-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dts: include: arm: st: usb: Add USB PHY clock rate support for STM32U…
…5xxx The existing code assumes that the HSE clock is a 16MHz crystal, however the hardware allows for a list of possible HSE clock values. Add them here as an enum, configure it for the STM32U595 chipset (which is the only device I have access to for testing). This addresses Issue #79825 . * Add a list of possible values to use in the DT bindings directory * Add a new PHY (st,stm32-otghs-phy) with an enum list matching the above list * Add support in the USB driver for checking the clock-cfg entry and compiling in the correct clock rate. * And also handle an out of enum configuration by failing compilation. Signed-off-by: Adrian Chadd <[email protected]>
- Loading branch information
Adrian Chadd
authored and
Adrian Chadd
committed
Oct 23, 2024
1 parent
a8bd569
commit 8e7537c
Showing
5 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2024 Meta | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
This binding is to be used by the STM32U5xx transceivers which are built-in | ||
with USB HS PHY IP and a configurable HSE clock source. | ||
compatible: "st,stm32u5-otghs-phy" | ||
|
||
include: phy-controller.yaml | ||
|
||
properties: | ||
"#phy-cells": | ||
const: 0 | ||
|
||
clock-cfg: | ||
type: int | ||
enum: | ||
- 0 # STM32U5_OTGHS_PHY_CLKSEL_16MHZ | ||
- 1 # STM32U5_OTGHS_PHY_CLKSEL_19P2MHZ | ||
- 2 # STM32U5_OTGHS_PHY_CLKSEL_20MHZ | ||
- 3 # STM32U5_OTGHS_PHY_CLKSEL_24MHZ | ||
- 4 # STM32U5_OTGHS_PHY_CLKSEL_26MHZ | ||
- 5 # STM32U5_OTGHS_PHY_CLKSEL_32MHZ | ||
description: | | ||
The clock source speed configuration for this PHY. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2024 Meta | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PHY_STM32U5_OTG_HS_PHY_H_ | ||
#define ZEPHYR_INCLUDE_DT_BINDINGS_PHY_STM32U5_OTG_HS_PHY_H_ | ||
|
||
/* Ideally we'd generate this list to match what's coming out of the YAML. | ||
* Make sure it's kept up to date with the yaml file in question. | ||
* (dts/bindings/phy/st,stm32-otghs-phy.yaml) | ||
*/ | ||
|
||
#define STM32U5_OTGHS_PHY_CLKSEL_16MHZ 0 | ||
#define STM32U5_OTGHS_PHY_CLKSEL_19P2MHZ 1 | ||
#define STM32U5_OTGHS_PHY_CLKSEL_20MHZ 2 | ||
#define STM32U5_OTGHS_PHY_CLKSEL_24MHZ 3 | ||
#define STM32U5_OTGHS_PHY_CLKSEL_26MHZ 4 | ||
#define STM32U5_OTGHS_PHY_CLKSEL_32MHZ 5 | ||
|
||
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PHY_STM32U5_OTG_HS_PHY_H_ */ |