Skip to content

Commit 2adc306

Browse files
committed
plat: renesas: Add support for RZ/A series
Add support for Renesas RZ/A series Signed-off-by: Nhut Nguyen <[email protected]>
1 parent 713ffbf commit 2adc306

File tree

130 files changed

+24176
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+24176
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (c) 2024, Renesas Electronics Corporation. All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
XSPI0_DEVICE?=qspiflash_mx25l25645g
8+
XSPI_DEVICE_TYPE:=QSPI
9+
10+
NAND:=0
11+
RZ_FLASH_SIZE ?= 33554432 # 32MB
12+
$(eval $(call add_define,RZ_FLASH_SIZE))
13+
14+
ifneq (${USE_SDRAM},0)
15+
16+
ifeq (${DDR_PLL4},1333)
17+
DDR_SOURCES += plat/renesas/rz/soc/${PLAT}/drivers/ddr/param_mc_C-011_D3-02-1.c \
18+
plat/renesas/rz/common/drivers/ddr/param_swizzle_T1.c
19+
else
20+
DDR_PLL4 := 1600
21+
DDR_SOURCES += plat/renesas/rz/soc/${PLAT}/drivers/ddr/param_mc_C-011_D3-01-1.c \
22+
plat/renesas/rz/common/drivers/ddr/param_swizzle_T1.c
23+
endif
24+
25+
$(eval $(call add_define,DDR_PLL4))
26+
endif
27+
$(eval $(call add_define_val,XSPI_DEVICE_TYPE,\"${XSPI_DEVICE_TYPE}\"))
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (c) 2021, Renesas Electronics Corporation. All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
XSPI1_DEVICE?=octaflash_mx66uw
8+
XSPI1_IF_OPTION?=.device_size=128*1024*1024
9+
XSPI2_DEVICE?=octaram_apsxx
10+
XSPI2_IF_OPTION?=.device_size=64*1024*1024
11+
XSPI_DEVICE_TYPE:=OCTA
12+
13+
NAND:=0
14+
RZ_FLASH_SIZE ?= 134217728 # 128MB
15+
$(eval $(call add_define,RZ_FLASH_SIZE))
16+
17+
ifneq (${USE_SDRAM},0)
18+
DDR_SOURCES += plat/renesas/rz/soc/${PLAT}/drivers/ddr/param_mc_C-011_D4-01-2.c \
19+
plat/renesas/rz/common/drivers/ddr/param_swizzle_T3bcud2.c
20+
21+
DDR_PLL4 := 1600
22+
$(eval $(call add_define,DDR_PLL4))
23+
endif
24+
$(eval $(call add_define_val,XSPI_DEVICE_TYPE,\"${XSPI_DEVICE_TYPE}\"))
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) 2021, Renesas Electronics Corporation. All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
XSPI0_DEVICE?=qspiflash_at25
8+
XSPI_DEVICE_TYPE:=QSPI
9+
10+
NAND:=0
11+
RZ_FLASH_SIZE ?= 16777216 # 16MB
12+
$(eval $(call add_define,RZ_FLASH_SIZE))
13+
14+
ifneq (${USE_SDRAM},0)
15+
DDR_SOURCES += plat/renesas/rz/soc/${PLAT}/drivers/ddr/param_mc_C-011_D4-01-2.c \
16+
plat/renesas/rz/common/drivers/ddr/param_swizzle_T3bcud2.c
17+
18+
DDR_PLL4 := 1600
19+
$(eval $(call add_define,DDR_PLL4))
20+
endif
21+
$(eval $(call add_define_val,XSPI_DEVICE_TYPE,\"${XSPI_DEVICE_TYPE}\"))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3+
* Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
*/
7+
8+
#include <asm_macros.S>
9+
10+
.globl platform_mem_init
11+
.globl plat_my_core_pos
12+
.globl plat_crash_console_init
13+
.globl plat_crash_console_putc
14+
.globl plat_crash_console_flush
15+
16+
func platform_mem_init
17+
ret
18+
endfunc platform_mem_init
19+
20+
func plat_my_core_pos
21+
mrs x0, mpidr_el1
22+
lsr x0, x0, #MPIDR_AFF1_SHIFT
23+
and x0, x0, #MPIDR_CPU_MASK
24+
ret
25+
endfunc plat_my_core_pos
26+
27+
func plat_crash_console_init
28+
mov x0, #1
29+
ret
30+
endfunc plat_crash_console_init
31+
32+
func plat_crash_console_putc
33+
ret
34+
endfunc plat_crash_console_putc
35+
36+
func plat_crash_console_flush
37+
mov x0, #0
38+
ret
39+
endfunc plat_crash_console_flush
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <common/desc_image_load.h>
8+
#include <plat/common/platform.h>
9+
#include <rzg2l_def.h>
10+
11+
#if (RZG2L_BL33_EXECUTION_EL == 0)
12+
#define BL33_MODE MODE_EL1
13+
#else
14+
#define BL33_MODE MODE_EL2
15+
#endif
16+
17+
static bl_mem_params_node_t bl2_mem_params_descs[] = {
18+
#if (APPLOAD == RZ_NOFIP)
19+
{
20+
.image_id = MAX_IMAGE_IDS,
21+
22+
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
23+
entry_point_info_t, SECURE | EXECUTABLE | EP_FIRST_EXE),
24+
.ep_info.spsr = SPSR_64(MODE_EL3,
25+
MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
26+
.ep_info.pc = BSP_BASE,
27+
.ep_info.args.arg0 = (uintptr_t)PARAMS_BASE,
28+
29+
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
30+
image_info_t, IMAGE_ATTRIB_PLAT_SETUP | IMAGE_ATTRIB_SKIP_LOADING),
31+
32+
.next_handoff_image_id = INVALID_IMAGE_ID,
33+
}
34+
#else
35+
{
36+
#if RZA3
37+
.image_id = BL31_IMAGE_ID,
38+
39+
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
40+
entry_point_info_t, SECURE | EXECUTABLE | EP_FIRST_EXE),
41+
.ep_info.spsr = SPSR_64(MODE_EL3,
42+
MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
43+
.ep_info.pc = BSP_BASE,
44+
.ep_info.args.arg0 = (uintptr_t)PARAMS_BASE,
45+
46+
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
47+
image_info_t, IMAGE_ATTRIB_PLAT_SETUP | IMAGE_ATTRIB_SKIP_LOADING),
48+
.image_info.image_max_size = BSP_LIMIT - BSP_BASE,
49+
.image_info.image_base = BSP_BASE,
50+
51+
.next_handoff_image_id = INVALID_IMAGE_ID,
52+
#else
53+
.image_id = BL31_IMAGE_ID,
54+
55+
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
56+
entry_point_info_t, SECURE | EXECUTABLE | EP_FIRST_EXE),
57+
.ep_info.spsr = SPSR_64(MODE_EL3,
58+
MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
59+
.ep_info.pc = BL31_BASE,
60+
.ep_info.args.arg0 = (uintptr_t)PARAMS_BASE,
61+
62+
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
63+
image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
64+
.image_info.image_max_size = BL31_LIMIT - BL31_BASE,
65+
.image_info.image_base = BL31_BASE,
66+
67+
68+
# ifdef BL32_BASE
69+
.next_handoff_image_id = BL32_IMAGE_ID,
70+
# else
71+
.next_handoff_image_id = BL33_IMAGE_ID,
72+
# endif /* BL32_BASE */
73+
},
74+
# ifdef BL32_BASE
75+
{
76+
.image_id = BL32_IMAGE_ID,
77+
78+
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
79+
entry_point_info_t, SECURE | EXECUTABLE),
80+
.ep_info.pc = BL32_BASE,
81+
.ep_info.spsr = 0,
82+
83+
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
84+
image_info_t, 0),
85+
.image_info.image_max_size = BL32_LIMIT - BL32_BASE,
86+
.image_info.image_base = BL32_BASE,
87+
88+
.next_handoff_image_id = BL33_IMAGE_ID,
89+
},
90+
# endif /* BL32_BASE */
91+
{
92+
.image_id = BL33_IMAGE_ID,
93+
94+
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
95+
entry_point_info_t, NON_SECURE | EXECUTABLE),
96+
.ep_info.spsr = SPSR_64(BL33_MODE, MODE_SP_ELX,
97+
DISABLE_ALL_EXCEPTIONS),
98+
.ep_info.pc = BL33_BASE,
99+
100+
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
101+
image_info_t, 0),
102+
.image_info.image_max_size =
103+
(uint32_t) (BL33_LIMIT - BL33_BASE),
104+
.image_info.image_base = BL33_BASE,
105+
106+
.next_handoff_image_id = INVALID_IMAGE_ID,
107+
#endif /* RZA3 */
108+
}
109+
#endif /* (APPLOAD == RZ_NOFIP) */
110+
};
111+
112+
REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)

0 commit comments

Comments
 (0)