Odroid M2 - how to boot this board?

This is for ARMv8 based devices

Odroid M2 - how to boot this board?

Postby nmset » Thu Jan 09, 2025 9:32 pm

Hello,

I'm requesting help to get ARCH running on the Odroid M2 board.

The device works well with the stock Ubuntu distribution which is not my preferred one.

I have done the following steps:

1. Deactivate booting from eMMC by simply moving the files in the boot partition to a backup directory after mounting it as a USB mass storage.

2. Copy the first 3 MB of the boot partition to an SD card, making it bootable with the SPL and uboot.

3. Create a boot partition and a root partition on the SD card.

4. Copy the Image kernel and initramfs-linux.image files from Arch's linux-aaarch64 package, version 6.12.1-2-aarch64-ARCH, on the boot partition.

5. Copy an rk3588s-odroid-m2.dtb file on the boot partition, than can come from 2 sources.

6. Create a boot.scr file as below.

[quote]
setenv bootargs "${bootargs} console=tty1 console=ttyS2,1500000 root=LABEL=SDROOT rw rootwait=5 pci=nomsi net.ifnames=0"

setenv fdtfile "/rk3588s-odroid-m2.dtb"

if test -n "${console}"; then
setenv bootargs "${bootargs} console=${console}"
fi

if test -n "${default_console}"; then
setenv bootargs "${bootargs} console=${default_console}"
fi

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
[/quote]
The result is always bad.

If rk3588s-odroid-m2.dtb comes from linux-aarch64-6.12.1-2 package, the screen never lights up and multiple lights blink on the board.

If rk3588s-odroid-m2.dtb comes from Ubuntu, the screen lights up with a bar at the top, then becomes black after about 15s, and lights stop blinking on the board.

Multiple trial-and-error configurations of boot.scr, file layout and more did not help.

I'm requesting help from people more knowledgeable here, the uboot thing is quite foreign to me.

Thank you for any input.
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Fri Jan 10, 2025 10:29 pm

Using the 6.12.1-2-aarch64-ARCH kernel, its initramfs and its FDT file, the board boots but with a black screen.

Typing blindly 'root/root' to login, then 'systemctl poweroff', it does shutdown.

So there is a running system, with a flashing blue light and a flashing orange ethernet light. The device is not visible on the LAN unfortunately.
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sat Jan 11, 2025 9:25 pm

There is progress with 6.13.0-rc3-1-aarch64-rc-ARCH and its FDT file.

The screen gets backlight at the very last moment, showing the login prompt fully functional. Boot messages are not printed before.

But network connection fails on the ethernet port, with a blinking orange light. It does work with Ubuntu. There is no IPv4 set at all and no route. An IPv6 link local address is always set, with a default route on that address. After a few minutes, a routable IPv6 address appears, but the default route is not updated and any pîng fails. Setting a default route to the IPv6 gateway does not help.

Moreover, the MAC address changes on every boot. It can be set to a fixed address in the boot.scr file with 'setenv ethaddr <address>'. With Ubuntu, the MAC address does not change on every boot, without the setenv instruction.

Finally, using an USB ethernet adapter allows a network IPv4 and IPv6 connection to be established seamlessly on boot. Another ethernet USB adapter combining an USB hub failed to work.

All this with systemd-networkd and DHCP. netctl did not help.

The board is not reliably usable at this stage.

In the hope that some Arch developers might consider.

Here is some information from inside:

[quote]# --------------------------- uname -a -----------------------------------------
Linux alarm 6.13.0-rc3-1-aarch64-rc-ARCH #1 SMP PREEMPT_DYNAMIC Mon Dec 16 04:27:13 MST 2024 aarch64 GNU/Linux

