Skip to content

Commit 09c0a8b

Browse files
Hieu NguyenKhiemNguyenT
authored andcommitted
hal: renesas: rzt: Add support for RZ/T2L
Add HAL support for RZ/T2L Signed-off-by: Hieu Nguyen <[email protected]> Signed-off-by: Nhut Nguyen <[email protected]>
1 parent 3204903 commit 09c0a8b

Some content is hidden

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

43 files changed

+44521
-0
lines changed

drivers/rz/README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ Origin:
55
Renesas Electronics Corporation
66
RZ/G: https://github.com/renesas/rzg-fsp
77
RZ/N: https://github.com/renesas/rzn-fsp
8+
RZ/T: https://github.com/renesas/rzt-fsp
89

910
Status:
1011
RZ/G FSP: version v2.1.0
1112
RZ/N FSP: version v2.1.0
13+
RZ/T FSP: version v2.2.0
1214

1315
Purpose:
1416
Flexible Software Package (FSP) for Renesas RZ MPU Family.
@@ -27,6 +29,9 @@ URL:
2729
https://github.com/renesas/rzn-fsp
2830
Commit: dcdc687a97844038f909186c938aab98c056175d
2931

32+
https://github.com/renesas/rzt-fsp
33+
Commit: e66ab13216949c9ce5a09555171c422d5a323f1b
34+
3035
Maintained-by:
3136
Renesas Electronics Corporation
3237

drivers/rz/fsp/inc/instances/rzt/fsp_common_api.h

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef FSP_VERSION_H
8+
#define FSP_VERSION_H
9+
10+
/***********************************************************************************************************************
11+
* Includes
12+
**********************************************************************************************************************/
13+
14+
/* Includes board and MCU related header files. */
15+
#include "bsp_api.h"
16+
17+
/*******************************************************************************************************************//**
18+
* @addtogroup RENESAS_COMMON
19+
* @{
20+
**********************************************************************************************************************/
21+
22+
/**********************************************************************************************************************
23+
* Macro definitions
24+
**********************************************************************************************************************/
25+
26+
/** FSP pack major version. */
27+
#define FSP_VERSION_MAJOR (2U)
28+
29+
/** FSP pack minor version. */
30+
#define FSP_VERSION_MINOR (2U)
31+
32+
/** FSP pack patch version. */
33+
#define FSP_VERSION_PATCH (0U)
34+
35+
/** FSP pack version build number (currently unused). */
36+
#define FSP_VERSION_BUILD (0U)
37+
38+
/** Public FSP version name. */
39+
#define FSP_VERSION_STRING ("2.2.0")
40+
41+
/** Unique FSP version ID. */
42+
#define FSP_VERSION_BUILD_STRING ("Built with RZ/T Flexible Software Package version 2.2.0")
43+
44+
/**********************************************************************************************************************
45+
* Typedef definitions
46+
**********************************************************************************************************************/
47+
48+
/** FSP Pack version structure */
49+
typedef union st_fsp_pack_version
50+
{
51+
/** Version id */
52+
uint32_t version_id;
53+
54+
/** Code version parameters, little endian order. */
55+
struct version_id_b_s
56+
{
57+
uint8_t build; ///< Build version of FSP Pack
58+
uint8_t patch; ///< Patch version of FSP Pack
59+
uint8_t minor; ///< Minor version of FSP Pack
60+
uint8_t major; ///< Major version of FSP Pack
61+
} version_id_b;
62+
} fsp_pack_version_t;
63+
64+
/** @} */
65+
66+
#endif

drivers/rz/fsp/src/rzt/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
zephyr_compile_definitions(_RZT_ORDINAL=1)
3+
zephyr_compile_definitions(BSP_CFG_RAM_EXECUTION=1)
4+
5+
set(srcs
6+
bsp/cmsis/Device/RENESAS/Source/system.c
7+
bsp/mcu/all/bsp_clocks.c
8+
bsp/mcu/all/bsp_common.c
9+
bsp/mcu/all/bsp_delay.c
10+
bsp/mcu/all/bsp_io.c
11+
bsp/mcu/all/bsp_irq.c
12+
bsp/mcu/all/bsp_register_protection.c
13+
bsp/mcu/all/cr/bsp_delay_core.c
14+
)
15+
16+
zephyr_library_sources(${srcs})

drivers/rz/fsp/src/rzt/bsp/cmsis/Device/RENESAS/Include/R9A07G074.h

