Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull Devicetree updates from Rob Herring:

- Fix possible memory leak in reserved-memory failure case

- Support for DMA parent bus which are not a parent node

- Clang -Wunsequenced fix

- Remove some unnecessary prints on memory alloc failures

- Various printk msg and comment fixes

- Update DT schema tools repository location

- Convert simple-framebuffer binding to DT schema

- Bindings for isl68137 and ir38064 trivial devices

- New documentation on binding do's and don't's for binding writers to
ignore

* tag 'devicetree-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (22 commits)
of: unittest: Remove error printing on OOM
of: irq: Remove WARN_ON() for kzalloc() failure
dt-bindings: pinctrl: fix bias-pull,up typo
dt-bindings: Update schema project location to devicetree.org github group
of: fix clang -Wunsequenced for be32_to_cpu()
of/device.c: fix the wrong comments
dt-bindings: Add isl68137 as a trivial device
dt-bindings: Add ir38064 as a trivial device
of: del redundant type conversion
dt-bindings: mfd: axp20x: Add fallback for axp805
of: Improve of_phandle_iterator_next() error message
dt-bindings: connector: Spelling mistake
dt-bindings: Add schemas for simple-framebuffer
of: address: Add support for the parent DMA bus
of: address: Retrieve a parent through a callback in __of_translate_address
dt-bindings: bus: Add binding for the Allwinner MBUS controller
dt-bindings: interconnect: Add a dma interconnect name
of: use correct function prototype for of_overlay_fdt_apply()
of: reserved_mem: fix reserve memory leak
of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put
...

