[PATCH] tools/mrvl_uart.sh: Remove script

Tony Dinh mibodhi at gmail.com
Mon Feb 7 09:19:43 CET 2022


Most Kirwood boards work with the current kwboot. And those boards
have the BootROM version 1.2.1.

For a few that don't, mrvl_uart.sh does not work either. And that is
due to the defect in the BootROM version 1.1.1.

Thanks!

Reviewed-by: Tony Dinh <mibodhi at gmail.com>

On Sun, Feb 6, 2022 at 11:27 PM Marcel Ziswiler <marcel at ziswiler.com> wrote:
>
> On Sun, 2022-02-06 at 10:03 +0100, Stefan Roese wrote:
> > On 2/5/22 01:54, Pali Rohár wrote:
> > > On Saturday 05 February 2022 01:40:23 Marcel Ziswiler wrote:
> > > > 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 at 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.
> > >
> > > This commit is part of master branch and added support for it:
> > > https://source.denx.de/u-boot/u-boot/-/commit/c513fe47dca24de87a904ce7d71cfd8a390e1154
> > >
> > > If it does not work then there is some bug which should be fixed. I have
> > > tested it and it works on my setup.
> > >
> > > Can you check if you have that commit to ensure that we are not going to
> > > test / debug older version?
> > >
> > > > > $ 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.
> > >
> > > I see...
> > >
> > > But I do not know what is the best option for now. If issue with -b is
> > > investigated / fixed then that script can be replaced by two (or three)
> > > commands. And I think it is better than maintaining two different tools
> > > in U-Boot which do same thing. On the other hand kwboot does not support
> > > 64-bit Armada format, which mrvl_uart.sh can handle (but only because it
> > > does not do any verification nor does not understand image format), so
> > > for this purpose it is better. But because U-Boot does not support
> > > 64-bit Armada image format, I do not know if this script should be in
> > > U-Boot because whole image building is outside of U-Boot responsibility
> > > and... probably this tool should be part of TF-A project instead. So at
> > > the end, should be this tool maintained in U-Boot project at all if
> > > U-Boot itself does not support nor provide tooling for 64-bit Armada
> > > images?
> > >
> > > Any opinion?
> >
> > Frankly, as long as mrvl_uart.sh has features that kwboot does not
> > support, I'm reluctant to completely remove it.
>
> Once "standalone" usage is fixed and properly documented I do recall my objection and am completely fine with
> removing tools/mrvl_uart.sh. Thanks!
>
> > Thanks,
> > Stefan


More information about the U-Boot mailing list