Lines changed: 32036 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/* Ensure Renesas MCU variation definitions are included to ensure MCU
8+
* specific register variations are handled correctly. */
9+
#ifndef BSP_FEATURE_H
10+
#error "INTERNAL ERROR: bsp_feature.h must be included before renesas.h."
11+
#endif
12+
13+
/** @addtogroup Renesas Electronics Corporation
14+
* @{
15+
*/
16+
17+
/** @addtogroup RZT2
18+
* @{
19+
*/
20+
21+
#ifndef RZT2_H
22+
#define RZT2_H
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
#include "../../../../mcu/all/bsp_compiler_support.h"
29+
30+
/* Define compiler macros for CPU architecture, used in CMSIS 5. */
31+
#if defined(__ICCARM__)
32+
#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__
33+
34+
/* Macros already defined */
35+
#else
36+
#if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__)
37+
#define __ARM_ARCH_8M_MAIN__ 1
38+
#elif defined(__ARM8M_BASELINE__)
39+
#define __ARM_ARCH_8M_BASE__ 1
40+
#elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M'
41+
#if __ARM_ARCH == 6
42+
#define __ARM_ARCH_6M__ 1
43+
#elif __ARM_ARCH == 7
44+
#if __ARM_FEATURE_DSP
45+
#define __ARM_ARCH_7EM__ 1
46+
#else
47+
#define __ARM_ARCH_7M__ 1
48+
#endif
49+
#endif /* __ARM_ARCH */
50+
#endif /* __ARM_ARCH_PROFILE == 'M' */
51+
#endif
52+
53+
/* Alternative core deduction for older ICCARM's */
54+
#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \
55+
!defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__)
56+
#if defined(__ARM6M__) && (__CORE__ == __ARM6M__)
57+
#define __ARM_ARCH_6M__ 1
58+
#elif defined(__ARM7M__) && (__CORE__ == __ARM7M__)
59+
#define __ARM_ARCH_7M__ 1
60+
#elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__)
61+
#define __ARM_ARCH_7EM__ 1
62+
#elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__)
63+
#define __ARM_ARCH_8M_BASE__ 1
64+
#elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__)
65+
#define __ARM_ARCH_8M_MAIN__ 1
66+
#elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__)
67+
#define __ARM_ARCH_8M_MAIN__ 1
68+
#elif defined(__ARM8R__) && (__CORE__ == __ARM8R__)
69+
#define __ARM_ARCH_8R__ 1
70+
#elif defined(__ARM8A__) && (__CORE__ == __ARM8A__)
71+
#define __ARM_ARCH_8A__ 1
72+
#else
73+
#error "Unknown target."
74+
#endif
75+
#endif
76+
#endif
77+
78+
/** @addtogroup Configuration_of_CMSIS
79+
* @{
80+
*/
81+
82+
/* =========================================================================================================================== */
83+
/* ================ Interrupt Number Definition ================ */
84+
/* =========================================================================================================================== */
85+
/* IRQn_Type is generated as part of an FSP project. It can be found in vector_data.h. */
86+
87+
/** @} */ /* End of group Configuration_of_CMSIS */
88+
89+
/* =========================================================================================================================== */
90+
/* ================ Processor and Core Peripheral Section ================ */
91+
/* =========================================================================================================================== */
92+
93+
#if __ARM_ARCH_7EM__
94+
#define RENESAS_CORTEX_M4
95+
#elif __ARM_ARCH_6M__
96+
#define RENESAS_CORTEX_M0PLUS
97+
#elif __ARM_ARCH_8M_BASE__
98+
#define RENESAS_CORTEX_M23
99+
#elif __ARM_ARCH_8M_MAIN__
100+
#define RENESAS_CORTEX_M33
101+
#elif __ARM_ARCH_8R__
102+
#define RENESAS_CORTEX_R52
103+
#elif __ARM_ARCH_8A__ || __ARM_ARCH_8A
104+
#define RENESAS_CORTEX_A55
105+
#else
106+
#warning Unsupported Architecture
107+
#endif
108+
109+
#if BSP_MCU_GROUP_RZT2M
110+
#include "R9A07G075.h"
111+
#elif BSP_MCU_GROUP_RZT2L
112+
#include "R9A07G074.h"
113+
#elif BSP_MCU_GROUP_RZT2ME
114+
#include "R9A07G075M29.h"
115+
#elif BSP_MCU_GROUP_RZT2H
116+
#include "R9A09G077.h"
117+
#else
118+
#warning Unsupported MCU
119+
#endif
120+
121+
#ifdef __cplusplus
122+
}
123+
#endif
124+
125+
#endif /* RZT2_H */
126+
127+
/** @} */ /* End of group RZT2 */
128+
129+
/** @} */ /* End of group Renesas Electronics Corporation */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef SYSTEM_RENESAS_ARM_H
8+
#define SYSTEM_RENESAS_ARM_H
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
#include <stdint.h>
15+
16+
extern uint32_t SystemCoreClock; /** System Clock Frequency (Core Clock) */
17+
18+
/**
19+
* Initialize the system
20+
*
21+
* @param none
22+
* @return none
23+
*
24+
* @brief Setup the microcontroller system.
25+
* Initialize the System and update the SystemCoreClock variable.
26+
*/
27+
extern void SystemInit(void);
28+
29+
/**
30+
* Update SystemCoreClock variable
31+
*
32+
* @param none
33+
* @return none
34+
*
35+
* @brief Updates the SystemCoreClock with current core Clock
36+
* retrieved from cpu registers.
37+
*/
38+
extern void SystemCoreClockUpdate(void);
39+
40+
#ifdef __cplusplus
41+
}
42+
#endif
43+
44+
#endif

0 commit comments

Comments
 (0)