* [PATCH 0/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: fix the SPI NOR
@ 2026-09-30 16:52 Igor Velkov via B4 Relay
2026-09-30 16:52 ` [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Igor Velkov via B4 Relay
2026-09-30 16:52 ` [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Igor Velkov via B4 Relay
0 siblings, 2 replies; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-09-30 16:52 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: Rob Herring, Conor Dooley, devicetree, linux-kernel, Igor Velkov,
linux-amlogic, Krzysztof Kozlowski, linux-arm-kernel
Two fixes for the SPI NOR flash on ODROID-HC4. Patch 1 lets the flash
probe after a boot from SD past the SPI. Patch 2 lowers the clock to
40 MHz, where reads stop returning corrupted data.
U-Boot takes this device tree from dts/upstream and gets the fixes with
the next sync.
Signed-off-by: Igor Velkov <iav@iav.lv>
---
Igor Velkov (2):
arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins
arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
---
base-commit: 065957517880dc7053e0723cc9532b6e78c8855c
change-id: 20260930-hc4-spi-nor-a80152e30ea1
Best regards,
--
Igor Velkov <iav@iav.lv>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins
2026-09-30 16:52 [PATCH 0/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: fix the SPI NOR Igor Velkov via B4 Relay
@ 2026-09-30 16:52 ` Igor Velkov via B4 Relay
2026-10-02 9:23 ` Neil Armstrong
2026-09-30 16:52 ` [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Igor Velkov via B4 Relay
1 sibling, 1 reply; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-09-30 16:52 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: Rob Herring, Conor Dooley, devicetree, linux-kernel, Igor Velkov,
linux-amlogic, Krzysztof Kozlowski, linux-arm-kernel
From: Igor Velkov <iav@iav.lv>
The SPI NOR flash uses six lines, but nor_pins covers only four: data,
clock and chip select. Nothing claims HOLD# (BOOT_3) and WP# (BOOT_7),
so they keep the boot ROM setting. After a boot from SPI they are in
the nor function and the flash works. After a boot from SD with the
button under the board, they stay eMMC data lines pulled low, and
spi-nor reports "unrecognized JEDEC id bytes: 00 00 00 00 00 00".
Mux them in a board-local group. nor_pins is shared with boards that
use BOOT_0..7 for eMMC, and the HC4 has eMMC disabled.
Tested on ODROID-HC4: after a boot from SD past the SPI, the flash
probes as a 16 MiB mtd0 and reads back correctly.
Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@iav.lv>
---
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
index 3ece30a0a1ff..5ce76a1bfe02 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -124,9 +124,19 @@ &sd_emmc_c {
status = "disabled";
};
+&periphs_pinctrl {
+ hc4_nor_hold_wp_pins: nor-hold-wp {
+ mux {
+ groups = "nor_hold", "nor_wp";
+ function = "nor";
+ bias-disable;
+ };
+ };
+};
+
&spifc {
status = "okay";
- pinctrl-0 = <&nor_pins>;
+ pinctrl-0 = <&nor_pins>, <&hc4_nor_hold_wp_pins>;
pinctrl-names = "default";
flash@0 {
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz
2026-09-30 16:52 [PATCH 0/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: fix the SPI NOR Igor Velkov via B4 Relay
2026-09-30 16:52 ` [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Igor Velkov via B4 Relay
@ 2026-09-30 16:52 ` Igor Velkov via B4 Relay
2026-10-02 9:22 ` Neil Armstrong
1 sibling, 1 reply; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-09-30 16:52 UTC (permalink / raw)
To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: Rob Herring, Conor Dooley, devicetree, linux-kernel, Igor Velkov,
linux-amlogic, Krzysztof Kozlowski, linux-arm-kernel
From: Igor Velkov <iav@iav.lv>
At 104 MHz, reads return corrupted data: bit 0 of the first byte of a
transfer flips from 0 to 1 part of the time. The same byte read as the
second byte of a transfer was correct in all 100 reads. One 4 KiB block
read 200 times came back wrong 157 times. Writes are unaffected.
flashcp verifies while it writes, so a bootloader update erases blocks
it should skip and can abort halfway, with the flash half written.
The Hardkernel vendor device tree for this board uses 40 MHz. At 40 MHz
the same tests pass: 200 block reads with no mismatch, and 14 flashcp
runs with no block erased.
Tested on ODROID-HC4 with an XT25F128B.
Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@iav.lv>
---
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
index 5ce76a1bfe02..8f09f2b74bdd 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -144,7 +144,7 @@ flash@0 {
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
- spi-max-frequency = <104000000>;
+ spi-max-frequency = <40000000>;
};
};
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz
2026-09-30 16:52 ` [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Igor Velkov via B4 Relay
@ 2026-10-02 9:22 ` Neil Armstrong
0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2026-10-02 9:22 UTC (permalink / raw)
To: iav, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: Rob Herring, Conor Dooley, devicetree, linux-kernel,
linux-amlogic, Krzysztof Kozlowski, linux-arm-kernel
On 9/30/26 18:52, Igor Velkov via B4 Relay wrote:
> From: Igor Velkov <iav@iav.lv>
>
> At 104 MHz, reads return corrupted data: bit 0 of the first byte of a
> transfer flips from 0 to 1 part of the time. The same byte read as the
> second byte of a transfer was correct in all 100 reads. One 4 KiB block
> read 200 times came back wrong 157 times. Writes are unaffected.
>
> flashcp verifies while it writes, so a bootloader update erases blocks
> it should skip and can abort halfway, with the flash half written.
>
> The Hardkernel vendor device tree for this board uses 40 MHz. At 40 MHz
> the same tests pass: 200 block reads with no mismatch, and 14 flashcp
> runs with no block erased.
>
> Tested on ODROID-HC4 with an XT25F128B.
>
> Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
> Assisted-by: LLM
> Signed-off-by: Igor Velkov <iav@iav.lv>
> ---
> arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> index 5ce76a1bfe02..8f09f2b74bdd 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> @@ -144,7 +144,7 @@ flash@0 {
> #size-cells = <1>;
> compatible = "jedec,spi-nor";
> reg = <0>;
> - spi-max-frequency = <104000000>;
> + spi-max-frequency = <40000000>;
> };
> };
>
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins
2026-09-30 16:52 ` [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Igor Velkov via B4 Relay
@ 2026-10-02 9:23 ` Neil Armstrong
0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2026-10-02 9:23 UTC (permalink / raw)
To: iav, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: Rob Herring, Conor Dooley, devicetree, linux-kernel,
linux-amlogic, Krzysztof Kozlowski, linux-arm-kernel
On 9/30/26 18:52, Igor Velkov via B4 Relay wrote:
> From: Igor Velkov <iav@iav.lv>
>
> The SPI NOR flash uses six lines, but nor_pins covers only four: data,
> clock and chip select. Nothing claims HOLD# (BOOT_3) and WP# (BOOT_7),
> so they keep the boot ROM setting. After a boot from SPI they are in
> the nor function and the flash works. After a boot from SD with the
> button under the board, they stay eMMC data lines pulled low, and
> spi-nor reports "unrecognized JEDEC id bytes: 00 00 00 00 00 00".
>
> Mux them in a board-local group. nor_pins is shared with boards that
> use BOOT_0..7 for eMMC, and the HC4 has eMMC disabled.
>
> Tested on ODROID-HC4: after a boot from SD past the SPI, the flash
> probes as a 16 MiB mtd0 and reads back correctly.
>
> Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
> Assisted-by: LLM
> Signed-off-by: Igor Velkov <iav@iav.lv>
> ---
> arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> index 3ece30a0a1ff..5ce76a1bfe02 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
> @@ -124,9 +124,19 @@ &sd_emmc_c {
> status = "disabled";
> };
>
> +&periphs_pinctrl {
> + hc4_nor_hold_wp_pins: nor-hold-wp {
> + mux {
> + groups = "nor_hold", "nor_wp";
> + function = "nor";
> + bias-disable;
> + };
> + };
> +};
Could you move this to meson-g12-common.dtsi instead ?
> +
> &spifc {
> status = "okay";
> - pinctrl-0 = <&nor_pins>;
> + pinctrl-0 = <&nor_pins>, <&hc4_nor_hold_wp_pins>;
> pinctrl-names = "default";
>
> flash@0 {
>
Thanks,
Neil
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-02 9:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 16:52 [PATCH 0/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: fix the SPI NOR Igor Velkov via B4 Relay
2026-09-30 16:52 ` [PATCH 1/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Igor Velkov via B4 Relay
2026-10-02 9:23 ` Neil Armstrong
2026-09-30 16:52 ` [PATCH 2/2] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Igor Velkov via B4 Relay
2026-10-02 9:22 ` Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®