Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b169a89
drivers: timer: Enable clic riscv machine timer
nandojve Aug 31, 2024
c71987d
west: Introduce hal bouffalo lab
nandojve Jul 18, 2021
0d79fd0
dts: bindings: vendor-prefixes: Add Bouffalo Lab prefix
nandojve Oct 14, 2024
60d4562
dts: riscv: bouffalolab: Add bl6 series cpu
nandojve Aug 3, 2021
5318a75
soc: riscv: bouffalolab: Add bl6 series cpu
nandojve Aug 3, 2021
d3ac8c9
soc: riscv: bouffalolab: Change to riscv-privileged
nandojve Jan 29, 2024
ba4daeb
drivers: pinctrl: bouffalolab: Add bflb pinctrl driver
nandojve Jan 27, 2024
784efc1
drivers: serial: bouffalolab: Add bflb serial driver
nandojve Aug 3, 2021
df8f88d
drivers: serial: bouffalolab: Add support to interrupts
nandojve Nov 11, 2021
b20d5ad
scripts: runner: Introduce blflash runner
nandojve Aug 7, 2021
2757196
boards: riscv: Introduce bl604e_iot_dvk
nandojve Apr 2, 2022
01828de
west.yml: Drop bouffalolab SDK dependency
VynDragon Aug 31, 2024
b45434d
soc: riscv: Rework bl60x to be SDK independent
VynDragon Aug 31, 2024
d032c73
dts: riscv: bouffalolab: Update bl60x series cpu
VynDragon Aug 31, 2024
902bb4e
drivers: pinctrl: bouffalolab: Update pinctrl driver
VynDragon Aug 31, 2024
dcaf4eb
drivers: gpio: bouffalolab: Add bflb gpio driver
VynDragon Aug 31, 2024
a32c5ce
drivers: serial: bouffalolab: Update serial driver
VynDragon Aug 31, 2024
3173294
scripts: runner: Introduce bflb_mcu_tool runner
VynDragon Aug 31, 2024
a699d4f
boards: riscv: bl604e_iot_dvk: Move to bl60x directory
nandojve Sep 9, 2024
5613e36
scripts: runner: Drop blflash in favor of bflb_mcu_tool
nandojve Sep 9, 2024
6cfc420
MAINTAINERS.yml: Add Bouffalo Lab entries
nandojve Sep 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ comment "Unavailable modules, please install those via the project manifest."
# config ZEPHYR_<MODULE_NAME_UPPER>_MODULE
# bool

comment "hal_bouffalolab module not available."
depends on !ZEPHYR_HAL_BOUFFALOLAB_MODULE

comment "hal_gigadevice module not available."
depends on !ZEPHYR_HAL_GIGADEVICE_MODULE

Expand Down
61 changes: 61 additions & 0 deletions modules/hal_bouffalolab/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright (c) 2021-2024 Gerson Fernando Budke <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_SOC_FAMILY_BFLB)

zephyr_library_named(hal_bouffalolab)

zephyr_compile_definitions(
ARCH_RISCV
)

zephyr_library_compile_definitions(
BFLB_USE_HAL_DRIVER
BFLB_USE_CUSTOM_LD_SECTIONS
)

