[PATCH 04/11] board: rockchip: Add a common ROCK Pi 4 target

Jonas Karlman jonas at kwiboo.se
Tue Mar 12 23:13:41 CET 2024


Hi Kever,

On 2024-03-11 10:29, Kever Yang wrote:
> Hi Jonas,
> 
> On 2024/2/19 17:13, Quentin Schulz wrote:
>> Hi Jonas,
>>
>> On 2/17/24 19:35, Jonas Karlman wrote:
>>> Move ROCK Pi 4 specific board code from the shared evb_rk3399 target
>>> into its own board target and update related defconfigs to use the new
>>> TARGET_ROCKPI4_RK3399 option.
>>>
>>> Also move the call to gpt_capsule_update_setup() from the weak function
>>> rk_board_late_init() into the main board_late_init() function.
>>>
>>> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
>>> ---
>>>   arch/arm/mach-rockchip/board.c                | 10 +++---
>>>   arch/arm/mach-rockchip/rk3399/Kconfig         |  6 ++++
>>>   board/radxa/rockpi4-rk3399/Kconfig            | 15 +++++++++
>>>   board/radxa/rockpi4-rk3399/MAINTAINERS        | 29 +++++++++++++++++
>>>   .../rockpi4-rk3399}/Makefile                  |  2 +-
>>>   .../rockpi4-rk3399/rockpi4-rk3399.c}          | 13 ++------
>>>   board/rockchip/evb_rk3399/MAINTAINERS         | 29 -----------------
>>>   configs/rock-4c-plus-rk3399_defconfig         |  2 +-
>>>   configs/rock-4se-rk3399_defconfig             |  2 +-
>>>   configs/rock-pi-4-rk3399_defconfig            |  2 +-
>>>   configs/rock-pi-4c-rk3399_defconfig           |  2 +-
>>>   include/configs/rk3399_common.h               | 16 ----------
>>>   include/configs/rockpi4-rk3399.h              | 32 +++++++++++++++++++
>>>   13 files changed, 95 insertions(+), 65 deletions(-)
>>>   create mode 100644 board/radxa/rockpi4-rk3399/Kconfig
>>>   create mode 100644 board/radxa/rockpi4-rk3399/MAINTAINERS
>>>   rename board/{rockchip/evb_rk3399 => radxa/rockpi4-rk3399}/Makefile 
>>> (79%)
>>>   rename board/{rockchip/evb_rk3399/evb-rk3399.c => 
>>> radxa/rockpi4-rk3399/rockpi4-rk3399.c} (79%)
>>>   create mode 100644 include/configs/rockpi4-rk3399.h
>>>
>>> diff --git a/arch/arm/mach-rockchip/board.c 
>>> b/arch/arm/mach-rockchip/board.c
>>> index 4f666aee706f..dea5805c4665 100644
>>> --- a/arch/arm/mach-rockchip/board.c
>>> +++ b/arch/arm/mach-rockchip/board.c
>>> @@ -34,7 +34,7 @@
>>>   #include <asm/arch-rockchip/periph.h>
>>>   #include <power/regulator.h>
>>>   -#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && 
>>> defined(CONFIG_EFI_PARTITION)
>>> +#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && 
>>> IS_ENABLED(CONFIG_EFI_PARTITION)
>>>     #define DFU_ALT_BUF_LEN            SZ_1K
>>>   @@ -185,10 +185,6 @@ static void gpt_capsule_update_setup(void)
>>>     __weak int rk_board_late_init(void)
>>>   {
>>> -#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && 
>>> defined(CONFIG_EFI_PARTITION)
>>> -    gpt_capsule_update_setup();
>>> -#endif
>>> -
>>>       return 0;
>>>   }
>>>   @@ -196,6 +192,10 @@ int board_late_init(void)
>>>   {
>>>       setup_boot_mode();
>>>   +#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && 
>>> IS_ENABLED(CONFIG_EFI_PARTITION)
>>> +    gpt_capsule_update_setup();
>>> +#endif
>>> +
>>>       return rk_board_late_init();
>>>   }
>>>   diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
>>> b/arch/arm/mach-rockchip/rk3399/Kconfig
>>> index d01063ac98b6..bf3600aee2ad 100644
>>> --- a/arch/arm/mach-rockchip/rk3399/Kconfig
>>> +++ b/arch/arm/mach-rockchip/rk3399/Kconfig
>>> @@ -89,6 +89,11 @@ config TARGET_ROCK960_RK3399
>>>          * 2x USB 3.0 type A, 2x USB 2.0 type A (host mode only),
>>>            1x USB 3.0 type C OTG
>>>   +config TARGET_ROCKPI4_RK3399
>>> +    bool "Radxa ROCK Pi 4 board"
>>> +    help
>>> +      Support for ROCK Pi 4 board family by Radxa.
>>> +
>>>   config TARGET_ROCKPRO64_RK3399
>>>       bool "Pine64 Rockpro64 board"
>>>       help
>>> @@ -174,6 +179,7 @@ source "board/google/gru/Kconfig"
>>>   source "board/pine64/pinebook-pro-rk3399/Kconfig"
>>>   source "board/pine64/pinephone-pro-rk3399/Kconfig"
>>>   source "board/pine64/rockpro64_rk3399/Kconfig"
>>> +source "board/radxa/rockpi4-rk3399/Kconfig"
>>>   source "board/rockchip/evb_rk3399/Kconfig"
>>>   source "board/theobroma-systems/puma_rk3399/Kconfig"
>>>   source "board/vamrs/rock960_rk3399/Kconfig"
>>> diff --git a/board/radxa/rockpi4-rk3399/Kconfig 
>>> b/board/radxa/rockpi4-rk3399/Kconfig
>>> new file mode 100644
>>> index 000000000000..d82663506b12
>>> --- /dev/null
>>> +++ b/board/radxa/rockpi4-rk3399/Kconfig
>>> @@ -0,0 +1,15 @@
>>> +if TARGET_ROCKPI4_RK3399
>>> +
>>> +config SYS_BOARD
>>> +    default "rockpi4-rk3399"
>>> +
>>> +config SYS_VENDOR
>>> +    default "radxa"
>>> +
>>> +config SYS_CONFIG_NAME
>>> +    default "rockpi4-rk3399"
>>> +
>>> +config BOARD_SPECIFIC_OPTIONS # dummy
>>> +    def_bool y
>>> +
>>> +endif
>>> diff --git a/board/radxa/rockpi4-rk3399/MAINTAINERS 
>>> b/board/radxa/rockpi4-rk3399/MAINTAINERS
>>> new file mode 100644
>>> index 000000000000..12d4f35af881
>>> --- /dev/null
>>> +++ b/board/radxa/rockpi4-rk3399/MAINTAINERS
>>> @@ -0,0 +1,29 @@
>>> +ROCK-PI-4
>>> +M:    Jagan Teki <jagan at amarulasolutions.com>
>>> +R:    Jonas Karlman <jonas at kwiboo.se>
>>> +S:    Maintained
>>> +F:    board/radxa/rockpi4-rk3399/
>>> +F:    configs/rock-pi-4-rk3399_defconfig
>>> +F:    arch/arm/dts/rk3399-rock-pi-4.dtsi
>>> +F:    arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi
>>> +F:    arch/arm/dts/rk3399-rock-pi-4a.dts
>>> +F:    arch/arm/dts/rk3399-rock-pi-4a-u-boot.dtsi
>>> +F:    configs/rock-pi-4c-rk3399_defconfig
>>> +F:    arch/arm/dts/rk3399-rock-pi-4c.dts
>>> +F:    arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
>>> +
>>
>> Probably for a different patch but I think this would benefit from 
>> using a glob?
>>
>> +F:    arch/arm/dts/rk3399-rock-pi-4*
> 
> 
> Agree with this suggest.

I will change to use glob where it does not match files listed under
under boards in v2.

Regards,
Jonas

> 
> 
> Thanks,
> - Kever
>>
>> Cheers,
>> Quentin



More information about the U-Boot mailing list