Skip to content

[RFC] Bouffalolab Vendor Support #83663

@VynDragon

Description

@VynDragon

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 specific HAL per se for Bouffalolab devices in the public SDK. The materials from the vendor that will be directly used here are the headers, which provide peripheral register details.

CPUs

Bouffalolab SoCs use various CPU designs:

  • SiFive (SiFive E24 on BL60x, BL70x and BL70xL)
  • Xuantie T-HEAD (E907 on BL61x, and C906, E907, E902 on BL808 and BL606P).

For both SiFive and Xuantie CPUs the reference manuals are public available.

Caches

Xuantie CPUs provide instruction caches and branch prediction. It can be configured via the XTHeadCMO RISCV extension and various CSR. The SiFive E24 do not provide a direct cache instead a peripheral called L1C (Level 1 Cache) is used. It is part of the ITCM from E24 to enable fast instruction fetch. The Bouffalo MCUs should use caching mechanisms to compensate the slow flash page load. When using it can be from 16KB up to 48KB dedicated I-Cache and should be handled with care.

The port will provide the mechanisms and their pitfalls within zephyr will be addressed on:

  • the initialization code
  • in the flash driver and
  • in the BL61x USB driver.

The management is critical in some drivers that interact with Flash and/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.
  • Some Cozylife Temperature sensors are supposed to feature BL602L, see https://www.elektroda.com/rtvforum/topic4081863.html for images. This item has been confirmed to feature BL602L10: https://aliexpress.com/item/1005006788062582.html
  • BL704L10 is available in this product: https://3reality.com/product/temperature-and-humidity-sensor-lite/, with JTAG and UART already broken out to headers, see FCC ID 2BAGQ-3RTHS0224Z

Peripherals Drivers

Most peripherals are either the same or very similar between SoCs. Due to this, the drivers will be implemented in a way that make them usable on all variants.

Task List

Milestone 0 :

Introduce the vendor.

Milestone 1:

Migration from SDK v1.4.5 headers to peripheral headers.

Milestone 2:

Finish clean-up

Milestone 3:

  • Introduce BL70x SoC
  • Add BL70x clock driver

Milestone 4:

  • Introduce BL61x SoC
  • Add BL61x clock driver

Dependencies

  • M0 -> M1 -> [M2 | M3 | M4]
  • After M0 new BL60x can be added
  • After M2/3/4 new drivers will be welcome for that specific series including:
    • WIFI
    • BLE
    • IEEE 802.15.4

References

SoCs

Boards

Drivers

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

Tools

Metadata

Metadata

Labels

MetaA collection of features, enhancements or bugsRFCRequest For Comments: want input from the community

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions