Skip to content

Conversation

@r2r0
Copy link
Member

@r2r0 r2r0 commented May 10, 2022

This PR allows STM32 UART device drivers to use alternate clocks introduced by #45053.
Example board (STM32WB55 based) configuration to enable HSI clock on LPUART:

&clk_hsi{
    status = "okay";
};

&lpuart1 {
    current-speed = <115200>;
    /delete-property/ clocks;
    clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000001>, <&rcc STM32_SRC_HSI LPUART1_SEL(2)>;
    wakeup-source;
    status = "okay";
};

Based on: #45053

@erwango
Copy link
Member

erwango commented May 10, 2022

@r2r0 would you mind rebasing, now that #45053 got merged ?

@r2r0
Copy link
Member Author

r2r0 commented May 11, 2022

@erwango Rebase done.

Copy link
Contributor

@GeorgeCGV GeorgeCGV left a comment

Choose a reason for hiding this comment

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

LGTM,
only minor corrections that would be great to have

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution.
Nit: I tend to prefer titles that are a bit more specific:
drivers/serial: stm32: bla or drivers: serial: stm32: bla

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Late couple of nit fixes.

@r2r0 r2r0 changed the title stm32: Enable UART alternate clocks drivers/serial: stm32: Enable UART alternate clocks May 11, 2022
Add support for an alternate clock. If available,
alternate clock is enabled and used to get the
device clock rate.
Based on: #45053.

Signed-off-by: Artur Lipowski <[email protected]>
@MaureenHelm MaureenHelm merged commit bb85759 into zephyrproject-rtos:main May 11, 2022
@r2r0 r2r0 deleted the stm32uart_alternate_clocks branch May 12, 2022 05:53
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.

5 participants