2023-04-22 18:29:57

by Stanislav Jakubek

[permalink] [raw]
Subject: [PATCH 1/2] ARM: dts: bcm23550: Add SoC-specific I2C compatible

Add BCM23550-specific compatible for brcm,kona-i2c nodes. While not
currently used by the i2c-bcm-kona driver, they can serve for further
customization, if required.
Done in preparation for dt-binding coversion to DT schema.

Signed-off-by: Stanislav Jakubek <[email protected]>
---
arch/arm/boot/dts/bcm23550.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/bcm23550.dtsi b/arch/arm/boot/dts/bcm23550.dtsi
index a36c9b1d23c8..32b244b8546c 100644
--- a/arch/arm/boot/dts/bcm23550.dtsi
+++ b/arch/arm/boot/dts/bcm23550.dtsi
@@ -159,7 +159,7 @@ uartb3: serial@2000 {
};

bsc1: i2c@16000 {
- compatible = "brcm,kona-i2c";
+ compatible = "brcm,bcm23550-i2c", "brcm,kona-i2c";
reg = <0x00016000 0x70>;
interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
@@ -169,7 +169,7 @@ bsc1: i2c@16000 {
};

bsc2: i2c@17000 {
- compatible = "brcm,kona-i2c";
+ compatible = "brcm,bcm23550-i2c", "brcm,kona-i2c";
reg = <0x00017000 0x70>;
interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
@@ -179,7 +179,7 @@ bsc2: i2c@17000 {
};

bsc3: i2c@18000 {
- compatible = "brcm,kona-i2c";
+ compatible = "brcm,bcm23550-i2c", "brcm,kona-i2c";
reg = <0x00018000 0x70>;
interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
@@ -189,7 +189,7 @@ bsc3: i2c@18000 {
};

bsc4: i2c@1c000 {
- compatible = "brcm,kona-i2c";
+ compatible = "brcm,bcm23550-i2c", "brcm,kona-i2c";
reg = <0x0001c000 0x70>;
interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
--
2.25.1


2023-04-22 18:29:57

by Stanislav Jakubek

[permalink] [raw]
Subject: [PATCH 2/2] dt-bindings: i2c: brcm,kona-i2c: convert to YAML

Convert Broadcom Kona family I2C bindings to DT schema.

Changes during conversion:
- add used, but previously undocumented SoC-specific compatibles
- drop references to SoCs that are not upstream
- add supported clock frequencies according to the Linux driver [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/i2c/busses/i2c-bcm-kona.c#n731

Signed-off-by: Stanislav Jakubek <[email protected]>
---
.../devicetree/bindings/i2c/brcm,kona-i2c.txt | 35 -----------
.../bindings/i2c/brcm,kona-i2c.yaml | 58 +++++++++++++++++++
2 files changed, 58 insertions(+), 35 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
create mode 100644 Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml

diff --git a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
deleted file mode 100644
index 1b87b741fa8e..000000000000
--- a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Broadcom Kona Family I2C
-=========================
-
-This I2C controller is used in the following Broadcom SoCs:
-
- BCM11130
- BCM11140
- BCM11351
- BCM28145
- BCM28155
-
-Required Properties
--------------------
-- compatible: "brcm,bcm11351-i2c", "brcm,kona-i2c"
-- reg: Physical base address and length of controller registers
-- interrupts: The interrupt number used by the controller
-- clocks: clock specifier for the kona i2c external clock
-- clock-frequency: The I2C bus frequency in Hz
-- #address-cells: Should be <1>
-- #size-cells: Should be <0>
-
-Refer to clocks/clock-bindings.txt for generic clock consumer
-properties.
-
-Example:
-
-i2c@3e016000 {
- compatible = "brcm,bcm11351-i2c","brcm,kona-i2c";
- reg = <0x3e016000 0x80>;
- interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&bsc1_clk>;
- clock-frequency = <400000>;
- #address-cells = <1>;
- #size-cells = <0>;
-};
diff --git a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml
new file mode 100644
index 000000000000..636912d8518d
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/brcm,kona-i2c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom Kona family I2C controller
+
+maintainers:
+ - Florian Fainelli <[email protected]>
+
+allOf:
+ - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - brcm,bcm11351-i2c
+ - brcm,bcm21664-i2c
+ - brcm,bcm23550-i2c
+ - const: brcm,kona-i2c
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-frequency:
+ enum: [ 100000, 400000, 1000000, 3400000 ]
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-frequency
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ i2c@3e016000 {
+ compatible = "brcm,bcm11351-i2c", "brcm,kona-i2c";
+ reg = <0x3e016000 0x80>;
+ interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bsc1_clk>;
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+...
--
2.25.1

2023-04-23 10:57:59

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/2] dt-bindings: i2c: brcm,kona-i2c: convert to YAML

On 22/04/2023 20:07, Stanislav Jakubek wrote:
> Convert Broadcom Kona family I2C bindings to DT schema.
>
> Changes during conversion:
> - add used, but previously undocumented SoC-specific compatibles
> - drop references to SoCs that are not upstream
> - add supported clock frequencies according to the Linux driver [1]
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/i2c/busses/i2c-bcm-kona.c#n731
>
> Signed-off-by: Stanislav Jakubek <[email protected]>
> ---
> .../devicetree/bindings/i2c/brcm,kona-i2c.txt | 35 -----------
> .../bindings/i2c/brcm,kona-i2c.yaml | 58 +++++++++++++++++++
> 2 files changed, 58 insertions(+), 35 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
> create mode 100644 Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml
>
> diff --git a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
> deleted file mode 100644
> index 1b87b741fa8e..000000000000
> --- a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -Broadcom Kona Family I2C
> -=========================
> -
> -This I2C controller is used in the following Broadcom SoCs:
> -
> - BCM11130
> - BCM11140
> - BCM11351
> - BCM28145
> - BCM28155
> -
> -Required Properties
> --------------------
> -- compatible: "brcm,bcm11351-i2c", "brcm,kona-i2c"
> -- reg: Physical base address and length of controller registers
> -- interrupts: The interrupt number used by the controller
> -- clocks: clock specifier for the kona i2c external clock
> -- clock-frequency: The I2C bus frequency in Hz
> -- #address-cells: Should be <1>
> -- #size-cells: Should be <0>
> -
> -Refer to clocks/clock-bindings.txt for generic clock consumer
> -properties.
> -
> -Example:
> -
> -i2c@3e016000 {
> - compatible = "brcm,bcm11351-i2c","brcm,kona-i2c";
> - reg = <0x3e016000 0x80>;
> - interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&bsc1_clk>;
> - clock-frequency = <400000>;
> - #address-cells = <1>;
> - #size-cells = <0>;
> -};
> diff --git a/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml
> new file mode 100644
> index 000000000000..636912d8518d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/brcm,kona-i2c.yaml
> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/brcm,kona-i2c.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom Kona family I2C controller
> +
> +maintainers:
> + - Florian Fainelli <[email protected]>
> +
> +allOf:
> + - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - brcm,bcm11351-i2c
> + - brcm,bcm21664-i2c
> + - brcm,bcm23550-i2c
> + - const: brcm,kona-i2c

Does not look like you tested the bindings. Please run `make
dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).

Best regards,
Krzysztof