[PATCH] spi: dt-bindings: mediatek,spi-mtk-nor: Add clock bindings for mt8189
Meiker Gao
ot_meiker.gao at mediatek.com
Tue Mar 10 18:51:27 PDT 2026
Update mediatek,spi-mtk-nor.yaml to add conditional clock and clock-names
bindings for the mt8189-nor platform. The mt8189-nor controller requires
five specific clocks and corresponding clock-names ("spi", "sf", "axi_f",
"axi_h", "axi_p"). This change enforces these requirements in the device
tree binding schema.
For other platforms, the minimum number of clocks and clock-names remains
unchanged. The patch also adds an example for mt8189-nor, illustrating the
new clock configuration.
This update ensures correct hardware description and validation for
mt8189-nor, improving compatibility and reducing configuration errors.
Signed-off-by: Meiker Gao <ot_meiker.gao at mediatek.com>
(cherry picked from commit de637a2fea765a92d4b06efef34671c74f8bc109)
---
.../bindings/spi/mediatek,spi-mtk-nor.yaml | 71 +++++++++++++++----
1 file changed, 59 insertions(+), 12 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml b/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
index a453996c13f2..904c25279e2d 100644
--- a/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
@@ -17,9 +17,6 @@ description: |
for devices other than SPI NOR flash due to limited transfer
capability of this controller.
-allOf:
- - $ref: /schemas/spi/spi-controller.yaml#
-
properties:
compatible:
oneOf:
@@ -27,6 +24,7 @@ properties:
- mediatek,mt8173-nor
- mediatek,mt8186-nor
- mediatek,mt8192-nor
+ - mediatek,mt8189-nor
- items:
- enum:
- mediatek,mt2701-nor
@@ -39,6 +37,7 @@ properties:
- items:
- enum:
- mediatek,mt8188-nor
+ - mediatek,mt8189-nor
- const: mediatek,mt8186-nor
reg:
@@ -56,14 +55,8 @@ properties:
design, so this is optional.
- description: clock used for controller axi slave bus.
this depends on hardware design, so it is optional.
-
- clock-names:
- minItems: 2
- items:
- - const: spi
- - const: sf
- - const: axi
- - const: axi_s
+ - description: clock used for controller axi_f, axi_h, and
+ axi_p to support the new platform.
required:
- compatible
@@ -71,6 +64,35 @@ required:
- clocks
- clock-names
+allOf:
+ - $ref: /schemas/spi/spi-controller.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8189-nor
+ then:
+ properties:
+ clocks:
+ maxItems: 5
+ clock-names:
+ maxItems: 5
+ items:
+ - const: spi
+ - const: sf
+ - const: axi_f
+ - const: axi_h
+ - const: axi_p
+ else:
+ properties:
+ clocks:
+ maxItems: 4
+ clock-names:
+ items:
+ - const: spi
+ - const: sf
+ - const: axi
+
unevaluatedProperties: false
examples:
@@ -81,7 +103,7 @@ examples:
#address-cells = <2>;
#size-cells = <2>;
- nor_flash: spi at 1100d000 {
+ spi at 1100d000 {
compatible = "mediatek,mt8173-nor";
reg = <0 0x1100d000 0 0xe0>;
interrupts = <1>;
@@ -97,3 +119,28 @@ examples:
};
};
};
+
+ - |
+ #include <dt-bindings/clock/mediatek,mt8189-clk.h>
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ spi at 11018000 {
+ compatible = "mediatek,mt8189-nor";
+ reg = <0 0x1100d000 0 0xe0>;
+ interrupts = <1>;
+ clocks = <&pericfg CLK_PERI_SPI>, <&topckgen CLK_TOP_SPINFI_IFR_SEL>,
+ <&pericfg CLK_PERAO_SFLASH_F>, <&topckgen CLK_PERAO_SFLASH_H>,
+ <&pericfg CLK_PERAO_SFLASH_P>;
+ clock-names = "spi", "sf", "axi_f", "axi_h", "axi_p";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ flash at 0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ };
+ };
+ };
--
2.45.2
More information about the Linux-mediatek
mailing list