dt-bindings: serial: 8250: allow "main" and "uart" as clock names
Subsystems (5)
PATCH v2 1/1 dt-bindings: serial: 8250: allow "main" and "uart" as clock names
There are two compatible strings defined in "8250.yaml" that require two clocks to be specified, along with their names:
- "spacemit,k1-uart", used in "spacemit/k1.dtsi"
- "nxp,lpc1850-uart", used in "lpc/lpc18xx.dtsi"
When only one clock is used, the name is not required. However there are two places that do specify a name:
- In "mediatek/mt7623.dtsi", the clock for the "mediatek,mtk-btif" compatible serial device is named "main"
- In "qca/ar9132.dtsi", the clock for the "ns8250" compatible serial device is named "uart"
In commit d2db0d7815444 ("dt-bindings: serial: 8250: allow clock 'uartclk' and 'reg' for nxp,lpc1850-uart"), Frank Li added the restriction that two named clocks be used for the NXP platform mentioned above.
Change that logic, so that an additional condition for (only) the SpacemiT platform similarly restricts the two clocks to have the names "core" and "bus".
Finally, add "main" and "uart" as allowed names when a single clock is specified.
--- Documentation/devicetree/bindings/serial/8250.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/8250.yaml +9 -1
@@ -60,7 +60,12 @@ allOf: items: - const: uartclk - const: reg - else: + - if: + properties: + compatible: + contains: + const: spacemit,k1-uart + then: properties: clock-names: items:
@@ -162,6 +167,9 @@ properties: minItems: 1 maxItems: 2 oneOf: + - enum: + - main + - uart - items: - const: core - const: bus
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
Signature · 1 line
2.48.1
Quoted 21 lines · Alex Elder
There are two compatible strings defined in "8250.yaml" that require two clocks to be specified, along with their names:
- "spacemit,k1-uart", used in "spacemit/k1.dtsi"
- "nxp,lpc1850-uart", used in "lpc/lpc18xx.dtsi"When only one clock is used, the name is not required. However there are two places that do specify a name:
- In "mediatek/mt7623.dtsi", the clock for the "mediatek,mtk-btif" compatible serial device is named "main"
- In "qca/ar9132.dtsi", the clock for the "ns8250" compatible serial device is named "uart"In commit
d2db0d7815444("dt-bindings: serial: 8250: allow clock 'uartclk' and 'reg' for nxp,lpc1850-uart"), Frank Li added the restriction that two named clocks be used for the NXP platform mentioned above.Change that logic, so that an additional condition for (only) the SpacemiT platform similarly restricts the two clocks to have the names "core" and "bus".
Quoted 7 lines
Finally, add "main" and "uart" as allowed names when a single clock is specified.
Fixes 2c0594f9f0629 ("dt-bindings: serial: 8250: support an optional second clock")Reported-by kernel test robot <[email protected]>Signed-off-by Alex Elder <[email protected]>