meson-gxl-s905d-phicomm-n1.dtb in Linux 5.0 won’t bootAfter diff
ing the working dtb and the failing one (meson-gxl-s905d-phicomm-n1.dtb
from compiling the kernel by hand), the issue was found to be the incorrectly high max-frequency
specified in meson-gx-p23x-q20x.dtsi
: mmc@7400
(i.e. &sd_emmc_c
).
Turns out that this is a long standing issue, I can’t even figure out since when it had been existing. At least dtb in Linux 4.19 / Linux 4.20 were all non-working ones. (There’s even no dtb for Phicomm N1 before Linux 5.0. People used meson-gxl-s905d-p230.dtb
for Phicomm N1 back then. The two dtbs are largely the same.)
The issue was also metioned in ODROID’s forum
meson-gxl-s905d-p230.dtb
in Armbian 5.67 does not suffer from this though, they applied their own patch. (I also noticed that 150balbes’ dtb contains some other patches for audio. But as I’m using the box headlessly, I didn’t check that in more detail.)
Here is the diff (of the decompiled dtb):
12345678910111213141516171819202122232425 --- a.dts 2019-01-01 00:00:00.000000000 +0000+++ b.dts 2019-01-01 00:00:00.000000000 +0000@@ -345,21 +345,21 @@ }; mmc@74000 { bus-width = <0x8>; cap-mmc-highspeed; clock-names = "core", "clkin0", "clkin1"; clocks = <0x8 0x60 0x8 0x7d 0x8 0x4>; compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; disable-wp; interrupts = <0x0 0xda 0x1>;- max-frequency = <0xbebc200>;+ max-frequency = <0x5f5e100>; mmc-ddr-1_8v; mmc-hs200-1_8v; mmc-pwrseq = <0x27>; non-removable; pinctrl-0 = <0x24 0x25>; pinctrl-1 = <0x26>; pinctrl-names = "default", "clk-gate"; reg = <0x0 0x74000 0x0 0x800>; resets = <0xf 0x2e>; status = "okay";
There’s actually another caveat, though. meson-gxl-s905d-phicomm-n1.dtb
from Linux 5.0 causes irq #35 being kept fired (leading to high “load average” in top
, around 1.0). I suspect it’s yet another wrong IRQ type but I’m not sure and could not find any references yet.
Anyway, I applied the following patch to mitigate this by changing the IRQL type from IRQ_TYPE_LEVEL_LOW
to IRQ_TYPE_LEVEL_HIGH
:
1234567891011 --- a.dts 2019-01-01 00:00:00.000000000 +0000+++ b.dts 2019-01-01 00:00:00.000000000 +0000@@ -966,7 +966,7 @@ ethernet-phy@0 { compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22"; interrupt-parent = <0x19>;- interrupts = <0x1d 0x8>;+ interrupts = <0x1d 0x4>; max-speed = <0x3e8>; phandle = <0x1b>; reg = <0x0>;
yangxuan8282 ‘s patch also addressed this issue, but in a different way. His patch seems to use the same configuration as meson-gxbb-vega-s95.dtsi
for Phicomm N1, by removing interrupts
option from dtb completely. This (seems to) results in using polling for interrupts, as shown in dmesg
:
1 [Mon Mar 3 00:00:00 2019] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)
I’m gonna sort out the patches I’m using for a headless N1 box (with other old patches you can find in the older posts), and will post them as patches upon the kernel source tree (instead of the decompiled dtbs) at a later time. Update: The patches I’m using are here.
Glad to see Linux 5.0 on my N1 box:
123456789101112131415161718192021222324252627282930 Linux n1-box 5.0.0 #1 SMP PREEMPT Mon Mar 3 00:00:00 UTC 2019 aarch64 The programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Mon Mar 3 00:00:00 2019 from 1.1.1.1[root@n1-box ~]# neofetch _,met$$$$$gg. root@n1-box ,g$$$$$$$$$$$$$$$P. ------------------- ,g$$P" """Y$$.". OS: Debian GNU/Linux 9.8 (stretch) aarch64 ,$$P' `$$$. Model: Phicomm N1',$$P ,ggs. `$$b: Kernel: 5.0.0`d$$' ,$P"' . $$$ Uptime: 1 minutes $$P d$' , $$P Packages: 512 $$: $$. - ,d$$' Shell: bash 4.4.12 $$; Y$b._ _,d$P' CPU: (4) @ 1.5GHz Y$$. `.`"Y$$$$P"' Memory: 66MB / 1983MB `$$b "-.__ `Y$$ ████████████████████████ `Y$$. `$$b. `Y$$b. `"Y$b._ `""" [root@n1-box ~]#
Here is the dtb with the patch above (as well as some other minor patches, but noticeably not the patch of removing frame buffer, so that it’s reasonably debuggable.). But be noted that I’m using the box headlessly, and do not have the condition to see if the video / audio works correctly.
After diff
ing the working dtb and the failing one (meson-gxl-s905d-phicomm-n1.dtb
from compiling the kernel by hand), the issue was found to be the incorrectly high max-frequency
specified in meson-gx-p23x-q20x.dtsi
: mmc@7400
(i.e. &sd_emmc_c
).
Turns out that this is a long standing issue, I can’t even figure out since when it had been existing. At least dtb in Linux 4.19 / Linux 4.20 were all non-working ones. (There’s even no dtb for Phicomm N1 before Linux 5.0. People used meson-gxl-s905d-p230.dtb
for Phicomm N1 back then. The two dtbs are largely the same.)
The issue was also metioned in ODROID’s forum
meson-gxl-s905d-p230.dtb
in Armbian 5.67 does not suffer from this though, they applied their own patch. (I also noticed that 150balbes’ dtb contains some other patches for audio. But as I’m using the box headlessly, I didn’t check that in more detail.)
Here is the diff (of the decompiled dtb):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | --- a.dts 2019-01-01 00:00:00.000000000 +0000 +++ b.dts 2019-01-01 00:00:00.000000000 +0000 @@ -345,21 +345,21 @@ }; mmc@74000 { bus-width = <0x8>; cap-mmc-highspeed; clock-names = "core", "clkin0", "clkin1"; clocks = <0x8 0x60 0x8 0x7d 0x8 0x4>; compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; disable-wp; interrupts = <0x0 0xda 0x1>; - max-frequency = <0xbebc200>; + max-frequency = <0x5f5e100>; mmc-ddr-1_8v; mmc-hs200-1_8v; mmc-pwrseq = <0x27>; non-removable; pinctrl-0 = <0x24 0x25>; pinctrl-1 = <0x26>; pinctrl-names = "default", "clk-gate"; reg = <0x0 0x74000 0x0 0x800>; resets = <0xf 0x2e>; status = "okay"; |
There’s actually another caveat, though. meson-gxl-s905d-phicomm-n1.dtb
from Linux 5.0 causes irq #35 being kept fired (leading to high “load average” in top
, around 1.0). I suspect it’s yet another wrong IRQ type but I’m not sure and could not find any references yet.
Anyway, I applied the following patch to mitigate this by changing the IRQL type from IRQ_TYPE_LEVEL_LOW
to IRQ_TYPE_LEVEL_HIGH
:
1 2 3 4 5 6 7 8 9 10 11 | --- a.dts 2019-01-01 00:00:00.000000000 +0000 +++ b.dts 2019-01-01 00:00:00.000000000 +0000 @@ -966,7 +966,7 @@ ethernet-phy@0 { compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22"; interrupt-parent = <0x19>; - interrupts = <0x1d 0x8>; + interrupts = <0x1d 0x4>; max-speed = <0x3e8>; phandle = <0x1b>; reg = <0x0>; |
yangxuan8282 ‘s patch also addressed this issue, but in a different way. His patch seems to use the same configuration as meson-gxbb-vega-s95.dtsi
for Phicomm N1, by removing interrupts
option from dtb completely. This (seems to) results in using polling for interrupts, as shown in dmesg
:
1 | [Mon Mar 3 00:00:00 2019] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL) |
I’m gonna sort out the patches I’m using for a headless N1 box (with other old patches you can find in the older posts), and will post them as patches upon the kernel source tree (instead of the decompiled dtbs) at a later time. Update: The patches I’m using are here.
Glad to see Linux 5.0 on my N1 box:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | Linux n1-box 5.0.0 #1 SMP PREEMPT Mon Mar 3 00:00:00 UTC 2019 aarch64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Mar 3 00:00:00 2019 from 1.1.1.1 [root@n1-box ~]# neofetch _,met$$$$$gg. root@n1-box ,g$$$$$$$$$$$$$$$P. ------------------- ,g$$P" """Y$$.". OS: Debian GNU/Linux 9.8 (stretch) aarch64 ,$$P' `$$$. Model: Phicomm N1 ',$$P ,ggs. `$$b: Kernel: 5.0.0 `d$$' ,$P"' . $$$ Uptime: 1 minutes $$P d$' , $$P Packages: 512 $$: $$. - ,d$$' Shell: bash 4.4.12 $$; Y$b._ _,d$P' CPU: (4) @ 1.5GHz Y$$. `.`"Y$$$$P"' Memory: 66MB / 1983MB `$$b "-.__ `Y$$ ████████████████████████ `Y$$. `$$b. `Y$$b. `"Y$b._ `""" [root@n1-box ~]# |
Here is the dtb with the patch above (as well as some other minor patches, but noticeably not the patch of removing frame buffer, so that it’s reasonably debuggable.). But be noted that I’m using the box headlessly, and do not have the condition to see if the video / audio works correctly.
Hi Carrot, is it possible to compile latest mainline kernel such as kernel 5.4 for N1 box with your patches? Thanks!
TBH I’m not sure about this. I’ve been sticking with 5.1 kernel for a while. You can try it out yourself though.