Re: [PATCH] dt-bindings: sh_eth convert bindings to json-schema

2019-09-30 Thread Simon Horman
On Mon, Sep 30, 2019 at 04:03:52PM +0200, Simon Horman wrote:
> Convert Renesas Electronics SH EtherMAC bindings documentation to
> json-schema.  Also name bindings documentation file according to the compat
> string being documented.
> 
> Signed-off-by: Simon Horman 
> ---

Sorry, I missed annotating this as being targeted at net-next.

> * Based on v5.3
> * Tested using:
>   # ARCH=arm64 make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/renesas,ether.yaml
>   # ARCH=arm   make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/renesas,ether.yaml
> ---
>  .../devicetree/bindings/net/renesas,ether.yaml | 114 
> +
>  Documentation/devicetree/bindings/net/sh_eth.txt   |  69 -
>  MAINTAINERS|   2 +-
>  3 files changed, 115 insertions(+), 70 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/renesas,ether.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/sh_eth.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/renesas,ether.yaml 
> b/Documentation/devicetree/bindings/net/renesas,ether.yaml
> new file mode 100644
> index ..7f84df9790e2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/renesas,ether.yaml
> @@ -0,0 +1,114 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/renesas,ether.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas Electronics SH EtherMAC
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +
> +maintainers:
> +  - Sergei Shtylyov 
> +
> +properties:
> +  compatible:
> +oneOf:
> +  - items:
> +  - enum:
> +  - renesas,gether-r8a7740   # device is a part of R8A7740 SoC
> +  - renesas,gether-r8a77980  # device is a part of R8A77980 SoC
> +  - renesas,ether-r7s72100   # device is a part of R7S72100 SoC
> +  - renesas,ether-r7s9210# device is a part of R7S9210 SoC
> +  - items:
> +  - enum:
> +  - renesas,ether-r8a7778# device is a part of R8A7778 SoC
> +  - renesas,ether-r8a7779# device is a part of R8A7779 SoC
> +  - enum:
> +  - renesas,rcar-gen1-ether  # a generic R-Car Gen1 device
> +  - items:
> +  - enum:
> +  - renesas,ether-r8a7745# device is a part of R8A7745 SoC
> +  - renesas,ether-r8a7743# device is a part of R8A7743 SoC
> +  - renesas,ether-r8a7790# device is a part of R8A7790 SoC
> +  - renesas,ether-r8a7791# device is a part of R8A7791 SoC
> +  - renesas,ether-r8a7793# device is a part of R8A7793 SoC
> +  - renesas,ether-r8a7794# device is a part of R8A7794 SoC
> +  - enum:
> +  - renesas,rcar-gen2-ether  # a generic R-Car Gen2 or RZ/G1 
> device
> +
> +  reg:
> +items:
> +   - description: E-DMAC/feLic registers
> +   - description: TSU registers
> +minItems: 1
> +
> +  interrupts:
> +maxItems: 1
> +
> +  '#address-cells':
> +description: number of address cells for the MDIO bus
> +const: 1
> +
> +  '#size-cells':
> +description: number of size cells on the MDIO bus
> +const: 0
> +
> +  clocks:
> +maxItems: 1
> +
> +  pinctrl-0: true
> +
> +  pinctrl-names: true
> +
> +  renesas,no-ether-link:
> +type: boolean
> +description:
> +  specify when a board does not provide a proper Ether LINK signal
> +
> +  renesas,ether-link-active-low:
> +type: boolean
> +description:
> +  specify when the Ether LINK signal is active-low instead of normal
> +  active-high
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - phy-mode
> +  - phy-handle
> +  - '#address-cells'
> +  - '#size-cells'
> +  - clocks
> +  - pinctrl-0
> +
> +examples:
> +  # Lager board
> +  - |
> +#include 
> +#include 
> +
> +ethernet@ee70 {
> +compatible = "renesas,ether-r8a7790", "renesas,rcar-gen2-ether";
> +reg = <0 0xee70 0 0x400>;
> +interrupt-parent = <&gic>;
> +interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
> +clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
> +phy-mode = "rmii";
> +phy-handle = <&phy1>;
> +pinctrl-0 = <ðer_pins>;
> +pinctrl-names = "default";
> +renesas,ether-link-active-low;
> + 

[PATCH] dt-bindings: sh_eth convert bindings to json-schema

2019-09-30 Thread Simon Horman
Convert Renesas Electronics SH EtherMAC bindings documentation to
json-schema.  Also name bindings documentation file according to the compat
string being documented.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/renesas,ether.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/renesas,ether.yaml
---
 .../devicetree/bindings/net/renesas,ether.yaml | 114 +
 Documentation/devicetree/bindings/net/sh_eth.txt   |  69 -
 MAINTAINERS|   2 +-
 3 files changed, 115 insertions(+), 70 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/renesas,ether.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/sh_eth.txt

diff --git a/Documentation/devicetree/bindings/net/renesas,ether.yaml 
b/Documentation/devicetree/bindings/net/renesas,ether.yaml
new file mode 100644
index ..7f84df9790e2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/renesas,ether.yaml
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/renesas,ether.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Electronics SH EtherMAC
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+maintainers:
+  - Sergei Shtylyov 
+
+properties:
+  compatible:
+oneOf:
+  - items:
+  - enum:
+  - renesas,gether-r8a7740   # device is a part of R8A7740 SoC
+  - renesas,gether-r8a77980  # device is a part of R8A77980 SoC
+  - renesas,ether-r7s72100   # device is a part of R7S72100 SoC
+  - renesas,ether-r7s9210# device is a part of R7S9210 SoC
+  - items:
+  - enum:
+  - renesas,ether-r8a7778# device is a part of R8A7778 SoC
+  - renesas,ether-r8a7779# device is a part of R8A7779 SoC
+  - enum:
+  - renesas,rcar-gen1-ether  # a generic R-Car Gen1 device
+  - items:
+  - enum:
+  - renesas,ether-r8a7745# device is a part of R8A7745 SoC
+  - renesas,ether-r8a7743# device is a part of R8A7743 SoC
+  - renesas,ether-r8a7790# device is a part of R8A7790 SoC
+  - renesas,ether-r8a7791# device is a part of R8A7791 SoC
+  - renesas,ether-r8a7793# device is a part of R8A7793 SoC
+  - renesas,ether-r8a7794# device is a part of R8A7794 SoC
+  - enum:
+  - renesas,rcar-gen2-ether  # a generic R-Car Gen2 or RZ/G1 device
+
+  reg:
+items:
+   - description: E-DMAC/feLic registers
+   - description: TSU registers
+minItems: 1
+
+  interrupts:
+maxItems: 1
+
+  '#address-cells':
+description: number of address cells for the MDIO bus
+const: 1
+
+  '#size-cells':
+description: number of size cells on the MDIO bus
+const: 0
+
+  clocks:
+maxItems: 1
+
+  pinctrl-0: true
+
+  pinctrl-names: true
+
+  renesas,no-ether-link:
+type: boolean
+description:
+  specify when a board does not provide a proper Ether LINK signal
+
+  renesas,ether-link-active-low:
+type: boolean
+description:
+  specify when the Ether LINK signal is active-low instead of normal
+  active-high
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - phy-mode
+  - phy-handle
+  - '#address-cells'
+  - '#size-cells'
+  - clocks
+  - pinctrl-0
+
+examples:
+  # Lager board
+  - |
+#include 
+#include 
+
+ethernet@ee70 {
+compatible = "renesas,ether-r8a7790", "renesas,rcar-gen2-ether";
+reg = <0 0xee70 0 0x400>;
+interrupt-parent = <&gic>;
+interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
+clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
+phy-mode = "rmii";
+phy-handle = <&phy1>;
+pinctrl-0 = <ðer_pins>;
+pinctrl-names = "default";
+renesas,ether-link-active-low;
+#address-cells = <1>;
+#size-cells = <0>;
+
+phy1: ethernet-phy@1 {
+reg = <1>;
+interrupt-parent = <&irqc0>;
+interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+pinctrl-0 = <&phy1_pins>;
+pinctrl-names = "default";
+};
+};
diff --git a/Documentation/devicetree/bindings/net/sh_eth.txt 
b/Documentation/devicetree/bindings/net/sh_eth.txt
deleted file mode 100644
index abc36274227c..
--- a/Documentation/devicetree/bindings/net/sh_eth.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-* Renesas Electronics SH EtherMAC
-
-This file provides information on what the device node for the SH EtherMAC
-interface contains.
-
-Required properties:
-- compatible: Must 

[PATCH v4 0/3] dt-bindings: bus: simple-pm-bus, renesas-bsc: convert bindings to json-schema

2019-09-30 Thread Simon Horman


Convert Simple Power-Managed Bus and Convert Renesas Bus State Controller
(BSC) bindings documentation to json-schema.

Based on v5.3.

Changes since v3 noted in individual patches.

Simon Horman (3):
  dt-bindings: bus: simple-pm-bus: convert bindings to json-schema
  dt-bindings: bus: renesas-bsc: convert bindings to json-schema
  arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

 .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 60 +
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 -
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 75 ++
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi   |  2 +-
 arch/arm64/boot/dts/qcom/msm8996.dtsi  |  2 +-
 6 files changed, 137 insertions(+), 92 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

-- 
2.11.0



[PATCH v4 2/3] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-30 Thread Simon Horman
Convert Renesas Bus State Controller (BSC) bindings documentation to
json-schema.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml

v4
* No change

v3
* v2 was miss-posted as v3

v2
* Add required field as suggested by Ulrich Hecht
* Add custom 'select' in that leaves out "simple-pm-bus"
  to avoid matching on users of the binding documented
  in simple-pm-bus.yaml, which this binding extends
---
 .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 60 ++
 2 files changed, 60 insertions(+), 46 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml

diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
deleted file mode 100644
index 90e947269437..
--- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Renesas Bus State Controller (BSC)
-==
-
-The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
-Bridge", or "External Bus Interface") can be found in several Renesas ARM SoCs.
-It provides an external bus for connecting multiple external devices to the
-SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and USB.
-
-While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
-domain, and may have a gateable functional clock.
-Before a device connected to the BSC can be accessed, the PM domain
-containing the BSC must be powered on, and the functional clock
-driving the BSC must be enabled.
-
-The bindings for the BSC extend the bindings for "simple-pm-bus".
-
-
-Required properties
-  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
-   "simple-pm-bus" as fallbacks.
-SoC-specific values can be:
-   "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
-   "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-  - reg: Must contain the base address and length to access the bus controller.
-
-Optional properties:
-  - interrupts: Must contain a reference to the BSC interrupt, if available.
-  - clocks: Must contain a reference to the functional clock, if available.
-  - power-domains: Must contain a reference to the PM domain, if available.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
new file mode 100644
index ..7d10b62a52d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
@@ -0,0 +1,60 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Bus State Controller (BSC)
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
+  Bridge", or "External Bus Interface") can be found in several Renesas ARM
+  SoCs.  It provides an external bus for connecting multiple external
+  devices to the SoC, driving several chip select lines, for e.g. NOR
+  FLASH, Ethernet and USB.
+
+  While the BSC is a fairly simple memory-mapped bus, it may be part of a
+  PM domain, and may have a gateable functional clock.  Before a device
+  connected to the BSC can be accessed, the PM domain containing the BSC
+  must be powered on, and the functional clock driving the BSC must be
+  enabled.
+
+  The bindings for the BSC extend the bindings for "simple-pm-bus".
+
+allOf:
+  - $ref: simple-pm-bus.yaml#
+
+properties:
+  compatible:
+items:
+  - enum:
+  - renesas,bsc-r8a73a4  # R-Mobile APE6 (r8a73a4)
+  - renesas,bsc-sh73a0   # SH-Mobile AG5 (sh73a0)
+  - const: renesas,bsc
+  - {} # simple-pm-bus, but not listed here to avoid false select
+
+  reg:
+max

[PATCH v4 1/3] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-30 Thread Simon Horman
Convert Simple Power-Managed Bus bindings documentation to json-schema.

As a side effect of this change only simple-pm-bus is used in example. A
follow-up patch will provide an example for the separately documented
Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
"renesas,bsc" compat strings.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

v4
* Only allow '@' after bus in nodename
* Allow #address-cells to be 1 or 2.

v3
* v2 was miss-posted as v3

v2
* Add SPDX line
* Remove extra blank line
* Add $nodename
* Remove extra leading space in compatible
* Update compatible to allow override by other schemas
* Allow #size-cells to be 1 or 2
* Do not limit ranges or clocks to 1 item
* Add anyOf requirement on ranges or clocks
* Update example based on msm8996.dtsi
---
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 -
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 75 ++
 2 files changed, 75 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
deleted file mode 100644
index 6f15037131ed..
--- a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Simple Power-Managed Bus
-
-
-A Simple Power-Managed Bus is a transparent bus that doesn't need a real
-driver, as it's typically initialized by the boot loader.
-
-However, its bus controller is part of a PM domain, or under the control of a
-functional clock.  Hence, the bus controller's PM domain and/or clock must be
-enabled for child devices connected to the bus (either on-SoC or externally)
-to function.
-
-While "simple-pm-bus" follows the "simple-bus" set of properties, as specified
-in the Devicetree Specification, it is not an extension of "simple-bus".
-
-
-Required properties:
-  - compatible: Must contain at least "simple-pm-bus".
-   Must not contain "simple-bus".
-   It's recommended to let this be preceded by one or more
-   vendor-specific compatible values.
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-
-Optional platform-specific properties for clock or PM domain control (at least
-one of them is required):
-  - clocks: Must contain a reference to the functional clock(s),
-  - power-domains: Must contain a reference to the PM domain.
-Please refer to the binding documentation for the clock and/or PM domain
-providers for more details.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
new file mode 100644
index ..33326ffdb266
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple Power-Managed Bus
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  A Simple Power-Managed Bus is a transparent bus that doesn't need a real
+  driver, as it's typically initialized by the boot loader.
+
+  However, its bus controller is part of a PM domain, or under the control
+  of a functional clock.  Hence, the bus controller's PM domain and/or
+  clock must be enabled for child devices connected to the bus (either
+  on-SoC or externally) to function.
+
+  While "simple-pm-bus" follows the "simple-bus" set of properties, as
+  specified in the Devicetree Specification, it is not an extension of
+  "simple-bus".
+
+properties:
+  $nodename:
+pattern: "^bus(@[0-9a-f]+)?$"
+
+  compatible:
+contains:
+  const: simple-pm-bus
+description:
+  Shall contain "simple-pm-bus" in addition to a optional b

[PATCH v4 3/3] arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

2019-09-30 Thread Simon Horman
Update simple-pm-bus node name from 'agnoc' to 'bus' reflecting the
proposed binding description in json-schema which in turn reflects the
Devicetree specification [1] v0.3-rc2.

  "The name of a node should be somewhat generic, reflecting the function
   of the device and not its precise programming model. If appropriate,
   the name should be one of the following choices:
 ...
 * bus
 ..."

Also drop the unit address as there is neither a reg property nor
non-empty ranges.

[1] https://www.devicetree.org/specifications/

Signed-off-by: Simon Horman 
---
*** Compile tested only ***

v4
* Update changelog
* Update reference in apq8096-db820c.dtsi

v3
* v2 was miss-posted as v3

v2
* New patch
---
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 +-
 arch/arm64/boot/dts/qcom/msm8996.dtsi| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi 
b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
index 04ad2fb22b9a..5a229592 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
@@ -439,7 +439,7 @@
enable-active-high;
};
 
