Skip to contentSkip to conversation

arm: dts: rockchip: rk3588s: add SFC (Serial Flash Controller) node

PATCH New FUKAUMI Naoki 1 participant 2 messages Sep 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: dts: rockchip: rk3588s: add SFC (Serial Flash Controller) node

this adds sfc node which is required for SPI flash.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +18 -0
index 5544f66c6ff41..849e9568846d4 100644
@@ -18,6 +18,15 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		spi0 = &spi0;
+		spi1 = &spi1;
+		spi2 = &spi2;
+		spi3 = &spi3;
+		spi4 = &spi4;
+		spi5 = &sfc;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -1424,6 +1433,15 @@ sata-port@0 {
 		};
 	};
 
+	sfc: spi@fe2b0000 {
+		compatible = "rockchip,sfc";
+		reg = <0x0 0xfe2b0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+		clock-names = "clk_sfc", "hclk_sfc";
+		status = "disabled";
+	};
+
 	sdmmc: mmc@fe2c0000 {
 		compatible = "rockchip,rk3588-dw-mshc", "rockchip,rk3288-dw-mshc";
 		reg = <0x0 0xfe2c0000 0x0 0x4000>;
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#1 lore raw

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

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.

---
 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
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index e7728007fd1bd..932da827c7f02 100644
@@ -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
arch/arm64/boot/dts/rockchip/rk3588s-rock-5a-emmc.dts new file +13 -0
new file mode 100644
index 0000000000000..625c5bbc5cc4b
@@ -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";
+};
arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +17 -1
index 8347adcbd0030..6182e05480d38 100644
@@ -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>;
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip