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

View file

@ -148,10 +148,10 @@ examples:
/* TMDS Output */
hdmi_tx_tmds_port: port@1 {
reg = <1>;
reg = <1>;
hdmi_tx_tmds_out: endpoint {
remote-endpoint = <&hdmi_connector_in>;
};
hdmi_tx_tmds_out: endpoint {
remote-endpoint = <&hdmi_connector_in>;
};
};
};

View file

@ -82,21 +82,21 @@ examples:
power-domains = <&hdmi_blk_ctrl IMX8MP_HDMIBLK_PD_HDMI_TX>;
reg-io-width = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hdmi_tx_from_pvi: endpoint {
remote-endpoint = <&pvi_to_hdmi_tx>;
};
};
endpoint {
remote-endpoint = <&pvi_to_hdmi_tx>;
};
};
port@1 {
reg = <1>;
hdmi_tx_out: endpoint {
remote-endpoint = <&hdmi0_con>;
};
};
port@1 {
reg = <1>;
endpoint {
remote-endpoint = <&hdmi0_con>;
};
};
};
};

View file

@ -27,7 +27,9 @@ properties:
- fsl,imx8mm-mipi-dsim
- fsl,imx8mp-mipi-dsim
- items:
- const: fsl,imx8mn-mipi-dsim
- enum:
- fsl,imx7d-mipi-dsim
- fsl,imx8mn-mipi-dsim
- const: fsl,imx8mm-mipi-dsim
reg:
@ -241,40 +243,40 @@ examples:
#include <dt-bindings/interrupt-controller/arm-gic.h>
dsi@13900000 {
compatible = "samsung,exynos5433-mipi-dsi";
reg = <0x13900000 0xC0>;
interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
phys = <&mipi_phy 1>;
phy-names = "dsim";
clocks = <&cmu_disp CLK_PCLK_DSIM0>,
<&cmu_disp CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8>,
<&cmu_disp CLK_PHYCLK_MIPIDPHY0_RXCLKESC0>,
<&cmu_disp CLK_SCLK_RGB_VCLK_TO_DSIM0>,
<&cmu_disp CLK_SCLK_DSIM0>;
clock-names = "bus_clk",
"phyclk_mipidphy0_bitclkdiv8",
"phyclk_mipidphy0_rxclkesc0",
"sclk_rgb_vclk_to_dsim0",
"sclk_mipi";
power-domains = <&pd_disp>;
vddcore-supply = <&ldo6_reg>;
vddio-supply = <&ldo7_reg>;
samsung,burst-clock-frequency = <512000000>;
samsung,esc-clock-frequency = <16000000>;
samsung,pll-clock-frequency = <24000000>;
pinctrl-names = "default";
pinctrl-0 = <&te_irq>;
compatible = "samsung,exynos5433-mipi-dsi";
reg = <0x13900000 0xC0>;
interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
phys = <&mipi_phy 1>;
phy-names = "dsim";
clocks = <&cmu_disp CLK_PCLK_DSIM0>,
<&cmu_disp CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8>,
<&cmu_disp CLK_PHYCLK_MIPIDPHY0_RXCLKESC0>,
<&cmu_disp CLK_SCLK_RGB_VCLK_TO_DSIM0>,
<&cmu_disp CLK_SCLK_DSIM0>;
clock-names = "bus_clk",
"phyclk_mipidphy0_bitclkdiv8",
"phyclk_mipidphy0_rxclkesc0",
"sclk_rgb_vclk_to_dsim0",
"sclk_mipi";
power-domains = <&pd_disp>;
vddcore-supply = <&ldo6_reg>;
vddio-supply = <&ldo7_reg>;
samsung,burst-clock-frequency = <512000000>;
samsung,esc-clock-frequency = <16000000>;
samsung,pll-clock-frequency = <24000000>;
pinctrl-names = "default";
pinctrl-0 = <&te_irq>;
ports {
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
port@0 {
reg = <0>;
dsi_to_mic: endpoint {
remote-endpoint = <&mic_to_dsi>;
};
};
};
dsi_to_mic: endpoint {
remote-endpoint = <&mic_to_dsi>;
};
};
};
};

View file

@ -104,30 +104,30 @@ examples:
#size-cells = <2>;
aal@14015000 {
compatible = "mediatek,mt8173-disp-aal";
reg = <0 0x14015000 0 0x1000>;
interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
clocks = <&mmsys CLK_MM_DISP_AAL>;
mediatek,gce-client-reg = <&gce SUBSYS_1401XXXX 0x5000 0x1000>;
compatible = "mediatek,mt8173-disp-aal";
reg = <0 0x14015000 0 0x1000>;
interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
clocks = <&mmsys CLK_MM_DISP_AAL>;
mediatek,gce-client-reg = <&gce SUBSYS_1401XXXX 0x5000 0x1000>;
ports {
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
aal0_in: endpoint {
remote-endpoint = <&ccorr0_out>;
};
};
port@0 {
reg = <0>;
endpoint {
remote-endpoint = <&ccorr0_out>;
};
};
port@1 {
reg = <1>;
aal0_out: endpoint {
remote-endpoint = <&gamma0_in>;
};
};
};
};
port@1 {
reg = <1>;
endpoint {
remote-endpoint = <&gamma0_in>;
};
};
};
};
};

View file

@ -418,63 +418,63 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,gcc-sdm845.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,gcc-sdm845.h>
#include <dt-bindings/power/qcom-rpmpd.h>
dsi@ae94000 {
compatible = "qcom,sc7180-dsi-ctrl", "qcom,mdss-dsi-ctrl";
reg = <0x0ae94000 0x400>;
reg-names = "dsi_ctrl";
dsi@ae94000 {
compatible = "qcom,sc7180-dsi-ctrl", "qcom,mdss-dsi-ctrl";
reg = <0x0ae94000 0x400>;
reg-names = "dsi_ctrl";
#address-cells = <1>;
#size-cells = <0>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&mdss>;
interrupts = <4>;
interrupt-parent = <&mdss>;
interrupts = <4>;
clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
<&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK>,
<&dispcc DISP_CC_MDSS_ESC0_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&dispcc DISP_CC_MDSS_AXI_CLK>;
clock-names = "byte",
"byte_intf",
"pixel",
"core",
"iface",
"bus";
clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
<&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
<&dispcc DISP_CC_MDSS_PCLK0_CLK>,
<&dispcc DISP_CC_MDSS_ESC0_CLK>,
<&dispcc DISP_CC_MDSS_AHB_CLK>,
<&dispcc DISP_CC_MDSS_AXI_CLK>;
clock-names = "byte",
"byte_intf",
"pixel",
"core",
"iface",
"bus";
phys = <&dsi0_phy>;
phy-names = "dsi";
phys = <&dsi0_phy>;
phy-names = "dsi";
assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>, <&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>;
assigned-clock-parents = <&dsi_phy 0>, <&dsi_phy 1>;
assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>, <&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>;
assigned-clock-parents = <&dsi_phy 0>, <&dsi_phy 1>;
power-domains = <&rpmhpd SC7180_CX>;
operating-points-v2 = <&dsi_opp_table>;
power-domains = <&rpmhpd SC7180_CX>;
operating-points-v2 = <&dsi_opp_table>;
ports {
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi0_in: endpoint {
remote-endpoint = <&dpu_intf1_out>;
};
};
port@0 {
reg = <0>;
endpoint {
remote-endpoint = <&dpu_intf1_out>;
};
};
port@1 {
reg = <1>;
dsi0_out: endpoint {
remote-endpoint = <&sn65dsi86_in>;
data-lanes = <0 1 2 3>;
qcom,te-source = "mdp_vsync_e";
};
};
};
};
port@1 {
reg = <1>;
endpoint {
remote-endpoint = <&sn65dsi86_in>;
data-lanes = <0 1 2 3>;
qcom,te-source = "mdp_vsync_e";
};
};
};
};
...

View file

@ -74,28 +74,28 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-10nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94a00 0x1e0>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-10nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94a00 0x1e0>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
#clock-cells = <1>;
#phy-cells = <0>;
#clock-cells = <1>;
#phy-cells = <0>;
vdds-supply = <&vdda_mipi_dsi0_pll>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
vdds-supply = <&vdda_mipi_dsi0_pll>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
qcom,phy-rescode-offset-top = /bits/ 8 <0 0 0 0 0>;
qcom,phy-rescode-offset-bot = /bits/ 8 <0 0 0 0 0>;
qcom,phy-drive-ldo-level = <400>;
};
qcom,phy-rescode-offset-top = /bits/ 8 <0 0 0 0 0>;
qcom,phy-rescode-offset-bot = /bits/ 8 <0 0 0 0 0>;
qcom,phy-drive-ldo-level = <400>;
};
...

View file

@ -56,24 +56,24 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-14nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94a00 0x1e0>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-14nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94a00 0x1e0>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
#clock-cells = <1>;
#phy-cells = <0>;
#clock-cells = <1>;
#phy-cells = <0>;
vcca-supply = <&vcca_reg>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
vcca-supply = <&vcca_reg>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
...

View file

@ -45,26 +45,26 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
dsi-phy@fd922a00 {
compatible = "qcom,dsi-phy-20nm";
reg = <0xfd922a00 0xd4>,
<0xfd922b00 0x2b0>,
<0xfd922d80 0x7b>;
reg-names = "dsi_pll",
"dsi_phy",
"dsi_phy_regulator";
dsi-phy@fd922a00 {
compatible = "qcom,dsi-phy-20nm";
reg = <0xfd922a00 0xd4>,
<0xfd922b00 0x2b0>,
<0xfd922d80 0x7b>;
reg-names = "dsi_pll",
"dsi_phy",
"dsi_phy_regulator";
#clock-cells = <1>;
#phy-cells = <0>;
#clock-cells = <1>;
#phy-cells = <0>;
vcca-supply = <&vcca_reg>;
vddio-supply = <&vddio_reg>;
vcca-supply = <&vcca_reg>;
vddio-supply = <&vddio_reg>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
...

View file

@ -51,25 +51,25 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
#include <dt-bindings/clock/qcom,rpmh.h>
dsi-phy@fd922a00 {
compatible = "qcom,dsi-phy-28nm-lp";
reg = <0xfd922a00 0xd4>,
<0xfd922b00 0x2b0>,
<0xfd922d80 0x7b>;
reg-names = "dsi_pll",
"dsi_phy",
"dsi_phy_regulator";
dsi-phy@fd922a00 {
compatible = "qcom,dsi-phy-28nm-lp";
reg = <0xfd922a00 0xd4>,
<0xfd922b00 0x2b0>,
<0xfd922d80 0x7b>;
reg-names = "dsi_pll",
"dsi_phy",
"dsi_phy_regulator";
#clock-cells = <1>;
#phy-cells = <0>;
#clock-cells = <1>;
#phy-cells = <0>;
vddio-supply = <&vddio_reg>;
vddio-supply = <&vddio_reg>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
...

View file

@ -54,23 +54,23 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,dispcc-sm8250.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,dispcc-sm8250.h>
#include <dt-bindings/clock/qcom,rpmh.h>
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-7nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94900 0x260>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
dsi-phy@ae94400 {
compatible = "qcom,dsi-phy-7nm";
reg = <0x0ae94400 0x200>,
<0x0ae94600 0x280>,
<0x0ae94900 0x260>;
reg-names = "dsi_phy",
"dsi_phy_lane",
"dsi_pll";
#clock-cells = <1>;
#phy-cells = <0>;
#clock-cells = <1>;
#phy-cells = <0>;
vdds-supply = <&vreg_l5a_0p88>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};
vdds-supply = <&vreg_l5a_0p88>;
clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>;
clock-names = "iface", "ref";
};

View file

@ -78,7 +78,6 @@ examples:
"mdp1-mem",
"cpu-cfg";
resets = <&dispcc_core_bcr>;
power-domains = <&dispcc_gdsc>;
@ -129,7 +128,7 @@ examples:
port@0 {
reg = <0>;
dpu_intf0_out: endpoint {
remote-endpoint = <&mdss0_dp0_in>;
remote-endpoint = <&mdss0_dp0_in>;
};
};
};
@ -209,8 +208,8 @@ examples:
};
port@1 {
reg = <1>;
mdss0_dp_out: endpoint { };
reg = <1>;
mdss0_dp_out: endpoint { };
};
};

View file

@ -58,10 +58,10 @@ examples:
#include <dt-bindings/power/r8a7796-sysc.h>
cmm0: cmm@fea40000 {
compatible = "renesas,r8a7796-cmm",
"renesas,rcar-gen3-cmm";
reg = <0xfea40000 0x1000>;
power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
clocks = <&cpg CPG_MOD 711>;
resets = <&cpg 711>;
compatible = "renesas,r8a7796-cmm",
"renesas,rcar-gen3-cmm";
reg = <0xfea40000 0x1000>;
power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
clocks = <&cpg CPG_MOD 711>;
resets = <&cpg 711>;
};

View file

@ -162,14 +162,17 @@ Example::
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,
shall be enclosed in <>.
3. For arrays spanning across lines, it is preferred to align the continued
entries with opening < from the first line.
3. For arrays spanning across lines, it is preferred to split on item boundary
and align the continued entries with opening < from the first line.
Usually avoid splitting individual items unless they significantly exceed
line wrap limit.
Example::
@ -177,6 +180,9 @@ Example::
compatible = "qcom,sm8550-tsens", "qcom,tsens-v2";
reg = <0x0 0x0c271000 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

View file

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

View file

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

View file

@ -52,11 +52,11 @@ additionalProperties: false
examples:
- |
interrupt-controller@1e6c0080 {
compatible = "aspeed,ast2400-vic";
reg = <0x1e6c0080 0x80>;
interrupt-controller;
#interrupt-cells = <1>;
valid-sources = <0xffffffff 0x0007ffff>;
compatible = "aspeed,ast2400-vic";
reg = <0x1e6c0080 0x80>;
interrupt-controller;
#interrupt-cells = <1>;
valid-sources = <0xffffffff 0x0007ffff>;
};
...

View file

@ -130,23 +130,23 @@ required:
examples:
- |
irq0_intc: interrupt-controller@f0406800 {
compatible = "brcm,bcm7120-l2-intc";
interrupt-parent = <&intc>;
#interrupt-cells = <1>;
reg = <0xf0406800 0x8>;
interrupt-controller;
interrupts = <0x0 0x42 0x0>, <0x0 0x40 0x0>;
brcm,int-map-mask = <0xeb8>, <0x140>;
brcm,int-fwd-mask = <0x7>;
compatible = "brcm,bcm7120-l2-intc";
interrupt-parent = <&intc>;
#interrupt-cells = <1>;
reg = <0xf0406800 0x8>;
interrupt-controller;
interrupts = <0x0 0x42 0x0>, <0x0 0x40 0x0>;
brcm,int-map-mask = <0xeb8>, <0x140>;
brcm,int-fwd-mask = <0x7>;
};
- |
irq1_intc: interrupt-controller@10000020 {
compatible = "brcm,bcm3380-l2-intc";
reg = <0x10000024 0x4>, <0x1000002c 0x4>,
<0x10000020 0x4>, <0x10000028 0x4>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&cpu_intc>;
interrupts = <2>;
compatible = "brcm,bcm3380-l2-intc";
reg = <0x10000024 0x4>, <0x1000002c 0x4>,
<0x10000020 0x4>, <0x10000028 0x4>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&cpu_intc>;
interrupts = <2>;
};

View file

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

View file

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

View file

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

View file

@ -52,10 +52,3 @@ examples:
#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:
- mediatek,mt6323
- mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
- mediatek,mt6328
- mediatek,mt6358
- mediatek,mt6359
- mediatek,mt6397
@ -88,6 +89,7 @@ properties:
oneOf:
- enum:
- mediatek,mt6323-regulator
- mediatek,mt6328-regulator
- mediatek,mt6358-regulator
- mediatek,mt6359-regulator
- mediatek,mt6397-regulator

View file

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

View file