-   agnoc@0 {
+   bus {
pcie@60 {
status = "okay";
perst-gpio = <&msmgpio 35 GPIO_ACTIVE_LOW>;
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi 
b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 96c0a481f454..99f376ebd27e 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -1373,7 +1373,7 @@
clock-names = "iface", "bus";
};
 
-   agnoc@0 {
+   bus {
power-domains = <&gcc AGGRE0_NOC_GDSC>;
compatible = "simple-pm-bus";
#address-cells = <1>;
-- 
2.11.0



Re: [PATCH v3 1/3] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-30 Thread Simon Horman
On Fri, Sep 27, 2019 at 01:38:44PM -0500, Rob Herring wrote:
> On Tue, Sep 24, 2019 at 11:36:07AM +0200, Simon Horman wrote:
> > Convert Simple Power-Managed Bus bindings documentation to json-schema.
> > 
> > As a side effect of this change only simple-pm-bus is used in example. A
> > follow-up patch will provide an example for the separately documented
> > Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
> > "renesas,bsc" compat strings.
> > 
> > Signed-off-by: Simon Horman 
> > ---
> > * Based on v5.3
> > * Tested using:
> >   # ARCH=arm64 make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> >   # ARCH=arm   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > 
> > v2
> > * Add SPDX line
> > * Remove extra blank line
> > * Add $nodename
> > * Remove extra leading space in compatible
> > * Update compatible to allow override by other schemas
> > * Allow #size-cells to be 1 or 2
> > * Do not limit ranges or clocks to 1 item
> > * Add anyOf requirement on ranges or clocks
> > * Update example based on msm8996.dtsi
> > ---
> >  .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 -
> >  .../devicetree/bindings/bus/simple-pm-bus.yaml | 75 
> > ++
> >  2 files changed, 75 insertions(+), 44 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> >  create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt 
> > b/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> > deleted file mode 100644
> > index 6f15037131ed..
> > --- a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> > +++ /dev/null
> > @@ -1,44 +0,0 @@
> > -Simple Power-Managed Bus
> > -
> > -
> > -A Simple Power-Managed Bus is a transparent bus that doesn't need a real
> > -driver, as it's typically initialized by the boot loader.
> > -
> > -However, its bus controller is part of a PM domain, or under the control 
> > of a
> > -functional clock.  Hence, the bus controller's PM domain and/or clock must 
> > be
> > -enabled for child devices connected to the bus (either on-SoC or 
> > externally)
> > -to function.
> > -
> > -While "simple-pm-bus" follows the "simple-bus" set of properties, as 
> > specified
> > -in the Devicetree Specification, it is not an extension of "simple-bus".
> > -
> > -
> > -Required properties:
> > -  - compatible: Must contain at least "simple-pm-bus".
> > -   Must not contain "simple-bus".
> > -   It's recommended to let this be preceded by one or more
> > -   vendor-specific compatible values.
> > -  - #address-cells, #size-cells, ranges: Must describe the mapping between
> > -   parent address and child address spaces.
> > -
> > -Optional platform-specific properties for clock or PM domain control (at 
> > least
> > -one of them is required):
> > -  - clocks: Must contain a reference to the functional clock(s),
> > -  - power-domains: Must contain a reference to the PM domain.
> > -Please refer to the binding documentation for the clock and/or PM domain
> > -providers for more details.
> > -
> > -
> > -Example:
> > -
> > -   bsc: bus@fec1 {
> > -   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
> > -"simple-pm-bus";
> > -   #address-cells = <1>;
> > -   #size-cells = <1>;
> > -   ranges = <0 0 0x2000>;
> > -   reg = <0xfec1 0x400>;
> > -   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
> > -   clocks = <&zb_clk>;
> > -   power-domains = <&pd_a4s>;
> > -   };
> > diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
> > b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > new file mode 100644
> > index ..598b71d779b1
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
>

Re: [PATCH v3 3/3] arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

2019-09-30 Thread Simon Horman
On Thu, Sep 26, 2019 at 01:58:21PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Sep 24, 2019 at 11:37 AM Simon Horman
>  wrote:
> > Update simple-pm-bus node name from 'agnoc' to 'bus' reflecting the
> > proposed binding description in json-schema which in turn reflects the ePAR
> > standard - "the name of a node should be somewhat generic, reflecting the
> > function of the device and not its precise programming model."
> >
> > Also drop the unit address as there is neither a reg property nor
> > non-empty ranges.
> >
> > Signed-off-by: Simon Horman 
> > ---
> > v2
> > * New patch
> > ---
> >  arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi 
> > b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> > index 96c0a481f454..99f376ebd27e 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> > @@ -1373,7 +1373,7 @@
> > clock-names = "iface", "bus";
> > };
> >
> > -   agnoc@0 {
> > +   bus {
> > power-domains = <&gcc AGGRE0_NOC_GDSC>;
> > compatible = "simple-pm-bus";
> > #address-cells = <1>;
> 
> This file is included by arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi,
> which references agnoc@0, so you have to update that one as well,
> to avoid introducing silent breakages.

Thanks, will do.


[PATCH] dt-bindings: spi: sh-msiof: Convert bindings to json-schema

2019-09-26 Thread Simon Horman
Convert Renesas HSPI bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.

Signed-off-by: Simon Horman 
---
Based on v5.3
Tested using:
  ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
  ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
---
 .../devicetree/bindings/spi/renesas,sh-msiof.yaml  | 158 +
 Documentation/devicetree/bindings/spi/sh-msiof.txt | 105 --
 2 files changed, 158 insertions(+), 105 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/sh-msiof.txt

diff --git a/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml 
b/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
new file mode 100644
index ..4afaa48c1666
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
@@ -0,0 +1,158 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/renesas,sh-msiof.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas MSIOF SPI controller
+
+maintainers:
+  - Geert Uytterhoeven 
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+oneOf:
+  - items:
+  - const: renesas,msiof-sh73a0 # SH-Mobile AG5
+  - const: renesas,sh-mobile-msiof  # generic SH-Mobile compatible
+# device
+  - items:
+  - enum:
+  - renesas,msiof-r8a7743   # RZ/G1M
+  - renesas,msiof-r8a7744   # RZ/G1N
+  - renesas,msiof-r8a7745   # RZ/G1E
+  - renesas,msiof-r8a77470  # RZ/G1C
+  - renesas,msiof-r8a7790   # R-Car H2
+  - renesas,msiof-r8a7791   # R-Car M2-W
+  - renesas,msiof-r8a7792   # R-Car V2H
+  - renesas,msiof-r8a7793   # R-Car M2-N
+  - renesas,msiof-r8a7794   # R-Car E2
+  - const: renesas,rcar-gen2-msiof  # generic R-Car Gen2 and RZ/G1
+# compatible device
+  - items:
+  - enum:
+  - renesas,msiof-r8a774a1  # RZ/G2M
+  - renesas,msiof-r8a774c0  # RZ/G2E
+  - renesas,msiof-r8a7795   # R-Car H3
+  - renesas,msiof-r8a7796   # R-Car M3-W
+  - renesas,msiof-r8a77965  # R-Car M3-N
+  - renesas,msiof-r8a77970  # R-Car V3M
+  - renesas,msiof-r8a77980  # R-Car V3H
+  - renesas,msiof-r8a77990  # R-Car E3
+  - renesas,msiof-r8a77995  # R-Car D3
+  - const: renesas,rcar-gen3-msiof  # generic R-Car Gen3 and RZ/G2
+# compatible device
+  - items:
+  - const: renesas,sh-msiof  # deprecated
+
+  reg:
+minItems: 1
+maxItems: 2
+oneOf:
+  - items:
+  - description: CPU and DMA engine registers
+  - items:
+  - description: CPU registers
+  - description: DMA engine registers
+
+  interrupts:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  num-cs:
+description: |
+  Total number of chip selects (default is 1).
+  Up to 3 native chip selects are supported:
+0: MSIOF_SYNC
+1: MSIOF_SS1
+2: MSIOF_SS2
+  Hardware limitations related to chip selects:
+- Native chip selects are always deasserted in between transfers
+  that are part of the same message.  Use cs-gpios to work around
+  this.
+- All slaves using native chip selects must use the same spi-cs-high
+  configuration.  Use cs-gpios to work around this.
+- When using GPIO chip selects, at least one native chip select must
+  be left unused, as it will be driven anyway.
+minimum: 1
+maximum: 3
+default: 1
+
+  dmas:
+minItems: 2
+maxItems: 4
+
+  dma-names:
+minItems: 2
+maxItems: 4
+items:
+  enum: [ tx, rx ]
+
+  renesas,dtdl:
+description: delay sync signal (setup) in transmit mode.
+allOf:
+  - $ref: /schemas/types.yaml#/definitions/uint32
+  - enum:
+  - 0# no bit delay
+  - 50   # 0.5-clock-cycle delay
+  - 100  # 1-clock-cycle delay
+  - 150  # 1.5-clock-cycle delay
+  - 200  # 2-clock-cycle delay
+
+  renesas,syncdl:
+description: delay sync signal (hold) in transmit mode
+allOf:
+  - $ref: /schemas/types.yaml#/definitions/uint32
+  - enum:
+  - 0# no bit delay
+  - 50   # 0.5-clock-cycle delay
+  - 100  # 1-clock-cycle delay
+  - 150  # 1.5-clock-cycle delay
+  - 200  # 2-clock-cycle delay
+  - 300  # 3-clock-cycle delay
+
+  renesas,tx-fifo-size

Re: [PATCH v3 3/3] arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

2019-09-26 Thread Simon Horman
On Tue, Sep 24, 2019 at 01:18:30PM +0300, Sergei Shtylyov wrote:
> On 09/24/2019 01:15 PM, Sergei Shtylyov wrote:
> 
> >> Update simple-pm-bus node name from 'agnoc' to 'bus' reflecting the
> >> proposed binding description in json-schema which in turn reflects the ePAR
> > 
> >It's ePAPR. BTW, you can now refer to DT spec itself instead -- it was 
> > based
> > on ePAPR...
> 
> https://www.devicetree.org/specifications/

Thanks Sergei,

how about this?

  arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

  Update simple-pm-bus node name from 'agnoc' to 'bus' reflecting the
  proposed binding description in json-schema which in turn reflects the
  Devicetree specification [1] v0.3-rc2. 

"The name of a node should be somewhat generic, reflecting the function
 of the device and not its precise programming model. If appropriate,
 the name should be one of the following choices:
   ...
   * bus
   ..."

  Also drop the unit address as there is neither a reg property nor
  non-empty ranges.

  [1] https://www.devicetree.org/specifications/

Signed-off-by: Simon Horman 


[PATCH v3 3/3] arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

2019-09-24 Thread Simon Horman
Update simple-pm-bus node name from 'agnoc' to 'bus' reflecting the
proposed binding description in json-schema which in turn reflects the ePAR
standard - "the name of a node should be somewhat generic, reflecting the
function of the device and not its precise programming model."

Also drop the unit address as there is neither a reg property nor
non-empty ranges.

Signed-off-by: Simon Horman 
---
v2
* New patch
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi 
b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 96c0a481f454..99f376ebd27e 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -1373,7 +1373,7 @@
clock-names = "iface", "bus";
};
 
-   agnoc@0 {
+   bus {
power-domains = <&gcc AGGRE0_NOC_GDSC>;
compatible = "simple-pm-bus";
#address-cells = <1>;
-- 
2.11.0



[PATCH v3 0/3] dt-bindings: bus: simple-pm-bus, renesas-bsc: convert bindings to json-schema

2019-09-24 Thread Simon Horman
Convert Simple Power-Managed Bus and Convert Renesas Bus State Controller
(BSC) bindings documentation to json-schema.

Based on v5.3.

Simon Horman (3):
  dt-bindings: bus: simple-pm-bus: convert bindings to json-schema
  dt-bindings: bus: renesas-bsc: convert bindings to json-schema
  arm64: dts: qcom: msm8996: Update simple-pm-bus node name to 'bus'

 .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 60 +
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 -
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 75 ++
 arch/arm64/boot/dts/qcom/msm8996.dtsi  |  2 +-
 5 files changed, 136 insertions(+), 91 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

-- 
2.11.0



[PATCH v3 2/3] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-24 Thread Simon Horman
Convert Renesas Bus State Controller (BSC) bindings documentation to
json-schema.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml

v2
* Add required field as suggested by Ulrich Hecht
* Add custom 'select' in that leaves out "simple-pm-bus"
  to avoid matching on users of the binding documented
  in simple-pm-bus.yaml, which this binding extends
---
 .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 60 ++
 2 files changed, 60 insertions(+), 46 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml

diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
deleted file mode 100644
index 90e947269437..
--- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Renesas Bus State Controller (BSC)
-==
-
-The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
-Bridge", or "External Bus Interface") can be found in several Renesas ARM SoCs.
-It provides an external bus for connecting multiple external devices to the
-SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and USB.
-
-While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
-domain, and may have a gateable functional clock.
-Before a device connected to the BSC can be accessed, the PM domain
-containing the BSC must be powered on, and the functional clock
-driving the BSC must be enabled.
-
-The bindings for the BSC extend the bindings for "simple-pm-bus".
-
-
-Required properties
-  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
-   "simple-pm-bus" as fallbacks.
-SoC-specific values can be:
-   "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
-   "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-  - reg: Must contain the base address and length to access the bus controller.
-
-Optional properties:
-  - interrupts: Must contain a reference to the BSC interrupt, if available.
-  - clocks: Must contain a reference to the functional clock, if available.
-  - power-domains: Must contain a reference to the PM domain, if available.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
new file mode 100644
index ..7d10b62a52d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
@@ -0,0 +1,60 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Bus State Controller (BSC)
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
+  Bridge", or "External Bus Interface") can be found in several Renesas ARM
+  SoCs.  It provides an external bus for connecting multiple external
+  devices to the SoC, driving several chip select lines, for e.g. NOR
+  FLASH, Ethernet and USB.
+
+  While the BSC is a fairly simple memory-mapped bus, it may be part of a
+  PM domain, and may have a gateable functional clock.  Before a device
+  connected to the BSC can be accessed, the PM domain containing the BSC
+  must be powered on, and the functional clock driving the BSC must be
+  enabled.
+
+  The bindings for the BSC extend the bindings for "simple-pm-bus".
+
+allOf:
+  - $ref: simple-pm-bus.yaml#
+
+properties:
+  compatible:
+items:
+  - enum:
+  - renesas,bsc-r8a73a4  # R-Mobile APE6 (r8a73a4)
+  - renesas,bsc-sh73a0   # SH-Mobile AG5 (sh73a0)
+  - const: renesas,bsc
+  - {} # simple-pm-bus, but not listed here to avoid false select
+
+  reg:
+maxItems: 1
+
+  interrupts:
+

[PATCH v3 1/3] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-24 Thread Simon Horman
Convert Simple Power-Managed Bus bindings documentation to json-schema.

As a side effect of this change only simple-pm-bus is used in example. A
follow-up patch will provide an example for the separately documented
Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
"renesas,bsc" compat strings.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

v2
* Add SPDX line
* Remove extra blank line
* Add $nodename
* Remove extra leading space in compatible
* Update compatible to allow override by other schemas
* Allow #size-cells to be 1 or 2
* Do not limit ranges or clocks to 1 item
* Add anyOf requirement on ranges or clocks
* Update example based on msm8996.dtsi
---
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 -
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 75 ++
 2 files changed, 75 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
deleted file mode 100644
index 6f15037131ed..
--- a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Simple Power-Managed Bus
-
-
-A Simple Power-Managed Bus is a transparent bus that doesn't need a real
-driver, as it's typically initialized by the boot loader.
-
-However, its bus controller is part of a PM domain, or under the control of a
-functional clock.  Hence, the bus controller's PM domain and/or clock must be
-enabled for child devices connected to the bus (either on-SoC or externally)
-to function.
-
-While "simple-pm-bus" follows the "simple-bus" set of properties, as specified
-in the Devicetree Specification, it is not an extension of "simple-bus".
-
-
-Required properties:
-  - compatible: Must contain at least "simple-pm-bus".
-   Must not contain "simple-bus".
-   It's recommended to let this be preceded by one or more
-   vendor-specific compatible values.
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-
-Optional platform-specific properties for clock or PM domain control (at least
-one of them is required):
-  - clocks: Must contain a reference to the functional clock(s),
-  - power-domains: Must contain a reference to the PM domain.
-Please refer to the binding documentation for the clock and/or PM domain
-providers for more details.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
new file mode 100644
index ..598b71d779b1
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple Power-Managed Bus
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  A Simple Power-Managed Bus is a transparent bus that doesn't need a real
+  driver, as it's typically initialized by the boot loader.
+
+  However, its bus controller is part of a PM domain, or under the control
+  of a functional clock.  Hence, the bus controller's PM domain and/or
+  clock must be enabled for child devices connected to the bus (either
+  on-SoC or externally) to function.
+
+  While "simple-pm-bus" follows the "simple-bus" set of properties, as
+  specified in the Devicetree Specification, it is not an extension of
+  "simple-bus".
+
+properties:
+  $nodename:
+pattern: "^bus([@-][0-9a-f]+)?$"
+
+  compatible:
+contains:
+  const: simple-pm-bus
+description:
+  Shall contain "simple-pm-bus" in addition to a optional bus-specific
+  compatible strings defined in individual pm-bus bindings.
+
+  '#address-cells':
+con

Re: [PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-24 Thread Simon Horman
On Mon, Sep 23, 2019 at 07:40:28AM -0500, Rob Herring wrote:
> On Mon, Sep 23, 2019 at 6:53 AM Simon Horman  wrote:
> >
> > On Thu, Sep 19, 2019 at 02:33:58PM -0500, Rob Herring wrote:
> > > On Thu, Sep 19, 2019 at 10:10 AM Simon Horman  wrote:
> > > >
> > > > On Tue, Sep 17, 2019 at 07:12:16AM -0500, Rob Herring wrote:
> > > > > On Mon, Sep 16, 2019 at 10:35 AM Simon Horman
> > > > >  wrote:
> >
> > ...
> >
> > > > > > +
> > > > > > +  power-domains:
> > > > > > +# Required if clocks is absent, optional otherwise
> > > > > > +minItems: 1
> > > > > > +
> > > > > > +required:
> > > > > > +  - compatible
> > > > > > +  - '#address-cells'
> > > > > > +  - '#size-cells'
> > > > > > +  - ranges
> > > > >
> > > > > This will capture what you commented above:
> > > > >
> > > > > oneOf:
> > > > >   - required:
> > > > >   - clocks
> > > > >   - required:
> > > > >   - power-domains
> > > >
> > > > Thanks. Unfortunately dtbs_check does not seem happy
> > > > if both clocks and power-domains are present.
> > >
> > > I was thinking it was either or. Use 'anyOf' instead.
> >
> > Thanks, perhaps the tooling needs updating to handle this.
> 
> Indeed. Now fixed.

Thanks, the above seems to be working nicely now.


[PATCH v2] dt-bindings: rtc: rtc-sh: convert bindings to json-schema

2019-09-23 Thread Simon Horman
Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
to json-schema.  Also name bindings documentation file according to the
compat string being documented.

Also correct syntax error in interrupts field in example.

Signed-off-by: Simon Horman 
Reviewed-by: Ulrich Hecht 
---
v2
* Added reviewed-by tag from Ulrich
* Constrain clocks and clock-names as suggested by Rob Herring
---
 .../devicetree/bindings/rtc/renesas,sh-rtc.yaml| 70 ++
 Documentation/devicetree/bindings/rtc/rtc-sh.txt   | 28 -
 2 files changed, 70 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml 
b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
new file mode 100644
index ..dcff573cbdb1
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Real Time Clock for Renesas SH and ARM SoCs
+
+maintainers:
+  - Chris Brandt 
+  - Geert Uytterhoeven 
+
+properties:
+  compatible:
+items:
+  - const: renesas,r7s72100-rtc  # RZ/A1H
+  - const: renesas,sh-rtc
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 3
+
+  interrupt-names:
+items:
+  - const: alarm
+  - const: period
+  - const: carry
+
+  clocks:
+# The functional clock source for the RTC controller must be listed
+# first (if it exists). Additionally, potential clock counting sources
+# are to be listed.
+minItems: 1
+maxItems: 4
+
+  clock-names:
+# The functional clock must be labeled as "fck". Other clocks
+# may be named in accordance to the SoC hardware manuals.
+minItems: 1
+maxItems: 4
+items:
+  enum: [ fck, rtc_x1, rtc_x3, extal ]
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+
+examples:
+  - |
+#include 
+#include 
+#include 
+
+rtc: rtc@fcff1000 {
+compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+reg = <0xfcff1000 0x2e>;
+interrupts = ,
+ ,
+ ;
+interrupt-names = "alarm", "period", "carry";
+clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+ <&rtc_x3_clk>, <&extal_clk>;
+clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
+};
diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt 
b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
deleted file mode 100644
index 7676c7d28874..
--- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-* Real Time Clock for Renesas SH and ARM SoCs
-
-Required properties:
-- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
-  fallback.
-- reg: physical base address and length of memory mapped region.
-- interrupts: 3 interrupts for alarm, period, and carry.
-- interrupt-names: The interrupts should be labeled as "alarm", "period", and
-  "carry".
-- clocks: The functional clock source for the RTC controller must be listed
-  first (if exists). Additionally, potential clock counting sources are to be
-  listed.
-- clock-names: The functional clock must be labeled as "fck". Other clocks
-  may be named in accordance to the SoC hardware manuals.
-
-
-Example:
-rtc: rtc@fcff1000 {
-   compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
-   reg = <0xfcff1000 0x2e>;
-   interrupts = ;
-   interrupt-names = "alarm", "period", "carry";
-   clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
-<&rtc_x3_clk>, <&extal_clk>;
-   clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
-};
-- 
2.11.0



[PATCH v2] dt-bindings: thermal: rcar-thermal: convert bindings to json-schema

2019-09-23 Thread Simon Horman
Convert Renesas R-Car Thermal bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.

As a side effect of this change all currently supported/used compat
strings are listed while no while card compat string is documented.
This, in my opinion, is desirable as only supported hardware should
be documented.

A possible follow-up is to deprecate renesas,rcar-thermal
after describing thermal zones in the DT for R-Mobile APE6 and R-Car H1.

Signed-off-by: Simon Horman 
---
Based on v5.3
Tested using:
  ARCH=arm make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml

v2
* Update compat strings to reflect that:
  - RZ/G1M and RZ/G1N are not compatible with renesas,rcar-gen2-thermal
  - R-Car V3M, E3 and D3, and RZ/G2E are not compatible with
renesas,rcar-thermal
* Update reg property
  - Drop uninformative comment
  - Do not limit to a maximum of one item
* Add SPDX tag
---
 .../devicetree/bindings/thermal/rcar-thermal.txt   |  78 --
 .../bindings/thermal/renesas,rcar-thermal.yaml | 116 +
 2 files changed, 116 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/rcar-thermal.txt
 create mode 100644 
Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml

diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt 
b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
deleted file mode 100644
index 196112d23b1e..
--- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-* Renesas R-Car Thermal
-
-Required properties:
-- compatible   : "renesas,thermal-",
-  "renesas,rcar-gen2-thermal" (with thermal-zone) or
-  "renesas,rcar-thermal" (without thermal-zone) as
-   fallback except R-Car V3M/E3/D3 and RZ/G2E.
- Examples with soctypes are:
-   - "renesas,thermal-r8a73a4" (R-Mobile APE6)
-   - "renesas,thermal-r8a7743" (RZ/G1M)
-   - "renesas,thermal-r8a7744" (RZ/G1N)
-   - "renesas,thermal-r8a774c0" (RZ/G2E)
-   - "renesas,thermal-r8a7779" (R-Car H1)
-   - "renesas,thermal-r8a7790" (R-Car H2)
-   - "renesas,thermal-r8a7791" (R-Car M2-W)
-   - "renesas,thermal-r8a7792" (R-Car V2H)
-   - "renesas,thermal-r8a7793" (R-Car M2-N)
-   - "renesas,thermal-r8a77970" (R-Car V3M)
-   - "renesas,thermal-r8a77990" (R-Car E3)
-   - "renesas,thermal-r8a77995" (R-Car D3)
-- reg  : Address range of the thermal registers.
- The 1st reg will be recognized as common register
- if it has "interrupts".
-
-Option properties:
-
-- interrupts   : If present should contain 3 interrupts for
-  R-Car V3M/E3/D3 and RZ/G2E or 1 interrupt otherwise.
-
-Example (non interrupt support):
-
-thermal@ffc48000 {
-   compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
-   reg = <0xffc48000 0x38>;
-};
-
-Example (interrupt support):
-
-thermal@e61f {
-   compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
-   reg = <0xe61f 0x14
-   0xe61f0100 0x38
-   0xe61f0200 0x38
-   0xe61f0300 0x38>;
-   interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
-};
-
-Example (with thermal-zone):
-
-thermal-zones {
-   cpu_thermal: cpu-thermal {
-   polling-delay-passive   = <1000>;
-   polling-delay   = <5000>;
-
-   thermal-sensors = <&thermal>;
-
-   trips {
-   cpu-crit {
-   temperature = <115000>;
-   hysteresis  = <0>;
-   type= "critical";
-   };
-   };
-   cooling-maps {
-   };
-   };
-};
-
-thermal: thermal@e61f {
-   compatible ="renesas,thermal-r8a7790",
-   "renesas,rcar-gen2-thermal",
-   "renesas,rcar-thermal";
-   reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
-   interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
-   power-domains = <&cpg_clocks>;
-

Re: [PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-23 Thread Simon Horman
On Thu, Sep 19, 2019 at 02:33:58PM -0500, Rob Herring wrote:
> On Thu, Sep 19, 2019 at 10:10 AM Simon Horman  wrote:
> >
> > On Tue, Sep 17, 2019 at 07:12:16AM -0500, Rob Herring wrote:
> > > On Mon, Sep 16, 2019 at 10:35 AM Simon Horman
> > >  wrote:

...

> > > > +
> > > > +  power-domains:
> > > > +# Required if clocks is absent, optional otherwise
> > > > +minItems: 1
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - '#address-cells'
> > > > +  - '#size-cells'
> > > > +  - ranges
> > >
> > > This will capture what you commented above:
> > >
> > > oneOf:
> > >   - required:
> > >   - clocks
> > >   - required:
> > >   - power-domains
> >
> > Thanks. Unfortunately dtbs_check does not seem happy
> > if both clocks and power-domains are present.
> 
> I was thinking it was either or. Use 'anyOf' instead.

Thanks, perhaps the tooling needs updating to handle this.

I now have:

required:
  - compatible
  - '#address-cells'
  - '#size-cells'
  - ranges

anyOf:
  - required:
  - clocks
  - required:
  - power-domains

And see:

# cr make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
...

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/dtschema/lib.py", line 429, in 
process_schema
DTValidator.check_schema(schema)
  File "/usr/local/lib/python3.7/dist-packages/dtschema/lib.py", line 575, in 
check_schema
raise jsonschema.SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: Additional properties are not allowed 
('anyOf' was unexpected)

Failed validating 'additionalProperties' in metaschema['allOf'][0]:
{'$id': 'http://devicetree.org/meta-schemas/base.yaml#',
 '$schema': 'http://json-schema.org/draft-07/schema#',
 'additionalProperties': False,
 'allOf': [{'$ref': 'http://json-schema.org/draft-07/schema#'}],
 'description': 'Metaschema for devicetree binding documentation',
 'properties': {'$id': {'pattern': 
'http://devicetree.org/schemas/.*\\.yaml#'},
'$schema': {'enum': 
['http://devicetree.org/meta-schemas/core.yaml#',
 
'http://devicetree.org/meta-schemas/base.yaml#']},
'additionalProperties': {'type': 'boolean'},
'allOf': {'items': {'propertyNames': {'enum': ['$ref',
   'if',
   'then',
   'else']}}},
'definitions': True,
'dependencies': True,
'description': True,
'else': True,
'examples': {'items': {'type': 'string'},
 'type': 'array'},
'if': True,
'maintainers': {'items': {'format': 'email',
  'type': 'string'},
'type': 'array'},
'oneOf': True,
'patternProperties': True,
'properties': True,
'required': True,
'select': {'allOf': [{'$ref': 
'http://json-schema.org/draft-07/schema#'},
 {'oneOf': [{'properties': 
{'properties': True,
'required': 
True},
 'type': 'object'},
{'type': 'boolean'}]}]},
'then': True,
'title': {'maxLength': 100},
'unevaluatedProperties': {'type': 'boolean'}},
 'required': ['$id', '$schema', 'title', 'maintainers']}

On schema:
{'

Re: [PATCH] soc: renesas: rcar-sysc: Remove unneeded inclusion of

2019-09-23 Thread Simon Horman
On Fri, Sep 20, 2019 at 04:47:05PM +0200, Geert Uytterhoeven wrote:
> No R-Car or RZ/G SYSC driver uses any of the definitions provided by
> , hence there is no need to include this header file.
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH] soc: renesas: r8a774c0-sysc: Fix power request conflicts

2019-09-23 Thread Simon Horman
On Fri, Sep 20, 2019 at 04:35:23PM +0200, Geert Uytterhoeven wrote:
> Describe the location and contents of the SYSCEXTMASK register on
> RZ/G2E, to prevent conflicts between internal and external power
> requests.
> 
> Based on a patch in the BSP by Dien Pham .
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH] dt-bindings: pwm: renesas: tpu: convert bindings to json-schema

2019-09-23 Thread Simon Horman
On Sat, Sep 21, 2019 at 04:36:29AM +0900, Yoshihiro Kaneko wrote:
> Convert Renesas R-Car Timer Pulse Unit PWM Controller bindings documentation
> to json-schema.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 



Re: [PATCH] dt-bindings: pwm: renesas: pwm-rcar: convert bindings to json-schema

2019-09-23 Thread Simon Horman
On Sat, Sep 21, 2019 at 04:35:27AM +0900, Yoshihiro Kaneko wrote:
> Convert Renesas R-Car PWM Timer Controller bindings documentation to
> json-schema.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 



Re: [PATCH] dt-bindings: irqchip: renesas: intc-irqpin: convert bindings to json-schema

2019-09-23 Thread Simon Horman
On Sat, Sep 21, 2019 at 04:34:21AM +0900, Yoshihiro Kaneko wrote:
> Convert R-/SH-Mobile IRQPin Controller bindings documentation to json-schema.
> 
> Signed-off-by: Yoshihiro Kaneko 
> ---
>  .../interrupt-controller/renesas,intc-irqpin.txt   |  62 -
>  .../interrupt-controller/renesas,intc-irqpin.yaml  | 102 
> +
>  2 files changed, 102 insertions(+), 62 deletions(-)
>  delete mode 100644 
> Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
>  create mode 100644 
> Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
>  
> b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
> deleted file mode 100644
> index 772c550..000
> --- 
> a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -DT bindings for the R-/SH-Mobile irqpin controller
> -
> -Required properties:
> -
> -- compatible: has to be "renesas,intc-irqpin-", 
> "renesas,intc-irqpin"
> -  as fallback.
> -  Examples with soctypes are:
> -- "renesas,intc-irqpin-r8a7740" (R-Mobile A1)
> -- "renesas,intc-irqpin-r8a7778" (R-Car M1A)
> -- "renesas,intc-irqpin-r8a7779" (R-Car H1)
> -- "renesas,intc-irqpin-sh73a0" (SH-Mobile AG5)
> -
> -- reg: Base address and length of each register bank used by the external
> -  IRQ pins driven by the interrupt controller hardware module. The base
> -  addresses, length and number of required register banks varies with 
> soctype.
> -- interrupt-controller: Identifies the node as an interrupt controller.
> -- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined 
> in
> -  interrupts.txt in this directory.
> -- interrupts: Must contain a list of interrupt specifiers. For each interrupt
> -  provided by this irqpin controller instance, there must be one entry,
> -  referring to the corresponding parent interrupt.
> -
> -Optional properties:
> -
> -- any properties, listed in interrupts.txt, and any standard resource 
> allocation
> -  properties
> -- sense-bitfield-width: width of a single sense bitfield in the SENSE 
> register,
> -  if different from the default 4 bits
> -- control-parent: disable and enable interrupts on the parent interrupt
> -  controller, needed for some broken implementations
> -- clocks: Must contain a reference to the functional clock.  This property is
> -  mandatory if the hardware implements a controllable functional clock for
> -  the irqpin controller instance.
> -- power-domains: Must contain a reference to the power domain. This property 
> is
> -  mandatory if the irqpin controller instance is part of a controllable power
> -  domain.
> -
> -
> -Example
> 
> -
> - irqpin1: interrupt-controller@e694 {
> - compatible = "renesas,intc-irqpin-r8a7740",
> -  "renesas,intc-irqpin";
> - #interrupt-cells = <2>;
> - interrupt-controller;
> - reg = <0xe694 4>,
> - <0xe6900014 4>,
> - <0xe6900024 1>,
> - <0xe6900044 1>,
> - <0xe6900064 1>;
> - interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH
> -   0 149 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
> - power-domains = <&pd_a4s>;
> - };
> diff --git 
> a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
>  
> b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
> new file mode 100644
> index 000..d4d3cf8
> --- /dev/null
> +++ 
> b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
> @@ -0,0 +1,102 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: 
> http://devicetree.org/schemas/interrupt-controller/renesas,intc-irqpin.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: DT bindings for the R-/SH-Mobile irqpin controller
> +
> +maintainers:
> +  - Geert Uytterhoeven 

I guess Geert's email address got fuzzed somehow.

> +  - Guennadi Liakhovetski 

I believe that its been a while since Guennadi worked in this area.
I'd suggest not including him as a maintainer of this binding.

> +
> +properties:
> +  compatible:
> +items:
> +  - enum:
> +  - renesas,intc-irqpin-r8a7740  # R-Mobile A1
> +  - renesas,intc-irqpin-r8a7778  # R-Car M1A
> +  - renesas,intc-irqpin-r8a7779  # R-Car H1
> +  - renes

Re: [PATCH v3] dt-bindings: irqchip: renesas-irqc: convert bindings to json-schema

2019-09-23 Thread Simon Horman
On Fri, Sep 20, 2019 at 02:48:31AM +0900, Yoshihiro Kaneko wrote:
> Convert Renesas Interrupt Controller bindings documentation to json-schema.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 


Re: [PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-19 Thread Simon Horman
On Tue, Sep 17, 2019 at 07:12:16AM -0500, Rob Herring wrote:
> On Mon, Sep 16, 2019 at 10:35 AM Simon Horman
>  wrote:
> >
> > Convert Simple Power-Managed Bus bindings documentation to json-schema.
> >
> > As a side effect of this change only simple-pm-bus is used in example. A
> > follow-up patch will provide an example for the separately documented
> > Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
> > "renesas,bsc" compat strings.
> >
> > Signed-off-by: Simon Horman 
> > ---
> > * Tested using:
> >   # ARCH=arm64 make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> >   # ARCH=arm   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > ---
> >  .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 --
> >  .../devicetree/bindings/bus/simple-pm-bus.yaml | 68 
> > ++
> >  2 files changed, 68 insertions(+), 44 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> >  create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> 
> > diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
> > b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > new file mode 100644
> > index ..72a3644974e3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> > @@ -0,0 +1,68 @@
> 
> SPDX tag?
> 
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Simple Power-Managed Bus
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven 
> > +
> > +description: |
> > +  A Simple Power-Managed Bus is a transparent bus that doesn't need a real
> > +  driver, as it's typically initialized by the boot loader.
> > +
> > +  However, its bus controller is part of a PM domain, or under the control
> > +  of a functional clock.  Hence, the bus controller's PM domain and/or
> > +  clock must be enabled for child devices connected to the bus (either
> > +  on-SoC or externally) to function.
> > +
> > +  While "simple-pm-bus" follows the "simple-bus" set of properties, as
> > +  specified in the Devicetree Specification, it is not an extension of
> > +  "simple-bus".
> > +
> > +
> > +properties:
> 
> Add $nodename in here.


For now I have gone with:

  $nodename:
pattern: "^bus@[0-9a-f]+$"

But this implies updating both msm8996.dtsi and the proposed
example (see below) to use bus@ rather than agnoc@.

If this is the right way to to then perhaps it is best to use the
following until msm8996.dtsi is updated.

  $nodename:
pattern: "^(bus|agnoc)@[0-9a-f]+$"

> 
> > +  compatible:
> > +items:
> > +   - const: simple-pm-bus
> 
> extra leading space.
> 
> > +
> > +  '#address-cells':
> > +const: 1
> > +
> > +  '#size-cells':
> > +const: 1
> 
> 1 or 2 should be valid...
> 
> > +
> > +  ranges:
> > +# Mapping between parent address and child address spaces.
> > +maxItems: 1
> 
> empty or multiple ranges should be possible.
> 
> > +
> > +  clocks:
> > +# Functional clocks
> > +# Required if power-domains is absent, optional otherwise
> > +minItems: 1
> 
> This will imply maxItems is 1 which I don't think you want.
> 
> Though more than 1 starts to mean you need to know specifically what the h/w 
> is.

I have changed this to:

  clocks: true
# Functional clocks
# Required if power-domains is absent, optional otherwise

> > +
> > +  power-domains:
> > +# Required if clocks is absent, optional otherwise
> > +minItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - '#address-cells'
> > +  - '#size-cells'
> > +  - ranges
> 
> This will capture what you commented above:
> 
> oneOf:
>   - required:
>   - clocks
>   - required:
>   - power-domains

Thanks. Unfortunately dtbs_check does not seem happy
if both clocks and power-domains are present.

# cr make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
...
/home/horms/projects/linux/renesas/arch/arm/boot/dts/r8a73a4-ape6evm.dt.yaml: 
bus@fec1: {'compatible': ['renesas,bsc-r8a73a4', 'renesa

Re: [PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-19 Thread Simon Horman
On Tue, Sep 17, 2019 at 07:48:17AM -0500, Rob Herring wrote:
> On Tue, Sep 17, 2019 at 6:29 AM Simon Horman  wrote:
> > On Mon, Sep 16, 2019 at 05:33:56PM +0200, Simon Horman wrote:

...

> > > +properties:
> > > +  compatible:
> > > +items:
> > > +   - const: simple-pm-bus
> >
> > The following patch, for Renesas BSC, also
> > describes the simple-pm-bus but also requires other compatible
> > strings to be present.
> >
> > In order to facilitate that I tried the following:
> >
> >compatible:
> >   contains:
> >  const: simple-pm-bus
> >   additionalItems: true
> >
> > This allows make dtbs_check DT_SCHEMA_FILES=.../simple-pm-bus.yaml to pass
> > in cases where there are more compat strings pesent. However
> > make dtbs_check DT_SCHEMA_FILES=...renesas,bsc.yaml (schema file
> > introduced in following patch) fails in the case
> > where the only compat string is simple-pm-bus.
> >
> > make dtbs_check DT_SCHEMA_FILES=...renesas,bsc.yaml also fails
> > due to the reg property not being present for the same compat case,
> > which should be valid according to simple-pm-bus.yaml.
> >
> > Does anyone have any guidance on how to proceed?
> 
> You'll need a custom 'select' in renesas,bsc.yaml that leaves out
> "simple-pm-bus". See "panel-lvds" users in linux-next for an example.

Thanks, I think I have that working now.


Re: [PATCH v2] dt-bindings: irqchip: renesas-irqc: convert bindings to json-schema

2019-09-19 Thread Simon Horman
On Thu, Sep 19, 2019 at 12:05:21AM +0900, Yoshihiro Kaneko wrote:
> Convert Renesas Interrupt Controller bindings documentation to json-schema.
> 
> Signed-off-by: Yoshihiro Kaneko 
> ---
> 
> v2
> - Add SPDX tag.
> - Document interrupt-contoller, reg, interrupts, power-domains and resets
>   properties.
> - Add addtionalProperties.
> 
> ---
>  .../bindings/interrupt-controller/renesas,irqc.txt | 48 -
>  .../interrupt-controller/renesas,irqc.yaml | 84 
> ++
>  2 files changed, 84 insertions(+), 48 deletions(-)
>  delete mode 100644 
> Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
>  create mode 100644 
> Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt 
> b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
> deleted file mode 100644
> index f977ea7..000
> --- a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -DT bindings for the R-Mobile/R-Car/RZ/G interrupt controller
> -
> -Required properties:
> -
> -- compatible: must be "renesas,irqc-" or 
> "renesas,intc-ex-",
> -   and "renesas,irqc" as fallback.
> -  Examples with soctypes are:
> -- "renesas,irqc-r8a73a4" (R-Mobile APE6)
> -- "renesas,irqc-r8a7743" (RZ/G1M)
> -- "renesas,irqc-r8a7744" (RZ/G1N)
> -- "renesas,irqc-r8a7745" (RZ/G1E)
> -- "renesas,irqc-r8a77470" (RZ/G1C)
> -- "renesas,irqc-r8a7790" (R-Car H2)
> -- "renesas,irqc-r8a7791" (R-Car M2-W)
> -- "renesas,irqc-r8a7792" (R-Car V2H)
> -- "renesas,irqc-r8a7793" (R-Car M2-N)
> -- "renesas,irqc-r8a7794" (R-Car E2)
> -- "renesas,intc-ex-r8a774a1" (RZ/G2M)
> -- "renesas,intc-ex-r8a774c0" (RZ/G2E)
> -- "renesas,intc-ex-r8a7795" (R-Car H3)
> -- "renesas,intc-ex-r8a7796" (R-Car M3-W)
> -- "renesas,intc-ex-r8a77965" (R-Car M3-N)
> -- "renesas,intc-ex-r8a77970" (R-Car V3M)
> -- "renesas,intc-ex-r8a77980" (R-Car V3H)
> -- "renesas,intc-ex-r8a77990" (R-Car E3)
> -- "renesas,intc-ex-r8a77995" (R-Car D3)
> -- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined 
> in
> -  interrupts.txt in this directory
> -- clocks: Must contain a reference to the functional clock.
> -
> -Optional properties:
> -
> -- any properties, listed in interrupts.txt, and any standard resource 
> allocation
> -  properties
> -
> -Example:
> -
> - irqc0: interrupt-controller@e61c {
> - compatible = "renesas,irqc-r8a7790", "renesas,irqc";
> - #interrupt-cells = <2>;
> - interrupt-controller;
> - reg = <0 0xe61c 0 0x200>;
> - interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
> -  <0 1 IRQ_TYPE_LEVEL_HIGH>,
> -  <0 2 IRQ_TYPE_LEVEL_HIGH>,
> -  <0 3 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&mstp4_clks R8A7790_CLK_IRQC>;
> - };
> diff --git 
> a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml 
> b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml
> new file mode 100644
> index 000..18497c3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/interrupt-controller/renesas,irqc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: DT bindings for the R-Mobile/R-Car/RZ/G interrupt controller
> +
> +maintainers:
> +  - Geert Uytterhoeven 
> +
> +properties:
> +  compatible:
> +items:
> +  - enum:
> +  - renesas,irqc-r8a73a4# R-Mobile APE6
> +  - renesas,irqc-r8a7743# RZ/G1M
> +  - renesas,irqc-r8a7744# RZ/G1N
> +  - renesas,irqc-r8a7745# RZ/G1E
> +  - renesas,irqc-r8a77470   # RZ/G1C
> +  - renesas,irqc-r8a7790# R-Car H2
> +  - renesas,irqc-r8a7791# R-Car M2-W
> +  - renesas,irqc-r8a7792# R-Car V2H
> +  - renesas,irqc-r8a7793# R-Car M2-N
> +  - renesas,irqc-r8a7794# R-Car E2
> +  - renesas,intc-ex-r8a774a1# RZ/G2M
> +  - renesas,intc-ex-r8a774c0# RZ/G2E
> +  - renesas,intc-ex-r8a7795 # R-Car H3
> +  - renesas,intc-ex-r8a7796 # R-Car M3-W
> +  - renesas,intc-ex-r8a77965# R-Car M3-N
> +  - renesas,intc-ex-r8a77970# R-Car V3M
> +  - renesas,intc-ex-r8a77980# R-Car V3H
> +  - renesas,intc-ex-r8a77990# R-Car E3
> +  - renesas,intc-ex-r8a77995# R-Car D3
> +  - const: renesas,irqc
> +
> +  '#interrupt-cells':
> +# an interrupt index and flags, as defined in interrupts.txt in
> +# this directory
> +const: 2
> +
> +  interrupt-cont

Re: [PATCH] dt-bindings: thermal: rcar-thermal: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Tue, Sep 17, 2019 at 01:37:39PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Sep 17, 2019 at 1:32 PM Simon Horman  wrote:
> > I missread the original bindings document and somehow missed
> > warnings emitted by dtbs_check. I now think the compat property should be
> > described as:
> >
> >   compatible:
> > oneOf:
> >   - items:
> >   - enum:
> >   - renesas,thermal-r8a73a4   # R-Mobile APE6
> >   - renesas,thermal-r8a7779   # R-Car H1
> >   - const: renesas,rcar-thermal   # Without thermal-zone
> >
> >   - items:
> >   - enum:
> >   - renesas,thermal-r8a7790   # R-Car H2
> >   - renesas,thermal-r8a7791   # R-Car M2-W
> >   - renesas,thermal-r8a7792   # R-Car V2H
> >   - renesas,thermal-r8a7793   # R-Car M2-N
> >   - const: renesas,rcar-gen2-thermal  # With thermal-zone
> >   - const: renesas,rcar-thermal   # Without thermal-zone
> >
> >   - items:
> >   - enum:
> >   - renesas,thermal-r8a7743   # RZ/G1M
> >   - renesas,thermal-r8a7744   # RZ/G1N
> >   - const: renesas,rcar-gen2-thermal  # With thermal-zone
> >
> >   - items:
> >   - enum:
> >   - renesas,thermal-r8a774c0  # RZ/G2E
> >   - renesas,thermal-r8a77970  # R-Car V3M
> >   - renesas,thermal-r8a77990  # R-Car E3
> >   - renesas,thermal-r8a77995  # R-Car D3
> 
> Perhaps we should (try to) get rid of the "Without thermal-zone" legacy?
> All R-Car Gen2 DTSes received thermal zones a while ago.
> R-Mobile APE6 and R-Car H1 still don't have them described, though.

Do you mean deprecate renesas,rcar-thermal ?

If so that sounds reasonable if APE6 and R-Car H1 supports thermal-zones.
But I don't feel it belongs in this patch, which aims
to translate the documentation from one format to another
(perhaps highlighting problems along the way :).


Re: [PATCH] dt-bindings: thermal: rcar-thermal: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Mon, Sep 16, 2019 at 12:07:17PM +0200, Simon Horman wrote:
> Convert Renesas R-Car Thermal bindings documentation to json-schema.
> Also name bindings documentation file according to the compat string
> being documented.
> 
> As a side effect of this change all currently supported/used compat
> strings are listed while no while card compat string is documented.
> This, in my opinion, is desirable as only supported hardware should
> be documented.
> 
> Signed-off-by: Simon Horman 
> ---
> Based on v5.3-rc1
> Tested using:
>   ARCH=arm make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml
> ---
>  .../devicetree/bindings/thermal/rcar-thermal.txt   |  78 ---
>  .../bindings/thermal/renesas,rcar-thermal.yaml | 110 
> +
>  2 files changed, 110 insertions(+), 78 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/thermal/rcar-thermal.txt
>  create mode 100644 
> Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml
> 
> diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt 
> b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> deleted file mode 100644
> index 196112d23b1e..
> --- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> +++ /dev/null
> @@ -1,78 +0,0 @@
> -* Renesas R-Car Thermal
> -
> -Required properties:
> -- compatible : "renesas,thermal-",
> -"renesas,rcar-gen2-thermal" (with thermal-zone) or
> -"renesas,rcar-thermal" (without thermal-zone) as
> -   fallback except R-Car V3M/E3/D3 and RZ/G2E.
> -   Examples with soctypes are:
> - - "renesas,thermal-r8a73a4" (R-Mobile APE6)
> - - "renesas,thermal-r8a7743" (RZ/G1M)
> - - "renesas,thermal-r8a7744" (RZ/G1N)
> - - "renesas,thermal-r8a774c0" (RZ/G2E)
> - - "renesas,thermal-r8a7779" (R-Car H1)
> - - "renesas,thermal-r8a7790" (R-Car H2)
> - - "renesas,thermal-r8a7791" (R-Car M2-W)
> - - "renesas,thermal-r8a7792" (R-Car V2H)
> - - "renesas,thermal-r8a7793" (R-Car M2-N)
> - - "renesas,thermal-r8a77970" (R-Car V3M)
> - - "renesas,thermal-r8a77990" (R-Car E3)
> - - "renesas,thermal-r8a77995" (R-Car D3)
> -- reg: Address range of the thermal registers.
> -   The 1st reg will be recognized as common register
> -   if it has "interrupts".
> -
> -Option properties:
> -
> -- interrupts : If present should contain 3 interrupts for
> -  R-Car V3M/E3/D3 and RZ/G2E or 1 interrupt 
> otherwise.
> -
> -Example (non interrupt support):
> -
> -thermal@ffc48000 {
> - compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
> - reg = <0xffc48000 0x38>;
> -};
> -
> -Example (interrupt support):
> -
> -thermal@e61f {
> - compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
> - reg = <0xe61f 0x14
> - 0xe61f0100 0x38
> - 0xe61f0200 0x38
> - 0xe61f0300 0x38>;
> - interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> -};
> -
> -Example (with thermal-zone):
> -
> -thermal-zones {
> - cpu_thermal: cpu-thermal {
> - polling-delay-passive   = <1000>;
> - polling-delay   = <5000>;
> -
> - thermal-sensors = <&thermal>;
> -
> - trips {
> - cpu-crit {
> - temperature = <115000>;
> - hysteresis  = <0>;
> - type= "critical";
> - };
> - };
> - cooling-maps {
> - };
> - };
> -};
> -
> -thermal: thermal@e61f {
> - compatible ="renesas,thermal-r8a7790",
> - "renesas,rcar-gen2-thermal",
> - "renesas,rcar-thermal";
> - reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
> - interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&mstp5_clks R8A7790_CLK_THE

Re: [PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Mon, Sep 16, 2019 at 05:33:56PM +0200, Simon Horman wrote:
> Convert Simple Power-Managed Bus bindings documentation to json-schema.
> 
> As a side effect of this change only simple-pm-bus is used in example. A
> follow-up patch will provide an example for the separately documented
> Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
> "renesas,bsc" compat strings.
> 
> Signed-off-by: Simon Horman 
> ---
> * Tested using:
>   # ARCH=arm64 make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
>   # ARCH=arm   make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> ---
>  .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 --
>  .../devicetree/bindings/bus/simple-pm-bus.yaml | 68 
> ++
>  2 files changed, 68 insertions(+), 44 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
>  create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> 
> diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt 
> b/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> deleted file mode 100644
> index 6f15037131ed..
> --- a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -Simple Power-Managed Bus
> -
> -
> -A Simple Power-Managed Bus is a transparent bus that doesn't need a real
> -driver, as it's typically initialized by the boot loader.
> -
> -However, its bus controller is part of a PM domain, or under the control of a
> -functional clock.  Hence, the bus controller's PM domain and/or clock must be
> -enabled for child devices connected to the bus (either on-SoC or externally)
> -to function.
> -
> -While "simple-pm-bus" follows the "simple-bus" set of properties, as 
> specified
> -in the Devicetree Specification, it is not an extension of "simple-bus".
> -
> -
> -Required properties:
> -  - compatible: Must contain at least "simple-pm-bus".
> - Must not contain "simple-bus".
> - It's recommended to let this be preceded by one or more
> - vendor-specific compatible values.
> -  - #address-cells, #size-cells, ranges: Must describe the mapping between
> - parent address and child address spaces.
> -
> -Optional platform-specific properties for clock or PM domain control (at 
> least
> -one of them is required):
> -  - clocks: Must contain a reference to the functional clock(s),
> -  - power-domains: Must contain a reference to the PM domain.
> -Please refer to the binding documentation for the clock and/or PM domain
> -providers for more details.
> -
> -
> -Example:
> -
> - bsc: bus@fec1 {
> - compatible = "renesas,bsc-sh73a0", "renesas,bsc",
> -  "simple-pm-bus";
> - #address-cells = <1>;
> - #size-cells = <1>;
> - ranges = <0 0 0x2000>;
> - reg = <0xfec1 0x400>;
> - interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&zb_clk>;
> - power-domains = <&pd_a4s>;
> - };
> diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
> b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> new file mode 100644
> index ..72a3644974e3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
> @@ -0,0 +1,68 @@
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Simple Power-Managed Bus
> +
> +maintainers:
> +  - Geert Uytterhoeven 
> +
> +description: |
> +  A Simple Power-Managed Bus is a transparent bus that doesn't need a real
> +  driver, as it's typically initialized by the boot loader.
> +
> +  However, its bus controller is part of a PM domain, or under the control
> +  of a functional clock.  Hence, the bus controller's PM domain and/or
> +  clock must be enabled for child devices connected to the bus (either
> +  on-SoC or externally) to function.
> +
> +  While "simple-pm-bus" follows the "simple-bus" set of properties, as
> +  specified in the Devicetree Specification, it is not an extension of
> +  "simple-bus".
> +
> +

There is an extra blank line above, I will plan to remove it in v2.

> +properties:
> +  compatible:
> +items:
> +   - const: s

Re: [PATCH 2/2] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Tue, Sep 17, 2019 at 01:09:29PM +0200, Simon Horman wrote:
> On Mon, Sep 16, 2019 at 05:33:57PM +0200, Simon Horman wrote:
> > Convert Renesas Bus State Controller (BSC) bindings documentation to
> > json-schema.
> > 
> > Signed-off-by: Simon Horman 
> > ---
> > * Tested using:
> >   # ARCH=arm64 make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> >   # ARCH=arm   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > ---
> >  .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
> >  .../devicetree/bindings/bus/renesas,bsc.yaml   | 57 
> > ++
> >  2 files changed, 57 insertions(+), 46 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
> >  create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
> > b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> > deleted file mode 100644
> > index 90e947269437..
> > --- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> > +++ /dev/null
> > @@ -1,46 +0,0 @@
> > -Renesas Bus State Controller (BSC)
> > -==
> > -
> > -The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> > -Bridge", or "External Bus Interface") can be found in several Renesas ARM 
> > SoCs.
> > -It provides an external bus for connecting multiple external devices to the
> > -SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and 
> > USB.
> > -
> > -While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
> > -domain, and may have a gateable functional clock.
> > -Before a device connected to the BSC can be accessed, the PM domain
> > -containing the BSC must be powered on, and the functional clock
> > -driving the BSC must be enabled.
> > -
> > -The bindings for the BSC extend the bindings for "simple-pm-bus".
> > -
> > -
> 
> There is an extra blank line above,
> I plan to remove it in v2.

Please ignore that comment, its clearly incorrect.

> 
> > -Required properties
> > -  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
> > -   "simple-pm-bus" as fallbacks.
> > -SoC-specific values can be:
> > -   "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
> > -   "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
> > -  - #address-cells, #size-cells, ranges: Must describe the mapping between
> > -   parent address and child address spaces.
> > -  - reg: Must contain the base address and length to access the bus 
> > controller.
> > -
> > -Optional properties:
> > -  - interrupts: Must contain a reference to the BSC interrupt, if 
> > available.
> > -  - clocks: Must contain a reference to the functional clock, if available.
> > -  - power-domains: Must contain a reference to the PM domain, if available.
> > -
> > -
> > -Example:
> > -
> > -   bsc: bus@fec1 {
> > -   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
> > -"simple-pm-bus";
> > -   #address-cells = <1>;
> > -   #size-cells = <1>;
> > -   ranges = <0 0 0x2000>;
> > -   reg = <0xfec1 0x400>;
> > -   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
> > -   clocks = <&zb_clk>;
> > -   power-domains = <&pd_a4s>;
> > -   };
> > diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
> > b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > new file mode 100644
> > index ..0231a15cac47
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > @@ -0,0 +1,57 @@
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas Bus State Controller (BSC)
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven 
> > +
> > +description: |
> > +  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> > +  Bridge", or "External Bus Interface") can be found in several Renesas ARM
> > +  SoCs.  It provide

Re: [PATCH 2/2] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Mon, Sep 16, 2019 at 05:33:57PM +0200, Simon Horman wrote:
> Convert Renesas Bus State Controller (BSC) bindings documentation to
> json-schema.
> 
> Signed-off-by: Simon Horman 
> ---
> * Tested using:
>   # ARCH=arm64 make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
>   # ARCH=arm   make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> ---
>  .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
>  .../devicetree/bindings/bus/renesas,bsc.yaml   | 57 
> ++
>  2 files changed, 57 insertions(+), 46 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
>  create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
> b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> deleted file mode 100644
> index 90e947269437..
> --- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -Renesas Bus State Controller (BSC)
> -==
> -
> -The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> -Bridge", or "External Bus Interface") can be found in several Renesas ARM 
> SoCs.
> -It provides an external bus for connecting multiple external devices to the
> -SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and USB.
> -
> -While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
> -domain, and may have a gateable functional clock.
> -Before a device connected to the BSC can be accessed, the PM domain
> -containing the BSC must be powered on, and the functional clock
> -driving the BSC must be enabled.
> -
> -The bindings for the BSC extend the bindings for "simple-pm-bus".
> -
> -

There is an extra blank line above,
I plan to remove it in v2.

> -Required properties
> -  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
> - "simple-pm-bus" as fallbacks.
> -SoC-specific values can be:
> - "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
> - "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
> -  - #address-cells, #size-cells, ranges: Must describe the mapping between
> - parent address and child address spaces.
> -  - reg: Must contain the base address and length to access the bus 
> controller.
> -
> -Optional properties:
> -  - interrupts: Must contain a reference to the BSC interrupt, if available.
> -  - clocks: Must contain a reference to the functional clock, if available.
> -  - power-domains: Must contain a reference to the PM domain, if available.
> -
> -
> -Example:
> -
> - bsc: bus@fec1 {
> - compatible = "renesas,bsc-sh73a0", "renesas,bsc",
> -  "simple-pm-bus";
> - #address-cells = <1>;
> - #size-cells = <1>;
> - ranges = <0 0 0x2000>;
> - reg = <0xfec1 0x400>;
> - interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&zb_clk>;
> - power-domains = <&pd_a4s>;
> - };
> diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
> b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> new file mode 100644
> index ..0231a15cac47
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> @@ -0,0 +1,57 @@
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas Bus State Controller (BSC)
> +
> +maintainers:
> +  - Geert Uytterhoeven 
> +
> +description: |
> +  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> +  Bridge", or "External Bus Interface") can be found in several Renesas ARM
> +  SoCs.  It provides an external bus for connecting multiple external
> +  devices to the SoC, driving several chip select lines, for e.g. NOR
> +  FLASH, Ethernet and USB.
> +
> +  While the BSC is a fairly simple memory-mapped bus, it may be part of a
> +  PM domain, and may have a gateable functional clock.  Before a device
> +  connected to the BSC can be accessed, the PM domain containing the BSC
> +  must be powered on, and the functional clock driving the BSC must be
> +  enabled.
> +
> +  The bindings for the BSC extend the bindings for "simple-pm-bus".
> +
> 

Re: [PATCH 2/2] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Tue, Sep 17, 2019 at 12:43:42PM +0200, Ulrich Hecht wrote:
> 
> > On September 16, 2019 at 5:33 PM Simon Horman  
> > wrote:
> > 
> > 
> > Convert Renesas Bus State Controller (BSC) bindings documentation to
> > json-schema.
> > 
> > Signed-off-by: Simon Horman 
> > ---
> > * Tested using:
> >   # ARCH=arm64 make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> >   # ARCH=arm   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > ---
> >  .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
> >  .../devicetree/bindings/bus/renesas,bsc.yaml   | 57 
> > ++
> >  2 files changed, 57 insertions(+), 46 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
> >  create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
> > b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> > deleted file mode 100644
> > index 90e947269437..
> > --- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
> > +++ /dev/null
> > @@ -1,46 +0,0 @@
> > -Renesas Bus State Controller (BSC)
> > -==
> > -
> > -The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> > -Bridge", or "External Bus Interface") can be found in several Renesas ARM 
> > SoCs.
> > -It provides an external bus for connecting multiple external devices to the
> > -SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and 
> > USB.
> > -
> > -While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
> > -domain, and may have a gateable functional clock.
> > -Before a device connected to the BSC can be accessed, the PM domain
> > -containing the BSC must be powered on, and the functional clock
> > -driving the BSC must be enabled.
> > -
> > -The bindings for the BSC extend the bindings for "simple-pm-bus".
> > -
> > -
> > -Required properties
> > -  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
> > -   "simple-pm-bus" as fallbacks.
> > -SoC-specific values can be:
> > -   "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
> > -   "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
> > -  - #address-cells, #size-cells, ranges: Must describe the mapping between
> > -   parent address and child address spaces.
> > -  - reg: Must contain the base address and length to access the bus 
> > controller.
> > -
> > -Optional properties:
> > -  - interrupts: Must contain a reference to the BSC interrupt, if 
> > available.
> > -  - clocks: Must contain a reference to the functional clock, if available.
> > -  - power-domains: Must contain a reference to the PM domain, if available.
> > -
> > -
> > -Example:
> > -
> > -   bsc: bus@fec1 {
> > -   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
> > -"simple-pm-bus";
> > -   #address-cells = <1>;
> > -   #size-cells = <1>;
> > -   ranges = <0 0 0x2000>;
> > -   reg = <0xfec1 0x400>;
> > -   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
> > -   clocks = <&zb_clk>;
> > -   power-domains = <&pd_a4s>;
> > -   };
> > diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
> > b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > new file mode 100644
> > index ..0231a15cac47
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> > @@ -0,0 +1,57 @@
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas Bus State Controller (BSC)
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven 
> > +
> > +description: |
> > +  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
> > +  Bridge", or "External Bus Interface") can be found in several Renesas ARM
> > +  SoCs.  It provides an external bus for connecting multiple external
> > +  devices to the SoC, driving several chi

Re: [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema

2019-09-17 Thread Simon Horman
On Tue, Sep 17, 2019 at 10:36:34AM +0200, Simon Horman wrote:
> Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
> to json-schema.  Also name bindings documentation file according to the
> compat string being documented.
> 
> Also correct syntax error in interrupts field in example.
> 
> Signed-off-by: Simon Horman 
> ---
> * Based on v5.3
> * Tested using:
>   # ARCH=arm64 make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
>   # ARCH=arm   make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml

  The above should read:

  * Tested using:
# ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
# ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml

> ---
>  .../devicetree/bindings/rtc/renesas,sh-rtc.yaml| 66 
> ++
>  Documentation/devicetree/bindings/rtc/rtc-sh.txt   | 28 -
>  2 files changed, 66 insertions(+), 28 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
>  delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt
> 
> diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml 
> b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> new file mode 100644
> index ..07dbcd4436ce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Real Time Clock for Renesas SH and ARM SoCs
> +
> +maintainers:
> +  - Chris Brandt 
> +  - Geert Uytterhoeven 
> +
> +properties:
> +  compatible:
> +items:
> +  - const: renesas,r7s72100-rtc  # RZ/A1H
> +  - const: renesas,sh-rtc
> +
> +  reg:
> +maxItems: 1
> +
> +  interrupts:
> +maxItems: 3
> +
> +  interrupt-names:
> +items:
> +  - const: alarm
> +  - const: period
> +  - const: carry
> +
> +  clocks:
> +# The functional clock source for the RTC controller must be listed
> +# first (if it exists). Additionally, potential clock counting sources
> +# are to be listed.
> +true
> +
> +  clock-names:
> +# The functional clock must be labeled as "fck". Other clocks
> +# may be named in accordance to the SoC hardware manuals.
> +true
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - interrupt-names
> +  - clocks
> +  - clock-names
> +
> +examples:
> +  - |
> +#include 
> +#include 
> +#include 
> +
> +rtc: rtc@fcff1000 {
> +compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +reg = <0xfcff1000 0x2e>;
> +interrupts = ,
> + ,
> + ;
> +interrupt-names = "alarm", "period", "carry";
> +clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> + <&rtc_x3_clk>, <&extal_clk>;
> +clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> +};
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt 
> b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> deleted file mode 100644
> index 7676c7d28874..
> --- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -* Real Time Clock for Renesas SH and ARM SoCs
> -
> -Required properties:
> -- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
> -  fallback.
> -- reg: physical base address and length of memory mapped region.
> -- interrupts: 3 interrupts for alarm, period, and carry.
> -- interrupt-names: The interrupts should be labeled as "alarm", "period", and
> -  "carry".
> -- clocks: The functional clock source for the RTC controller must be listed
> -  first (if exists). Additionally, potential clock counting sources are to be
> -  listed.
> -- clock-names: The functional clock must be labeled as "fck". Other clocks
> -  may be named in accordance to the SoC hardware manuals.
> -
> -
> -Example:
> -rtc: rtc@fcff1000 {
> - compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> - reg = <0xfcff1000 0x2e>;
> - interrupts =  -   GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> -   GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> - interrupt-names = "alarm", "period", "carry";
> - clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> -  <&rtc_x3_clk>, <&extal_clk>;
> - clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> -};
> -- 
> 2.11.0
> 


[PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema

2019-09-17 Thread Simon Horman
Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
to json-schema.  Also name bindings documentation file according to the
compat string being documented.

Also correct syntax error in interrupts field in example.

Signed-off-by: Simon Horman 
---
* Based on v5.3
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
---
 .../devicetree/bindings/rtc/renesas,sh-rtc.yaml| 66 ++
 Documentation/devicetree/bindings/rtc/rtc-sh.txt   | 28 -
 2 files changed, 66 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml 
b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
new file mode 100644
index ..07dbcd4436ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Real Time Clock for Renesas SH and ARM SoCs
+
+maintainers:
+  - Chris Brandt 
+  - Geert Uytterhoeven 
+
+properties:
+  compatible:
+items:
+  - const: renesas,r7s72100-rtc  # RZ/A1H
+  - const: renesas,sh-rtc
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 3
+
+  interrupt-names:
+items:
+  - const: alarm
+  - const: period
+  - const: carry
+
+  clocks:
+# The functional clock source for the RTC controller must be listed
+# first (if it exists). Additionally, potential clock counting sources
+# are to be listed.
+true
+
+  clock-names:
+# The functional clock must be labeled as "fck". Other clocks
+# may be named in accordance to the SoC hardware manuals.
+true
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+
+examples:
+  - |
+#include 
+#include 
+#include 
+
+rtc: rtc@fcff1000 {
+compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+reg = <0xfcff1000 0x2e>;
+interrupts = ,
+ ,
+ ;
+interrupt-names = "alarm", "period", "carry";
+clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+ <&rtc_x3_clk>, <&extal_clk>;
+clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
+};
diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt 
b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
deleted file mode 100644
index 7676c7d28874..
--- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-* Real Time Clock for Renesas SH and ARM SoCs
-
-Required properties:
-- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
-  fallback.
-- reg: physical base address and length of memory mapped region.
-- interrupts: 3 interrupts for alarm, period, and carry.
-- interrupt-names: The interrupts should be labeled as "alarm", "period", and
-  "carry".
-- clocks: The functional clock source for the RTC controller must be listed
-  first (if exists). Additionally, potential clock counting sources are to be
-  listed.
-- clock-names: The functional clock must be labeled as "fck". Other clocks
-  may be named in accordance to the SoC hardware manuals.
-
-
-Example:
-rtc: rtc@fcff1000 {
-   compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
-   reg = <0xfcff1000 0x2e>;
-   interrupts = ;
-   interrupt-names = "alarm", "period", "carry";
-   clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
-<&rtc_x3_clk>, <&extal_clk>;
-   clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
-};
-- 
2.11.0



[PATCH 0/2] dt-bindings: bus: simple-pm-bus, renesas-bsc: convert bindings to json-schema

2019-09-16 Thread Simon Horman
Convert Simple Power-Managed Bus and Convert Renesas Bus State Controller
(BSC) bindings documentation to json-schema.

Based on v5.3.

Simon Horman (2):
  dt-bindings: bus: simple-pm-bus: convert bindings to json-schema
  dt-bindings: bus: renesas-bsc: convert bindings to json-schema

 .../devicetree/bindings/bus/renesas,bsc.txt| 46 ---
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 57 ++
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 --
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 68 ++
 4 files changed, 125 insertions(+), 90 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

-- 
2.11.0



[PATCH 2/2] dt-bindings: bus: renesas-bsc: convert bindings to json-schema

2019-09-16 Thread Simon Horman
Convert Renesas Bus State Controller (BSC) bindings documentation to
json-schema.

Signed-off-by: Simon Horman 
---
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
---
 .../devicetree/bindings/bus/renesas,bsc.txt| 46 -
 .../devicetree/bindings/bus/renesas,bsc.yaml   | 57 ++
 2 files changed, 57 insertions(+), 46 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.txt
 create mode 100644 Documentation/devicetree/bindings/bus/renesas,bsc.yaml

diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.txt 
b/Documentation/devicetree/bindings/bus/renesas,bsc.txt
deleted file mode 100644
index 90e947269437..
--- a/Documentation/devicetree/bindings/bus/renesas,bsc.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Renesas Bus State Controller (BSC)
-==
-
-The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
-Bridge", or "External Bus Interface") can be found in several Renesas ARM SoCs.
-It provides an external bus for connecting multiple external devices to the
-SoC, driving several chip select lines, for e.g. NOR FLASH, Ethernet and USB.
-
-While the BSC is a fairly simple memory-mapped bus, it may be part of a PM
-domain, and may have a gateable functional clock.
-Before a device connected to the BSC can be accessed, the PM domain
-containing the BSC must be powered on, and the functional clock
-driving the BSC must be enabled.
-
-The bindings for the BSC extend the bindings for "simple-pm-bus".
-
-
-Required properties
-  - compatible: Must contain an SoC-specific value, and "renesas,bsc" and
-   "simple-pm-bus" as fallbacks.
-SoC-specific values can be:
-   "renesas,bsc-r8a73a4" for R-Mobile APE6 (r8a73a4)
-   "renesas,bsc-sh73a0" for SH-Mobile AG5 (sh73a0)
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-  - reg: Must contain the base address and length to access the bus controller.
-
-Optional properties:
-  - interrupts: Must contain a reference to the BSC interrupt, if available.
-  - clocks: Must contain a reference to the functional clock, if available.
-  - power-domains: Must contain a reference to the PM domain, if available.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/renesas,bsc.yaml 
b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
new file mode 100644
index ..0231a15cac47
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/renesas,bsc.yaml
@@ -0,0 +1,57 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/renesas,bsc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Bus State Controller (BSC)
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  The Renesas Bus State Controller (BSC, sometimes called "LBSC within Bus
+  Bridge", or "External Bus Interface") can be found in several Renesas ARM
+  SoCs.  It provides an external bus for connecting multiple external
+  devices to the SoC, driving several chip select lines, for e.g. NOR
+  FLASH, Ethernet and USB.
+
+  While the BSC is a fairly simple memory-mapped bus, it may be part of a
+  PM domain, and may have a gateable functional clock.  Before a device
+  connected to the BSC can be accessed, the PM domain containing the BSC
+  must be powered on, and the functional clock driving the BSC must be
+  enabled.
+
+  The bindings for the BSC extend the bindings for "simple-pm-bus".
+
+allOf:
+  - $ref: simple-pm-bus.yaml#
+
+properties:
+  compatible:
+items:
+  - enum:
+  - renesas,bsc-r8a73a4  # R-Mobile APE6 (r8a73a4)
+  - renesas,bsc-sh73a0   # SH-Mobile AG5 (sh73a0)
+  - const: renesas,bsc
+  - const: simple-pm-bus
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+examples:
+  - |
+#include 
+
+bsc: bus@fec1 {
+compatible = "renesas,bsc-sh73a0", "renesas,bsc", "simple-pm-bus";
+#address-cells = <1>;
+#size-cells = <1>;
+ranges = <0 0 0x2000>;
+reg = <0xfec1 0x400>;
+interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
+clocks = <&zb_clk>;
+power-domains = <&pd_a4s>;
+};
-- 
2.11.0



[PATCH 1/2] dt-bindings: bus: simple-pm-bus: convert bindings to json-schema

2019-09-16 Thread Simon Horman
Convert Simple Power-Managed Bus bindings documentation to json-schema.

As a side effect of this change only simple-pm-bus is used in example. A
follow-up patch will provide an example for the separately documented
Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and
"renesas,bsc" compat strings.

Signed-off-by: Simon Horman 
---
* Tested using:
  # ARCH=arm64 make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
  # ARCH=arm   make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
---
 .../devicetree/bindings/bus/simple-pm-bus.txt  | 44 --
 .../devicetree/bindings/bus/simple-pm-bus.yaml | 68 ++
 2 files changed, 68 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt
 create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml

diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
deleted file mode 100644
index 6f15037131ed..
--- a/Documentation/devicetree/bindings/bus/simple-pm-bus.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Simple Power-Managed Bus
-
-
-A Simple Power-Managed Bus is a transparent bus that doesn't need a real
-driver, as it's typically initialized by the boot loader.
-
-However, its bus controller is part of a PM domain, or under the control of a
-functional clock.  Hence, the bus controller's PM domain and/or clock must be
-enabled for child devices connected to the bus (either on-SoC or externally)
-to function.
-
-While "simple-pm-bus" follows the "simple-bus" set of properties, as specified
-in the Devicetree Specification, it is not an extension of "simple-bus".
-
-
-Required properties:
-  - compatible: Must contain at least "simple-pm-bus".
-   Must not contain "simple-bus".
-   It's recommended to let this be preceded by one or more
-   vendor-specific compatible values.
-  - #address-cells, #size-cells, ranges: Must describe the mapping between
-   parent address and child address spaces.
-
-Optional platform-specific properties for clock or PM domain control (at least
-one of them is required):
-  - clocks: Must contain a reference to the functional clock(s),
-  - power-domains: Must contain a reference to the PM domain.
-Please refer to the binding documentation for the clock and/or PM domain
-providers for more details.
-
-
-Example:
-
-   bsc: bus@fec1 {
-   compatible = "renesas,bsc-sh73a0", "renesas,bsc",
-"simple-pm-bus";
-   #address-cells = <1>;
-   #size-cells = <1>;
-   ranges = <0 0 0x2000>;
-   reg = <0xfec1 0x400>;
-   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&zb_clk>;
-   power-domains = <&pd_a4s>;
-   };
diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml 
b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
new file mode 100644
index ..72a3644974e3
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml
@@ -0,0 +1,68 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple Power-Managed Bus
+
+maintainers:
+  - Geert Uytterhoeven 
+
+description: |
+  A Simple Power-Managed Bus is a transparent bus that doesn't need a real
+  driver, as it's typically initialized by the boot loader.
+
+  However, its bus controller is part of a PM domain, or under the control
+  of a functional clock.  Hence, the bus controller's PM domain and/or
+  clock must be enabled for child devices connected to the bus (either
+  on-SoC or externally) to function.
+
+  While "simple-pm-bus" follows the "simple-bus" set of properties, as
+  specified in the Devicetree Specification, it is not an extension of
+  "simple-bus".
+
+
+properties:
+  compatible:
+items:
+   - const: simple-pm-bus
+
+  '#address-cells':
+const: 1
+
+  '#size-cells':
+const: 1
+
+  ranges:
+# Mapping between parent address and child address spaces.
+maxItems: 1
+
+  clocks:
+# Functional clocks
+# Required if power-domains is absent, optional otherwise
+minItems: 1
+
+  power-domains:
+# Required if clocks is absent, optional otherwise
+minItems: 1
+
+required:
+  - compatible
+  - '#address-cells'
+  - '#size-cells'
+  - ranges
+
+examples:
+  - |
+#include 
+
+bsc: bus@fec1 {
+compatible = "simple-pm-bus";
+#address-cells = <1>;
+#size-cells = <1>;
+ranges = <0 0 0x2000>;
+reg = <0xfec1 0x400>;
+interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
+clocks = <&zb_clk>;
+power-domains = <&pd_a4s>;
+};
-- 
2.11.0



[PATCH] dt-bindings: thermal: rcar-thermal: convert bindings to json-schema

2019-09-16 Thread Simon Horman
Convert Renesas R-Car Thermal bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.

As a side effect of this change all currently supported/used compat
strings are listed while no while card compat string is documented.
This, in my opinion, is desirable as only supported hardware should
be documented.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
Tested using:
  ARCH=arm make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml
---
 .../devicetree/bindings/thermal/rcar-thermal.txt   |  78 ---
 .../bindings/thermal/renesas,rcar-thermal.yaml | 110 +
 2 files changed, 110 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/rcar-thermal.txt
 create mode 100644 
Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml

diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt 
b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
deleted file mode 100644
index 196112d23b1e..
--- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-* Renesas R-Car Thermal
-
-Required properties:
-- compatible   : "renesas,thermal-",
-  "renesas,rcar-gen2-thermal" (with thermal-zone) or
-  "renesas,rcar-thermal" (without thermal-zone) as
-   fallback except R-Car V3M/E3/D3 and RZ/G2E.
- Examples with soctypes are:
-   - "renesas,thermal-r8a73a4" (R-Mobile APE6)
-   - "renesas,thermal-r8a7743" (RZ/G1M)
-   - "renesas,thermal-r8a7744" (RZ/G1N)
-   - "renesas,thermal-r8a774c0" (RZ/G2E)
-   - "renesas,thermal-r8a7779" (R-Car H1)
-   - "renesas,thermal-r8a7790" (R-Car H2)
-   - "renesas,thermal-r8a7791" (R-Car M2-W)
-   - "renesas,thermal-r8a7792" (R-Car V2H)
-   - "renesas,thermal-r8a7793" (R-Car M2-N)
-   - "renesas,thermal-r8a77970" (R-Car V3M)
-   - "renesas,thermal-r8a77990" (R-Car E3)
-   - "renesas,thermal-r8a77995" (R-Car D3)
-- reg  : Address range of the thermal registers.
- The 1st reg will be recognized as common register
- if it has "interrupts".
-
-Option properties:
-
-- interrupts   : If present should contain 3 interrupts for
-  R-Car V3M/E3/D3 and RZ/G2E or 1 interrupt otherwise.
-
-Example (non interrupt support):
-
-thermal@ffc48000 {
-   compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
-   reg = <0xffc48000 0x38>;
-};
-
-Example (interrupt support):
-
-thermal@e61f {
-   compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
-   reg = <0xe61f 0x14
-   0xe61f0100 0x38
-   0xe61f0200 0x38
-   0xe61f0300 0x38>;
-   interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
-};
-
-Example (with thermal-zone):
-
-thermal-zones {
-   cpu_thermal: cpu-thermal {
-   polling-delay-passive   = <1000>;
-   polling-delay   = <5000>;
-
-   thermal-sensors = <&thermal>;
-
-   trips {
-   cpu-crit {
-   temperature = <115000>;
-   hysteresis  = <0>;
-   type= "critical";
-   };
-   };
-   cooling-maps {
-   };
-   };
-};
-
-thermal: thermal@e61f {
-   compatible ="renesas,thermal-r8a7790",
-   "renesas,rcar-gen2-thermal",
-   "renesas,rcar-thermal";
-   reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
-   interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
-   clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
-   power-domains = <&cpg_clocks>;
-   #thermal-sensor-cells = <0>;
-};
diff --git 
a/Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml 
b/Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml
new file mode 100644
index ..ab4cc3c35410
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/renesas,rcar-thermal.yaml
@@ -0,0 +1,110 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/renesas,rcar-thermal.ya

Re: [PATCH] dt-bindings: hspi: Convert bindings to json-schema

2019-09-16 Thread Simon Horman
On Fri, Sep 13, 2019 at 03:22:10PM -0500, Rob Herring wrote:
> On Fri, Sep 13, 2019 at 7:22 AM Simon Horman  
> wrote:
> >
> > Convert Renesas HSPI bindings documentation to json-schema.
> > Also name bindings documentation file according to the compat string
> > being documented.
> >
> > As a side effect of this change all currently supported/used compat
> > strings are listed while no while card compat string is documented.
> > This, in my opinion, is desirable as only supported hardware should
> > be documented.
> >
> > Signed-off-by: Simon Horman 

Hi Rob,

thanks for your review. I have sent v2 which I believe addresses
the issues you have raised.

> > ---
> > Based on v5.3-rc1
> > Tested using:
> >   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > ---
> >  .../devicetree/bindings/spi/renesas,hspi.yaml  | 54 
> > ++
> >  Documentation/devicetree/bindings/spi/sh-hspi.txt  | 26 ---
> >  2 files changed, 54 insertions(+), 26 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt
> >
> > diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml 
> > b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > new file mode 100644
> > index ..94a64a33daf4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas HSPI
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven 
> 
> Add:
> 
> allOf:
>   - $ref: spi-controller.yaml#
> 
> > +
> > +properties:
> > +  compatible:
> > +items:
> > +  - enum:
> > +- renesas,hspi-r8a7778 # R-Car M1A
> > +- renesas,hspi-r8a7779 # R-Car H1
> > +  - const: renesas,hspi
> > +
> > +  reg:
> > +maxItems: 1
> > +
> > +  interrupts:
> > +maxItems: 1
> > +
> 
> > +  '#address-cells':
> > +const: 1
> > +
> > +  '#size-cells':
> > +const: 0
> 
> And then these 2 can be dropped.
> 
> > +
> > +  # Pinctrl properties might be needed, too.
> > +  # See Documentation/devicetree/bindings/pinctrl/renesas,*.
> 
> If only a single state, you don't. For multiple states, we need to
> document the names.
> 
> If not present, then they get added automagically so that
> 'additionalProperties: false' works. But you can't use that here as
> you'll have child nodes.
> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - '#address-cells'
> > +  - '#size-cells'
> > +
> > +examples:
> > +  - |
> > +#include 
> > +
> > +hspi0: spi@fffc7000 {
> > +compatible = "renesas,hspi-r8a7778", "renesas,hspi";
> > +reg = <0xfffc7000 0x18>;
> > +interrupt-parent = <&gic>;
> > +interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
> > +#address-cells = <1>;
> > +#size-cells = <0>;
> > +};
> > +
> 


[PATCH v2] dt-bindings: hspi: Convert bindings to json-schema

2019-09-16 Thread Simon Horman
Convert Renesas HSPI bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.

As a side effect of this change all currently supported/used compat
strings are listed while no while card compat string is documented.
This, in my opinion, is desirable as only supported hardware should
be documented.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
Tested using:
  ARCH=arm make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml

v2
- reference spi-controller.yaml# and thus do not document
  #address-cells and #size-cells properties.
  These properties are still listed as required.
- Drop comment regarding pinctrl properties.
  These are not needed as only one state, "default", is supported
- Document clocks and power-domains properties.
  The clocks property is required. Add these properties to the example.
- Drop unnecessary interrupt-parent property from example.
---
 .../devicetree/bindings/spi/renesas,hspi.yaml  | 57 ++
 Documentation/devicetree/bindings/spi/sh-hspi.txt  | 26 --
 2 files changed, 57 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt

diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml 
b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
new file mode 100644
index ..c429cf4bea5b
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas HSPI
+
+maintainers:
+  - Geert Uytterhoeven 
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+items:
+  - enum:
+- renesas,hspi-r8a7778 # R-Car M1A
+- renesas,hspi-r8a7779 # R-Car H1
+  - const: renesas,hspi
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  power-domains:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - '#address-cells'
+  - '#size-cells'
+
+examples:
+  - |
+#include 
+#include 
+
+hspi0: spi@fffc7000 {
+compatible = "renesas,hspi-r8a7778", "renesas,hspi";
+reg = <0xfffc7000 0x18>;
+interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
+clocks = <&mstp0_clks R8A7778_CLK_HSPI>;
+power-domains = <&cpg_clocks>;
+#address-cells = <1>;
+#size-cells = <0>;
+};
+
diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt 
b/Documentation/devicetree/bindings/spi/sh-hspi.txt
deleted file mode 100644
index b9d1e4d11a77..
--- a/Documentation/devicetree/bindings/spi/sh-hspi.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Renesas HSPI.
-
-Required properties:
-- compatible   : "renesas,hspi-", "renesas,hspi" as fallback.
-Examples with soctypes are:
-  - "renesas,hspi-r8a7778" (R-Car M1)
-  - "renesas,hspi-r8a7779" (R-Car H1)
-- reg  : Offset and length of the register set for the device
-- interrupts   : Interrupt specifier
-- #address-cells   : Must be <1>
-- #size-cells  : Must be <0>
-
-Pinctrl properties might be needed, too.  See
-Documentation/devicetree/bindings/pinctrl/renesas,*.
-
-Example:
-
-   hspi0: spi@fffc7000 {
-   compatible = "renesas,hspi-r8a7778", "renesas,hspi";
-   reg = <0xfffc7000 0x18>;
-   interrupt-parent = <&gic>;
-   interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-   };
-
-- 
2.11.0



[PATCH] dt-bindings: hspi: Convert bindings to json-schema

2019-09-13 Thread Simon Horman
Convert Renesas HSPI bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.

As a side effect of this change all currently supported/used compat
strings are listed while no while card compat string is documented.
This, in my opinion, is desirable as only supported hardware should
be documented.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
Tested using:
  make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml
---
 .../devicetree/bindings/spi/renesas,hspi.yaml  | 54 ++
 Documentation/devicetree/bindings/spi/sh-hspi.txt  | 26 ---
 2 files changed, 54 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt

diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml 
b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
new file mode 100644
index ..94a64a33daf4
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas HSPI
+
+maintainers:
+  - Geert Uytterhoeven 
+
+properties:
+  compatible:
+items:
+  - enum:
+- renesas,hspi-r8a7778 # R-Car M1A
+- renesas,hspi-r8a7779 # R-Car H1
+  - const: renesas,hspi
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  '#address-cells':
+const: 1
+
+  '#size-cells':
+const: 0
+
+  # Pinctrl properties might be needed, too.
+  # See Documentation/devicetree/bindings/pinctrl/renesas,*.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - '#address-cells'
+  - '#size-cells'
+
+examples:
+  - |
+#include 
+
+hspi0: spi@fffc7000 {
+compatible = "renesas,hspi-r8a7778", "renesas,hspi";
+reg = <0xfffc7000 0x18>;
+interrupt-parent = <&gic>;
+interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
+#address-cells = <1>;
+#size-cells = <0>;
+};
+
diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt 
b/Documentation/devicetree/bindings/spi/sh-hspi.txt
deleted file mode 100644
index b9d1e4d11a77..
--- a/Documentation/devicetree/bindings/spi/sh-hspi.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Renesas HSPI.
-
-Required properties:
-- compatible   : "renesas,hspi-", "renesas,hspi" as fallback.
-Examples with soctypes are:
-  - "renesas,hspi-r8a7778" (R-Car M1)
-  - "renesas,hspi-r8a7779" (R-Car H1)
-- reg  : Offset and length of the register set for the device
-- interrupts   : Interrupt specifier
-- #address-cells   : Must be <1>
-- #size-cells  : Must be <0>
-
-Pinctrl properties might be needed, too.  See
-Documentation/devicetree/bindings/pinctrl/renesas,*.
-
-Example:
-
-   hspi0: spi@fffc7000 {
-   compatible = "renesas,hspi-r8a7778", "renesas,hspi";
-   reg = <0xfffc7000 0x18>;
-   interrupt-parent = <&gic>;
-   interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-   };
-
-- 
2.11.0



Re: [PATCH 2/2] arm64: dts: renesas: r8a774c0: Add dynamic power coefficient

2019-09-13 Thread Simon Horman
On Fri, Sep 13, 2019 at 09:50:08AM +0100, Biju Das wrote:
> Describe the dynamic power coefficient of A53 CPUs.
> 
> Based on work by Gaku Inami  and others.
> 
> Signed-off-by: Biju Das 

Reviewed-by: Simon Horman 



Re: [PATCH 1/2] arm64: dts: renesas: r8a774c0: Create thermal zone to support IPA

2019-09-13 Thread Simon Horman
On Fri, Sep 13, 2019 at 09:50:07AM +0100, Biju Das wrote:
> Setup a thermal zone driven by SoC temperature sensor.
> Create passive trip points and bind them to CPUFreq cooling
> device that supports power extension.
> 
> Based on the work done by Dien Pham 
> and others for r8a77990 SoC.
> 
> Signed-off-by: Biju Das 

Reviewed-by: Simon Horman 

> ---
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 19 ---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> index a1c2de9..764df4c 100644
> --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> @@ -73,6 +73,7 @@
>   compatible = "arm,cortex-a53";
>   reg = <0>;
>   device_type = "cpu";
> + #cooling-cells = <2>;
>   power-domains = <&sysc R8A774C0_PD_CA53_CPU0>;
>   next-level-cache = <&L2_CA53>;
>   enable-method = "psci";
> @@ -1905,18 +1906,30 @@
>   thermal-zones {
>   cpu-thermal {
>   polling-delay-passive = <250>;
> - polling-delay = <1000>;
> - thermal-sensors = <&thermal>;
> + polling-delay = <0>;
> + thermal-sensors = <&thermal 0>;
> + sustainable-power = <717>;
>  
>   cooling-maps {
> + map0 {
> + trip = <&target>;
> + cooling-device = <&a53_0 0 2>;
> + contribution = <1024>;
> + };
>   };
>  
>   trips {
> - cpu-crit {
> + sensor1_crit: sensor1-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
> +
> + target: trip-point1 {
> + temperature = <10>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   };
>   };
>   };
> -- 
> 2.7.4
> 


Re: [PATCH v2] dt-bindings: arm: renesas: Convert 'renesas,prr' to json-schema

2019-09-13 Thread Simon Horman
On Sun, Sep 08, 2019 at 01:05:28PM +0100, Simon Horman wrote:
> Convert Renesas Product Register bindings documentation to json-schema.
> 
> Signed-off-by: Simon Horman 

Apologies Geert,

this patch was supposed to be addressed to you rather than myself.

> ---
> Based on v5.3-rc1
> Tested using:
>   make dtbs_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/renesas,prr.yaml
> 
> v2
> * Use simple enum for compat values
> * Drop "" from compat values
> * Only supply 'maxItems' property to 'reg'
> ---
>  .../devicetree/bindings/arm/renesas,prr.txt| 20 -
>  .../devicetree/bindings/arm/renesas,prr.yaml   | 35 
> ++
>  2 files changed, 35 insertions(+), 20 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.yaml
> 
> diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.txt 
> b/Documentation/devicetree/bindings/arm/renesas,prr.txt
> deleted file mode 100644
> index 08e482e953ca..
> --- a/Documentation/devicetree/bindings/arm/renesas,prr.txt
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -Renesas Product Register
> -
> -Most Renesas ARM SoCs have a Product Register or Boundary Scan ID Register 
> that
> -allows to retrieve SoC product and revision information.  If present, a 
> device
> -node for this register should be added.
> -
> -Required properties:
> -  - compatible: Must be one of:
> -"renesas,prr"
> -"renesas,bsid"
> -  - reg: Base address and length of the register block.
> -
> -
> -Examples
> -
> -
> - prr: chipid@ff44 {
> - compatible = "renesas,prr";
> - reg = <0 0xff44 0 4>;
> - };
> diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml 
> b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> new file mode 100644
> index ..7f8d17f33983
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas Product Register
> +
> +maintainers:
> +  - Geert Uytterhoeven 
> +  - Magnus Damm 
> +
> +description: |
> +  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
> +  Register that allows to retrieve SoC product and revision information.
> +  If present, a device node for this register should be added.
> +
> +properties:
> +  compatible:
> +enum:
> +  - renesas,prr
> +  - renesas,bsid
> +  reg:
> +maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +prr: chipid@ff44 {
> +compatible = "renesas,prr";
> +reg = <0 0xff44 0 4>;
> +};
> -- 
> 2.11.0
> 


Re: [PATCH v3 2/4] dmaengine: rcar-dmac: Use of_data values instead of a macro

2019-09-13 Thread Simon Horman
On Mon, Sep 09, 2019 at 03:34:50PM +0900, Yoshihiro Shimoda wrote:
> Since we will have changed memory mapping of the DMAC in the future,
> this patch uses of_data values instead of a macro to calculate
> each channel's base offset.
> 
> Signed-off-by: Yoshihiro Shimoda 
> Reviewed-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH v3 3/4] dmaengine: rcar-dmac: Use devm_platform_ioremap_resource()

2019-09-13 Thread Simon Horman
On Mon, Sep 09, 2019 at 03:34:51PM +0900, Yoshihiro Shimoda wrote:
> This patch uses devm_platform_ioremap_resource() instead of
> using platform_get_resource() and devm_ioremap_resource() together
> to simplify.
> 
> Signed-off-by: Yoshihiro Shimoda 
> Reviewed-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 

> ---
>  drivers/dma/sh/rcar-dmac.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 74996a0..542786d 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -1824,7 +1824,6 @@ static int rcar_dmac_probe(struct platform_device *pdev)
>   struct dma_device *engine;
>   struct rcar_dmac *dmac;
>   const struct rcar_dmac_of_data *data;
> - struct resource *mem;
>   unsigned int i;
>   int ret;
>  
> @@ -1863,8 +1862,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
>   return -ENOMEM;
>  
>   /* Request resources. */
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - dmac->iomem = devm_ioremap_resource(&pdev->dev, mem);
> + dmac->iomem = devm_platform_ioremap_resource(pdev, 0);
>   if (IS_ERR(dmac->iomem))
>   return PTR_ERR(dmac->iomem);
>  
> -- 
> 2.7.4
> 


[PATCH v2] dt-bindings: arm: renesas: Convert 'renesas,prr' to json-schema

2019-09-08 Thread Simon Horman
Convert Renesas Product Register bindings documentation to json-schema.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
Tested using:
  make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/renesas,prr.yaml

v2
* Use simple enum for compat values
* Drop "" from compat values
* Only supply 'maxItems' property to 'reg'
---
 .../devicetree/bindings/arm/renesas,prr.txt| 20 -
 .../devicetree/bindings/arm/renesas,prr.yaml   | 35 ++
 2 files changed, 35 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.txt
 create mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.yaml

diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.txt 
b/Documentation/devicetree/bindings/arm/renesas,prr.txt
deleted file mode 100644
index 08e482e953ca..
--- a/Documentation/devicetree/bindings/arm/renesas,prr.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Renesas Product Register
-
-Most Renesas ARM SoCs have a Product Register or Boundary Scan ID Register that
-allows to retrieve SoC product and revision information.  If present, a device
-node for this register should be added.
-
-Required properties:
-  - compatible: Must be one of:
-"renesas,prr"
-"renesas,bsid"
-  - reg: Base address and length of the register block.
-
-
-Examples
-
-
-   prr: chipid@ff44 {
-   compatible = "renesas,prr";
-   reg = <0 0xff44 0 4>;
-   };
diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml 
b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
new file mode 100644
index ..7f8d17f33983
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Product Register
+
+maintainers:
+  - Geert Uytterhoeven 
+  - Magnus Damm 
+
+description: |
+  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
+  Register that allows to retrieve SoC product and revision information.
+  If present, a device node for this register should be added.
+
+properties:
+  compatible:
+enum:
+  - renesas,prr
+  - renesas,bsid
+  reg:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+prr: chipid@ff44 {
+compatible = "renesas,prr";
+reg = <0 0xff44 0 4>;
+};
-- 
2.11.0



Re: [PATCH] dt-bindings: arm: renesas: Convert 'renesas,prr' to json-schema

2019-09-08 Thread Simon Horman
On Fri, Sep 06, 2019 at 01:54:26PM +0100, Rob Herring wrote:
> On Fri, Sep 6, 2019 at 12:49 PM Simon Horman  wrote:
> >
> > On Fri, Sep 06, 2019 at 12:21:58PM +0100, Rob Herring wrote:
> > > On Fri, Sep 6, 2019 at 12:14 PM Simon Horman  
> > > wrote:
> > > >
> > > > Convert Renesas Product Register bindings documentation to json-schema.
> > > >
> > > > Signed-off-by: Simon Horman 
> > > > ---
> > > > Based on v5.3-rc1
> > > > Tested using:
> > > >   make dtbs_check 
> > > > DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > > > ---
> > > >  .../devicetree/bindings/arm/renesas,prr.txt| 20 
> > > >  .../devicetree/bindings/arm/renesas,prr.yaml   | 36 
> > > > ++
> > > >  2 files changed, 36 insertions(+), 20 deletions(-)
> > > >  delete mode 100644 
> > > > Documentation/devicetree/bindings/arm/renesas,prr.txt
> > > >  create mode 100644 
> > > > Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.txt 
> > > > b/Documentation/devicetree/bindings/arm/renesas,prr.txt
> > > > deleted file mode 100644
> > > > index 08e482e953ca..
> > > > --- a/Documentation/devicetree/bindings/arm/renesas,prr.txt
> > > > +++ /dev/null
> > > > @@ -1,20 +0,0 @@
> > > > -Renesas Product Register
> > > > -
> > > > -Most Renesas ARM SoCs have a Product Register or Boundary Scan ID 
> > > > Register that
> > > > -allows to retrieve SoC product and revision information.  If present, 
> > > > a device
> > > > -node for this register should be added.
> > > > -
> > > > -Required properties:
> > > > -  - compatible: Must be one of:
> > > > -"renesas,prr"
> > > > -"renesas,bsid"
> > > > -  - reg: Base address and length of the register block.
> > > > -
> > > > -
> > > > -Examples
> > > > -
> > > > -
> > > > -   prr: chipid@ff44 {
> > > > -   compatible = "renesas,prr";
> > > > -   reg = <0 0xff44 0 4>;
> > > > -   };
> > > > diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml 
> > > > b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > > > new file mode 100644
> > > > index ..9df003041456
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > > > @@ -0,0 +1,36 @@
> > > > +# SPDX-License-Identifier: GPL-2.0
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Renesas Product Register
> > > > +
> > > > +maintainers:
> > > > +  - Geert Uytterhoeven 
> > > > +  - Magnus Damm 
> > > > +
> > > > +description: |
> > > > +  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
> > > > +  Register that allows to retrieve SoC product and revision 
> > > > information.
> > > > +  If present, a device node for this register should be added.
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +oneOf:
> > > > +- const: "renesas,prr"
> > > > +- const: "renesas,bsid"
> > >
> > > enum is better than oneOf+const and drop the quotes. oneOf/allOf/anyOf
> > > result in terrible error messages.
> >
> > Thanks Rob,
> >
> > Like this?
> >
> >   compatible:
> > enum:
> >   - renesas,prr
> >   - renesas,bsid
> >
> > > > +  reg:
> > > > +items:
> > > > +  - description: Base address and length of the register block.
> > >
> > > That's what 'reg' *always* is... Just 'maxItems: 1' is sufficient when
> > > there is" only 1 entry.
> >
> > And this?
> >
> >   reg:
> > maxItems: 1
> 
> Yes, for both.

Thanks, I have posted v2 with the changes you suggested.


Re: [PATCH 2/2] rcar-vin: Add support for outputting NV12

2019-09-08 Thread Simon Horman
On Fri, Sep 06, 2019 at 04:40:29PM +0200, Niklas Söderlund wrote:
> Most Gen3 boards can output frames in NV12 format, add support for this
> with a runtime check that the running hardware support it.

nit: s/support/supports/

> Signed-off-by: Niklas Söderlund 

Reviewed-by: Simon Horman 

> ---
>  drivers/media/platform/rcar-vin/rcar-dma.c  |  5 ++-
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 39 +
>  2 files changed, 37 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
> b/drivers/media/platform/rcar-vin/rcar-dma.c
> index 3cb29b2e0b2b18a9..0edae4181cdda9fe 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -118,6 +118,7 @@
>  #define VNDMR_ABIT   (1 << 2)
>  #define VNDMR_DTMD_YCSEP (1 << 1)
>  #define VNDMR_DTMD_ARGB  (1 << 0)
> +#define VNDMR_DTMD_YCSEP_420 (3 << 0)
>  
>  /* Video n Data Mode Register 2 bits */
>  #define VNDMR2_VPS   (1 << 30)
> @@ -710,11 +711,13 @@ static int rvin_setup(struct rvin_dev *vin)
>* Output format
>*/
>   switch (vin->format.pixelformat) {
> + case V4L2_PIX_FMT_NV12:
>   case V4L2_PIX_FMT_NV16:
>   rvin_write(vin,
>  ALIGN(vin->format.width * vin->format.height, 0x80),
>  VNUVAOF_REG);
> - dmr = VNDMR_DTMD_YCSEP;
> + dmr = vin->format.pixelformat == V4L2_PIX_FMT_NV12 ?
> + VNDMR_DTMD_YCSEP_420 : VNDMR_DTMD_YCSEP;
>   output_is_yuv = true;
>   break;
>   case V4L2_PIX_FMT_YUYV:
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index ba08f6c49956e899..51df827d91bc0ef3 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -30,6 +30,10 @@
>   */
>  
>  static const struct rvin_video_format rvin_formats[] = {
> + {
> + .fourcc = V4L2_PIX_FMT_NV12,
> + .bpp= 1,
> + },
>   {
>   .fourcc = V4L2_PIX_FMT_NV16,
>   .bpp= 1,
> @@ -72,6 +76,9 @@ const struct rvin_video_format 
> *rvin_format_from_pixel(struct rvin_dev *vin,
>   if (vin->info->model == RCAR_M1 && pixelformat == V4L2_PIX_FMT_XBGR32)
>   return NULL;
>  
> + if (pixelformat == V4L2_PIX_FMT_NV12 && !vin->info->nv12)
> + return NULL;
> +
>   for (i = 0; i < ARRAY_SIZE(rvin_formats); i++)
>   if (rvin_formats[i].fourcc == pixelformat)
>   return rvin_formats + i;
> @@ -90,17 +97,29 @@ static u32 rvin_format_bytesperline(struct rvin_dev *vin,
>   if (WARN_ON(!fmt))
>   return -EINVAL;
>  
> - align = pix->pixelformat == V4L2_PIX_FMT_NV16 ? 0x20 : 0x10;
> + switch (pix->pixelformat) {
> + case V4L2_PIX_FMT_NV12:
> + case V4L2_PIX_FMT_NV16:
> + align = 0x20;
> + break;
> + default:
> + align = 0x10;
> + break;
> + }
>  
>   return ALIGN(pix->width, align) * fmt->bpp;
>  }
>  
>  static u32 rvin_format_sizeimage(struct v4l2_pix_format *pix)
>  {
> - if (pix->pixelformat == V4L2_PIX_FMT_NV16)
> + switch (pix->pixelformat) {
> + case V4L2_PIX_FMT_NV12:
> + return pix->bytesperline * pix->height * 3 / 2;
> + case V4L2_PIX_FMT_NV16:
>   return pix->bytesperline * pix->height * 2;
> -
> - return pix->bytesperline * pix->height;
> + default:
> + return pix->bytesperline * pix->height;
> + }
>  }
>  
>  static void rvin_format_align(struct rvin_dev *vin, struct v4l2_pix_format 
> *pix)
> @@ -132,8 +151,16 @@ static void rvin_format_align(struct rvin_dev *vin, 
> struct v4l2_pix_format *pix)
>   break;
>   }
>  
> - /* HW limit width to a multiple of 32 (2^5) for NV16 else 2 (2^1) */
> - walign = vin->format.pixelformat == V4L2_PIX_FMT_NV16 ? 5 : 1;
> + /* HW limit width to a multiple of 32 (2^5) for NV12/16 else 2 (2^1) */
> + switch (vin->format.pixelformat) {
> + case V4L2_PIX_FMT_NV12:
> + case V4L2_PIX_FMT_NV16:
> + walign = 5;
> + break;
> + default:
> + walign = 1;
> + break;
> + }
>  
>   /* Limit to VIN capabilities */
>   v4l_bound_align_image(&pix->width, 2, vin->info->max_width, walign,
> -- 
> 2.23.0
> 


Re: [PATCH] dt-bindings: arm: renesas: Convert 'renesas,prr' to json-schema

2019-09-06 Thread Simon Horman
On Fri, Sep 06, 2019 at 12:21:58PM +0100, Rob Herring wrote:
> On Fri, Sep 6, 2019 at 12:14 PM Simon Horman  
> wrote:
> >
> > Convert Renesas Product Register bindings documentation to json-schema.
> >
> > Signed-off-by: Simon Horman 
> > ---
> > Based on v5.3-rc1
> > Tested using:
> >   make dtbs_check 
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > ---
> >  .../devicetree/bindings/arm/renesas,prr.txt| 20 
> >  .../devicetree/bindings/arm/renesas,prr.yaml   | 36 
> > ++
> >  2 files changed, 36 insertions(+), 20 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.txt
> >  create mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.txt 
> > b/Documentation/devicetree/bindings/arm/renesas,prr.txt
> > deleted file mode 100644
> > index 08e482e953ca..
> > --- a/Documentation/devicetree/bindings/arm/renesas,prr.txt
> > +++ /dev/null
> > @@ -1,20 +0,0 @@
> > -Renesas Product Register
> > -
> > -Most Renesas ARM SoCs have a Product Register or Boundary Scan ID Register 
> > that
> > -allows to retrieve SoC product and revision information.  If present, a 
> > device
> > -node for this register should be added.
> > -
> > -Required properties:
> > -  - compatible: Must be one of:
> > -"renesas,prr"
> > -"renesas,bsid"
> > -  - reg: Base address and length of the register block.
> > -
> > -
> > -Examples
> > -
> > -
> > -   prr: chipid@ff44 {
> > -   compatible = "renesas,prr";
> > -   reg = <0 0xff44 0 4>;
> > -   };
> > diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml 
> > b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > new file mode 100644
> > index ..9df003041456
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
> > @@ -0,0 +1,36 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas Product Register
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven 
> > +  - Magnus Damm 
> > +
> > +description: |
> > +  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
> > +  Register that allows to retrieve SoC product and revision information.
> > +  If present, a device node for this register should be added.
> > +
> > +properties:
> > +  compatible:
> > +oneOf:
> > +- const: "renesas,prr"
> > +- const: "renesas,bsid"
> 
> enum is better than oneOf+const and drop the quotes. oneOf/allOf/anyOf
> result in terrible error messages.

Thanks Rob,

Like this?

  compatible:
enum:
  - renesas,prr
  - renesas,bsid

> > +  reg:
> > +items:
> > +  - description: Base address and length of the register block.
> 
> That's what 'reg' *always* is... Just 'maxItems: 1' is sufficient when
> there is" only 1 entry.

And this?

  reg:
maxItems: 1

> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +examples:
> > +  - |
> > +prr: chipid@ff44 {
> > +compatible = "renesas,prr";
> > +reg = <0 0xff44 0 4>;
> > +};
> > --
> > 2.11.0
> >
> 


[PATCH] dt-bindings: Correct spelling in example schema

2019-09-06 Thread Simon Horman
Correct spelling of "identifier".

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
---
 Documentation/devicetree/bindings/example-schema.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/example-schema.yaml 
b/Documentation/devicetree/bindings/example-schema.yaml
index 9175d67f355d..c43819c2783a 100644
--- a/Documentation/devicetree/bindings/example-schema.yaml
+++ b/Documentation/devicetree/bindings/example-schema.yaml
@@ -5,7 +5,7 @@
 # All the top-level keys are standard json-schema keywords except for
 # 'maintainers' and 'select'
 
-# $id is a unique idenifier based on the filename. There may or may not be a
+# $id is a unique identifier based on the filename. There may or may not be a
 # file present at the URL.
 $id: "http://devicetree.org/schemas/example-schema.yaml#";
 # $schema is the meta-schema this schema should be validated with.
-- 
2.11.0



[PATCH] dt-bindings: arm: renesas: Convert 'renesas,prr' to json-schema

2019-09-06 Thread Simon Horman
Convert Renesas Product Register bindings documentation to json-schema.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
Tested using:
  make dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/renesas,prr.yaml
---
 .../devicetree/bindings/arm/renesas,prr.txt| 20 
 .../devicetree/bindings/arm/renesas,prr.yaml   | 36 ++
 2 files changed, 36 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.txt
 create mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.yaml

diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.txt 
b/Documentation/devicetree/bindings/arm/renesas,prr.txt
deleted file mode 100644
index 08e482e953ca..
--- a/Documentation/devicetree/bindings/arm/renesas,prr.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Renesas Product Register
-
-Most Renesas ARM SoCs have a Product Register or Boundary Scan ID Register that
-allows to retrieve SoC product and revision information.  If present, a device
-node for this register should be added.
-
-Required properties:
-  - compatible: Must be one of:
-"renesas,prr"
-"renesas,bsid"
-  - reg: Base address and length of the register block.
-
-
-Examples
-
-
-   prr: chipid@ff44 {
-   compatible = "renesas,prr";
-   reg = <0 0xff44 0 4>;
-   };
diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml 
b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
new file mode 100644
index ..9df003041456
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Product Register
+
+maintainers:
+  - Geert Uytterhoeven 
+  - Magnus Damm 
+
+description: |
+  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
+  Register that allows to retrieve SoC product and revision information.
+  If present, a device node for this register should be added.
+
+properties:
+  compatible:
+oneOf:
+- const: "renesas,prr"
+- const: "renesas,bsid"
+  reg:
+items:
+  - description: Base address and length of the register block.
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+prr: chipid@ff44 {
+compatible = "renesas,prr";
+reg = <0 0xff44 0 4>;
+};
-- 
2.11.0



Re: [PATCH] PCI: rcar: Remove unnecessary header include (../pci.h)

2019-09-06 Thread Simon Horman
On Thu, Sep 05, 2019 at 04:05:28PM +0100, Andrew Murray wrote:
> Remove unnecessary header include (../pci.h) since it doesn't
> provide any needed symbols.
> 
> Signed-off-by: Andrew Murray 

Reviewed-by: Simon Horman 

> ---
>  drivers/pci/controller/pcie-rcar.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-rcar.c 
> b/drivers/pci/controller/pcie-rcar.c
> index f6a669a9af41..ee1c38c2fac9 100644
> --- a/drivers/pci/controller/pcie-rcar.c
> +++ b/drivers/pci/controller/pcie-rcar.c
> @@ -30,8 +30,6 @@
>  #include 
>  #include 
>  
> -#include "../pci.h"
> -
>  #define PCIECAR  0x10
>  #define PCIECCTLR0x18
>  #define  CONFIG_SEND_ENABLE  BIT(31)
> -- 
> 2.21.0
> 


[PATCH net-next v2 3/4] ravb: remove undocumented endianness selection

2019-09-05 Thread Simon Horman
This patch removes the use of the undocumented BOC bit of the CCC register.

Current documentation for EtherAVB (ravb) describes the offset of what the
driver uses as the BOC bit as reserved and that only a value of 0 should be
written. After some internal investigation with Renesas it remains unclear
why this driver accesses these fields but regardless of what the historical
reasons are the current code is considered incorrect.

Based on work by Kazuya Mizuguchi 

Signed-off-by: Simon Horman 
---
v2
* New patch broken out of larger patch
---
 drivers/net/ethernet/renesas/ravb.h  | 1 -
 drivers/net/ethernet/renesas/ravb_main.c | 6 --
 2 files changed, 7 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index 70eeceb7f8ae..bdb051f04b0c 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -216,7 +216,6 @@ enum CCC_BIT {
CCC_CSEL_HPB= 0x0001,
CCC_CSEL_ETH_TX = 0x0002,
CCC_CSEL_GMII_REF = 0x0003,
-   CCC_BOC = 0x0010,   /* Undocumented? */
CCC_LBME= 0x0100,
 };
 
diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index 4d1f274cded0..b538cc6fdbb7 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -447,12 +447,6 @@ static int ravb_dmac_init(struct net_device *ndev)
ravb_ring_format(ndev, RAVB_BE);
ravb_ring_format(ndev, RAVB_NC);
 
-#if defined(__LITTLE_ENDIAN)
-   ravb_modify(ndev, CCC, CCC_BOC, 0);
-#else
-   ravb_modify(ndev, CCC, CCC_BOC, CCC_BOC);
-#endif
-
/* Set AVB RX */
ravb_write(ndev,
   RCR_EFFS | RCR_ENCF | RCR_ETS0 | RCR_ESF | 0x1800, RCR);
-- 
2.11.0



[PATCH net-next v2 2/4] ravb: remove undocumented counter processing

2019-09-05 Thread Simon Horman
This patch removes the use of the undocumented counter registers
CDCR, LCCR, CERCR, CEECR.

Offsets used for undocumented registers are considered reserved and
should not be written to. After some internal investigation with Renesas
it remains unclear why this driver accesses these fields but regardless of
what the historical reasons are the current code is considered incorrect.

Based on work by Kazuya Mizuguchi 

Signed-off-by: Simon Horman 
---
v2
* New patch broken out of larger patch
---
 drivers/net/ethernet/renesas/ravb.h  | 4 
 drivers/net/ethernet/renesas/ravb_main.c | 9 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index 2596a95a4300..70eeceb7f8ae 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -194,15 +194,11 @@ enum ravb_reg {
MAHR= 0x05c0,
MALR= 0x05c8,
TROCR   = 0x0700,   /* Undocumented? */
-   CDCR= 0x0708,   /* Undocumented? */
-   LCCR= 0x0710,   /* Undocumented? */
CEFCR   = 0x0740,
FRECR   = 0x0748,
TSFRCR  = 0x0750,
TLFRCR  = 0x0758,
RFCR= 0x0760,
-   CERCR   = 0x0768,   /* Undocumented? */
-   CEECR   = 0x0770,   /* Undocumented? */
MAFCR   = 0x0778,
 };
 
diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index 6cacd5e893ac..4d1f274cded0 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1629,15 +1629,6 @@ static struct net_device_stats *ravb_get_stats(struct 
net_device *ndev)
 
nstats->tx_dropped += ravb_read(ndev, TROCR);
ravb_write(ndev, 0, TROCR); /* (write clear) */
-   nstats->collisions += ravb_read(ndev, CDCR);
-   ravb_write(ndev, 0, CDCR);  /* (write clear) */
-   nstats->tx_carrier_errors += ravb_read(ndev, LCCR);
-   ravb_write(ndev, 0, LCCR);  /* (write clear) */
-
-   nstats->tx_carrier_errors += ravb_read(ndev, CERCR);
-   ravb_write(ndev, 0, CERCR); /* (write clear) */
-   nstats->tx_carrier_errors += ravb_read(ndev, CEECR);
-   ravb_write(ndev, 0, CEECR); /* (write clear) */
 
nstats->rx_packets = stats0->rx_packets + stats1->rx_packets;
nstats->tx_packets = stats0->tx_packets + stats1->tx_packets;
-- 
2.11.0



[PATCH net-next v2 4/4] ravb: TROCR register is only present on R-Car Gen3

2019-09-05 Thread Simon Horman
Only use the TROCR register on R-Car Gen3 as it is not present on other
SoCs.

Offsets used for the undocumented registers are considered reserved and
should not be written to. After some internal investigation with Renesas it
remains unclear why this driver accesses these fields on R-Car Gen2 but
regardless of what the historical reasons are the current code is
considered incorrect.

Signed-off-by: Simon Horman 
Reviewed-by: Yoshihiro Shimoda 
Acked-by: Sergei Shtylyov 
---
v2
* Accumulated tags
* Updated changelog
---
 drivers/net/ethernet/renesas/ravb.h  | 2 +-
 drivers/net/ethernet/renesas/ravb_main.c | 6 --
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index bdb051f04b0c..a9c89d5d8898 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -193,7 +193,7 @@ enum ravb_reg {
GECMR   = 0x05b0,
MAHR= 0x05c0,
MALR= 0x05c8,
-   TROCR   = 0x0700,   /* Undocumented? */
+   TROCR   = 0x0700,   /* R-Car Gen3 only */
CEFCR   = 0x0740,
FRECR   = 0x0748,
TSFRCR  = 0x0750,
diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index b538cc6fdbb7..de9aa8c47f1c 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1621,8 +1621,10 @@ static struct net_device_stats *ravb_get_stats(struct 
net_device *ndev)
stats0 = &priv->stats[RAVB_BE];
stats1 = &priv->stats[RAVB_NC];
 
-   nstats->tx_dropped += ravb_read(ndev, TROCR);
-   ravb_write(ndev, 0, TROCR); /* (write clear) */
+   if (priv->chip_id == RCAR_GEN3) {
+   nstats->tx_dropped += ravb_read(ndev, TROCR);
+   ravb_write(ndev, 0, TROCR); /* (write clear) */
+   }
 
nstats->rx_packets = stats0->rx_packets + stats1->rx_packets;
nstats->tx_packets = stats0->tx_packets + stats1->tx_packets;
-- 
2.11.0



[PATCH net-next v2 1/4] ravb: correct typo in FBP field of SFO register

2019-09-05 Thread Simon Horman
The field name is FBP rather than FPB.

This field is unused and could equally be removed from the driver entirely.
But there seems no harm in leaving as documentation of the presence of the
field.

Based on work by Kazuya Mizuguchi 

Signed-off-by: Simon Horman 
Reviewed-by: Yoshihiro Shimoda 
Acked-by: Sergei Shtylyov 
---
v2 - Simon Horman
* Accumulated tags
* Claimed authorship - a whole one line
* No mangled diff this time

v1 - Simon Horman
* Extracted from larger patch
* Wrote changelog
---
 drivers/net/ethernet/renesas/ravb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index ac9195add811..2596a95a4300 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -317,7 +317,7 @@ enum UFCD_BIT {
 
 /* SFO */
 enum SFO_BIT {
-   SFO_FPB = 0x003F,
+   SFO_FBP = 0x003F,
 };
 
 /* RTC */
-- 
2.11.0



[PATCH net-next v2 0/4] ravb: remove use of undocumented registers

2019-09-05 Thread Simon Horman
Hi,

this short series cleans up the RAVB driver a little.

The first patch corrects the spelling of the FBP field of SFO register.
This register field is unused and should have no run-time effect.

The remaining patches remove the use of undocumented registers
after some consultation with the internal Renesas BSP team.

Changes in v2:
* Corrected mangled state of first patch
* Patches 2/4 and 3/4 split out of a large patch
* Accumulated acks
* Tweaked changelog
* Claimed authorship of all patches

v1 of this series was tested on the following platforms.
No behaviour change is expected in v2.
* E3 Ebisu
* H3 Salvator-XS (ES2.0)
* M3-W Salvator-XS
* M3-N Salvator-XS
* RZ/G1C iW-RainboW-G23S

Simon Horman (4):
  ravb: correct typo in FBP field of SFO register
  ravb: remove undocumented counter processing
  ravb: remove undocumented endianness selection
  ravb: TROCR register is only present on R-Car Gen3

 drivers/net/ethernet/renesas/ravb.h  |  9 ++---
 drivers/net/ethernet/renesas/ravb_main.c | 21 -
 2 files changed, 6 insertions(+), 24 deletions(-)

-- 
2.11.0



[PATCH 1/1] arm64: dts: renesas: hihope-common: Fix eMMC status

2019-09-05 Thread Simon Horman
From: Fabrizio Castro 

SDHI3 got accidentally disabled while adding USB 2.0 support,
this patch fixes it.

Fixes: 734d277f412a ("arm64: dts: renesas: hihope-common: Add USB 2.0 support")
Signed-off-by: Fabrizio Castro 
Reviewed-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm64/boot/dts/renesas/hihope-common.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/hihope-common.dtsi 
b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
index 3311a982fff8..23fd0224ca90 100644
--- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
@@ -279,6 +279,7 @@
mmc-hs200-1_8v;
non-removable;
fixed-emmc-driver-type = <1>;
+   status = "okay";
 };
 
 &usb_extal_clk {
-- 
2.11.0



[GIT PULL] Second Round of Renesas ARM Based SoC Fixes for v5.3

2019-09-05 Thread Simon Horman
Hi Olof, Hi Kevin, Hi Arnd,

Please consider these second round of Renesas ARM based SoC fixes for v5.3.

This pull request is based on the previous round of
such requests, tagged as renesas-next-20190813-v5.3-rc1,
which you have already pulled.


The following changes since commit 45f5d5a9e34d3fe4140a9a3b5f7ebe86c252440a:

  arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name 
(2019-08-09 11:58:17 -0700)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git 
tags/renesas-fixes2-for-v5.3

for you to fetch changes up to ae688e1720fd387de34f2140a735917411672bf1:

  arm64: dts: renesas: hihope-common: Fix eMMC status (2019-08-31 11:23:18 
+0200)


Second Round of Renesas ARM Based SoC Fixes for v5.3

* RZ/G2M based HiHope main board
  - Re-enabled accidently disabled SDHI3 (eMMC) support


Fabrizio Castro (1):
  arm64: dts: renesas: hihope-common: Fix eMMC status

 arch/arm64/boot/dts/renesas/hihope-common.dtsi | 1 +
 1 file changed, 1 insertion(+)


Re: [GIT PULL] Renesas ARM Based SoC Fixes for v5.3

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:40:36PM +0200, Arnd Bergmann wrote:
> On Fri, Aug 16, 2019 at 3:33 PM Simon Horman  
> wrote:
> >
> > are available in the git repository at:
> >
> >   https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git 
> > tags/renesas-fixes-for-v5.3
> >
> > for you to fetch changes up to 45f5d5a9e34d3fe4140a9a3b5f7ebe86c252440a:
> >
> >   arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name 
> > (2019-08-09 11:58:17 -0700)
> >
> > 
> > Renesas ARM Based SoC Fixes for v5.3
> >
> > * R-Car D3 (r8a77995) based Draak Board
> >   - Correct backlight regulator name in device tree
> 
> I just found this pull request in the a...@kernel.org inbox, sorry for missing
> it earlier. The 5.4 pull requests that Geert sent in the meantime are all
> merged as they went to the new s...@kernel.org address.
> 
> Pulled this now into arm/fixes.

Thanks, and sorry for using the old email address.

I do have one more fix which I plan to post later today.


Re: [PATCH 3/3] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit31 when using SIM0_D"

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:16:58PM +0200, Geert Uytterhoeven wrote:
> This reverts commit e167d723e1a472d252e5c4baf823b77ce5543b05.
> 
> According to the R-Car Gen3 Hardware Manual Errata for Rev 1.00 of Aug
> 24, 2018, the SEL_SIMCARD_{0,1} definition was to be deleted.  However,
> this errata merely fixed an accidental double definition in the Hardware
> User's Manual Rev. 1.00.  The real definition is still present in later
> revisions of the manual (Rev. 1.50 and Rev. 2.00).
> 
> Hence revert the commit to recover the definition.
> 
> Based on a patch in the BSP by Takeshi Kihara
> .
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH 2/3] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit30 when using SSI_SCK2 and SSI_WS2"

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:16:57PM +0200, Geert Uytterhoeven wrote:
> This reverts commit e87882eb9be10b2b9e28156922c2a47d877f5db4.
> 
> According to the R-Car Gen3 Hardware Manual Errata for Rev 1.00 of Aug
> 24, 2018, the SEL_SSI2_{0,1} definition was to be deleted.  However,
> this errata merely fixed an accidental double definition in the Hardware
> User's Manual Rev. 1.00.  The real definition is still present in later
> revisions of the manual (Rev. 1.50 and Rev. 2.00).
> 
> Hence revert the commit to recover the definition.
> 
> Based on a patch in the BSP by Takeshi Kihara
> .
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH 1/3] pinctrl: sh-pfc: r8a77990: Rename AVB_AVTP_{MATCH,CAPTURE} pin functions

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:16:56PM +0200, Geert Uytterhoeven wrote:
> From: Takeshi Kihara 
> 
> The Hardware Manual Errata for Rev. 1.50 of April 10, 2019 renamed IPSR2
> register bit[23:20] value H'3 and register bit[27:24] value H'3 from
> AVB_AVTP_MATCH_A resp. AVB_AVTP_CAPTURE_A to AVB_AVTP_MATCH resp.
> AVB_AVTP_CAPTURE_A.

I think the trailing '_A' above is a typo.

That notwithstanding:

Reviewed-by: Simon Horman 

> Update the R-Car E3 pin control driver to reflect this.
> 
> Signed-off-by: Takeshi Kihara 
> [geert: Reword, reference errata]
> Signed-off-by: Geert Uytterhoeven 
> ---
> Do we need a SH_PFC_PIN_GROUP_ALIAS() for backwards compatibility?
> There are no users of the "avb_avtp_match_a" and "avb_avtp_capture_a"
> pin groups in upstream DTS files, so I would say no.

Agreed.


> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 32 +--
>  1 file changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c 
> b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> index 2dfb8d9cfda126e4..2a6de2125bbf38b3 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> @@ -232,8 +232,8 @@
>  #define IP2_11_8 FM(AVB_MDC) F_(0, 0)F_(0, 
> 0)F_(0, 0)F_(0, 0)F_(0, 0)
> F_(0, 0)F_(0, 0)F_(0, 0)F_(0, 0) F_(0, 0) F_(0, 
> 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
>  #define IP2_15_12FM(BS_N)FM(PWM0_A)  
> FM(AVB_MAGIC)   FM(VI4_CLK) F_(0, 0)
> FM(TX3_C)   F_(0, 0)FM(VI5_CLK_B)   F_(0, 0)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
>  #define IP2_19_16FM(RD_N)FM(PWM1_A)  
> FM(AVB_LINK)FM(VI4_FIELD)   F_(0, 0)
> FM(RX3_C)   FM(FSCLKST2_N_A) FM(VI5_DATA0_B) F_(0, 0)   F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
> -#define IP2_23_20FM(RD_WR_N) FM(SCL7_A)  
> FM(AVB_AVTP_MATCH_A)FM(VI4_VSYNC_N) FM(TX5_B)   
> FM(SCK3_C)  FM(PWM5_A)  F_(0, 0)F_(0, 0)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
> -#define IP2_27_24FM(EX_WAIT0)FM(SDA7_A)  
> FM(AVB_AVTP_CAPTURE_A)  FM(VI4_HSYNC_N) FM(RX5_B)   
> FM(PWM6_A)  F_(0, 0)F_(0, 0)F_(0, 0)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
> +#define IP2_23_20FM(RD_WR_N) FM(SCL7_A)  
> FM(AVB_AVTP_MATCH)  FM(VI4_VSYNC_N) FM(TX5_B)   
> FM(SCK3_C)  FM(PWM5_A)  F_(0, 0)F_(0, 0)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
> +#define IP2_27_24FM(EX_WAIT0)FM(SDA7_A)  
> FM(AVB_AVTP_CAPTURE)FM(VI4_HSYNC_N) FM(RX5_B)   
> FM(PWM6_A)  F_(0, 0)F_(0, 0)F_(0, 0)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
>  #define IP2_31_28FM(A0)  FM(IRQ0)
> FM(PWM2_A)  FM(MSIOF3_SS1_B)FM(VI5_CLK_A)   
> FM(DU_CDE)  FM(HRX3_D)  FM(IERX)FM(QSTB_QHE)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
>  #define IP3_3_0  FM(A1)  FM(IRQ1)
> FM(PWM3_A)  FM(DU_DOTCLKIN1)FM(VI5_DATA0_A) 
> FM(DU_DISP_CDE) FM(SDA6_B)  FM(IETX)FM(QCPV_QDE)F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
>  #define IP3_7_4  FM(A2)  FM(IRQ2)
> FM(AVB_AVTP_PPS)FM(VI4_CLKENB)  FM(VI5_DATA1_A) 
> FM(DU_DISP) FM(SCL6_B)  F_(0, 0)FM(QSTVB_QVE)   F_(0, 0) 
> F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
> @@ -634,7 +634,7 @@ static const u16 pinmux_data[] = {
>  
>   PINMUX_IPSR_GPSR(IP2_23_20, RD_WR_N),
>   PINMUX_IPSR_MSEL(IP2_23_20, SCL7_A, SEL_I2C7_0),
> - PINMUX_IPSR_GPSR(IP2_23_20, AVB_AVTP_MATCH_A),
> + PINMUX_IPSR_GPSR(IP2_23_20, AVB_AVTP_MATCH),
>   PINMUX_IPSR_GPSR(IP2_23_20, VI4_VSYNC_N),
>   PINMUX_IPSR_GPSR(IP2_23_20, TX5_B),
>   PINMUX_IPSR_MSEL(IP2_23_20, SCK3_C, SEL_SCIF3_2),
> @@ -642,7 +642,7 @@ static const u16 pinmux_data[] = {
>  
>   PINMUX_IPSR_GPSR(IP2_27_24, EX_WAIT0),
>   PINMUX_IPSR_MSEL(IP2_27_24, SDA7_A

Re: [PATCH 1/2] ARM: dts: gose: Replace spaces by TABs

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:01:13PM +0200, Geert Uytterhoeven wrote:
> Make it easier to compare the file with other similar files.
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [PATCH 2/2] ARM: dts: lager: Replace spaces by TABs

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:01:14PM +0200, Geert Uytterhoeven wrote:
> Make it easier to compare the file with other similar files.
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 



Re: [net-next 1/3] ravb: correct typo in FBP field of SFO register

2019-09-05 Thread Simon Horman
On Mon, Sep 02, 2019 at 11:33:55AM -0700, David Miller wrote:
> From: Simon Horman 
> Date: Mon,  2 Sep 2019 10:06:01 +0200
> 
> > -   SFO_FPB = 0x003F,
> > +   SFO_FBP = 0x003F,
> >  };
> > 
> >  /* RTC */
> > ---
> >  drivers/net/ethernet/renesas/ravb.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/renesas/ravb.h 
> > b/drivers/net/ethernet/renesas/ravb.h
> 
> Simon please clean this up, I don't know what happened here :-)

Yeah, sorry about that. I don't know how it happened either.


Re: [net-next 2/3] ravb: Remove undocumented processing

2019-09-05 Thread Simon Horman
On Mon, Sep 02, 2019 at 08:41:14PM +0300, Sergei Shtylyov wrote:
> On 09/02/2019 11:06 AM, Simon Horman wrote:
> 
> > From: Kazuya Mizuguchi 
> > 
> > This patch removes the use of the undocumented registers
> > CDCR, LCCR, CERCR, CEECR and the undocumented BOC bit of the CCC register.
> 
>The driver has many more #define's marked as undocumented. It's not clear
> why you crammed the counters and the endianness bit in one patch. It clearly
> needs to be split -- one patch for the MAC counters and one patch for the
> AVB-DMAC bit.

Thanks for the suggestion, I will split the patch.

> > Current documentation for EtherAVB (ravb) describes the offset of
> > what the driver uses as the BOC bit as reserved and that only a value of
> > 0 should be written. Furthermore, the offsets used for the undocumented
> > registers are also considered reserved nd should not be written to.
> > 
> > After some internal investigation with Renesas it remains unclear
> > why this driver accesses these fields but regardless of what the historical
> > reasons are the current code is considered incorrect.
> > 
> > Signed-off-by: Kazuya Mizuguchi 
> > Signed-off-by: Simon Horman 
> [...]
> 
> MBR, Sergei
> 


Re: [PATCH 1/5] clk: renesas: rcar-gen2-legacy: Switch Z clock to .determine_rate()

2019-09-05 Thread Simon Horman
On Mon, Sep 02, 2019 at 10:44:25AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Mon, Sep 2, 2019 at 10:31 AM Simon Horman  wrote:
> > On Fri, Aug 30, 2019 at 10:43:01AM +0200, Geert Uytterhoeven wrote:
> > > On Tue, Jun 18, 2019 at 1:09 PM Simon Horman  wrote:
> > > > On Mon, Jun 17, 2019 at 02:52:34PM +0200, Geert Uytterhoeven wrote:
> > > > > As the .round_rate() callback returns a long clock rate, it cannot
> > > > > return clock rates that do not fit in signed long, but do fit in
> > > > > unsigned long.  Hence switch the Z clock on R-Car Gen2 from the old
> > > > > .round_rate() callback to the newer .determine_rate() callback, which
> > > > > does not suffer from this limitation.
> > > > >
> > > > > This includes implementing range checking.
> > > > >
> > > > > Signed-off-by: Geert Uytterhoeven 
> > >
> > > > > --- a/drivers/clk/renesas/clk-rcar-gen2.c
> > > > > +++ b/drivers/clk/renesas/clk-rcar-gen2.c
> > > > > @@ -66,19 +66,22 @@ static unsigned long cpg_z_clk_recalc_rate(struct 
> > > > > clk_hw *hw,
> > > > >   return div_u64((u64)parent_rate * mult, 32);
> > > > >  }
> > > > >
> > > > > -static long cpg_z_clk_round_rate(struct clk_hw *hw, unsigned long 
> > > > > rate,
> > > > > -  unsigned long *parent_rate)
> > > > > +static int cpg_z_clk_determine_rate(struct clk_hw *hw,
> > > > > + struct clk_rate_request *req)
> > > > >  {
> > > > > - unsigned long prate  = *parent_rate;
> > > > > - unsigned int mult;
> > > > > + unsigned long prate = req->best_parent_rate;
> > > > > + unsigned int min_mult, max_mult, mult;
> > > > >
> > > > > - if (!prate)
> > > > > - prate = 1;
> > > > > + min_mult = max(div_u64(req->min_rate * 32ULL, prate), 1ULL);
> > > > > + max_mult = min(div_u64(req->max_rate * 32ULL, prate), 32ULL);
> > > >
> > > > nit: the type of the second parameter doesn't look correct to me,
> > > > div_u64 expects a u32 divisor.
> > >
> > > Yes, this should use div64_ul() instead.
> >
> > Ok, but in that case should the constants be "UL" instead of "UUL" ?
> 
> The first or the second? ;-)
> 
> The multiplication should always be calculated using 64-bit arithmetic,
> hence the first ULL suffix.
> The max() macro needs two parameters of the same type, and
> div64_ul() returns u64, hence the second ULL suffix.

Thanks, I see that now.


Re: [PATCH 1/5] clk: renesas: rcar-gen2-legacy: Switch Z clock to .determine_rate()

2019-09-02 Thread Simon Horman
On Fri, Aug 30, 2019 at 10:43:01AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Jun 18, 2019 at 1:09 PM Simon Horman  wrote:
> > On Mon, Jun 17, 2019 at 02:52:34PM +0200, Geert Uytterhoeven wrote:
> > > As the .round_rate() callback returns a long clock rate, it cannot
> > > return clock rates that do not fit in signed long, but do fit in
> > > unsigned long.  Hence switch the Z clock on R-Car Gen2 from the old
> > > .round_rate() callback to the newer .determine_rate() callback, which
> > > does not suffer from this limitation.
> > >
> > > This includes implementing range checking.
> > >
> > > Signed-off-by: Geert Uytterhoeven 
> 
> > > --- a/drivers/clk/renesas/clk-rcar-gen2.c
> > > +++ b/drivers/clk/renesas/clk-rcar-gen2.c
> > > @@ -66,19 +66,22 @@ static unsigned long cpg_z_clk_recalc_rate(struct 
> > > clk_hw *hw,
> > >   return div_u64((u64)parent_rate * mult, 32);
> > >  }
> > >
> > > -static long cpg_z_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> > > -  unsigned long *parent_rate)
> > > +static int cpg_z_clk_determine_rate(struct clk_hw *hw,
> > > + struct clk_rate_request *req)
> > >  {
> > > - unsigned long prate  = *parent_rate;
> > > - unsigned int mult;
> > > + unsigned long prate = req->best_parent_rate;
> > > + unsigned int min_mult, max_mult, mult;
> > >
> > > - if (!prate)
> > > - prate = 1;
> > > + min_mult = max(div_u64(req->min_rate * 32ULL, prate), 1ULL);
> > > + max_mult = min(div_u64(req->max_rate * 32ULL, prate), 32ULL);
> >
> > nit: the type of the second parameter doesn't look correct to me,
> > div_u64 expects a u32 divisor.
> 
> Yes, this should use div64_ul() instead.

Ok, but in that case should the constants be "UL" instead of "UUL" ?

> 
> > > + if (max_mult < min_mult)
> > > + return -EINVAL;
> > >
> > > - mult = div_u64((u64)rate * 32, prate);
> > > - mult = clamp(mult, 1U, 32U);
> > > + mult = div_u64(req->rate * 32ULL, prate);
> >
> > Likewise, do we care that prate will be 64bit on 64bit platforms?
> > (Yes, I know gen2 SoCs are 32bit :)
> 
> Likewise, div64_ul().
> 
> Thanks a lot!
> 
> Gr{oetje,eeting}s,
> 
> Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds
> 


Re: [PATCH] clk: renesas: Remove R-Car Gen2 legacy DT clock support

2019-09-02 Thread Simon Horman
On Fri, Aug 30, 2019 at 03:36:15PM +0200, Geert Uytterhoeven wrote:
> As of commit 362b334b17943d84 ("ARM: dts: r8a7791: Convert to new
> CPG/MSSR bindings"), all upstream R-Car Gen2 device tree source files
> use the unified "Renesas Clock Pulse Generator / Module Standby and
> Software Reset" DT bindings.
> 
> Hence remove backward compatibility with old R-Car Gen2 device trees
> describing a hierarchical representation of the various CPG and MSTP
> clocks.
> 
> Signed-off-by: Geert Uytterhoeven 
> ---
> To be queued in clk-renesas-for-v5.5.
> 
> The abovementioned commit was part of the v4.15 release.
> The conversion was backported to v4.14.75-ltsi, and included in any
> R-Car BSP based on v4.14 (rcar-3.6.0 and later).

Reviewed-by: Simon Horman 



[net-next 2/3] ravb: Remove undocumented processing

2019-09-02 Thread Simon Horman
From: Kazuya Mizuguchi 

This patch removes the use of the undocumented registers
CDCR, LCCR, CERCR, CEECR and the undocumented BOC bit of the CCC register.

Current documentation for EtherAVB (ravb) describes the offset of
what the driver uses as the BOC bit as reserved and that only a value of
0 should be written. Furthermore, the offsets used for the undocumented
registers are also considered reserved nd should not be written to.

After some internal investigation with Renesas it remains unclear
why this driver accesses these fields but regardless of what the historical
reasons are the current code is considered incorrect.

Signed-off-by: Kazuya Mizuguchi 
Signed-off-by: Simon Horman 
---
 drivers/net/ethernet/renesas/ravb.h  |  5 -
 drivers/net/ethernet/renesas/ravb_main.c | 15 ---
 2 files changed, 20 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index 2596a95a4300..bdb051f04b0c 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -194,15 +194,11 @@ enum ravb_reg {
MAHR= 0x05c0,
MALR= 0x05c8,
TROCR   = 0x0700,   /* Undocumented? */
-   CDCR= 0x0708,   /* Undocumented? */
-   LCCR= 0x0710,   /* Undocumented? */
CEFCR   = 0x0740,
FRECR   = 0x0748,
TSFRCR  = 0x0750,
TLFRCR  = 0x0758,
RFCR= 0x0760,
-   CERCR   = 0x0768,   /* Undocumented? */
-   CEECR   = 0x0770,   /* Undocumented? */
MAFCR   = 0x0778,
 };
 
@@ -220,7 +216,6 @@ enum CCC_BIT {
CCC_CSEL_HPB= 0x0001,
CCC_CSEL_ETH_TX = 0x0002,
CCC_CSEL_GMII_REF = 0x0003,
-   CCC_BOC = 0x0010,   /* Undocumented? */
CCC_LBME= 0x0100,
 };
 
diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index 6cacd5e893ac..b538cc6fdbb7 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -447,12 +447,6 @@ static int ravb_dmac_init(struct net_device *ndev)
ravb_ring_format(ndev, RAVB_BE);
ravb_ring_format(ndev, RAVB_NC);
 
-#if defined(__LITTLE_ENDIAN)
-   ravb_modify(ndev, CCC, CCC_BOC, 0);
-#else
-   ravb_modify(ndev, CCC, CCC_BOC, CCC_BOC);
-#endif
-
/* Set AVB RX */
ravb_write(ndev,
   RCR_EFFS | RCR_ENCF | RCR_ETS0 | RCR_ESF | 0x1800, RCR);
@@ -1629,15 +1623,6 @@ static struct net_device_stats *ravb_get_stats(struct 
net_device *ndev)
 
nstats->tx_dropped += ravb_read(ndev, TROCR);
ravb_write(ndev, 0, TROCR); /* (write clear) */
-   nstats->collisions += ravb_read(ndev, CDCR);
-   ravb_write(ndev, 0, CDCR);  /* (write clear) */
-   nstats->tx_carrier_errors += ravb_read(ndev, LCCR);
-   ravb_write(ndev, 0, LCCR);  /* (write clear) */
-
-   nstats->tx_carrier_errors += ravb_read(ndev, CERCR);
-   ravb_write(ndev, 0, CERCR); /* (write clear) */
-   nstats->tx_carrier_errors += ravb_read(ndev, CEECR);
-   ravb_write(ndev, 0, CEECR); /* (write clear) */
 
nstats->rx_packets = stats0->rx_packets + stats1->rx_packets;
nstats->tx_packets = stats0->tx_packets + stats1->tx_packets;
-- 
2.11.0



[net-next 0/3] ravb: Remove use of undocumented registers

2019-09-02 Thread Simon Horman
Hi,

this short series cleans up the RAVB driver a little.

The first patch corrects the spelling of the FBP field of SFO register.
This register field is unused and should have no run-time effect.

The remaining two patches remove the use of undocumented registers
after some consultation with the internal Renesas BSP team.

All patches have been lightly tested on:
* E3 Ebisu
* H3 Salvator-XS (ES2.0)
* M3-W Salvator-XS
* M3-N Salvator-XS

Kazuya Mizuguchi (2):
  ravb: correct typo in FBP field of SFO register
  ravb: Remove undocumented processing

Simon Horman (1):
  ravb: TROCR register is only present on R-Car Gen3

 drivers/net/ethernet/renesas/ravb.h  |  9 ++---
 drivers/net/ethernet/renesas/ravb_main.c | 21 -
 2 files changed, 6 insertions(+), 24 deletions(-)

-- 
2.11.0



[net-next 3/3] ravb: TROCR register is only present on R-Car Gen3

2019-09-02 Thread Simon Horman
Only use the TROCR register on R-Car Gen3.
It is not present on other SoCs.

Offsets used for the undocumented registers are also considered reserved
and should not be written to.

After some internal investigation with Renesas it remains unclear why this
driver accesses these fields on R-Car Gen2 but regardless of what the
historical reasons are the current code is considered incorrect.

Signed-off-by: Simon Horman 
---
 drivers/net/ethernet/renesas/ravb.h  | 2 +-
 drivers/net/ethernet/renesas/ravb_main.c | 6 --
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index bdb051f04b0c..a9c89d5d8898 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -193,7 +193,7 @@ enum ravb_reg {
GECMR   = 0x05b0,
MAHR= 0x05c0,
MALR= 0x05c8,
-   TROCR   = 0x0700,   /* Undocumented? */
+   TROCR   = 0x0700,   /* R-Car Gen3 only */
CEFCR   = 0x0740,
FRECR   = 0x0748,
TSFRCR  = 0x0750,
diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index b538cc6fdbb7..de9aa8c47f1c 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1621,8 +1621,10 @@ static struct net_device_stats *ravb_get_stats(struct 
net_device *ndev)
stats0 = &priv->stats[RAVB_BE];
stats1 = &priv->stats[RAVB_NC];
 
-   nstats->tx_dropped += ravb_read(ndev, TROCR);
-   ravb_write(ndev, 0, TROCR); /* (write clear) */
+   if (priv->chip_id == RCAR_GEN3) {
+   nstats->tx_dropped += ravb_read(ndev, TROCR);
+   ravb_write(ndev, 0, TROCR); /* (write clear) */
+   }
 
nstats->rx_packets = stats0->rx_packets + stats1->rx_packets;
nstats->tx_packets = stats0->tx_packets + stats1->tx_packets;
-- 
2.11.0



[net-next 1/3] ravb: correct typo in FBP field of SFO register

2019-09-02 Thread Simon Horman
From: Kazuya Mizuguchi 

The field name is FBP rather than FPB.

This field is unused and could equally be removed from the driver entirely.
But there seems no harm in leaving as documentation of the presence of the
field.

Signed-off-by: Kazuya Mizuguchi 
Signed-off-by: Simon Horman 
---
v0 - Kazuya Mizuguchi

v1 - Simon Horman
* Extracted from larger patch
* Wrote changelog

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index ac9195add811..bdb051f04b0c 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -317,7 +312,7 @@ enum UFCD_BIT {

 /* SFO */
 enum SFO_BIT {
-   SFO_FPB = 0x003F,
+   SFO_FBP = 0x003F,
 };

 /* RTC */
---
 drivers/net/ethernet/renesas/ravb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h 
b/drivers/net/ethernet/renesas/ravb.h
index ac9195add811..2596a95a4300 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -317,7 +317,7 @@ enum UFCD_BIT {
 
 /* SFO */
 enum SFO_BIT {
-   SFO_FPB = 0x003F,
+   SFO_FBP = 0x003F,
 };
 
 /* RTC */
-- 
2.11.0



Re: [PATCH v2 0/7] soc: renesas: rcar-gen3-sysc: Fix power request conflicts

2019-08-31 Thread Simon Horman
On Wed, Aug 28, 2019 at 01:36:11PM +0200, Geert Uytterhoeven wrote:
>   Hi all,
> 
> Recent R-Car Gen3 SoCs added an External Request Mask Register to the
> System Controller (SYSC).  This register allows to mask external power
> requests for CPU or 3DG domains, to prevent conflicts between powering
> off CPU cores or the 3D Graphics Engine, and changing the state of
> another power domain through SYSC, which could lead to CPG state machine
> lock-ups.
> 
> This patch series starts making use of this register.  Note that the
> register is optional, and that its location and contents are
> SoC-specific.
> 
> This was inspired by a patch in the BSP by Dien Pham
> .
> 
> Note that the issue fixed cannot happen in the upstream kernel, as
> upstream has no support for graphics acceleration yet.  SoCs lacking the
> External Request Mask Register may need a different mitigation in the
> future.
> 
> Changes compared to v1[1]:
>   - Improve description of cover letter and first patch.
> 
> Changes compared to RFC[2]:
>   - Rebased.
> 
> This has been boot-tested on R-Car H3 ES1.0, H3 ES2.0, M3-W ES1.0, M3-N,
> V3M, and E3 (only the last 3 have this register!), and regression-tested
> on R-Car Gen2.
> 
> This has not been tested on R-Car H3 ES3.0, M3-W ES2.0, and V3H.
> 
> For your convenience, this series is available in the
> topic/rcar3-sysc-extmask-v2 branch of my renesas-drivers git repository at
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.
> 
> Thanks for your comments!

Looks good to me.

Reviewed-by: Simon Horman 



Re: [PATCH] arm64: dts: renesas: hihope-common: Fix eMMC status

2019-08-31 Thread Simon Horman
On Fri, Aug 30, 2019 at 03:25:39PM +0200, Geert Uytterhoeven wrote:
> On Fri, Aug 30, 2019 at 3:15 PM Fabrizio Castro
>  wrote:
> > SDHI3 got accidentally disabled while adding USB 2.0 support,
> > this patch fixes it.
> >
> > Fixes: 734d277f412a ("arm64: dts: renesas: hihope-common: Add USB 2.0 
> > support")
> > Signed-off-by: Fabrizio Castro 
> 
> Reviewed-by: Geert Uytterhoeven 
> 
> This is a fix for v5.3.

Thanks, applied as a fix for v5.3.


Re: [PATCH 2/2] dmaengine: rcar-dmac: Add dma-channel-mask property support

2019-08-31 Thread Simon Horman
On Wed, Aug 28, 2019 at 08:13:55PM +0900, Yoshihiro Shimoda wrote:
> This patch adds dma-channel-mask property support not to reserve
> some DMA channels for some reasons. (for example: a heterogeneous
> CPU uses it.)
> 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Simon Horman 



Re: [PATCH 1/2] dmaengine: rcar-dmac: Don't set DMACHCLR bit 0 to 1 if iommu is mapped

2019-08-31 Thread Simon Horman
On Wed, Aug 28, 2019 at 08:13:54PM +0900, Yoshihiro Shimoda wrote:
> The commit 20c169aceb45 ("dmaengine: rcar-dmac: clear pertinence
> number of channels") always set the DMACHCLR bit 0 to 1, but if
> iommu is mapped to the device, this driver doesn't need to clear it.
> So, this patch takes care of it by using "channels_mask" bitfield.
> 
> Note that, this patch doesn't have a "Fixes:" tag because the driver
> doesn't manage the channel 0 anyway so that the behavior of
> the channel is not changed.
> 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Simon Horman 



Re: [PATCH 4/4] usb: host: xhci-rcar: avoid 60s wait by request_firmware() in system booting

2019-08-31 Thread Simon Horman
On Tue, Aug 27, 2019 at 07:02:07PM +0900, Yoshihiro Shimoda wrote:
> If CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y and CONFIG_USB_XHCI_RCAR=y,
> request_firmware() in xhci_rcar_download_firmware() waits for 60s to
> sysfs fallback for the firmware like below.
> 
> [1.599701] xhci-hcd ee00.usb: xHCI Host Controller
> [1.604948] xhci-hcd ee00.usb: new USB bus registered, assigned bus 
> number 3
> [1.612403] xhci-hcd ee00.usb: Direct firmware load for 
> r8a779x_usb3_v3.dlmem failed with error -2
> [1.621726] xhci-hcd ee00.usb: Falling back to sysfs fallback for: 
> r8a779x_usb3_v3.dlmem
> [1.707953] ata1: link resume succeeded after 1 retries
> [1.819379] ata1: SATA link down (SStatus 0 SControl 300)
> [   62.436012] xhci-hcd ee00.usb: can't setup: -11
> [   62.440901] xhci-hcd ee00.usb: USB bus 3 deregistered
> [   62.446361] xhci-hcd: probe of ee00.usb failed with error -11
> 
> To avoid this 60s wait, this patch adds to check the system_state
> condition and if the system is not running,
> xhci_rcar_download_firmware() calls request_firmware_direct()
> instead of request_firmware() as a workaround.
> 
> Signed-off-by: Yoshihiro Shimoda 

It seems to me that request_firmware() is working as expected.
And that this patch introduces an alternate behaviour for xhci-rcar
where it will fall back to the user-space helper in some cases but not
others. This inconsistency isn't obviously correct to me. Perhaps
xhci-rcar should always call request_firmware_direct() ?

> ---
>  drivers/usb/host/xhci-rcar.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c
> index 34761be..c90cf46 100644
> --- a/drivers/usb/host/xhci-rcar.c
> +++ b/drivers/usb/host/xhci-rcar.c
> @@ -6,6 +6,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -146,7 +147,10 @@ static int xhci_rcar_download_firmware(struct usb_hcd 
> *hcd)
>   firmware_name = priv->firmware_name;
>  
>   /* request R-Car USB3.0 firmware */
> - retval = request_firmware(&fw, firmware_name, dev);
> + if (system_state < SYSTEM_RUNNING)
> + retval = request_firmware_direct(&fw, firmware_name, dev);
> + else
> + retval = request_firmware(&fw, firmware_name, dev);
>   if (retval)
>   return retval;
>  
> -- 
> 2.7.4
> 


Re: [PATCH 1/2] dmaengine: rcar-dmac: Use of_data values instead of a macro

2019-08-31 Thread Simon Horman
On Tue, Aug 27, 2019 at 03:08:16PM +0200, Geert Uytterhoeven wrote:
> Hi Shimoda-san,
> 
> On Tue, Aug 27, 2019 at 1:12 PM Yoshihiro Shimoda
>  wrote:
> > Since we will have changed memory mapping of the DMAC in the future,
> > this patch uses of_data values instead of a macro to calculate
> > each channel's base offset.
> >
> > Signed-off-by: Yoshihiro Shimoda 
> 
> Reviewed-by: Geert Uytterhoeven 
> 
> > --- a/drivers/dma/sh/rcar-dmac.c
> > +++ b/drivers/dma/sh/rcar-dmac.c
> > @@ -208,12 +208,20 @@ struct rcar_dmac {
> >
> >  #define to_rcar_dmac(d)container_of(d, struct rcar_dmac, 
> > engine)
> >
> > +/*
> > + * struct rcar_dmac_of_data - This driver's OF data
> > + * @chan_offset_base: DMAC channels base offset
> > + * @chan_offset_coefficient: DMAC channels offset coefficient
> 
> Perhaps "stride" instead of "coefficient"? Or "step"?
> 
> > @@ -1803,10 +1813,15 @@ static int rcar_dmac_probe(struct platform_device 
> > *pdev)
> > unsigned int channels_offset = 0;
> > struct dma_device *engine;
> > struct rcar_dmac *dmac;
> > +   const struct rcar_dmac_of_data *data;
> > struct resource *mem;
> > unsigned int i;
> > int ret;
> >
> > +   data = of_device_get_match_data(&pdev->dev);
> > +   if (!data)
> > +   return -EINVAL;
> 
> This cannot fail, as the driver is DT only, and all entries in the match table
> have a data pointer.

It seems to me that not including this check would make the code both more
fragile and less intuitive for a marginal gain in simplicity.

> 
> Gr{oetje,eeting}s,
> 
> Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds
> 


Re: [RFC DO-NOT-MERGE PATCH] arm64: dts: renesas: R8A77961: Add Renesas M3-W+ (M3 ES3.0) SoC support

2019-08-31 Thread Simon Horman
On Fri, Aug 23, 2019 at 04:18:09PM +0200, Geert Uytterhoeven wrote:
> Hi Eugeniu,
> 
> Thanks for bringing this up!
> 
> On Wed, Aug 21, 2019 at 2:45 PM Eugeniu Rosca  wrote:
> > Similar to the revision update from H3-ES1.x to H3-ES2.0, the update
> > from M3-ES1.x to M3-ES3.0, in addition to fixing HW bugs/erratas, drops
> > entire silicon IPs [1-2] (for cost efficiency and other reasons).
> >
> > However, unlike in the H3 ES1.x->ES2.0 revision update, the M3-ES3.0
> > came with a new SoC id, i.e. r8a77961 (according to both [2] and
> 
> Actually R-Car H3 ES2.0 is r8a77951, while ES1.x is r8a77950.
> But we ignored the fifth digit (see below).
> 
> > the updated SoC HW manual Rev.2.00 Jul 2019). The choice to allocate a
> > new identifier seems to strengthen the HW differences between M3-ES1.x
> > and M3-ES3.0 (as it is the case for M3N/r8a77965).
> 
> While H3 ES2.0 was an evolutionary step, obsoleting H3 ES1.x, it looks
> like M3-W and M3-W+ may exist as two separate products, next to each
> other.
> 
> > Given the above, there are several ways to differentiate between
> > M3-ES1.x and M3-ES3.0:
> >
> > A. The BSP way [1]. Move/rename r8a7796.dtsi to r8a7796-es1.dtsi and
> > keep using r8a7796.dtsi for M3-ES3.x.
> >
> > Pros:
> >  * Resembles commit 291e0c4994d081 ("arm64: dts: r8a7795: Add support
> >for R-Car H3 ES2.0")
> >  * Reuses the r8a7796 (e.g. sysc, cpg-mssr) drivers for r8a77961 (i.e.
> >minimizes the bring-up effort)
> > Cons:
> >  * Deliberately diverges from the vendor documentation [2] by
> >ignoring the new SoC identifier r8a77961, i.e. leading to
> >inconsistencies in the names of the drivers and DTS
> >
> > B. The approach taken in this patch, i.e. create a brand new
> >   r8a77961.dtsi (similar to r8a77965.dtsi).
> >
> > Pros:
> >  * Reflects the reality documented by HW designers [2]
> >  * Maintains drivers/DTS naming consistency and avoids mismatch between
> >documentation and code
> > Cons:
> >  * higher bring-up effort than (A)
> >  * more discussion is needed on whether it makes sense to separate:
> >- DTS only
> >- DTS + Kconfig (ARCH_R8A77961)
> >- DTS + Kconfig (ARCH_R8A77961) + drivers (sysc, cpg-mssr, other?)
> >
> > Comments appreciated!
> 
> When we started work on H3 ES2.0, it was considered an evolutionary step
> from ES1.x, not a different SoC.  We also were used to 4-digit IDs in
> compatible values, as before the 5th digit was typically used to
> indicate a minor difference, like a different package, or a different
> ROM option.  Hence we ignored the 5th digit, reused the compatible
> values for H3 ES1.x, and went with soc_device_match() to differentiate,
> where needed.
> 
> However, it turned out H3 ES2.0 was more like a different SoC in the
> same family: it has more similarities with R-Car M3-W ES1.0 than with
> R-Car H3 ES1.x.  In the mean time, with the advent of R-Car D3 and M3-N,
> we also got used to 5 digits.  Hence in hindsight, it might have been
> better if we had considered H3 ES1.x and ES2.0 to be two different
> SoCs.
> 
> Given R-Car M3-W and M3-W+ may co-exist as separate SoCs, I think
> approach B is the best approach, using separate DTS, compatible values,
> Kconfig, and drivers, like we did for e.g. R-Car M3-N.
> 
> What do you think?
> Thanks!

+1

Your recollection of the decisions made around H3 and 4/5 digit identifiers
matches mine. And I agree that in hindsight we may have been better to use
a 5 digit identifier for H3 ES2.0.  So I think it would be a good idea to
learn from this and use a 5 digit identifier for M3-W+. We can always
register unused identifiers if the need arises.

For may the main drawback of this approach is that it is inconsistent
with the one we took for H3, which may lead to confusion. But I think
that we are better off to favour evolution over reuse in this case.
Or in other words, it seems like a good opportunity to learn from
our mistakes.



Re: [PATCH 2/3] soc: renesas: Enable ARM_ERRATA_754322 for affected Cortex-A9

2019-08-22 Thread Simon Horman
On Wed, Aug 21, 2019 at 02:46:01PM +0200, Geert Uytterhoeven wrote:
> ARM Erratum 754322 affects Cortex-A9 revisions r2p* and r3p*.
> 
> Enable support code to mitigate the erratum when compiling a kernel for
> any of the affected Renesas SoCs:
>   - RZ/A1: r3p0,
>   - R-Mobile A1: r2p4,
>   - R-Car M1A: r2p2-00rel0,
>   - R-Car H1: r3p0,
>   - SH-Mobile AG5: r2p2,
> and drop the corresponding config symbol from shmobile_defconfig.
> 
> EMMA Mobile EV2 (r1p3) and RZ/A2 (r4p1) are not affected.

Reviewed-by: Simon Horman 

> 
> Signed-off-by: Geert Uytterhoeven 
> ---
> Looks like my R-Mobile A1 is actually r2p3, and the R-Car M1A in Magnus'
> farm is r2p4?
> 
>  arch/arm/configs/shmobile_defconfig | 1 -
>  drivers/soc/renesas/Kconfig | 5 +
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/configs/shmobile_defconfig 
> b/arch/arm/configs/shmobile_defconfig
> index c6c70355141c38fa..123821e63873dafa 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -9,7 +9,6 @@ CONFIG_PERF_EVENTS=y
>  CONFIG_SLAB=y
>  CONFIG_ARCH_RENESAS=y
>  CONFIG_PL310_ERRATA_588369=y
> -CONFIG_ARM_ERRATA_754322=y
>  CONFIG_SMP=y
>  CONFIG_SCHED_MC=y
>  CONFIG_NR_CPUS=8
> diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
> index a72d014ea37cc788..3c5e017bacbaca11 100644
> --- a/drivers/soc/renesas/Kconfig
> +++ b/drivers/soc/renesas/Kconfig
> @@ -55,6 +55,7 @@ config ARCH_EMEV2
>  
>  config ARCH_R7S72100
>   bool "RZ/A1H (R7S72100)"
> + select ARM_ERRATA_754322
>   select PM
>   select PM_GENERIC_DOMAINS
>   select RENESAS_OSTM
> @@ -79,6 +80,7 @@ config ARCH_R8A73A4
>  config ARCH_R8A7740
>   bool "R-Mobile A1 (R8A77400)"
>   select ARCH_RMOBILE
> + select ARM_ERRATA_754322
>   select RENESAS_INTC_IRQPIN
>  
>  config ARCH_R8A7743
> @@ -108,10 +110,12 @@ config ARCH_R8A77470
>  config ARCH_R8A7778
>   bool "R-Car M1A (R8A77781)"
>   select ARCH_RCAR_GEN1
> + select ARM_ERRATA_754322
>  
>  config ARCH_R8A7779
>   bool "R-Car H1 (R8A77790)"
>   select ARCH_RCAR_GEN1
> + select ARM_ERRATA_754322
>   select HAVE_ARM_SCU if SMP
>   select HAVE_ARM_TWD if SMP
>   select SYSC_R8A7779
> @@ -158,6 +162,7 @@ config ARCH_R9A06G032
>  config ARCH_SH73A0
>   bool "SH-Mobile AG5 (R8A73A00)"
>   select ARCH_RMOBILE
> + select ARM_ERRATA_754322
>   select HAVE_ARM_SCU if SMP
>   select HAVE_ARM_TWD if SMP
>   select RENESAS_INTC_IRQPIN
> -- 
> 2.17.1
> 


Re: [PATCH 1/3] soc: renesas: Enable ARM_ERRATA_814220 for affected Cortex-A7

2019-08-22 Thread Simon Horman
On Wed, Aug 21, 2019 at 02:46:00PM +0200, Geert Uytterhoeven wrote:
> ARM Erratum 814220 affects Cortex-A7 revisions r0p2-r0p5.
> 
> Enable automatically support to mitigate the erratum when compiling a
> kernel for any of the affected Renesas SoCs:
>   - R-Mobile APE6: r0p2,
>   - RZ/G1E: r0p5,
>   - RZ/G1C: r0p5,
>   - R-Car H2: r0p3,
>   - R-Car E2: r0p5,
>   - RZ/N1: r0p5.
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 

> ---
>  drivers/soc/renesas/Kconfig | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
> index 2bbf49e5d441808b..a72d014ea37cc788 100644
> --- a/drivers/soc/renesas/Kconfig
> +++ b/drivers/soc/renesas/Kconfig
> @@ -72,6 +72,7 @@ config ARCH_R8A73A4
>   bool "R-Mobile APE6 (R8A73A40)"
>   select ARCH_RMOBILE
>   select ARM_ERRATA_798181 if SMP
> + select ARM_ERRATA_814220
>   select HAVE_ARM_ARCH_TIMER
>   select RENESAS_IRQC
>  
> @@ -95,11 +96,13 @@ config ARCH_R8A7744
>  config ARCH_R8A7745
>   bool "RZ/G1E (R8A77450)"
>   select ARCH_RCAR_GEN2
> + select ARM_ERRATA_814220
>   select SYSC_R8A7745
>  
>  config ARCH_R8A77470
>   bool "RZ/G1C (R8A77470)"
>   select ARCH_RCAR_GEN2
> + select ARM_ERRATA_814220
>   select SYSC_R8A77470
>  
>  config ARCH_R8A7778
> @@ -117,6 +120,7 @@ config ARCH_R8A7790
>   bool "R-Car H2 (R8A77900)"
>   select ARCH_RCAR_GEN2
>   select ARM_ERRATA_798181 if SMP
> + select ARM_ERRATA_814220
>   select I2C
>   select SYSC_R8A7790
>  
> @@ -143,11 +147,13 @@ config ARCH_R8A7793
>  config ARCH_R8A7794
>   bool "R-Car E2 (R8A77940)"
>   select ARCH_RCAR_GEN2
> + select ARM_ERRATA_814220
>   select SYSC_R8A7794
>  
>  config ARCH_R9A06G032
>   bool "RZ/N1D (R9A06G032)"
>   select ARCH_RZN1
> + select ARM_ERRATA_814220
>  
>  config ARCH_SH73A0
>   bool "SH-Mobile AG5 (R8A73A00)"
> -- 
> 2.17.1
> 


Re: [PATCH 3/3] [RFC] ARM: shmobile: defconfig: Disable PL310_ERRATA_588369

2019-08-22 Thread Simon Horman
On Wed, Aug 21, 2019 at 02:46:02PM +0200, Geert Uytterhoeven wrote:
> PL310 Erratum 588369 affects PL310 cache controller revisions older than
> r2p0.
> 
> As Renesas ARM SoCs contain the following revisions:
>   - SH-Mobile AG5: r3p1,
>   - R-Mobile A1: r3p1-50rel0,
>   - R-Car H1: r3p2,
>   - RZ/A1: r3p2,
>   - RZ/A2: r3p3,
> none of them are affected, and support for the errata can be disabled
> safely.
> 
> The EMMA Mobile EV2 documentation doesn't mention the revision of its
> PL310 cache controller, so this SoC might be affected.  However, the L2
> cache controller is not enabled by Linux.

If the controller is not enabled by Linux then I would think that the
Errata is not needed. If that is true then I agree with this patch.

Regarding making assumptions about the version of the PL310 cache
controller, I suggest that we cannot assume that it is not affected
without further information.

> 
> Signed-off-by: Geert Uytterhoeven 
> ---
>  arch/arm/configs/shmobile_defconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/configs/shmobile_defconfig 
> b/arch/arm/configs/shmobile_defconfig
> index 123821e63873dafa..95a127cbe8e6fcd7 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -8,7 +8,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>  CONFIG_PERF_EVENTS=y
>  CONFIG_SLAB=y
>  CONFIG_ARCH_RENESAS=y
> -CONFIG_PL310_ERRATA_588369=y
>  CONFIG_SMP=y
>  CONFIG_SCHED_MC=y
>  CONFIG_NR_CPUS=8
> -- 
> 2.17.1
> 


Re: [PATCH LOCAL] arm64: renesas_defconfig: Refresh for v5.3-rc2

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 02:21:23PM +0200, Geert Uytterhoeven wrote:
> Update the defconfig for Renesas R-Car Gen3 and RZ/G2 boards:
>   - Drop CONFIG_COMMON_CLK_XGENE=n (no longer auto-enabled since commit
> ce9a1046434caee1 ("clk: xgene: Don't build COMMON_CLK_XGENE by
> default").
> 
> Signed-off-by: Geert Uytterhoeven 

Perhaps too slow to be particularly useful, but this looks good to me.

Reviewed-by: Simon Horman 

> ---
> To be applied to topic/renesas-defconfig.
> Not intended for upstream merge.
> 
>  arch/arm64/configs/renesas_defconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/configs/renesas_defconfig 
> b/arch/arm64/configs/renesas_defconfig
> index 264fe03d6b085bae..bf0fd6aad56758e1 100644
> --- a/arch/arm64/configs/renesas_defconfig
> +++ b/arch/arm64/configs/renesas_defconfig
> @@ -274,7 +274,6 @@ CONFIG_VIRTIO_BALLOON=y
>  CONFIG_VIRTIO_MMIO=y
>  CONFIG_CHROME_PLATFORMS=y
>  CONFIG_COMMON_CLK_CS2000_CP=y
> -# CONFIG_COMMON_CLK_XGENE is not set
>  CONFIG_COMMON_CLK_VC5=y
>  CONFIG_CLK_RCAR_USB2_CLOCK_SEL=y
>  CONFIG_HWSPINLOCK=y
> -- 
> 2.17.1
> 


Re: [PATCH] arm64: dts: renesas: r8a774c0: Fix register range of display node

2019-08-21 Thread Simon Horman
On Wed, Aug 21, 2019 at 11:57:32AM +0200, Geert Uytterhoeven wrote:
> Since the R8A774C0 SoC uses DU{0,1} only, the register block length
> should be 0x4.
> 
> Based on commit 06585ed38b6698bc ("arm64: dts: renesas: r8a77990: Fix
> register range of display node") for R-Car E3.
> 
> Fixes: 8ed3a6b223159df3 ("arm64: dts: renesas: r8a774c0: Add display output 
> support")
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 

> ---
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> index 5ce1eb4596f54043..4ee885e7678886f6 100644
> --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> @@ -1805,7 +1805,7 @@
>  
>   du: display@feb0 {
>   compatible = "renesas,du-r8a774c0";
> - reg = <0 0xfeb0 0 0x8>;
> + reg = <0 0xfeb0 0 0x4>;
>   interrupts = ,
>;
>   clocks = <&cpg CPG_MOD 724>,
> -- 
> 2.17.1
> 


[PATCH v2] dt-bindings: clk: emev2: Rename bindings documentation file

2019-08-21 Thread Simon Horman
Rename the device tree clock bindings for Renesas EMMA Mobile EV2
from emev2-clock.txt to renesas,emev2-smu.txt.

This is part of an ongoing effort to name bindings documentation files for
Renesas IP blocks consistently, in line with the compat strings they
document.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1

v2
* Drop emev2 prefix from new filename, it was unintentional
  and does not match the proposed naming scheme
---
 .../devicetree/bindings/clock/{emev2-clock.txt => renesas,emev2-smu.txt}  | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename Documentation/devicetree/bindings/clock/{emev2-clock.txt => 
renesas,emev2-smu.txt} (100%)

diff --git a/Documentation/devicetree/bindings/clock/emev2-clock.txt 
b/Documentation/devicetree/bindings/clock/renesas,emev2-smu.txt
similarity index 100%
rename from Documentation/devicetree/bindings/clock/emev2-clock.txt
rename to Documentation/devicetree/bindings/clock/renesas,emev2-smu.txt
-- 
2.11.0



Re: [PATCH] ARM: debug-ll: Add support for r7s9210

2019-08-21 Thread Simon Horman
On Wed, Aug 07, 2019 at 10:54:15AM +0200, Geert Uytterhoeven wrote:
> Enable low-level debugging support for RZ/A2M (r7s9210).
> 
> The RZA2MEVB board uses either SCIF2 (SDRAM enabled) or SCIF4 (HyperRAM
> only) for the serial console.
> 
> Note that "SCIFA" serial ports on RZ/A2 SoCs use a compressed register
> layout, hence add support for that to renesas-scif.S.
> 
> Signed-off-by: Geert Uytterhoeven 

Reviewed-by: Simon Horman 

> ---
>  arch/arm/Kconfig.debug| 20 +++-
>  arch/arm/include/debug/renesas-scif.S |  6 +-
>  2 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 85710e078afb4878..9fe038aecc553deb 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -924,6 +924,20 @@ choice
> Say Y here if you want kernel low-level debugging support
> via SCIF2 on Renesas RZ/A1H (R7S72100).
>  
> + config DEBUG_R7S9210_SCIF2
> + bool "Kernel low-level debugging messages via SCIF2 on R7S9210"
> + depends on ARCH_R7S9210
> + help
> +   Say Y here if you want kernel low-level debugging support
> +   via SCIF2 on Renesas RZ/A2M (R7S9210).
> +
> + config DEBUG_R7S9210_SCIF4
> + bool "Kernel low-level debugging messages via SCIF4 on R7S9210"
> + depends on ARCH_R7S9210
> + help
> +   Say Y here if you want kernel low-level debugging support
> +   via SCIF4 on Renesas RZ/A2M (R7S9210).
> +
>   config DEBUG_RCAR_GEN1_SCIF0
>   bool "Kernel low-level debugging messages via SCIF0 on R8A7778"
>   depends on ARCH_R8A7778
> @@ -1537,6 +1551,8 @@ config DEBUG_LL_INCLUDE
>   default "debug/msm.S" if DEBUG_QCOM_UARTDM
>   default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
>   default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
> + default "debug/renesas-scif.S" if DEBUG_R7S9210_SCIF2
> + default "debug/renesas-scif.S" if DEBUG_R7S9210_SCIF4
>   default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF0
>   default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2
>   default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0
> @@ -1666,7 +1682,8 @@ config DEBUG_UART_PHYS
>   default 0xe6e6 if DEBUG_RCAR_GEN2_SCIF0
>   default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1
>   default 0xe6ee if DEBUG_RCAR_GEN2_SCIF4
> - default 0xe8008000 if DEBUG_R7S72100_SCIF2
> + default 0xe8008000 if DEBUG_R7S72100_SCIF2 || DEBUG_R7S9210_SCIF2
> + default 0xe8009000 if DEBUG_R7S9210_SCIF4
>   default 0xf000 if DEBUG_DIGICOLOR_UA0
>   default 0xfbe0 if ARCH_EBSA110
>   default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
> @@ -1699,6 +1716,7 @@ config DEBUG_UART_PHYS
>   DEBUG_LL_UART_EFM32 || \
>   DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
>   DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
> + DEBUG_R7S9210_SCIF2 || DEBUG_R7S9210_SCIF4 || \
>   DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \
>   DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF1 || \
>   DEBUG_RCAR_GEN2_SCIF2 || DEBUG_RCAR_GEN2_SCIF4 || \
> diff --git a/arch/arm/include/debug/renesas-scif.S 
> b/arch/arm/include/debug/renesas-scif.S
> index 1c5f795587fc5681..25f06663a9a4e2c1 100644
> --- a/arch/arm/include/debug/renesas-scif.S
> +++ b/arch/arm/include/debug/renesas-scif.S
> @@ -11,7 +11,11 @@
>  #define SCIF_PHYSCONFIG_DEBUG_UART_PHYS
>  #define SCIF_VIRT((SCIF_PHYS & 0x00ff) | 0xfd00)
>  
> -#if CONFIG_DEBUG_UART_PHYS < 0xe6e0
> +#if defined(CONFIG_DEBUG_R7S9210_SCIF2) || 
> defined(CONFIG_DEBUG_R7S9210_SCIF4)
> +/* RZ/A2 SCIFA */
> +#define FTDR 0x06
> +#define FSR  0x08
> +#elif CONFIG_DEBUG_UART_PHYS < 0xe6e0
>  /* SCIFA */
>  #define FTDR 0x20
>  #define FSR  0x14
> -- 
> 2.17.1
> 


Re: [PATCH] dt-bindings: clk: emev2: Rename bindings documentation file

2019-08-21 Thread Simon Horman
On Wed, Aug 21, 2019 at 09:56:20AM +0200, Niklas Söderlund wrote:
> Hi Simon,
> 
> Thanks for your work.
> 
> On 2019-08-19 15:56:30 +0200, Simon Horman wrote:
> > Rename the device tree clock bindings for Renesas EMMA Mobile EV2
> > from emev2-clock.txt to emev2-renesas,emev2-smu.txt.
> 
> Should this not be renesas,emev2-smu.txt to align with the compatible 
> string?

Yes indeed, I'll prepare v2.

> > 
> > This is part of an ongoing effort to name bindings documentation files for
> > Renesas IP blocks consistently, in line with the compat strings they
> > document.
> > 
> > Signed-off-by: Simon Horman 
> > ---
> > Based on v5.3-rc1
> > ---
> >  .../bindings/clock/{emev2-clock.txt => emev2-renesas,emev2-smu.txt}   
> > | 0
> >  1 file changed, 0 insertions(+), 0 deletions(-)
> >  rename Documentation/devicetree/bindings/clock/{emev2-clock.txt => 
> > emev2-renesas,emev2-smu.txt} (100%)
> > 
> > diff --git a/Documentation/devicetree/bindings/clock/emev2-clock.txt 
> > b/Documentation/devicetree/bindings/clock/emev2-renesas,emev2-smu.txt
> > similarity index 100%
> > rename from Documentation/devicetree/bindings/clock/emev2-clock.txt
> > rename to 
> > Documentation/devicetree/bindings/clock/emev2-renesas,emev2-smu.txt
> > -- 
> > 2.11.0
> > 
> 
> -- 
> Regards,
> Niklas Söderlund
> 


Re: [PATCH] arm64: dts: renesas: r8a77970: sort nodes

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 09:56:33PM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>* Sort by node address, grouping all nodes with the same compat string
>  and sorting the group alphabetically.
> Else
>* Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 

> ---
> 
> This patch is based on the master branch of Geert Uytterhoeven's renesas-devel
> tree.
> 
>  arch/arm64/boot/dts/renesas/r8a77970.dtsi | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> index 5b6164d..0cd3b37 100644
> --- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> @@ -1181,6 +1181,9 @@
>   polling-delay = <1000>;
>   thermal-sensors = <&thermal>;
>  
> + cooling-maps {
> + };
> +
>   trips {
>   cpu-crit {
>   temperature = <12>;
> @@ -1188,9 +1191,6 @@
>   type = "critical";
>   };
>   };
> -
> - cooling-maps {
> - };
>   };
>   };
>  
> -- 
> 1.9.1
> 


Re: [PATCH] arm64: dts: renesas: r8a7796: sort nodes

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 09:56:18PM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>* Sort by node address, grouping all nodes with the same compat string
>  and sorting the group alphabetically.
> Else
>* Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko 

Sorry, I feel that I have missed this in other review's too,
but, isn't canfd out of order. Its bus address seems to place it
before dmac0. Or do we prefer to keep it grouped with the can nodes?

The above notwithstanding,

Reviewed-by: Simon Horman 

> ---
> 
> This patch is based on the master branch of Geert Uytterhoeven's renesas-devel
> tree.
> 
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi | 152 
> +++
>  1 file changed, 76 insertions(+), 76 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> index 26df5b8..3dc9d73 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> @@ -1833,6 +1833,17 @@
> "ssi.1", "ssi.0";
>   status = "disabled";
>  
> + rcar_sound,ctu {
> + ctu00: ctu-0 { };
> + ctu01: ctu-1 { };
> + ctu02: ctu-2 { };
> + ctu03: ctu-3 { };
> + ctu10: ctu-4 { };
> + ctu11: ctu-5 { };
> + ctu12: ctu-6 { };
> + ctu13: ctu-7 { };
> + };
> +
>   rcar_sound,dvc {
>   dvc0: dvc-0 {
>   dmas = <&audma1 0xbc>;
> @@ -1849,17 +1860,6 @@
>   mix1: mix-1 { };
>   };
>  
> - rcar_sound,ctu {
> - ctu00: ctu-0 { };
> - ctu01: ctu-1 { };
> - ctu02: ctu-2 { };
> - ctu03: ctu-3 { };
> - ctu10: ctu-4 { };
> - ctu11: ctu-5 { };
> - ctu12: ctu-6 { };
> - ctu13: ctu-7 { };
> - };
> -
>   rcar_sound,src {
>   src0: src-0 {
>   interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> @@ -1913,6 +1913,59 @@
>   };
>   };
>  
> + rcar_sound,ssi {
> + ssi0: ssi-0 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x01>, <&audma1 0x02>;
> + dma-names = "rx", "tx";
> + };
> + ssi1: ssi-1 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x03>, <&audma1 0x04>;
> + dma-names = "rx", "tx";
> + };
> + ssi2: ssi-2 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x05>, <&audma1 0x06>;
> + dma-names = "rx", "tx";
> + };
> + ssi3: ssi-3 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x07>, <&audma1 0x08>;
> + dma-names = "rx", "tx";
> + };
> + ssi4: ssi-4 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x09>, <&audma1 0x0a>;
> + dma-names = "rx", "tx";
> + };
> + ssi5: ssi-5 {
> + interrupts =  IRQ_TYPE_LEVEL_HIGH>;
> + dmas = <&audma0 0x0b>, <&audma1 0x0c>;
> +

Re: [PATCH] arm64: dts: renesas: r8a774c0: sort nodes

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 09:56:01PM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>* Sort by node address, grouping all nodes with the same compat string
>  and sorting the group alphabetically.
> Else
>* Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 



Re: [PATCH] arm64: dts: renesas: r8a774c0-cat874: sort nodes

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 09:55:41PM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>* Sort by node address, grouping all nodes with the same compat string
>  and sorting the group alphabetically.
> Else
>* Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko 

Thanks Kaneko-san,

I think that the i2c1_pins and hscif2_pins nodes
are also out of order.

I'm not sure if Geert would prefer you to respin or fix that himself.

In any case, with that problem resolved:

Reviewed-by: Simon Horman 

> ---
> 
> This patch is based on the master branch of Geert Uytterhoeven's renesas-devel
> tree.
> 
>  arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts 
> b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> index 651383c..aaa37158 100644
> --- a/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
> @@ -82,13 +82,13 @@
>   simple-audio-card,bitclock-master = <&sndcpu>;
>   simple-audio-card,frame-master = <&sndcpu>;
>  
> - sndcpu: simple-audio-card,cpu {
> - sound-dai = <&rcar_sound>;
> - };
> -
>   sndcodec: simple-audio-card,codec {
>   sound-dai = <&tda19988>;
>   };
> +
> + sndcpu: simple-audio-card,cpu {
> + sound-dai = <&rcar_sound>;
> + };
>   };
>  
>   vcc_sdhi0: regulator-vcc-sdhi0 {
> @@ -313,16 +313,16 @@
>   power-source = <1800>;
>   };
>  
> - sound_pins: sound {
> - groups = "ssi01239_ctrl", "ssi0_data";
> - function = "ssi";
> - };
> -
>   sound_clk_pins: sound_clk {
>   groups = "audio_clkout1_a";
>   function = "audio_clk";
>   };
>  
> + sound_pins: sound {
> + groups = "ssi01239_ctrl", "ssi0_data";
> + function = "ssi";
> + };
> +
>   usb30_pins: usb30 {
>   groups = "usb30", "usb30_id";
>   function = "usb30";
> -- 
> 1.9.1
> 


Re: [PATCH] arm64: dts: renesas: r8a774a1: sort nodes

2019-08-21 Thread Simon Horman
On Mon, Aug 19, 2019 at 09:54:55PM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>* Sort by node address, grouping all nodes with the same compat string
>  and sorting the group alphabetically.
> Else
>* Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Simon Horman 



Re: [PATCH] mmc: host: renesas_sdhi_sys_dmac: Remove all R-Car Gen3 SoCs

2019-08-20 Thread Simon Horman
On Tue, Aug 20, 2019 at 05:43:10PM +0900, Yoshihiro Shimoda wrote:
> All R-Car Gen3 SoCs with any ES version cannot use this DMAC actually.
> So, this patch removes the compatibles of R-Car Gen3 SoCs from
> renesas_sdhi_sys_dmac_of_match. Since the previous code has
> an empty whitelist to prevent probing of R-Car Gen3 SoCs,
> no behavior changes.
> 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Simon Horman 


[PATCH v2] dt-bindings: iio: light: isl29501: Rename bindings documentation file

2019-08-19 Thread Simon Horman
Rename the bindings documentation file for Renesas ISL29501 Time-of-flight
sensor from isl29501.txt to renesas,isl29501.txt.

This is part of an ongoing effort to name bindings documentation files for
Renesas IP blocks consistently, in line with the compat strings they
document.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1

v2
* Drop spurious top-level Makefile hunk
---
 .../devicetree/bindings/iio/light/{isl29501.txt => renesas,isl29501.txt}  | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename Documentation/devicetree/bindings/iio/light/{isl29501.txt => 
renesas,isl29501.txt} (100%)

diff --git a/Documentation/devicetree/bindings/iio/light/isl29501.txt 
b/Documentation/devicetree/bindings/iio/light/renesas,isl29501.txt
similarity index 100%
rename from Documentation/devicetree/bindings/iio/light/isl29501.txt
rename to Documentation/devicetree/bindings/iio/light/renesas,isl29501.txt
-- 
2.11.0



Re: [PATCH] dt-bindings: iio: light: isl29501: Rename bindings documentation file

2019-08-19 Thread Simon Horman
On Mon, Aug 19, 2019 at 04:01:05PM +0200, Simon Horman wrote:
> Rename the bindings documentation file for Renesas ISL29501 Time-of-flight
> sensor from isl29501.txt to renesas,isl29501.txt.
> 
> This is part of an ongoing effort to name bindings documentation files for
> Renesas IP blocks consistently, in line with the compat strings they
> document.
> 
> Signed-off-by: Simon Horman 
> ---
> Based on v5.3-rc1
> ---
>  .../bindings/iio/light/{isl29501.txt => renesas,isl29501.txt} | 0
>  Makefile  | 4 
> ++--

Sorry, I seem to have messed this up a bit: the Makefile portion should not
be there.  I'll shake things out and repost.


[PATCH] dt-bindings: iio: light: isl29501: Rename bindings documentation file

2019-08-19 Thread Simon Horman
Rename the bindings documentation file for Renesas ISL29501 Time-of-flight
sensor from isl29501.txt to renesas,isl29501.txt.

This is part of an ongoing effort to name bindings documentation files for
Renesas IP blocks consistently, in line with the compat strings they
document.

Signed-off-by: Simon Horman 
---
Based on v5.3-rc1
---
 .../bindings/iio/light/{isl29501.txt => renesas,isl29501.txt} | 0
 Makefile  | 4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename Documentation/devicetree/bindings/iio/light/{isl29501.txt => 
renesas,isl29501.txt} (100%)

diff --git a/Documentation/devicetree/bindings/iio/light/isl29501.txt 
b/Documentation/devicetree/bindings/iio/light/renesas,isl29501.txt
similarity index 100%
rename from Documentation/devicetree/bindings/iio/light/isl29501.txt
rename to Documentation/devicetree/bindings/iio/light/renesas,isl29501.txt
diff --git a/Makefile b/Makefile
index fd6f7949bc1a..9be5834073f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
-PATCHLEVEL = 2
+PATCHLEVEL = 3
 SUBLEVEL = 0
-EXTRAVERSION =
+EXTRAVERSION = -rc1
 NAME = Bobtail Squid
 
 # *DOCUMENTATION*
-- 
2.11.0



  1   2   3   4   5   6   7   8   9   10   >