Unverified Commit 8f2f74b4 authored by Palmer Dabbelt's avatar Palmer Dabbelt
Browse files

RISC-V: Canaan devicetree fixes

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.

Link: https://lore.kernel.org/all/mhng-85044754-c361-40bc-a6a2-7082f35930bb@palmer-ri-x1c9/

* remotes/palmer/riscv-canaan_dt_schema:
  riscv: dts: canaan: build all devicetress if SOC_CANAAN
  riscv: dts: canaan: add specific compatible for kd233's LCD
  riscv: dts: canaan: fix bus {ranges,reg} warnings
  riscv: dts: canaan: remove spi-max-frequency from controllers
  riscv: dts: canaan: use custom compatible for k210 i2s
  riscv: dts: canaan: fix kd233 display spi frequency
  riscv: dts: canaan: fix mmc node names
  riscv: dts: canaan: fix the k210's timer nodes
  riscv: dts: canaan: fix the k210's memory node
  dt-bindings: memory-controllers: add canaan k210 sram controller
  dt-bindings: display: ili9341: document canaan kd233's lcd
  dt-bindings: display: convert ilitek,ili9341.txt to dt-schema
parents c08b4848 0ed04813
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
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>;
	};
+35 −14
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ properties:
  compatible:
    items:
      - enum:
          - adafruit,yx240qv29
          # ili9341 240*320 Color on stm32f429-disco board
          - st,sf-tc240t-9370-t
          - canaan,kd233-tft
      - const: ilitek,ili9341

  reg: true
@@ -47,16 +49,26 @@ 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

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>;
@@ -73,5 +85,14 @@ examples:
                };
            };
        };
        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>;
        };
    };
...
+52 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/memory-controllers/canaan,k210-sram.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Canaan K210 SRAM memory controller

description:
  The Canaan K210 SRAM memory controller is responsible for the system's 8 MiB
  of SRAM. The controller is initialised by the bootloader, which configures
  its clocks, before OS bringup.

maintainers:
  - Conor Dooley <conor@kernel.org>

properties:
  compatible:
    enum:
      - canaan,k210-sram

  clocks:
    minItems: 1
    items:
      - description: sram0 clock
      - description: sram1 clock
      - description: aisram clock

  clock-names:
    minItems: 1
    items:
      - const: sram0
      - const: sram1
      - const: aisram

required:
  - compatible
  - clocks
  - clock-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/k210-clk.h>
    memory-controller {
        compatible = "canaan,k210-sram";
        clocks = <&sysclk K210_CLK_SRAM0>,
                 <&sysclk K210_CLK_SRAM1>,
                 <&sysclk K210_CLK_AI>;
        clock-names = "sram0", "sram1", "aisram";
    };
+8 −2
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .o, $(dtb-y))
dtb-$(CONFIG_SOC_CANAAN) += canaan_kd233.dtb
dtb-$(CONFIG_SOC_CANAAN) += k210_generic.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_bit.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_dock.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_go.dtb
dtb-$(CONFIG_SOC_CANAAN) += sipeed_maixduino.dtb

obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
+3 −3
Original line number Diff line number Diff line
@@ -127,10 +127,10 @@
	cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;

	panel@0 {
		compatible = "ilitek,ili9341";
		compatible = "canaan,kd233-tft", "ilitek,ili9341";
		reg = <0>;
		dc-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
		spi-max-frequency = <15000000>;
		spi-max-frequency = <10000000>;
		status = "disabled";
	};
};
@@ -142,7 +142,7 @@
	cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
	status = "okay";

	slot@0 {
	mmc@0 {
		compatible = "mmc-spi-slot";
		reg = <0>;
		voltage-ranges = <3300 3300>;
Loading