Booting Ubuntu 24.04.03 from eth

Hi all,
I have a bit non standard situation but maybe somebody can help me.

I’m trying to boot my HiFive Premier p550 from network.

Right now I’ve faced with eth connection problem on initrd stage.
I can up eth link but busybox udhcpc can’t get data from DHCP server.
If I boot from sd card it works well.
And on uboot stage it can copy files from this DHCP server without any problems.

Will start at the beginning.

I’ve already made the same for other devices, so i want to say that my approach work well on other riscv devices.

In generaly i try to unpack initrd, add my code to /init and repack it back.

The first issue.
The latest HiFive Premier release Ubuntu 24.04.03 at 07.2025 provide initrd only with:
‘’’
/usr/lib/firmware
/usr/lib/modules
‘’’

Without /init /bin /sbin and other folders.
As understand its a new UKI format of initrd.
Unfortunately I couldn’t build a traditional initrd and i’ve just added files
/usr/klibc…
/ld-linux-riscv64-lp64d.so.1
/bin/ and /sbin/ with main files and busybox.

So, it seems I’ve made some workaround for this but if somebody advises the right way how to build a traditional initrd i would be really appreciated.

The second issue.
I’m booting the kernel by such way
‘’’

tftpboot ${kernel_addr_r} ${tpath}/vmlinuz-6.6.77-2-premier;
tftpboot ${fdt_addr_r} ${tpath}/efi_eic7700-hifive-premier-p550.dtb;
tftpboot ${ramdisk_addr_r} ${tpath}/initrd.img-6.6.77-2-premier;
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
‘’’
I’ve had success only with efi version of dtb efi_eic7700-hifive-premier-p550.dtb

Is it expected?

The last and the main issue with DHCP.

‘’’
// Bring up an ethernet device
modprobe gpio_dwapb stmmac pcs_xpcs phylink dwmac_eic7700
‘’’
Link becomes up but DHCP, that works in uboot stage, now doesn’t work.

‘’’
$ udhcpc -n --now --quit -i eth0 -t 5 -T 1 -A 1 -s /sbin/dhcp-script
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting discover
[ 4436.278884] eic7700-eth-dwmac 50400000.ethernet eth0: NETDEV WATCHDOG: CPU: 1: transmit queue 0 timed out 5748 ms
[ 4436.289280] eic7700-eth-dwmac 50400000.ethernet eth0: Reset adapter.
udhcpc: read error: Network is down, reopening socket
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: no lease, failing
[ 4445.390836] eic7700-eth-dwmac 50400000.ethernet eth0: NETDEV WATCHDOG: CPU: 3: transmit queue 0 timed out 5004 ms
[ 4445.401220] eic7700-eth-dwmac 50400000.ethernet eth0: Reset adapter.

[ 148.408518] dwmac4: Master AXI performs any burst length
[ 148.408527] eic7700-eth-dwmac 50400000.ethernet eth0: No Safety Features support found
[ 148.408534] eic7700-eth-dwmac 50400000.ethernet eth0: No MAC Management Counters available
[ 148.408539] eic7700-eth-dwmac 50400000.ethernet eth0: PTP not supported by HW
[ 148.408549] eic7700-eth-dwmac 50400000.ethernet eth0: configuring for phy/rgmii link mode
[ 152.504015] eic7700-eth-dwmac 50400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 157.518150] eic7700-eth-dwmac 50400000.ethernet eth0: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 5004 ms
[ 157.518193] eic7700-eth-dwmac 50400000.ethernet eth0: Reset adapter.
[ 157.518986] eic7700-eth-dwmac 50400000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 157.520499] eic7700-eth-dwmac 50400000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL)
[ 157.520510] dwmac4: Master AXI performs any burst length
‘’’

I can configure eth0 statically but it either can’t ping server.

How to fix such eth connection?

Sorry for many words but I couldn’t make it shorter.

This indicates issues with the kernel driver of eth. Are you using the right dtb file for your kernel? I wonder where is that efi_eic7700-hifive-premier-p550.dtb file coming from.

Yeah, I understand this, but don’t know how to handle it.

About your question.
I’ve tried two dtbs.
I’ve got it from the vendor Ubuntu 24.04.03 at 07.2025 image.

/boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb
md5sum for it
80657851da3850f4b27a329bd08a7a01

and efi dtb
/boot/efi/dtb/eswin/eic7700-hifive-premier-p550.dtb, sorry, iforget, I’ve renamed it to efi_eic7700-hifive-premier-p550.dtb
md5sum for it
daecf3f8a48077bb1965e327f00fd2d3

Additional info about these dtbs

file /boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb
/boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb: Device Tree Blob version 17, size=51988, boot CPU=0, string block size=2388, DT structure block size=49544

file /boot/efi/dtb/eswin/eic7700-hifive-premier-p550.dtb
/boot/efi/dtb/eswin/eic7700-hifive-premier-p550.dtb: Device Tree Blob version 17, size=145768, boot CPU=0, string block size=3936, DT structure block size=141776

When i use non efi dtb ( i mean this /boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb) i have a kernel panic.

Sorry for long log.

=> booti $kernel_addr_r $ramdisk_add_r:$filesize $fdt_addr_r
Moving Image from 0x84000000 to 0x80200000, end=8241b000
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
ERROR: reserving fdt memory region failed (addr=fffff000 size=1000 flags=4)
Using Device Tree in place at 0000000088000000, end 000000008800fb13
Working FDT set to 88000000

Starting kernel …

[ 0.000000] Linux version 6.6.77-2-premier (buildd@bos03-riscv64-022) (riscv64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #2 SMP PREEMPT_DYNAMIC Tue Jul 8 17:47:24 UTC 2025
[ 0.000000] Machine model: SiFive HiFive Premier P550
[ 0.000000] SBI specification v2.0 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x10004
[ 0.000000] SBI TIME extension detected
[ 0.000000] SBI IPI extension detected
[ 0.000000] SBI RFENCE extension detected
[ 0.000000] SBI SRST extension detected
[ 0.000000] SBI DBCN extension detected
[ 0.000000] earlycon: uart0 at MMIO32 0x0000000050900000 (options ‘115200n8’)
[ 0.000000] printk: bootconsole [uart0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000007fe0000000, size 512 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] OF: reserved mem: 0x0000007fe0000000..0x0000007fffffffff (524288 KiB) map reusable linux,cma
[ 0.000000] OF: reserved mem: 0x0000000020000000..0x000000003fffffff (524288 KiB) nomap non-reusable mmode_resv3@20000000
[ 0.000000] OF: reserved mem: 0x0000000059000000..0x00000000593fffff (4096 KiB) nomap non-reusable sprammemory@59000000
[ 0.000000] OF: reserved mem: 0x0000000080000000..0x000000008003ffff (256 KiB) nomap non-reusable mmode_resv1@80000000
[ 0.000000] OF: reserved mem: 0x0000000080040000..0x000000008005ffff (128 KiB) nomap non-reusable mmode_resv0@80040000
[ 0.000000] OF: reserved mem: 0x00000000a0000000..0x00000000a00fffff (1024 KiB) nomap non-reusable lpcpu@a0000000
[ 0.000000] OF: reserved mem: 0x00000000dfff0000..0x00000000dfffffff (64 KiB) nomap non-reusable lpcpures@dfff0000
[ 0.000000] OF: reserved mem: 0x00000000e0000000..0x00000000e0ffffff (16384 KiB) nomap non-reusable region@e0000000
[ 0.000000] OF: reserved mem: 0x00000000fffff000..0x00000000ffffffff (4 KiB) nomap non-reusable g2d_4GB_boundary_reserved_4k
[ 0.000000] OF: reserved mem: 0x0000001000000000..0x00000010003fffff (4096 KiB) nomap non-reusable mmode_resv2@10,0
[ 0.000000] Oops - store (or AMO) access fault [#1]
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.77-2-premier #2
[ 0.000000] Hardware name: SiFive HiFive Premier P550 (DT)
[ 0.000000] epc : __memset+0x60/0x100
[ 0.000000] ra : create_pgd_mapping+0x118/0x1c2
[ 0.000000] epc : ffffffff80c2df50 ra : ffffffff80e065a8 sp : ffffffff81c03d30
[ 0.000000] gp : ffffffff81d92288 tp : ffffffff81d95c40 t0 : ffff8d7ffebfd000
[ 0.000000] t1 : 0000000000000000 t2 : 7265736572203a46 s0 : ffffffff81c03d80
[ 0.000000] s1 : ffffaf8000060000 a0 : ffff8d7ffebfd000 a1 : 0000000000000000
[ 0.000000] a2 : 0000000000001000 a3 : ffff8d7ffebfe000 a4 : 0000000000000000
[ 0.000000] a5 : ffff8d7ffebfd000 a6 : 0000000000000000 a7 : 0000000000000000
[ 0.000000] s2 : 0000000080060000 s3 : 0000000000001000 s4 : 00000000000000e7
[ 0.000000] s5 : ffffffff81d91a8c s6 : 0000007fdfdff000 s7 : ffffffff820a5af8
[ 0.000000] s8 : ffffffff81002000 s9 : 0000000000000000 s10: 00000000ed54d410
[ 0.000000] s11: 0000000000000000 t3 : ffffffff81009a58 t4 : ffffffff81009a58
[ 0.000000] t5 : ffffffff81009a58 t6 : ffffffff81009a70
[ 0.000000] status: 0000000200000100 badaddr: ffff8d7ffebfd000 cause: 0000000000000007
[ 0.000000] [] __memset+0x60/0x100
[ 0.000000] [] create_linear_mapping_range+0xb6/0xd8
[ 0.000000] [] create_linear_mapping_page_table+0x26c/0x2bc
[ 0.000000] [] setup_vm_final+0xde/0x1e8
[ 0.000000] [] paging_init+0x18/0x28
[ 0.000000] [] setup_arch+0xd2/0x14e
[ 0.000000] [] start_kernel+0x88/0x6f0
[ 0.000000] Code: 1007 82b3 40e2 0797 0000 8793 00e7 8305 97ba 8782 (b023) 00b2
[ 0.000000] —[ end trace 0000000000000000 ]—
[ 0.000000] Kernel panic - not syncing: Fatal exception in interrupt
[ 0.000000] —[ end Kernel panic - not syncing: Fatal exception in interrupt ]—

But if i use efi dtb (/boot/efi/dtb/eswin/eic7700-hifive-premier-p550.dtb) i mostly don’t have unresolved problems in kernel bring up stage. Only with eth device.

And additionally i use such bootarg.
So many gpu directives to resolve problems with gpu bring up.

setenv bootargs ‘console=ttyS0,115200 earlycon cma=256M rdinit=/init drm_kms_helper.poll=0 drm.vblankoffdelay=0 module_blacklist=panfrost,lima,panthor,drm,drm_kms_helper,rockchip_drm nomodeset sifive.gpu.disable=1 efi=debug earlycon=sbi clk_ignore_unused stmmaceth.debug=3 stmmaceth.chain_mode=1 phydev.link=1 stmmaceth.debug=6 stmmaceth.chain_mode=1 phy.ignore_interrupts=1 phy.reset_delay_ms=100 stmmaceth.clk_csr=3 stmmaceth.phy_addr=0’;

You actually want to use /boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb, because it’s shipped together with the kernel. I have no idea where that efi_eic7700-hifive-premier-p550.dtb comes from, so I’d stay away from it. Currently the U-boot/kernel patches from ESWIN are quite messy, until they can upstream and clean up everything. Thus, using the exact device-tree shipped with that specific kernel is crucial, as the kernel device-tree can fluctuate a lot from version to version during ESWIN’s development. (Consider everything not stabilized yet) I tried tftp workflow on my board, and I couldn’t even get the kernel to boot, and U-boot actually crashed if I do it without initrd. However, after upgrading the bootloader, especially U-boot, tftp workflow just works! You can upgrade to this version:

Flash the bootloader_P550.bin using the instructions here:

https://www.sifive.com/document-file/hifive-premier-p550-image-update-procedure

Also, I’d advise you remove all those custom kernel command line arguments regarding stmmaceth and phy, to make sure they are not interfering with the vendor driver code.

1 Like

Great.
Thanks a lot

Will try and return with results.

Thanks for the great advice!!!

Now a standard dtb (/boot/dtbs/6.6.77-2-premier/eswin/eic7700-hifive-premier-p550.dtb) has been loaded and without any problem.

And ideally to understand how it was possible. Maybe you have any suggestions?

So, i had a boot from sd and it works well.
I’ve tried to repeat the same, got these files from tftp and on my previous uboot it has a kernel panic.

Now I’ve installed a new uboot (bootloader_P550.bin provided by you) and the same dtb + the same kernel works well for sd booting and net booting.
I’ve just interesting how it can be possible? Any ideas ?

And the last thing. if we resolve it I’ll be fully satisfied.

Do you know how to force ubuntu to make a standard initrd with /etc /bin etc instead of a new UKI format only with /usr/lib?
I’ve tried to find something but it doesn’t work and it build initrd only in UKI format.

It’s quite possible that the bootchain/u-boot from the ESWIN’s repo is from a newer u-boot source tree that contains many bug fixes missing from Sifive’s bootchain release. I’m not surprised.

I’m not sure what’s the UKI format you are referring to. The reason you only see a initrd with /usr/lib, or specifically /usr/lib/{firmware|modules} is because the initrd file is a concatenation of 2 cpio’s. The first one is uncompressed, containing only essential firmware+modules, aka. earlycpio. The second one is the traditional initrd you are looking for. This becomes clearer if you try unmkinitramfs /boot/initrd.img-6.6.21-7-premier <extracted> Then you’ll see two directories, early and main. Hack it, repack, and concatenate to produce the new initrd. I’m not so sure if the first cpio has to be uncompressed or not, but you can give it a try.

1 Like

Now im fully satisfied.
I didn’t know about unmkinitramfs.
I’ve just unpack it like a cpio archive.

I think this topic now is fully resolved.
Thanks a lot.