[PATCH] arm64: renesas: Add Cortex-M33 build option to R-Car Gen5

Quentin Schulz quentin.schulz at cherry.de
Tue Apr 21 18:37:45 CEST 2026


Hi Marek,

On 3/30/26 1:23 AM, Marek Vasut wrote:
> The R-Car Gen5 SoCs contains Cortex-M33, Cortex-R52 and Cortex-A720AE
> cores. Add U-Boot build options for the Cortex-M33 core.
> 
> Since the Cortex-M33 core is a 32bit core, select V8M and ARM64 for
> RCAR64 accordingly. Select TMU timer on the 32bit core, where it is
> used instead of the ARMv8 timer. Adjust TMU timer base address to match
> the address map of the Cortex-M33 core. Disable unused OF_BOARD_SETUP
> as well as unavailable POSITION_INDEPENDENT configuration options.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> ---
> Cc: Anshul Dalal <anshuld at ti.com>
> Cc: Hai Pham <hai.pham.ud at renesas.com>
> Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Cc: Jesse Taube <mr.bossman075 at gmail.com>
> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
> Cc: Paul Barker <paul.barker.ct at bp.renesas.com>
> Cc: Quentin Schulz <quentin.schulz at cherry.de>
> Cc: Tien Fong Chee <tien.fong.chee at altera.com>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Udit Kumar <u-kumar1 at ti.com>
> Cc: u-boot at lists.denx.de
> ---
>   Kconfig                                             |  2 ++
>   arch/arm/mach-renesas/Kconfig                       | 11 ++++++++---
>   arch/arm/mach-renesas/Kconfig.rcar5                 |  7 +++++++
>   arch/arm/mach-renesas/include/mach/rcar-gen5-base.h |  6 ++++++
>   include/configs/rcar-gen5-common.h                  |  6 ++++++
>   5 files changed, 29 insertions(+), 3 deletions(-)
> 
> diff --git a/Kconfig b/Kconfig
> index 0bbdc0cbea6..7033a255675 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -476,6 +476,7 @@ config SKIP_RELOCATE
>   
>   config SKIP_RELOCATE_CODE
>   	bool
> +	default y if RCAR_64_CM
>   	help
>   	  Skips relocation of U-Boot code to the end of RAM, but still does
>   	  relocate data to the end of RAM. This is mainly meant to relocate
> @@ -485,6 +486,7 @@ config SKIP_RELOCATE_CODE
>   
>   config SKIP_RELOCATE_CODE_DATA_OFFSET
>   	hex
> +	default 0xa0000000 if RCAR_64_CM
>   	default 0x0
>   	depends on SKIP_RELOCATE_CODE
>   	help

Can't you set those in arch/arm/mach-renesas/Kconfig instead? e.g. in 
arch/arm/mach-rockchip/Kconfig we have a few symbols we provide defaults 
for. I think it would make more sense to have this in the arch-specific 
file and avoid everyone polluting the main declaration of the symbol? 
What do you think?

> diff --git a/arch/arm/mach-renesas/Kconfig b/arch/arm/mach-renesas/Kconfig
> index fa4e312a4dd..3f21755a226 100644
> --- a/arch/arm/mach-renesas/Kconfig
> +++ b/arch/arm/mach-renesas/Kconfig
> @@ -1,15 +1,20 @@
>   if ARCH_RENESAS
>   
> +config TMU_TIMER
> +	bool
> +

def_bool y if RCAR_64_CM

?

>   # Renesas ARM SoCs R-Car Gen3/Gen4 (64bit)
>   config RCAR_64
>   	bool
> -	select ARM64
> +	select CPU_V8M if RCAR_64_CM
> +	select ARM64 if !RCAR_64_CM
> +	select TMU_TIMER if RCAR_64_CM
>   	select CMD_CACHE
> -	select OF_BOARD_SETUP
> +	select OF_BOARD_SETUP if !RCAR_64_CM
>   	select PHY
>   	select PINCONF
>   	select PINCTRL
> -	select POSITION_INDEPENDENT
> +	select POSITION_INDEPENDENT if !RCAR_64_CM
>   	imply CMD_FS_UUID
>   	imply CMD_GPT
>   	imply CMD_MMC_SWRITE if MMC

I don't understand this choice. RCAR_64 is clearly a 64b platform, but 
here for some reason we add support for a 32b platform. Why not follow 
the same implem as for RCAR_32 or RZN1? Add yet another choice for 
RCAR_GEN34_CM for example?

The main issue I have with this is that RCAR_64 doesn't mean a 64b 
machine anymore, and the naming doesn't help with that. I'm pretty sure 
in the future someone's going to make the mistake of doing a simple 
CONFIG_IS_ENABLED(RCAR_64) to check if it's a 64b machine or not.

> diff --git a/arch/arm/mach-renesas/Kconfig.rcar5 b/arch/arm/mach-renesas/Kconfig.rcar5
> index 528fc5aecc9..2e6d119a328 100644
> --- a/arch/arm/mach-renesas/Kconfig.rcar5
> +++ b/arch/arm/mach-renesas/Kconfig.rcar5
> @@ -1,5 +1,12 @@
>   if RCAR_GEN5
>   
> +config RCAR_64_CM
> +	bool "Renesas ARM SoCs R-Car Gen5 (use Cortex-M33)"
> +	default n

default n
is the default, no need to specify.

I'm wondering why CM in the symbol name? *C*ortex-*M*? *C*ompanion 
*M*icrocontroller? Would _M33 help making this clearer maybe?

> +	help
> +	  Build U-Boot for the Cortex-M33 core present on selected SoC.
> +	  The default is n, meaning U-Boot is built for the Cortex-A core.
> +
>   menu "Select Target SoC"
>   
>   config R8A78000
> diff --git a/arch/arm/mach-renesas/include/mach/rcar-gen5-base.h b/arch/arm/mach-renesas/include/mach/rcar-gen5-base.h
> index f9af3ef885a..4cb9a1fbc42 100644
> --- a/arch/arm/mach-renesas/include/mach/rcar-gen5-base.h
> +++ b/arch/arm/mach-renesas/include/mach/rcar-gen5-base.h
> @@ -9,7 +9,13 @@
>   /*
>    * R-Car (R8A78000) I/O Addresses
>    */
> +#if defined(CONFIG_RCAR_64_CM)
> +/* Cortex-M33 address */
> +#define TMU_BASE		0xC0680000
> +#else
> +/* Cortex-A720AE address */
>   #define TMU_BASE		0x1C030000
> +#endif
>   

Should that be a symbol instead? Then you can have

default 0xC0680000 if RCAR_64_CM
default 0x1C030000

for example.

Cheers,
Quentin


More information about the U-Boot mailing list