Topic: uboot tftp

Hi,

I'm helping Jonathan Gray try to get OpenBSD running on Novena, and noticed that tftpboot is pretty unreliable - it gets frequent network timeouts and will often exceed u-boot's failure counter and attempt the download again.

I'm pretty sure it's not autoneg getting the duplex wrong, and dropping the peer to 100baseTX or 10baseT doesn't seem to help either. Any clues?

Also, is it possible to increase the grace period to hit ^c to get to the uboot menu? It's pretty short to go from the two-finger user+reset press to the keyboard in time. I guess I need to rebuild u-boot.img - are the instructions at http://www.kosagi.com/w/index.php?title … _PVT_Notes still up to date? It looks like recent u-boot commits have been in a different repository (/xobs/u-boot-novena)

-d

Re: uboot tftp

Actually, 10baseT half-duplex works acceptably as a workaround. It probably is autoneg-related

Re: uboot tftp

If you're bringing up OpenBSD, you might want to use the newer U-Boot, available at https://github.com/xobs/u-boot-novena

I'll need to remember to update that page.  But basically, we now use SPL, which is a two-stage U-Boot.  Stage 1, which comes from the file named "SPL", goes at 1024 bytes from the start of the card.  Stage 2, which is probably what you're interested in mucking about with, goes on the FAT partition.

To increase the time (or get rid of the Ctrl-C thing entirely), modify include/configs/novena.h and then rebuild (just type "make").  Then replace the file on the FAT partition.  I can't recall if it's u-boot.img or u-boot.bin.

Re: uboot tftp

Thanks - I'll try the new bootloader. Are the instructions the same? Anything special that needs to happen to upgrade from the old one?

Re: uboot tftp

I updated the wiki page to reflect the current state of things.  Things haven't changed too much, but I wrote about SPL now, and included instructions on how to deploy.

One thing to note: As of right now, U-Boot cannot boot older kernels.  I need to have it put PCIe into reset before jumping to Linux.  I'll fix that today.

Re: uboot tftp

By "older kernels" do you mean the one that's installed by default?

Re: uboot tftp

Yes, sorry.  All relative.

I think what's going on is that the latest U-Boot supports PCIe, but leaves it in an inconsistent state.  I'll remove PCIe support from U-Boot for now.

Re: uboot tftp

Oh, and tftpboot is still flaky. It works if I let Linux boot first and then reboot, so I guess it's missing some MII magic

Re: uboot tftp

I just pushed some patches to github that fix booting.  I also added a patch that might fix Ethernet, though I can't test it right now.

Could you give the new commit a shot?  It should be on the branch "novena-r2", commit 9ca708b134496815579dcbba2be1607d8a2f556f

10 (edited by Damien Miller 2015-04-02 20:20:13)

Re: uboot tftp

No, that seems to have busted Ethernet entirely. It seems to think it it is up, but nothing sent appears on the wire.

Reverting 9ca708b134496815579dcbba2be1607d8a2f556f doesn't make any difference - the NIC status light don't come on either.

BTW, do I need to install either the SPL or spl/u-boot.spl.bin files to /boot/u-boot.spl?

Re: uboot tftp

No, SPL is mostly fixed.  It has a very simple scope -- it really only needs to get RAM working, and it already does that.  The only change anyone would need to make to SPL would be to add SATA support.

I wonder if it's just a GPIO that didn't get set properly...

Re: uboot tftp

I finally found some time to work on this. It turns out that I did need to update the SPL. BTW it seems that novena-install-spl isn't included as part of the .deb, but I found it in the repository.

With the SPL updated and the u-boot.img built from the tip of novena-r2, ethernet is back to working, but is still a bit flaky.

It seems that the flakiness manifests if Linux has booted and the novena has been reset, so I expect it's not being cleanly initialised. A simple workaround is to remove the power for a little while if Linux has booted.

"mii dump" shows no difference between a failing and working ethernet unfortunately sad

Re: uboot tftp

Hi Damien,

Please check in Novena's board config file for an option called

#define CONFIG_TFTP_BLOCKSIZE 4096

Either remove it (to use the default value), or change it to 1468.

U-Boot's tftp code is somewhat flaky and OpenBSD's tftp server doesn't like that at all (printing obscure messages). Please share if this fixed the issue for you.

Regards.