Skip to content

Introduce Bouffalo Lab SoC's [patch 1] #84173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 23, 2025

Conversation

nandojve
Copy link
Member

@nandojve nandojve commented Jan 17, 2025

This PR is intent to continue the work started at #37686. It rewrite the original work to be compatible with Zephyr 4.1.

This is the first PR of a series, which includes:

  • Add BouffaloLab vendor
  • Add BL-60x SoC.
  • Pinctrl
  • Serial
  • bl604e_iot_dvk (development kit) - It can only be obtained directly with Bouffalo Lab
    * Add bfflash runner to easy flash

This is an split of #78795

RFC of reference: #83663

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 17, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_bouffalolab 🆕 N/A (Added) zephyrproject-rtos/hal_bouffalolab@c6c44b8 (main) N/A

DNM label due to: 1 added project

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch 4 times, most recently from 6cbbaa4 to c0018bb Compare January 24, 2025 12:01
@nandojve nandojve requested a review from nordicjm January 24, 2025 14:19
@fabiobaltieri fabiobaltieri added DNM (manifest) This PR should not be merged (controlled by action-manifest) and removed DNM This PR should not be merged (Do Not Merge) labels Feb 4, 2025
@profound1987
Copy link

Hi Nandovje
Bouffalo Team is also doing some porting work on zephyr and using Bouffalo SDK' lhal https://github.com/bouffalolab/bouffalo_sdk/tree/master/drivers/lhal and the lhal driver will be Long-Term Supported for peripherals' driver. from the code, it seems that the driver is based on std driver(from IOT SDK?) How about having a discussion on this. Thanks.

@nandojve
Copy link
Member Author

Hi Nandovje Bouffalo Team is also doing some porting work on zephyr and using Bouffalo SDK' lhal https://github.com/bouffalolab/bouffalo_sdk/tree/master/drivers/lhal and the lhal driver will be Long-Term Supported for peripherals' driver. from the code, it seems that the driver is based on std driver(from IOT SDK?)

Hi @profound1987 ,

Nice to talk with you again : )

Is the lhal a result from bouffalolab/bouffalo_sdk#14 request ?

We have a RFC #83663 that gives some directions about how we would like proceed. This is the first step to add Bouffalo Lab vendor in Zephyr mainline. Last week we got green light to have the hal_bouffalolab and we are waiting the hal folder be offered to us to commit the initial version. Our plan is after a few rounds complete migrate from original sdk 1.4.5.

How about having a discussion on this. Thanks.

We are always open to talk. Send me pvt email to us schedule a meeting.

@profound1987
Copy link

Hi @nandojve
Boffalo is very grateful for the work you have done. The lhal layer adopts the ideas we previously discussed to consolidate drivers for common IP, while the soc directory contains chip-specific components such as clocks and low-power features. In other words, lhal simultaneously supports the 602/702/616 series. The reason we plan to use lhal is that once it’s adapted in Zephyr’s drivers, enabling Zephyr to support the 602/702/616 series becomes a very straightforward task. Morever, we are also developing new chips and they are also based on lhal.
├── lhal
│   ├── CHANGELOG.md
│   ├── CMakeLists.txt
│   ├── config
│   ├── include
│   └── src
├── rfparam
│   ├── CMakeLists.txt
│   ├── Inc
│   ├── README.md
│   ├── Src
│   └── bouffalo.mk
├── soc
│   ├── bl602
│   ├── bl616
│   ├── bl702
│   ├── bl702l
│   └── bl808

I notice that the driver that you are using is https://github.com/bouffalolab/bouffalo_sdk/tree/release_v1.4.5, it's out of date for long time, we really sorry for that we have not update bouffalo sdk release, the current code on master branch is based on lhal, you can take a look. I will also do a release on bouffalo sdk.

@VynDragon
Copy link
Collaborator

VynDragon commented Feb 25, 2025