@ -22,6 +22,7 @@ allOf:
properties:
compatible:
enum:
- allwinner,sun50i-a100-operating-points
- allwinner,sun50i-h6-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,12 +15,25 @@ description:
properties:
compatible:
enum:
- qcom,sa8775p-adsp-pas
- qcom,sa8775p-cdsp0-pas
- qcom,sa8775p-cdsp1-pas
- qcom,sa8775p-gpdsp0-pas
- qcom,sa8775p-gpdsp1-pas
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-cdsp0-pas
- qcom,sa8775p-cdsp1-pas
- qcom,sa8775p-gpdsp0-pas
- qcom,sa8775p-gpdsp1-pas
reg:
maxItems: 1
@ -63,8 +76,9 @@ allOf:
- if:
properties:
compatible:
enum:
- qcom,sa8775p-adsp-pas
contains:
enum:
- qcom,sa8775p-adsp-pas
then:
properties:
power-domains:
@ -79,9 +93,10 @@ allOf:
- if:
properties:
compatible:
enum:
- qcom,sa8775p-cdsp0-pas
- qcom,sa8775p-cdsp1-pas
contains:
enum:
- qcom,sa8775p-cdsp0-pas
- qcom,sa8775p-cdsp1-pas
then:
properties:
power-domains:
@ -98,9 +113,10 @@ allOf:
- if:
properties:
compatible:
enum:
- qcom,sa8775p-gpdsp0-pas
- qcom,sa8775p-gpdsp1-pas
contains:
enum:
- qcom,sa8775p-gpdsp0-pas
- qcom,sa8775p-gpdsp1-pas
then:
properties:
power-domains:

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,msm8226-imem
- qcom,msm8974-imem
- qcom,msm8976-imem
- qcom,qcs404-imem
- qcom,qcs8300-imem
- qcom,qdu1000-imem

View file

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

View file

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

View file

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

View file

@ -50,12 +50,12 @@ examples:
#include <dt-bindings/power/r8a779f0-sysc.h>
ufs: ufs@e686000 {
compatible = "renesas,r8a779f0-ufs";
reg = <0xe6860000 0x100>;
interrupts = <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 1514>, <&ufs30_clk>;
clock-names = "fck", "ref_clk";
freq-table-hz = <200000000 200000000>, <38400000 38400000>;
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
resets = <&cpg 1514>;
compatible = "renesas,r8a779f0-ufs";
reg = <0xe6860000 0x100>;
interrupts = <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 1514>, <&ufs30_clk>;
clock-names = "fck", "ref_clk";
freq-table-hz = <200000000 200000000>, <38400000 38400000>;
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
resets = <&cpg 1514>;
};

View file

@ -112,19 +112,19 @@ examples:
#include <dt-bindings/clock/exynos7-clk.h>
ufs: ufs@15570000 {
compatible = "samsung,exynos7-ufs";
reg = <0x15570000 0x100>,
<0x15570100 0x100>,
<0x15571000 0x200>,
<0x15572000 0x300>;
reg-names = "hci", "vs_hci", "unipro", "ufsp";
interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock_fsys1 ACLK_UFS20_LINK>,
<&clock_fsys1 SCLK_UFSUNIPRO20_USER>;
clock-names = "core_clk", "sclk_unipro_main";
pinctrl-names = "default";
pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>;
phys = <&ufs_phy>;
phy-names = "ufs-phy";
compatible = "samsung,exynos7-ufs";
reg = <0x15570000 0x100>,
<0x15570100 0x100>,
<0x15571000 0x200>,
<0x15572000 0x300>;
reg-names = "hci", "vs_hci", "unipro", "ufsp";
interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock_fsys1 ACLK_UFS20_LINK>,
<&clock_fsys1 SCLK_UFSUNIPRO20_USER>;
clock-names = "core_clk", "sclk_unipro_main";
pinctrl-names = "default";
pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>;
phys = <&ufs_phy>;
phy-names = "ufs-phy";
};
...

View file

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

View file

