mbox series

[v2,00/16] Canaan devicetree fixes

Message ID 20220627194003.2395484-1-mail@conchuod.ie
Headers show
Series Canaan devicetree fixes | expand

Message

Conor Dooley June 27, 2022, 7:39 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com>

Hey all,
This series should rid us of dtbs_check errors for the RISC-V Canaan k210
based boards. To make keeping it that way a little easier, I changed the
Canaan devicetree Makefile so that it would build all of the devicetrees
in the directory if SOC_CANAAN.

I *DO NOT* have any Canaan hardware so I have not tested any of this in
action. Since I sent v1, I tried to buy some since it's cheap - but could
out of the limited stockists none seemed to want to deliver to Ireland :(
I based the series on next-20220617.

For the bindings, I am never sure about which of {unevaluated,additional}
Properties is correct to use, but the if statements in the binding didn't
work with additional so I used unevaluated...

@Mark, for your ASoC binding I was not sure about the properties that I
made depend on the compatible, but I looked in tree and was not able to
find other users to contradict what's in the Canaan devicetrees nor did
I get that much help from their docs.

@Serge, I dropped your R-b since I changed the enum.

@Rob, <N days ago>'s removal of ilitek,ili9341.txt is moved to ths series
since I was editing the dt-schema binding anyway.

Thanks,
Conor.

Changes since v1:
- I added a new dt node & compatible for the SRAM memory controller due
  Damien's wish to preserve the inter-op with U-Boot.
- The dw-apb-ssi binding now uses the default rx/tx widths
- A new patch fixes bus {ranges,reg} warnings
- Rearranged the patches in a slightly more logical order

Conor Dooley (16):
  dt-bindings: display: convert ilitek,ili9341.txt to dt-schema
  dt-bindings: display: panel: allow ilitek,ili9341 in isolation
  ASoC: dt-bindings: convert designware-i2s to dt-schema
  spi: dt-bindings: dw-apb-ssi: update spi-{r,t}x-bus-width
  dt-bindings: dma: add Canaan k210 to Synopsys DesignWare DMA
  dt-bindings: timer: add Canaan k210 to Synopsys DesignWare timer
  dt-bindings: memory-controllers: add canaan k210 sram controller
  riscv: dts: canaan: fix the k210's memory node.
  riscv: dts: canaan: add a specific compatible for k210's dma
  riscv: dts: canaan: add a specific compatible for k210's timers
  riscv: dts: canaan: fix mmc node names
  riscv: dts: canaan: fix kd233 display spi frequency
  riscv: dts: canaan: use custom compatible for k210 i2s
  riscv: dts: canaan: remove spi-max-frequency from controllers
  riscv: dts: canaan: fix bus {ranges,reg} warnings
  riscv: dts: canaan: build all devicetress if SOC_CANAAN

 .../bindings/display/ilitek,ili9341.txt       | 27 ------
 .../display/panel/ilitek,ili9341.yaml         | 60 ++++++++----
 .../bindings/dma/snps,dw-axi-dmac.yaml        | 35 +++++--
 .../memory-controllers/canaan,k210-sram.yaml  | 53 +++++++++++
 .../bindings/sound/designware-i2s.txt         | 35 -------
 .../bindings/sound/snps,designware-i2s.yaml   | 93 +++++++++++++++++++
 .../bindings/spi/snps,dw-apb-ssi.yaml         |  6 --
 .../bindings/timer/snps,dw-apb-timer.yaml     | 28 ++++--
 arch/riscv/boot/dts/canaan/Makefile           | 10 +-
 arch/riscv/boot/dts/canaan/canaan_kd233.dts   |  4 +-
 arch/riscv/boot/dts/canaan/k210.dtsi          | 38 ++++----
 .../riscv/boot/dts/canaan/sipeed_maix_bit.dts |  2 +-
 .../boot/dts/canaan/sipeed_maix_dock.dts      |  2 +-
 arch/riscv/boot/dts/canaan/sipeed_maix_go.dts |  2 +-
 .../boot/dts/canaan/sipeed_maixduino.dts      |  2 +-
 15 files changed, 269 insertions(+), 128 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/ilitek,ili9341.txt
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/canaan,k210-sram.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/designware-i2s.txt
 create mode 100644 Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml

Comments

Heiko Stuebner June 28, 2022, 3 p.m. UTC | #1
Hi Conor,

Am Montag, 27. Juni 2022, 21:39:49 CEST schrieb Conor Dooley:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> A dt-schema binding for the Ilitek ili9341 was created as
> panel/ilitek,ili9341.yaml but the txt binding was ignored in the
> process. Move the remaining items in the txt binding to the yaml one &
> delete it.
> 
> The example in the txt binding has a spi-max-frequency which disagrees
> with the yaml replacement (and its own documentation) so change that to
> conform with the binding. There are no users in tree of the Adafruit
> yx240qv29 to check against.
> 
> Link: https://cdn-learn.adafruit.com/assets/assets/000/046/879/original/SPEC-YX240QV29-T_Rev.A__1_.pdf
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

in your v1 you already got a [0]
Reviewed-by: Rob Herring <robh@kernel.org>
for this patch

Looking at the diffstat, which didn't change, you should
include such tags in followup revisions, to prevent
reviewers from double efforts.

Heiko


[0] https://lore.kernel.org/r/20220627232054.GA3155668-robh@kernel.org

> ---
>  .../bindings/display/ilitek,ili9341.txt       | 27 -----------
>  .../display/panel/ilitek,ili9341.yaml         | 48 +++++++++++++------
>  2 files changed, 34 insertions(+), 41 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/display/ilitek,ili9341.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt b/Documentation/devicetree/bindings/display/ilitek,ili9341.txt
> deleted file mode 100644
> index 169b32e4ee4e..000000000000
> --- a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -Ilitek ILI9341 display panels
> -
> -This binding is for display panels using an Ilitek ILI9341 controller in SPI
> -mode.
> -
> -Required properties:
> -- compatible:	"adafruit,yx240qv29", "ilitek,ili9341"
> -- dc-gpios:	D/C pin
> -- reset-gpios:	Reset pin
> -
> -The node for this driver must be a child node of a SPI controller, hence
> -all mandatory properties described in ../spi/spi-bus.txt must be specified.
> -
> -Optional properties:
> -- rotation:	panel rotation in degrees counter clockwise (0,90,180,270)
> -- backlight:	phandle of the backlight device attached to the panel
> -
> -Example:
> -	display@0{
> -		compatible = "adafruit,yx240qv29", "ilitek,ili9341";
> -		reg = <0>;
> -		spi-max-frequency = <32000000>;
> -		dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
> -		reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
> -		rotation = <270>;
> -		backlight = <&backlight>;
> -	};
> diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
> index 6058948a9764..94ca92878434 100644
> --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
> @@ -23,6 +23,7 @@ properties:
>        - enum:
>            # ili9341 240*320 Color on stm32f429-disco board
>            - st,sf-tc240t-9370-t
> +          - adafruit,yx240qv29
>        - const: ilitek,ili9341
>  
>    reg: true
> @@ -47,31 +48,50 @@ properties:
>    vddi-led-supply:
>      description: Voltage supply for the LED driver (1.65 .. 3.3 V)
>  
> -additionalProperties: false
> +unevaluatedProperties: false
>  
>  required:
>    - compatible
>    - reg
>    - dc-gpios
> -  - port
> +
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - st,sf-tc240t-9370-t
> +then:
> +  required:
> +    - port
>  
>  examples:
>    - |+
> +    #include <dt-bindings/gpio/gpio.h>
>      spi {
>          #address-cells = <1>;
>          #size-cells = <0>;
>          panel: display@0 {
> -                 compatible = "st,sf-tc240t-9370-t",
> -                              "ilitek,ili9341";
> -                 reg = <0>;
> -                 spi-3wire;
> -                 spi-max-frequency = <10000000>;
> -                 dc-gpios = <&gpiod 13 0>;
> -                 port {
> -                         panel_in: endpoint {
> -                           remote-endpoint = <&display_out>;
> -                      };
> -                 };
> -             };
> +            compatible = "st,sf-tc240t-9370-t",
> +                         "ilitek,ili9341";
> +            reg = <0>;
> +            spi-3wire;
> +            spi-max-frequency = <10000000>;
> +            dc-gpios = <&gpiod 13 0>;
> +            port {
> +                panel_in: endpoint {
> +                    remote-endpoint = <&display_out>;
> +                };
> +            };
> +        };
> +        display@1{
> +            compatible = "adafruit,yx240qv29", "ilitek,ili9341";
> +            reg = <1>;
> +            spi-max-frequency = <10000000>;
> +            dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
> +            reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
> +            rotation = <270>;
> +            backlight = <&backlight>;
>          };
> +    };
>  ...
>
Conor Dooley June 28, 2022, 4:49 p.m. UTC | #2
On 28/06/2022 16:04, Heiko Stübner wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Am Dienstag, 28. Juni 2022, 17:00:56 CEST schrieb Heiko Stübner:
>> Hi Conor,
>>
>> Am Montag, 27. Juni 2022, 21:39:49 CEST schrieb Conor Dooley:
>>> From: Conor Dooley <conor.dooley@microchip.com>
>>>
>>> A dt-schema binding for the Ilitek ili9341 was created as
>>> panel/ilitek,ili9341.yaml but the txt binding was ignored in the
>>> process. Move the remaining items in the txt binding to the yaml one &
>>> delete it.
>>>
>>> The example in the txt binding has a spi-max-frequency which disagrees
>>> with the yaml replacement (and its own documentation) so change that to
>>> conform with the binding. There are no users in tree of the Adafruit
>>> yx240qv29 to check against.
>>>
>>> Link: https://cdn-learn.adafruit.com/assets/assets/000/046/879/original/SPEC-YX240QV29-T_Rev.A__1_.pdf
>>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>>
>> in your v1 you already got a [0]
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> for this patch
>>
>> Looking at the diffstat, which didn't change, you should
>> include such tags in followup revisions, to prevent
>> reviewers from double efforts.
> 
> and now I see that the review actually happened _after_ v2 was send ;-)

