make reserved-memory work on mips, and improve test

This commit is contained in:
Daniel Barlow 2023-12-21 22:21:20 +00:00
parent dbb82339bd
commit 231c2cef03
2 changed files with 17 additions and 5 deletions

View file

@ -80,11 +80,15 @@ in {
mkdir $out
cat ${o.dtb} > $out/dtb
fdtput -p $out/dtb /reserved-memory '#address-cells' 2
fdtput -p $out/dtb /reserved-memory '#size-cells' 2
address_cells=$(fdtget $out/dtb / '#address-cells')
size_cells=$(fdtget $out/dtb / '#size-cells')
if [ address_cells -gt 1 ]; then ac_prefix=0; fi
if [ size_cells -gt 1 ]; then sz_prefix=0; fi
fdtput -p $out/dtb /reserved-memory '#address-cells' $address_cells
fdtput -p $out/dtb /reserved-memory '#size-cells' $size_cells
fdtput -p $out/dtb /reserved-memory ranges
fdtput -p -t s $out/dtb /reserved-memory/phram-rootfs@$rootfsStart compatible phram
fdtput -p -t lx $out/dtb /reserved-memory/phram-rootfs@$rootfsStart reg 0 0x$rootfsStart 0 $(printf %x $rootfsBytes)
fdtput -p -t s $out/dtb /reserved-memory/phram-rootfs@$rootfsStart compatible phram
fdtput -p -t lx $out/dtb /reserved-memory/phram-rootfs@$rootfsStart reg $ac_prefix 0x$rootfsStart $sz_prefix $(printf %x $rootfsBytes)
# dtc -I dtb -O dts -o /dev/stdout $out/dtb; exit 1
dtbBytes=$(($(stat -L -c %s $out/dtb) + 0x1000 &(~0xfff)))