]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm64: renesas: Add Cortex-M33 build option to R-Car Gen5
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Mon, 27 Apr 2026 01:10:15 +0000 (03:10 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Tue, 5 May 2026 10:53:53 +0000 (12:53 +0200)
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@mailbox.org>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
arch/arm/mach-renesas/Kconfig
arch/arm/mach-renesas/Kconfig.rcar5
arch/arm/mach-renesas/include/mach/rcar-gen5-base.h
include/configs/rcar-gen5-common.h

index fa4e312a4dd5a2ac5898697be00be0e53a2ec278..f86acc3103939c388bf1591ca5a81ea39ec8f56c 100644 (file)
@@ -1,15 +1,19 @@
 if ARCH_RENESAS
 
-# Renesas ARM SoCs R-Car Gen3/Gen4 (64bit)
+config TMU_TIMER
+       bool
+
+# Renesas ARM SoCs R-Car Gen3/Gen4/Gen5 (64bit Cortex-A / 32bit Cortex-M/R)
 config RCAR_64
        bool
-       select ARM64
+       select CPU_V8M if RCAR_64_RSIP
+       select ARM64 if !RCAR_64_RSIP
        select CMD_CACHE
-       select OF_BOARD_SETUP
+       select OF_BOARD_SETUP if !RCAR_64_RSIP
        select PHY
        select PINCONF
        select PINCTRL
-       select POSITION_INDEPENDENT
+       select POSITION_INDEPENDENT if !RCAR_64_RSIP
        imply CMD_FS_UUID
        imply CMD_GPT
        imply CMD_MMC_SWRITE if MMC
index 528fc5aecc9f6e7bcf3960cfd5dd6fe80315c61b..0e0e43c08e430f07f3dff74b3f3bae9c196fdc1a 100644 (file)
@@ -1,5 +1,13 @@
 if RCAR_GEN5
 
+config RCAR_64_RSIP
+       bool "Renesas ARM SoCs R-Car Gen5 (use Cortex-M33 RSIP)"
+       select SKIP_RELOCATE_CODE
+       select TMU_TIMER
+       help
+         Build U-Boot for the Cortex-M33 RSIP 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
@@ -23,4 +31,7 @@ endchoice
 
 source "board/renesas/ironhide/Kconfig"
 
+config SKIP_RELOCATE_CODE_DATA_OFFSET
+       default 0xa0000000 if RCAR_64_RSIP
+
 endif
index f9af3ef885a5e6eb0c1d8215d233bc8cd0417706..35b0d00e45c2823472d56e31eeefa29e07c6bcd0 100644 (file)
@@ -9,7 +9,13 @@
 /*
  * R-Car (R8A78000) I/O Addresses
  */
+#if defined(CONFIG_RCAR_64_RSIP)
+/* Cortex-M33 address */
+#define TMU_BASE               0xC0680000
+#else
+/* Cortex-A720AE address */
 #define TMU_BASE               0x1C030000
+#endif
 
 /* Arm Generic Timer */
 #define CNTCR_BASE             0x1C000FFF /* Region 0 */
index dc28d07c7f90d1ba59c9d07a749a8f0a41fa1044..81b5e2aa5bb3521dc325fbb7df87fbd037782647 100644 (file)
 #define CFG_SYS_SDRAM_SIZE             (0x80000000u - DRAM_RSV_SIZE)
 #define CFG_MAX_MEM_MAPPED             (0x80000000u - DRAM_RSV_SIZE)
 
+/* Timer */
+#if defined(CONFIG_RCAR_64_RSIP)
+#define CFG_SYS_TIMER_COUNTER          (TMU_BASE + 0xc)        /* TCNT0 */
+#define CFG_SYS_TIMER_RATE             (133333333 / 4)
+#endif
+
 /* Environment setting */
 #define CFG_EXTRA_ENV_SETTINGS         \
        "bootm_size=0x10000000\0"