set(bflb_soc ${CONFIG_SOC_SUB_SERIES})
set(bflb_drv_dir ${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/drivers/${bflb_soc}_driver)
set(bflb_common_dir ${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/common)
set(bflb_drv_src_dir ${bflb_drv_dir}/std_drv/src)

# Global includes to be used outside hal_gigadevice
zephyr_include_directories(
include
${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/include

${bflb_drv_dir}/regs
${bflb_drv_dir}/startup
${bflb_drv_dir}/std_drv/inc

${bflb_common_dir}/misc
)

zephyr_library_include_directories(
${bflb_common_dir}/soft_crc
)

zephyr_library_sources(
${bflb_drv_src_dir}/${bflb_soc}_aon.c
${bflb_drv_src_dir}/${bflb_soc}_ef_ctrl.c
${bflb_drv_src_dir}/${bflb_soc}_glb.c
${bflb_drv_src_dir}/${bflb_soc}_hbn.c
${bflb_drv_src_dir}/${bflb_soc}_l1c.c
${bflb_drv_src_dir}/${bflb_soc}_pds.c
${bflb_drv_src_dir}/${bflb_soc}_romapi.c

${bflb_common_dir}/soft_crc/softcrc.c
)

zephyr_library_sources_ifdef(CONFIG_USE_BFLB_ACOMP ${bflb_drv_src_dir}/${bflb_soc}_acomp.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_ADC ${bflb_drv_src_dir}/${bflb_soc}_adc.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_DAC ${bflb_drv_src_dir}/${bflb_soc}_dac.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_DMA ${bflb_drv_src_dir}/${bflb_soc}_dma.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_I2C ${bflb_drv_src_dir}/${bflb_soc}_i2c.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_IR ${bflb_drv_src_dir}/${bflb_soc}_ir.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_PWM ${bflb_drv_src_dir}/${bflb_soc}_pwm.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_SPI ${bflb_drv_src_dir}/${bflb_soc}_spi.c)
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_UART ${bflb_drv_src_dir}/${bflb_soc}_uart.c)

endif()
59 changes: 59 additions & 0 deletions modules/hal_bouffalolab/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (c) 2021-2024 Gerson Fernando Budke <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

config ZEPHYR_HAL_BOUFFALOLAB_MODULE
bool

config HAS_BFLB_HAL
bool

if HAS_BFLB_HAL

config USE_BFLB_ACOMP
bool
help
Enable BFLB Analog Comparator (ACOMP) HAL module driver

config USE_BFLB_ADC
bool
help
Enable BFLB Analog-to-Digital Converter (ADC) HAL module driver

config USE_BFLB_DAC
bool
help
Enable BFLB Digital-to-Analog Converter (DAC) HAL module driver

config USE_BFLB_DMA
bool
help
Enable BFLB Direct Memory Access controller (DMA) HAL module driver

config USE_BFLB_I2C
bool
help
Enable BFLB Inter-Integrated Circuit Interface (I2C) HAL module driver

config USE_BFLB_IR
bool
help
Enable BFLB Infrared Remote controller (IR) HAL module driver

config USE_BFLB_PWM
bool
help
Enable BFLB Pulse Width Modulation (PMU) HAL module driver

config USE_BFLB_SPI
bool
help
Enable BFLB Serial Peripheral Interface(SPI) HAL module driver

config USE_BFLB_UART
bool
help
Enable BFLB Universal Asynchronous Receiver/Transmitter (UART)
HAL module driver

endif # HAS_BFLB_HAL
25 changes: 25 additions & 0 deletions modules/hal_bouffalolab/include/bl_ld_sections.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2021-2024 Gerson Fernando Budke <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __BL_LD_SECTIONS_H
#define __BL_LD_SECTIONS_H

#define ATTR_STRINGIFY(x) #x
#define ATTR_TOSTRING(x) ATTR_STRINGIFY(x)
#define ATTR_UNI_SYMBOL __FILE__ ATTR_TOSTRING(__LINE__)
#define ATTR_CLOCK_SECTION __attribute__((section(".itcm.sclock_rlt_code." ATTR_UNI_SYMBOL)))
#define ATTR_CLOCK_CONST_SECTION __attribute__((section(".itcm.sclock_rlt_const." ATTR_UNI_SYMBOL)))
#define ATTR_TCM_SECTION __attribute__((section(".itcm.code." ATTR_UNI_SYMBOL)))
#define ATTR_TCM_CONST_SECTION __attribute__((section(".itcm.const." ATTR_UNI_SYMBOL)))
#define ATTR_DTCM_SECTION __attribute__((section(".dtcm.data")))
#define ATTR_HSRAM_SECTION __attribute__((section(".hsram_code")))
#define ATTR_DMA_RAM_SECTION __attribute__((section(".system_ram")))
#define ATTR_HBN_RAM_SECTION __attribute__((section(".hbn_ram_code")))
#define ATTR_HBN_RAM_CONST_SECTION __attribute__((section(".hbn_ram_data")))
#define ATTR_FALLTHROUGH() __attribute__((fallthrough))
#define ATTR_USED __attribute__((__used__))
#define ATTR_EALIGN(x) __aligned(size)

#endif /* __BL_LD_SECTIONS_H */
8 changes: 8 additions & 0 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ manifest:
url-base: https://github.com/zephyrproject-rtos
- name: babblesim
url-base: https://github.com/BabbleSim
- name: nandojve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should never be in the commit history, I am not sure what exactly are we achieving by leaving something like that in the manifest. Manifest changes must be squashed and always point to a tree hosted by the zephyr project.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, but there is no hal_bouffalolab yet. It is possible to use only one manifest version if we delay to introduce the board as one the latest commits. That will prevent bisect errors for this new platform because there won't be a target until the first board.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, but there is no hal_bouffalolab yet.

Until there is, a PR pointing at your personal repo is a "demo" PR, not ready for merge yet. It should be demoted to a GitHub draft to make sure it cannot be merged and to be excluded from PR scrubbing and stats. The PR name should be adjusted accordingly. There's also a DNM label.

It is possible to use only one manifest version if we delay to introduce the board as one the latest commits.

Yes: bisectability requires that dependencies are always added before dependants. That's true no matter how many commits or PRs there are. It's fine if brand new code or HAL is not immediately tested yet but in the next commits/PRs coming right after.

url-base: https://github.com/nandojve

group-filter: [-babblesim, -optional]

Expand Down Expand Up @@ -161,6 +163,12 @@ manifest:
path: modules/hal/atmel
groups:
- hal
- name: hal_bouffalolab
remote: nandojve
path: modules/hal/bouffalolab
revision: sdk-v1.4.5
groups:
- hal
- name: hal_espressif
revision: e52371024732a47a67fa9c889fbccd0aa6355f3a
path: modules/hal/espressif
Expand Down