Merge tag 'devicetree-for-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - A bunch of improvements in dt-check-style. Fix various bindings based on these additional checks. - Convert hisilicon,hix5hd2-ir, hisilicon,hi6220-ade, hisilicon,hi6220-dsi, hisilicon,hip05-sas-v1, MediaTek RT5650 codecs, mediatek,g3dsys, mediatek,mt2701-scpsys, ti,omap-mpu, and ti,omap-ocp2scp to DT schema format - Add schemas for ST STM32MP2 DWC3 xHCI USB, ST STM32MP25 USB2-FEMTO PHY, spacemit,k1-gpu and spacemit,k3-gpu, HiSilicon local bus, HiSilicon HIP05 CPLD, SDMC DM2016, and QCom SM7250 and Kuno PDC - Various binding updates to fix schema warnings in .dts files - Drop obsolete .txt bindings for STM32(MP1) RCC, VExpress hwmon and regulator, and mailbox.txt - Remove the unused of_overlay_remove_all() function - Fixes for of_check_msi_parent() - Add "i2c-parent" tracking to fw_devlink * tag 'devicetree-for-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (72 commits) dt-bindings: usb: dwc3: Document ST STM32MP2 DWC3 xHCI USB controller dt-bindings: iommu: Describe MT8195 infra IRQs dt-bindings: clock: mediatek: Add MT8516 fallbacks dt-bindings: media: Convert hisilicon,hix5hd2-ir to DT schema dt-bindings: display: Convert hisilicon,hi6220-ade to DT schema dt-bindings: display: Convert hisilicon,hi6220-dsi to DT schema dt-bindings: phy: Document ST STM32MP25 USB2-FEMTO PHY of: overlay: remove unused of_overlay_remove_all() dt-bindings: power: Convert mediatek,mt2701-scpsys to DT schema dt-bindings: bus: Add HiSilicon local bus dt-bindings: gpu: img,powervr-rogue: add spacemit,k1-gpu and spacemit,k3-gpu dt-bindings: interrupt-controller: qcom,pdc: Document SM7250 PDC dt-bindings: vendor-prefixes: add Ambarella dt-bindings: reset: Drop obsolete STM32(MP1) RCC bindings dt-bindings: arm: keystone: ti,sci: Correct reg and mboxes constraints dt-bindings: ASoC: Convert MediaTek RT5650 codecs bindings to DT schema dt-bindings: scsi: Convert hisilicon,hip05-sas-v1 to DT schema of/irq: Stop the MSI walk at the first msi-parent of/irq: Fix device node refcount leak in of_check_msi_parent() dt-bindings: display: faraday,tve200: Use a level-high interrupt ...
diff --git a/Documentation/devicetree/bindings/arm/arm,cci-400.yaml b/Documentation/devicetree/bindings/arm/arm,cci-400.yaml index d28303d..a4f086c 100644 --- a/Documentation/devicetree/bindings/arm/arm,cci-400.yaml +++ b/Documentation/devicetree/bindings/arm/arm,cci-400.yaml
@@ -45,7 +45,11 @@ properties: compatible: - const: arm,cci-400-ctrl-if + oneOf: + - const: arm,cci-400-ctrl-if + - items: + - const: arm,cci-400-ctrl-if + - const: syscon interface-type: enum:
diff --git a/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml b/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml index 949444a..f4101f9 100644 --- a/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml +++ b/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml
@@ -308,7 +308,7 @@ arm,trig-in-sigs = <0 1>; arm,trig-in-types = <PE_DBGTRIGGER PE_PMUIRQ>; - arm,trig-out-sigs = <0 1 2 >; + arm,trig-out-sigs = <0 1 2>; arm,trig-out-types = <PE_EDBGREQ PE_DBGRESTART PE_CTIIRQ>;
diff --git a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml index 25a2b42..052e239 100644 --- a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml +++ b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml
@@ -48,7 +48,7 @@ const: debug_messages reg: - minItems: 1 + maxItems: 1 mbox-names: description: | @@ -59,7 +59,7 @@ - const: tx mboxes: - minItems: 2 + maxItems: 2 ti,host-id: $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml index 9aa39b0..5ede7d2 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml
@@ -19,7 +19,7 @@ - enum: - mediatek,mt2701-audsys - mediatek,mt6765-audsys - - mediatek,mt6779-audsys + - mediatek,mt6779-audio - mediatek,mt7622-audsys - mediatek,mt8167-audsys - mediatek,mt8173-audsys
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt deleted file mode 100644 index 7de43bf..0000000 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt +++ /dev/null
@@ -1,30 +0,0 @@ -MediaTek g3dsys controller -============================ - -The MediaTek g3dsys controller provides various clocks and reset controller to -the GPU. - -Required Properties: - -- compatible: Should be: - - "mediatek,mt2701-g3dsys", "syscon": - for MT2701 SoC - - "mediatek,mt7623-g3dsys", "mediatek,mt2701-g3dsys", "syscon": - for MT7623 SoC -- #clock-cells: Must be 1 -- #reset-cells: Must be 1 - -The g3dsys controller uses the common clk binding from -Documentation/devicetree/bindings/clock/clock-bindings.txt -The available clocks are defined in dt-bindings/clock/mt*-clk.h. - -Example: - -g3dsys: clock-controller@13000000 { - compatible = "mediatek,mt7623-g3dsys", - "mediatek,mt2701-g3dsys", - "syscon"; - reg = <0 0x13000000 0 0x200>; - #clock-cells = <1>; - #reset-cells = <1>; -};
diff --git a/Documentation/devicetree/bindings/arm/omap/mpu.txt b/Documentation/devicetree/bindings/arm/omap/mpu.txt deleted file mode 100644 index e41490e..0000000 --- a/Documentation/devicetree/bindings/arm/omap/mpu.txt +++ /dev/null
@@ -1,54 +0,0 @@ -* TI - MPU (Main Processor Unit) subsystem - -The MPU subsystem contain one or several ARM cores -depending of the version. -The MPU contain CPUs, GIC, L2 cache and a local PRCM. - -Required properties: -- compatible : Should be "ti,omap3-mpu" for OMAP3 - Should be "ti,omap4-mpu" for OMAP4 - Should be "ti,omap5-mpu" for OMAP5 -- ti,hwmods: "mpu" - -Optional properties: -- sram: Phandle to the ocmcram node - -am335x and am437x only: -- pm-sram: Phandles to ocmcram nodes to be used for power management. - First should be type 'protect-exec' for the driver to use to copy - and run PM functions, second should be regular pool to be used for - data region for code. See Documentation/devicetree/bindings/sram/sram.yaml - for more details. - -Examples: - -- For an OMAP5 SMP system: - -mpu { - compatible = "ti,omap5-mpu"; - ti,hwmods = "mpu" -}; - -- For an OMAP4 SMP system: - -mpu { - compatible = "ti,omap4-mpu"; - ti,hwmods = "mpu"; -}; - - -- For an OMAP3 monocore system: - -mpu { - compatible = "ti,omap3-mpu"; - ti,hwmods = "mpu"; -}; - -- For an AM335x system: - -mpu { - compatible = "ti,omap3-mpu"; - ti,hwmods = "mpu"; - pm-sram = <&pm_sram_code - &pm_sram_data>; -};
diff --git a/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml b/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml new file mode 100644 index 0000000..abd8c64 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml
@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/ti/ti,omap-mpu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI MPU (Main Processor Unit) subsystem + +maintainers: + - Benoit Cousson <b-cousson@ti.com> + +description: + The MPU subsystem contains one or several ARM cores depending on the version. + The MPU contains CPUs, GIC, L2 cache and a local PRCM. + +properties: + compatible: + enum: + - ti,omap3-mpu + - ti,omap4-mpu + - ti,omap5-mpu + + ti,hwmods: + $ref: /schemas/types.yaml#/definitions/string + description: Name of the hwmod associated with the MPU + const: mpu + deprecated: true + + sram: + description: ocmcram node + + pm-sram: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: ocmcram nodes for power management. For am335x and am437x. + items: + - items: + - description: ocmcram node of type protect-exec for PM functions + - items: + - description: ocmcram node of regular pool to be used for data region + +required: + - compatible + +additionalProperties: false + +examples: + - | + mpu { + compatible = "ti,omap5-mpu"; + ti,hwmods = "mpu"; + }; + + - | + mpu { + compatible = "ti,omap3-mpu"; + ti,hwmods = "mpu"; + pm-sram = <&pm_sram_code &pm_sram_data>; + };
diff --git a/Documentation/devicetree/bindings/arm/vexpress-config.yaml b/Documentation/devicetree/bindings/arm/vexpress-config.yaml index 41c53e3..b04e8e0 100644 --- a/Documentation/devicetree/bindings/arm/vexpress-config.yaml +++ b/Documentation/devicetree/bindings/arm/vexpress-config.yaml
@@ -139,6 +139,10 @@ "^regulator-.+$": $ref: /schemas/regulator/regulator.yaml# + description: + If regulator-min-microvolt and regulator-max-microvolt do not both + define a range, the supply is treated as fixed and only its voltage + can be read. properties: compatible: const: arm,vexpress-volt
diff --git a/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml b/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml new file mode 100644 index 0000000..56f13e2 --- /dev/null +++ b/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml
@@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/hisilicon,hisi-localbus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon local bus + +maintainers: + - Wei Xu <xuwei5@hisilicon.com> + +allOf: + - $ref: /schemas/simple-bus.yaml# + +properties: + compatible: + items: + - const: hisilicon,hisi-localbus + - const: simple-bus + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + local-bus@80380000 { + compatible = "hisilicon,hisi-localbus", "simple-bus"; + reg = <0x0 0x80380000 0x0 0x10000>; + #address-cells = <2>; + #size-cells = <1>; + ranges = <0 0 0x0 0x90000000 0x08000000>, + <1 0 0x0 0x98000000 0x08000000>; + }; + };
diff --git a/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt b/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt deleted file mode 100644 index 18729f6..0000000 --- a/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt +++ /dev/null
@@ -1,29 +0,0 @@ -* OMAP OCP2SCP - ocp interface to scp interface - -properties: -- compatible : Should be "ti,am437x-ocp2scp" for AM437x processor - Should be "ti,omap-ocp2scp" for all others -- reg : Address and length of the register set for the device -- #address-cells, #size-cells : Must be present if the device has sub-nodes -- ranges : the child address space are mapped 1:1 onto the parent address space -- ti,hwmods : must be "ocp2scp_usb_phy" - -Sub-nodes: -All the devices connected to ocp2scp are described using sub-node to ocp2scp - -ocp2scp@4a0ad000 { - compatible = "ti,omap-ocp2scp"; - reg = <0x4a0ad000 0x1f>; - #address-cells = <1>; - #size-cells = <1>; - ranges; - ti,hwmods = "ocp2scp_usb_phy"; - - subnode1 { - ... - }; - - subnode2 { - ... - }; -};
diff --git a/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml b/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml new file mode 100644 index 0000000..a885218 --- /dev/null +++ b/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/ti,omap-ocp2scp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI OMAP OCP to SCP bus bridge + +maintainers: + - Kishon Vijay Abraham I <kishon@ti.com> + +properties: + compatible: + oneOf: + - items: + - const: ti,am437x-ocp2scp + - const: ti,omap-ocp2scp + - const: ti,omap-ocp2scp + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + + ti,hwmods: + $ref: /schemas/types.yaml#/definitions/string + description: Name of the hwmod associated with the device. + deprecated: true + +required: + - compatible + - "#address-cells" + - "#size-cells" + +allOf: + - if: + properties: + compatible: + contains: + const: ti,am437x-ocp2scp + then: + properties: + reg: false + else: + required: + - reg + +additionalProperties: + type: object + +examples: + - | + ocp2scp@4a0ad000 { + compatible = "ti,omap-ocp2scp"; + reg = <0x4a0ad000 0x1f>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + phy@80 { + compatible = "ti,omap-usb2"; + reg = <0x80 0x58>; + ctrl-module = <&omap_control_usb2phy>; + clocks = <&usb_phy_cm_clk32k>; + clock-names = "wkupclk"; + #phy-cells = <0>; + }; + };
diff --git a/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml b/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml index 591a9e8..438723d 100644 --- a/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml +++ b/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml
@@ -26,7 +26,6 @@ - mediatek,mt7988-apmixedsys - mediatek,mt8135-apmixedsys - mediatek,mt8173-apmixedsys - - mediatek,mt8516-apmixedsys - items: - const: mediatek,mt7623-apmixedsys - const: mediatek,mt2701-apmixedsys @@ -42,6 +41,7 @@ - mediatek,mt7629-apmixedsys - mediatek,mt8167-apmixedsys - mediatek,mt8183-apmixedsys + - mediatek,mt8516-apmixedsys - const: syscon reg:
diff --git a/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml b/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml index c080fb0..6594d49 100644 --- a/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml +++ b/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml
@@ -23,7 +23,6 @@ - mediatek,mt7622-topckgen - mediatek,mt8135-topckgen - mediatek,mt8173-topckgen - - mediatek,mt8516-topckgen - items: - const: mediatek,mt7623-topckgen - const: mediatek,mt2701-topckgen @@ -43,6 +42,7 @@ - mediatek,mt7988-topckgen - mediatek,mt8167-topckgen - mediatek,mt8183-topckgen + - mediatek,mt8516-topckgen - const: syscon reg:
diff --git a/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml b/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml index 17ea067..b869552 100644 --- a/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml +++ b/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml
@@ -128,7 +128,7 @@ cvcc12-supply = <&v1v2_hdmi>; #sound-dai-cells = <0>; - sil,i2s-data-lanes = < 0 1 2 >; + sil,i2s-data-lanes = <0 1 2>; clocks = <&mclk>; clock-names = "mclk";
diff --git a/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt b/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt deleted file mode 100644 index d270bfe..0000000 --- a/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt +++ /dev/null
@@ -1,72 +0,0 @@ -Device-Tree bindings for DesignWare DSI Host Controller v1.20a driver - -A DSI Host Controller resides in the middle of display controller and external -HDMI converter or panel. - -Required properties: -- compatible: value should be "hisilicon,hi6220-dsi". -- reg: physical base address and length of dsi controller's registers. -- clocks: contains APB clock phandle + clock-specifier pair. -- clock-names: should be "pclk". -- ports: contains DSI controller input and output sub port. - The input port connects to ADE output port with the reg value "0". - The output port with the reg value "1", it could connect to panel or - any other bridge endpoints. - See Documentation/devicetree/bindings/graph.txt for more device graph info. - -A example of HiKey board hi6220 SoC and board specific DT entry: -Example: - -SoC specific: - dsi: dsi@f4107800 { - compatible = "hisilicon,hi6220-dsi"; - reg = <0x0 0xf4107800 0x0 0x100>; - clocks = <&media_ctrl HI6220_DSI_PCLK>; - clock-names = "pclk"; - status = "disabled"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - /* 0 for input port */ - port@0 { - reg = <0>; - dsi_in: endpoint { - remote-endpoint = <&ade_out>; - }; - }; - }; - }; - - -Board specific: - &dsi { - status = "ok"; - - ports { - /* 1 for output port */ - port@1 { - reg = <1>; - - dsi_out0: endpoint@0 { - remote-endpoint = <&adv7533_in>; - }; - }; - }; - }; - - &i2c2 { - ... - - adv7533: adv7533@39 { - ... - - port { - adv7533_in: endpoint { - remote-endpoint = <&dsi_out0>; - }; - }; - }; - }; -
diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt b/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt deleted file mode 100644 index 305a0e7..0000000 --- a/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt +++ /dev/null
@@ -1,64 +0,0 @@ -Device-Tree bindings for hisilicon ADE display controller driver - -ADE (Advanced Display Engine) is the display controller which grab image -data from memory, do composition, do post image processing, generate RGB -timing stream and transfer to DSI. - -Required properties: -- compatible: value should be "hisilicon,hi6220-ade". -- reg: physical base address and length of the ADE controller's registers. -- hisilicon,noc-syscon: ADE NOC QoS syscon. -- resets: The ADE reset controller node. -- interrupt: the ldi vblank interrupt number used. -- clocks: a list of phandle + clock-specifier pairs, one for each entry - in clock-names. -- clock-names: should contain: - "clk_ade_core" for the ADE core clock. - "clk_codec_jpeg" for the media NOC QoS clock, which use the same clock with - jpeg codec. - "clk_ade_pix" for the ADE pixel clock. -- assigned-clocks: Should contain "clk_ade_core" and "clk_codec_jpeg" clocks' - phandle + clock-specifier pairs. -- assigned-clock-rates: clock rates, one for each entry in assigned-clocks. - The rate of "clk_ade_core" could be "360000000" or "180000000"; - The rate of "clk_codec_jpeg" could be or less than "1440000000". - These rate values could be configured according to performance and power - consumption. -- port: the output port. This contains one endpoint subnode, with its - remote-endpoint set to the phandle of the connected DSI input endpoint. - See Documentation/devicetree/bindings/graph.txt for more device graph info. - -Optional properties: -- dma-coherent: Present if dma operations are coherent. - - -A example of HiKey board hi6220 SoC specific DT entry: -Example: - - ade: ade@f4100000 { - compatible = "hisilicon,hi6220-ade"; - reg = <0x0 0xf4100000 0x0 0x7800>; - reg-names = "ade_base"; - hisilicon,noc-syscon = <&medianoc_ade>; - resets = <&media_ctrl MEDIA_ADE>; - interrupts = <0 115 4>; /* ldi interrupt */ - - clocks = <&media_ctrl HI6220_ADE_CORE>, - <&media_ctrl HI6220_CODEC_JPEG>, - <&media_ctrl HI6220_ADE_PIX_SRC>; - /*clock name*/ - clock-names = "clk_ade_core", - "clk_codec_jpeg", - "clk_ade_pix"; - - assigned-clocks = <&media_ctrl HI6220_ADE_CORE>, - <&media_ctrl HI6220_CODEC_JPEG>; - assigned-clock-rates = <360000000>, <288000000>; - dma-coherent; - - port { - ade_out: endpoint { - remote-endpoint = <&dsi_in>; - }; - }; - };
diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml new file mode 100644 index 0000000..ec3d4b7 --- /dev/null +++ b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml
@@ -0,0 +1,95 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/hisilicon/hisilicon,hi6220-ade.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon ADE Display Controller + +maintainers: + - Xinliang Liu <z.liuxinliang@hisilicon.com> + +description: + ADE (Advanced Display Engine) is the display controller which grab image + data from memory, do composition, do post image processing, generate RGB + timing stream and transfer to DSI. + +properties: + compatible: + const: hisilicon,hi6220-ade + + reg: + maxItems: 1 + + reg-names: + items: + - const: ade_base + + clocks: + maxItems: 3 + + clock-names: + items: + - const: clk_ade_core + - const: clk_codec_jpeg + - const: clk_ade_pix + + dma-coherent: true + + interrupts: + items: + - description: LDI vblank interrupt specifier. + + resets: + maxItems: 1 + + hisilicon,noc-syscon: + description: ADE NOC QoS syscon. + $ref: /schemas/types.yaml#/definitions/phandle + + port: + $ref: /schemas/graph.yaml#/properties/port + description: Output port containing an endpoint subnode. + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - interrupts + - resets + - hisilicon,noc-syscon + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/hi6220-clock.h> + #include <dt-bindings/reset/hisi,hi6220-resets.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + + ade@f4100000 { + compatible = "hisilicon,hi6220-ade"; + reg = <0x0 0xf4100000 0x0 0x7800>; + reg-names = "ade_base"; + clocks = <&media_ctrl HI6220_ADE_CORE>, + <&media_ctrl HI6220_CODEC_JPEG>, + <&media_ctrl HI6220_ADE_PIX_SRC>; + clock-names = "clk_ade_core", "clk_codec_jpeg", "clk_ade_pix"; + dma-coherent; + interrupts = <0 115 4>; + resets = <&media_ctrl MEDIA_ADE>; + hisilicon,noc-syscon = <&medianoc_ade>; + + port { + endpoint { + remote-endpoint = <&dsi_in>; + }; + }; + }; + };
diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml new file mode 100644 index 0000000..868ab18 --- /dev/null +++ b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml
@@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/hisilicon/hisilicon,hi6220-dsi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon DesignWare DSI Host Controller + +maintainers: + - Xinliang Liu <z.liuxinliang@hisilicon.com> + +properties: + compatible: + const: hisilicon,hi6220-dsi + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: pclk + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + description: Input port, connects to ADE output endpoint. + $ref: /schemas/graph.yaml#/properties/port + + port@1: + description: Output port, connects to panel or bridge endpoints. + $ref: /schemas/graph.yaml#/properties/port + +required: + - compatible + - reg + - clocks + - clock-names + - ports + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/hi6220-clock.h> + + dsi@f4107800 { + compatible = "hisilicon,hi6220-dsi"; + reg = <0xf4107800 0x100>; + clocks = <&media_ctrl HI6220_DSI_PCLK>; + clock-names = "pclk"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dsi_in: endpoint { + remote-endpoint = <&ade_out>; + }; + }; + }; + };
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml index bd8f7b8..966127e 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
@@ -15,10 +15,13 @@ properties: compatible: - enum: - - mediatek,mt7623-hdmi-ddc - - mediatek,mt8167-hdmi-ddc - - mediatek,mt8173-hdmi-ddc + oneOf: + - const: mediatek,mt8173-hdmi-ddc + - items: + - enum: + - mediatek,mt7623-hdmi-ddc + - mediatek,mt8167-hdmi-ddc + - const: mediatek,mt8173-hdmi-ddc reg: maxItems: 1
diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Documentation/devicetree/bindings/dts-coding-style.rst index 63648db..441436b 100644 --- a/Documentation/devicetree/bindings/dts-coding-style.rst +++ b/Documentation/devicetree/bindings/dts-coding-style.rst
@@ -135,8 +135,9 @@ 3. Status is the last information to annotate that device node is or is not finished (board resources are needed). -The individual properties inside each group shall use natural sort order by -the property name. +The individual properties inside each group shall use usually natural sort +order by the property name, with exceptions of logical grouping of properties, +e.g. supplies. Example::
diff --git a/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml b/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml index 3c44fe6..acdc5c1 100644 --- a/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +++ b/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml
@@ -18,11 +18,9 @@ which can create the interprocessor communication (IPC) between the CPU and BPMP. - This node is a mailbox consumer. See the following files for details - of the mailbox subsystem, and the specifiers implemented by the - relevant provider(s): + This node is a mailbox consumer. See the following file for details + of the mailbox specifiers implemented by the relevant provider(s): - - .../mailbox/mailbox.txt - .../mailbox/nvidia,tegra186-hsp.yaml This node is a clock, power domain, and reset provider. See the
diff --git a/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml index e3e668a..698cc14 100644 --- a/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml
@@ -14,7 +14,7 @@ details see ../mfd/delta,tn48m-cpld.yaml. Delta TN48M has an onboard Lattice CPLD that is used as an GPIO expander. - It provides 12 pins in total, they are input-only or ouput-only type. + It provides 12 pins in total, they are input-only or output-only type. properties: compatible:
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml index c8d0d91..d68fe8c 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml
@@ -112,7 +112,13 @@ maxItems: 1 resets: - maxItems: 1 + minItems: 1 + maxItems: 2 + + reset-names: + items: + - const: ao_g3d + - const: media_g3d operating-points-v2: true @@ -134,6 +140,23 @@ properties: compatible: contains: + const: hisilicon,hi6220-mali + then: + properties: + resets: + minItems: 2 + required: + - reset-names + else: + properties: + resets: + maxItems: 1 + reset-names: false + + - if: + properties: + compatible: + contains: enum: - allwinner,sun4i-a10-mali - allwinner,sun7i-a20-mali
diff --git a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml index e9218e0..600445c 100644 --- a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml +++ b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
@@ -37,6 +37,12 @@ - const: img,img-rogue - items: - enum: + - spacemit,k1-gpu + - const: img,img-bxe-2-32 + - const: img,img-rogue + - items: + - enum: + - spacemit,k3-gpu - thead,th1520-gpu - const: img,img-bxm-4-64 - const: img,img-rogue @@ -102,6 +108,8 @@ compatible: contains: enum: + - spacemit,k1-gpu + - spacemit,k3-gpu - ti,am62-gpu - ti,am62p-gpu - ti,j721s2-gpu @@ -162,13 +170,16 @@ properties: compatible: contains: - const: thead,th1520-gpu + enum: + - spacemit,k1-gpu + - spacemit,k3-gpu + - thead,th1520-gpu then: properties: power-domains: items: - - description: The single, unified power domain for the GPU on the - TH1520 SoC, integrating all internal IP power domains. + - description: The single, unified power domain for the GPU, + integrating all internal IP power domains. power-domain-names: false required: - power-domains
diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml index 1ff44cb..2210764 100644 --- a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml
@@ -49,7 +49,7 @@ shunt-resistor-micro-ohms: description: - The value of curent sense resistor in micro ohms. Pin configuration is + The value of current sense resistor in micro ohms. Pin configuration is set for differential input pair. adi,temperature-enable:
diff --git a/Documentation/devicetree/bindings/hwmon/vexpress.txt b/Documentation/devicetree/bindings/hwmon/vexpress.txt deleted file mode 100644 index 4a4df4ffc..0000000 --- a/Documentation/devicetree/bindings/hwmon/vexpress.txt +++ /dev/null
@@ -1,23 +0,0 @@ -Versatile Express hwmon sensors -------------------------------- - -Requires node properties: -- "compatible" value : one of - "arm,vexpress-volt" - "arm,vexpress-amp" - "arm,vexpress-temp" - "arm,vexpress-power" - "arm,vexpress-energy" -- "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg - (see Documentation/devicetree/bindings/arm/vexpress-config.yaml - for more details) - -Optional node properties: -- label : string describing the monitored value - -Example: - energy@0 { - compatible = "arm,vexpress-energy"; - arm,vexpress-sysreg,func = <13 0>; - label = "A15 Jcore"; - };
diff --git a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml index d1f26d5..57caebe 100644 --- a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml +++ b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml
@@ -52,8 +52,8 @@ axi_iic_0: i2c@40800000 { compatible = "xlnx,xps-iic-2.00.a"; clocks = <&clkc 15>; - interrupts = < 1 2 >; - reg = < 0x40800000 0x10000 >; + interrupts = <1 2>; + reg = <0x40800000 0x10000>; #size-cells = <0>; #address-cells = <1>;
diff --git a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml index dd78abe..979d7e7 100644 --- a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml +++ b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
@@ -69,7 +69,7 @@ light-sensor@39 { compatible = "upisemi,usd5182"; reg = <0x39>; - upisemi,glass-coef = < 1000 >; + upisemi,glass-coef = <1000>; upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>; upisemi,upper-dark-gain = /bits/ 8 <0x00>; upisemi,lower-dark-gain = /bits/ 8 <0x16>;
diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.yaml b/Documentation/devicetree/bindings/input/matrix-keymap.yaml index ce910e4..bef8f98 100644 --- a/Documentation/devicetree/bindings/input/matrix-keymap.yaml +++ b/Documentation/devicetree/bindings/input/matrix-keymap.yaml
@@ -41,8 +41,7 @@ - | keypad { /* ... */ - linux,keymap = < 0x00030012 - 0x0102003a >; + linux,keymap = <0x00030012 0x0102003a>; keypad,num-rows = <2>; keypad,num-columns = <8>; };
diff --git a/Documentation/devicetree/bindings/input/ti,tca8418.yaml b/Documentation/devicetree/bindings/input/ti,tca8418.yaml index 624a183..a8897c5 100644 --- a/Documentation/devicetree/bindings/input/ti,tca8418.yaml +++ b/Documentation/devicetree/bindings/input/ti,tca8418.yaml
@@ -46,16 +46,15 @@ interrupts = <11 IRQ_TYPE_EDGE_FALLING>; keypad,num-rows = <4>; keypad,num-columns = <4>; - linux,keymap = < MATRIX_KEY(0x00, 0x01, BTN_0) - MATRIX_KEY(0x00, 0x00, BTN_1) - MATRIX_KEY(0x01, 0x01, BTN_2) - MATRIX_KEY(0x01, 0x00, BTN_3) - MATRIX_KEY(0x02, 0x00, BTN_4) - MATRIX_KEY(0x00, 0x03, BTN_5) - MATRIX_KEY(0x00, 0x02, BTN_6) - MATRIX_KEY(0x01, 0x03, BTN_7) - MATRIX_KEY(0x01, 0x02, BTN_8) - MATRIX_KEY(0x02, 0x02, BTN_9) - >; + linux,keymap = <MATRIX_KEY(0x00, 0x01, BTN_0) + MATRIX_KEY(0x00, 0x00, BTN_1) + MATRIX_KEY(0x01, 0x01, BTN_2) + MATRIX_KEY(0x01, 0x00, BTN_3) + MATRIX_KEY(0x02, 0x00, BTN_4) + MATRIX_KEY(0x00, 0x03, BTN_5) + MATRIX_KEY(0x00, 0x02, BTN_6) + MATRIX_KEY(0x01, 0x03, BTN_7) + MATRIX_KEY(0x01, 0x02, BTN_8) + MATRIX_KEY(0x02, 0x02, BTN_9)>; }; };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml index 6427385..294af57 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml
@@ -12,8 +12,9 @@ description: This binding specifies what properties must be available in the device tree representation of an Open PIC compliant interrupt controller. This binding is - based on the binding defined for Open PIC in [1] and is a superset of that - binding. + based on the binding defined for Open PIC in the Devicetree Specification + (available from https://www.devicetree.org/specifications/) and is a superset + of that binding. properties: compatible: @@ -24,7 +25,7 @@ - const: chrp,open-pic device_type: - const: open-pci + const: open-pic deprecated: true reg:
diff --git a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml index b3d19c8..8401d3b 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml
@@ -30,6 +30,7 @@ - qcom,glymur-pdc - qcom,hawi-pdc - qcom,kaanapali-pdc + - qcom,kuno-pdc - qcom,maili-pdc - qcom,milos-pdc - qcom,nord-pdc @@ -50,6 +51,7 @@ - qcom,sdx75-pdc - qcom,sm4450-pdc - qcom,sm6350-pdc + - qcom,sm7250-pdc - qcom,sm8150-pdc - qcom,sm8250-pdc - qcom,sm8350-pdc
diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml index 79c573c..cbda221 100644 --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -100,7 +100,10 @@ maxItems: 1 interrupts: - maxItems: 1 + minItems: 1 + maxItems: 5 + description: + A single interrupt or one interrupt per bank. clocks: items: @@ -159,6 +162,19 @@ properties: compatible: contains: + const: mediatek,mt8195-iommu-infra + then: + properties: + interrupts: + minItems: 5 + else: + properties: + interrupts: + maxItems: 1 + - if: + properties: + compatible: + contains: enum: - mediatek,mt2701-m4u - mediatek,mt2712-m4u
diff --git a/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml b/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml index 87d3196..f58b0d4 100644 --- a/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml
@@ -17,9 +17,6 @@ hold four 32-bit messages; when a FIFO is full, clients must wait before attempting more transmissions. - Refer to ./mailbox.txt for generic information about mailbox device-tree - bindings. - properties: compatible: oneOf:
diff --git a/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt b/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt index c4dd93f..87749d2 100644 --- a/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt
@@ -31,12 +31,12 @@ Mailbox client =============== -"mboxes" and the optional "mbox-names" (please see -Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value -of the mboxes property should contain a phandle to the mailbox controller -device node and second argument is the channel index. It must be 0 (hardware -support only one channel).The equivalent "mbox-names" property value can be -used to give a name to the communication channel to be used by the client user. +The common mailbox binding properties "mboxes" and the optional "mbox-names" +can be used. Each value of the mboxes property should contain a phandle to +the mailbox controller device node and second argument is the channel index. +It must be 0 (hardware support only one channel). The equivalent "mbox-names" +property value can be used to give a name to the communication channel to be +used by the client user. Example: mclient0: mclient0@400 {
diff --git a/Documentation/devicetree/bindings/mailbox/mailbox.txt b/Documentation/devicetree/bindings/mailbox/mailbox.txt deleted file mode 100644 index af8ecee..0000000 --- a/Documentation/devicetree/bindings/mailbox/mailbox.txt +++ /dev/null
@@ -1,60 +0,0 @@ -* Generic Mailbox Controller and client driver bindings - -Generic binding to provide a way for Mailbox controller drivers to -assign appropriate mailbox channel to client drivers. - -* Mailbox Controller - -Required property: -- #mbox-cells: Must be at least 1. Number of cells in a mailbox - specifier. - -Example: - mailbox: mailbox { - ... - #mbox-cells = <1>; - }; - - -* Mailbox Client - -Required property: -- mboxes: List of phandle and mailbox channel specifiers. - -Optional property: -- mbox-names: List of identifier strings for each mailbox channel. -- shmem : List of phandle pointing to the shared memory(SHM) area between the - users of these mailboxes for IPC, one for each mailbox. This shared - memory can be part of any memory reserved for the purpose of this - communication between the mailbox client and the remote. - - -Example: - pwr_cntrl: power { - ... - mbox-names = "pwr-ctrl", "rpc"; - mboxes = <&mailbox 0 &mailbox 1>; - }; - -Example with shared memory(shmem): - - sram: sram@50000000 { - compatible = "mmio-sram"; - reg = <0x50000000 0x10000>; - - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x50000000 0x10000>; - - cl_shmem: shmem@0 { - compatible = "client-shmem"; - reg = <0x0 0x200>; - }; - }; - - client@2e000000 { - ... - mboxes = <&mailbox 0>; - shmem = <&cl_shmem>; - .. - };
diff --git a/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml index 8504ceb..7e3b7b6 100644 --- a/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml
@@ -53,8 +53,7 @@ ============== A device needing to communicate with a target processor device should specify them using the common mailbox binding properties, "mboxes" and the optional - "mbox-names" (please see Documentation/devicetree/bindings/mailbox/mailbox.txt - for details). Each value of the mboxes property should contain a phandle to + "mbox-names". Each value of the mboxes property should contain a phandle to the mailbox controller device node and an args specifier that will be the phandle to the intended sub-mailbox child node to be used for communication. The equivalent "mbox-names" property value can be used to give a name to the
diff --git a/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml index b0129be..2f11e5f 100644 --- a/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml +++ b/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml
@@ -96,8 +96,8 @@ <0x0 0xff01a000 0x0 0x100>; reg-names = "aphy", "dphy", "host"; power-domains = <&pwrc PWRC_C3_MIPI_ISP_WRAP_ID>; - clocks = <&clkc_periphs CLKID_VAPB>, - <&clkc_periphs CLKID_CSI_PHY0>; + clocks = <&clkc_periphs CLKID_VAPB>, + <&clkc_periphs CLKID_CSI_PHY0>; clock-names = "vapb", "phy0"; assigned-clocks = <&clkc_periphs CLKID_VAPB>, <&clkc_periphs CLKID_CSI_PHY0>;
diff --git a/Documentation/devicetree/bindings/media/arm,mali-c55.yaml b/Documentation/devicetree/bindings/media/arm,mali-c55.yaml index fc4fcd1..39af7ff 100644 --- a/Documentation/devicetree/bindings/media/arm,mali-c55.yaml +++ b/Documentation/devicetree/bindings/media/arm,mali-c55.yaml
@@ -79,7 +79,7 @@ port { isp_in: endpoint { - remote-endpoint = <&csi2_rx_out>; + remote-endpoint = <&csi2_rx_out>; }; }; };
diff --git a/Documentation/devicetree/bindings/media/atmel,isc.yaml b/Documentation/devicetree/bindings/media/atmel,isc.yaml index dc8aba69..5c84f37 100644 --- a/Documentation/devicetree/bindings/media/atmel,isc.yaml +++ b/Documentation/devicetree/bindings/media/atmel,isc.yaml
@@ -102,12 +102,12 @@ clock-output-names = "isc-mck"; port { - isc_0: endpoint { - remote-endpoint = <&ov7740_0>; - hsync-active = <1>; - vsync-active = <0>; - pclk-sample = <1>; - bus-width = <8>; - }; + isc_0: endpoint { + remote-endpoint = <&ov7740_0>; + hsync-active = <1>; + vsync-active = <0>; + pclk-sample = <1>; + bus-width = <8>; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml index 5fb5d60..bfec4da 100644 --- a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml
@@ -117,11 +117,11 @@ power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; brcm,num-data-lanes = <2>; port { - csi1_ep: endpoint { - remote-endpoint = <&imx219_0>; - bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>; - data-lanes = <1 2>; - }; + csi1_ep: endpoint { + remote-endpoint = <&imx219_0>; + bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>; + data-lanes = <1 2>; + }; }; }; ...
diff --git a/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml b/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml index 6ed9a56..cbc6249 100644 --- a/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml +++ b/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml
@@ -160,50 +160,50 @@ phy-names = "dphy"; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - csi2rx_in_sensor: endpoint { - remote-endpoint = <&sensor_out_csi2rx>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; + csi2rx_in_sensor: endpoint { + remote-endpoint = <&sensor_out_csi2rx>; + clock-lanes = <0>; + data-lanes = <1 2>; }; + }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - csi2rx_out_grabber0: endpoint { - remote-endpoint = <&grabber0_in_csi2rx>; - }; + csi2rx_out_grabber0: endpoint { + remote-endpoint = <&grabber0_in_csi2rx>; }; + }; - port@2 { - reg = <2>; + port@2 { + reg = <2>; - csi2rx_out_grabber1: endpoint { - remote-endpoint = <&grabber1_in_csi2rx>; - }; + csi2rx_out_grabber1: endpoint { + remote-endpoint = <&grabber1_in_csi2rx>; }; + }; - port@3 { - reg = <3>; + port@3 { + reg = <3>; - csi2rx_out_grabber2: endpoint { - remote-endpoint = <&grabber2_in_csi2rx>; - }; + csi2rx_out_grabber2: endpoint { + remote-endpoint = <&grabber2_in_csi2rx>; }; + }; - port@4 { - reg = <4>; + port@4 { + reg = <4>; - csi2rx_out_grabber3: endpoint { - remote-endpoint = <&grabber3_in_csi2rx>; - }; + csi2rx_out_grabber3: endpoint { + remote-endpoint = <&grabber3_in_csi2rx>; }; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml b/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml new file mode 100644 index 0000000..cd836f2 --- /dev/null +++ b/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml
@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/hisilicon,hix5hd2-ir.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HIX5HD2 IR controller + +maintainers: + - Wei Xu <xuwei5@hisilicon.com> + +allOf: + - $ref: rc.yaml# + +properties: + compatible: + items: + - enum: + - hisilicon,hix5hd2-ir + - hisilicon,hi3796cv300-ir + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + hisilicon,power-syscon: + description: Provide correct clocks instead. + $ref: /schemas/types.yaml#/definitions/phandle + deprecated: true + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + ir@f8001000 { + compatible = "hisilicon,hix5hd2-ir"; + reg = <0xf8001000 0x1000>; + interrupts = <0 47 4>; + clocks = <&clock 0>; + linux,rc-map-name = "rc-tivo"; + };
diff --git a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt b/Documentation/devicetree/bindings/media/hix5hd2-ir.txt deleted file mode 100644 index ca4cf77..0000000 --- a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt +++ /dev/null
@@ -1,26 +0,0 @@ -Device-Tree bindings for hix5hd2 ir IP - -Required properties: - - compatible: Should contain "hisilicon,hix5hd2-ir", or: - - "hisilicon,hi3796cv300-ir" for Hi3796CV300 IR device. - - reg: Base physical address of the controller and length of memory - mapped region. - - interrupts: interrupt-specifier for the sole interrupt generated by - the device. The interrupt specifier format depends on the interrupt - controller parent. - - clocks: clock phandle and specifier pair. - -Optional properties: - - linux,rc-map-name: see rc.txt file in the same directory. - - hisilicon,power-syscon: DEPRECATED. Don't use this in new dts files. - Provide correct clocks instead. - -Example node: - - ir: ir@f8001000 { - compatible = "hisilicon,hix5hd2-ir"; - reg = <0xf8001000 0x1000>; - interrupts = <0 47 4>; - clocks = <&clock HIX5HD2_IR_CLOCK>; - linux,rc-map-name = "rc-tivo"; - };
diff --git a/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml b/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml index 0e7a7b5..99d728c 100644 --- a/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml +++ b/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml
@@ -88,7 +88,7 @@ #size-cells = <0>; sensor@37 { - compatible = "galaxycore,gc05a2"; + compatible = "galaxycore,gc05a2"; reg = <0x37>; clocks = <&gc05a2_clk>;
diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml index 634d3b8..83f84a7 100644 --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml
@@ -90,22 +90,22 @@ #size-cells = <0>; ov2680: camera-sensor@36 { - compatible = "ovti,ov2680"; - reg = <0x36>; - clocks = <&osc>; - clock-names = "xvclk"; - reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + compatible = "ovti,ov2680"; + reg = <0x36>; + clocks = <&osc>; + clock-names = "xvclk"; + reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - DOVDD-supply = <&sw2_reg>; - DVDD-supply = <&sw2_reg>; - AVDD-supply = <®_peri_3p15v>; + DOVDD-supply = <&sw2_reg>; + DVDD-supply = <&sw2_reg>; + AVDD-supply = <®_peri_3p15v>; - port { - ov2680_to_mipi: endpoint { - remote-endpoint = <&mipi_from_sensor>; - link-frequencies = /bits/ 64 <330000000>; - }; + port { + ov2680_to_mipi: endpoint { + remote-endpoint = <&mipi_from_sensor>; + link-frequencies = /bits/ 64 <330000000>; }; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml index 814fc568..b6b5145 100644 --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml
@@ -94,9 +94,9 @@ port { camera_out: endpoint { - data-lanes = <1 2>; - link-frequencies = /bits/ 64 <360000000>; - remote-endpoint = <&mipi_in_camera>; + data-lanes = <1 2>; + link-frequencies = /bits/ 64 <360000000>; + remote-endpoint = <&mipi_in_camera>; }; }; };
diff --git a/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml b/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml index 085020c..b6f8009 100644 --- a/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml +++ b/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml
@@ -61,15 +61,15 @@ #include <dt-bindings/interrupt-controller/irq.h> soc { - #address-cells = <2>; - #size-cells = <2>; - jpeg-encoder@fd20000 { - compatible = "img,e5010-jpeg-enc"; - reg = <0x00 0xfd20000 0x00 0x100>, - <0x00 0xfd20200 0x00 0x200>; - reg-names = "core", "mmu"; - clocks = <&k3_clks 201 0>; - power-domains = <&k3_pds 201 TI_SCI_PD_EXCLUSIVE>; - interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; - }; + #address-cells = <2>; + #size-cells = <2>; + jpeg-encoder@fd20000 { + compatible = "img,e5010-jpeg-enc"; + reg = <0x00 0xfd20000 0x00 0x100>, + <0x00 0xfd20200 0x00 0x200>; + reg-names = "core", "mmu"; + clocks = <&k3_clks 201 0>; + power-domains = <&k3_pds 201 TI_SCI_PD_EXCLUSIVE>; + interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; + }; };
diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml index 4505e66..551e483 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
@@ -160,7 +160,7 @@ vcodec_enc_vp8: vcodec@19002000 { compatible = "mediatek,mt8173-vcodec-enc-vp8"; - reg = <0x19002000 0x1000>; /* VENC_LT_SYS */ + reg = <0x19002000 0x1000>; /* VENC_LT_SYS */ interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_LOW>; iommus = <&iommu M4U_PORT_VENC_RCPU_SET2>, <&iommu M4U_PORT_VENC_REC_FRM_SET2>,
diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml index 654360c..0f5c397 100644 --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
@@ -106,8 +106,8 @@ compatible = "mediatek,mt2701-jpgdec"; reg = <0x15004000 0x1000>; interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_LOW>; - clocks = <&imgsys CLK_IMG_JPGDEC_SMI>, - <&imgsys CLK_IMG_JPGDEC>; + clocks = <&imgsys CLK_IMG_JPGDEC_SMI>, + <&imgsys CLK_IMG_JPGDEC>; clock-names = "jpgdec-smi", "jpgdec"; power-domains = <&scpsys MT2701_POWER_DOMAIN_ISP>;
diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml index d2f0357..1f636bc 100644 --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
@@ -93,7 +93,7 @@ "mediatek,mtk-jpgenc"; reg = <0x1500a000 0x1000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_LOW>; - clocks = <&imgsys CLK_IMG_VENC>; + clocks = <&imgsys CLK_IMG_VENC>; clock-names = "jpgenc"; power-domains = <&scpsys MT2701_POWER_DOMAIN_ISP>; iommus = <&iommu MT2701_M4U_PORT_JPGENC_RDMA>,
diff --git a/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml b/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml index b3a345f..d069876 100644 --- a/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml +++ b/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml
@@ -149,22 +149,22 @@ clock-names = "pclk", "scck"; ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; /* must be 0, first child port */ - csi2dc_in: endpoint { /* input from IDI interface */ - bus-type = <4>; /* MIPI CSI2 D-PHY */ - remote-endpoint = <&csi2host_out>; - }; - }; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; /* must be 0, first child port */ + csi2dc_in: endpoint { /* input from IDI interface */ + bus-type = <4>; /* MIPI CSI2 D-PHY */ + remote-endpoint = <&csi2host_out>; + }; + }; - port@1 { - reg = <1>; /* must be 1, second child port */ - csi2dc_out: endpoint { - remote-endpoint = <&xisc_in>; /* output to sensor controller */ - }; - }; + port@1 { + reg = <1>; /* must be 1, second child port */ + csi2dc_out: endpoint { + remote-endpoint = <&xisc_in>; /* output to sensor controller */ + }; + }; }; }; @@ -181,18 +181,18 @@ dma-names = "rx"; ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; /* must be 0, first child port */ - csi2dc_input: endpoint { /* input from IDI interface */ - remote-endpoint = <&csi2host_out>; - }; - }; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; /* must be 0, first child port */ + csi2dc_input: endpoint { /* input from IDI interface */ + remote-endpoint = <&csi2host_out>; + }; + }; - port@1 { - reg = <1>; - }; + port@1 { + reg = <1>; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/microchip,xisc.yaml b/Documentation/devicetree/bindings/media/microchip,xisc.yaml index 25f5f79..6a9e56c 100644 --- a/Documentation/devicetree/bindings/media/microchip,xisc.yaml +++ b/Documentation/devicetree/bindings/media/microchip,xisc.yaml
@@ -118,12 +118,12 @@ clock-output-names = "isc-mck"; port { - xisc_in: endpoint { - bus-type = <MEDIA_BUS_TYPE_PARALLEL>; - remote-endpoint = <&csi2dc_out>; - hsync-active = <1>; - vsync-active = <1>; - bus-width = <12>; - }; + xisc_in: endpoint { + bus-type = <MEDIA_BUS_TYPE_PARALLEL>; + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml index 6ba668a..4727dd7 100644 --- a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml +++ b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml
@@ -95,7 +95,7 @@ jpegdec: jpegdec@58400000 { compatible = "nxp,imx8qxp-jpgdec"; - reg = <0x58400000 0x00050000 >; + reg = <0x58400000 0x00050000>; clocks = <&img_jpeg_dec_lpcg IMX_LPCG_CLK_0>, <&img_jpeg_dec_lpcg IMX_LPCG_CLK_4>; interrupts = <GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>, @@ -111,7 +111,7 @@ jpegenc: jpegenc@58450000 { compatible = "nxp,imx8qm-jpgenc", "nxp,imx8qxp-jpgenc"; - reg = <0x58450000 0x00050000 >; + reg = <0x58450000 0x00050000>; clocks = <&img_jpeg_enc_lpcg IMX_LPCG_CLK_0>, <&img_jpeg__lpcg IMX_LPCG_CLK_4>; interrupts = <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>,
diff --git a/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml b/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml index 56c1645..389b545 100644 --- a/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml +++ b/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml
@@ -119,26 +119,26 @@ <&mmcc VIDEO_MAXI_CLK>; clock-names = "core", "iface", "bus", "mbus"; power-domains = <&mmcc VENUS_GDSC>; - iommus = <&venus_smmu 0x00>, - <&venus_smmu 0x01>, - <&venus_smmu 0x0a>, - <&venus_smmu 0x07>, - <&venus_smmu 0x0e>, - <&venus_smmu 0x0f>, - <&venus_smmu 0x08>, - <&venus_smmu 0x09>, - <&venus_smmu 0x0b>, - <&venus_smmu 0x0c>, - <&venus_smmu 0x0d>, - <&venus_smmu 0x10>, - <&venus_smmu 0x11>, - <&venus_smmu 0x21>, - <&venus_smmu 0x28>, - <&venus_smmu 0x29>, - <&venus_smmu 0x2b>, - <&venus_smmu 0x2c>, - <&venus_smmu 0x2d>, - <&venus_smmu 0x31>; + iommus = <&venus_smmu 0x00>, + <&venus_smmu 0x01>, + <&venus_smmu 0x0a>, + <&venus_smmu 0x07>, + <&venus_smmu 0x0e>, + <&venus_smmu 0x0f>, + <&venus_smmu 0x08>, + <&venus_smmu 0x09>, + <&venus_smmu 0x0b>, + <&venus_smmu 0x0c>, + <&venus_smmu 0x0d>, + <&venus_smmu 0x10>, + <&venus_smmu 0x11>, + <&venus_smmu 0x21>, + <&venus_smmu 0x28>, + <&venus_smmu 0x29>, + <&venus_smmu 0x2b>, + <&venus_smmu 0x2c>, + <&venus_smmu 0x2d>, + <&venus_smmu 0x31>; memory-region = <&venus_mem>; video-decoder {
diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml index 57a838f..2599c3a 100644 --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml
@@ -302,19 +302,19 @@ "vfe_lite_cphy_rx", "vfe_lite_csid"; - interrupts = <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 431 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 359 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 360 IRQ_TYPE_EDGE_RISING>; + interrupts = <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 431 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 359 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 360 IRQ_TYPE_EDGE_RISING>; interrupt-names = "csid0", "csid1",
diff --git a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml index 1fc62a1..36fde92 100644 --- a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml +++ b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml
@@ -53,11 +53,11 @@ #address-cells = <2>; #size-cells = <2>; - isp@880000 { - compatible = "brcm,bcm2712-pispbe", "raspberrypi,pispbe"; - reg = <0x10 0x00880000 0x0 0x4000>; - interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&firmware_clocks 7>; - iommus = <&iommu2>; + isp@880000 { + compatible = "brcm,bcm2712-pispbe", "raspberrypi,pispbe"; + reg = <0x10 0x00880000 0x0 0x4000>; + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&firmware_clocks 7>; + iommus = <&iommu2>; }; };
diff --git a/Documentation/devicetree/bindings/media/rc.txt b/Documentation/devicetree/bindings/media/rc.txt deleted file mode 100644 index be629f7..0000000 --- a/Documentation/devicetree/bindings/media/rc.txt +++ /dev/null
@@ -1 +0,0 @@ -This file has been moved to rc.yaml.
diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml index 1bfba84..1329d4e 100644 --- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml +++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml
@@ -188,13 +188,13 @@ /* ... CSIS 1 */ fimc-lite@b90000 { - compatible = "samsung,exynos4212-fimc-lite"; - reg = <0xb90000 0x1000>; - interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; - power-domains = <&pd_isp>; - clocks = <&isp_clock CLK_ISP_FIMC_LITE0>; - clock-names = "flite"; - iommus = <&sysmmu_fimc_lite0>; + compatible = "samsung,exynos4212-fimc-lite"; + reg = <0xb90000 0x1000>; + interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&pd_isp>; + clocks = <&isp_clock CLK_ISP_FIMC_LITE0>; + clock-names = "flite"; + iommus = <&sysmmu_fimc_lite0>; }; /* ... FIMC-LITE 1 */
diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml index 7c2ddd2..cb01161 100644 --- a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
@@ -120,14 +120,14 @@ dma-names = "tx"; port { - dcmi_0: endpoint { - remote-endpoint = <&ov5640_0>; - bus-type = <MEDIA_BUS_TYPE_PARALLEL>; - bus-width = <8>; - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <1>; - }; + dcmi_0: endpoint { + remote-endpoint = <&ov5640_0>; + bus-type = <MEDIA_BUS_TYPE_PARALLEL>; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <1>; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml index 162a0c52..0bf7c67 100644 --- a/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
@@ -120,13 +120,13 @@ clocks = <&rcc DCMIPP_K>; port { - endpoint { - remote-endpoint = <&mipid02_2>; - bus-width = <8>; - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <0>; - }; + endpoint { + remote-endpoint = <&mipid02_2>; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <0>; + }; }; };
diff --git a/Documentation/devicetree/bindings/media/ti,cal.yaml b/Documentation/devicetree/bindings/media/ti,cal.yaml index f1a940a..c223b4f 100644 --- a/Documentation/devicetree/bindings/media/ti,cal.yaml +++ b/Documentation/devicetree/bindings/media/ti,cal.yaml
@@ -136,17 +136,17 @@ ti,camerrx-control = <&scm_conf 0xE94>; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - csi2_0: port@0 { - reg = <0>; - csi2_phy0: endpoint { - remote-endpoint = <&csi2_cam0>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; + csi2_0: port@0 { + reg = <0>; + csi2_phy0: endpoint { + remote-endpoint = <&csi2_cam0>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; }; }; @@ -156,21 +156,21 @@ #size-cells = <0>; camera-sensor@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - AVDD-supply = <®_2p8v>; - DOVDD-supply = <®_1p8v>; - DVDD-supply = <®_1p5v>; - clocks = <&clk_ov5640_fixed>; - clock-names = "xclk"; + compatible = "ovti,ov5640"; + reg = <0x3c>; + AVDD-supply = <®_2p8v>; + DOVDD-supply = <®_1p8v>; + DVDD-supply = <®_1p5v>; + clocks = <&clk_ov5640_fixed>; + clock-names = "xclk"; - port { - csi2_cam0: endpoint { - remote-endpoint = <&csi2_phy0>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; + port { + csi2_cam0: endpoint { + remote-endpoint = <&csi2_phy0>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; }; };
diff --git a/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml b/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml index 209dc97..31a2f77 100644 --- a/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml
@@ -214,7 +214,7 @@ compatible = "ti,tps65910"; reg = <0x2d>; interrupt-parent = <&intc>; - interrupts = < 0 118 0x04 >; + interrupts = <0 118 0x04>; #gpio-cells = <2>; gpio-controller;
diff --git a/Documentation/devicetree/bindings/mux/reg-mux.yaml b/Documentation/devicetree/bindings/mux/reg-mux.yaml index dc4be09..c8de11a 100644 --- a/Documentation/devicetree/bindings/mux/reg-mux.yaml +++ b/Documentation/devicetree/bindings/mux/reg-mux.yaml
@@ -22,7 +22,7 @@ reg: true '#mux-control-cells': - const: 1 + enum: [ 0, 1 ] mux-reg-masks: $ref: /schemas/types.yaml#/definitions/uint32-matrix
diff --git a/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml b/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml index d073c51..e0aacec 100644 --- a/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml +++ b/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml
@@ -27,7 +27,7 @@ $ref: /schemas/types.yaml#/definitions/string description: Unique EEPROM identifier describing its function in the - system. Will be used as created NVMEM deivce's name. + system. Will be used as created NVMEM device's name. required: - compatible
diff --git a/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml b/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml index e863519..b680105 100644 --- a/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml
@@ -160,7 +160,7 @@ reg = <0x2800 0 0 0 0>; compatible = "pciclass,0604"; device_type = "pci"; - reset-gpios = <&gpio27 4 0 >; + reset-gpios = <&gpio27 4 0>; #address-cells = <3>; #size-cells = <2>; ranges; @@ -170,7 +170,7 @@ reg = <0x03800 0 0 0 0>; compatible = "pciclass,0604"; device_type = "pci"; - reset-gpios = <&gpio25 2 0 >; + reset-gpios = <&gpio25 2 0>; #address-cells = <3>; #size-cells = <2>; ranges;
diff --git a/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml b/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml new file mode 100644 index 0000000..c76e94c --- /dev/null +++ b/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml
@@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/st,stm32-usb2phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 MPU High-Speed USB PHY + +description: + USB2 PHY block in STM32 is attached to USB 2.0 Host controller and + USB 2.0 side of DWC3 DRD controller, and provides the USB LS/FS/HS + connectivity. Both PHYs are the FEMTO-PHY, but their configuration + bits in the system control register are different for each variant. + +maintainers: + - Fabrice Gasnier <fabrice.gasnier@foss.st.com> + - Marek Vasut <marex@nabladev.com> + - Pankaj Dev <pankaj.dev@st.com> + +properties: + compatible: + enum: + - st,stm32mp25-usb2phy1 + - st,stm32mp25-usb2phy2 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + vdd33-supply: + description: Phandle to regulator providing 3V3 power supply to the USB2 HS PHY + + "#clock-cells": + const: 1 + + "#phy-cells": + const: 0 + +required: + - compatible + - reg + - clocks + - resets + - vdd33-supply + - "#clock-cells" + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/st,stm32mp25-rcc.h> + #include <dt-bindings/reset/st,stm32mp25-rcc.h> + + usb-phy@2400 { + compatible = "st,stm32mp25-usb2phy1"; + reg = <0x2400 0x24>; + #phy-cells = <0>; + #clock-cells = <1>; + clocks = <&rcc CK_KER_USB2PHY1>; + resets = <&rcc USB2PHY1_R>; + vdd33-supply = <&vdd33usb>; + };
diff --git a/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml index 94b868c..0084350 100644 --- a/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml
@@ -339,7 +339,7 @@ sdcard-pins { function = "SD_CARD"; groups = "SD_CARD"; - sunplus,pins = < SPPCTL_IOPAD(91, SPPCTL_PCTL_G_GPIO, 0, 0) >; + sunplus,pins = <SPPCTL_IOPAD(91, SPPCTL_PCTL_G_GPIO, 0, 0)>; }; hdmi_A_tx1-pins {
diff --git a/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml b/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml new file mode 100644 index 0000000..75c84ab --- /dev/null +++ b/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml
@@ -0,0 +1,184 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/mediatek,mt2701-scpsys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek SCPSYS + +maintainers: + - Matthias Brugger <matthias.bgg@gmail.com> + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> + +description: > + The System Control Processor System (SCPSYS) has several power management + related tasks in the system. The tasks include thermal measurement, dynamic + voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control. + The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power + domain control. + + It provides the power domains defined in: + - include/dt-bindings/power/mt2701-power.h + - include/dt-bindings/power/mt2712-power.h + - include/dt-bindings/power/mt6797-power.h + - include/dt-bindings/power/mt7622-power.h + - include/dt-bindings/power/mt7623a-power.h + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt7623a-scpsys + - mediatek,mt6797-scpsys + - items: + - enum: + - mediatek,mt2701-scpsys + - mediatek,mt2712-scpsys + - mediatek,mt7622-scpsys + - const: syscon + - items: + - const: mediatek,mt7623-scpsys + - const: mediatek,mt2701-scpsys + - const: syscon + - items: + - const: mediatek,mt7629-scpsys + - const: mediatek,mt7622-scpsys + + '#power-domain-cells': + description: Always 1 + const: 1 + + reg: + maxItems: 1 + + interrupts: + maxItems: 4 + + clocks: + minItems: 1 + maxItems: 20 + + clock-names: + minItems: 1 + maxItems: 6 + items: + enum: + - mm + - mfg + - ethif + - venc + - jpgdec + - audio + - vdec + - hif_sel + + vdec-supply: true + venc-supply: true + isp-supply: true + mm-supply: true + audio-supply: true + usb-supply: true + mfg_async-supply: true + mfg-supply: true + + infracfg: + description: Infrastructure configuration controller phandle + $ref: /schemas/types.yaml#/definitions/phandle + +required: + - compatible + - '#power-domain-cells' + - reg + - infracfg + - clocks + - clock-names + +additionalProperties: false + +allOf: + - if: + properties: + compatible: + contains: + const: mediatek,mt2701-scpsys + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mm + - const: mfg + - const: ethif + - if: + properties: + compatible: + contains: + const: mediatek,mt7623a-scpsys + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: ethif + - if: + properties: + compatible: + contains: + const: mediatek,mt2712-scpsys + then: + properties: + clocks: + minItems: 6 + clock-names: + items: + - const: mm + - const: mfg + - const: venc + - const: jpgdec + - const: audio + - const: vdec + - if: + properties: + compatible: + contains: + const: mediatek,mt7622-scpsys + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: hif_sel + - if: + properties: + compatible: + contains: + const: mediatek,mt6797-scpsys + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mfg + - const: mm + - const: vdec + +examples: + - | + #include <dt-bindings/clock/mt2701-clk.h> + + power-controller@10006000 { + #power-domain-cells = <1>; + compatible = "mediatek,mt2701-scpsys", "syscon"; + reg = <0x10006000 0x1000>; + infracfg = <&infracfg>; + clocks = <&topckgen CLK_TOP_MM_SEL>, + <&topckgen CLK_TOP_MFG_SEL>, + <&topckgen CLK_TOP_ETHIF_SEL>; + clock-names = "mm", "mfg", "ethif"; + };
diff --git a/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml index 079ad97..60f0882 100644 --- a/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml +++ b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml
@@ -27,12 +27,9 @@ mailbox controller device node and an args specifier that will be the phandle to the intended sub-mailbox child node to be used for communication. See - Documentation/devicetree/bindings/mailbox/mailbox.txt - for more details about the generic mailbox controller - and client driver bindings. Also see - Documentation/devicetree/bindings/mailbox/ \ - xlnx,zynqmp-ipi-mailbox.txt for typical controller that - is used to communicate with this System controllers. + Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml + for typical controller that is used to communicate with + this System controllers. items: - description: tx channel - description: rx channel
diff --git a/Documentation/devicetree/bindings/regulator/vexpress.txt b/Documentation/devicetree/bindings/regulator/vexpress.txt deleted file mode 100644 index 1c2e92c..0000000 --- a/Documentation/devicetree/bindings/regulator/vexpress.txt +++ /dev/null
@@ -1,32 +0,0 @@ -Versatile Express voltage regulators ------------------------------------- - -Requires node properties: -- "compatible" value: "arm,vexpress-volt" -- "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg - (see Documentation/devicetree/bindings/arm/vexpress-config.yaml - for more details) - -Required regulator properties: -- "regulator-name" -- "regulator-always-on" - -Optional regulator properties: -- "regulator-min-microvolt" -- "regulator-max-microvolt" - -See Documentation/devicetree/bindings/regulator/regulator.txt -for more details about the regulator properties. - -When no "regulator-[min|max]-microvolt" properties are defined, -the device is treated as fixed (or rather "read-only") regulator. - -Example: - volt@0 { - compatible = "arm,vexpress-volt"; - arm,vexpress-sysreg,func = <2 0>; - regulator-name = "Cores"; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1050000>; - regulator-always-on; - };
diff --git a/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt b/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt deleted file mode 100644 index 384035e..0000000 --- a/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt +++ /dev/null
@@ -1,6 +0,0 @@ -STMicroelectronics STM32 Peripheral Reset Controller -==================================================== - -The RCC IP is both a reset and a clock controller. - -Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml
diff --git a/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt b/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt deleted file mode 100644 index 2880d5d..0000000 --- a/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt +++ /dev/null
@@ -1,6 +0,0 @@ -STMicroelectronics STM32MP1 Peripheral Reset Controller -======================================================= - -The RCC IP is both a reset and a clock controller. - -Please see Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.yaml
diff --git a/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml b/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml new file mode 100644 index 0000000..27d4cf5 --- /dev/null +++ b/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml
@@ -0,0 +1,158 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/scsi/hisilicon,hip05-sas-v1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon SAS controller + +maintainers: + - Xingui Yang <yangxingui@huawei.com> + +properties: + compatible: + items: + - enum: + - hisilicon,hip05-sas-v1 + - hisilicon,hip06-sas-v2 + - hisilicon,hip07-sas-v2 + + reg: + minItems: 1 + items: + - description: SAS registers + - description: CPLD SGPIO control registers + + clocks: + minItems: 1 + maxItems: 2 + + dma-coherent: true + + interrupts: + description: > + Interrupt specifiers for PHY, SATA, and completion queues; ordering and + number depend on controller version. + + For v1 hw: Interrupts for phys, completion queues, and fatal + sources; the interrupts are ordered in 3 groups, as follows: + + - Phy interrupts - Each phy has 3 interrupt sources: + - broadcast + - phyup + - abnormal + The phy interrupts are ordered into groups of 3 per phy + (broadcast, phyup, and abnormal) in increasing order. + - Completion queue interrupts - each completion queue has 1 interrupt + source. + - Fatal interrupts - the fatal interrupts are ordered as follows: + - ECC + - AXI bus + + For v2 hw: Interrupts for phys, Sata, and completion queues; + the interrupts are ordered in 3 groups, as follows: + + - Phy interrupts - Each controller has 2 phy interrupts: + - phy up/down + - channel interrupt + - Sata interrupts - Each phy on the controller has 1 Sata interrupt. + - Completion queue interrupts - each completion queue has 1 interrupt + source + minItems: 58 + maxItems: 128 + + ctrl-reset-reg: + description: Offset to controller reset register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + ctrl-reset-sts-reg: + description: Offset to controller reset status register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + ctrl-clock-ena-reg: + description: Offset to controller clock enable register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + hip06-sas-v2-quirk-amt: + description: + Indicates that the v2 controller has the "am-max-transmissions" limitation. + type: boolean + + hisilicon,sas-syscon: + description: Phandle of syscon used for SAS control. + $ref: /schemas/types.yaml#/definitions/phandle + + hisilicon,signal-attenuation: + description: + De-emphasis, preshoot, and boost attenuation readings for the board, + used to calculate signal attenuation (y = (x-10000)/10000). + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 3 + maxItems: 3 + items: + minimum: 7600 + maximum: 12400 + + phy-count: + description: Number of PHYs accessible by the controller. + $ref: /schemas/types.yaml#/definitions/uint32 + + queue-count: + description: Number of delivery and completion queues in the controller. + $ref: /schemas/types.yaml#/definitions/uint32 + + sas-addr: + description: SAS address, array of 8 bytes representing host SAS address. + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 8 + maxItems: 8 + +required: + - compatible + - reg + - interrupts + - ctrl-reset-reg + - ctrl-reset-sts-reg + - ctrl-clock-ena-reg + - hisilicon,sas-syscon + - phy-count + - queue-count + - sas-addr + +additionalProperties: false + +examples: + - | + sas@c1000000 { + compatible = "hisilicon,hip05-sas-v1"; + reg = <0xc1000000 0x10000>; + dma-coherent; + interrupts = <259 4>, <263 4>, <264 4>, /* phy0 */ + <269 4>, <273 4>, <274 4>, /* phy1 */ + <279 4>, <283 4>, <284 4>, /* phy2 */ + <289 4>, <293 4>, <294 4>, /* phy3 */ + <299 4>, <303 4>, <304 4>, /* phy4 */ + <309 4>, <313 4>, <314 4>, /* phy5 */ + <319 4>, <323 4>, <324 4>, /* phy6 */ + <329 4>, <333 4>, <334 4>, /* phy7 */ + <336 1>, <337 1>, <338 1>, /* cq0-2 */ + <339 1>, <340 1>, <341 1>, /* cq3-5 */ + <342 1>, <343 1>, <344 1>, /* cq6-8 */ + <345 1>, <346 1>, <347 1>, /* cq9-11 */ + <348 1>, <349 1>, <350 1>, /* cq12-14 */ + <351 1>, <352 1>, <353 1>, /* cq15-17 */ + <354 1>, <355 1>, <356 1>, /* cq18-20 */ + <357 1>, <358 1>, <359 1>, /* cq21-23 */ + <360 1>, <361 1>, <362 1>, /* cq24-26 */ + <363 1>, <364 1>, <365 1>, /* cq27-29 */ + <366 1>, <367 1>, /* cq30-31 */ + <376 4>, /* fatal ecc */ + <381 4>; /* fatal axi */ + ctrl-reset-reg = <0xa60>; + ctrl-reset-sts-reg = <0x5a30>; + ctrl-clock-ena-reg = <0x338>; + hisilicon,sas-syscon = <&pcie_sas>; + queue-count = <32>; + phy-count = <8>; + sas-addr = [50 01 88 20 16 00 00 0a]; + };
diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt deleted file mode 100644 index 8c6659e..0000000 --- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt +++ /dev/null
@@ -1,98 +0,0 @@ -* HiSilicon SAS controller - -The HiSilicon SAS controller supports SAS/SATA. - -Main node required properties: - - compatible : value should be as follows: - (a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset - (b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset - (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset - - sas-addr : array of 8 bytes for host SAS address - - reg : Contains two regions. The first is the address and length of the SAS - register. The second is the address and length of CPLD register for - SGPIO control. The second is optional, and should be set only when - we use a CPLD for directly attached disk LED control. - - hisilicon,sas-syscon: phandle of syscon used for sas control - - ctrl-reset-reg : offset to controller reset register in ctrl reg - - ctrl-reset-sts-reg : offset to controller reset status register in ctrl reg - - ctrl-clock-ena-reg : offset to controller clock enable register in ctrl reg - - queue-count : number of delivery and completion queues in the controller - - phy-count : number of phys accessible by the controller - - interrupts : For v1 hw: Interrupts for phys, completion queues, and fatal - sources; the interrupts are ordered in 3 groups, as follows: - - Phy interrupts - - Completion queue interrupts - - Fatal interrupts - Phy interrupts : Each phy has 3 interrupt sources: - - broadcast - - phyup - - abnormal - The phy interrupts are ordered into groups of 3 per phy - (broadcast, phyup, and abnormal) in increasing order. - Completion queue interrupts : each completion queue has 1 - interrupt source. - The interrupts are ordered in increasing order. - Fatal interrupts : the fatal interrupts are ordered as follows: - - ECC - - AXI bus - For v2 hw: Interrupts for phys, Sata, and completion queues; - the interrupts are ordered in 3 groups, as follows: - - Phy interrupts - - Sata interrupts - - Completion queue interrupts - Phy interrupts : Each controller has 2 phy interrupts: - - phy up/down - - channel interrupt - Sata interrupts : Each phy on the controller has 1 Sata - interrupt. The interrupts are ordered in increasing - order. - Completion queue interrupts : each completion queue has 1 - interrupt source. The interrupts are ordered in - increasing order. - -Optional main node properties: - - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the - "am-max-transmissions" limitation. - - hisilicon,signal-attenuation : array of 3 32-bit values, containing de-emphasis, - preshoot, and boost attenuation readings for the board. They - are used to describe the signal attenuation of the board. These - values' range is 7600 to 12400, and used to represent -24dB to - 24dB. - The formula is "y = (x-10000)/10000". For example, 10478 - means 4.78dB. - -Example: - sas0: sas@c1000000 { - compatible = "hisilicon,hip05-sas-v1"; - sas-addr = [50 01 88 20 16 00 00 0a]; - reg = <0x0 0xc1000000 0x0 0x10000>; - hisilicon,sas-syscon = <&pcie_sas>; - ctrl-reset-reg = <0xa60>; - ctrl-reset-sts-reg = <0x5a30>; - ctrl-clock-ena-reg = <0x338>; - queue-count = <32>; - phy-count = <8>; - dma-coherent; - interrupt-parent = <&mbigen_dsa>; - interrupts = <259 4>,<263 4>,<264 4>,/* phy0 */ - <269 4>,<273 4>,<274 4>,/* phy1 */ - <279 4>,<283 4>,<284 4>,/* phy2 */ - <289 4>,<293 4>,<294 4>,/* phy3 */ - <299 4>,<303 4>,<304 4>,/* phy4 */ - <309 4>,<313 4>,<314 4>,/* phy5 */ - <319 4>,<323 4>,<324 4>,/* phy6 */ - <329 4>,<333 4>,<334 4>,/* phy7 */ - <336 1>,<337 1>,<338 1>,/* cq0-2 */ - <339 1>,<340 1>,<341 1>,/* cq3-5 */ - <342 1>,<343 1>,<344 1>,/* cq6-8 */ - <345 1>,<346 1>,<347 1>,/* cq9-11 */ - <348 1>,<349 1>,<350 1>,/* cq12-14 */ - <351 1>,<352 1>,<353 1>,/* cq15-17 */ - <354 1>,<355 1>,<356 1>,/* cq18-20 */ - <357 1>,<358 1>,<359 1>,/* cq21-23 */ - <360 1>,<361 1>,<362 1>,/* cq24-26 */ - <363 1>,<364 1>,<365 1>,/* cq27-29 */ - <366 1>,<367 1>/* cq30-31 */ - <376 4>,/* fatal ecc */ - <381 4>;/* fatal axi */ - };
diff --git a/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml b/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml new file mode 100644 index 0000000..eaaa8f9 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml
@@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/hisilicon/hisilicon,hip05-cpld.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HIP05 CPLD registers + +maintainers: + - Wei Xu <xuwei5@hisilicon.com> + +properties: + compatible: + const: hisilicon,hip05-cpld + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + local-bus { + #address-cells = <2>; + #size-cells = <1>; + + cpld@100000000 { + compatible = "hisilicon,hip05-cpld"; + reg = <0x1 0x0 0x100>; + }; + };
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml new file mode 100644 index 0000000..ad3df06 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml
@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt2701-g3dsys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek G3D System Controller + +maintainers: + - Sean Wang <sean.wang@mediatek.com> + - Ryder Lee <ryder.lee@mediatek.com> + +description: | + The MediaTek G3D system controller provides clocks and reset control + for the GPU subsystem on MediaTek SoCs. + +properties: + compatible: + oneOf: + - items: + - const: mediatek,mt2701-g3dsys + - const: syscon + - items: + - const: mediatek,mt7623-g3dsys + - const: mediatek,mt2701-g3dsys + - const: syscon + + reg: + maxItems: 1 + + "#clock-cells": + const: 1 + + "#reset-cells": + const: 1 + +required: + - compatible + - reg + - "#clock-cells" + - "#reset-cells" + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + g3dsys: syscon@13000000 { + compatible = "mediatek,mt7623-g3dsys", + "mediatek,mt2701-g3dsys", + "syscon"; + reg = <0 0x13000000 0 0x200>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + };
diff --git a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt b/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt deleted file mode 100644 index 3530a66..0000000 --- a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt +++ /dev/null
@@ -1,79 +0,0 @@ -MediaTek SCPSYS -=============== - -The System Control Processor System (SCPSYS) has several power management -related tasks in the system. The tasks include thermal measurement, dynamic -voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control. -The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power -domain control. - -The driver implements the Generic PM domain bindings described in -power/power-domain.yaml. It provides the power domains defined in -- include/dt-bindings/power/mt8173-power.h -- include/dt-bindings/power/mt6797-power.h -- include/dt-bindings/power/mt6765-power.h -- include/dt-bindings/power/mt2701-power.h -- include/dt-bindings/power/mt2712-power.h -- include/dt-bindings/power/mt7622-power.h - -Required properties: -- compatible: Should be one of: - - "mediatek,mt2701-scpsys" - - "mediatek,mt2712-scpsys" - - "mediatek,mt6735-scpsys" - - "mediatek,mt6765-scpsys" - - "mediatek,mt6797-scpsys" - - "mediatek,mt7622-scpsys" - - "mediatek,mt7623-scpsys", "mediatek,mt2701-scpsys": For MT7623 SoC - - "mediatek,mt7623a-scpsys": For MT7623A SoC - - "mediatek,mt7629-scpsys", "mediatek,mt7622-scpsys": For MT7629 SoC - - "mediatek,mt8173-scpsys" -- #power-domain-cells: Must be 1 -- reg: Address range of the SCPSYS unit -- infracfg: must contain a phandle to the infracfg controller -- clock, clock-names: clocks according to the common clock binding. - These are clocks which hardware needs to be - enabled before enabling certain power domains. - Required clocks for MT2701 or MT7623: "mm", "mfg", "ethif" - Required clocks for MT2712: "mm", "mfg", "venc", "jpgdec", "audio", "vdec" - Required clocks for MT6765: MUX: "mm", "mfg" - CG: "mm-0", "mm-1", "mm-2", "mm-3", "isp-0", - "isp-1", "cam-0", "cam-1", "cam-2", - "cam-3","cam-4" - Required clocks for MT6797: "mm", "mfg", "vdec" - Required clocks for MT7622 or MT7629: "hif_sel" - Required clocks for MT7623A: "ethif" - Required clocks for MT8173: "mm", "mfg", "venc", "venc_lt" - -Optional properties: -- vdec-supply: Power supply for the vdec power domain -- venc-supply: Power supply for the venc power domain -- isp-supply: Power supply for the isp power domain -- mm-supply: Power supply for the mm power domain -- venc_lt-supply: Power supply for the venc_lt power domain -- audio-supply: Power supply for the audio power domain -- usb-supply: Power supply for the usb power domain -- mfg_async-supply: Power supply for the mfg_async power domain -- mfg_2d-supply: Power supply for the mfg_2d power domain -- mfg-supply: Power supply for the mfg power domain - -Example: - - scpsys: scpsys@10006000 { - #power-domain-cells = <1>; - compatible = "mediatek,mt8173-scpsys"; - reg = <0 0x10006000 0 0x1000>; - infracfg = <&infracfg>; - clocks = <&clk26m>, - <&topckgen CLK_TOP_MM_SEL>; - <&topckgen CLK_TOP_VENC_SEL>, - <&topckgen CLK_TOP_VENC_LT_SEL>; - clock-names = "mfg", "mm", "venc", "venc_lt"; - }; - -Example consumer: - - afe: mt8173-afe-pcm@11220000 { - compatible = "mediatek,mt8173-afe-pcm"; - power-domains = <&scpsys MT8173_POWER_DOMAIN_AUDIO>; - };
diff --git a/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml index 23e7e4e..9f6f009 100644 --- a/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml +++ b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml
@@ -17,13 +17,17 @@ properties: compatible: - items: - - enum: - - nuvoton,wpcm450-gcr - - nuvoton,npcm750-gcr - - nuvoton,npcm845-gcr - - const: syscon - - const: simple-mfd + oneOf: + - items: + - enum: + - nuvoton,npcm845-gcr + - const: syscon + - items: + - enum: + - nuvoton,wpcm450-gcr + - nuvoton,npcm750-gcr + - const: syscon + - const: simple-mfd reg: maxItems: 1
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml index d2ae2ae..e94c4fd 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml
@@ -71,7 +71,7 @@ maxItems: 1 description: Reference to the mailbox representing the outgoing doorbell in APCS for - this client, as described in mailbox/mailbox.txt + this client. "#clock-cells": const: 0
diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml new file mode 100644 index 0000000..a3166cc --- /dev/null +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml
@@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/mediatek,mt8173-rt5650.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek MT8173 with RT5650 codecs and HDMI via I2S + +maintainers: + - Ariel D'Alessandro <ariel.dalessandro@collabora.com> + +properties: + compatible: + const: mediatek,mt8173-rt5650 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + mediatek,audio-codec: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The phandles of rt5650 codecs and of the HDMI encoder node. + minItems: 2 + + mediatek,platform: + $ref: /schemas/types.yaml#/definitions/phandle + description: + The phandle of MT8173 ASoC platform. + + mediatek,mclk: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The MCLK source. + 0: external oscillator, MCLK = 12.288M + 1: internal source from mt8173, MCLK = sampling rate * 256 + + codec-capture: + description: Subnode of rt5650 codec capture. + type: object + + properties: + sound-dai: + maxItems: 1 + description: phandle of the CPU DAI + + additionalProperties: false + +required: + - compatible + - mediatek,audio-codec + - mediatek,platform + +additionalProperties: false + +examples: + - | + sound { + compatible = "mediatek,mt8173-rt5650"; + mediatek,audio-codec = <&rt5650 &hdmi0>; + mediatek,platform = <&afe>; + pinctrl-names = "default"; + pinctrl-0 = <&aud_i2s2>; + + mediatek,mclk = <1>; + codec-capture { + sound-dai = <&rt5650 1>; + }; + }; + +...
diff --git a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt b/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt deleted file mode 100644 index 29dce2a..0000000 --- a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt +++ /dev/null
@@ -1,31 +0,0 @@ -MT8173 with RT5650 CODECS and HDMI via I2S - -Required properties: -- compatible : "mediatek,mt8173-rt5650" -- mediatek,audio-codec: the phandles of rt5650 codecs - and of the hdmi encoder node -- mediatek,platform: the phandle of MT8173 ASoC platform - -Optional subnodes: -- codec-capture : the subnode of rt5650 codec capture -Required codec-capture subnode properties: -- sound-dai: audio codec dai name on capture path - <&rt5650 0> : Default setting. Connect rt5650 I2S1 for capture. (dai_name = rt5645-aif1) - <&rt5650 1> : Connect rt5650 I2S2 for capture. (dai_name = rt5645-aif2) - -- mediatek,mclk: the MCLK source - 0 : external oscillator, MCLK = 12.288M - 1 : internal source from mt8173, MCLK = sampling rate*256 - -Example: - - sound { - compatible = "mediatek,mt8173-rt5650"; - mediatek,audio-codec = <&rt5650 &hdmi0>; - mediatek,platform = <&afe>; - mediatek,mclk = <0>; - codec-capture { - sound-dai = <&rt5650 1>; - }; - }; -
diff --git a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml index 80e5426..ad830ae 100644 --- a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml +++ b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml
@@ -62,21 +62,21 @@ interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; flash@0 { - reg = < 0 >; + reg = <0>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>; }; flash@1 { - reg = < 1 >; + reg = <1>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>; }; flash@2 { - reg = < 2 >; + reg = <2>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>;
diff --git a/Documentation/devicetree/bindings/thermal/thermal-idle.yaml b/Documentation/devicetree/bindings/thermal/thermal-idle.yaml index 1b77d54..6b4b165 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-idle.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-idle.yaml
@@ -137,7 +137,7 @@ cooling-maps { map0 { trip = <&cpu_alert1>; - cooling-device = <&cpu_b0_therm 0 15 >, + cooling-device = <&cpu_b0_therm 0 15>, <&cpu_b1_therm 0 15>; };
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index 8cad849..a822521 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -188,7 +188,7 @@ - injoinic,ip5306 # Inspur Power System power supply unit version 1 - inspur,ipsps1 - # Intel common redudant power supply crps185 + # Intel common redundant power supply crps185 - intel,crps185 # Intersil ISL29028 Ambient Light and Proximity Sensor - isil,isl29028 @@ -414,6 +414,8 @@ - samsung,24ad0xd1 # Samsung Exynos SoC SATA PHY I2C device - samsung,exynos-sataphy-i2c + # SDMC 1024bit EEPROM + 128bit OTP memory for key + - sdmc,dm2016 # Semtech sx1301 baseband processor - semtech,sx1301 # Sensirion multi-pixel gas sensor with I2C interface
diff --git a/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml b/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml new file mode 100644 index 0000000..96bd557 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml
@@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/st,stm32mp25-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 MPU DWC3 USB SoC controller + +description: + The STM32 MPU DWC3 USB SoC controller block supports both + Host(SS/HS/FS/LS) and Device(SS/HS/FS) mode operation + +maintainers: + - Fabrice Gasnier <fabrice.gasnier@foss.st.com> + - Marek Vasut <marex@nabladev.com> + +allOf: + - $ref: snps,dwc3-common.yaml# + +properties: + compatible: + const: st,stm32mp25-dwc3 + + reg: + maxItems: 1 + + access-controllers: + maxItems: 1 + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + items: + - const: ref + - const: bus_early + - const: suspend + + interrupts: + maxItems: 1 + + resets: + maxItems: 1 + + over-current-active-low: + type: boolean + description: Over-Current signal polarity is active-low + + st,syscfg: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Phandle to system configuration controller. + items: + - items: + - description: phandle to syscfg + - description: USB3DR control offset within syscfg + + st,enable-port-power-control: + type: boolean + description: Enable Host-Mode Port Power Control (bit-3 of capability param HCCPARAMS) + + st,vbusen-active-low: + type: boolean + description: VBUS-ENABLE signal polarity is active-low + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - phys + - phy-names + - resets + - st,syscfg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/st,stm32mp25-rcc.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/st,stm32mp25-rcc.h> + + usb@48300000 { + compatible = "st,stm32mp25-dwc3"; + reg = <0x48300000 0x100000>; + clocks = <&rcc CK_KER_USB2PHY2>, <&rcc CK_BUS_USB3DR>, <&rcc CK_KER_USB2PHY2>; + clock-names = "ref", "bus_early", "suspend"; + interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb2_phy>, <&usb3_phy>; + phy-names = "usb2-phy", "usb3-phy"; + resets = <&rcc USB3DR_R>; + over-current-active-low; + st,syscfg = <&syscfg 0x4800>; + st,vbusen-active-low; + };
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 2d93308..fdc459e 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -114,6 +114,8 @@ description: Amarula Solutions "^amazon,.*": description: Amazon.com, Inc. + "^ambarella,.*": + description: Ambarella, Inc. "^amcc,.*": description: Applied Micro Circuits Corporation (APM, formally AMCC) "^amd,.*":
diff --git a/Documentation/devicetree/of_unittest.rst b/Documentation/devicetree/of_unittest.rst index 6ed6e32..5ea8ee0 100644 --- a/Documentation/devicetree/of_unittest.rst +++ b/Documentation/devicetree/of_unittest.rst
@@ -125,7 +125,7 @@ Before executing OF unittest, it is required to attach the test data to -machine's device tree (if present). So, when selftest_data_add() is called, +machine's device tree (if present). So, when unittest_data_add() is called, at first it reads the flattened device tree data linked into the kernel image via the following kernel symbols::
diff --git a/Documentation/devicetree/overlay-notes.rst b/Documentation/devicetree/overlay-notes.rst index ba401ef..f2bb114 100644 --- a/Documentation/devicetree/overlay-notes.rst +++ b/Documentation/devicetree/overlay-notes.rst
@@ -115,10 +115,6 @@ previously created via the call to of_overlay_fdt_apply(). Removal of an overlay changeset that is stacked by another will not be permitted. -Finally, if you need to remove all overlays in one-go, just call -of_overlay_remove_all() which will remove every single one in the correct -order. - There is the option to register notifiers that get called on overlay operations. See of_overlay_notifier_register/unregister and enum of_overlay_notify_action for details.
diff --git a/Documentation/translations/zh_CN/devicetree/overlay-notes.rst b/Documentation/translations/zh_CN/devicetree/overlay-notes.rst index ba5edd0..f1217ea 100644 --- a/Documentation/translations/zh_CN/devicetree/overlay-notes.rst +++ b/Documentation/translations/zh_CN/devicetree/overlay-notes.rst
@@ -116,9 +116,6 @@ 2) 调用of_overlay_remove()来删除和清理先前通过调用of_overlay_fdt_apply() 而创建的覆盖变更集。不允许删除一个被另一个覆盖的覆盖变化集。 -最后,如果你需要一次性删除所有的覆盖,只需调用of_overlay_remove_all(), -它将以正确的顺序删除每一个覆盖。 - 你可以选择注册在覆盖操作中被调用的通知器。详见 of_overlay_notifier_register/unregister和enum of_overlay_notify_action。
diff --git a/MAINTAINERS b/MAINTAINERS index 1cd7e66..2b0d9a2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS
@@ -12085,7 +12085,7 @@ M: Xingui Yang <yangxingui@huawei.com> S: Supported W: http://www.hisilicon.com -F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt +F: Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml F: drivers/scsi/hisi_sas/ HISILICON SECURITY ENGINE V2 DRIVER (SEC2) @@ -20834,6 +20834,8 @@ F: Documentation/process/maintainer-devicetree.rst F: arch/*/boot/dts/ F: include/dt-bindings/ +F: scripts/dtc/dt-check-style +F: scripts/dtc/dt-style-selftest/ OPENCOMPUTE PTP CLOCK DRIVER M: Vadim Fedorenko <vadim.fedorenko@linux.dev>
diff --git a/drivers/of/fdt_address.c b/drivers/of/fdt_address.c index f358d2c..2e4e46a 100644 --- a/drivers/of/fdt_address.c +++ b/drivers/of/fdt_address.c
@@ -172,7 +172,7 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) goto bail; bus = &of_busses[0]; - /* Cound address cells & copy address locally */ + /* Count address cells & copy address locally */ bus->count_cells(blob, parent, &na, &ns); if (!OF_CHECK_COUNTS(na, ns)) { pr_err("Bad cell count for %s\n",
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index ef1ed97..162590c 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c
@@ -767,34 +767,27 @@ void __init of_irq_init(const struct of_device_id *matches) } } -static int of_check_msi_parent(struct device_node *dev_node, struct device_node **msi_node) +static int of_check_msi_parent(struct device_node *dev_node, struct device_node **msi_node, + struct of_phandle_args *msi_spec) { - struct of_phandle_args msi_spec; int ret; /* * An msi-parent phandle with a missing or == 0 #msi-cells * property identifies a 1:1 ID translation mapping. * - * Set the msi controller node if the firmware matches this - * condition. + * @msi_spec keeps a reference to the target node whenever the + * phandle parses, -EINVAL included, and the caller releases it. */ ret = of_parse_phandle_with_optional_args(dev_node, "msi-parent", "#msi-cells", - 0, &msi_spec); + 0, msi_spec); if (ret) return ret; - if ((*msi_node && *msi_node != msi_spec.np) || msi_spec.args_count != 0) - ret = -EINVAL; + if ((*msi_node && *msi_node != msi_spec->np) || msi_spec->args_count != 0) + return -EINVAL; - if (!ret) { - /* Return with a node reference held */ - *msi_node = msi_spec.np; - return 0; - } - of_node_put(msi_spec.np); - - return ret; + return 0; } /** @@ -808,7 +801,9 @@ static int of_check_msi_parent(struct device_node *dev_node, struct device_node * @id_in: Device ID. * * Walk up the device hierarchy looking for devices with a "msi-map" - * or "msi-parent" property. If found, apply the mapping to @id_in. + * or "msi-parent" property. If found, apply the mapping to @id_in. With + * @msi_np non-NULL, a device declaring an msi-parent ends the walk, usable + * or not. * * Returns: The mapped MSI id. */ @@ -823,6 +818,7 @@ u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u32 id_in) */ for (parent_dev = dev; parent_dev; parent_dev = parent_dev->parent) { struct of_phandle_args msi_spec = {}; + int ret; if (!of_map_msi_id(parent_dev->of_node, id_in, msi_np, &msi_spec)) { if (msi_spec.np) { @@ -837,8 +833,17 @@ u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u32 id_in) break; } /* -ENODEV: msi-map absent → check for msi-parent */ - if (msi_np && !of_check_msi_parent(parent_dev->of_node, msi_np)) + if (!msi_np) + continue; + + ret = of_check_msi_parent(parent_dev->of_node, msi_np, &msi_spec); + if (msi_spec.np) { + /* A declared msi-parent names the controller, usable or not */ + if (!ret && !*msi_np) + *msi_np = of_node_get(msi_spec.np); + of_node_put(msi_spec.np); break; + } } return id_out; }
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 83c56dd..b2e1198 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c
@@ -1282,26 +1282,3 @@ int of_overlay_remove(int *ovcs_id) return ret; } EXPORT_SYMBOL_GPL(of_overlay_remove); - -/** - * of_overlay_remove_all() - Reverts and frees all overlay changesets - * - * Removes all overlays from the system in the correct order. - * - * Return: 0 on success, or a negative error number - */ -int of_overlay_remove_all(void) -{ - struct overlay_changeset *ovcs, *ovcs_n; - int ret; - - /* the tail of list is guaranteed to be safe to remove */ - list_for_each_entry_safe_reverse(ovcs, ovcs_n, &ovcs_list, ovcs_list) { - ret = of_overlay_remove(&ovcs->id); - if (ret) - return ret; - } - - return 0; -} -EXPORT_SYMBOL_GPL(of_overlay_remove_all);
diff --git a/drivers/of/property.c b/drivers/of/property.c index 72cf129..45e55f6 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c
@@ -74,7 +74,7 @@ bool of_graph_is_present(const struct device_node *node) struct device_node *port __free(device_node) = of_get_child_by_name(node, "port"); - return !!port; + return port; } EXPORT_SYMBOL(of_graph_is_present); @@ -1471,6 +1471,22 @@ static struct device_node *parse_gpio_compat(struct device_node *np, return sup_args.np; } +static struct device_node *parse_i2c_parent(struct device_node *np, + const char *prop_name, int index) +{ + if (strcmp(prop_name, "i2c-parent")) + return NULL; + + /* tc9563 (pci1179,0623) is <phandle addr>; every other user is bare phandles */ + if (of_device_is_compatible(np, "pci1179,0623")) { + if (index) + return NULL; + return of_parse_phandle(np, prop_name, 0); + } + + return of_parse_phandle(np, prop_name, index); +} + static struct device_node *parse_interrupts(struct device_node *np, const char *prop_name, int index) { @@ -1562,6 +1578,7 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_resets, }, { .parse_prop = parse_leds, }, { .parse_prop = parse_backlight, }, + { .parse_prop = parse_i2c_parent, }, { .parse_prop = parse_panel, }, { .parse_prop = parse_msi_parent, }, { .parse_prop = parse_pses, }, @@ -1659,12 +1676,12 @@ static bool of_is_fwnode_add_links_supported(void) return true; if (is_supported != -1) - return !!is_supported; + return is_supported; is_supported = !((match_property_by_path("/soc", "compatible", "intel,ce4100-cp") >= 0) || (match_property_by_path("/", "architecture", "OLPC") >= 0)); - return !!is_supported; + return is_supported; } static int of_fwnode_add_links(struct fwnode_handle *fwnode)
diff --git a/include/dt-bindings/clock/agilex-clock.h b/include/dt-bindings/clock/agilex-clock.h index 06feca0..6206a45 100644 --- a/include/dt-bindings/clock/agilex-clock.h +++ b/include/dt-bindings/clock/agilex-clock.h
@@ -44,6 +44,7 @@ /* Gate clocks */ #define AGILEX_MPU_CLK 30 +/* Legacy ABI ID; do not use in new DTs, use AGILEX_MPU_CCU_CLK */ #define AGILEX_MPU_L2RAM_CLK 31 #define AGILEX_MPU_PERIPH_CLK 32 #define AGILEX_L4_MAIN_CLK 33
diff --git a/include/linux/of.h b/include/linux/of.h index b920aac..44d8313 100644 --- a/include/linux/of.h +++ b/include/linux/of.h
@@ -1837,7 +1837,6 @@ struct of_overlay_notify_data { int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, int *ovcs_id, const struct device_node *target_base); int of_overlay_remove(int *ovcs_id); -int of_overlay_remove_all(void); int of_overlay_notifier_register(struct notifier_block *nb); int of_overlay_notifier_unregister(struct notifier_block *nb); @@ -1855,11 +1854,6 @@ static inline int of_overlay_remove(int *ovcs_id) return -ENOTSUPP; } -static inline int of_overlay_remove_all(void) -{ - return -ENOTSUPP; -} - static inline int of_overlay_notifier_register(struct notifier_block *nb) { return 0;
diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 96deffc..6bbd12b 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style
@@ -5,12 +5,14 @@ # .dts/.dtsi/.dtso source files. Enforces rules from # Documentation/devicetree/bindings/dts-coding-style.rst. # -# Two modes: +# Three modes: # --mode=relaxed (default) # Only rules that produce zero warnings on the current tree. # Suitable for dt_binding_check. # --mode=strict -# All rules. Required for new submissions. +# Most of the rules. Required for new submissions. +# --mode=stricter +# All rules, including ones having false positives. # # Two input types (auto-detected by file extension): # *.yaml -- DT binding; check each example block @@ -42,7 +44,6 @@ NODE_OPEN = auto() # something { (with optional label/name/addr) NODE_CLOSE = auto() # }; PROPERTY = auto() # name = value; or name; - CONTINUATION = auto() # continuation of a multi-line property re_cpp_directive = re.compile( @@ -77,24 +78,30 @@ class DtsLine: - __slots__ = ('lineno', 'raw', 'linetype', 'indent_str', 'stripped', - 'prop_name', 'continuations', - 'node_name', 'node_addr', 'label', 'ref_name', 'depth', + __slots__ = ('lineno', 'raw', 'code', 'linetype', 'indent_str', 'stripped', 'is_root', + 'prop_name', 'continuation', 'continuations', + 'node_name', 'node_addr', 'label', 'ref_name', 'parent', 'depth', 'closures') - def __init__(self, lineno, raw, linetype, depth, indent_str, stripped): + def __init__(self, lineno, raw, linetype, depth, indent_str, stripped, + continuation = False, is_root = False): self.lineno = lineno # 1-based within the block - self.raw = raw + self.raw = raw # Entire raw line self.linetype = linetype self.indent_str = indent_str # leading whitespace as-is self.depth = depth - self.stripped = stripped + self.stripped = stripped # Code without indentation + # Only the code, skipping trailing comments and space between code and trailing comment + self.code = _strip_strings_and_comments(stripped).rstrip() + self.is_root = is_root self.prop_name = None + self.continuation = continuation # Continuation of a multi-line property self.continuations = [] self.node_name = None self.node_addr = None self.label = None self.ref_name = None + self.parent = None # DtsLine of parent node self.closures = 1 # count of '}' on a NODE_CLOSE line @@ -169,7 +176,7 @@ continue if not stripped: - dl = DtsLine(i, raw, LineType.BLANK, depth, '', '') + dl = DtsLine(i, raw, LineType.BLANK, depth, '', '', continuation=not prev_complete) out.append(dl) continue @@ -178,7 +185,7 @@ else LineType.COMMENT_BODY) if ltype == LineType.COMMENT_END: in_block_comment = False - dl = DtsLine(i, raw, ltype, depth, indent_str, stripped) + dl = DtsLine(i, raw, ltype, depth, indent_str, stripped, continuation=not prev_complete) out.append(dl) continue @@ -201,18 +208,10 @@ # structural classification entirely. if not code: ltype = LineType.COMMENT_START if opens_block else LineType.COMMENT - dl = DtsLine(i, raw, ltype, depth, indent_str, stripped) + dl = DtsLine(i, raw, ltype, depth, indent_str, stripped, continuation=not prev_complete) out.append(dl) continue - if not prev_complete: - dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code) - out.append(dl) - prev_complete = (code.endswith(';') or - code.endswith('{') or - code.endswith('};')) - continue - # NODE_CLOSE: the canonical form is "}" or "};" alone. A line # that is nothing but closures (e.g. "}; };") is still treated # as NODE_CLOSE for depth tracking, but the multi-closure case @@ -228,7 +227,10 @@ continue if code.endswith('{'): - dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code) + is_root = False + if re.search(r'&{/}\s*{', code) or re.search(r'^/\s*\{$', code): + is_root = True + dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code, is_root=is_root) parse_node_header(dl) out.append(dl) depth += 1 @@ -236,7 +238,8 @@ continue # Property (or first line of a multi-line property). - dl = DtsLine(i, raw, LineType.PROPERTY, depth, indent_str, code) + dl = DtsLine(i, raw, LineType.PROPERTY, depth, indent_str, code, + continuation=not prev_complete) parse_property_name(dl) out.append(dl) prev_complete = code.endswith(';') @@ -245,7 +248,7 @@ last_prop = None grouped = [] for dl in out: - if dl.linetype == LineType.CONTINUATION and last_prop is not None: + if dl.continuation and last_prop is not None: last_prop.continuations.append(dl) continue if dl.linetype == LineType.PROPERTY: @@ -272,7 +275,7 @@ def parse_property_name(dl): - m = re.match(r'^([a-zA-Z0-9#][a-zA-Z0-9,._+#-]*)\s*[=;]', dl.stripped) + m = re.match(r'^([a-zA-Z0-9#][a-zA-Z0-9,._+?#-]*)\s*[=;]', dl.stripped) if m: dl.prop_name = m.group(1) @@ -309,13 +312,13 @@ class Ctx: """Context passed to each rule check. Carries the parsed lines, - raw text, mode and kind.""" + raw text, mode and file_type.""" - def __init__(self, lines, text, mode, kind): + def __init__(self, lines, text, mode, file_type): self.lines = lines self.text = text - self.mode = mode # 'relaxed' or 'strict' - if kind in DTS_FAMILY: + self.mode = mode # 'relaxed', 'strict' or 'stricter' + if file_type in DTS_FAMILY: self.file_type = 'dts' else: self.file_type = 'yaml' @@ -327,7 +330,7 @@ def __init__(self, name, mode, description, check, applies_to=('yaml', 'dts', 'dtsi', 'dtso')): self.name = name - self.mode = mode # 'relaxed' or 'strict' + self.mode = mode # 'relaxed', 'strict' or 'stricter' self.description = description self.check = check self.applies_to = applies_to # input types this rule covers @@ -335,52 +338,8 @@ # --- individual rule check functions -------------------------------------- -def check_trailing_whitespace(ctx): - for dl in ctx.lines: - if dl.raw != dl.raw.rstrip(): - yield (dl.lineno, 'trailing whitespace') - -def check_tab_in_yaml_example(ctx): - """Reject literal tabs in DTS lines when input is YAML. - - For YAML examples, indent and content must use spaces. Tabs inside - a #define value are tolerated (those are CPP macros, not DTS). - For .dts files, this rule does not apply -- tabs are required. - """ - if ctx.file_type != 'yaml': - return - for dl in ctx.lines: - if dl.linetype == LineType.PREPROCESSOR: - continue - if dl.linetype == LineType.BLANK: - continue - if '\t' in dl.raw: - yield (dl.lineno, 'tab character not allowed in DTS example') - - -def check_mixed_indent_chars(ctx): - """Indent must be all-tabs, except for aligning indentation (comments - or continued lines).""" - for dl in ctx.lines: - if not dl.indent_str: - continue - if dl.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', dl.indent_str): - yield (dl.lineno, 'mixed tabs and spaces in indent') - if dl.indent_str.count(' ') > 7: - yield (dl.lineno, 'too many space characters in indent (more than 7)') - for cont in dl.continuations: - if not cont.indent_str: - continue - if cont.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', cont.indent_str): - yield (cont.lineno, 'mixed tabs and spaces in indent') - - -def detect_indent_unit(ctx): +def _detect_indent_unit(ctx): """Find the indent unit used at depth 1 in this block. Returns tuple of string (one of: ' ' (2 spaces), ' ' (4 spaces), @@ -406,105 +365,17 @@ return (None, None) -def check_indent_unit_relaxed(ctx): - """YAML examples: 2 or 4 spaces. Never tabs or other widths.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if unit not in (' ', ' '): - yield (lineno, 'indent unit must be 2 or 4 spaces, got %r' % unit) - - -def check_indent_unit_dts(ctx): - """DTS files: 1 tab per level. Always required.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if unit != '\t': - yield (lineno, 'indent unit must be 1 tab in DTS, got %r' % unit) - - -def check_indent_unit_strict(ctx): - """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed).""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if ctx.file_type == 'yaml': - if unit != ' ': - yield (lineno, 'indent unit must be 4 spaces in strict mode, ' - 'got %r' % unit) - - -def check_indent_consistent(ctx): - """All indented lines must be a multiple of the detected unit.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if ctx.file_type == 'yaml': - if unit not in (' ', ' '): - return # let check_indent_unit_* report this - else: - if unit != '\t': - return - - for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR): - continue - if dl.linetype == LineType.CONTINUATION: - continue # continuations align to <, not to indent unit - if dl.linetype in (LineType.COMMENT_BODY, LineType.COMMENT_END): - continue - if not dl.indent_str: - continue - # The indent must be 'unit' repeated dl.depth times, exactly. - # NODE_CLOSE lines have depth equal to the post-decrement value, - # which matches the indent expected. - expected = unit * dl.depth - if dl.indent_str != expected: - yield (dl.lineno, - 'indent mismatch (expected depth %d * %r)' % - (dl.depth, unit)) - - -def check_blank_lines(ctx): - """No two consecutive blank lines, no leading/trailing blank lines - in any node body.""" - lines = ctx.lines - # Consecutive blanks - for i in range(1, len(lines)): - if lines[i].linetype == LineType.BLANK and \ - lines[i - 1].linetype == LineType.BLANK: - yield (lines[i].lineno, 'consecutive blank lines') - # Blank right after { or right before } - for i, dl in enumerate(lines): - if dl.linetype != LineType.BLANK: - continue - prev = lines[i - 1] if i > 0 else None - nxt = lines[i + 1] if i + 1 < len(lines) else None - if prev is not None and prev.linetype == LineType.NODE_OPEN: - yield (dl.lineno, 'blank line at start of node body') - if nxt is not None and nxt.linetype == LineType.NODE_CLOSE: - yield (dl.lineno, 'blank line at end of node body') - - -def _walk_bodies(lines): - """Yield lists of immediate-child NODE_OPEN lines for each node body - in the input. Skips ref-nodes (&label) since those don't have an - intrinsic ordering.""" - body_stack = [[]] - for dl in lines: - if dl.linetype == LineType.NODE_OPEN: - body_stack[-1].append(dl) - body_stack.append([]) - continue - if dl.linetype == LineType.NODE_CLOSE: - if len(body_stack) <= 1: - # Unbalanced; ignore to avoid crashing on malformed input - continue - yield body_stack.pop() - continue - while body_stack: - yield body_stack.pop() +def _display_col(text): + """Visual column width of text, with tabs expanded to the next + 8-column stop, matching how printf and most editors render a + line and the kernel-wide line length convention.""" + col = 0 + for ch in text: + if ch == '\t': + col = (col // 8 + 1) * 8 + else: + col += 1 + return col def _natural_sort_key(s): @@ -519,14 +390,88 @@ return tuple(parts) +def _strip_strings_and_comments(text): + """Remove string literals and /* */ + // comments from a single + line, replacing them with empty strings. Used so syntactic checks + (whitespace, hex case, etc.) don't false-positive on contents of + quoted strings or comments. An unclosed /* on the line is treated + as a comment running to end of line.""" + text = re.sub(r'"(?:[^"\\]|\\.)*"', '""', text) + text = re.sub(r'/\*.*?\*/', '', text) + text = re.sub(r'/\*.*$', '', text) + text = re.sub(r'//.*$', '', text) + return text + + +def _walk_bodies(lines): + """Yield lists of immediate-child NODE_OPEN lines for each node body + in the input. Skips ref-nodes (&label) since those don't have an + intrinsic ordering.""" + # Array of stacked nodes (parent/child) + body_stack = [[]] + # Current stack of nodes, purely to track parent relationship for each node + node_stack = [] + parent_dl = None + for dl in lines: + if dl.linetype == LineType.NODE_OPEN: + dl.parent = parent_dl + node_stack.append(dl) + body_stack[-1].append(dl) + body_stack.append([]) + parent_dl = dl + continue + if dl.linetype == LineType.NODE_CLOSE: + if len(body_stack) <= 1: + # Unbalanced; ignore to avoid crashing on malformed input + continue + parent_dl = node_stack.pop().parent + yield body_stack.pop() + continue + while body_stack: + yield body_stack.pop() + + +def check_blank_lines(ctx): + """No two consecutive blank lines, no leading/trailing blank lines + in any node body.""" + lines = ctx.lines + # Consecutive blanks + for i in range(1, len(lines)): + if lines[i].linetype == LineType.BLANK and \ + lines[i - 1].linetype == LineType.BLANK: + yield (lines[i].lineno, 'consecutive blank lines') + prev_is_blank = lines[i].linetype == LineType.BLANK + for cont in lines[i].continuations: + if cont.linetype == LineType.BLANK and prev_is_blank: + yield (cont.lineno, 'consecutive blank lines') + prev_is_blank = cont.linetype == LineType.BLANK + + # Blank right after { or right before } + for i, dl in enumerate(lines): + if dl.linetype != LineType.BLANK: + continue + prev = lines[i - 1] if i > 0 else None + nxt = lines[i + 1] if i + 1 < len(lines) else None + if prev is not None and prev.linetype == LineType.NODE_OPEN: + yield (dl.lineno, 'blank line at start of node body') + if nxt is not None and nxt.linetype == LineType.NODE_CLOSE: + yield (dl.lineno, 'blank line at end of node body') + + def check_child_address_order(ctx): """Addressed siblings (foo@N) must appear in ascending address - order within their parent node body.""" + order within their parent node body. + Exception: Top-level in DTS follows name order, regardless of unit address + in memory@N and soc@N nodes + """ for children in _walk_bodies(ctx.lines): addressed = [] for c in children: if c.node_addr is None: continue + if c.parent and c.parent.is_root: + # Top-level does not use unit address sorting usually + continue try: parts = tuple(int(p, 16) for p in c.node_addr.split(',')) except ValueError: @@ -544,12 +489,16 @@ """Unaddressed siblings must appear in natural-sort order by node name within their parent node body. Addressed children are scoped by check_child_address_order; reference nodes (&label { ... }) and - the root node are skipped.""" + the root node are skipped. + However root node has children with and without unit address, and + sorting should be only by name.""" for children in _walk_bodies(ctx.lines): unaddressed = [] for c in children: if c.node_addr is not None: - continue + # Skip nodes with unit address, except when sorting top-level + if not c.parent or not c.parent.is_root: + continue if c.node_name in (None, '/'): continue if c.ref_name is not None: @@ -562,41 +511,245 @@ 'child node %r out of name order' % dl.node_name) -def _property_bucket(name): - """Return the canonical bucket index for a property: - 0 device_type +def check_continuation_alignment(ctx): + """A multi-line property's continuation lines must align their + first non-whitespace character to the display column of: + 1. the first '<' or '"' after the '=' in the leading line, if continuation is with '<' or '"' + 2. the first value, if the continuation is still the same phandle. + Display columns are used so tab-indented .dts files (where a continuation + aligns with tabs plus spaces) are compared correctly.""" + for dl in ctx.lines: + if dl.linetype != LineType.PROPERTY: + continue + if not dl.continuations: + continue + eq = dl.raw.find('=') + if eq < 0: + continue + # First '<' or '"' after '=', but ignore comments and strip trailing + # whitespace (e.g. remaining after removing the comment) + rest = _strip_strings_and_comments(dl.raw[eq + 1:]).rstrip() + m = re.search(r'\s*([<"])', rest) + if not m: + continue + dl_value_complete = rest.endswith('",') or rest.endswith('>,') + target_col = _display_col(_strip_strings_and_comments(dl.raw[:eq + 1 + m.start(1)])) + for cont in dl.continuations: + if cont.linetype == LineType.BLANK: + continue + target_offset = 0 + err_msg_explanation = 'to < or "' + if not dl_value_complete: + target_offset = 1 + err_msg_explanation = 'to the value under <' + if _display_col(cont.indent_str) != target_col + target_offset: + yield (cont.lineno, + 'continuation should align to column %d ' + '(%s)' % (target_col + target_offset + 1, err_msg_explanation)) + # Align to the value within <> or "" of continuation (so the previous line) + if len(cont.code): + dl_value_complete = cont.code.endswith('",') or cont.code.endswith('>,') + + +def _check_hex_case(dl): + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + return + for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): + lit = m.group(0) + if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': + yield (dl.lineno, + 'hex literal %r must be lowercase' % lit) + + +def check_hex_case(ctx): + """Hex literals (0xN) must use lowercase digits and prefix.""" + for dl in ctx.lines: + yield from _check_hex_case(dl) + for cont in dl.continuations: + yield from _check_hex_case(cont) + + +def check_indent_consistent(ctx): + """All indented lines must be a multiple of the detected unit.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if ctx.file_type == 'yaml': + if unit not in (' ', ' '): + return # let check_indent_unit_* report this + else: + if unit != '\t': + return + + for dl in ctx.lines: + if dl.continuation: + continue # continuations align to <, not to indent unit + if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR): + continue + if dl.linetype in (LineType.COMMENT_BODY, LineType.COMMENT_END): + continue + if not dl.indent_str: + continue + # The indent must be 'unit' repeated dl.depth times, exactly. + # NODE_CLOSE lines have depth equal to the post-decrement value, + # which matches the indent expected. + expected = unit * dl.depth + if dl.indent_str != expected: + yield (dl.lineno, + 'indent mismatch (expected depth %d * %r)' % + (dl.depth, unit)) + + +def check_indent_unit_dts(ctx): + """DTS files: 1 tab per level. Always required.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if unit != '\t': + yield (lineno, 'indent unit must be 1 tab in DTS, got %r' % unit) + + +def check_indent_unit_relaxed(ctx): + """YAML examples: 2 or 4 spaces. Never tabs or other widths.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if unit not in (' ', ' '): + yield (lineno, 'indent unit must be 2 or 4 spaces, got %r' % unit) + + +def check_indent_unit_strict(ctx): + """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed).""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if ctx.file_type == 'yaml': + if unit != ' ': + yield (lineno, 'indent unit must be 4 spaces in strict mode, ' + 'got %r' % unit) + + +def _check_line_length(dl): + if dl.linetype == LineType.BLANK: + return + cols = _display_col(dl.raw) + if cols > 80: + yield (dl.lineno, + 'line exceeds 80 columns (%d)' % cols) + + +def check_line_length(ctx): + """Lines must not exceed 80 columns; tabs count as 8 (see + _display_col).""" + for dl in ctx.lines: + yield from _check_line_length(dl) + for cont in dl.continuations: + yield from _check_line_length(cont) + + +def _check_mixed_indent_chars(dl): + if not dl.indent_str: + return + if dl.linetype == LineType.PREPROCESSOR: + return + if re.search(r' \t', dl.indent_str): + yield (dl.lineno, 'mixed tabs and spaces in indent') + if dl.indent_str.count(' ') > 7: + yield (dl.lineno, 'too many space characters in indent (more than 7)') + + +def check_mixed_indent_chars(ctx): + """Indent must be all-tabs, except for aligning indentation (comments + or continued lines).""" + for dl in ctx.lines: + yield from _check_mixed_indent_chars(dl) + for cont in dl.continuations: + yield from _check_mixed_indent_chars(cont) + + +def check_node_close_alone(ctx): + """The closing '};' of a node must be on its own line. The + classifier accepts a canonical "}" or "};" as NODE_CLOSE; a line + that is all closures (e.g. "}; };") is still NODE_CLOSE for depth + tracking but is flagged here via dl.closures. Any other line that + still contains '};' (in code, not in strings or comments) is + mixing a node close with something else.""" + for dl in ctx.lines: + if dl.linetype == LineType.NODE_CLOSE: + if dl.closures > 1: + yield (dl.lineno, + 'closing brace must be on its own line') + continue + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + continue + if '};' in dl.code: + yield (dl.lineno, + 'closing brace must be on its own line') + + +def check_node_name(ctx): + """Only recommended characters are used in node names.""" + for dl in ctx.lines: + if not dl.node_name in (None, '/'): + if not re.match(r'[0-9a-z][0-9a-z-]*(?<!-)$', dl.node_name): + yield (dl.lineno, f'node name "{dl.node_name}" is using discouraged style') + + +def check_property_name(ctx): + """Only recommended characters are used in property names.""" + for dl in ctx.lines: + if dl.prop_name: + exceptions = ['cpu_off', 'cpu_on', 'cpu_suspend', + 'device_type', 'dr_mode', + 'mmc-hs200-1_2v', 'mmc-hs200-1_8v', 'mmc-hs400-1_2v', 'mmc-hs400-1_8v', + 'opp-avg-kBps', 'opp-peak-kBps', 'phy_type'] + + if re.match(r'\#([0-9a-z][0-9a-z-]*(?<!-),)?[a-z-]+-cells$', dl.prop_name): + continue + if dl.prop_name in exceptions: + continue + if not re.match(r'([0-9a-z][0-9a-z-]*(?<!-),)?[0-9a-z][0-9a-z-]*(?<!-)$', dl.prop_name): + yield (dl.lineno, f'property name "{dl.prop_name}" is using discouraged style') + + +def _property_bucket(name, is_root=False): + """Return the canonical bucket (group) index for a property: + 0 device_type ('model' in the root node) 1 compatible - 2 reg / reg-names + 2 reg, reg-names 3 ranges 4 standard properties (no vendor comma in #-stripped name) 5 vendor-specific properties 6 status - Plus a sub-key inside the bucket for fixed slots (device_type, compatible, - reg, reg-names, ranges, status). 'standard' and 'vendor' return None for - the sub-key, signalling that the within-bucket key is computed by - the pairing rules.""" + Properties sharing a bucket compare equal: their relative order + within the group is not checked, only the pairing rules below + apply.""" stripped = name.lstrip('#') - if name == 'device_type': - return (0, 0) + if is_root: + if name == 'model': + return 0 + elif name == 'device_type': + return 0 if name == 'compatible': - return (1, 0) - if name == 'reg': - return (2, 0) - if name == 'reg-names': - return (2, 1) + return 1 + if name in ('reg', 'reg-names'): + return 2 if name == 'ranges': - return (3, 0) + return 3 if name == 'status': - return (6, 0) - return (5 if ',' in stripped else 4, None) + return 6 + return 5 if ',' in stripped else 4 # Declarative pairing rules: each is a callable # (name, all_names) -> anchor_name_or_None -# If a rule returns an anchor, the property sorts immediately after the +# If a rule returns an anchor, the property must be placed after the # anchor. Rules are tried in order; the first match wins. If none -# matches, the within-bucket key falls back to natural sort by the -# #-stripped name. +# matches, the property can be placed anywhere within its bucket. def _pair_pinctrl_names(name, all_names): """pinctrl-names follows the highest pinctrl-N in the same node.""" @@ -611,8 +764,7 @@ def _pair_x_names(name, all_names): """Generic <x>-names follows its owning property. The owner is usually plural (clocks/clock-names, dmas/dma-names, - resets/reset-names) but occasionally singular (reg/reg-names is - handled by the fixed slot above; this rule catches anything else).""" + resets/reset-names) but occasionally singular (reg/reg-names).""" if not name.endswith('-names'): return None base = name[:-len('-names')] @@ -627,30 +779,27 @@ PAIRING_RULES = (_pair_pinctrl_names, _pair_x_names) -def _property_sort_key(name, all_names): - """Sort key for a property among its node-body siblings. - - Format: (bucket, within_key, tiebreak). 'within_key' for - standard/vendor buckets follows pairing rules: a property paired - with anchor X sorts as if it were X with a higher tiebreak.""" - bucket, fixed_sub = _property_bucket(name) - if fixed_sub is not None: - return (bucket, (), fixed_sub) - +def _property_anchor(name, all_names): + """Return the property this one must be placed after, or None.""" for rule in PAIRING_RULES: anchor = rule(name, all_names) if anchor is not None: - return (bucket, _natural_sort_key(anchor.lstrip('#')), 1) - - return (bucket, _natural_sort_key(name.lstrip('#')), 0) + return anchor + return None def check_property_order(ctx): - """Properties within a node body must appear in canonical order: - compatible, reg(/reg-names), ranges, then the standard group, then - the vendor-specific group, then status. Inside the standard and - vendor groups, pairing rules apply (e.g. <x>-names follows <x>); - everything else falls back to natural sort by the #-stripped name.""" + """Properties within a node body must be grouped in canonical + order: device_type ('model' for the root node), compatible, + reg(/reg-names), ranges, then the standard group, then the + vendor-specific group, then status. + + The order of properties within one group is free, e.g. it does not + matter whether '#address-cells' comes before or after 'clocks'. + Paired properties still keep their relative order: <x>-names + follows <x> (clocks/clock-names, reg/reg-names, ...), pinctrl-names + follows the pinctrl-N states and #size-cells follows + #address-cells.""" lines = ctx.lines for i, dl in enumerate(lines): if dl.linetype != LineType.NODE_OPEN: @@ -668,29 +817,62 @@ if len(props) < 2: continue all_names = [p.prop_name for p in props] - keyed = [(p, _property_sort_key(p.prop_name, all_names)) - for p in props] - for k in range(1, len(keyed)): - if keyed[k][1] < keyed[k - 1][1]: - p = keyed[k][0] - prev = keyed[k - 1][0] - yield (p.lineno, - 'property %r out of canonical order ' - '(should sort before %r)' % - (p.prop_name, prev.prop_name)) + buckets = [_property_bucket(p.prop_name, dl.is_root) for p in props] + findings = [] + # Group (bucket) order + for k in range(1, len(props)): + if buckets[k] < buckets[k - 1]: + findings.append((props[k].lineno, + 'property %r out of canonical order ' + '(should sort before %r)' % + (props[k].prop_name, + props[k - 1].prop_name))) + # Pairing within a group: the anchor must come first + seen = set() + for p in props: + anchor = _property_anchor(p.prop_name, all_names) + if anchor is not None and anchor not in seen: + findings.append((p.lineno, + 'property %r must be placed after %r' % + (p.prop_name, anchor))) + seen.add(p.prop_name) + yield from sorted(findings) -def _strip_strings_and_comments(text): - """Remove string literals and /* */ + // comments from a single - line, replacing them with empty strings. Used so syntactic checks - (whitespace, hex case, etc.) don't false-positive on contents of - quoted strings or comments. An unclosed /* on the line is treated - as a comment running to end of line.""" - text = re.sub(r'"(?:[^"\\]|\\.)*"', '""', text) - text = re.sub(r'/\*.*?\*/', '', text) - text = re.sub(r'/\*.*$', '', text) - text = re.sub(r'//.*$', '', text) - return text +def _check_redundant_whitespace(dl): + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + return + if re.search(r'(\s\s+|\t)\{', dl.code): + yield (dl.lineno, 'extra whitespace before {') + if re.search(r':(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after :') + if re.search(r'\s+;', dl.code): + yield (dl.lineno, 'extra whitespace before ;') + + +def check_redundant_whitespace(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + yield from _check_redundant_whitespace(dl) + for cont in dl.continuations: + yield from _check_redundant_whitespace(cont) + + +def check_redundant_whitespace_strict(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + continue + if re.search(r'(\s\s+|\t)=', dl.code): + yield (dl.lineno, 'extra whitespace before =') + if re.search(r'=(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after =') def check_required_blank_lines(ctx): @@ -710,6 +892,8 @@ if d.linetype == LineType.NODE_CLOSE and \ d.depth == body_depth - 1 and depth_inside == 0: break + if d.continuation: + continue # Track depth inside nested children so we only look at # immediate-body items. if d.linetype == LineType.NODE_OPEN and \ @@ -729,8 +913,6 @@ LineType.COMMENT_BODY, LineType.COMMENT_END, LineType.PREPROCESSOR): continue - if d.linetype == LineType.CONTINUATION: - continue needs_blank = False if d.linetype == LineType.NODE_OPEN: @@ -752,19 +934,58 @@ between_blanks = 0 -def check_hex_case(ctx): - """Hex literals (0xN) must use lowercase digits and prefix.""" +def check_tab_in_yaml_example(ctx): + """Reject literal tabs in DTS lines when input is YAML. + + For YAML examples, indent and content must use spaces. Tabs inside + a #define value are tolerated (those are CPP macros, not DTS). + For .dts files, this rule does not apply -- tabs are required. + """ + if ctx.file_type != 'yaml': + return for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): + if dl.linetype == LineType.PREPROCESSOR: continue - text = _strip_strings_and_comments(dl.raw) - for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', text): - lit = m.group(0) - if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': - yield (dl.lineno, - 'hex literal %r must be lowercase' % lit) + if dl.linetype == LineType.BLANK: + continue + if '\t' in dl.raw: + yield (dl.lineno, 'tab character not allowed in DTS example') + for cont in dl.continuations: + if '\t' in cont.raw: + yield (cont.lineno, 'tab character not allowed in DTS example') + + +def _check_trailing_whitespace(dl): + if dl.raw != dl.raw.rstrip(): + yield (dl.lineno, 'trailing whitespace') + + +def check_trailing_whitespace(ctx): + for dl in ctx.lines: + yield from _check_trailing_whitespace(dl) + for cont in dl.continuations: + yield from _check_trailing_whitespace(cont) + + +def check_unclosed_block_comment(ctx): + """Every /* must have a matching */ in the same block. Catches both + a comment opened on its own line (COMMENT_START) and a tail comment + opened on a PROPERTY or other code line (where in_block_comment is + set by _split_code so the next line becomes COMMENT_BODY without a + preceding COMMENT_START).""" + open_lineno = None + for dl in ctx.lines: + if dl.linetype == LineType.COMMENT_START: + open_lineno = dl.lineno + elif dl.linetype == LineType.COMMENT_END: + open_lineno = None + elif dl.linetype == LineType.COMMENT_BODY and open_lineno is None: + # Block was opened by a /* tail on a code line; report at + # the first orphan body line since the originating line is + # already classified as something else. + open_lineno = dl.lineno + if open_lineno is not None: + yield (open_lineno, 'unclosed /* block comment') def check_unit_address_format(ctx): @@ -798,6 +1019,17 @@ break +def check_unused_labels(ctx): + """Labels defined but never referenced are clutter.""" + defined, referenced = collect_labels_and_refs(ctx.text) + for label in sorted(defined - referenced): + # Find the line where this label is defined for line-number + # reporting. + m = re.search(r'(?m)^.*\b' + re.escape(label) + r'\s*:', ctx.text) + lineno = ctx.text[:m.start()].count('\n') + 1 if m else 1 + yield (lineno, 'label %r defined but never &-referenced' % label) + + def check_value_whitespace(ctx): """A <...> cell list must have no whitespace directly after '<' or directly before '>'. Continuation lines are joined onto the @@ -808,9 +1040,9 @@ for dl in ctx.lines: if dl.linetype != LineType.PROPERTY: continue - segs = [_strip_strings_and_comments(dl.raw).strip()] + segs = [dl.code.strip()] for cont in dl.continuations: - segs.append(_strip_strings_and_comments(cont.stripped).strip()) + segs.append(cont.code.strip()) text = '' for s in segs: if not s: @@ -826,131 +1058,13 @@ break -def check_node_close_alone(ctx): - """The closing '};' of a node must be on its own line. The - classifier accepts a canonical "}" or "};" as NODE_CLOSE; a line - that is all closures (e.g. "}; };") is still NODE_CLOSE for depth - tracking but is flagged here via dl.closures. Any other line that - still contains '};' (in code, not in strings or comments) is - mixing a node close with something else.""" - for dl in ctx.lines: - if dl.linetype == LineType.NODE_CLOSE: - if dl.closures > 1: - yield (dl.lineno, - 'closing brace must be on its own line') - continue - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): - continue - text = _strip_strings_and_comments(dl.raw) - if '};' in text: - yield (dl.lineno, - 'closing brace must be on its own line') - - -def _display_col(text): - """Visual column width of text, with tabs expanded to the next - 8-column stop, matching how printf and most editors render a - line and the kernel-wide line length convention.""" - col = 0 - for ch in text: - if ch == '\t': - col = (col // 8 + 1) * 8 - else: - col += 1 - return col - - -def check_line_length(ctx): - """Lines must not exceed 80 columns; tabs count as 8 (see - _display_col).""" - for dl in ctx.lines: - if dl.linetype == LineType.BLANK: - continue - cols = _display_col(dl.raw) - if cols > 80: - yield (dl.lineno, - 'line exceeds 80 columns (%d)' % cols) - - -def check_continuation_alignment(ctx): - """A multi-line property's continuation lines must align their - first non-whitespace character to the display column of the first - '<' or '"' after the '=' in the leading line. Display columns are - used so tab-indented .dts files (where a continuation aligns with - tabs plus spaces) are compared correctly.""" - for dl in ctx.lines: - if dl.linetype != LineType.PROPERTY: - continue - if not dl.continuations: - continue - eq = dl.raw.find('=') - if eq < 0: - continue - # First '<' or '"' after '=' - rest = dl.raw[eq + 1:] - m = re.search(r'[<"]', rest) - if not m: - continue - target_col = _display_col(dl.raw[:eq + 1 + m.start()]) - for cont in dl.continuations: - if _display_col(cont.indent_str) != target_col: - yield (cont.lineno, - 'continuation should align to column %d ' - '(under "<" or \\")' % (target_col + 1)) - - -def check_unclosed_block_comment(ctx): - """Every /* must have a matching */ in the same block. Catches both - a comment opened on its own line (COMMENT_START) and a tail comment - opened on a PROPERTY or other code line (where in_block_comment is - set by _split_code so the next line becomes COMMENT_BODY without a - preceding COMMENT_START).""" - open_lineno = None - for dl in ctx.lines: - if dl.linetype == LineType.COMMENT_START: - open_lineno = dl.lineno - elif dl.linetype == LineType.COMMENT_END: - open_lineno = None - elif dl.linetype == LineType.COMMENT_BODY and open_lineno is None: - # Block was opened by a /* tail on a code line; report at - # the first orphan body line since the originating line is - # already classified as something else. - open_lineno = dl.lineno - if open_lineno is not None: - yield (open_lineno, 'unclosed /* block comment') - - -def check_unused_labels(ctx): - """Labels defined but never referenced are clutter.""" - defined, referenced = collect_labels_and_refs(ctx.text) - for label in sorted(defined - referenced): - # Find the line where this label is defined for line-number - # reporting. - m = re.search(r'(?m)^.*\b' + re.escape(label) + r'\s*:', ctx.text) - lineno = ctx.text[:m.start()].count('\n') + 1 if m else 1 - yield (lineno, 'label %r defined but never &-referenced' % label) - - # --- registry -------------------------------------------------------------- RULES = [ # 'relaxed' is the default; rules in this group must produce zero # output on a clean kernel tree (post the small prep-cleanup # commit at the head of this series). - Rule('trailing-whitespace', 'relaxed', - 'no trailing whitespace on any line', - check_trailing_whitespace), - Rule('tab-in-yaml', 'relaxed', - 'YAML (also DTS examples) may not contain tab characters', - check_tab_in_yaml_example, applies_to=('yaml',)), - Rule('mixed-indent-chars', 'relaxed', - 'indent must not mix tabs and spaces', - check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')), - Rule('unclosed-block-comment', 'relaxed', - 'every /* block comment must close with */', - check_unclosed_block_comment), + # Rules are sorted here by group (relaxed, strict, stricter) and name # DTS files always use tabs; this is not negotiable per kernel # coding style (.dts files are real source). Relaxed mode. @@ -958,19 +1072,26 @@ 'DTS files: 1 tab per nesting level', check_indent_unit_dts, applies_to=('dts', 'dtsi', 'dtso')), + Rule('mixed-indent-chars', 'relaxed', + 'indent must not mix tabs and spaces', + check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')), + # See also check_redundant_whitespace_strict() and check_value_whitespace() + Rule('redundant-whitespace', 'relaxed', + 'no redundant whitespace within code', + check_redundant_whitespace), + Rule('tab-in-yaml', 'relaxed', + 'YAML (also DTS examples) may not contain tab characters', + check_tab_in_yaml_example, applies_to=('yaml',)), + Rule('trailing-whitespace', 'relaxed', + 'no trailing whitespace on any line', + check_trailing_whitespace), + Rule('unclosed-block-comment', 'relaxed', + 'every /* block comment must close with */', + check_unclosed_block_comment), # 'strict' rules are opt-in (e.g. for new submissions via # checkpatch.pl in a follow-up series). They flag many existing # files and can be promoted to relaxed once those are cleaned up. - Rule('indent-unit', 'strict', - 'YAML: 2 or 4 spaces per level', - check_indent_unit_relaxed, applies_to=('yaml',)), - Rule('indent-unit-strict', 'strict', - 'YAML: must be 4 spaces per level', - check_indent_unit_strict, applies_to=('yaml',)), - Rule('indent-consistent', 'strict', - 'every line indented at depth * unit', - check_indent_consistent), Rule('blank-lines', 'strict', 'no consecutive blanks; no blanks at node body edges', check_blank_lines), @@ -980,45 +1101,72 @@ Rule('child-name-order', 'strict', 'unaddressed siblings must be in natural-sort name order', check_child_name_order), - Rule('property-order', 'strict', - 'canonical bucket + pairing + natural-sort order of properties', - check_property_order), - Rule('required-blank-lines', 'strict', - 'blank line before child nodes and before "status"', - check_required_blank_lines), + Rule('continuation-alignment', 'strict', + 'multi-line property continuations align under <, " or the value under <', + check_continuation_alignment), Rule('hex-case', 'strict', 'hex literals must be lowercase', check_hex_case), - Rule('unit-address-format', 'strict', - 'unit addresses must be lowercase hex without leading zeros', - check_unit_address_format), - Rule('value-whitespace', 'strict', - 'no whitespace directly inside <...> brackets', - check_value_whitespace), + Rule('indent-consistent', 'strict', + 'every line indented at depth * unit', + check_indent_consistent), + Rule('indent-unit', 'strict', + 'YAML: 2 or 4 spaces per level', + check_indent_unit_relaxed, applies_to=('yaml',)), + Rule('indent-unit-strict', 'strict', + 'YAML: must be 4 spaces per level', + check_indent_unit_strict, applies_to=('yaml',)), + Rule('line-length', 'strict', + 'lines must not exceed 80 columns', + check_line_length, applies_to=('yaml',)), + Rule('line-length-dts', 'stricter', + 'lines must not exceed 80 columns', + check_line_length, applies_to=('dts', 'dtsi', 'dtso')), Rule('node-close-alone', 'strict', 'closing brace must be on its own line', check_node_close_alone), - Rule('line-length', 'strict', - 'lines must not exceed 80 columns', - check_line_length), - Rule('continuation-alignment', 'strict', - 'multi-line property continuations align under "<" or "\\""', - check_continuation_alignment), + Rule('node-name', 'strict', + 'node names use only recommended characters (see DTS Coding Style)', + check_node_name), + Rule('property-name', 'strict', + 'property names use only recommended characters (see DTS Coding Style)', + check_property_name), + Rule('property-order', 'strict', + 'canonical group + pairing order of properties (order within ' + 'a group is not checked)', + check_property_order), + # See also check_redundant_whitespace() and check_value_whitespace() + Rule('redundant-whitespace-strict', 'strict', + 'no redundant whitespace within code', + check_redundant_whitespace_strict), + Rule('required-blank-lines', 'strict', + 'blank line before child nodes and before "status"', + check_required_blank_lines), + Rule('unit-address-format', 'strict', + 'unit addresses must be lowercase hex without leading zeros', + check_unit_address_format), Rule('unused-labels', 'strict', 'every label must be &-referenced in the same example/file ' '(skipped for .dtsi/.dtso since labels there are exported)', - check_unused_labels, applies_to=('yaml', 'dts')), + check_unused_labels, applies_to=('yaml',)), + Rule('unused-labels-dts', 'stricter', + 'every label must be &-referenced in the same example/file ' + '(skipped for .dtsi/.dtso since labels there are exported)', + check_unused_labels, applies_to=('dts',)), + Rule('value-whitespace', 'strict', + 'no whitespace directly inside <...> brackets', + check_value_whitespace), ] -def select_rules(mode, input_kind): +def select_rules(mode, file_type): """Return rules that apply to the given mode and input type.""" - rank = {'relaxed': 0, 'strict': 1} + rank = {'relaxed': 0, 'strict': 1, 'stricter': 2} out = [] for r in RULES: if rank[r.mode] > rank[mode]: continue - if input_kind not in r.applies_to: + if file_type not in r.applies_to: continue out.append(r) return out @@ -1028,12 +1176,12 @@ # Block runner # --------------------------------------------------------------------------- -def check_block(text, mode, input_type): +def check_block(text, mode, file_type): """Run all selected rules on a single block of DTS text. Returns a list of (lineno, rule_name, message) tuples.""" lines = classify_lines(text) - ctx = Ctx(lines, text, mode, input_type) - rules = select_rules(mode, input_type) + ctx = Ctx(lines, text, mode, file_type) + rules = select_rules(mode, file_type) findings = [] for r in rules: for lineno, msg in r.check(ctx): @@ -1090,7 +1238,7 @@ # Top-level processing # --------------------------------------------------------------------------- -def input_kind(filepath): +def get_file_type(filepath): p = filepath.lower() if p.endswith('.yaml') or p.endswith('.yml'): return 'yaml' @@ -1110,17 +1258,17 @@ def collect_findings(filepath, mode): """Return a (lines, count) pair for filepath. lines is a list of formatted output strings; count is the number of findings.""" - kind = input_kind(filepath) - if kind == 'yaml': + file_type = get_file_type(filepath) + if file_type == 'yaml': iterator = iter_yaml_examples(filepath) - elif kind in DTS_FAMILY: + elif file_type in DTS_FAMILY: iterator = iter_dts_file(filepath) else: return (['%s: unknown file type, skipping' % filepath], 0) out = [] for text, base, idx in iterator: - for lineno, rule, msg in check_block(text, mode, kind): + for lineno, rule, msg in check_block(text, mode, file_type): abs_line = base + lineno - 1 ex_tag = '' if idx is None else ' example %d' % idx out.append('%s:%d:%s [%s] %s' % @@ -1141,7 +1289,7 @@ description='Check DTS coding style on YAML examples and ' '.dts/.dtsi/.dtso files.', fromfile_prefix_chars='@') - ap.add_argument('--mode', choices=('relaxed', 'strict'), + ap.add_argument('--mode', choices=('relaxed', 'strict', 'stricter'), default='relaxed', help='which rule set to apply (default: relaxed)') ap.add_argument('-j', '--jobs', type=int, default=0,
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts b/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts new file mode 100644 index 0000000..f2e99fb --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts
@@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + + reg = <0x10000 0x1000>; + + clocks = <1 2 3>, + + + /* Comment is not a blank line */ + <4 5 6>, + + /* Comment is not a blank line */ + <7 8 9>; + + + interrupts = <1>; + + /* Comment is not a blank line */ + qcom,calibration-variant = "foo"; + }; + + + interrupt-controller@20000 { + + compatible = "example,intc"; + reg = <0x20000 0x1000>; + + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso new file mode 100644 index 0000000..74b49be --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso
@@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label = "foo"; + }; + + label_bar: bar { + label = "bar"; + }; + }; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu-2 { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts new file mode 100644 index 0000000..91a7488 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts
@@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + clocks = <1 2 3>, /* comments with " < , should not matter */ + <4 5 6>, + /* but comments should be placed properly */ + <7 8 9>; + interrupts = <1 2 3>, /* comments with " < , should not ... */ + <4 5 6>, + <7 8 9>; + pinmux = <0x01 + 0x02>, + <0x03 + 0x04>; + power-domain-names = "foo", + "bar", /* comments with " < , should not */ + "baz"; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts new file mode 100644 index 0000000..74c95639 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts
@@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso new file mode 100644 index 0000000..052c029 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso
@@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso new file mode 100644 index 0000000..d9cf670 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso
@@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label = "foo"; + }; + + label_bar: bar { + label = "bar"; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso new file mode 100644 index 0000000..4b2cf60 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + soc: soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&soc { + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts new file mode 100644 index 0000000..adf40e3 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts
@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Line length in DTS + */ + +/dts-v1/; + +/ { + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + foo@1000 { + compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah", + "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second"; + reg = <0x1000 0x100>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-node-name.dts b/scripts/dtc/dt-style-selftest/bad/dts-node-name.dts new file mode 100644 index 0000000..b897cbd --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-node-name.dts
@@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + foo_bar { + compatible = "example,test-node-name"; + }; + + foo,bar { + compatible = "example,test-node-name"; + }; + + foo.bar { + compatible = "example,test-node-name"; + }; + + foo+bar { + compatible = "example,test-node-name"; + }; + + foo-bar- { + compatible = "example,test-node-name"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + foo_bar@1000 { + compatible = "example,test-node-name"; + reg = <0x1000 0x100>; + }; + + foo,bar@2000 { + compatible = "example,test-node-name"; + reg = <0x2000 0x100>; + }; + + foo.bar@3000 { + compatible = "example,test-node-name"; + reg = <0x3000 0x100>; + }; + + foo+bar@4000 { + compatible = "example,test-node-name"; + reg = <0x4000 0x100>; + }; + + foo-bar-@5000 { + compatible = "example,test-node-name"; + reg = <0x5000 0x100>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts new file mode 100644 index 0000000..110e33a --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts
@@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + foo { + compatible = "example,test-property-name"; + + property#foo; + property+foo; + property-foo; + property-foo-; + property.foo; + property?foo; + property_foo; + + vendor,property#foo; + vendor,property+foo; + vendor,property,foo; + vendor,property-foo; + vendor,property-foo-; + vendor,property.foo; + vendor,property?foo; + vendor,property_foo; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts index f31abb6..eb36daa 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts
@@ -6,6 +6,11 @@ /dts-v1/; / { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; + qcom,board-id = <8 0>; + chassis-type = "handset"; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -38,6 +43,19 @@ interrupt-controller@10000 { <4 5 6>, <7 8 9>; compatible = "example,intc"; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; }; }; }; + +/ { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; + +/{ + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso new file mode 100644 index 0000000..b2e564f --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso
@@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; +/plugin/; + +&{/} { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; + qcom,board-id = <8 0>; + chassis-type = "handset"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + reg = <0x0 0x0>; + compatible = "arm,cortex-a57"; + device_type = "cpu"; + enable-method = "psci"; + }; + }; + + pmu { + compatible = "example,pmu"; + + status = "disabled"; + dma-coherent; + }; + + soc@0 { + ranges = <0 0 0 0xc0000000>; + compatible = "simple-bus"; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + reg = <0x10000 0x1000>; + interrupts = <1 2 3>, + <4 5 6>, + <7 8 9>; + compatible = "example,intc"; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; + }; + }; +}; + +&{/} { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; + +&{/}{ + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts new file mode 100644 index 0000000..201e394 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts
@@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +#define SOME_MACRO(foo) \ + (foo) ? <1> : <2> ; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + /* comments { are okay = though ; */ + soc: soc@0 { /* comments { are okay = though ; */ + compatible = "simple-bus"; /* comments { are okay = though ; */ + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + } ; +}; /* comments { are okay = though ; */ + +&soc { + serial: serial@20000 { /* comments { are okay = though ; */ + compatible = "example,serial"; + reg = <0x20000 0x1000>; + } ; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts new file mode 100644 index 0000000..f6480dd --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts
@@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +#define SOME_MACRO(foo) \ + (foo) ? <1> : <2> ; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + /* comments { are okay = though ; */ + soc: soc@0 { /* comments { are okay = though ; */ + compatible = "simple-bus"; /* comments { are okay = though ; */ + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + } ; +}; /* comments { are okay = though ; */ + +&soc { + serial: serial@20000 { /* comments { are okay = though ; */ + compatible = "example,serial"; + reg = <0x20000 0x1000>, + <0x30000 0x1000> ; + } ; /* comments { are okay = though ; */ +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso new file mode 100644 index 0000000..01d94e1 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts new file mode 100644 index 0000000..73c2452 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts
@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + clocks = <1 2 3>, + <4 5 6>, + <7 8 9>; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts b/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts new file mode 100644 index 0000000..90802ae --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts
@@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Unused label in DTS + */ + +/dts-v1/; + +/ { + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + dev: device@1000 { + compatible = "example,test-unused-label"; + reg = <0x1000 0x100>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml new file mode 100644 index 0000000..a58cd53 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml
@@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-bad-blank-lines.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with too many blank lines + +maintainers: + - Test User <test@example.com> + +properties: + compatible: + const: example,test-blank-lines + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-blank-lines"; + + reg = <0x1000 0x100>; + + clocks = <1 2 3>, + + + /* Comment is not a blank line */ + <4 5 6>, + + /* Comment is not a blank line */ + <7 8 9>; + + + interrupts = <1>; + + /* Comment is not a blank line */ + qcom,calibration-variant = "foo"; + }; + + + foo@2000 { + + compatible = "example,test-blank-lines"; + + reg = <0x2000 0x100>; + + };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml index 3df56e6..7c3b731 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml
@@ -7,7 +7,7 @@ title: Test fixture with addressed children out of order maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml index 35d85e5..f348303 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml
@@ -7,7 +7,7 @@ title: Test fixture with unaddressed children out of name order maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml index 9277854..0189b65 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml
@@ -7,7 +7,7 @@ title: Test fixture with mis-aligned multi-line property maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -25,6 +25,9 @@ - | foo@1000 { compatible = "example,test-cont-align"; - reg = <0x1000 0x100>, - <0x2000 0x100>; + reg = <0x1000 0x100>, /* comments with " < , should not matter */ + <0x2000 0x100>, /* comments with " < , should not matter */ + /* but comments should be placed properly */ + <0x3000 + 0x100>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml index 44a9d25..068542a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml
@@ -7,7 +7,7 @@ title: Test fixture with digit-leading nodes out of address order maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml index b26d1bf..b0b8683 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml
@@ -7,7 +7,7 @@ title: Test fixture with uppercase hex literals maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -25,5 +25,8 @@ - | foo@1000 { compatible = "example,test-hex-case"; - reg = <0xABCD 0x100>; + reg = <0xABCD 0x100>, + <0x2BCD 0x100>, + <0x3BCD + 0x100>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml index bee4cf1..155060a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml
@@ -7,7 +7,7 @@ title: Test fixture using 2-space indent (rejected by strict mode) maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml index ba51286..4a69b50 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml
@@ -7,7 +7,7 @@ title: Test fixture where a label is only "referenced" inside a string maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml index 64427bf..6b1209e 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml
@@ -7,7 +7,7 @@ title: Test fixture exceeding 80 columns maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -24,6 +24,7 @@ examples: - | foo@1000 { - compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah"; + compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah", + "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second"; reg = <0x1000 0x100>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml index 5401d1a..4f76188 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml
@@ -7,7 +7,7 @@ title: Test fixture mixing tabs and spaces in indent maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -26,4 +26,6 @@ device@1000 { compatible = "example,test-mixed"; reg = <0x1000 0x100>; + clocks = <1>, + <2>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml index 4d9fa27..afc202a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml
@@ -7,7 +7,7 @@ title: Test fixture with two closing braces on one line maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml index e107659..9e714f7 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml
@@ -7,7 +7,7 @@ title: Test fixture with closing brace not on its own line maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml new file mode 100644 index 0000000..03373ca --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml
@@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-node-name.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with incorrect node names + +maintainers: + - Rob Herring <robh@kernel.org> + +properties: + compatible: + const: example,test-node-name + reg: + maxItems: 1 + +required: + - compatible + +additionalProperties: false + +examples: + - | + foo_bar@1000 { + compatible = "example,test-node-name"; + reg = <0x1000 0x100>; + }; + + foo,bar@2000 { + compatible = "example,test-node-name"; + reg = <0x2000 0x100>; + }; + + foo.bar@3000 { + compatible = "example,test-node-name"; + reg = <0x3000 0x100>; + }; + + foo+bar@4000 { + compatible = "example,test-node-name"; + reg = <0x4000 0x100>; + }; + + foo-bar-@5000 { + compatible = "example,test-node-name"; + reg = <0x5000 0x100>; + }; + + // TODO handle also "-foo-bar" which is against spec but accepted by DTC + + foo_bar { + compatible = "example,test-node-name"; + };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml index e2c69e9..c71fb2c 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml
@@ -7,7 +7,7 @@ title: Test fixture with device_type maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml index 75582a3..4d8a50d 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml
@@ -7,7 +7,7 @@ title: Test fixture with reg before compatible maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -26,4 +26,9 @@ device@1000 { reg = <0x1000 0x100>; compatible = "example,test-prop-order"; + + interrupts = <1>; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml index 767ab21..51abc54 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml
@@ -7,7 +7,7 @@ title: Test fixture exercising <x>-names and pinctrl-names pairing maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml new file mode 100644 index 0000000..08e0d1e --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml
@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-property-name.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with incorrect property names + +maintainers: + - Rob Herring <robh@kernel.org> + +properties: + compatible: + const: example,test-property-name + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-property-name"; + reg = <0x1000 0x100>; + + property#foo; + property+foo; + property-foo; + property-foo-; + property.foo; + property?foo; + property_foo; + + vendor,property#foo; + vendor,property+foo; + vendor,property,foo; + vendor,property-foo; + vendor,property-foo-; + vendor,property.foo; + vendor,property?foo; + vendor,property_foo; + };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml new file mode 100644 index 0000000..739c44f --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml
@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/yaml-redundant-ws-strict.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with redundant whitespace + +maintainers: + - Rob Herring <robh@kernel.org> + +properties: + compatible: + const: example,test-redundant + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + device@1000 { + compatible = "example,test-trailing"; + reg = <0x1000 0x100>; + clocks = <&clk 0>; /* comments { are okay = though ; */ + clock-names = "bus"; /* comments { are okay = though ; */ + } ;
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml new file mode 100644 index 0000000..b2f5196 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml
@@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/yaml-redundant-ws.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with redundant whitespace + +maintainers: + - Rob Herring <robh@kernel.org> + +properties: + compatible: + const: example,test-redundant + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + device@1000 { /* comments { are okay = though ; */ + compatible = "example,test-trailing"; + reg = <0x1000 0x100>, + <0x3000 0x100> ; + } ; + + device@2000 { /* comments { are okay = though ; */ + compatible = "example,test-trailing"; + reg = <0x2000 0x100>; + }; /* comments { are okay = though ; */
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml index 8bb5324..0036d5e 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml
@@ -7,7 +7,7 @@ title: Test fixture missing required blank lines maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml index 487d07f..937ecdd 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml
@@ -7,7 +7,7 @@ title: Test fixture with a tab in a DTS line maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml index 2368ada..695d046 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml
@@ -7,7 +7,7 @@ title: Test fixture with properties out of order behind trailing comments maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml index 5c4b4bd..17eeed3 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml
@@ -7,7 +7,7 @@ title: Test fixture with trailing whitespace maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible: @@ -25,5 +25,8 @@ - | device@1000 { compatible = "example,test-trailing"; - reg = <0x1000 0x100>; + reg = <0x1000 0x100>, + <0x2000 0x100>, + <0x3000 + 0x100>; };
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml index 63c1c08..191ed77 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml
@@ -7,7 +7,7 @@ title: Test fixture with an unclosed /* block comment maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml index 9b3fe50..62590948 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml
@@ -7,7 +7,7 @@ title: Test fixture with 0x-prefixed unit address maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml index 93705cd..5bb19fba 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml
@@ -7,7 +7,7 @@ title: Test fixture with malformed unit address maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml index 28d7176..7f862ae 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml
@@ -7,7 +7,7 @@ title: Test fixture with an unused label maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml index 504bf09..1d7bc81 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml
@@ -7,7 +7,7 @@ title: Test fixture with extra whitespace in a multi-line cell array maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml index 342ab9f..a5082a1 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml
@@ -7,7 +7,7 @@ title: Test fixture with extra whitespace inside <...> maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt new file mode 100644 index 0000000..97617bc --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt
@@ -0,0 +1,6 @@ +# mode=strict +bad/dts-blank-lines.dts:16: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:23: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:30: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:32: [blank-lines] blank line at start of node body +bad/dts-blank-lines.dts:35: [blank-lines] blank line at end of node body
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt index e2eea08..312a45e 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt
@@ -1,2 +1,3 @@ # mode=strict bad/dts-child-name-order.dts:16: [child-name-order] child node 'bar' out of name order +bad/dts-child-name-order.dts:21: [child-name-order] child node 'memory' out of name order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt new file mode 100644 index 0000000..e44ceb2 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt
@@ -0,0 +1,3 @@ +# mode=strict +bad/dts-child-name-order.dtso:17: [child-name-order] child node 'bar' out of name order +bad/dts-child-name-order.dtso:22: [child-name-order] child node 'memory' out of name order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt new file mode 100644 index 0000000..fd7f389 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt
@@ -0,0 +1,11 @@ +# mode=strict +bad/dts-cont-align.dts:13: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:14: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:15: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:17: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:18: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 27 (to the value under <) +bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:22: [continuation-alignment] continuation should align to column 27 (to the value under <) +bad/dts-cont-align.dts:24: [continuation-alignment] continuation should align to column 38 (to < or ") +bad/dts-cont-align.dts:25: [continuation-alignment] continuation should align to column 38 (to < or ")
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt new file mode 100644 index 0000000..1f41acd --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt
@@ -0,0 +1,2 @@ +# mode=strict +bad/dts-digit-node-order.dts:29: [child-address-order] child node @10000 out of address order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt new file mode 100644 index 0000000..21db32f --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt
@@ -0,0 +1,2 @@ +# mode=strict +bad/dts-digit-node-order.dtso:30: [child-address-order] child node @10000 out of address order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt new file mode 100644 index 0000000..d7941a8 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt
@@ -0,0 +1,2 @@ +# mode=strict +bad/dts-extend-node-child-name-order.dtso:23: [child-name-order] child node 'bar' out of name order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt new file mode 100644 index 0000000..408796d --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt
@@ -0,0 +1,2 @@ +# mode=strict +bad/dts-extend-node-digit-node-order.dtso:24: [child-address-order] child node @10000 out of address order
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt new file mode 100644 index 0000000..9cdb755 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt
@@ -0,0 +1,3 @@ +# mode=stricter +bad/dts-line-length.dts:17: [line-length-dts] line exceeds 80 columns (101) +bad/dts-line-length.dts:18: [line-length-dts] line exceeds 80 columns (108)
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt index 93146cf..1706390 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt
@@ -6,4 +6,5 @@ bad/dts-mixed-indent.dts:13: [indent-consistent] indent mismatch (expected depth 2 * '\t') bad/dts-mixed-indent.dts:13: [mixed-indent-chars] mixed tabs and spaces in indent bad/dts-mixed-indent.dts:16: [mixed-indent-chars] mixed tabs and spaces in indent +bad/dts-mixed-indent.dts:18: [mixed-indent-chars] too many space characters in indent (more than 7) bad/dts-mixed-indent.dts:19: [indent-consistent] indent mismatch (expected depth 2 * '\t')
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt new file mode 100644 index 0000000..bd8d7e2 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt
@@ -0,0 +1,13 @@ +# mode=strict +bad/dts-node-name.dts:8: [node-name] node name "foo_bar" is using discouraged style +bad/dts-node-name.dts:12: [child-name-order] child node 'foo,bar' out of name order +bad/dts-node-name.dts:12: [node-name] node name "foo,bar" is using discouraged style +bad/dts-node-name.dts:16: [node-name] node name "foo.bar" is using discouraged style +bad/dts-node-name.dts:20: [child-name-order] child node 'foo+bar' out of name order +bad/dts-node-name.dts:20: [node-name] node name "foo+bar" is using discouraged style +bad/dts-node-name.dts:24: [node-name] node name "foo-bar-" is using discouraged style +bad/dts-node-name.dts:35: [node-name] node name "foo_bar" is using discouraged style +bad/dts-node-name.dts:40: [node-name] node name "foo,bar" is using discouraged style +bad/dts-node-name.dts:45: [node-name] node name "foo.bar" is using discouraged style +bad/dts-node-name.dts:50: [node-name] node name "foo+bar" is using discouraged style +bad/dts-node-name.dts:55: [node-name] node name "foo-bar-" is using discouraged style
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt new file mode 100644 index 0000000..f447743 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt
@@ -0,0 +1,14 @@ +# mode=strict +bad/dts-property-name.dts:11: [property-name] property name "property#foo" is using discouraged style +bad/dts-property-name.dts:12: [property-name] property name "property+foo" is using discouraged style +bad/dts-property-name.dts:14: [property-name] property name "property-foo-" is using discouraged style +bad/dts-property-name.dts:15: [property-name] property name "property.foo" is using discouraged style +bad/dts-property-name.dts:16: [property-name] property name "property?foo" is using discouraged style +bad/dts-property-name.dts:17: [property-name] property name "property_foo" is using discouraged style +bad/dts-property-name.dts:19: [property-name] property name "vendor,property#foo" is using discouraged style +bad/dts-property-name.dts:20: [property-name] property name "vendor,property+foo" is using discouraged style +bad/dts-property-name.dts:21: [property-name] property name "vendor,property,foo" is using discouraged style +bad/dts-property-name.dts:23: [property-name] property name "vendor,property-foo-" is using discouraged style +bad/dts-property-name.dts:24: [property-name] property name "vendor,property.foo" is using discouraged style +bad/dts-property-name.dts:25: [property-name] property name "vendor,property?foo" is using discouraged style +bad/dts-property-name.dts:26: [property-name] property name "vendor,property_foo" is using discouraged style
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt index 4bc2132..155b072 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt
@@ -1,6 +1,12 @@ # mode=strict -bad/dts-property-order.dts:15: [property-order] property 'compatible' out of canonical order (should sort before 'reg') -bad/dts-property-order.dts:16: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') -bad/dts-property-order.dts:25: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') -bad/dts-property-order.dts:30: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') -bad/dts-property-order.dts:40: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dts:10: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:12: [property-order] property 'chassis-type' out of canonical order (should sort before 'qcom,board-id') +bad/dts-property-order.dts:20: [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/dts-property-order.dts:21: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') +bad/dts-property-order.dts:35: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') +bad/dts-property-order.dts:45: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dts:47: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dts:53: [redundant-whitespace] extra whitespace before { +bad/dts-property-order.dts:55: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:60: [property-order] property 'model' out of canonical order (should sort before 'compatible')
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt new file mode 100644 index 0000000..48c020d --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt
@@ -0,0 +1,12 @@ +# mode=strict +bad/dts-property-order.dtso:11: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:13: [property-order] property 'chassis-type' out of canonical order (should sort before 'qcom,board-id') +bad/dts-property-order.dtso:21: [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/dts-property-order.dtso:22: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') +bad/dts-property-order.dtso:36: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') +bad/dts-property-order.dtso:46: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dtso:48: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dtso:54: [redundant-whitespace] extra whitespace before { +bad/dts-property-order.dtso:56: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:61: [property-order] property 'model' out of canonical order (should sort before 'compatible')
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt new file mode 100644 index 0000000..ac0d57b --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt
@@ -0,0 +1,13 @@ +# mode=strict +bad/dts-redundant-ws-strict.dts:7: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:13: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:13: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws-strict.dts:17: [redundant-whitespace-strict] extra whitespace before = +bad/dts-redundant-ws-strict.dts:18: [redundant-whitespace-strict] extra whitespace after = +bad/dts-redundant-ws-strict.dts:19: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws-strict.dts:22: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:23: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:23: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws-strict.dts:24: [redundant-whitespace-strict] extra whitespace before = +bad/dts-redundant-ws-strict.dts:25: [redundant-whitespace-strict] extra whitespace after = +bad/dts-redundant-ws-strict.dts:26: [redundant-whitespace] extra whitespace before ;
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt new file mode 100644 index 0000000..3b2a989 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt
@@ -0,0 +1,10 @@ +# mode=relaxed +bad/dts-redundant-ws.dts:7: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:13: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:13: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws.dts:19: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws.dts:22: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:23: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:23: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws.dts:26: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws.dts:27: [redundant-whitespace] extra whitespace before ;
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt new file mode 100644 index 0000000..5f9a630 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt
@@ -0,0 +1,2 @@ +# mode=strict +bad/dts-redundant-ws.dtso:5: [redundant-whitespace] extra whitespace before {
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt new file mode 100644 index 0000000..a15a7d6 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt
@@ -0,0 +1,3 @@ +# mode=relaxed +bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace +bad/dts-trailing-ws.dts:13: [trailing-whitespace] trailing whitespace
diff --git a/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt new file mode 100644 index 0000000..4cdcaba --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt
@@ -0,0 +1,2 @@ +# mode=stricter +bad/dts-unused-label.dts:16: [unused-labels-dts] label 'dev' defined but never &-referenced
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt new file mode 100644 index 0000000..8a8db8d --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt
@@ -0,0 +1,6 @@ +# mode=strict +bad/yaml-blank-lines.yaml:33: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:40: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:47: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:49: example 0 [blank-lines] blank line at start of node body +bad/yaml-blank-lines.yaml:53: example 0 [blank-lines] blank line at end of node body
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt index b5576dd..9e98c28 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt
@@ -1,2 +1,4 @@ # mode=strict -bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (under "<" or \") +bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (to < or ") +bad/yaml-cont-align.yaml:30: example 0 [continuation-alignment] continuation should align to column 11 (to < or ") +bad/yaml-cont-align.yaml:32: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <)
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt index 6600f7c..f424902 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt
@@ -1,2 +1,4 @@ # mode=strict bad/yaml-hex-case.yaml:28: example 0 [hex-case] hex literal '0xABCD' must be lowercase +bad/yaml-hex-case.yaml:29: example 0 [hex-case] hex literal '0x2BCD' must be lowercase +bad/yaml-hex-case.yaml:30: example 0 [hex-case] hex literal '0x3BCD' must be lowercase
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt index 89b3636..f21b823 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt
@@ -1,2 +1,3 @@ # mode=strict bad/yaml-line-length.yaml:27: example 0 [line-length] line exceeds 80 columns (81) +bad/yaml-line-length.yaml:28: example 0 [line-length] line exceeds 80 columns (88)
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt index bc3fc3c..442f21f 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt
@@ -1,2 +1,3 @@ # mode=relaxed bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not allowed in DTS example +bad/yaml-mixed-indent.yaml:30: example 0 [tab-in-yaml] tab character not allowed in DTS example
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt new file mode 100644 index 0000000..d9cf749 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt
@@ -0,0 +1,7 @@ +# mode=strict +bad/yaml-node-name.yaml:25: example 0 [node-name] node name "foo_bar" is using discouraged style +bad/yaml-node-name.yaml:30: example 0 [node-name] node name "foo,bar" is using discouraged style +bad/yaml-node-name.yaml:35: example 0 [node-name] node name "foo.bar" is using discouraged style +bad/yaml-node-name.yaml:40: example 0 [node-name] node name "foo+bar" is using discouraged style +bad/yaml-node-name.yaml:45: example 0 [node-name] node name "foo-bar-" is using discouraged style +bad/yaml-node-name.yaml:52: example 0 [node-name] node name "foo_bar" is using discouraged style
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt index 578df72..bb0dd5d 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt
@@ -1,2 +1,3 @@ # mode=strict bad/yaml-prop-order.yaml:28: example 0 [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/yaml-prop-order.yaml:32: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant')
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt index e6e2134..ee66655 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt
@@ -1,3 +1,3 @@ # mode=strict -bad/yaml-prop-pairing.yaml:30: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'clock-names') -bad/yaml-prop-pairing.yaml:32: example 0 [property-order] property 'pinctrl-0' out of canonical order (should sort before 'pinctrl-names') +bad/yaml-prop-pairing.yaml:29: example 0 [property-order] property 'clock-names' must be placed after 'clocks' +bad/yaml-prop-pairing.yaml:31: example 0 [property-order] property 'pinctrl-names' must be placed after 'pinctrl-0'
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt new file mode 100644 index 0000000..6aa3a00 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt
@@ -0,0 +1,14 @@ +# mode=strict +bad/yaml-property-name.yaml:30: example 0 [property-name] property name "property#foo" is using discouraged style +bad/yaml-property-name.yaml:31: example 0 [property-name] property name "property+foo" is using discouraged style +bad/yaml-property-name.yaml:33: example 0 [property-name] property name "property-foo-" is using discouraged style +bad/yaml-property-name.yaml:34: example 0 [property-name] property name "property.foo" is using discouraged style +bad/yaml-property-name.yaml:35: example 0 [property-name] property name "property?foo" is using discouraged style +bad/yaml-property-name.yaml:36: example 0 [property-name] property name "property_foo" is using discouraged style +bad/yaml-property-name.yaml:38: example 0 [property-name] property name "vendor,property#foo" is using discouraged style +bad/yaml-property-name.yaml:39: example 0 [property-name] property name "vendor,property+foo" is using discouraged style +bad/yaml-property-name.yaml:40: example 0 [property-name] property name "vendor,property,foo" is using discouraged style +bad/yaml-property-name.yaml:42: example 0 [property-name] property name "vendor,property-foo-" is using discouraged style +bad/yaml-property-name.yaml:43: example 0 [property-name] property name "vendor,property.foo" is using discouraged style +bad/yaml-property-name.yaml:44: example 0 [property-name] property name "vendor,property?foo" is using discouraged style +bad/yaml-property-name.yaml:45: example 0 [property-name] property name "vendor,property_foo" is using discouraged style
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt new file mode 100644 index 0000000..fbf3238 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt
@@ -0,0 +1,5 @@ +# mode=strict +bad/yaml-redundant-ws-strict.yaml:26: example 0 [redundant-whitespace] extra whitespace before { +bad/yaml-redundant-ws-strict.yaml:27: example 0 [redundant-whitespace-strict] extra whitespace before = +bad/yaml-redundant-ws-strict.yaml:28: example 0 [redundant-whitespace-strict] extra whitespace after = +bad/yaml-redundant-ws-strict.yaml:31: example 0 [redundant-whitespace] extra whitespace before ;
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt new file mode 100644 index 0000000..a162967 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt
@@ -0,0 +1,4 @@ +# mode=relaxed +bad/yaml-redundant-ws.yaml:26: example 0 [redundant-whitespace] extra whitespace before { +bad/yaml-redundant-ws.yaml:29: example 0 [redundant-whitespace] extra whitespace before ; +bad/yaml-redundant-ws.yaml:30: example 0 [redundant-whitespace] extra whitespace before ;
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt index cfdbc84..4f2ec95 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt
@@ -1,2 +1,4 @@ # mode=relaxed bad/yaml-trailing-ws.yaml:27: example 0 [trailing-whitespace] trailing whitespace +bad/yaml-trailing-ws.yaml:29: example 0 [trailing-whitespace] trailing whitespace +bad/yaml-trailing-ws.yaml:30: example 0 [trailing-whitespace] trailing whitespace
diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt index 3df55b17..d25b5b4 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt
@@ -1,2 +1,3 @@ # mode=strict bad/yaml-value-ws-multiline.yaml:25: example 0 [value-whitespace] extra whitespace inside <...> +bad/yaml-value-ws-multiline.yaml:26: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <)
diff --git a/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso new file mode 100644 index 0000000..1fd75a6 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso
@@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label = "bar"; + }; + + foo: foo { + label = "foo"; + }; + }; + + pmu-2 { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + label_bar_2: bar-2 { + label = "bar"; + }; + + foo_2: foo-2 { + label = "foo"; + }; +}
diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts index 36fb4ee..e6450a1 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts
@@ -15,12 +15,16 @@ / { interrupt-controller@10000 { compatible = "example,intc"; reg = <0x10000 0x1000>; - interrupts = <1 2 3>, + interrupts = <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, + /* but comments should be placed properly */ <7 8 9>; - pinmux = < - 0x01 - 0x02 - >; + pinmux = <0x01 + 0x02>, + <0x03 /* comments with " < , should not matter */ + 0x04>; + power-domain-names = "foo", /* comments with " < , should not */ + "bar", + "baz"; }; };
diff --git a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts index cdf3f91..2b21dde 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts
@@ -5,13 +5,10 @@ / { #address-cells = <1>; #size-cells = <1>; - /* TODO: uncomment when child-address-order is fixed for top-level */ - /* memory@a0000000 { device_type = "memory"; reg = <0x0 0xa0000000 0x0 0x0>; }; - */ pmu { compatible = "example,pmu";
diff --git a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso new file mode 100644 index 0000000..efafa1c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso
@@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +}; + +&soc { + interrupt-controller@110000 { + compatible = "example,intc"; + reg = <0x110000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@120000 { + compatible = "example,serial"; + reg = <0x120000 0x1000>; + }; + + serial@130000 { + compatible = "example,serial"; + reg = <0x130000 0x1000>; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso new file mode 100644 index 0000000..b00c2a1 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso
@@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label = "bar"; + }; + + foo: foo { + label = "foo"; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso new file mode 100644 index 0000000..1ce18af --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + soc: soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&soc { + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts index 0e183e3..288fcfb 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts
@@ -6,6 +6,11 @@ /dts-v1/; / { + model = "DT style selftest"; + compatible = "example,test-board", "example,test-soc"; + chassis-type = "handset"; + qcom,board-id = <8 0>; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -35,7 +40,10 @@ soc@0 { interrupt-controller@10000 { compatible = "example,intc"; reg = <0x10000 0x1000>; + clocks = <6>; interrupts = <1 2 3>; + qcom,calibration-variant = "foo"; + qcom,opp-fuse-level = <1>; }; }; };
diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso new file mode 100644 index 0000000..60c68b3 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso
@@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; +/plugin/; + +&{/} { + model = "DT style selftest"; + compatible = "example,test-board", "example,test-soc"; + chassis-type = "handset"; + qcom,board-id = <8 0>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x0>; + enable-method = "psci"; + }; + }; + + pmu { + compatible = "example,pmu"; + dma-coherent; + + status = "disabled"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + clocks = <6>; + interrupts = <1 2 3>; + qcom,calibration-variant = "foo"; + qcom,opp-fuse-level = <1>; + }; + }; +};
diff --git a/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml b/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml index 1502f80..b91b8a8 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml
@@ -7,7 +7,7 @@ title: Test fixture for dt-check-style maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml new file mode 100644 index 0000000..4a5b5ad --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml
@@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-good-cont-align.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with aligned multi-line property + +maintainers: + - Rob Herring <robh@kernel.org> + +properties: + compatible: + const: example,test-cont-align + reg: + maxItems: 2 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-cont-align"; + reg = <0x1000 0x100>, + <0x2000 0x100>, + /* but comments should be placed properly */ + <0x3000 + 0x100>; + };
diff --git a/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml b/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml index a836d5f..a95d07f 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml
@@ -17,7 +17,7 @@ not leave the parser in block-comment state. maintainers: - - Test User <test@example.com> + - Rob Herring <robh@kernel.org> properties: compatible:
diff --git a/scripts/dtc/dt-style-selftest/run.sh b/scripts/dtc/dt-style-selftest/run.sh index 8117dd9..5691301 100755 --- a/scripts/dtc/dt-style-selftest/run.sh +++ b/scripts/dtc/dt-style-selftest/run.sh
@@ -26,7 +26,7 @@ # good/ -- must exit 0 and produce no output in both modes for f in "$here"/good/*; do [ -e "$f" ] || continue - for mode in relaxed strict; do + for mode in relaxed strict stricter; do out=$(run "$f" "$mode") rc=$? if [ -n "$out" ] || [ "$rc" -ne 0 ]; then