diff --git a/dts/arm/renesas/ra/r7fa4m1ab3cfm.dtsi b/dts/arm/renesas/ra/r7fa4m1ab3cfm.dtsi new file mode 100644 index 00000000000..8c1430d7790 --- /dev/null +++ b/dts/arm/renesas/ra/r7fa4m1ab3cfm.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include diff --git a/dts/arm/renesas/ra/ra-cm4-common.dtsi b/dts/arm/renesas/ra/ra-cm4-common.dtsi new file mode 100644 index 00000000000..a7c06b440cb --- /dev/null +++ b/dts/arm/renesas/ra/ra-cm4-common.dtsi @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-m4"; + reg = <0>; + }; + }; + + sram0: memory0@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(32)>; + }; + + soc { + fcu: flash-controller@4001c000 { + compatible = "renesas,ra-flash-controller"; + reg = <0x4001c000 0x44>; + reg-names = "fcache"; + + #address-cells = <1>; + #size-cells = <1>; + + flash0: flash0@0 { + compatible = "soc-nv-flash"; + reg = <0x00000000 DT_SIZE_K(256)>; + }; + + flash1: flash1@40100000 { + compatible = "soc-nv-flash"; + reg = <0x40100000 DT_SIZE_K(8)>; + }; + }; + }; +}; + +&nvic { + arm,num-irq-priority-bits = <4>; +}; diff --git a/dts/arm/renesas/ra/ra4-cm4-common.dtsi b/dts/arm/renesas/ra/ra4-cm4-common.dtsi new file mode 100644 index 00000000000..82d5d48a037 --- /dev/null +++ b/dts/arm/renesas/ra/ra4-cm4-common.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include diff --git a/soc/arm/renesas_ra/CMakeLists.txt b/soc/arm/renesas_ra/CMakeLists.txt new file mode 100644 index 00000000000..b6a22aa757b --- /dev/null +++ b/soc/arm/renesas_ra/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(common) + +add_subdirectory(${SOC_SERIES}) diff --git a/soc/arm/renesas_ra/Kconfig b/soc/arm/renesas_ra/Kconfig new file mode 100644 index 00000000000..628b75a93de --- /dev/null +++ b/soc/arm/renesas_ra/Kconfig @@ -0,0 +1,18 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config SOC_FAMILY_RA + bool + +if SOC_FAMILY_RA + +config SOC_FAMILY + string + default "renesas_ra" + +config SERIES_SPECIFIC_SOC_INIT + bool "Use series specific initialize" + +source "soc/arm/renesas_ra/*/Kconfig.soc" + +endif # SOC_FAMILY_RA diff --git a/soc/arm/renesas_ra/Kconfig.defconfig b/soc/arm/renesas_ra/Kconfig.defconfig new file mode 100644 index 00000000000..e5e211a94b3 --- /dev/null +++ b/soc/arm/renesas_ra/Kconfig.defconfig @@ -0,0 +1,4 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +source "soc/arm/renesas_ra/*/Kconfig.defconfig.series" diff --git a/soc/arm/renesas_ra/Kconfig.soc b/soc/arm/renesas_ra/Kconfig.soc new file mode 100644 index 00000000000..2652ee94d2e --- /dev/null +++ b/soc/arm/renesas_ra/Kconfig.soc @@ -0,0 +1,4 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +source "soc/arm/renesas_ra/*/Kconfig.series" diff --git a/soc/arm/renesas_ra/common/ra_common_soc.h b/soc/arm/renesas_ra/common/ra_common_soc.h new file mode 100644 index 00000000000..60559793743 --- /dev/null +++ b/soc/arm/renesas_ra/common/ra_common_soc.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_ARM_RENESAS_RA_COMMON_RA_COMMON_SOC_H_ +#define ZEPHYR_SOC_ARM_RENESAS_RA_COMMON_RA_COMMON_SOC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_SOC_ARM_RENESAS_RA_COMMON_RA_COMMON_SOC_H_ */ diff --git a/soc/arm/renesas_ra/ra4m1/CMakeLists.txt b/soc/arm/renesas_ra/ra4m1/CMakeLists.txt new file mode 100644 index 00000000000..45014584cbb --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +# empty diff --git a/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.r7fa4m1xxxxxx b/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.r7fa4m1xxxxxx new file mode 100644 index 00000000000..c138e20d85c --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.r7fa4m1xxxxxx @@ -0,0 +1,9 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +if SOC_R7FA4M1AB3CFM + +config SOC + default "r7fa4m1ab3cfm" + +endif # SOC_R7FA4M1AB3CFM diff --git a/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.series b/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.series new file mode 100644 index 00000000000..99e8e3f639d --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/Kconfig.defconfig.series @@ -0,0 +1,14 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_RA4M1 + +rsource "Kconfig.defconfig.r7fa4*" + +config SOC_SERIES + default "ra4m1" + +config NUM_IRQS + default 32 + +endif # SOC_SERIES_RA4M1 diff --git a/soc/arm/renesas_ra/ra4m1/Kconfig.series b/soc/arm/renesas_ra/ra4m1/Kconfig.series new file mode 100644 index 00000000000..5d958f2a898 --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/Kconfig.series @@ -0,0 +1,11 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_RA4M1 + bool "Renesas RA4M1" + select ARM + select CPU_CORTEX_M4 + select CPU_HAS_ARM_MPU + select CPU_CORTEX_M_HAS_SYSTICK + select SOC_FAMILY_RA + select XIP diff --git a/soc/arm/renesas_ra/ra4m1/Kconfig.soc b/soc/arm/renesas_ra/ra4m1/Kconfig.soc new file mode 100644 index 00000000000..a7b402fd291 --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/Kconfig.soc @@ -0,0 +1,11 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +choice + prompt "Renesas RA4M1 SoC Selection" + depends on SOC_SERIES_RA4M1 + +config SOC_R7FA4M1AB3CFM + bool "R7FA4M1AB3CFM" + +endchoice diff --git a/soc/arm/renesas_ra/ra4m1/linker.ld b/soc/arm/renesas_ra/ra4m1/linker.ld new file mode 100644 index 00000000000..44d5ee51889 --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/linker.ld @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + * + */ + +#include diff --git a/soc/arm/renesas_ra/ra4m1/soc.h b/soc/arm/renesas_ra/ra4m1/soc.h new file mode 100644 index 00000000000..127ee9ab444 --- /dev/null +++ b/soc/arm/renesas_ra/ra4m1/soc.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../common/ra_common_soc.h"