Hi,

On 01/01/2014 01:40 PM, Tim Fletcher wrote:
On 01/01/14 06:50, Ma Haijun wrote:
The only difference is below, and Tim Fletcher's is the larger one
$ diff *.dts
587a588
            ts-attached = <0x0>;
Seem the problem is that there is no enough reserved space to add the
required nodes.

After some investigation, I've found a bug in the u-boot's PSCI code. Since
this feature is introduced by  Marc Zyngier, I add him to the cc list.

Currently, PSCI's fdt node is added in bootm's go subcommand by
armv7_update_dt, but I think the proper place is the prep command.
There are 2 reasons for my proposed change.
1. It is not compatible with falcon's spl command, which expect everything
is ready at prep stage, this may be not a big issue, because falcon boot
mode  is not enabled on sunxi7i boards, and the PSCI patch currently does
not take falcon mode into consideration anyway.
2. It cannot reliably add the nodes as in Tim Fletcher's case.

Currently, u-boot basically does these things to setup fdt:
boot_relocate_fdt reserves CONFIG_SYS_FDT_PAD extra bytes, which should be
enough for all fdt changes.
image_setup_libfdt  do the necessary changes, and call fdt_resize to shrink
to  its actual size plus some bytes for its internal use, plus paddings to
page boundary.
Then armv7_update_dt calls fdt_resize again (??), add add PSCI nodes to the
tree.
That means armv7_update_dt works by chance: if there is not enough padding,
it will fail.

I think armv7_update_dt should be invoked in image_setup_libfdt. There are
already some arch/board specific hooks in it, namely arch_fixup_memory_node
and ft_board_setup, maybe we can add another one, or just use one of them.
And the fdt_resize call in armv7_update_dt should be removed.

Thanks for looking into this, means I'm not going totally mad :)

Just as another data point I have done a full rebuild from a fresh checkout of 
Hans's latest github tree and I have the same -38 error.

Bummer, fwiw attached is my uboot env (uEnv-full.txt) + boot.cmd (built into 
boot.scr)
I use to boot.

I also have a uEnv.txt on my sdcard, this is included in uEnv-boot.txt

Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
env set fdt_high ffffffff
ext2load mmc 0 0x46000000 uImage.new
ext2load mmc 0 0x49000000 dtb
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p3 ro rootwait loglevel=5
bootm 0x46000000 - 0x49000000
baudrate=115200
console=ttyS0,115200
bootdelay=1
bootenv=uEnv.txt
bootscr=boot.scr
kernel=uImage
loglevel=8
panicarg=panic=10
root=/dev/mmcblk0p3 rootwait
scriptaddr=0x44000000
loadbootenv=ext2load mmc 0 $scriptaddr ${bootenv}
loadbootscr=ext2load mmc 0 $scriptaddr ${bootscr}
setargs=setenv bootargs console=${console} root=${root} loglevel=${loglevel} 
${panicarg} ${extraargs}
boot_mmc=ext2load mmc 0 0x43000000 script.bin && ext2load mmc 0 0x48000000 
${kernel} && watchdog 0 && bootm 0x48000000
bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv}; env 
import -t ${scriptaddr} ${filesize}; fi; if test -n ${uenvcmd}; then echo 
Running uenvcmd ...; run uenvcmd; fi; if run loadbootscr; then echo Jumping to 
${bootscr}; source ${scriptaddr}; fi; run setargs boot_mmc;
console=tty0
loglevel=5
root=/dev/mmcblk0p3 ro rootwait rootfstype=ext4
extraargs=console=ttyS0,115200 disp.screen0_output_mode=EDID:1280x720p60 
hdmi.audio=EDID:0 sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 
sunxi_fb_mem_reserve=20 sunxi_no_mali_mem_reserve

Reply via email to