Network driver failure (clock issue?)

Hi,
I went through the instructions to build my own boot image using buildroot.
That was fairly straightforward – I was somewhat surprised that I ended up building somewhat ancient software (gcc-7.2, kernel 4.15-rc6, …), but that is probably what was working well enough a year ago …
However, I ran into (at least) one problem:
Unlike with the original image, the Cadence network adapter does not seem to work.
Specifically I see in the kernel messages:
[ 0.420000] macb 10090000.ethernet: failed to get macb_clk (4294966779)
and I also wonder whether there is a more generic problem detecting clocks
[ 0.370000] of_fixed_factor_clk: probe of soc:tlclk failed with error -12

I had networking working with the original image actually, though I have carelessly overwritten it meanwhile :open_mouth:

The software on the v1_0 branch of freedom-u-sdk is about 2 years old, and isn’t recommended. There is an archive/buildroot branch that has more recent sources, it was deprecated only a couple of months ago when we switched to open-embedded. This branch has a machine mode u-boot with more recent kernel, buildroot, compilers, etc. This requires flipping switches on the board though, see the README.md file if you want to try it. It also has a debian rootfs you can boot into if you change the u-boot config to switch from the buildroot initramfs to the debian rootfs. The debian rootfs is about 12-18 months old, but you should be able to update it with yum. We aren’t actively supporting or developing this anymore though. Long term, the best solution is to use one of the supported linux distros, e.g;. open-embedded, fedora, debian, opensuse… These are all using a supervisor mode u-boot with OpenSBI, and recent kernels and compilers. Open-embedded is what we are supporting for now to replace freedom-u-sdk. The current freedom-u-sdk README.md file now points you at our open-embedded layer… There is also a open-embedded image on our web site.

If you really want the original useless boot image back you can find it in https://old-www.sifive.com/products/hifive-unleashed/ but ignore the firmware file that you don’t need and just dd the .bin file to a SDcard and boot it.

If I haven’t answered your question, you need to be more specific about what exactly you did.

Hi Jim,
Very much appreciate your response!
I was indeed very surprised to look at so ancient code …
Will start with the newer archive/buildroot branch (just because that is very quick for me to do) before looking into open-embedded. Is there a pointer for how to get started with OE for RISCV/SiFive?
I’ll also ping some colleagues on openSUSE on it as welll …
– Kurt

The current freedom-u-sdk is a README.md file that explains how to build our open embedded layer.

I know that opensuse is building images, but I don’t know if they have any support to run on the HiFive Unleashed. If you get u-boot running on the board though, you can probably boot into an opensuse rootfs.

Archive/buildroot with the Deb demo image (apt-get upgrade d to latest) works fine, thanks.
Observations:

  • Ethernet runs at 100Mbps instead of 1000.
  • SD card (mmc/spi2) is very slow: 2MB/s read, 1MB/s write.
    Will look into OE next.

The SDcard is slow yes. Use NFS, NBD, or other network protocol for storage as that will likely be faster. It should be possible to run ethernet at 1Gb. That may depend on the linux kernel version though.