# --------------------------- dmesg |grep -i eth -------------------------------
[ 6.225041] rk_gmac-dwmac fe1c0000.ethernet: IRQ eth_lpi not found
[ 6.225588] rk_gmac-dwmac fe1c0000.ethernet: IRQ sfty not found
[ 6.226224] rk_gmac-dwmac fe1c0000.ethernet: clock input or output? (output).
[ 6.226850] rk_gmac-dwmac fe1c0000.ethernet: Can not read property: tx_delay.
[ 6.227472] rk_gmac-dwmac fe1c0000.ethernet: set tx_delay to 0x30
[ 6.228002] rk_gmac-dwmac fe1c0000.ethernet: Can not read property: rx_delay.
[ 6.228625] rk_gmac-dwmac fe1c0000.ethernet: set rx_delay to 0x10
[ 6.229158] rk_gmac-dwmac fe1c0000.ethernet: integrated PHY? (no).
[ 6.234706] rk_gmac-dwmac fe1c0000.ethernet: init for RGMII_ID
[ 6.235314] rk_gmac-dwmac fe1c0000.ethernet: User ID: 0x30, Synopsys ID: 0x51
[ 6.235941] rk_gmac-dwmac fe1c0000.ethernet: DWMAC4/5
[ 6.236389] rk_gmac-dwmac fe1c0000.ethernet: DMA HW capability register supported
[ 6.237043] rk_gmac-dwmac fe1c0000.ethernet: RX Checksum Offload Engine supported
[ 6.237695] rk_gmac-dwmac fe1c0000.ethernet: TX Checksum insertion supported
[ 6.238307] rk_gmac-dwmac fe1c0000.ethernet: Wake-Up On Lan supported
[ 6.238889] rk_gmac-dwmac fe1c0000.ethernet: TSO supported
[ 6.239367] rk_gmac-dwmac fe1c0000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 6.240066] rk_gmac-dwmac fe1c0000.ethernet: Enabled L3L4 Flow TC (entries=2)
[ 6.241866] rk_gmac-dwmac fe1c0000.ethernet: Enabled RFS Flow TC (entries=10)
[ 6.242487] rk_gmac-dwmac fe1c0000.ethernet: TSO feature enabled
[ 6.242489] rk_gmac-dwmac fe1c0000.ethernet: SPH feature enabled
[ 6.242491] rk_gmac-dwmac fe1c0000.ethernet: Using 32/32 bits DMA host/device width
[ 6.571471] rk_gmac-dwmac fe1c0000.ethernet end0: renamed from eth0
[ 6.622989] rk_gmac-dwmac fe1c0000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 6.624040] rk_gmac-dwmac fe1c0000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-1
[ 6.699526] rk_gmac-dwmac fe1c0000.ethernet end0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[ 6.709454] rk_gmac-dwmac fe1c0000.ethernet end0: No Safety Features support found
[ 6.709466] rk_gmac-dwmac fe1c0000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
[ 6.709774] rk_gmac-dwmac fe1c0000.ethernet end0: registered PTP clock
[ 6.711965] rk_gmac-dwmac fe1c0000.ethernet end0: configuring for phy/rgmii-id link mode
[ 9.836444] rk_gmac-dwmac fe1c0000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx

# -------------------------------- ip addr -----------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:ee:61:7a:39 brd ff:ff:ff:ff:ff:ff
altname enx001eee617a39
inet6 fe80::21e:eeff:fe61:7a39/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever

