Skip to content

drivers: syscon: bflb efuses #89108

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

VynDragon
Copy link
Collaborator

@VynDragon VynDragon commented Apr 25, 2025

This introduces bflb efuse access via syscon api.

This is not used at the moment but will be in the next steps of integration (for clock_control and things like DAC and ADC).

Copy link

github-actions bot commented Apr 25, 2025

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

Name Old Revision New Revision Diff
hal_bouffalolab zephyrproject-rtos/hal_bouffalolab@c6c44b8 zephyrproject-rtos/hal_bouffalolab@5811738 (main) zephyrproject-rtos/[email protected]

All manifest checks OK

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

@github-actions github-actions bot added manifest manifest-hal_bouffalolab DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Apr 25, 2025
Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Is the EEPROM API really the correct one to use here?

@VynDragon
Copy link
Collaborator Author

VynDragon commented Apr 26, 2025

Is the EEPROM API really the correct one to use here?

That is one of the main questions yea, what alternatives is there?

@henrikbrixandersen
Copy link
Member

Is the EEPROM API really the correct one to use here?

That is one of the main questions yea, what alternatives is there?

If you are just reading the eFUSE settings, perhaps the syscon API is better suited?

@VynDragon
Copy link
Collaborator Author

VynDragon commented Apr 26, 2025

It looks like it would fit yea... Is there any example driver for it that doesnt just read memory actually? Or would that be a first driver for a syscon interface?

@nandojve
Copy link
Member

needs rebase

@VynDragon VynDragon force-pushed the bl60x_efuses branch 2 times, most recently from 6515391 to f9d7b8c Compare May 2, 2025 14:52
@VynDragon
Copy link
Collaborator Author

Rebased and made to use syscon.

@VynDragon VynDragon changed the title drivers: eeprom: bflb efuses drivers: syscon: bflb efuses May 2, 2025
@VynDragon VynDragon force-pushed the bl60x_efuses branch 4 times, most recently from 4705786 to b92a322 Compare May 8, 2025 14:25
@VynDragon VynDragon marked this pull request as ready for review May 8, 2025 15:14
@github-actions github-actions bot added platform: bouffalolab area: RISCV RISCV Architecture (32-bit & 64-bit) labels May 8, 2025
@kartben kartben requested a review from Copilot May 14, 2025 14:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Bouffalolab efuse access via the syscon API.

  • Updates the West manifest to use a pull request revision for hal_bouffalolab.
  • Adds new Kconfig and DTS nodes for the efuse driver and corresponding binding definitions.
  • Introduces the syscon_bflb_efuse.c driver file with the necessary functions for efuse access.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
west.yml Updates the hal_bouffalolab revision to a pull request branch revision.
soc/bflb/bl60x/Kconfig Adds required select statements and enables SYSCON for Bouffalolab SOC.
dts/riscv/bflb/bl60x.dtsi Introduces the efuse node with reg, status, and size properties.
dts/bindings/syscon/bflb,efuse.yaml Provides the binding specification for the efuse driver.
drivers/syscon/syscon_bflb_efuse.c Implements the efuse driver with functions for clock configuration and efuse read/cache.
drivers/syscon/Kconfig.bflb_efuse Defines the new Kconfig entry for the Bouffalolab efuse driver.
drivers/syscon/Kconfig Includes the new efuse Kconfig file.
drivers/syscon/CMakeLists.txt Adds the efuse driver source file based on configuration.

Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

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

Sorry just noticed one more thing :| looks good to me otherwise!

# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
# SPDX-License-Identifier: Apache-2.0

description: BouffaloLab Efuse Driver
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry just spotted this. Bindings shouldn't be talking about "drivers"

https://docs.kernel.org/devicetree/bindings/writing-bindings.html#overall-design

Suggested change
description: BouffaloLab Efuse Driver
description: BouffaloLab Efuse

Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

kartben
kartben previously approved these changes May 14, 2025
nandojve
nandojve previously approved these changes May 15, 2025
@kartben kartben assigned VynDragon and nandojve and unassigned carlocaione May 15, 2025
@kartben
Copy link
Collaborator

kartben commented May 15, 2025

re-assigning to BFLB maintainers

VynDragon added 2 commits May 18, 2025 06:20
This sets revision to the one with vendor headers from final hal version

Signed-off-by: Camille BAUD <[email protected]>
This introduces a driver used to access bouffalolab efuses via syscon API

Signed-off-by: Camille BAUD <[email protected]>
@VynDragon VynDragon dismissed stale reviews from nandojve and kartben via f75e066 May 18, 2025 04:22
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label May 18, 2025
@VynDragon VynDragon force-pushed the bl60x_efuses branch 2 times, most recently from ca83c05 to bd2febe Compare May 18, 2025 05:09
This enables the driver by default, it will be needed at init in the future

Signed-off-by: Camille BAUD <[email protected]>
@VynDragon VynDragon requested review from kartben and nandojve May 18, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants