rockchip: modify devicetree at runtime for Radxa ROCK Pi E v3.0
Subsystems (3)
PATCH 1/1 rockchip: modify devicetree at runtime for Radxa ROCK Pi E v3.0
since Radxa ROCK Pi E v3.0 is different to ROCK Pi E, "model" and "compatible" in DT need to be different.
(specifically, sysupgrade[1] in OpenWrt)
also, "mmc0" and "mmc1" aliases need to be swapped to align with other Radxa's boards.
modify them after loading DT for kernel.
[1] https://openwrt.org/docs/techref/sysupgrade#how_it_works
--- arch/arm/mach-rockchip/rk3328/Kconfig | 6 ++++++ board/radxa/rockpie-rk3328/Kconfig | 12 +++++++++++ board/radxa/rockpie-rk3328/MAINTAINERS | 6 ++++++ board/radxa/rockpie-rk3328/Makefile | 3 +++ board/radxa/rockpie-rk3328/rockpie-rk3328.c | 22 +++++++++++++++++++++ configs/rock-pi-e-v3-rk3328_defconfig | 2 ++ 6 files changed, 51 insertions(+) create mode 100644 board/radxa/rockpie-rk3328/Kconfig create mode 100644 board/radxa/rockpie-rk3328/MAINTAINERS create mode 100644 board/radxa/rockpie-rk3328/Makefile create mode 100644 board/radxa/rockpie-rk3328/rockpie-rk3328.c
arch/arm/mach-rockchip/rk3328/Kconfig +6 -0
@@ -10,6 +10,11 @@ config TARGET_EVB_RK3328 with full function and phisical connectors support like usb2.0 host ports, LVDS, JTAG, MAC, SDcard, HDMI, USB-2-serial... +config TARGET_ROCK_PI_E_V3_RK3328 + bool "Radxa ROCK Pi E v3.0" + help + Radxa ROCK Pi E v3.0 single board computers with a RK3328 SoC. + endchoice config ROCKCHIP_BOOT_MODE_REG
@@ -37,5 +42,6 @@ config TPL_SYS_MALLOC_F_LEN default 0x800 source "board/rockchip/evb_rk3328/Kconfig" +source "board/radxa/rockpie-rk3328/Kconfig" endif
board/radxa/rockpie-rk3328/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_ROCK_PI_E_V3_RK3328 + +config SYS_BOARD + default "rockpie-rk3328" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "evb_rk3328" + +endif
board/radxa/rockpie-rk3328/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +ROCK-PI-E-V3-RK3328 +M: FUKAUMI Naoki <[email protected]> +S: Maintained +F: board/radxa/rockpie-rk3328 +F: configs/rock-pi-e-v3-rk3328_defconfig +F: arch/arm/dts/rk3328-rock-pi-e*
board/radxa/rockpie-rk3328/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += rockpie-rk3328.o
board/radxa/rockpie-rk3328/rockpie-rk3328.c new file +22 -0
@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <fdt_support.h> + +#define MODEL "Radxa ROCK Pi E v3.0" +#define COMPATIBLE1 "radxa,rockpi-e-v3" +#define COMPATIBLE2 "rockchip,rk3328" + +#define MMC0 "mmc@ff520000" +#define MMC1 "mmc@ff500000" + +int ft_board_setup (void *blob,struct bd_info *bd) +{ +fdt_setprop_string (blob,0 ,"model" ,MODEL ); +fdt_setprop_string (blob,0 ,"compatible" ,COMPATIBLE1 ); +fdt_appendprop_string (blob,0 ,"compatible" ,COMPATIBLE2 ); + +fdt_find_and_setprop (blob,"/aliases" ,"mmc0" ,MMC0 ,13 ,1 ); +fdt_find_and_setprop (blob,"/aliases" ,"mmc1" ,MMC1 ,13 ,1 ); + +return 0 ; +}
configs/rock-pi-e-v3-rk3328_defconfig +2 -0
@@ -9,6 +9,7 @@ CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock-pi-e-v3" CONFIG_DM_RESET=y CONFIG_ROCKCHIP_RK3328=y +CONFIG_TARGET_ROCK_PI_E_V3_RK3328=y CONFIG_DEBUG_UART_BASE=0xFF130000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0x800800
@@ -18,6 +19,7 @@ CONFIG_FIT_VERBOSE=y CONFIG_SPL_FIT_SIGNATURE=y CONFIG_SPL_LOAD_FIT=y CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_BOARD_SETUP=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y
Signature · 1 line
2.43.0
Hi Naoki,
Quoted 102 lines · FUKAUMI Naoki
since Radxa ROCK Pi E v3.0 is different to ROCK Pi E, "model" and "compatible" in DT need to be different.
(specifically, sysupgrade[1] in OpenWrt)also, "mmc0" and "mmc1" aliases need to be swapped to align with other Radxa's boards.
modify them after loading DT for kernel.
[1] https://openwrt.org/docs/techref/sysupgrade#how_it_works
Signed-off-by FUKAUMI Naoki <[email protected]>--- arch/arm/mach-rockchip/rk3328/Kconfig | 6 ++++++ board/radxa/rockpie-rk3328/Kconfig | 12 +++++++++++ board/radxa/rockpie-rk3328/MAINTAINERS | 6 ++++++ board/radxa/rockpie-rk3328/Makefile | 3 +++ board/radxa/rockpie-rk3328/rockpie-rk3328.c | 22 +++++++++++++++++++++ configs/rock-pi-e-v3-rk3328_defconfig | 2 ++ 6 files changed, 51 insertions(+)create mode 100644 board/radxa/rockpie-rk3328/Kconfig create mode 100644 board/radxa/rockpie-rk3328/MAINTAINERS create mode 100644 board/radxa/rockpie-rk3328/Makefile create mode 100644
board/radxa/rockpie-rk3328/rockpie-rk3328.carch/arm/mach-rockchip/rk3328/Kconfig +6
-0@@ -10,6 +10,11 @@ config TARGET_EVB_RK3328 with full function and phisical connectors support like usb2.0 host ports, LVDS, JTAG, MAC, SDcard, HDMI, USB-2-serial... +config TARGET_ROCK_PI_E_V3_RK3328 + bool "Radxa ROCK Pi E v3.0" + help + Radxa ROCK Pi E v3.0 single board computers with a RK3328 SoC. + endchoice config ROCKCHIP_BOOT_MODE_REG@@ -37,5 +42,6 @@ config TPL_SYS_MALLOC_F_LEN default 0x800 source "board/rockchip/evb_rk3328/Kconfig" +source "board/radxa/rockpie-rk3328/Kconfig" endifboard/radxa/rockpie-rk3328/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if TARGET_ROCK_PI_E_V3_RK3328 + +config SYS_BOARD + default "rockpie-rk3328" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "evb_rk3328" + +endifboard/radxa/rockpie-rk3328/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +ROCK-PI-E-V3-RK3328 +M: FUKAUMI Naoki <[email protected]> +S: Maintained +F: board/radxa/rockpie-rk3328 +F: configs/rock-pi-e-v3-rk3328_defconfig +F: arch/arm/dts/rk3328-rock-pi-e*board/radxa/rockpie-rk3328/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += rockpie-rk3328.oboard/radxa/rockpie-rk3328/rockpie-rk3328.c new file +9
-0@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <fdt_support.h> + +#define MODEL "Radxa ROCK Pi E v3.0" +#define COMPATIBLE1 "radxa,rockpi-e-v3" +#define COMPATIBLE2 "rockchip,rk3328" + +#define MMC0 "mmc@ff520000"
board/radxa/rockpie-rk3328/rockpie-rk3328.c line 19
Quoted 10 lines
board/radxa/rockpie-rk3328/rockpie-rk3328.c new file +10
-0+#define MMC1 "mmc@ff500000" + +int ft_board_setup (void *blob,struct bd_info *bd) +{ +fdt_setprop_string (blob,0 ,"model" ,MODEL ); +fdt_setprop_string (blob,0 ,"compatible" ,COMPATIBLE1 ); +fdt_appendprop_string (blob,0 ,"compatible" ,COMPATIBLE2 ); + +fdt_find_and_setprop (blob,"/aliases" ,"mmc0" ,MMC0 ,13 ,1 ); +fdt_find_and_setprop (blob,"/aliases" ,"mmc1" ,MMC1 ,13 ,1 );
There is already available dts arch/arm/dts/rk3328-rock-pi-e-v3.dts,
so this change should go to to dts instead.
Does arch/arm/dts/rk3328-rock-pi-e-v3.dts also go to mainline kernel?
Thanks,
- Kever
Quoted 23 lines
board/radxa/rockpie-rk3328/rockpie-rk3328.c new file +3
-0+ +return 0 ; +}configs/rock-pi-e-v3-rk3328_defconfig +2
-0@@ -9,6 +9,7 @@ CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock-pi-e-v3" CONFIG_DM_RESET=y CONFIG_ROCKCHIP_RK3328=y +CONFIG_TARGET_ROCK_PI_E_V3_RK3328=y CONFIG_DEBUG_UART_BASE=0xFF130000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0x800800@@ -18,6 +19,7 @@ CONFIG_FIT_VERBOSE=y CONFIG_SPL_FIT_SIGNATURE=y CONFIG_SPL_LOAD_FIT=y CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_OF_BOARD_SETUP=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y
hi,
Quoted 114 lines · Kever Yang
Hi Naoki,
Quoted 98 lines · FUKAUMI Naoki
since Radxa ROCK Pi E v3.0 is different to ROCK Pi E, "model" and "compatible" in DT need to be different.
(specifically, sysupgrade[1] in OpenWrt)also, "mmc0" and "mmc1" aliases need to be swapped to align with other Radxa's boards.
modify them after loading DT for kernel.
[1] https://openwrt.org/docs/techref/sysupgrade#how_it_works
Signed-off-by FUKAUMI Naoki <[email protected]>---
arch/arm/mach-rockchip/rk3328/Kconfig | 6 ++++++ board/radxa/rockpie-rk3328/Kconfig | 12 +++++++++++ board/radxa/rockpie-rk3328/MAINTAINERS | 6 ++++++ board/radxa/rockpie-rk3328/Makefile | 3 +++board/radxa/rockpie-rk3328/rockpie-rk3328.c| 22 +++++++++++++++++++++ configs/rock-pi-e-v3-rk3328_defconfig | 2 ++6 files changed, 51 insertions(+)create mode 100644 board/radxa/rockpie-rk3328/Kconfig create mode 100644 board/radxa/rockpie-rk3328/MAINTAINERS create mode 100644 board/radxa/rockpie-rk3328/Makefile create mode 100644
board/radxa/rockpie-rk3328/rockpie-rk3328.carch/arm/mach-rockchip/rk3328/Kconfig +0
-0@@ -10,6 +10,11 @@ config TARGET_EVB_RK3328with full function and phisical connectors support like usb2.0 host ports, LVDS, JTAG, MAC, SDcard, HDMI, USB-2-serial...
arch/arm/mach-rockchip/rk3328/Kconfig +5
-0+config TARGET_ROCK_PI_E_V3_RK3328 + bool "Radxa ROCK Pi E v3.0" + help + Radxa ROCK Pi E v3.0 single board computers with a RK3328 SoC. +endchoice
configROCKCHIP_BOOT_MODE_REGarch/arm/mach-rockchip/rk3328/Kconfig +0
-0@@ -37,5 +42,6 @@ config TPL_SYS_MALLOC_F_LENdefault
0x800
source "board/rockchip/evb_rk3328/Kconfig"
+source "board/radxa/rockpie-rk3328/Kconfig"
endifboard/radxa/rockpie-rk3328/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if TARGET_ROCK_PI_E_V3_RK3328 + +config SYS_BOARD + default "rockpie-rk3328" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "evb_rk3328" + +endifboard/radxa/rockpie-rk3328/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +ROCK-PI-E-V3-RK3328 +M: FUKAUMI Naoki <[email protected]> +S: Maintained +F: board/radxa/rockpie-rk3328 +F: configs/rock-pi-e-v3-rk3328_defconfig +F: arch/arm/dts/rk3328-rock-pi-e*board/radxa/rockpie-rk3328/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += rockpie-rk3328.oboard/radxa/rockpie-rk3328/rockpie-rk3328.c new file +9
-0@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <fdt_support.h> + +#define MODEL "Radxa ROCK Pi E v3.0" +#define COMPATIBLE1 "radxa,rockpi-e-v3" +#define COMPATIBLE2 "rockchip,rk3328" + +#define MMC0 "mmc@ff520000"board/radxa/rockpie-rk3328/rockpie-rk3328.c line 19
Quoted 10 lines
board/radxa/rockpie-rk3328/rockpie-rk3328.c new file +10
-0+#define MMC1 "mmc@ff500000" + +int ft_board_setup (void *blob,struct bd_info *bd) +{ + fdt_setprop_string(blob, 0, "model", MODEL); + fdt_setprop_string(blob, 0, "compatible", COMPATIBLE1); + fdt_appendprop_string(blob, 0, "compatible", COMPATIBLE2); + + fdt_find_and_setprop(blob, "/aliases", "mmc0", MMC0, 13, 1); + fdt_find_and_setprop(blob, "/aliases", "mmc1", MMC1, 13, 1);There is already available dts
arch/arm/dts/rk3328-rock-pi-e-v3.dts,
Quoted 3 lines
so this change should go to to dts instead.
Does
arch/arm/dts/rk3328-rock-pi-e-v3.dtsalso go to mainline kernel?
https://lore.kernel.org/linux-rockchip/[email protected]/t/#u
adding new dts for v3.0 will not be accepted for mainline kernel.
I need new compatible for v3.0 in DT for kernel, but I have no good idea to handle this issue...
Best regards,
--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.
Quoted 28 lines
Thanks,
- Kever
Quoted 23 lines
board/radxa/rockpie-rk3328/rockpie-rk3328.c new file +3
-0+ + return 0; +}configs/rock-pi-e-v3-rk3328_defconfig +0
-0@@ -9,6 +9,7 @@ CONFIG_ENV_OFFSET=0x3F8000
CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock-pi-e-v3"CONFIG_DM_RESET=yCONFIG_ROCKCHIP_RK3328=y+CONFIG_TARGET_ROCK_PI_E_V3_RK3328=yCONFIG_DEBUG_UART_BASE=0xFF130000CONFIG_DEBUG_UART_CLOCK=24000000CONFIG_SYS_LOAD_ADDR=0x800800configs/rock-pi-e-v3-rk3328_defconfig +0
-0@@ -18,6 +19,7 @@ CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=yCONFIG_SPL_LOAD_FIT=yCONFIG_LEGACY_IMAGE_FORMAT=y+CONFIG_OF_BOARD_SETUP=yCONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb" #CONFIG_DISPLAY_CPUINFOis not setCONFIG_DISPLAY_BOARDINFO_LATE=y