# ----------------------------- lsmod -----------------------------------------
Module Size Used by
pci_endpoint_test 24576 0
hantro_vpu 278528 0
rockchipdrm 188416 0
v4l2_jpeg 16384 1 hantro_vpu
rockchip_rga 24576 0
v4l2_vp9 24576 1 hantro_vpu
hid_logitech_hidpp 53248 0
dw_hdmi_qp 24576 1 rockchipdrm
v4l2_h264 16384 1 hantro_vpu
v4l2_mem2mem 36864 2 hantro_vpu,rockchip_rga
joydev 24576 0
dw_mipi_dsi 20480 1 rockchipdrm
dwmac_rk 28672 0
dw_hdmi 57344 1 rockchipdrm
videobuf2_dma_sg 16384 1 rockchip_rga
videobuf2_dma_contig 24576 1 hantro_vpu
stmmac_platform 20480 1 dwmac_rk
analogix_dp 45056 1 rockchipdrm
videobuf2_memops 16384 2 videobuf2_dma_contig,videobuf2_dma_sg
stmmac 258048 3 stmmac_platform,dwmac_rk
videobuf2_v4l2 28672 3 hantro_vpu,rockchip_rga,v4l2_mem2mem
cec 65536 1 dw_hdmi
panthor 131072 0
rc_core 57344 1 cec
videodev 266240 4 videobuf2_v4l2,hantro_vpu,rockchip_rga,v4l2_mem2mem
pcs_xpcs 32768 1 stmmac
drm_client_lib 12288 1 rockchipdrm
drm_gpuvm 36864 1 panthor
drm_dma_helper 20480 2 rockchipdrm
phylink 61440 2 stmmac,pcs_xpcs
videobuf2_common 57344 7 videobuf2_dma_contig,videobuf2_v4l2,hantro_vpu,rockchip_rga,videobuf2_dma_sg,v4l2_mem2mem,videobuf2_memops
hid_logitech_dj 32768 0
cfg80211 466944 0
drm_exec 12288 2 drm_gpuvm,panthor
mc 69632 5 videodev,videobuf2_v4l2,hantro_vpu,videobuf2_common,v4l2_mem2mem
gpu_sched 40960 1 panthor
rockchip_saradc 16384 0
pwm_fan 20480 0
phy_rockchip_samsung_hdptx 28672 1
phy_rockchip_naneng_combphy 16384 4
rk805_pwrkey 12288 0
rockchip_thermal 28672 0
rtc_pcf8563 24576 1
drm_shmem_helper 24576 1 panthor
display_connector 16384 0
rfkill 28672 2 cfg80211
dw_wdt 12288 0
fuse 155648 1
loop 32768 0
nfnetlink 20480 1
ip_tables 32768 0
[/quote]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby hyke » Sun Jan 12, 2025 5:18 am

HDMI support for the rk3588 in the mainline kernel only got merged in 6.13. So it makes sense you had to use the rc kernel to get output.
make_clickable_callback(MAGIC_URL_FULL, '
', 'https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/arch/arm64/boot/dts/rockchip?id=9c39d5ab450f7181775957000f4aff33bfef9f7b', '', ' class="postlink"')

Regarding the built-in networking, have you tried running dhcpcd directly on the interface? Regarding using systemd-networkd, what system.network files do you have configured in /etc/systemd/network? Do you have an .network that will against "end0"?
Raspberry Pi 3 Model B Rev 1.2|Raspberry Pi Zero 2 W Rev 1.0|Hardkernel ODROID-HC4|Orange Pi 5|Orange Pi 5 Max
linux-rpi|linux-rpi|linux-odroid|linux-opi5|linux-collabora:aarch64
hyke
 
Posts: 12
Joined: Sun Nov 10, 2013 2:26 am

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 10:24 am

Thank you for your reply @hyke.

I tested multiple simple configurations with systemd-networkd and with dhcpcd. Addresses and routes are set on static configs but not one single bit goes through the NIC. DNS entries are rightly set in /etc/resolv.conf.

The following posts show the tested configs.
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 10:25 am

[quote]# ------------------------------- dhcpcd.conf ----------------------------------
interface end0
static ip_address=192.168.1.123/24
static routers=192.168.1.254
static domain_name_servers=8.8.8.8


# ------------------------------- ip addr --------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:ee:61:7a:39 brd ff:ff:ff:ff:ff:ff
altname enx001eee617a39
inet 192.168.1.123/24 brd 192.168.1.255 scope global noprefixroute end0
valid_lft forever preferred_lft forever
inet6 fe80::21e:eeff:fe61:7a39/64 scope link
valid_lft forever preferred_lft forever

# ------------------------------- ip route --------------------------------------
default via 192.168.1.254 dev end0 src 192.168.1.123 metric 1002
192.168.1.0/24 dev end0 proto dhcp scope link src 192.168.1.123 metric 1002
[/quote]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 10:26 am

[quote]# ------------------------------- en.network -----------------------------------
[Match]
Name=en*

# Tested with and without this section.
[Link]
RequiredForOnline=routable

[Network]
DHCP=yes
# Is in the default en.network file created on boot.
DNSSEC=no

# ------------------------------- ip addr -----------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:ee:61:7a:39 brd ff:ff:ff:ff:ff:ff
altname enx001eee617a39
inet6 fe80::21e:eeff:fe61:7a39/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
[/quote]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 10:26 am

[quote]# ------------------------------- en.network -----------------------------------
[Match]
Name=en*

[Network]
Address=192.168.1.123/24
Gateway=192.168.1.254
DNS=192.168.1.254


# ------------------------------- ip addr -------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:ee:61:7a:39 brd ff:ff:ff:ff:ff:ff
altname enx001eee617a39
inet 192.168.1.123/24 brd 192.168.1.255 scope global end0
valid_lft forever preferred_lft forever
inet6 2a01:e0a:837:4ca0:21e:eeff:fe61:7a39/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86273sec preferred_lft 86273sec
inet6 fe80::21e:eeff:fe61:7a39/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever

# ------------------------------- ip route ------------------------------------
default via 192.168.1.254 dev end0 proto static
192.168.1.0/24 dev end0 proto kernel scope link src 192.168.1.123

# ------------------------------- ping ----------------------------------------
PING 192.168.1.119 (192.168.1.119) 56(84) bytes of data.
From 192.168.1.123 icmp_seq=1 Destination Host Unreachable
From 192.168.1.123 icmp_seq=2 Destination Host Unreachable

--- 192.168.1.119 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1019ms
pipe 2
[/quote]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 10:28 am

[quote]# ------------------------------- lspci -----------------------------------
0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01)

