-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
USB HS support fixes on STM32U5 #80249
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,15 +107,15 @@ | |
ram-size = <4096>; | ||
maximum-speed = "high-speed"; | ||
clocks = <&rcc STM32_CLOCK(AHB2, 15U)>, | ||
<&rcc STM32_SRC_HSI48 ICKLK_SEL(0)>; | ||
<&rcc STM32_SRC_HSI48 OTGHS_SEL(0)>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though Switching that to |
||
phys = <&otghs_phy>; | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
otghs_phy: otghs_phy { | ||
/* Clock source defined by USBPHYC_SEL in */ | ||
compatible = "usb-nop-xceiv"; | ||
/* Clock source defined by OTGHS_SEL() in usbotg_hs `clocks` */ | ||
compatible = "st,stm32u5-otghs-phy"; | ||
#phy-cells = <0>; | ||
}; | ||
|
||
|
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: | ||
- 1 # OTGHS_PHY_CLK_16MHZ | ||
- 2 # OTGHS_PHY_CLK_19P2MHZ | ||
- 3 # OTGHS_PHY_CLK_20MHZ | ||
- 4 # OTGHS_PHY_CLK_24MHZ | ||
- 5 # OTGHS_PHY_CLK_26MHZ | ||
- 6 # OTGHS_PHY_CLK_32MHZ | ||
Comment on lines
+19
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please document values in the description to allow rendering in documentation.
Comment on lines
+19
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it makes more sense to define list of possible frequencies:
here. That way it will still be pretty straightforward to select specific configuration in devicetree, e.g. with |
||
description: | | ||
The clock source speed configuration for this PHY. |
erikarn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* 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_ | ||
|
||
#define OTGHS_PHY_CLK_16MHZ 1 | ||
#define OTGHS_PHY_CLK_19P2MHZ 2 | ||
#define OTGHS_PHY_CLK_20MHZ 3 | ||
#define OTGHS_PHY_CLK_24MHZ 4 | ||
#define OTGHS_PHY_CLK_26MHZ 5 | ||
#define OTGHS_PHY_CLK_32MHZ 6 | ||
|
||
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PHY_STM32U5_OTG_HS_PHY_H_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are various ways to provide a default value:
COND_CODE_1(DT_NODE_HAS_PROP
: See examples https://github.com/search?q=repo%3Azephyrproject-rtos%2Fzephyr%20COND_CODE_1(DT_NODE_HAS_PROP&type=code)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or the property could be marked
required: true
with no default value provided to force user to input the correct value. Maybe this is the best course of action here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this is even better as this depends on each board implementation.