kwboot: Marvell Dove UART booting
Pali Rohár
pali at kernel.org
Mon Mar 20 22:06:08 CET 2023
On Monday 20 March 2023 13:48:35 Tony Dinh wrote:
> Hi Pali,
>
> On Mon, Mar 20, 2023 at 1:33 PM Pali Rohár <pali at kernel.org> wrote:
> >
> > Hello! After longer time I have something new in this area.
> >
> > On Wednesday 16 February 2022 20:18:31 Tony Dinh wrote:
> > > Hi Pali,
> > >
> > > Please see below.
> > >
> > > On Tue, Feb 15, 2022 at 3:02 PM Pali Rohár <pali at kernel.org> wrote:
> > > >
> > > > Hello!
> > > >
> > > > On Wednesday 22 December 2021 20:08:56 Tony Dinh wrote:
> > > > > *** With jumper inserted, serial console connected, start serial console
> > > > >
> > > > > # picocom --b 115200 --f n --p n --d 8 /dev/ttyUSB0
> > > > > Terminal ready
> > > > >
> > > > > *** Hit <Enter> here to get to the prompt and execute "x 0x0E"
> > > > >
> > > > > Bootstrap 2.33>
> > > > > Bootstrap 2.33>x 0x0E
> > > > >
> > > > > *** No more input possible here, so Control-A-X to exit serial console
> > > > >
> > > > > Terminating...
> > > > > Thanks for using picocom
> > > > >
> > > > > *** Run kwboot
> > > > >
> > > > > # kwboot -t -p -B 115200 /dev/ttyUSB0 -D /localdisk/mtd0.t5335z
> > > > > Patching image boot signature to UART
> > > > > Aligning image header to Xmodem block size
> > > > > Waiting 2s and flushing tty
> > > > > Sending boot image header (512 bytes)...
> > > > > 25 % [.... ]
> > > > > Done
> > > > > Sending boot image data (607664 bytes)...
> > > > > 0 % [......................................................................]
> > > > > 1 % [......................................................................]
> > > > > 2 % [......................................................................]
> > > > > <snip>
> > > > > 95 % [......................................................................]
> > > > > 97 % [......................................................................]
> > > > > 98 % [.......................................................... ]
> > > > > Done
> > > > > Finishing transfer
> > > > > [Type Ctrl-\ + c to quit]
> > > > >
> > > > > *** Hung here! BootROM did not execute the image payload.
> > > >
> > > > I found this github repository https://github.com/rabeeh/u-boot with
> > > > Dove version of U-Boot. In its README file is section about UART:
> > > > https://github.com/rabeeh/u-boot/blob/master/README.MARVELL#L131-L138
> > > > It points to the file with "w" commands which needs to be executed in
> > > > bootrom prior doing calling "x" command (which enters into x-modem):
> > > > https://github.com/rabeeh/u-boot/blob/master/tools/doimage_dove/uart_init.txt
> > > >
> > > > Could you try to execute all those "w" commands in that other and then
> > > > use kwboot if it helps?
> > >
> > > Unfortunately, it did not help. I ran the same procedure. Connected
> > > the HP t5335z jumper to get to the BootROM debug prompt, and executed
> > > the "w" commands. And then "x e" to enter UART booting mode. And then
> > > execute kwboot. Here is the log.
> > >
> > > <BEGIN log>
> > >
> > > Bootstrap 2.33>w D00D0210 00000050
> > > >w D00D802C 01010000
> > > >w D00D802C 00010000
> > > >w d0800E40 00000100
> > > >w d0800E50 00120012
> > > >w d0800E40 00000101
> > > >w d0800E50 000d000d
> > > >w d0800E40 00000102
> > > >w d0800E50 000a000a
> > > >w d0800E40 00000103
> > > >w d0800E50 00080008
> > > >w d0800E40 00000200
> > > >w d0800E50 00120012
> > > >w d0800E40 00000201
> > > >w d0800E50 000d000d
> > > >w d0800E40 00000202
> > > >w d0800E50 000a000a
> > > >w d0800E40 00000203
> > > >w d0800E50 00080008
> > >
> > > >x e
> > >
> > > Terminating...
> > > Thanks for using picocom
> > >
> > > ./kwboot-2022/kwboot -t -B 115200 /dev/ttyUSB0 -D mtd0.t5335z
> > > kwboot version 2022.04-rc2-00001-gab8903a24d-dirty
> > > Patching image boot signature to UART
> > > Sending boot image header (3072 bytes)...
> > > 4 % [........................ ]
> > > Done
> > > Sending boot image data (605104 bytes)...
> > > 0 % [......................................................................]
> > > 1 % [......................................................................]
> > > <snip>
> > > 97 % [......................................................................]
> > > 99 % [...................................... ]
> > > Done
> > > Finishing transfer
> > > [Type Ctrl-\ + c to quit]
> > >
> > > <END log>
> > >
> > > Thanks,
> > > Tony
> >
> > I looked at the mentioned rabeeh/u-boot repository again and there are
> > two important bits of informations:
> >
> > 1) https://github.com/rabeeh/u-boot/blob/master/README.MARVELL#L136
> > README.MARVELL says that for UART booting should be used file named
> > with _uart.
> >
> > 2) https://github.com/rabeeh/u-boot/blob/master/Makefile#L313
> > Build rules for _uart file and normal file are different. For example
> > UART file has different doimage DDR input file (-R) and is _without_
> > doimage binary file (-B option). But it has _same_ main u-boot binary
> > u-boot.bin
> >
> > So I think that for converting Dove SPI image to UART image are more
> > steps needed. And I think you could do it by first unpacking all
> > kwbimage parts via u-boot's tools/dumpimage tool and then packing all
> > required parts via Marvell doimage tool from that rabeeh/u-boot github
> > repository.
> >
> > Are you going to try it?
>
> Thanks for the info. It sounds promising.
>
> I wanted to compile a UART version for stock HP T5335z u-boot to see
> if it will boot with kwboot. But I did not have time to revisit this
> topic and kind of forgot about it.
>
> The GPL source README said the build requires an old Marvell
> toolchain. The old link is broken, and I could not find it at Marvell
> GitHub. Do you have any idea where I can find this specific toolchain
> arm-marvell-linux-gnueabi.tar.bz2 version 4.4.5 or newer?
>
> Thanks,
> Tony
No idea where is that old Marvell toolchain. But I think you do not have
to use Marvell toolchain, I think that gcc-based for ARM should be fine.
Possible problem may be that old U-Boot is not able to compile with
modern gcc versions. So in case of issues, take gcc 4. For example
download Live CD of some Ubuntu from year 2008 and compile old U-Boot in
this old Ubuntu with its old gcc.
More information about the U-Boot
mailing list