On Ubuntu:

- lspci returns an empty string
- there are no files in /etc/systemd/network/
[/quote]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Re: Odroid M2 - how to boot this board?

Postby nmset » Sun Jan 12, 2025 8:41 pm

After reading many internet sources, I resolved to poke in HardKernel's code, replaced 2 functions in the dts file of the Linux source tree (v6.13-rc6) and built the FDT file (make dtbs). The result is a functional ethernet port, simply working. Let's hope mainline ships a working FDT file soon by any means and by any code.

[code]# ------------------------------------------------------------------------------

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dts b/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dts
index 8f034c6d494c..267ccc8de0d6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dts
@@ -228,19 +228,31 @@ &cpu_l3 {
cpu-supply = <&vdd_cpu_lit_s0>;
};

+//make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/hardkernel/linux/blob/b56b831c9b21b7244569ffdc089b4c28871ef994/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dtsi#L267', '', ' class="postlink"')
&gmac1 {
- clock_in_out = "output";
- phy-handle = <&rgmii_phy1>;
- phy-mode = "rgmii-id";
- phy-supply = <&vcc_3v3_s0>;
+ status = "okay";
+
+ /* Use rgmii-rxid mode to disable rx delay inside Soc */
+ phy-mode = "rgmii-rxid";
+ clock_in_out = "input";
+
+ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+ snps,reset-active-low;
+ /* Reset time is 20ms, 100ms for rtl8211f */
+ snps,reset-delays-us = <0 20000 100000>;
+
pinctrl-names = "default";
pinctrl-0 = <&gmac1_miim
+ &gmac1_clkinout
&gmac1_tx_bus2
&gmac1_rx_bus2
&gmac1_rgmii_clk
- &gmac1_rgmii_bus
- &gmac1_clkinout>;
- status = "okay";
+ &gmac1_rgmii_bus>;
+
+ tx_delay = <0x44>;
+ /* rx_delay = <0x4f>; */
+
+ phy-handle = <&rgmii_phy1>;
};

&gpu {
@@ -396,13 +408,11 @@ pcf8563: rtc@51 {
};
};

+//make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/hardkernel/linux/blob/b56b831c9b21b7244569ffdc089b4c28871ef994/arch/arm64/boot/dts/rockchip/rk3588s-odroid-m2.dtsi#L632', '', ' class="postlink"')
&mdio1 {
- rgmii_phy1: ethernet-phy@1 {
- compatible = "ethernet-phy-id001c.c916";
- reg = <1>;
- reset-assert-us = <20000>;
- reset-deassert-us = <100000>;
- reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+ rgmii_phy1: phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
};
};

[/code]
nmset
 
Posts: 42
Joined: Sun Jul 29, 2012 7:09 pm

Next

Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 11 guests