Hello @profound1987 , please refer to the RFC at #83663 for further discussions. Here is the first PR of many and not the place to discuss general Bouffalolab support. There is also a brand new vendor channel in the Zephyr discord if you want to discuss this more instantly. Further Details (and answers to your message) will be dispatched on the RFC at #83663.

@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch from c0018bb to b53eb5d Compare March 12, 2025 17:14
@nandojve nandojve added this to the v4.2.0 milestone Mar 12, 2025
Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

some early observations.

BFLB_USE_CUSTOM_LD_SECTIONS
)

set(bflb_soc bl602)
Copy link
Collaborator

Choose a reason for hiding this comment

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

just an observation, but this decouples the passed to the hal from the SoC described by the soc.yml and in Kconfig, which in future can make it harder to find / handle if support for other bouffalo SoCs is introduced.

Not a request to change now, but please consider if this could be improved if addressing other comments.

Copy link
Member Author

@nandojve nandojve Mar 23, 2025

Choose a reason for hiding this comment

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

Noted. It will be improved soon on other PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this header being included anywhere.

Can you please provide some more info ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is defined to replace the default sections inside the drivers functions inside HAL. There is an improvement planned to remove all this.

https://github.com/zephyrproject-rtos/hal_bouffalolab/blob/c6c44b879503d990dfba643c212b606cee414faa/common/misc/compiler/common.h#L43-L65

@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch from b53eb5d to 1192d6d Compare March 23, 2025 14:32
@nandojve nandojve marked this pull request as ready for review March 23, 2025 14:34
@nandojve nandojve requested a review from tejlmand March 23, 2025 14:34
@zephyrbot zephyrbot added area: Process area: UART Universal Asynchronous Receiver-Transmitter area: Devicetree area: West West utility labels Mar 23, 2025
@nandojve
Copy link
Member Author

nandojve commented Apr 17, 2025

Hi @mbolivar and @gmarull ,

Could you revist the PR? I drop the blflash tool support and would like a review from the assignee.
I would like to know what is missing to introduce this vendor.

Needs rebase due to conflict with pinctrl.

Add initial version that uses bouffalo_sdk 1.4.5.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add necessary bflb prefix to be used on devicetree bindings and identify
the board vendor.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Introduce Bouffalo Lab vendor with BL60x cpu.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add initial version.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add Bouffalo Lab pinctrl driver.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add Bouffalo Lab serial driver. The driver uses pinctrl to configure
pins and have power management capabilities.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add initial version.

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch from c85ae38 to c27eefd Compare April 17, 2025 14:19
@gmarull gmarull removed their assignment Apr 17, 2025
@gmarull gmarull requested a review from nordicjm April 17, 2025 14:21
@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch from c27eefd to ff960ed Compare April 17, 2025 17:47
Introduce Bouffalo Lab platform.

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve nandojve force-pushed the bflb/bflb_upstream_v1 branch from ff960ed to 2770da0 Compare April 17, 2025 17:49
@nandojve nandojve removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Apr 23, 2025
@nandojve
Copy link
Member Author

The manifest is up to date but BOT is not removing the DNM label (manifest)

@nandojve nandojve dismissed mbolivar’s stale review April 23, 2025 09:20

Just one minor, but IMO blocking, nit in the west flasher, otherwise this looks great to me! Awesome stuff @nandojve , amazing persistence working on this

The content was removed. A convenience tool will be introduced later.

@nandojve
Copy link
Member Author

Hi @tejlmand,

Could you revisit to confirm that your concerns were addressed.

@kartben kartben added the DNM This PR should not be merged (Do Not Merge) label Apr 23, 2025
@kartben
Copy link
Collaborator

kartben commented Apr 23, 2025

Added DNM to give @mbolivar time to respond as per our processes.

@kartben kartben removed the DNM This PR should not be merged (Do Not Merge) label Apr 23, 2025
@kartben kartben merged commit b939b1d into zephyrproject-rtos:main Apr 23, 2025
35 of 37 checks passed
@nandojve nandojve deleted the bflb/bflb_upstream_v1 branch April 24, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.