]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3308: Generate ethaddr based on cpu id
authorJonas Karlman <jonas@kwiboo.se>
Mon, 8 Apr 2024 18:14:01 +0000 (18:14 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 26 Apr 2024 07:47:03 +0000 (15:47 +0800)
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>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/dts/rk3308-u-boot.dtsi
arch/arm/mach-rockchip/Kconfig

index db2c20a7055e531e689598975f5f5e441bfa1fae..436f66d1b87db008095cad13b1448b9c9757fcd2 100644 (file)
                mmc0 = &emmc;
                mmc1 = &sdmmc;
        };
+
+       otp: nvmem@ff210000 {
+               compatible = "rockchip,rk3308-otp";
+               reg = <0x0 0xff210000 0x0 0x4000>;
+               clocks = <&cru SCLK_OTP_USR>, <&cru PCLK_OTP_NS>,
+                        <&cru PCLK_OTP_PHY>;
+               clock-names = "otp", "apb_pclk", "phy";
+               resets = <&cru SRST_OTP_PHY>;
+               reset-names = "phy";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               cpu_id: id@7 {
+                       reg = <0x07 0x10>;
+               };
+       };
 };
 
 &cru {
index 0902eb285453536172485f3e3c2a878595036587..2707d3fdfb31ccfceeabfb9f6358112ecb5e08ea 100644 (file)
@@ -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