diff mbox series

[04/13] rockchip: rk3308: Generate ethaddr based on cpu id

Message ID 20240316225655.3244348-5-jonas@kwiboo.se
State Superseded
Delegated to: Kever Yang
Headers show
Series rockchip: rk3308: Sync DT with linux v6.8 and update defconfigs | expand

Commit Message

Jonas Karlman March 16, 2024, 10:56 p.m. UTC
Like other Rockchip SoCs the RK3308 has cpu id programmed into OTP
memory. The rockchip_otp driver already support the RK3308 variant.
However, the device tree is missing a node to enable use of OTP.

Add the missing otp node to soc u-boot.dtsi, enable the rockchip_otp
driver and enable use of misc_init_r() to set ethaddr based on cpu id.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/arm/dts/rk3308-u-boot.dtsi | 11 +++++++++++
 arch/arm/mach-rockchip/Kconfig  |  3 +++
 2 files changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/dts/rk3308-u-boot.dtsi b/arch/arm/dts/rk3308-u-boot.dtsi
index db2c20a7055e..396fefb743cf 100644
--- a/arch/arm/dts/rk3308-u-boot.dtsi
+++ b/arch/arm/dts/rk3308-u-boot.dtsi
@@ -10,6 +10,17 @@ 
 		mmc0 = &emmc;
 		mmc1 = &sdmmc;
 	};
+
+	otp: nvmem@ff210000 {
+		compatible = "rockchip,rk3308-otp";
+		reg = <0x0 0xff210000 0x0 0x4000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		cpu_id: id@7 {
+			reg = <0x07 0x10>;
+		};
+	};
 };
 
 &cru {
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 71c5945b5742..6e07a70bf4ae 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -163,7 +163,10 @@  config ROCKCHIP_RK3308
 	imply ARMV8_CRYPTO
 	imply ARMV8_SET_SMPEN
 	imply LEGACY_IMAGE_FORMAT
+	imply MISC
+	imply MISC_INIT_R
 	imply ROCKCHIP_COMMON_BOARD
+	imply ROCKCHIP_OTP
 	imply SPL_CLK
 	imply SPL_FIT_SIGNATURE
 	imply SPL_RAM