Skip to content

Commit ada9ce3

Browse files
committed
soc: riscv: bouffalolab: Add bl60x series cpu
Add initial version. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent 398fedd commit ada9ce3

File tree

20 files changed

+676
-0
lines changed

20 files changed

+676
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2021-2025 Gerson Fernando Budke <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_HAL_BFLB_GLB_H_
8+
#define ZEPHYR_HAL_BFLB_GLB_H_
9+
10+
#ifdef CONFIG_SOC_SERIES_BL60X
11+
#include <bl602_glb.h>
12+
#endif
13+
14+
#endif /* ZEPHYR_HAL_BFLB_GLB_H_ */
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2021-2025 Gerson Fernando Budke <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_HAL_BFLB_HBN_H_
8+
#define ZEPHYR_HAL_BFLB_HBN_H_
9+
10+
#ifdef CONFIG_SOC_SERIES_BL60X
11+
#include <bl602_hbn.h>
12+
#endif
13+
14+
#endif /* ZEPHYR_HAL_BFLB_HBN_H_ */

soc/bouffalolab/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
add_subdirectory(common)
6+
add_subdirectory(${SOC_SERIES})

soc/bouffalolab/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SOC_FAMILY_BOUFFALOLAB_BFLB
6+
select HAS_BFLB_HAL
7+
8+
if SOC_FAMILY_BOUFFALOLAB_BFLB
9+
10+
rsource "*/Kconfig"
11+
12+
endif # SOC_FAMILY_BOUFFALOLAB_BFLB

soc/bouffalolab/Kconfig.defconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if SOC_FAMILY_BOUFFALOLAB_BFLB
6+
7+
config SYS_CLOCK_HW_CYCLES_PER_SEC
8+
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
9+
10+
rsource "*/Kconfig.defconfig"
11+
12+
endif # SOC_FAMILY_BOUFFALOLAB_BFLB

soc/bouffalolab/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SOC_FAMILY_BOUFFALOLAB_BFLB
6+
bool
7+
8+
config SOC_FAMILY
9+
default "bouffalolab_bflb" if SOC_FAMILY_BOUFFALOLAB_BFLB
10+
11+
rsource "*/Kconfig.soc"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_include_directories(.)
6+
zephyr_sources(soc.c)
7+
8+
zephyr_linker_sources_ifdef(CONFIG_SOC_SERIES_BL60X RODATA rodata.ld)
9+
10+
set(SOC_LINKER_SCRIPT
11+
${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld
12+
CACHE INTERNAL ""
13+
)

soc/bouffalolab/bl60x/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SOC_SERIES_BL60X
6+
select RISCV
7+
select RISCV_MACHINE_TIMER
8+
select RISCV_ISA_RV32I
9+
select RISCV_ISA_EXT_M
10+
select RISCV_ISA_EXT_A
11+
select RISCV_ISA_EXT_C
12+
select RISCV_ISA_EXT_ZICSR
13+
select RISCV_ISA_EXT_ZIFENCEI
14+
select ATOMIC_OPERATIONS_C
15+
select CPU_HAS_FPU
16+
select INCLUDE_RESET_VECTOR
17+
select SOC_EARLY_INIT_HOOK
18+
select XIP
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if SOC_SERIES_BL60X
6+
7+
config NUM_IRQS
8+
default 80
9+
10+
endif # SOC_SERIES_BL60X

soc/bouffalolab/bl60x/Kconfig.soc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SOC_SERIES_BL60X
6+
bool
7+
select SOC_FAMILY_BOUFFALOLAB_BFLB
8+
help
9+
Enable support for BouffaloLab BL6xx MCU series
10+
11+
config SOC_SERIES
12+
default "bl60x" if SOC_SERIES_BL60X
13+
14+
config SOC_BL602C00Q2I
15+
bool
16+
select SOC_SERIES_BL60X
17+
18+
config SOC_BL602C20Q2I
19+
bool
20+
select SOC_SERIES_BL60X
21+
22+
config SOC_BL602C20Q2IS
23+
bool
24+
select SOC_SERIES_BL60X
25+
26+
config SOC_BL602C40Q2IS
27+
bool
28+
select SOC_SERIES_BL60X
29+
30+
config SOC_BL602l10Q2H
31+
bool
32+
select SOC_SERIES_BL60X
33+
34+
config SOC_BL602l20Q2H
35+
bool
36+
select SOC_SERIES_BL60X
37+
38+
config SOC_BL604E20Q2I
39+
bool
40+
select SOC_SERIES_BL60X
41+
42+
config SOC
43+
default "bl602c00q2i" if SOC_BL602C00Q2I
44+
default "bl602c20q2i" if SOC_BL602C20Q2I
45+
default "bl602c20q2is" if SOC_BL602C20Q2IS
46+
default "bl602c40q2is" if SOC_BL602C40Q2IS
47+
default "bl602l10q2h" if SOC_BL602l10Q2H
48+
default "bl602l20q2h" if SOC_BL602l20Q2H
49+
default "bl604e20q2i" if SOC_BL604E20Q2I

0 commit comments

Comments
 (0)