Skip to content
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

[RFC] Bouffalolab Vendor Support #83663

Open
2 of 76 tasks
VynDragon opened this issue Jan 7, 2025 · 1 comment
Open
2 of 76 tasks

[RFC] Bouffalolab Vendor Support #83663

VynDragon opened this issue Jan 7, 2025 · 1 comment
Assignees
Labels
Meta A collection of features, enhancements or bugs RFC Request For Comments: want input from the community

Comments

@VynDragon
Copy link
Contributor

VynDragon commented Jan 7, 2025

Introduction

There is community interest to add support for Bouffalolab SoCs in Zephyr. This RFC was opened to serve as an umbrella to help community and Zephyr members know the initiatives.

Problem description

There is a pull request for the initial support: #78795 .
Work is ongoing for more.

Proposed changes

Give an overview about all pieces required to add Bouffalolab SoCs in Zephyr.

Detailed RFC

In this section of the document the target audience is the dev team. Upon reading this section each engineer should have a rather clear picture of what needs to be done in order to implement the described feature.

Vendor Documentation and SDK

Bouffalolab provides a open source SDK which can be used for reference, especially for peripherals for which the documentation is incomplete or absent.
There is some significant amount of documentation available in https://github.com/bouffalolab/bl_docs .

HAL

There is no HAL per se for Bouffalolab devices, the only materials from the vendor that are directly used are the headers providing peripheral register lists. These headers are Apache 2 and we are awaiting Bouffalolab confirmation for their usage in a zephyr HAL repository.

CPUs

Bouffalolab SoCs use various CPU designs: from SiFive (SiFive E24 on BL60x, BL70x and BL70xL), and from Xuantie T-HEAD (E907 on BL61x, and C906, E907, E902 on BL808 and BL606P).
SiFive E24 Reference Manual is available from sources such as starfive or alibaba. Xuantie CPUs reference manuals are available directly on Xuantie's website after registration.

Caches

Xuantie CPUs provide instruction caches and branch prediction, configured via the XTHeadCMO RISCV extension and various CSR.
The SiFive E24 used in BL60x and BL70x do not provide a cache, but Bouffalolab uses a peripheral, called L1C (Level 1 Cache) to use part of the ITCM from E24 as a fast instruction cache.
BL60x, BL70x, and BL61x rely heavily on these caching mechanisms due to slow flash, with 16KB to 48KB dedicated to instruction caching on the fastest memory in the device, it is recommended to pay close attention to it.
Examples of using those mechanisms and their pitfalls within zephyr are available in the initialization code, the flash driver, and the BL61x USB driver. It is very critical in drivers interacting with the flash or DMA.

Availability for developers

Devboards and modules for BL60x and BL61x are easily available from AI-Thinker, Pine64, and Sipeed via typical channels (Amazon, Aliexpress, LCSC...).
Devboards and modules for BL70x are sometimes available from XT/DOIT. Some noname boards are also available. It is also embbeded in some Sipeed products, such as the RV-debugger.
Devboards and modules for BL808 are available from Sipeed and Pine64.
BL606P is so far only available in the Pine64 PineVox.
TG7100C is a alternative packaging of BL602, available from AI-Thinker via typical channels.
Xiaomi offers modules for BL616 and BL602 at https://iot.mi.com/moduleBrowser.html
Qualcomm offers BL61x as QCC74x.

Peripherals Drivers

Most peripherals are either the same or very similar between SoCs. It is recommended to implement drivers in a way that make them usable for all SoCs.

Task List

Essentials

Essentials are understood to be:

The initial support will be submitted in a series:

Future

  • 72102 Clock driver for BL60x
  • 72102 Clock driver for BL61x
  • 72102 Clock driver for BL70x

SoCs

Boards

Drivers

Drivers are 'complete' if they support all currently complete SoCs.

@VynDragon VynDragon added the RFC Request For Comments: want input from the community label Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

Hi @VynDragon! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@henrikbrixandersen henrikbrixandersen added the Meta A collection of features, enhancements or bugs label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta A collection of features, enhancements or bugs RFC Request For Comments: want input from the community
Projects
Status: No status
Development

No branches or pull requests

3 participants