Skip to content

Conversation

VynDragon
Copy link
Contributor

  • Introduce De-init
  • Introduce Runtime configuration.

@zephyrbot zephyrbot added platform: Bouffalo Lab area: UART Universal Asynchronous Receiver-Transmitter labels Oct 7, 2025
@zephyrbot zephyrbot requested review from dcpleung and josuah October 7, 2025 20:14
josuah
josuah previously approved these changes Oct 7, 2025
Copy link
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

A 2nd chip family implementing _DEINIT APIs!

@josuah
Copy link
Contributor

josuah commented Oct 7, 2025

Some unused variable on CI due to the #ifdef... show that at least this driver runs well on CI

/__w/zephyr/zephyr/drivers/serial/uart_bflb.c:455:35: error: unused variable 'cfg' [-Werror=unused-variable]
  455 |         const struct bflb_config *cfg = dev->config;
      |                                   ^~~

@VynDragon
Copy link
Contributor Author

Some unused variable on CI due to the #ifdef... show that at least this driver runs well on CI

/__w/zephyr/zephyr/drivers/serial/uart_bflb.c:455:35: error: unused variable 'cfg' [-Werror=unused-variable]
  455 |         const struct bflb_config *cfg = dev->config;
      |                                   ^~~

Ah well i didnt catch that one...

Allows BFLB uart peripheral to de-init.

Signed-off-by: Camille BAUD <[email protected]>
@kartben kartben requested a review from Copilot October 8, 2025 04:44
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 introduces de-initialization functionality and runtime configuration support to the BFLB UART driver. The changes enable dynamic UART parameter configuration during runtime rather than only at compile time.

  • Moved UART configuration parameters from static config structure to runtime data structure
  • Added runtime configuration API support with configure and config_get functions
  • Introduced de-initialization function to properly clean up UART resources

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.flow_ctrl = UART_FLOWCTRL_NONE, \
/* overflow interrupt threshold, size is 32 bytes*/ \
.tx_fifo_threshold = 8, \
.tx_fifo_threshold = 16, \
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The tx_fifo_threshold value was changed from 8 to 16 without explanation. This change should either be documented in the commit message or reverted if it's unintentional, as it could affect UART transmission behavior.

Suggested change
.tx_fifo_threshold = 16, \
.tx_fifo_threshold = 8, \

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@kartben kartben Oct 8, 2025

Choose a reason for hiding this comment

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

It's a fair comment and at least it would be worth having this change as a separate commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

This adds the ability to do runtime configuration of the BFLB
UART driver.

Signed-off-by: Camille BAUD <[email protected]>
Increases the fifo threshold for tx, should increase speed a bit.

Signed-off-by: Camille BAUD <[email protected]>
Copy link

sonarqubecloud bot commented Oct 8, 2025

@cfriedt cfriedt merged commit 6430ad4 into zephyrproject-rtos:main Oct 10, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter platform: Bouffalo Lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants