1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

Devicetree updates for v6.14:

DT Bindings:
 - Add Bindings for QCom QCS615 UFS, QCom IPQ5424 DWC3 USB, NXP imx7d
   MIPI DSI, QCom SM8750 PDC, QCom MSM8976 SRAM, QCom ipq6018 temp
   sensor, QCom QCS8300 Power Domain Controller, QCom QCS615 Power Domain
   Controller, QCom QCS615 APSS, QCom QCS615 qfprom, QCom QCS8300
   remoteproc, Mediatek MT6328 PMIC, Allwinner A100 OPP, and NXP iMX35
   GPT
 
 - Convert Altera socfpga-system, raspberrypi,bcm2835-power to DT
   schema
 
 - Add Siflower vendor prefix
 
 - Cleanup display, interrupt-controller, and UFS binding examples'
   indentation
 
 - Document preferred line wrapping (the same as the rest of the kernel)
 
 DT Core:
 - Add warning when of_property_read_bool() is used on non-boolean
   properties
 
 - Restore keeping bootloader DTB when booting with ACPI. Turns out some
   x86 platforms relied on that. Shrug.
 
 - Fix of_find_node_opts_by_path() handling of alias+path+options
 
 - Fix resource bounds checking for empty resources
 
 - A bunch of small fixes/cleanups all over from Zijun Hu
 
 - Cleanups in bin_attribute handling
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmeUF2sACgkQ+vtdtY28
 YcNTOg//Th/uvw3sZqnf/L5LF824B0s8Kx7WauuzUZpg8C1R1OdOdCL8KYWeIqmU
 LfyNxcU9wdSDNv1MBAYzlO8kV9+Cm9NVh8lL9FyFDah6O381SusPXR2GmFVb4yJT
 8xCahYX9N1kHmPKC7iEKtS+z3DP6COUD78wpJ+81SpsfBFOosjtuOtktDIWZyREb
 vHMSQXeDPpdriIT69vq8Ss+tluUr2oiiJstQrVtJhnP/ShtQHfYJcQCFiMaUJXM9
 3uO+ahnVaR5aCvo8WaBIaoiO1iq1CZ9gK585o3y46JvuLyKjwf7I+Y+h82tr55hO
 Vpx3wLX7l9nZ/TeX8e+N9APaUIXrbMzYMj8HN28u8oNlOCpIY3zTx8/Pjs7D5WCU
 csXynvPvI3EivTkpvwCKlgJHpGSBgASEW18ysy7WjcCWlxrw0xLZB6PuGbOmlxyB
 D1CjFGk3atAKGoaZU0RRbmFYslr1SPvjrcJGTgfrfg9JgLIp7hrXxnlVBIK2JayU
 BsEHCMTXgXy5iinCu0fGEwkzAnHB/g/C29rnT7RpnVTZlzcqhIyChG58MEgbHJZO
 3EQ16HNet//hsVpr3a7CkkPksX/7eCgp6zrIhWytvbCCXOpVOz69bfmgoxIR9tdW
 Lwx74nU9bNJISi8WrcgCqNgjBcj/HBOb+wtaHFl/DNG+oXLhVa4=
 =3bID
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree updates from Rob Herring:
 "DT Bindings:

   - Add Bindings for QCom QCS615 UFS, QCom IPQ5424 DWC3 USB, NXP imx7d
     MIPI DSI, QCom SM8750 PDC, QCom MSM8976 SRAM, QCom ipq6018 temp
     sensor, QCom QCS8300 Power Domain Controller, QCom QCS615 Power
     Domain Controller, QCom QCS615 APSS, QCom QCS615 qfprom, QCom
     QCS8300 remoteproc, Mediatek MT6328 PMIC, Allwinner A100 OPP, and
     NXP iMX35 GPT

   - Convert Altera socfpga-system, raspberrypi,bcm2835-power to DT
     schema

   - Add Siflower vendor prefix

   - Cleanup display, interrupt-controller, and UFS binding examples'
     indentation

   - Document preferred line wrapping (the same as the rest of the
     kernel)

  DT Core:

   - Add warning when of_property_read_bool() is used on non-boolean
     properties

   - Restore keeping bootloader DTB when booting with ACPI. Turns out
     some x86 platforms relied on that. Shrug.

   - Fix of_find_node_opts_by_path() handling of alias+path+options

   - Fix resource bounds checking for empty resources

   - A bunch of small fixes/cleanups all over from Zijun Hu

   - Cleanups in bin_attribute handling"

* tag 'devicetree-for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (50 commits)
  of: address: Fix empty resource handling in __of_address_resource_bounds()
  of/fdt: Restore possibility to use both ACPI and FDT from bootloader
  docs: dt-bindings: Document preferred line wrapping
  dt-bindings: ufs: Correct indentation and style in DTS example
  of: Correct element count for two arrays in API of_parse_phandle_with_args_map()
  of: reserved-memory: Warn for missing static reserved memory regions
  of: Do not expose of_alias_scan() and correct its comments
  dt-bindings: ufs: qcom: Add UFS Host Controller for QCS615
  dt-bindings: usb: qcom,dwc3: Add IPQ5424 to USB DWC3 bindings
  dt-bindings: arm: coresight: Update the pattern of ete node name
  of: Warn when of_property_read_bool() is used on non-boolean properties
  device property: Split property reading bool and presence test ops
  of/fdt: Check fdt_get_mem_rsv() error in early_init_fdt_scan_reserved_mem()
  of: reserved-memory: Move an assignment to effective place in __reserved_mem_alloc_size()
  of: reserved-memory: Do not make kmemleak ignore freed address
  of: reserved-memory: Fix using wrong number of cells to get property 'alignment'
  of: Remove a duplicated code block
  of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()
  of: Correct child specifier used as input of the 2nd nexus node
  dt-bindings: interrupt-controller: ti,omap4-wugen-mpu: Add file extension
  ...
This commit is contained in:
Linus Torvalds 2025-01-24 15:09:20 -08:00
commit f345fc7a07
60 changed files with 607 additions and 511 deletions

View file

@ -1,25 +0,0 @@
Altera SOCFPGA System Manager
Required properties:
- compatible : "altr,sys-mgr"
- reg : Should contain 1 register ranges(address and length)
- cpu1-start-addr : CPU1 start address in hex.
Example:
sysmgr@ffd08000 {
compatible = "altr,sys-mgr";
reg = <0xffd08000 0x1000>;
cpu1-start-addr = <0xffd080c4>;
};
ARM64 - Stratix10
Required properties:
- compatible : "altr,sys-mgr-s10"
- reg : Should contain 1 register range(address and length)
for system manager register.
Example:
sysmgr@ffd12000 {
compatible = "altr,sys-mgr-s10";
reg = <0xffd12000 0x228>;
};

View file

@ -23,7 +23,7 @@ description: |
properties: properties:
$nodename: $nodename:
pattern: "^ete([0-9a-f]+)$" pattern: "^ete(-[0-9]+)?$"
compatible: compatible:
items: items:
- const: arm,embedded-trace-extension - const: arm,embedded-trace-extension
@ -55,13 +55,13 @@ examples:
# An ETE node without legacy CoreSight connections # An ETE node without legacy CoreSight connections
- | - |
ete0 { ete-0 {
compatible = "arm,embedded-trace-extension"; compatible = "arm,embedded-trace-extension";
cpu = <&cpu_0>; cpu = <&cpu_0>;
}; };
# An ETE node with legacy CoreSight connections # An ETE node with legacy CoreSight connections
- | - |
ete1 { ete-1 {
compatible = "arm,embedded-trace-extension"; compatible = "arm,embedded-trace-extension";
cpu = <&cpu_1>; cpu = <&cpu_1>;

View file

@ -87,14 +87,14 @@ examples:
port@0 { port@0 {
reg = <0>; reg = <0>;
hdmi_tx_from_pvi: endpoint { endpoint {
remote-endpoint = <&pvi_to_hdmi_tx>; remote-endpoint = <&pvi_to_hdmi_tx>;
}; };
}; };
port@1 { port@1 {
reg = <1>; reg = <1>;
hdmi_tx_out: endpoint { endpoint {
remote-endpoint = <&hdmi0_con>; remote-endpoint = <&hdmi0_con>;
}; };
}; };

View file

@ -27,7 +27,9 @@ properties:
- fsl,imx8mm-mipi-dsim - fsl,imx8mm-mipi-dsim
- fsl,imx8mp-mipi-dsim - fsl,imx8mp-mipi-dsim
- items: - items:
- const: fsl,imx8mn-mipi-dsim - enum:
- fsl,imx7d-mipi-dsim
- fsl,imx8mn-mipi-dsim
- const: fsl,imx8mm-mipi-dsim - const: fsl,imx8mm-mipi-dsim
reg: reg:

View file

@ -117,14 +117,14 @@ examples:
port@0 { port@0 {
reg = <0>; reg = <0>;
aal0_in: endpoint { endpoint {
remote-endpoint = <&ccorr0_out>; remote-endpoint = <&ccorr0_out>;
}; };
}; };
port@1 { port@1 {
reg = <1>; reg = <1>;
aal0_out: endpoint { endpoint {
remote-endpoint = <&gamma0_in>; remote-endpoint = <&gamma0_in>;
}; };
}; };

View file

@ -462,14 +462,14 @@ examples:
port@0 { port@0 {
reg = <0>; reg = <0>;
dsi0_in: endpoint { endpoint {
remote-endpoint = <&dpu_intf1_out>; remote-endpoint = <&dpu_intf1_out>;
}; };
}; };
port@1 { port@1 {
reg = <1>; reg = <1>;
dsi0_out: endpoint { endpoint {
remote-endpoint = <&sn65dsi86_in>; remote-endpoint = <&sn65dsi86_in>;
data-lanes = <0 1 2 3>; data-lanes = <0 1 2 3>;
qcom,te-source = "mdp_vsync_e"; qcom,te-source = "mdp_vsync_e";

View file

@ -78,7 +78,6 @@ examples:
"mdp1-mem", "mdp1-mem",
"cpu-cfg"; "cpu-cfg";
resets = <&dispcc_core_bcr>; resets = <&dispcc_core_bcr>;
power-domains = <&dispcc_gdsc>; power-domains = <&dispcc_gdsc>;

View file

@ -162,14 +162,17 @@ Example::
status = "okay"; status = "okay";
} }
Indentation Indentation and wrapping
----------- ------------------------
1. Use indentation according to Documentation/process/coding-style.rst. 1. Use indentation and wrap lines according to
Documentation/process/coding-style.rst.
2. Each entry in arrays with multiple cells, e.g. "reg" with two IO addresses, 2. Each entry in arrays with multiple cells, e.g. "reg" with two IO addresses,
shall be enclosed in <>. shall be enclosed in <>.
3. For arrays spanning across lines, it is preferred to align the continued 3. For arrays spanning across lines, it is preferred to split on item boundary
entries with opening < from the first line. and align the continued entries with opening < from the first line.
Usually avoid splitting individual items unless they significantly exceed
line wrap limit.
Example:: Example::
@ -177,6 +180,9 @@ Example::
compatible = "qcom,sm8550-tsens", "qcom,tsens-v2"; compatible = "qcom,sm8550-tsens", "qcom,tsens-v2";
reg = <0x0 0x0c271000 0x0 0x1000>, reg = <0x0 0x0c271000 0x0 0x1000>,
<0x0 0x0c222000 0x0 0x1000>; <0x0 0x0c222000 0x0 0x1000>;
/* Lines exceeding coding style line wrap limit: */
interconnects = <&aggre1_noc MASTER_USB3_0 0 &mc_virt SLAVE_EBI1 0>,
<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_0 0>;
}; };
Organizing DTSI and DTS Organizing DTSI and DTS

View file

@ -25,6 +25,7 @@ properties:
compatible: compatible:
enum: enum:
- mediatek,mt6323-keys - mediatek,mt6323-keys
- mediatek,mt6328-keys
- mediatek,mt6331-keys - mediatek,mt6331-keys
- mediatek,mt6357-keys - mediatek,mt6357-keys
- mediatek,mt6358-keys - mediatek,mt6358-keys

View file

@ -110,8 +110,8 @@ properties:
interrupts: interrupts:
description: Interrupt source of the parent interrupt controller on description: Interrupt source of the parent interrupt controller on
secondary GICs, or VGIC maintenance interrupt on primary GIC (see secondary GICs, or VGIC maintenance interrupt on primary GIC (see "GICv2
below). with virtualization extensions" paragraph in the "reg" property).
maxItems: 1 maxItems: 1
cpu-offset: cpu-offset:

View file

@ -26,6 +26,8 @@ properties:
compatible: compatible:
items: items:
- enum: - enum:
- qcom,qcs615-pdc
- qcom,qcs8300-pdc
- qcom,qdu1000-pdc - qcom,qdu1000-pdc
- qcom,sa8255p-pdc - qcom,sa8255p-pdc
- qcom,sa8775p-pdc - qcom,sa8775p-pdc
@ -47,6 +49,7 @@ properties:
- qcom,sm8450-pdc - qcom,sm8450-pdc
- qcom,sm8550-pdc - qcom,sm8550-pdc
- qcom,sm8650-pdc - qcom,sm8650-pdc
- qcom,sm8750-pdc
- qcom,x1e80100-pdc - qcom,x1e80100-pdc
- const: qcom,pdc - const: qcom,pdc

View file

@ -142,7 +142,7 @@ examples:
<&cpu2_intc 11>, <&cpu2_intc 11>,
<&cpu3_intc 11>, <&cpu3_intc 11>,
<&cpu4_intc 11>; <&cpu4_intc 11>;
reg = <0x28000000 0x4000>; reg = <0x24000000 0x4000>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <0>; #interrupt-cells = <0>;
msi-controller; msi-controller;

View file

@ -44,6 +44,7 @@ properties:
- const: qcom,msm8994-apcs-kpss-global - const: qcom,msm8994-apcs-kpss-global
- items: - items:
- enum: - enum:
- qcom,qcs615-apss-shared
- qcom,sc7180-apss-shared - qcom,sc7180-apss-shared
- qcom,sc8180x-apss-shared - qcom,sc8180x-apss-shared
- qcom,sm8150-apss-shared - qcom,sm8150-apss-shared

View file

@ -52,10 +52,3 @@ examples:
#qca,ddr-wb-channel-cells = <1>; #qca,ddr-wb-channel-cells = <1>;
}; };
interrupt-controller {
// ...
qca,ddr-wb-channel-interrupts = <2>, <3>, <4>, <5>;
qca,ddr-wb-channels = <&ddr_ctrl 3>, <&ddr_ctrl 2>,
<&ddr_ctrl 0>, <&ddr_ctrl 1>;
};

View file

@ -36,6 +36,7 @@ properties:
- enum: - enum:
- mediatek,mt6323 - mediatek,mt6323
- mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332. - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
- mediatek,mt6328
- mediatek,mt6358 - mediatek,mt6358
- mediatek,mt6359 - mediatek,mt6359
- mediatek,mt6397 - mediatek,mt6397
@ -88,6 +89,7 @@ properties:
oneOf: oneOf:
- enum: - enum:
- mediatek,mt6323-regulator - mediatek,mt6323-regulator
- mediatek,mt6328-regulator
- mediatek,mt6358-regulator - mediatek,mt6358-regulator
- mediatek,mt6359-regulator - mediatek,mt6359-regulator
- mediatek,mt6397-regulator - mediatek,mt6397-regulator

View file

@ -32,6 +32,7 @@ properties:
- qcom,msm8998-qfprom - qcom,msm8998-qfprom
- qcom,qcm2290-qfprom - qcom,qcm2290-qfprom
- qcom,qcs404-qfprom - qcom,qcs404-qfprom
- qcom,qcs615-qfprom
- qcom,sc7180-qfprom - qcom,sc7180-qfprom
- qcom,sc7280-qfprom - qcom,sc7280-qfprom
- qcom,sc8280xp-qfprom - qcom,sc8280xp-qfprom

View file

@ -22,6 +22,7 @@ allOf:
properties: properties:
compatible: compatible:
enum: enum:
- allwinner,sun50i-a100-operating-points
- allwinner,sun50i-h6-operating-points - allwinner,sun50i-h6-operating-points
- allwinner,sun50i-h616-operating-points - allwinner,sun50i-h616-operating-points

View file

@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/raspberrypi,bcm2835-power.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Broadcom BCM2835 power domain
maintainers:
- Alexander Aring <alex.aring@gmail.com>
- Florian Fainelli <florian.fainelli@broadcom.com>
description:
The Raspberry Pi power domain manages power for various subsystems
in the Raspberry Pi BCM2835 SoC.
properties:
compatible:
enum:
- raspberrypi,bcm2835-power
firmware:
$ref: /schemas/types.yaml#/definitions/phandle
description: Reference to the RPi firmware device node
"#power-domain-cells":
const: 1
required:
- compatible
- firmware
- "#power-domain-cells"
unevaluatedProperties: false
examples:
- |
power-controller {
compatible = "raspberrypi,bcm2835-power";
firmware = <&firmware>;
#power-domain-cells = <1>;
};

View file

@ -15,7 +15,20 @@ description:
properties: properties:
compatible: compatible:
enum: oneOf:
- items:
- enum:
- qcom,qcs8300-adsp-pas
- const: qcom,sa8775p-adsp-pas
- items:
- enum:
- qcom,qcs8300-cdsp-pas
- const: qcom,sa8775p-cdsp0-pas
- items:
- enum:
- qcom,qcs8300-gpdsp-pas
- const: qcom,sa8775p-gpdsp0-pas
- enum:
- qcom,sa8775p-adsp-pas - qcom,sa8775p-adsp-pas
- qcom,sa8775p-cdsp0-pas - qcom,sa8775p-cdsp0-pas
- qcom,sa8775p-cdsp1-pas - qcom,sa8775p-cdsp1-pas
@ -63,6 +76,7 @@ allOf:
- if: - if:
properties: properties:
compatible: compatible:
contains:
enum: enum:
- qcom,sa8775p-adsp-pas - qcom,sa8775p-adsp-pas
then: then:
@ -79,6 +93,7 @@ allOf:
- if: - if:
properties: properties:
compatible: compatible:
contains:
enum: enum:
- qcom,sa8775p-cdsp0-pas - qcom,sa8775p-cdsp0-pas
- qcom,sa8775p-cdsp1-pas - qcom,sa8775p-cdsp1-pas
@ -98,6 +113,7 @@ allOf:
- if: - if:
properties: properties:
compatible: compatible:
contains:
enum: enum:
- qcom,sa8775p-gpdsp0-pas - qcom,sa8775p-gpdsp0-pas
- qcom,sa8775p-gpdsp1-pas - qcom,sa8775p-gpdsp1-pas

View file

@ -0,0 +1,51 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/altera/altr,sys-mgr.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Altera SOCFPGA System Manager
maintainers:
- Dinh Nguyen <dinguyen@kernel.org>
properties:
compatible:
oneOf:
- description: Cyclone5/Arria5/Arria10
const: altr,sys-mgr
- description: Stratix10 SoC
items:
- const: altr,sys-mgr-s10
- const: altr,sys-mgr
reg:
maxItems: 1
cpu1-start-addr:
$ref: /schemas/types.yaml#/definitions/uint32
description: CPU1 start address in hex
required:
- compatible
- reg
allOf:
- if:
properties:
compatible:
contains:
const: altr,sys-mgr-s10
then:
properties:
cpu1-start-addr: false
additionalProperties: false
examples:
- |
sysmgr@ffd08000 {
compatible = "altr,sys-mgr";
reg = <0xffd08000 0x1000>;
cpu1-start-addr = <0xffd080c4>;
};

View file

@ -1,47 +0,0 @@
Raspberry Pi power domain driver
Required properties:
- compatible: Should be "raspberrypi,bcm2835-power".
- firmware: Reference to the RPi firmware device node.
- #power-domain-cells: Should be <1>, we providing multiple power domains.
The valid defines for power domain are:
RPI_POWER_DOMAIN_I2C0
RPI_POWER_DOMAIN_I2C1
RPI_POWER_DOMAIN_I2C2
RPI_POWER_DOMAIN_VIDEO_SCALER
RPI_POWER_DOMAIN_VPU1
RPI_POWER_DOMAIN_HDMI
RPI_POWER_DOMAIN_USB
RPI_POWER_DOMAIN_VEC
RPI_POWER_DOMAIN_JPEG
RPI_POWER_DOMAIN_H264
RPI_POWER_DOMAIN_V3D
RPI_POWER_DOMAIN_ISP
RPI_POWER_DOMAIN_UNICAM0
RPI_POWER_DOMAIN_UNICAM1
RPI_POWER_DOMAIN_CCP2RX
RPI_POWER_DOMAIN_CSI2
RPI_POWER_DOMAIN_CPI
RPI_POWER_DOMAIN_DSI0
RPI_POWER_DOMAIN_DSI1
RPI_POWER_DOMAIN_TRANSPOSER
RPI_POWER_DOMAIN_CCP2TX
RPI_POWER_DOMAIN_CDP
RPI_POWER_DOMAIN_ARM
Example:
power: power {
compatible = "raspberrypi,bcm2835-power";
firmware = <&firmware>;
#power-domain-cells = <1>;
};
Example for using power domain:
&usb {
power-domains = <&power RPI_POWER_DOMAIN_USB>;
};

View file

@ -20,6 +20,7 @@ properties:
- qcom,apq8064-imem - qcom,apq8064-imem
- qcom,msm8226-imem - qcom,msm8226-imem
- qcom,msm8974-imem - qcom,msm8974-imem
- qcom,msm8976-imem
- qcom,qcs404-imem - qcom,qcs404-imem
- qcom,qcs8300-imem - qcom,qcs8300-imem
- qcom,qdu1000-imem - qcom,qdu1000-imem

View file

@ -80,6 +80,7 @@ properties:
- description: v2 of TSENS with combined interrupt - description: v2 of TSENS with combined interrupt
items: items:
- enum: - enum:
- qcom,ipq6018-tsens
- qcom,ipq9574-tsens - qcom,ipq9574-tsens
- const: qcom,ipq8074-tsens - const: qcom,ipq8074-tsens

View file

@ -21,6 +21,7 @@ properties:
- items: - items:
- enum: - enum:
- fsl,imx25-gpt - fsl,imx25-gpt
- fsl,imx35-gpt
- fsl,imx50-gpt - fsl,imx50-gpt
- fsl,imx51-gpt - fsl,imx51-gpt
- fsl,imx53-gpt - fsl,imx53-gpt
@ -31,6 +32,7 @@ properties:
- enum: - enum:
- fsl,imx6sl-gpt - fsl,imx6sl-gpt
- fsl,imx6sx-gpt - fsl,imx6sx-gpt
- fsl,imx7d-gpt
- fsl,imx8mp-gpt - fsl,imx8mp-gpt
- fsl,imxrt1050-gpt - fsl,imxrt1050-gpt
- fsl,imxrt1170-gpt - fsl,imxrt1170-gpt
@ -38,7 +40,6 @@ properties:
- items: - items:
- enum: - enum:
- fsl,imx6ul-gpt - fsl,imx6ul-gpt
- fsl,imx7d-gpt
- const: fsl,imx6sx-gpt - const: fsl,imx6sx-gpt
reg: reg:

View file

@ -26,6 +26,7 @@ properties:
- qcom,msm8994-ufshc - qcom,msm8994-ufshc
- qcom,msm8996-ufshc - qcom,msm8996-ufshc
- qcom,msm8998-ufshc - qcom,msm8998-ufshc
- qcom,qcs615-ufshc
- qcom,qcs8300-ufshc - qcom,qcs8300-ufshc
- qcom,sa8775p-ufshc - qcom,sa8775p-ufshc
- qcom,sc7180-ufshc - qcom,sc7180-ufshc
@ -243,6 +244,7 @@ allOf:
compatible: compatible:
contains: contains:
enum: enum:
- qcom,qcs615-ufshc
- qcom,sm6115-ufshc - qcom,sm6115-ufshc
- qcom,sm6125-ufshc - qcom,sm6125-ufshc
then: then:

View file

@ -16,6 +16,7 @@ properties:
- qcom,ipq4019-dwc3 - qcom,ipq4019-dwc3
- qcom,ipq5018-dwc3 - qcom,ipq5018-dwc3
- qcom,ipq5332-dwc3 - qcom,ipq5332-dwc3
- qcom,ipq5424-dwc3
- qcom,ipq6018-dwc3 - qcom,ipq6018-dwc3
- qcom,ipq8064-dwc3 - qcom,ipq8064-dwc3
- qcom,ipq8074-dwc3 - qcom,ipq8074-dwc3

View file

@ -1342,6 +1342,8 @@ patternProperties:
description: Siemens AG description: Siemens AG
"^sifive,.*": "^sifive,.*":
description: SiFive, Inc. description: SiFive, Inc.
"^siflower,.*":
description: Shanghai Siflower Communication Co.
"^sigma,.*": "^sigma,.*":
description: Sigma Designs, Inc. description: Sigma Designs, Inc.
"^sii,.*": "^sii,.*":

View file

@ -50,15 +50,13 @@ from 'scripts/dtc/of_unittest_expect --help'.
The Device Tree Source file (drivers/of/unittest-data/testcases.dts) contains The Device Tree Source file (drivers/of/unittest-data/testcases.dts) contains
the test data required for executing the unit tests automated in the test data required for executing the unit tests automated in
drivers/of/unittest.c. Currently, following Device Tree Source Include files drivers/of/unittest.c. See the content of the folder::
(.dtsi) are included in testcases.dts::
drivers/of/unittest-data/tests-interrupts.dtsi drivers/of/unittest-data/tests-*.dtsi
drivers/of/unittest-data/tests-platform.dtsi
drivers/of/unittest-data/tests-phandle.dtsi
drivers/of/unittest-data/tests-match.dtsi
When the kernel is build with OF_SELFTEST enabled, then the following make for the Device Tree Source Include files (.dtsi) included in testcases.dts.
When the kernel is build with CONFIG_OF_UNITTEST enabled, then the following make
rule:: rule::
$(obj)/%.dtb: $(src)/%.dts FORCE $(obj)/%.dtb: $(src)/%.dts FORCE

View file

@ -40,7 +40,7 @@ OF Selftest被设计用来测试提供给设备驱动开发者的接口includ
drivers/of/unittest-data/tests-phandle.dtsi drivers/of/unittest-data/tests-phandle.dtsi
drivers/of/unittest-data/tests-match.dtsi drivers/of/unittest-data/tests-match.dtsi
当内核在启用OF_SELFTEST的情况下被构建时那么下面的make规则:: 当内核在启用CONFIG_OF_UNITTEST的情况下被构建时那么下面的make规则::
$(obj)/%.dtb: $(src)/%.dts FORCE $(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep, dtc) $(call if_changed_dep, dtc)

View file

@ -1656,6 +1656,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
acpi_fwnode_device_dma_supported, \ acpi_fwnode_device_dma_supported, \
.device_get_dma_attr = acpi_fwnode_device_get_dma_attr, \ .device_get_dma_attr = acpi_fwnode_device_get_dma_attr, \
.property_present = acpi_fwnode_property_present, \ .property_present = acpi_fwnode_property_present, \
.property_read_bool = acpi_fwnode_property_present, \
.property_read_int_array = \ .property_read_int_array = \
acpi_fwnode_property_read_int_array, \ acpi_fwnode_property_read_int_array, \
.property_read_string_array = \ .property_read_string_array = \

View file

@ -70,6 +70,44 @@ bool fwnode_property_present(const struct fwnode_handle *fwnode,
} }
EXPORT_SYMBOL_GPL(fwnode_property_present); EXPORT_SYMBOL_GPL(fwnode_property_present);
/**
* device_property_read_bool - Return the value for a boolean property of a device
* @dev: Device whose property is being checked
* @propname: Name of the property
*
* Return if property @propname is true or false in the device firmware description.
*
* Return: true if property @propname is present. Otherwise, returns false.
*/
bool device_property_read_bool(const struct device *dev, const char *propname)
{
return fwnode_property_read_bool(dev_fwnode(dev), propname);
}
EXPORT_SYMBOL_GPL(device_property_read_bool);
/**
* fwnode_property_read_bool - Return the value for a boolean property of a firmware node
* @fwnode: Firmware node whose property to check
* @propname: Name of the property
*
* Return if property @propname is true or false in the firmware description.
*/
bool fwnode_property_read_bool(const struct fwnode_handle *fwnode,
const char *propname)
{
bool ret;
if (IS_ERR_OR_NULL(fwnode))
return false;
ret = fwnode_call_bool_op(fwnode, property_read_bool, propname);
if (ret)
return ret;
return fwnode_call_bool_op(fwnode->secondary, property_read_bool, propname);
}
EXPORT_SYMBOL_GPL(fwnode_property_read_bool);
/** /**
* device_property_read_u8_array - return a u8 array property of a device * device_property_read_u8_array - return a u8 array property of a device
* @dev: Device to get the property of * @dev: Device to get the property of

View file

@ -677,6 +677,7 @@ static const struct fwnode_operations software_node_ops = {
.get = software_node_get, .get = software_node_get,
.put = software_node_put, .put = software_node_put,
.property_present = software_node_property_present, .property_present = software_node_property_present,
.property_read_bool = software_node_property_present,
.property_read_int_array = software_node_read_int_array, .property_read_int_array = software_node_read_int_array,
.property_read_string_array = software_node_read_string_array, .property_read_string_array = software_node_read_string_array,
.get_name = software_node_get_name, .get_name = software_node_get_name,

View file

@ -16,26 +16,11 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/dma-direct.h> /* for bus_dma_region */ #include <linux/dma-direct.h> /* for bus_dma_region */
/* Uncomment me to enable of_dump_addr() debugging output */
// #define DEBUG
#include "of_private.h" #include "of_private.h"
/* Max address size we deal with */
#define OF_MAX_ADDR_CELLS 4
#define OF_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
#define OF_CHECK_COUNTS(na, ns) (OF_CHECK_ADDR_COUNT(na) && (ns) > 0)
/* Debug utility */
#ifdef DEBUG
static void of_dump_addr(const char *s, const __be32 *addr, int na)
{
pr_debug("%s", s);
while (na--)
pr_cont(" %08x", be32_to_cpu(*(addr++)));
pr_cont("\n");
}
#else
static void of_dump_addr(const char *s, const __be32 *addr, int na) { }
#endif
/* Callbacks for bus specific translators */ /* Callbacks for bus specific translators */
struct of_bus { struct of_bus {
const char *name; const char *name;
@ -200,17 +185,15 @@ static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
static int __of_address_resource_bounds(struct resource *r, u64 start, u64 size) static int __of_address_resource_bounds(struct resource *r, u64 start, u64 size)
{ {
u64 end = start;
if (overflows_type(start, r->start)) if (overflows_type(start, r->start))
return -EOVERFLOW; return -EOVERFLOW;
if (size && check_add_overflow(end, size - 1, &end))
return -EOVERFLOW;
if (overflows_type(end, r->end))
return -EOVERFLOW;
r->start = start; r->start = start;
r->end = end;
if (!size)
r->end = wrapping_sub(typeof(r->end), r->start, 1);
else if (size && check_add_overflow(r->start, size - 1, &r->end))
return -EOVERFLOW;
return 0; return 0;
} }

View file

@ -894,10 +894,10 @@ struct device_node *of_find_node_opts_by_path(const char *path, const char **opt
/* The path could begin with an alias */ /* The path could begin with an alias */
if (*path != '/') { if (*path != '/') {
int len; int len;
const char *p = separator; const char *p = strchrnul(path, '/');
if (!p) if (separator && separator < p)
p = strchrnul(path, '/'); p = separator;
len = p - path; len = p - path;
/* of_aliases must not be NULL */ /* of_aliases must not be NULL */
@ -1027,19 +1027,15 @@ struct device_node *of_find_node_with_property(struct device_node *from,
const char *prop_name) const char *prop_name)
{ {
struct device_node *np; struct device_node *np;
const struct property *pp;
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&devtree_lock, flags); raw_spin_lock_irqsave(&devtree_lock, flags);
for_each_of_allnodes_from(from, np) { for_each_of_allnodes_from(from, np) {
for (pp = np->properties; pp; pp = pp->next) { if (__of_find_property(np, prop_name, NULL)) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
of_node_get(np); of_node_get(np);
goto out; break;
} }
} }
}
out:
of_node_put(from); of_node_put(from);
raw_spin_unlock_irqrestore(&devtree_lock, flags); raw_spin_unlock_irqrestore(&devtree_lock, flags);
return np; return np;
@ -1453,8 +1449,8 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
char *pass_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-pass-thru", stem_name); char *pass_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-pass-thru", stem_name);
struct device_node *cur, *new = NULL; struct device_node *cur, *new = NULL;
const __be32 *map, *mask, *pass; const __be32 *map, *mask, *pass;
static const __be32 dummy_mask[] = { [0 ... MAX_PHANDLE_ARGS] = cpu_to_be32(~0) }; static const __be32 dummy_mask[] = { [0 ... (MAX_PHANDLE_ARGS - 1)] = cpu_to_be32(~0) };
static const __be32 dummy_pass[] = { [0 ... MAX_PHANDLE_ARGS] = cpu_to_be32(0) }; static const __be32 dummy_pass[] = { [0 ... (MAX_PHANDLE_ARGS - 1)] = cpu_to_be32(0) };
__be32 initial_match_array[MAX_PHANDLE_ARGS]; __be32 initial_match_array[MAX_PHANDLE_ARGS];
const __be32 *match_array = initial_match_array; const __be32 *match_array = initial_match_array;
int i, ret, map_len, match; int i, ret, map_len, match;
@ -1546,7 +1542,6 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
* specifier into the out_args structure, keeping the * specifier into the out_args structure, keeping the
* bits specified in <list>-map-pass-thru. * bits specified in <list>-map-pass-thru.
*/ */
match_array = map - new_size;
for (i = 0; i < new_size; i++) { for (i = 0; i < new_size; i++) {
__be32 val = *(map - new_size + i); __be32 val = *(map - new_size + i);
@ -1555,6 +1550,7 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
val |= cpu_to_be32(out_args->args[i]) & pass[i]; val |= cpu_to_be32(out_args->args[i]) & pass[i];
} }
initial_match_array[i] = val;
out_args->args[i] = be32_to_cpu(val); out_args->args[i] = be32_to_cpu(val);
} }
out_args->args_count = list_size = new_size; out_args->args_count = list_size = new_size;
@ -1822,8 +1818,7 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np,
* for storing the resulting tree * for storing the resulting tree
* *
* The function scans all the properties of the 'aliases' node and populates * The function scans all the properties of the 'aliases' node and populates
* the global lookup table with the properties. It returns the * the global lookup table with the properties.
* number of alias properties found, or an error code in case of failure.
*/ */
void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
{ {

View file

@ -8,7 +8,6 @@
#define pr_fmt(fmt) "OF: fdt: " fmt #define pr_fmt(fmt) "OF: fdt: " fmt
#include <linux/acpi.h>
#include <linux/crash_dump.h> #include <linux/crash_dump.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/kernel.h> #include <linux/kernel.h>
@ -497,6 +496,7 @@ static void __init fdt_reserve_elfcorehdr(void)
void __init early_init_fdt_scan_reserved_mem(void) void __init early_init_fdt_scan_reserved_mem(void)
{ {
int n; int n;
int res;
u64 base, size; u64 base, size;
if (!initial_boot_params) if (!initial_boot_params)
@ -507,7 +507,11 @@ void __init early_init_fdt_scan_reserved_mem(void)
/* Process header /memreserve/ fields */ /* Process header /memreserve/ fields */
for (n = 0; ; n++) { for (n = 0; ; n++) {
fdt_get_mem_rsv(initial_boot_params, n, &base, &size); res = fdt_get_mem_rsv(initial_boot_params, n, &base, &size);
if (res) {
pr_err("Invalid memory reservation block index %d\n", n);
break;
}
if (!size) if (!size)
break; break;
memblock_reserve(base, size); memblock_reserve(base, size);
@ -1215,14 +1219,7 @@ void __init unflatten_device_tree(void)
/* Save the statically-placed regions in the reserved_mem array */ /* Save the statically-placed regions in the reserved_mem array */
fdt_scan_reserved_mem_reg_nodes(); fdt_scan_reserved_mem_reg_nodes();
/* Don't use the bootloader provided DTB if ACPI is enabled */ /* Populate an empty root node when bootloader doesn't provide one */
if (!acpi_disabled)
fdt = NULL;
/*
* Populate an empty root node when ACPI is enabled or bootloader
* doesn't provide one.
*/
if (!fdt) { if (!fdt) {
fdt = (void *) __dtb_empty_root_begin; fdt = (void *) __dtb_empty_root_begin;
/* fdt_totalsize() will be used for copy size */ /* fdt_totalsize() will be used for copy size */
@ -1264,18 +1261,9 @@ void __init unflatten_and_copy_device_tree(void)
} }
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS
static ssize_t of_fdt_raw_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
memcpy(buf, initial_boot_params + off, count);
return count;
}
static int __init of_fdt_raw_init(void) static int __init of_fdt_raw_init(void)
{ {
static struct bin_attribute of_fdt_raw_attr = static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(fdt);
__BIN_ATTR(fdt, S_IRUSR, of_fdt_raw_read, NULL, 0);
if (!initial_boot_params) if (!initial_boot_params)
return 0; return 0;
@ -1285,8 +1273,9 @@ static int __init of_fdt_raw_init(void)
pr_warn("not creating '/sys/firmware/fdt': CRC check failed\n"); pr_warn("not creating '/sys/firmware/fdt': CRC check failed\n");
return 0; return 0;
} }
of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params); bin_attr_fdt.private = initial_boot_params;
return sysfs_create_bin_file(firmware_kobj, &of_fdt_raw_attr); bin_attr_fdt.size = fdt_totalsize(initial_boot_params);
return sysfs_create_bin_file(firmware_kobj, &bin_attr_fdt);
} }
late_initcall(of_fdt_raw_init); late_initcall(of_fdt_raw_init);
#endif #endif

View file

@ -17,23 +17,10 @@
#include <linux/of_fdt.h> #include <linux/of_fdt.h>
#include <linux/sizes.h> #include <linux/sizes.h>
/* Max address size we deal with */ /* Uncomment me to enable of_dump_addr() debugging output */
#define OF_MAX_ADDR_CELLS 4 // #define DEBUG
#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
(ns) > 0)
/* Debug utility */ #include "of_private.h"
#ifdef DEBUG
static void __init of_dump_addr(const char *s, const __be32 *addr, int na)
{
pr_debug("%s", s);
while(na--)
pr_cont(" %08x", *(addr++));
pr_cont("\n");
}
#else
static void __init of_dump_addr(const char *s, const __be32 *addr, int na) { }
#endif
/* Callbacks for bus specific translators */ /* Callbacks for bus specific translators */
struct of_bus { struct of_bus {

View file

@ -171,7 +171,7 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
struct device_node *ipar, *tnode, *old = NULL; struct device_node *ipar, *tnode, *old = NULL;
__be32 initial_match_array[MAX_PHANDLE_ARGS]; __be32 initial_match_array[MAX_PHANDLE_ARGS];
const __be32 *match_array = initial_match_array; const __be32 *match_array = initial_match_array;
const __be32 *tmp, dummy_imask[] = { [0 ... MAX_PHANDLE_ARGS] = cpu_to_be32(~0) }; const __be32 *tmp, dummy_imask[] = { [0 ... (MAX_PHANDLE_ARGS - 1)] = cpu_to_be32(~0) };
u32 intsize = 1, addrsize; u32 intsize = 1, addrsize;
int i, rc = -EINVAL; int i, rc = -EINVAL;

View file

@ -29,7 +29,7 @@ const struct kobj_type of_node_ktype = {
}; };
static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj, static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf, const struct bin_attribute *bin_attr, char *buf,
loff_t offset, size_t count) loff_t offset, size_t count)
{ {
struct property *pp = container_of(bin_attr, struct property, attr); struct property *pp = container_of(bin_attr, struct property, attr);
@ -77,7 +77,7 @@ int __of_add_property_sysfs(struct device_node *np, struct property *pp)
pp->attr.attr.name = safe_name(&np->kobj, pp->name); pp->attr.attr.name = safe_name(&np->kobj, pp->name);
pp->attr.attr.mode = secure ? 0400 : 0444; pp->attr.attr.mode = secure ? 0400 : 0444;
pp->attr.size = secure ? 0 : pp->length; pp->attr.size = secure ? 0 : pp->length;
pp->attr.read = of_node_property_read; pp->attr.read_new = of_node_property_read;
rc = sysfs_create_bin_file(&np->kobj, &pp->attr); rc = sysfs_create_bin_file(&np->kobj, &pp->attr);
WARN(rc, "error adding attribute %s to node %pOF\n", pp->name, np); WARN(rc, "error adding attribute %s to node %pOF\n", pp->name, np);

View file

@ -119,6 +119,8 @@ extern void *__unflatten_device_tree(const void *blob,
void *(*dt_alloc)(u64 size, u64 align), void *(*dt_alloc)(u64 size, u64 align),
bool detached); bool detached);
void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
/** /**
* General utilities for working with live trees. * General utilities for working with live trees.
* *
@ -188,4 +190,22 @@ void __init fdt_scan_reserved_mem_reg_nodes(void);
bool of_fdt_device_is_available(const void *blob, unsigned long node); bool of_fdt_device_is_available(const void *blob, unsigned long node);
/* Max address size we deal with */
#define OF_MAX_ADDR_CELLS 4
#define OF_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
#define OF_CHECK_COUNTS(na, ns) (OF_CHECK_ADDR_COUNT(na) && (ns) > 0)
/* Debug utility */
#ifdef DEBUG
static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na)
{
pr_debug("%s", s);
while (na--)
pr_cont(" %08x", be32_to_cpu(*(addr++)));
pr_cont("\n");
}
#else
static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na) { }
#endif
#endif /* _LINUX_OF_PRIVATE_H */ #endif /* _LINUX_OF_PRIVATE_H */

View file

@ -52,6 +52,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
memblock_phys_free(base, size); memblock_phys_free(base, size);
} }
if (!err)
kmemleak_ignore_phys(base); kmemleak_ignore_phys(base);
return err; return err;
@ -262,6 +263,11 @@ void __init fdt_scan_reserved_mem_reg_nodes(void)
uname); uname);
continue; continue;
} }
if (len > t_len)
pr_warn("%s() ignores %d regions in node '%s'\n",
__func__, len / t_len - 1, uname);
base = dt_mem_next_cell(dt_root_addr_cells, &prop); base = dt_mem_next_cell(dt_root_addr_cells, &prop);
size = dt_mem_next_cell(dt_root_size_cells, &prop); size = dt_mem_next_cell(dt_root_size_cells, &prop);
@ -409,12 +415,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam
prop = of_get_flat_dt_prop(node, "alignment", &len); prop = of_get_flat_dt_prop(node, "alignment", &len);
if (prop) { if (prop) {
if (len != dt_root_addr_cells * sizeof(__be32)) { if (len != dt_root_size_cells * sizeof(__be32)) {
pr_err("invalid alignment property in '%s' node.\n", pr_err("invalid alignment property in '%s' node.\n",
uname); uname);
return -EINVAL; return -EINVAL;
} }
align = dt_mem_next_cell(dt_root_addr_cells, &prop); align = dt_mem_next_cell(dt_root_size_cells, &prop);
} }
nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL;
@ -435,13 +441,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam
return -EINVAL; return -EINVAL;
} }
base = 0;
while (len > 0) { while (len > 0) {
start = dt_mem_next_cell(dt_root_addr_cells, &prop); start = dt_mem_next_cell(dt_root_addr_cells, &prop);
end = start + dt_mem_next_cell(dt_root_size_cells, end = start + dt_mem_next_cell(dt_root_size_cells,
&prop); &prop);
base = 0;
ret = __reserved_mem_alloc_in_range(size, align, ret = __reserved_mem_alloc_in_range(size, align,
start, end, nomap, &base); start, end, nomap, &base);
if (ret == 0) { if (ret == 0) {

View file

@ -19,6 +19,8 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_pdt.h> #include <linux/of_pdt.h>
#include "of_private.h"
static struct of_pdt_ops *of_pdt_prom_ops __initdata; static struct of_pdt_ops *of_pdt_prom_ops __initdata;
#if defined(CONFIG_SPARC) #if defined(CONFIG_SPARC)

View file

@ -24,16 +24,6 @@
#include "of_private.h" #include "of_private.h"
const struct of_device_id of_default_bus_match_table[] = {
{ .compatible = "simple-bus", },
{ .compatible = "simple-mfd", },
{ .compatible = "isa", },
#ifdef CONFIG_ARM_AMBA
{ .compatible = "arm,amba-bus", },
#endif /* CONFIG_ARM_AMBA */
{} /* Empty terminated list */
};
/** /**
* of_find_device_by_node - Find the platform_device associated with a node * of_find_device_by_node - Find the platform_device associated with a node
* @np: Pointer to device tree node * @np: Pointer to device tree node
@ -484,8 +474,17 @@ int of_platform_default_populate(struct device_node *root,
const struct of_dev_auxdata *lookup, const struct of_dev_auxdata *lookup,
struct device *parent) struct device *parent)
{ {
return of_platform_populate(root, of_default_bus_match_table, lookup, static const struct of_device_id match_table[] = {
parent); { .compatible = "simple-bus", },
{ .compatible = "simple-mfd", },
{ .compatible = "isa", },
#ifdef CONFIG_ARM_AMBA
{ .compatible = "arm,amba-bus", },
#endif /* CONFIG_ARM_AMBA */
{} /* Empty terminated list */
};
return of_platform_populate(root, match_table, lookup, parent);
} }
EXPORT_SYMBOL_GPL(of_platform_default_populate); EXPORT_SYMBOL_GPL(of_platform_default_populate);

View file

@ -31,6 +31,32 @@
#include "of_private.h" #include "of_private.h"
/**
* of_property_read_bool - Find a property
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
*
* Search for a boolean property in a device node. Usage on non-boolean
* property types is deprecated.
*
* Return: true if the property exists false otherwise.
*/
bool of_property_read_bool(const struct device_node *np, const char *propname)
{
struct property *prop = of_find_property(np, propname, NULL);
/*
* Boolean properties should not have a value. Testing for property
* presence should either use of_property_present() or just read the
* property value and check the returned error code.
*/
if (prop && prop->length)
pr_warn("%pOF: Read of boolean property '%s' with a value.\n", np, propname);
return prop ? true : false;
}
EXPORT_SYMBOL(of_property_read_bool);
/** /**
* of_graph_is_present() - check graph's presence * of_graph_is_present() - check graph's presence
* @node: pointer to device_node containing graph port * @node: pointer to device_node containing graph port
@ -965,6 +991,12 @@ of_fwnode_device_get_dma_attr(const struct fwnode_handle *fwnode)
static bool of_fwnode_property_present(const struct fwnode_handle *fwnode, static bool of_fwnode_property_present(const struct fwnode_handle *fwnode,
const char *propname) const char *propname)
{
return of_property_present(to_of_node(fwnode), propname);
}
static bool of_fwnode_property_read_bool(const struct fwnode_handle *fwnode,
const char *propname)
{ {
return of_property_read_bool(to_of_node(fwnode), propname); return of_property_read_bool(to_of_node(fwnode), propname);
} }
@ -1390,9 +1422,9 @@ static struct device_node *parse_interrupt_map(struct device_node *np,
addrcells = of_bus_n_addr_cells(np); addrcells = of_bus_n_addr_cells(np);
imap = of_get_property(np, "interrupt-map", &imaplen); imap = of_get_property(np, "interrupt-map", &imaplen);
imaplen /= sizeof(*imap);
if (!imap) if (!imap)
return NULL; return NULL;
imaplen /= sizeof(*imap);
imap_end = imap + imaplen; imap_end = imap + imaplen;
@ -1560,6 +1592,7 @@ const struct fwnode_operations of_fwnode_ops = {
.device_dma_supported = of_fwnode_device_dma_supported, .device_dma_supported = of_fwnode_device_dma_supported,
.device_get_dma_attr = of_fwnode_device_get_dma_attr, .device_get_dma_attr = of_fwnode_device_get_dma_attr,
.property_present = of_fwnode_property_present, .property_present = of_fwnode_property_present,
.property_read_bool = of_fwnode_property_read_bool,
.property_read_int_array = of_fwnode_property_read_int_array, .property_read_int_array = of_fwnode_property_read_int_array,
.property_read_string_array = of_fwnode_property_read_string_array, .property_read_string_array = of_fwnode_property_read_string_array,
.get_name = of_fwnode_get_name, .get_name = of_fwnode_get_name,

View file

@ -161,6 +161,15 @@ static void __init of_unittest_find_node_by_name(void)
"option alias path test, subcase #1 failed\n"); "option alias path test, subcase #1 failed\n");
of_node_put(np); of_node_put(np);
np = of_find_node_opts_by_path("testcase-alias/phandle-tests/consumer-a:testaliasoption",
&options);
name = kasprintf(GFP_KERNEL, "%pOF", np);
unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name) &&
!strcmp("testaliasoption", options),
"option alias path test, subcase #2 failed\n");
of_node_put(np);
kfree(name);
np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL);
unittest(np, "NULL option alias path test failed\n"); unittest(np, "NULL option alias path test failed\n");
of_node_put(np); of_node_put(np);

View file

@ -112,6 +112,7 @@ struct fwnode_reference_args {
* @device_is_available: Return true if the device is available. * @device_is_available: Return true if the device is available.
* @device_get_match_data: Return the device driver match data. * @device_get_match_data: Return the device driver match data.
* @property_present: Return true if a property is present. * @property_present: Return true if a property is present.
* @property_read_bool: Return a boolean property value.
* @property_read_int_array: Read an array of integer properties. Return zero on * @property_read_int_array: Read an array of integer properties. Return zero on
* success, a negative error code otherwise. * success, a negative error code otherwise.
* @property_read_string_array: Read an array of string properties. Return zero * @property_read_string_array: Read an array of string properties. Return zero
@ -141,6 +142,8 @@ struct fwnode_operations {
(*device_get_dma_attr)(const struct fwnode_handle *fwnode); (*device_get_dma_attr)(const struct fwnode_handle *fwnode);
bool (*property_present)(const struct fwnode_handle *fwnode, bool (*property_present)(const struct fwnode_handle *fwnode,
const char *propname); const char *propname);
bool (*property_read_bool)(const struct fwnode_handle *fwnode,
const char *propname);
int (*property_read_int_array)(const struct fwnode_handle *fwnode, int (*property_read_int_array)(const struct fwnode_handle *fwnode,
const char *propname, const char *propname,
unsigned int elem_size, void *val, unsigned int elem_size, void *val,

View file

@ -311,6 +311,7 @@ extern struct device_node *of_find_node_with_property(
extern struct property *of_find_property(const struct device_node *np, extern struct property *of_find_property(const struct device_node *np,
const char *name, const char *name,
int *lenp); int *lenp);
extern bool of_property_read_bool(const struct device_node *np, const char *propname);
extern int of_property_count_elems_of_size(const struct device_node *np, extern int of_property_count_elems_of_size(const struct device_node *np,
const char *propname, int elem_size); const char *propname, int elem_size);
extern int of_property_read_u32_index(const struct device_node *np, extern int of_property_read_u32_index(const struct device_node *np,
@ -397,7 +398,6 @@ extern int of_phandle_iterator_args(struct of_phandle_iterator *it,
uint32_t *args, uint32_t *args,
int size); int size);
extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
extern int of_alias_get_id(const struct device_node *np, const char *stem); extern int of_alias_get_id(const struct device_node *np, const char *stem);
extern int of_alias_get_highest_id(const char *stem); extern int of_alias_get_highest_id(const char *stem);
@ -615,6 +615,12 @@ static inline struct device_node *of_find_compatible_node(
return NULL; return NULL;
} }
static inline bool of_property_read_bool(const struct device_node *np,
const char *propname)
{
return false;
}
static inline int of_property_count_elems_of_size(const struct device_node *np, static inline int of_property_count_elems_of_size(const struct device_node *np,
const char *propname, int elem_size) const char *propname, int elem_size)
{ {
@ -1242,24 +1248,6 @@ static inline int of_property_read_string_index(const struct device_node *np,
return rc < 0 ? rc : 0; return rc < 0 ? rc : 0;
} }
/**
* of_property_read_bool - Find a property
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
*
* Search for a boolean property in a device node. Usage on non-boolean
* property types is deprecated.
*
* Return: true if the property exists false otherwise.
*/
static inline bool of_property_read_bool(const struct device_node *np,
const char *propname)
{
const struct property *prop = of_find_property(np, propname, NULL);
return prop ? true : false;
}
/** /**
* of_property_present - Test if a property is present in a node * of_property_present - Test if a property is present in a node
* @np: device node to search for the property. * @np: device node to search for the property.
@ -1271,7 +1259,9 @@ static inline bool of_property_read_bool(const struct device_node *np,
*/ */
static inline bool of_property_present(const struct device_node *np, const char *propname) static inline bool of_property_present(const struct device_node *np, const char *propname)
{ {
return of_property_read_bool(np, propname); struct property *prop = of_find_property(np, propname, NULL);
return prop ? true : false;
} }
/** /**

View file

@ -47,8 +47,6 @@ struct of_dev_auxdata {
{ .compatible = _compat, .phys_addr = _phys, .name = _name, \ { .compatible = _compat, .phys_addr = _phys, .name = _name, \
.platform_data = _pdata } .platform_data = _pdata }
extern const struct of_device_id of_default_bus_match_table[];
/* Platform drivers register/unregister */ /* Platform drivers register/unregister */
extern struct platform_device *of_device_alloc(struct device_node *np, extern struct platform_device *of_device_alloc(struct device_node *np,
const char *bus_id, const char *bus_id,

View file

@ -37,6 +37,7 @@ struct fwnode_handle *__dev_fwnode(struct device *dev);
struct device *: __dev_fwnode)(dev) struct device *: __dev_fwnode)(dev)
bool device_property_present(const struct device *dev, const char *propname); bool device_property_present(const struct device *dev, const char *propname);
bool device_property_read_bool(const struct device *dev, const char *propname);
int device_property_read_u8_array(const struct device *dev, const char *propname, int device_property_read_u8_array(const struct device *dev, const char *propname,
u8 *val, size_t nval); u8 *val, size_t nval);
int device_property_read_u16_array(const struct device *dev, const char *propname, int device_property_read_u16_array(const struct device *dev, const char *propname,
@ -54,6 +55,8 @@ int device_property_match_string(const struct device *dev,
bool fwnode_property_present(const struct fwnode_handle *fwnode, bool fwnode_property_present(const struct fwnode_handle *fwnode,
const char *propname); const char *propname);
bool fwnode_property_read_bool(const struct fwnode_handle *fwnode,
const char *propname);
int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode, int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode,
const char *propname, u8 *val, const char *propname, u8 *val,
size_t nval); size_t nval);
@ -207,12 +210,6 @@ int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name);
unsigned int device_get_child_node_count(const struct device *dev); unsigned int device_get_child_node_count(const struct device *dev);
static inline bool device_property_read_bool(const struct device *dev,
const char *propname)
{
return device_property_present(dev, propname);
}
static inline int device_property_read_u8(const struct device *dev, static inline int device_property_read_u8(const struct device *dev,
const char *propname, u8 *val) const char *propname, u8 *val)
{ {
@ -263,12 +260,6 @@ static inline int device_property_string_array_count(const struct device *dev,
return device_property_read_string_array(dev, propname, NULL, 0); return device_property_read_string_array(dev, propname, NULL, 0);
} }
static inline bool fwnode_property_read_bool(const struct fwnode_handle *fwnode,
const char *propname)
{
return fwnode_property_present(fwnode, propname);
}
static inline int fwnode_property_read_u8(const struct fwnode_handle *fwnode, static inline int fwnode_property_read_u8(const struct fwnode_handle *fwnode,
const char *propname, u8 *val) const char *propname, u8 *val)
{ {