@ -1342,6 +1342,8 @@ patternProperties:
description: Siemens AG
"^sifive,.*":
description: SiFive, Inc.
"^siflower,.*":
description: Shanghai Siflower Communication Co.
"^sigma,.*":
description: Sigma Designs, Inc.
"^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 test data required for executing the unit tests automated in
drivers/of/unittest.c. Currently, following Device Tree Source Include files
(.dtsi) are included in testcases.dts::
drivers/of/unittest.c. See the content of the folder::
drivers/of/unittest-data/tests-interrupts.dtsi
drivers/of/unittest-data/tests-platform.dtsi
drivers/of/unittest-data/tests-phandle.dtsi
drivers/of/unittest-data/tests-match.dtsi
drivers/of/unittest-data/tests-*.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::
$(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-match.dtsi
当内核在启用OF_SELFTEST的情况下被构建时那么下面的make规则::
当内核在启用CONFIG_OF_UNITTEST的情况下被构建时那么下面的make规则::
$(obj)/%.dtb: $(src)/%.dts FORCE
$(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, \
.device_get_dma_attr = acpi_fwnode_device_get_dma_attr, \
.property_present = acpi_fwnode_property_present, \
.property_read_bool = acpi_fwnode_property_present, \
.property_read_int_array = \
acpi_fwnode_property_read_int_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);
/**
* 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
* @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,
.put = software_node_put,
.property_present = software_node_property_present,
.property_read_bool = software_node_property_present,
.property_read_int_array = software_node_read_int_array,
.property_read_string_array = software_node_read_string_array,
.get_name = software_node_get_name,

View file

@ -16,26 +16,11 @@
#include <linux/string.h>
#include <linux/dma-direct.h> /* for bus_dma_region */
/* Uncomment me to enable of_dump_addr() debugging output */
// #define DEBUG
#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 */
struct of_bus {
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)
{
u64 end = start;
if (overflows_type(start, r->start))
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->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;
}

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 */
if (*path != '/') {
int len;
const char *p = separator;
const char *p = strchrnul(path, '/');
if (!p)
p = strchrnul(path, '/');
if (separator && separator < p)
p = separator;
len = p - path;
/* 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)
{
struct device_node *np;
const struct property *pp;
unsigned long flags;
raw_spin_lock_irqsave(&devtree_lock, flags);
for_each_of_allnodes_from(from, np) {
for (pp = np->properties; pp; pp = pp->next) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
of_node_get(np);
goto out;
}
if (__of_find_property(np, prop_name, NULL)) {
of_node_get(np);
break;
}
}
out:
of_node_put(from);
raw_spin_unlock_irqrestore(&devtree_lock, flags);
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);
struct device_node *cur, *new = NULL;
const __be32 *map, *mask, *pass;
static const __be32 dummy_mask[] = { [0 ... MAX_PHANDLE_ARGS] = cpu_to_be32(~0) };
static const __be32 dummy_pass[] = { [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 - 1)] = cpu_to_be32(0) };
__be32 initial_match_array[MAX_PHANDLE_ARGS];
const __be32 *match_array = initial_match_array;
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
* bits specified in <list>-map-pass-thru.
*/
match_array = map - new_size;
for (i = 0; i < 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];
}
initial_match_array[i] = val;
out_args->args[i] = be32_to_cpu(val);
}
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
*
* The function scans all the properties of the 'aliases' node and populates
* the global lookup table with the properties. It returns the
* number of alias properties found, or an error code in case of failure.
* the global lookup table with the properties.
*/
void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
{

View file

@ -8,7 +8,6 @@
#define pr_fmt(fmt) "OF: fdt: " fmt
#include <linux/acpi.h>
#include <linux/crash_dump.h>
#include <linux/crc32.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)
{
int n;
int res;
u64 base, size;
if (!initial_boot_params)
@ -507,7 +507,11 @@ void __init early_init_fdt_scan_reserved_mem(void)
/* Process header /memreserve/ fields */
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)
break;
memblock_reserve(base, size);
@ -1215,14 +1219,7 @@ void __init unflatten_device_tree(void)
/* Save the statically-placed regions in the reserved_mem array */
fdt_scan_reserved_mem_reg_nodes();
/* Don't use the bootloader provided DTB if ACPI is enabled */
if (!acpi_disabled)
fdt = NULL;
/*
* Populate an empty root node when ACPI is enabled or bootloader
* doesn't provide one.
*/
/* Populate an empty root node when bootloader doesn't provide one */
if (!fdt) {
fdt = (void *) __dtb_empty_root_begin;
/* fdt_totalsize() will be used for copy size */
@ -1264,18 +1261,9 @@ void __init unflatten_and_copy_device_tree(void)
}
#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 struct bin_attribute of_fdt_raw_attr =
__BIN_ATTR(fdt, S_IRUSR, of_fdt_raw_read, NULL, 0);
static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(fdt);
if (!initial_boot_params)
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");
return 0;
}
of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params);
return sysfs_create_bin_file(firmware_kobj, &of_fdt_raw_attr);
bin_attr_fdt.private = initial_boot_params;
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);
#endif

