Added Simon to the discussion.
On Wed, Feb 1, 2023 at 1:13 PM Tony Dinh <mibo...@gmail.com> wrote: > > Hi all, > > On Wed, Feb 1, 2023 at 11:05 AM Pali Rohár <p...@kernel.org> wrote: > > > > On Wednesday 01 February 2023 09:17:15 Michael Walle wrote: > > > > > > When DM_SERIAL is enabled, the device-tree property dm-pre-reloc is > > > > > > required to boot over UART with kwboot. Enable this in a Kirkwood > > > > > > common u-boot dtsi. > > > > > > > > > > My (dev) board unfortunately, have a bootloader which can't boot over > > > > > serial. > > > > > > > > This is feature of Marvell BootROM and does not require any special from > > > > Bootloader. So you should be able to boot over UART (if you have > > > > accessible pins). > > > > > > I know, but there are known versions ob the bootrom where uart boot > > > isn't supported (correctly). > > > > I heard about it... maybe it is a bug in client software (kwboot)? I do > > not have such board if you are interested in it I could try to send some > > details how to debug it. > > The Kirkwood SoCs came with different BootROM versions. Version 1.1 > cannot be booted over UART, but version 1.2 can. I think there must > be a bug in the BootROM 1.1. The older Kirkwood such as Sheevaplug, > Dockstar, iConnect boards come with BootROM 1.1. Later version of > Sheevaplug, GoFlex Home, GoFlex Net, Dreamplug, Pogoplug V4, Zyxel > NSA310S, NSA320, NSA325 come with BootROM 1.2. So even though it is > the same SoC, eg. 6281, they are actually produced at a different time > and have different BootROM versions. > > When I test new u-boot images for boards such as Dockstar or iConnect, > I run kwboot with the GoFlex Home/Net. And they boot fine to a point > that allows me to see that the image is good enough. So in the > development phase, most if not all Kirkwood u-boot images can be > booted over UART. Some with real boards, some with surrogates. > > > > I also have another board which can boot > > > over uart. But thats in daily use ;) > > > > > > > > Could you elaborate that a bit more? Why is this required for > > > > > uart boot? kwboot will talk with the bootrom why does u-boot need > > > > > anything? Or will there just be no output until the uart is > > > > > initialized? > > > > > > > > On mvebu/armada boards this dm-pre-reloc is required to ensure that DT > > > > nodes are present in SPL DTB file. Otherwise build process drop all > > > > non-pre-realoc nodes from SPL version of DTB file. And because SPL use > > > > DM serial, it is required to have uart DT nodes in DTB file. Btw, same > > > > problem is with SPI in SPL. > > > > > > > > But... kirkwood does not use SPL, so I do not know what is reason for > > > > this here. > > > > > > Yes thats what puzzled me, too. > > When u-boot,dm-pre-reloc is not specified in the uart0 DTS node, after > the image was transferred by kwboot, the serial console is silent and > the board is frozen. > > If I understand correctly, it is because before u-boot relocation, if > DM serial is enabled, the serial uclass is present, but it has not > been initialized (I think it is created but not "bind(?)" ). The > dm-preloc property works because it explicitly tells DM to fully > initialize the uclass before relocation. That was just my observation > about DM in general, devices do not get fully initialized until the > first use. So I tried the u-boot,dm-pre-reloc and it works. If my > assumption is incorrect, perhaps somebody can look at the serial > uclass and see if there is a different type of issue there. > > Thanks, > Tony > > > > > > > > > > > > > > > > Signed-off-by: Tony Dinh <mibo...@gmail.com> > > > > > > --- > > > > > > > > > > > > arch/arm/dts/kirkwood-u-boot.dtsi | 7 +++++++ > > > > > > 1 file changed, 7 insertions(+) > > > > > > create mode 100644 arch/arm/dts/kirkwood-u-boot.dtsi > > > > > > > > > > Is this new? AFAIK only <boardname>-u-boot.dtsi is included > > > > > automatically. > > > > > > > > It is not new, Tom wrote about it quite ago: > > > > https://lore.kernel.org/u-boot/20220802121113.GG1146598@bill-the-cat/ > > > > > > Thats relatively new for someone not following the u-boot > > > development that closely ;) Thanks for the pointer. > > > > > > -michael > > >