diff mbox series

[2/2] arm: dts: rockchip: add support for SPI flash module for Radxa ROCK 5A

Message ID 20230913064505.77393-2-naoki@radxa.com (mailing list archive)
State New, archived
Headers show
Series [1/2] arm: dts: rockchip: rk3588s: add SFC (Serial Flash Controller) node | expand

Commit Message

FUKAUMI Naoki Sept. 13, 2023, 6:45 a.m. UTC
this adds support for SPI flash module for Radxa ROCK 5A.
 https://docs.radxa.com/en/accessories/spi-flash-module

on ROCK 5A, only either SPI flash module or eMMC module can be used.
since SPI flash module is equipped by default and eMMC module is
optional, rk3588s-rock-5a.dts should be configured for SPI flash and
new dts file, rk3588s-rock-5a-emmc.dts is added for eMMC.

this modification may be done by device tree overlay, but for
bootloader (more specifically, U-Boot SPL), it needs to be different
dts file.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
---
 arch/arm64/boot/dts/rockchip/Makefile          |  1 +
 .../boot/dts/rockchip/rk3588s-rock-5a-emmc.dts | 13 +++++++++++++
 .../boot/dts/rockchip/rk3588s-rock-5a.dts      | 18 +++++++++++++++++-
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-rock-5a-emmc.dts
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index e7728007fd1bd..932da827c7f02 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -105,3 +105,4 @@  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-indiedroid-nova.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-khadas-edge2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a-emmc.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a-emmc.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a-emmc.dts
new file mode 100644
index 0000000000000..625c5bbc5cc4b
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a-emmc.dts
@@ -0,0 +1,13 @@ 
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3588s-rock-5a.dts"
+
+&sdhci {
+	status = "okay";
+};
+
+&sfc {
+	status = "disabled";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
index 8347adcbd0030..6182e05480d38 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
@@ -355,7 +355,7 @@  &sdhci {
 	non-removable;
 	mmc-hs400-1_8v;
 	mmc-hs400-enhanced-strobe;
-	status = "okay";
+	status = "disabled";
 };
 
 &sdmmc {
@@ -373,6 +373,22 @@  &sdmmc {
 	status = "okay";
 };
 
+&sfc {
+	pinctrl-0 = <&fspim0_pins>;
+	pinctrl-names = "default";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
+	};
+};
+
 &spi2 {
 	status = "okay";
 	assigned-clocks = <&cru CLK_SPI2>;