+341 -196
+1
Documentation/devicetree/bindings/arm/cpus.yaml
··· 67 67 68 68 patternProperties: 69 69 '^cpu@[0-9a-f]+$': 70 + type: object 70 71 properties: 71 72 device_type: 72 73 const: cpu
+36
Documentation/devicetree/bindings/arm/sunxi/sunxi-mbus.txt
··· 1 + Allwinner Memory Bus (MBUS) controller 2 + 3 + The MBUS controller drives the MBUS that other devices in the SoC will 4 + use to perform DMA. It also has a register interface that allows to 5 + monitor and control the bandwidth and priorities for masters on that 6 + bus. 7 + 8 + Required properties: 9 + - compatible: Must be one of: 10 + - allwinner,sun5i-a13-mbus 11 + - reg: Offset and length of the register set for the controller 12 + - clocks: phandle to the clock driving the controller 13 + - dma-ranges: See section 2.3.9 of the DeviceTree Specification 14 + - #interconnect-cells: Must be one, with the argument being the MBUS 15 + port ID 16 + 17 + Each device having to perform their DMA through the MBUS must have the 18 + interconnects and interconnect-names properties set to the MBUS 19 + controller and with "dma-mem" as the interconnect name. 20 + 21 + Example: 22 + 23 + mbus: dram-controller@1c01000 { 24 + compatible = "allwinner,sun5i-a13-mbus"; 25 + reg = <0x01c01000 0x1000>; 26 + clocks = <&ccu CLK_MBUS>; 27 + dma-ranges = <0x00000000 0x40000000 0x20000000>; 28 + #interconnect-cells = <1>; 29 + }; 30 + 31 + fe0: display-frontend@1e00000 { 32 + compatible = "allwinner,sun5i-a13-display-frontend"; 33 + ... 34 + interconnects = <&mbus 19>; 35 + interconnect-names = "dma-mem"; 36 + };
+1 -1
Documentation/devicetree/bindings/connector/usb-connector.txt
··· 47 47 Required nodes: 48 48 - any data bus to the connector should be modeled using the OF graph bindings 49 49 specified in bindings/graph.txt, unless the bus is between parent node and 50 - the connector. Since single connector can have multpile data buses every bus 50 + the connector. Since single connector can have multiple data buses every bus 51 51 has assigned OF graph port number as follows: 52 52 0: High Speed (HS), present in all connectors, 53 53 1: Super Speed (SS), present in SS capable connectors,
-33
Documentation/devicetree/bindings/display/amlogic,simple-framebuffer.txt
··· 1 - Meson specific Simple Framebuffer bindings 2 - 3 - This binding documents meson specific extensions to the simple-framebuffer 4 - bindings. The meson simplefb u-boot code relies on the devicetree containing 5 - pre-populated simplefb nodes. 6 - 7 - These extensions are intended so that u-boot can select the right node based 8 - on which pipeline is being used. As such they are solely intended for 9 - firmware / bootloader use, and the OS should ignore them. 10 - 11 - Required properties: 12 - - compatible: "amlogic,simple-framebuffer", "simple-framebuffer" 13 - - amlogic,pipeline, one of: 14 - "vpu-cvbs" 15 - "vpu-hdmi" 16 - 17 - Example: 18 - 19 - chosen { 20 - #address-cells = <2>; 21 - #size-cells = <2>; 22 - ranges; 23 - 24 - simplefb_hdmi: framebuffer-hdmi { 25 - compatible = "amlogic,simple-framebuffer", 26 - "simple-framebuffer"; 27 - amlogic,pipeline = "vpu-hdmi"; 28 - clocks = <&clkc CLKID_HDMI_PCLK>, 29 - <&clkc CLKID_CLK81>, 30 - <&clkc CLKID_GCLK_VENCI_INT0>; 31 - power-domains = <&pwrc_vpu>; 32 - }; 33 - };
-36
Documentation/devicetree/bindings/display/simple-framebuffer-sunxi.txt
··· 1 - Sunxi specific Simple Framebuffer bindings 2 - 3 - This binding documents sunxi specific extensions to the simple-framebuffer 4 - bindings. The sunxi simplefb u-boot code relies on the devicetree containing 5 - pre-populated simplefb nodes. 6 - 7 - These extensions are intended so that u-boot can select the right node based 8 - on which pipeline is being used. As such they are solely intended for 9 - firmware / bootloader use, and the OS should ignore them. 10 - 11 - Required properties: 12 - - compatible: "allwinner,simple-framebuffer" 13 - - allwinner,pipeline, one of: 14 - "de_be0-lcd0" 15 - "de_be1-lcd1" 16 - "de_be0-lcd0-hdmi" 17 - "de_be1-lcd1-hdmi" 18 - "mixer0-lcd0" 19 - "mixer0-lcd0-hdmi" 20 - "mixer1-lcd1-hdmi" 21 - "mixer1-lcd1-tve" 22 - 23 - Example: 24 - 25 - chosen { 26 - #address-cells = <1>; 27 - #size-cells = <1>; 28 - ranges; 29 - 30 - framebuffer@0 { 31 - compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; 32 - allwinner,pipeline = "de_be0-lcd0-hdmi"; 33 - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, 34 - <&ahb_gates 44>; 35 - }; 36 - };
-91
Documentation/devicetree/bindings/display/simple-framebuffer.txt
··· 1 - Simple Framebuffer 2 - 3 - A simple frame-buffer describes a frame-buffer setup by firmware or 4 - the bootloader, with the assumption that the display hardware has already 5 - been set up to scan out from the memory pointed to by the reg property. 6 - 7 - Since simplefb nodes represent runtime information they must be sub-nodes of 8 - the chosen node (*). Simplefb nodes must be named "framebuffer@<address>". 9 - 10 - If the devicetree contains nodes for the display hardware used by a simplefb, 11 - then the simplefb node must contain a property called "display", which 12 - contains a phandle pointing to the primary display hw node, so that the OS 13 - knows which simplefb to disable when handing over control to a driver for the 14 - real hardware. The bindings for the hw nodes must specify which node is 15 - considered the primary node. 16 - 17 - It is advised to add display# aliases to help the OS determine how to number 18 - things. If display# aliases are used, then if the simplefb node contains a 19 - "display" property then the /aliases/display# path must point to the display 20 - hw node the "display" property points to, otherwise it must point directly 21 - to the simplefb node. 22 - 23 - If a simplefb node represents the preferred console for user interaction, 24 - then the chosen node's stdout-path property should point to it, or to the 25 - primary display hw node, as with display# aliases. If display aliases are 26 - used then it should be set to the alias instead. 27 - 28 - It is advised that devicetree files contain pre-filled, disabled framebuffer 29 - nodes, so that the firmware only needs to update the mode information and 30 - enable them. This way if e.g. later on support for more display clocks get 31 - added, the simplefb nodes will already contain this info and the firmware 32 - does not need to be updated. 33 - 34 - If pre-filled framebuffer nodes are used, the firmware may need extra 35 - information to find the right node. In that case an extra platform specific 36 - compatible and platform specific properties should be used and documented, 37 - see e.g. simple-framebuffer-sunxi.txt . 38 - 39 - Required properties: 40 - - compatible: "simple-framebuffer" 41 - - reg: Should contain the location and size of the framebuffer memory. 42 - - width: The width of the framebuffer in pixels. 43 - - height: The height of the framebuffer in pixels. 44 - - stride: The number of bytes in each line of the framebuffer. 45 - - format: The format of the framebuffer surface. Valid values are: 46 - - r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b). 47 - - a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r). 48 - 49 - Optional properties: 50 - - clocks : List of clocks used by the framebuffer. 51 - - *-supply : Any number of regulators used by the framebuffer. These should 52 - be named according to the names in the device's design. 53 - 54 - The above resources are expected to already be configured correctly. 55 - The OS must ensure they are not modified or disabled while the simple 56 - framebuffer remains active. 57 - 58 - - display : phandle pointing to the primary display hardware node 59 - 60 - Example: 61 - 62 - aliases { 63 - display0 = &lcdc0; 64 - } 65 - 66 - chosen { 67 - framebuffer0: framebuffer@1d385000 { 68 - compatible = "simple-framebuffer"; 69 - reg = <0x1d385000 (1600 * 1200 * 2)>; 70 - width = <1600>; 71 - height = <1200>; 72 - stride = <(1600 * 2)>; 73 - format = "r5g6b5"; 74 - clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; 75 - lcd-supply = <&reg_dc1sw>; 76 - display = <&lcdc0>; 77 - }; 78 - stdout-path = "display0"; 79 - }; 80 - 81 - soc@1c00000 { 82 - lcdc0: lcdc@1c0c000 { 83 - compatible = "allwinner,sun4i-a10-lcdc"; 84 - ... 85 - }; 86 - }; 87 - 88 - 89 - *) Older devicetree files may have a compatible = "simple-framebuffer" node 90 - in a different place, operating systems must first enumerate any compatible 91 - nodes found under chosen and then check for other compatible nodes.
+160
Documentation/devicetree/bindings/display/simple-framebuffer.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/simple-framebuffer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Simple Framebuffer Device Tree Bindings 8 + 9 + maintainers: 10 + - Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> 11 + - Hans de Goede <hdegoede@redhat.com> 12 + 13 + description: |+ 14 + A simple frame-buffer describes a frame-buffer setup by firmware or 15 + the bootloader, with the assumption that the display hardware has 16 + already been set up to scan out from the memory pointed to by the 17 + reg property. 18 + 19 + Since simplefb nodes represent runtime information they must be 20 + sub-nodes of the chosen node (*). Simplefb nodes must be named 21 + framebuffer@<address>. 22 + 23 + If the devicetree contains nodes for the display hardware used by a 24 + simplefb, then the simplefb node must contain a property called 25 + display, which contains a phandle pointing to the primary display 26 + hw node, so that the OS knows which simplefb to disable when handing 27 + over control to a driver for the real hardware. The bindings for the 28 + hw nodes must specify which node is considered the primary node. 29 + 30 + It is advised to add display# aliases to help the OS determine how 31 + to number things. If display# aliases are used, then if the simplefb 32 + node contains a display property then the /aliases/display# path 33 + must point to the display hw node the display property points to, 34 + otherwise it must point directly to the simplefb node. 35 + 36 + If a simplefb node represents the preferred console for user 37 + interaction, then the chosen node stdout-path property should point 38 + to it, or to the primary display hw node, as with display# 39 + aliases. If display aliases are used then it should be set to the 40 + alias instead. 41 + 42 + It is advised that devicetree files contain pre-filled, disabled 43 + framebuffer nodes, so that the firmware only needs to update the 44 + mode information and enable them. This way if e.g. later on support 45 + for more display clocks get added, the simplefb nodes will already 46 + contain this info and the firmware does not need to be updated. 47 + 48 + If pre-filled framebuffer nodes are used, the firmware may need 49 + extra information to find the right node. In that case an extra 50 + platform specific compatible and platform specific properties should 51 + be used and documented. 52 + 53 + properties: 54 + compatible: 55 + items: 56 + - enum: 57 + - allwinner,simple-framebuffer 58 + - amlogic,simple-framebuffer 59 + - const: simple-framebuffer 60 + 61 + reg: 62 + description: Location and size of the framebuffer memory 63 + 64 + clocks: 65 + description: List of clocks used by the framebuffer. 66 + 67 + power-domains: 68 + description: List of power domains used by the framebuffer. 69 + 70 + width: 71 + $ref: /schemas/types.yaml#/definitions/uint32 72 + description: Width of the framebuffer in pixels 73 + 74 + height: 75 + $ref: /schemas/types.yaml#/definitions/uint32 76 + description: Height of the framebuffer in pixels 77 + 78 + stride: 79 + $ref: /schemas/types.yaml#/definitions/uint32 80 + description: Number of bytes of a line in the framebuffer 81 + 82 + format: 83 + description: > 84 + Format of the framebuffer: 85 + * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r 86 + * `r5g6b5` - 16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b 87 + enum: 88 + - a8b8g8r8 89 + - r5g6b5 90 + 91 + display: 92 + $ref: /schemas/types.yaml#/definitions/phandle 93 + description: Primary display hardware node 94 + 95 + allwinner,pipeline: 96 + description: Pipeline used by the framebuffer on Allwinner SoCs 97 + enum: 98 + - de_be0-lcd0 99 + - de_be0-lcd0-hdmi 100 + - de_be0-lcd0-tve0 101 + - de_be1-lcd0 102 + - de_be1-lcd1-hdmi 103 + - de_fe0-de_be0-lcd0 104 + - de_fe0-de_be0-lcd0-hdmi 105 + - de_fe0-de_be0-lcd0-tve0 106 + - mixer0-lcd0 107 + - mixer0-lcd0-hdmi 108 + - mixer1-lcd1-hdmi 109 + - mixer1-lcd1-tve 110 + 111 + amlogic,pipeline: 112 + description: Pipeline used by the framebuffer on Amlogic SoCs 113 + enum: 114 + - vpu-cvbs 115 + - vpu-hdmi 116 + 117 + patternProperties: 118 + "^[a-zA-Z0-9-]+-supply$": 119 + $ref: /schemas/types.yaml#/definitions/phandle 120 + description: 121 + Regulators used by the framebuffer. These should be named 122 + according to the names in the device design. 123 + 124 + required: 125 + # The binding requires also reg, width, height, stride and format, 126 + # but usually they will be filled by the bootloader. 127 + - compatible 128 + 129 + additionalProperties: false 130 + 131 + examples: 132 + - | 133 + aliases { 134 + display0 = &lcdc0; 135 + }; 136 + 137 + chosen { 138 + #address-cells = <1>; 139 + #size-cells = <1>; 140 + stdout-path = "display0"; 141 + framebuffer0: framebuffer@1d385000 { 142 + compatible = "simple-framebuffer"; 143 + reg = <0x1d385000 3840000>; 144 + width = <1600>; 145 + height = <1200>; 146 + stride = <3200>; 147 + format = "r5g6b5"; 148 + clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; 149 + lcd-supply = <&reg_dc1sw>; 150 + display = <&lcdc0>; 151 + }; 152 + }; 153 + 154 + soc@1c00000 { 155 + lcdc0: lcdc@1c0c000 { 156 + compatible = "allwinner,sun4i-a10-lcdc"; 157 + }; 158 + }; 159 + 160 + ...
+4
Documentation/devicetree/bindings/interconnect/interconnect.txt
··· 51 51 interconnect-names to match interconnect paths with interconnect 52 52 specifier pairs. 53 53 54 + Reserved interconnect names: 55 + * dma-mem: Path from the device to the main memory of 56 + the system 57 + 54 58 Example: 55 59 56 60 sdhci@7864000 {
+1
Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml
··· 129 129 130 130 patternProperties: 131 131 "^v2m@[0-9a-f]+$": 132 + type: object 132 133 description: | 133 134 * GICv2m extension for MSI/MSI-x support (Optional) 134 135
+1
Documentation/devicetree/bindings/mfd/axp20x.txt
··· 25 25 * "x-powers,axp223" 26 26 * "x-powers,axp803" 27 27 * "x-powers,axp806" 28 + * "x-powers,axp805", "x-powers,axp806" 28 29 * "x-powers,axp809" 29 30 * "x-powers,axp813" 30 31 - reg: The I2C slave address or RSB hardware address for the AXP chip
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
··· 42 42 The following generic properties as defined in pinctrl-bindings.txt are valid 43 43 to specify in a pin configuration subnode: 44 44 45 - pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength, 45 + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength, 46 46 output-low, output-high. 47 47 48 48 Non-empty subnodes must specify the 'pins' property.
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
··· 44 44 45 45 The following generic properties as defined in pinctrl-bindings.txt are valid 46 46 to specify in a pin configuration subnode: 47 - pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength. 47 + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength. 48 48 49 49 Non-empty subnodes must specify the 'pins' property. 50 50 Note that not all properties are valid for all pins.
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,ipq8064-pinctrl.txt
··· 42 42 The following generic properties as defined in pinctrl-bindings.txt are valid 43 43 to specify in a pin configuration subnode: 44 44 45 - pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength, 45 + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength, 46 46 output-low, output-high. 47 47 48 48 Non-empty subnodes must specify the 'pins' property.
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8660-pinctrl.txt
··· 42 42 The following generic properties as defined in pinctrl-bindings.txt are valid 43 43 to specify in a pin configuration subnode: 44 44 45 - pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength, 45 + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength, 46 46 output-low, output-high. 47 47 48 48 Non-empty subnodes must specify the 'pins' property.
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt
··· 41 41 42 42 The following generic properties as defined in pinctrl-bindings.txt are valid 43 43 to specify in a pin configuration subnode: 44 - pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength. 44 + pins, function, bias-disable, bias-pull-down, bias-pull-up, drive-strength. 45 45 46 46 Non-empty subnodes must specify the 'pins' property. 47 47 Note that not all properties are valid for all pins.
+1
Documentation/devicetree/bindings/timer/arm,arch_timer_mmio.yaml
··· 59 59 60 60 patternProperties: 61 61 '^frame@[0-9a-z]*$': 62 + type: object 62 63 description: A timer node has up to 8 frame sub-nodes, each with the following properties. 63 64 properties: 64 65 frame-number:
+4
Documentation/devicetree/bindings/trivial-devices.yaml
··· 92 92 - fsl,sgtl5000 93 93 # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface 94 94 - gmt,g751 95 + # Infineon IR38064 Voltage Regulator 96 + - infineon,ir38064 95 97 # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 96 98 - infineon,slb9635tt 97 99 # Infineon SLB9645 I2C TPM (new protocol, max 400khz) ··· 104 102 - isil,isl29028 105 103 # Intersil ISL29030 Ambient Light and Proximity Sensor 106 104 - isil,isl29030 105 + # Intersil ISL68137 Digital Output Configurable PWM Controller 106 + - isil,isl68137 107 107 # 5 Bit Programmable, Pulse-Width Modulator 108 108 - maxim,ds1050 109 109 # Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
+60
Documentation/devicetree/bindings/writing-bindings.txt
··· 1 + DOs and DON'Ts for designing and writing Devicetree bindings 2 + 3 + This is a list of common review feedback items focused on binding design. With 4 + every rule, there are exceptions and bindings have many gray areas. 5 + 6 + For guidelines related to patches, see 7 + Documentation/devicetree/bindings/submitting-patches.txt 8 + 9 + 10 + Overall design 11 + 12 + - DO attempt to make bindings complete even if a driver doesn't support some 13 + features. For example, if a device has an interrupt, then include the 14 + 'interrupts' property even if the driver is only polled mode. 15 + 16 + - DON'T refer to Linux or "device driver" in bindings. Bindings should be 17 + based on what the hardware has, not what an OS and driver currently support. 18 + 19 + - DO use node names matching the class of the device. Many standard names are 20 + defined in the DT Spec. If there isn't one, consider adding it. 21 + 22 + - DO check that the example matches the documentation especially after making 23 + review changes. 24 + 25 + - DON'T create nodes just for the sake of instantiating drivers. Multi-function 26 + devices only need child nodes when the child nodes have their own DT 27 + resources. A single node can be multiple providers (e.g. clocks and resets). 28 + 29 + - DON'T use 'syscon' alone without a specific compatible string. A 'syscon' 30 + hardware block should have a compatible string unique enough to infer the 31 + register layout of the entire block (at a minimum). 32 + 33 + 34 + Properties 35 + 36 + - DO make 'compatible' properties specific. DON'T use wildcards in compatible 37 + strings. DO use fallback compatibles when devices are the same as or a subset 38 + of prior implementations. DO add new compatibles in case there are new 39 + features or bugs. 40 + 41 + - DO use a vendor prefix on device specific property names. Consider if 42 + properties could be common among devices of the same class. Check other 43 + existing bindings for similar devices. 44 + 45 + - DON'T redefine common properties. Just reference the definition and define 46 + constraints specific to the device. 47 + 48 + - DO use common property unit suffixes for properties with scientific units. 49 + See property-units.txt. 50 + 51 + - DO define properties in terms of constraints. How many entries? What are 52 + possible values? What is the order? 53 + 54 + 55 + Board/SoC .dts Files 56 + 57 + - DO put all MMIO devices under a bus node and not at the top-level. 58 + 59 + - DO use non-empty 'ranges' to limit the size of child buses/devices. 64-bit 60 + platforms don't need all devices to have 64-bit address and size.
+1 -1
Documentation/devicetree/writing-schema.md
··· 97 97 binding documents and validate DTS files using the DT schema. The DT schema 98 98 project can be installed with pip: 99 99 100 - `pip3 install git+https://github.com/robherring/yaml-bindings.git@master` 100 + `pip3 install git+https://github.com/devicetree-org/dt-schema.git@master` 101 101 102 102 dtc must also be built with YAML output support enabled. This requires that 103 103 libyaml and its headers be installed on the host system.
+34 -6
drivers/of/address.c
··· 569 569 * relative to that node. 570 570 */ 571 571 static u64 __of_translate_address(struct device_node *dev, 572 + struct device_node *(*get_parent)(const struct device_node *), 572 573 const __be32 *in_addr, const char *rprop, 573 574 struct device_node **host) 574 575 { ··· 586 585 587 586 *host = NULL; 588 587 /* Get parent & match bus type */ 589 - parent = of_get_parent(dev); 588 + parent = get_parent(dev); 590 589 if (parent == NULL) 591 590 goto bail; 592 591 bus = of_match_bus(parent); ··· 610 609 /* Switch to parent bus */ 611 610 of_node_put(dev); 612 611 dev = parent; 613 - parent = of_get_parent(dev); 612 + parent = get_parent(dev); 614 613 615 614 /* If root, we have finished */ 616 615 if (parent == NULL) { ··· 666 665 struct device_node *host; 667 666 u64 ret; 668 667 669 - ret = __of_translate_address(dev, in_addr, "ranges", &host); 668 + ret = __of_translate_address(dev, of_get_parent, 669 + in_addr, "ranges", &host); 670 670 if (host) { 671 671 of_node_put(host); 672 672 return OF_BAD_ADDR; ··· 677 675 } 678 676 EXPORT_SYMBOL(of_translate_address); 679 677 678 + static struct device_node *__of_get_dma_parent(const struct device_node *np) 679 + { 680 + struct of_phandle_args args; 681 + int ret, index; 682 + 683 + index = of_property_match_string(np, "interconnect-names", "dma-mem"); 684 + if (index < 0) 685 + return of_get_parent(np); 686 + 687 + ret = of_parse_phandle_with_args(np, "interconnects", 688 + "#interconnect-cells", 689 + index, &args); 690 + if (ret < 0) 691 + return of_get_parent(np); 692 + 693 + return of_node_get(args.np); 694 + } 695 + 680 696 u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr) 681 697 { 682 698 struct device_node *host; 683 699 u64 ret; 684 700 685 - ret = __of_translate_address(dev, in_addr, "dma-ranges", &host); 701 + ret = __of_translate_address(dev, __of_get_dma_parent, 702 + in_addr, "dma-ranges", &host); 686 703 687 704 if (host) { 688 705 of_node_put(host); ··· 757 736 unsigned long port; 758 737 struct device_node *host; 759 738 760 - taddr = __of_translate_address(dev, in_addr, "ranges", &host); 739 + taddr = __of_translate_address(dev, of_get_parent, 740 + in_addr, "ranges", &host); 761 741 if (host) { 762 742 /* host-specific port access */ 763 743 port = logic_pio_trans_hwaddr(&host->fwnode, taddr, size); ··· 930 908 return -EINVAL; 931 909 932 910 while (1) { 911 + struct device_node *parent; 912 + 933 913 naddr = of_n_addr_cells(node); 934 914 nsize = of_n_size_cells(node); 935 - node = of_get_next_parent(node); 915 + 916 + parent = __of_get_dma_parent(node); 917 + of_node_put(node); 918 + 919 + node = parent; 936 920 if (!node) 937 921 break; 938 922
+3 -2
drivers/of/base.c
··· 1350 1350 * property data length 1351 1351 */ 1352 1352 if (it->cur + count > it->list_end) { 1353 - pr_err("%pOF: arguments longer than property\n", 1354 - it->parent); 1353 + pr_err("%pOF: %s = %d found %d\n", 1354 + it->parent, it->cells_name, 1355 + count, it->cell_count); 1355 1356 goto err; 1356 1357 } 1357 1358 }
+1 -1
drivers/of/device.c
··· 17 17 18 18 /** 19 19 * of_match_device - Tell if a struct device matches an of_device_id list 20 - * @ids: array of of device match structures to search in 20 + * @matches: array of of device match structures to search in 21 21 * @dev: the of device structure to match against 22 22 * 23 23 * Used by a driver to check whether an platform_device present in the
+1 -1
drivers/of/fdt.c
··· 1091 1091 /* Retrieve command line */ 1092 1092 p = of_get_flat_dt_prop(node, "bootargs", &l); 1093 1093 if (p != NULL && l > 0) 1094 - strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); 1094 + strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); 1095 1095 1096 1096 /* 1097 1097 * CONFIG_CMDLINE is meant to be a default in case nothing else
+1 -1
drivers/of/irq.c
··· 500 500 * pointer, interrupt-parent device_node etc. 501 501 */ 502 502 desc = kzalloc(sizeof(*desc), GFP_KERNEL); 503 - if (WARN_ON(!desc)) { 503 + if (!desc) { 504 504 of_node_put(np); 505 505 goto err; 506 506 }
+17 -5
drivers/of/of_reserved_mem.c
··· 171 171 { 172 172 extern const struct of_device_id __reservedmem_of_table[]; 173 173 const struct of_device_id *i; 174 + int ret = -ENOENT; 174 175 175 176 for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) { 176 177 reservedmem_of_init_fn initfn = i->data; ··· 180 179 if (!of_flat_dt_is_compatible(rmem->fdt_node, compat)) 181 180 continue; 182 181 183 - if (initfn(rmem) == 0) { 182 + ret = initfn(rmem); 183 + if (ret == 0) { 184 184 pr_info("initialized node %s, compatible id %s\n", 185 185 rmem->name, compat); 186 - return 0; 186 + break; 187 187 } 188 188 } 189 - return -ENOENT; 189 + return ret; 190 190 } 191 191 192 192 static int __init __rmem_cmp(const void *a, const void *b) ··· 247 245 int len; 248 246 const __be32 *prop; 249 247 int err = 0; 248 + int nomap; 250 249 250 + nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; 251 251 prop = of_get_flat_dt_prop(node, "phandle", &len); 252 252 if (!prop) 253 253 prop = of_get_flat_dt_prop(node, "linux,phandle", &len); ··· 259 255 if (rmem->size == 0) 260 256 err = __reserved_mem_alloc_size(node, rmem->name, 261 257 &rmem->base, &rmem->size); 262 - if (err == 0) 263 - __reserved_mem_init_node(rmem); 258 + if (err == 0) { 259 + err = __reserved_mem_init_node(rmem); 260 + if (err != 0 && err != -ENOENT) { 261 + pr_info("node %s compatible matching fail\n", 262 + rmem->name); 263 + memblock_free(rmem->base, rmem->size); 264 + if (nomap) 265 + memblock_add(rmem->base, rmem->size); 266 + } 267 + } 264 268 } 265 269 } 266 270
+1 -1
drivers/of/property.c
··· 659 659 * 660 660 * Return: An 'endpoint' node pointer which is identified by reg and at the same 661 661 * is the child of a port node identified by port_reg. reg and port_reg are 662 - * ignored when they are -1. 662 + * ignored when they are -1. Use of_node_put() on the pointer when done. 663 663 */ 664 664 struct device_node *of_graph_get_endpoint_by_regs( 665 665 const struct device_node *parent, int port_reg, int reg)
+4 -9
drivers/of/unittest.c
··· 344 344 } 345 345 346 346 nh = kzalloc(sizeof(*nh), GFP_KERNEL); 347 - if (WARN_ON(!nh)) 347 + if (!nh) 348 348 return; 349 349 350 350 nh->np = np; ··· 1199 1199 1200 1200 /* creating copy */ 1201 1201 unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL); 1202 - 1203 - if (!unittest_data) { 1204 - pr_warn("%s: Failed to allocate memory for unittest_data; " 1205 - "not running tests\n", __func__); 1202 + if (!unittest_data) 1206 1203 return -ENOMEM; 1207 - } 1204 + 1208 1205 of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); 1209 1206 if (!unittest_data_node) { 1210 1207 pr_warn("%s: No tree to attach; not running tests\n", __func__); ··· 1842 1845 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); 1843 1846 1844 1847 std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL); 1845 - if (!std) { 1846 - dev_err(dev, "Failed to allocate unittest i2c data\n"); 1848 + if (!std) 1847 1849 return -ENOMEM; 1848 - } 1849 1850 1850 1851 /* link them together */ 1851 1852 std->pdev = pdev;
+4 -3
include/linux/of.h
··· 234 234 static inline u64 of_read_number(const __be32 *cell, int size) 235 235 { 236 236 u64 r = 0; 237 - while (size--) 238 - r = (r << 32) | be32_to_cpu(*(cell++)); 237 + for (; size--; cell++) 238 + r = (r << 32) | be32_to_cpu(*cell); 239 239 return r; 240 240 } 241 241 ··· 1449 1449 1450 1450 #else 1451 1451 1452 - static inline int of_overlay_fdt_apply(void *overlay_fdt, int *ovcs_id) 1452 + static inline int of_overlay_fdt_apply(void *overlay_fdt, u32 overlay_fdt_size, 1453 + int *ovcs_id) 1453 1454 { 1454 1455 return -ENOTSUPP; 1455 1456 }