On Sat, 2022-02-05 at 01:25 +0100, Pali Rohár wrote: > On Saturday 05 February 2022 01:01:28 Marcel Ziswiler wrote: > > Addendum. > > > > On Sat, 2022-02-05 at 00:43 +0100, Marcel Ziswiler wrote: > > > > > > > [snip] > > > > > > Kosta, do you see any problems with removing this script? As you might > > > > have seen, Pali and Marek did some great work on kwboot in the mean > > > > time. Is there anything left in mrvl_uart.sh that kwboot can't handle? > > > > > > Disclaimer: I am not really a Kirkwood developer or at least not yet > > > (;-p). > > > > > > Recently, we started playing with mainline U-Boot/Linux kernel as part of > > > an effort to port OpenWrt to > > > the > > > MikroTik RB5009UG [1]. It features an Armada 7040 which is a 64-bit Arm > > > SoC while kwboot mentions 32-bit > > > platforms only. Anyway, so far I was able to boot it using the good oldé > > > mrvl_uart.sh script as follows: > > > > > > ⬢[zim@toolbox ~]$ ~/u-boot/tools/mrvl_uart.sh /dev/ttyUSB3 ~/arm-trusted- > > > firmware/build/a70x0_rb5009/release/flash-image.bin > > > Using device connected on serial port "/dev/ttyUSB3" > > > Loading flash image file > > > "/var/home/zim/arm-trusted-firmware/build/a70x0_rb5009/release/flash-image.bin" > > > Recovery will run at 115200 baud > > > ======================================== > > > Press the "Reset" button on the target board and the "Enter" key on the > > > host keyboard simultaneously > > > Sending > > > /var/home/zim/Sources/arm-trusted-firmware.git/build/a70x0_rb5009/release/flash-image.bin, > > > 11377 > > > blocks: Give your local XMODEM receive command now. > > > Bytes Sent:1456384 BPS:7871 > > > > > > Transfer complete > > > > > > Trying this with kwboot instead I was not successful as of yet. Not sure > > > whether I am just missing > > > something > > > or > > > support for booting 64-bit platforms would yet need to be added. > > > > If I patch it as follows it actually starts transferring but does not > > really get too far. > > 64-bit Armada SoCs use different image format than 32-bit Armada SoCs. > This format is not supported by U-Boot as U-Boot does not even build > images for this format. You even cannot boot U-Boot directly on those > 64-bit Armada SoCs. It is TF-A what is booted and it is TF-A project > which generate images compatible for those SoCs.
Yes, we do know that. > So U-Boot does not have any support for those 64-bit images. Yes, U-Boot proper basically has to be combined with TF-A using some external tooling. > So you should use TF-A tools which generates these 64-bit Armada > bootable images. Exactly. > Probably you could use kwboot just for sending boot pattern and then > generic "sx" tool (which is used also by that shell script). And after > that kwboot again for terminal support. But this does not verify that > image is correct and also may have issues if header part contains > executable code which prints something to UART... > > $ kwboot -b /dev/ttyUSB0 Hm, at least kwboot from today's master does not allow -b without also giving it an image. > $ sx flash-image.bin 0<>/dev/ttyUSB0 1>&0 > $ kwboot -t /dev/ttyUSB0 Remember, it is not that we do not have a solution or do not know how this all works. It is rather that we currently use that mrvl_uart.sh script which this patch is about to remove and Stefan enquired about. Thanks, Pali. [snip]