;) you had me scratching my head for a moment!

> 
> 
>> [0] https://lore.kernel.org/r/20220627232054.GA3155668-robh@kernel.org
>>
>>> ---
>>>  .../bindings/display/ilitek,ili9341.txt       | 27 -----------
>>>  .../display/panel/ilitek,ili9341.yaml         | 48 +++++++++++++------
>>>  2 files changed, 34 insertions(+), 41 deletions(-)
>>>  delete mode 100644 Documentation/devicetree/bindings/display/ilitek,ili9341.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt b/Documentation/devicetree/bindings/display/ilitek,ili9341.txt
>>> deleted file mode 100644
>>> index 169b32e4ee4e..000000000000
>>> --- a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt
>>> +++ /dev/null
>>> @@ -1,27 +0,0 @@
>>> -Ilitek ILI9341 display panels
>>> -
>>> -This binding is for display panels using an Ilitek ILI9341 controller in SPI
>>> -mode.
>>> -
>>> -Required properties:
>>> -- compatible:      "adafruit,yx240qv29", "ilitek,ili9341"
>>> -- dc-gpios:        D/C pin
>>> -- reset-gpios:     Reset pin
>>> -
>>> -The node for this driver must be a child node of a SPI controller, hence
>>> -all mandatory properties described in ../spi/spi-bus.txt must be specified.
>>> -
>>> -Optional properties:
>>> -- rotation:        panel rotation in degrees counter clockwise (0,90,180,270)
>>> -- backlight:       phandle of the backlight device attached to the panel
>>> -
>>> -Example:
>>> -   display@0{
>>> -           compatible = "adafruit,yx240qv29", "ilitek,ili9341";
>>> -           reg = <0>;
>>> -           spi-max-frequency = <32000000>;
>>> -           dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
>>> -           reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
>>> -           rotation = <270>;
>>> -           backlight = <&backlight>;
>>> -   };
>>> diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
>>> index 6058948a9764..94ca92878434 100644
>>> --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
>>> +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
>>> @@ -23,6 +23,7 @@ properties:
>>>        - enum:
>>>            # ili9341 240*320 Color on stm32f429-disco board
>>>            - st,sf-tc240t-9370-t
>>> +          - adafruit,yx240qv29
>>>        - const: ilitek,ili9341
>>>
>>>    reg: true
>>> @@ -47,31 +48,50 @@ properties:
>>>    vddi-led-supply:
>>>      description: Voltage supply for the LED driver (1.65 .. 3.3 V)
>>>
>>> -additionalProperties: false
>>> +unevaluatedProperties: false
>>>
>>>  required:
>>>    - compatible
>>>    - reg
>>>    - dc-gpios
>>> -  - port
>>> +
>>> +if:
>>> +  properties:
>>> +    compatible:
>>> +      contains:
>>> +        enum:
>>> +          - st,sf-tc240t-9370-t
>>> +then:
>>> +  required:
>>> +    - port
>>>
>>>  examples:
>>>    - |+
>>> +    #include <dt-bindings/gpio/gpio.h>
>>>      spi {
>>>          #address-cells = <1>;
>>>          #size-cells = <0>;
>>>          panel: display@0 {
>>> -                 compatible = "st,sf-tc240t-9370-t",
>>> -                              "ilitek,ili9341";
>>> -                 reg = <0>;
>>> -                 spi-3wire;
>>> -                 spi-max-frequency = <10000000>;
>>> -                 dc-gpios = <&gpiod 13 0>;
>>> -                 port {
>>> -                         panel_in: endpoint {
>>> -                           remote-endpoint = <&display_out>;
>>> -                      };
>>> -                 };
>>> -             };
>>> +            compatible = "st,sf-tc240t-9370-t",
>>> +                         "ilitek,ili9341";
>>> +            reg = <0>;
>>> +            spi-3wire;
>>> +            spi-max-frequency = <10000000>;
>>> +            dc-gpios = <&gpiod 13 0>;
>>> +            port {
>>> +                panel_in: endpoint {
>>> +                    remote-endpoint = <&display_out>;
>>> +                };
>>> +            };
>>> +        };
>>> +        display@1{
>>> +            compatible = "adafruit,yx240qv29", "ilitek,ili9341";
>>> +            reg = <1>;
>>> +            spi-max-frequency = <10000000>;
>>> +            dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
>>> +            reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
>>> +            rotation = <270>;
>>> +            backlight = <&backlight>;
>>>          };
>>> +    };
>>>  ...
>>>
>>
>>
> 
> 
> 
>