View file

@ -17,23 +17,10 @@
#include <linux/of_fdt.h>
#include <linux/sizes.h>
/* Max address size we deal with */
#define OF_MAX_ADDR_CELLS 4
#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
(ns) > 0)
/* Uncomment me to enable of_dump_addr() debugging output */
// #define DEBUG
/* Debug utility */
#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
#include "of_private.h"
/* Callbacks for bus specific translators */
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;
__be32 initial_match_array[MAX_PHANDLE_ARGS];
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;
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,
struct bin_attribute *bin_attr, char *buf,
const struct bin_attribute *bin_attr, char *buf,
loff_t offset, size_t count)
{
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.mode = secure ? 0400 : 0444;
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);
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),
bool detached);
void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
/**
* 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);
/* 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 */

View file

@ -52,7 +52,8 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
memblock_phys_free(base, size);
}
kmemleak_ignore_phys(base);
if (!err)
kmemleak_ignore_phys(base);
return err;
}
@ -262,6 +263,11 @@ void __init fdt_scan_reserved_mem_reg_nodes(void)
uname);
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);
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);
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",
uname);
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;
@ -435,13 +441,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, const char *unam
return -EINVAL;
}
base = 0;
while (len > 0) {
start = dt_mem_next_cell(dt_root_addr_cells, &prop);
end = start + dt_mem_next_cell(dt_root_size_cells,
&prop);
base = 0;
ret = __reserved_mem_alloc_in_range(size, align,
start, end, nomap, &base);
if (ret == 0) {

View file

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

View file

@ -24,16 +24,6 @@
#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
* @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,
struct device *parent)
{
return of_platform_populate(root, of_default_bus_match_table, lookup,
parent);
static const struct of_device_id 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 */
};
return of_platform_populate(root, match_table, lookup, parent);
}
EXPORT_SYMBOL_GPL(of_platform_default_populate);

View file

@ -31,6 +31,32 @@
#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
* @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,
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);
}
@ -1390,9 +1422,9 @@ static struct device_node *parse_interrupt_map(struct device_node *np,
addrcells = of_bus_n_addr_cells(np);
imap = of_get_property(np, "interrupt-map", &imaplen);
imaplen /= sizeof(*imap);
if (!imap)
return NULL;
imaplen /= sizeof(*imap);
imap_end = imap + imaplen;
@ -1560,6 +1592,7 @@ const struct fwnode_operations of_fwnode_ops = {
.device_dma_supported = of_fwnode_device_dma_supported,
.device_get_dma_attr = of_fwnode_device_get_dma_attr,
.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_string_array = of_fwnode_property_read_string_array,
.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");
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);
unittest(np, "NULL option alias path test failed\n");
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_get_match_data: Return the device driver match data.
* @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
* success, a negative error code otherwise.
* @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);
bool (*property_present)(const struct fwnode_handle *fwnode,
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,
const char *propname,
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,
const char *name,
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,
const char *propname, int elem_size);
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,
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_highest_id(const char *stem);
@ -615,6 +615,12 @@ static inline struct device_node *of_find_compatible_node(
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,
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;
}
/**
* 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
* @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)
{
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, \
.platform_data = _pdata }
extern const struct of_device_id of_default_bus_match_table[];
/* Platform drivers register/unregister */
extern struct platform_device *of_device_alloc(struct device_node *np,
const char *bus_id,

View file

@ -37,6 +37,7 @@ struct fwnode_handle *__dev_fwnode(struct device *dev);
struct device *: __dev_fwnode)(dev)
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,
u8 *val, size_t nval);
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,
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,
const char *propname, u8 *val,
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);
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,
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);
}
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,
const char *propname, u8 *val)
{