Skip to content

Commit da744e2

Browse files
thaoluonguwandrzej-kaczmarek
authored andcommitted
hal: renesas: ra: Add bsp configuration files for ra8m1
Move cfg files from zephyr OS to hal_renesas Signed-off-by: Thao Luong <[email protected]>
1 parent 54ffb45 commit da744e2

File tree

6 files changed

+727
-0
lines changed

6 files changed

+727
-0
lines changed

ra/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ zephyr_library_sources(${srcs})
2121

2222
message(${CONFIG_SOC_SERIES})
2323
zephyr_include_directories(fsp/ra/fsp/src/bsp/mcu/${CONFIG_SOC_SERIES})
24+
zephyr_include_directories(ra_cfg/fsp_cfg/bsp/${CONFIG_SOC_SERIES})
2425

2526
# Optional build base on feature configuration
2627
zephyr_library_sources_ifdef(CONFIG_USE_RA_FSP_SCI_B_UART
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef ZEPHYR_SOC_RENESAS_RA_COMMON_BSP_CFG_H_
8+
#define ZEPHYR_SOC_RENESAS_RA_COMMON_BSP_CFG_H_
9+
10+
#include "soc.h"
11+
#include "bsp_clock_cfg.h"
12+
#include "bsp_mcu_family_cfg.h"
13+
14+
#define BSP_CFG_PARAM_CHECKING_ENABLE (0)
15+
16+
/* Add for zephyr porting */
17+
#define BSP_CFG_INTERRUPT_INIT 0
18+
#define BSP_CFG_SP_MON_INIT 0
19+
20+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_POPULATED
21+
#define BSP_CLOCK_CFG_MAIN_OSC_POPULATED (1)
22+
#endif
23+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE
24+
#define BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE (0)
25+
#endif
26+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_DRIVE
27+
#define BSP_CLOCK_CFG_SUBCLOCK_DRIVE (0)
28+
#endif
29+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_POPULATED
30+
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
31+
#endif
32+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS
33+
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
34+
#endif
35+
36+
#endif /* ZEPHYR_SOC_RENESAS_RA_COMMON_BSP_CFG_H_ */
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <zephyr/devicetree.h>
8+
9+
#ifndef BSP_CLOCK_CFG_H_
10+
#define BSP_CLOCK_CFG_H_
11+
12+
#define BSP_CFG_CLOCKS_SECURE (0)
13+
#define BSP_CFG_CLOCKS_OVERRIDE (0)
14+
15+
#define BSP_CFG_XTAL_HZ DT_PROP(DT_NODELABEL(xtal), clock_frequency)
16+
17+
#if DT_PROP(DT_NODELABEL(hoco), clock_frequency) == 16000000
18+
#define BSP_CFG_HOCO_FREQUENCY 0 /* HOCO 16MHz */
19+
#elif DT_PROP(DT_NODELABEL(hoco), clock_frequency) == 18000000
20+
#define BSP_CFG_HOCO_FREQUENCY 1 /* HOCO 18MHz */
21+
#elif DT_PROP(DT_NODELABEL(hoco), clock_frequency) == 20000000
22+
#define BSP_CFG_HOCO_FREQUENCY 2 /* HOCO 20MHz */
23+
#elif DT_PROP(DT_NODELABEL(hoco), clock_frequency) == 32000000
24+
#define BSP_CFG_HOCO_FREQUENCY 4 /* HOCO 32MHz */
25+
#elif DT_PROP(DT_NODELABEL(hoco), clock_frequency) == 48000000
26+
#define BSP_CFG_HOCO_FREQUENCY 7 /* HOCO 48MHz */
27+
#else
28+
#error "Invalid HOCO frequency, only can be set to 16MHz, 18MHz, 20MHz, 32MHz, 48MHz"
29+
#endif
30+
31+
#define BSP_CFG_PLL_SOURCE DT_PROP(DT_NODELABEL(clock), pll_source)
32+
#define BSP_CFG_PLL_DIV DT_PROP(DT_NODELABEL(clock), pll_div)
33+
#define BSP_CFG_PLL_MUL \
34+
BSP_CLOCKS_PLL_MUL(DT_PROP_BY_IDX(DT_NODELABEL(clock), pll_mul, 0), \
35+
DT_PROP_BY_IDX(DT_NODELABEL(clock), pll_mul, 1))
36+
37+
#define BSP_CFG_PLODIVP DT_PROP(DT_NODELABEL(clock), pll_divp)
38+
#define BSP_CFG_PLL1P_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll_freqp)
39+
#define BSP_CFG_PLODIVQ DT_PROP(DT_NODELABEL(clock), pll_divq)
40+
#define BSP_CFG_PLL1Q_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll_freqq)
41+
#define BSP_CFG_PLODIVR DT_PROP(DT_NODELABEL(clock), pll_divr)
42+
#define BSP_CFG_PLL1R_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll_freqr)
43+
44+
#define BSP_CFG_PLL2_SOURCE DT_PROP(DT_NODELABEL(clock), pll2_source)
45+
#define BSP_CFG_PLL2_DIV DT_PROP(DT_NODELABEL(clock), pll2_div)
46+
#define BSP_CFG_PLL2_MUL \
47+
BSP_CLOCKS_PLL_MUL(DT_PROP_BY_IDX(DT_NODELABEL(clock), pll2_mul, 0), \
48+
DT_PROP_BY_IDX(DT_NODELABEL(clock), pll2_mul, 1))
49+
50+
#define BSP_CFG_PL2ODIVP DT_PROP(DT_NODELABEL(clock), pll2_divp)
51+
#define BSP_CFG_PLL2P_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll2_freqp)
52+
#define BSP_CFG_PL2ODIVQ DT_PROP(DT_NODELABEL(clock), pll2_divq)
53+
#define BSP_CFG_PLL2Q_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll2_freqq)
54+
#define BSP_CFG_PL2ODIVR DT_PROP(DT_NODELABEL(clock), pll2_divr)
55+
#define BSP_CFG_PLL2R_FREQUENCY_HZ DT_PROP(DT_NODELABEL(clock), pll2_freqr)
56+
57+
#define BSP_CFG_CLOCK_SOURCE DT_PROP(DT_NODELABEL(clock), sysclock_source)
58+
#define BSP_CFG_CPUCLK_DIV DT_PROP(DT_NODELABEL(clock), cpuclk_div)
59+
60+
#define BSP_CFG_ICLK_DIV DT_PROP(DT_NODELABEL(clock), iclk_div)
61+
#define BSP_CFG_PCLKA_DIV DT_PROP(DT_NODELABEL(clock), pclka_div)
62+
#define BSP_CFG_PCLKB_DIV DT_PROP(DT_NODELABEL(clock), pclkb_div)
63+
#define BSP_CFG_PCLKC_DIV DT_PROP(DT_NODELABEL(clock), pclkc_div)
64+
#define BSP_CFG_PCLKD_DIV DT_PROP(DT_NODELABEL(clock), pclkd_div)
65+
#define BSP_CFG_PCLKE_DIV DT_PROP(DT_NODELABEL(clock), pclke_div)
66+
#define BSP_CFG_BCLK_DIV DT_PROP(DT_NODELABEL(clock), bclk_div)
67+
#define BSP_CFG_BCLK_OUTPUT DT_PROP(DT_NODELABEL(clock), bclk_out)
68+
#define BSP_CFG_FCLK_DIV DT_PROP(DT_NODELABEL(clock), fclk_div)
69+
#define BSP_CFG_SDCLK_OUTPUT DT_PROP(DT_NODELABEL(clock), sdclk_out)
70+
71+
#define BSP_CFG_UCK_SOURCE DT_PROP(DT_NODELABEL(clock), uclk_source)
72+
#define BSP_CFG_UCK_DIV DT_PROP(DT_NODELABEL(clock), uclk_div)
73+
#define BSP_CFG_U60CK_SOURCE DT_PROP(DT_NODELABEL(clock), u60clk_source)
74+
#define BSP_CFG_U60CK_DIV DT_PROP(DT_NODELABEL(clock), u60clk_div)
75+
#define BSP_CFG_OCTA_SOURCE DT_PROP(DT_NODELABEL(clock), octaspiclk_source)
76+
#define BSP_CFG_OCTA_DIV DT_PROP(DT_NODELABEL(clock), octaspiclk_div)
77+
#define BSP_CFG_CANFDCLK_SOURCE DT_PROP(DT_NODELABEL(clock), canfdclk_source)
78+
#define BSP_CFG_CANFDCLK_DIV DT_PROP(DT_NODELABEL(clock), canfdclk_div)
79+
#define BSP_CFG_CLKOUT_SOURCE DT_PROP(DT_NODELABEL(clock), clkout_source)
80+
#define BSP_CFG_CLKOUT_DIV DT_PROP(DT_NODELABEL(clock), clkout_div)
81+
#define BSP_CFG_SCICLK_SOURCE DT_PROP(DT_NODELABEL(clock), sciclk_source)
82+
#define BSP_CFG_SCICLK_DIV DT_PROP(DT_NODELABEL(clock), sciclk_div)
83+
#define BSP_CFG_SPICLK_SOURCE DT_PROP(DT_NODELABEL(clock), spiclk_source)
84+
#define BSP_CFG_SPICLK_DIV DT_PROP(DT_NODELABEL(clock), spiclk_div)
85+
#define BSP_CFG_ADCCLK_SOURCE DT_PROP(DT_NODELABEL(clock), adcclk_source)
86+
#define BSP_CFG_ADCCLK_DIV DT_PROP(DT_NODELABEL(clock), adcclk_div)
87+
#define BSP_CFG_I3CCLK_SOURCE DT_PROP(DT_NODELABEL(clock), i3cclk_source)
88+
#define BSP_CFG_I3CCLK_DIV DT_PROP(DT_NODELABEL(clock), i3cclk_div)
89+
90+
#endif /* BSP_CLOCK_CFG_H_ */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef BSP_MCU_DEVICE_CFG_H_
8+
#define BSP_MCU_DEVICE_CFG_H_
9+
#define BSP_CFG_MCU_PART_SERIES (8)
10+
#endif /* BSP_MCU_DEVICE_CFG_H_ */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef BSP_MCU_DEVICE_PN_CFG_H_
8+
9+
#if defined(CONFIG_SOC_R7FA8M1AHECBD)
10+
#define BSP_MCU_R7FA8M1AHECBD
11+
#define BSP_MCU_FEATURE_SET ('A')
12+
#define BSP_ROM_SIZE_BYTES (2064384)
13+
#define BSP_RAM_SIZE_BYTES (917504)
14+
#define BSP_DATA_FLASH_SIZE_BYTES (12288)
15+
#define BSP_PACKAGE_BGA
16+
#define BSP_PACKAGE_PINS (224)
17+
#endif
18+
19+
#endif /* BSP_MCU_DEVICE_PN_CFG_H_ */

0 commit comments

Comments
 (0)