Commit 06f054b1 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull devicetree updates from Rob Herring:
 "DT Bindings:

   - Convert samsung,exynos5-dp, atmel,lcdc, aspeed,ast2400-wdt bindings
     to schemas

   - Add bindings for Allwinner H616 NMI controller, Renesas r8a779g0
     irqc, Renesas R-Car V4M TMU and CMT timers, Freescale S32G3
     linflexuart, and Mediatek MT7988 XHCI

   - Add 'reg' constraints on DSI and SPI display panels

   - More dropping of unnecessary quotes in schemas

   - Use full paths rather than relative paths in schema $refs

   - Drop redundant storing of phandle for reserved memory

  DT Core:

   - Use scope based cleanups for kfree() and of_node_put()

   - Track interrupt-map and power-supplies for fw_devlink

   - Add buffer overflow check in of_modalias()

   - Add and use __of_prop_free() helper for freeing struct property"

* tag 'devicetree-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (25 commits)
  of: property: Add fw_devlink support for interrupt-map property
  dt-bindings: display: panel: constrain 'reg' in DSI panels
  dt-bindings: display: panel: constrain 'reg' in SPI panels
  dt-bindings: display: samsung,ams495qa01: add missing SPI properties ref
  dt-bindings: Use full path to other schemas
  dt-bindings: PCI: qcom,pcie-sm8350: Drop redundant 'oneOf' sub-schema
  of: module: add buffer overflow check in of_modalias()
  dt-bindings: PCI: microchip: increase number of items in ranges property
  dt-bindings: Drop unnecessary quotes on keys
  dt-bindings: interrupt-controller: mediatek,mt6577-sysirq: Drop unnecessary quotes
  of: property: Use scope based cleanup on port_node
  of: reserved_mem: Remove the use of phandle from the reserved_mem APIs
  of: property: fw_devlink: Add support for "power-supplies" binding
  dt-bindings: watchdog: aspeed,ast2400-wdt: Convert to DT schema
  dt-bindings: irq: sun7i-nmi: Add binding for the H616 NMI controller
  dt-bindings: interrupt-controller: renesas,irqc: Add r8a779g0 support
  dt-bindings: timer: renesas,tmu: Add R-Car V4M support
  dt-bindings: timer: renesas,cmt: Add R-Car V4M support
  of: Use scope based of_node_put() cleanups
  of: Use scope based kfree() cleanups
  ...
parents 7ee332c9 d976c6f4
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/atmel,lcdc-display.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip's LCDC Display
maintainers:
- Nicolas Ferre <nicolas.ferre@microchip.com>
- Dharma Balasubiramani <dharma.b@microchip.com>
description:
The LCD Controller (LCDC) consists of logic for transferring LCD image data
from an external display buffer to a TFT LCD panel. The LCDC has one display
input buffer per layer that fetches pixels through the single bus host
interface and a look-up table to allow palletized display configurations. The
LCDC is programmable on a per layer basis, and supports different LCD
resolutions, window sizes, image formats and pixel depths.
# We need a select here since this schema is applicable only for nodes with the
# following properties
select:
anyOf:
- required: [ 'atmel,dmacon' ]
- required: [ 'atmel,lcdcon2' ]
- required: [ 'atmel,guard-time' ]
properties:
atmel,dmacon:
$ref: /schemas/types.yaml#/definitions/uint32
description: dma controller configuration
atmel,lcdcon2:
$ref: /schemas/types.yaml#/definitions/uint32
description: lcd controller configuration
atmel,guard-time:
$ref: /schemas/types.yaml#/definitions/uint32
description: lcd guard time (Delay in frame periods)
maximum: 127
bits-per-pixel:
$ref: /schemas/types.yaml#/definitions/uint32
description: lcd panel bit-depth.
enum: [1, 2, 4, 8, 16, 24, 32]
atmel,lcdcon-backlight:
$ref: /schemas/types.yaml#/definitions/flag
description: enable backlight
atmel,lcdcon-backlight-inverted:
$ref: /schemas/types.yaml#/definitions/flag
description: invert backlight PWM polarity
atmel,lcd-wiring-mode:
$ref: /schemas/types.yaml#/definitions/string
description: lcd wiring mode "RGB" or "BRG"
enum:
- RGB
- BRG
atmel,power-control-gpio:
description: gpio to power on or off the LCD (as many as needed)
maxItems: 1
display-timings:
$ref: panel/display-timings.yaml#
required:
- atmel,dmacon
- atmel,lcdcon2
- atmel,guard-time
- bits-per-pixel
additionalProperties: false
examples:
- |
display: panel {
bits-per-pixel = <32>;
atmel,lcdcon-backlight;
atmel,dmacon = <0x1>;
atmel,lcdcon2 = <0x80008002>;
atmel,guard-time = <9>;
atmel,lcd-wiring-mode = "RGB";
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <9000000>;
hactive = <480>;
vactive = <272>;
hback-porch = <1>;
hfront-porch = <1>;
vback-porch = <40>;
vfront-porch = <1>;
hsync-len = <45>;
vsync-len = <1>;
};
};
};
Atmel LCDC Framebuffer
-----------------------------------------------------
Required properties:
- compatible :
"atmel,at91sam9261-lcdc" ,
"atmel,at91sam9263-lcdc" ,
"atmel,at91sam9g10-lcdc" ,
"atmel,at91sam9g45-lcdc" ,
"atmel,at91sam9g45es-lcdc" ,
"atmel,at91sam9rl-lcdc" ,
- reg : Should contain 1 register ranges(address and length).
Can contain an additional register range(address and length)
for fixed framebuffer memory. Useful for dedicated memories.
- interrupts : framebuffer controller interrupt
- display: a phandle pointing to the display node
Required nodes:
- display: a display node is required to initialize the lcd panel
This should be in the board dts.
- default-mode: a videomode within the display with timing parameters
as specified below.
Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
Example:
fb0: fb@00500000 {
compatible = "atmel,at91sam9g45-lcdc";
reg = <0x00500000 0x1000>;
interrupts = <23 3 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fb>;
display = <&display0>;
#address-cells = <1>;
#size-cells = <1>;
};
Example for fixed framebuffer memory:
fb0: fb@00500000 {
compatible = "atmel,at91sam9263-lcdc";
reg = <0x00700000 0x1000 0x70000000 0x200000>;
[...]
};
Atmel LCDC Display
-----------------------------------------------------
Required properties (as per of_videomode_helper):
- atmel,dmacon: dma controller configuration
- atmel,lcdcon2: lcd controller configuration
- atmel,guard-time: lcd guard time (Delay in frame periods)
- bits-per-pixel: lcd panel bit-depth.
Optional properties (as per of_videomode_helper):
- atmel,lcdcon-backlight: enable backlight
- atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
Example:
display0: display {
bits-per-pixel = <32>;
atmel,lcdcon-backlight;
atmel,dmacon = <0x1>;
atmel,lcdcon2 = <0x80008002>;
atmel,guard-time = <9>;
atmel,lcd-wiring-mode = <1>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <9000000>;
hactive = <480>;
vactive = <272>;
hback-porch = <1>;
hfront-porch = <1>;
vback-porch = <40>;
vfront-porch = <1>;
hsync-len = <45>;
vsync-len = <1>;
};
};
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/atmel,lcdc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip's LCDC Framebuffer
maintainers:
- Nicolas Ferre <nicolas.ferre@microchip.com>
- Dharma Balasubiramani <dharma.b@microchip.com>
description:
The LCDC works with a framebuffer, which is a section of memory that contains
a complete frame of data representing pixel values for the display. The LCDC
reads the pixel data from the framebuffer and sends it to the LCD panel to
render the image.
properties:
compatible:
enum:
- atmel,at91sam9261-lcdc
- atmel,at91sam9263-lcdc
- atmel,at91sam9g10-lcdc
- atmel,at91sam9g45-lcdc
- atmel,at91sam9g45es-lcdc
- atmel,at91sam9rl-lcdc
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
maxItems: 2
clock-names:
items:
- const: hclk
- const: lcdc_clk
display:
$ref: /schemas/types.yaml#/definitions/phandle
description: A phandle pointing to the display node.
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- display
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/at91.h>
#include <dt-bindings/interrupt-controller/irq.h>
fb@500000 {
compatible = "atmel,at91sam9g45-lcdc";
reg = <0x00500000 0x1000>;
interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fb>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_PERIPHERAL 23>;
clock-names = "hclk", "lcdc_clk";
display = <&display>;
};
The Exynos display port interface should be configured based on
the type of panel connected to it.
We use two nodes:
-dp-controller node
-dptx-phy node(defined inside dp-controller node)
For the DP-PHY initialization, we use the dptx-phy node.
Required properties for dptx-phy: deprecated, use phys and phy-names
-reg: deprecated
Base address of DP PHY register.
-samsung,enable-mask: deprecated
The bit-mask used to enable/disable DP PHY.
For the Panel initialization, we read data from dp-controller node.
Required properties for dp-controller:
-compatible:
should be "samsung,exynos5-dp".
-reg:
physical base address of the controller and length
of memory mapped region.
-interrupts:
interrupt combiner values.
-clocks:
from common clock binding: handle to dp clock.
-clock-names:
from common clock binding: Shall be "dp".
-phys:
from general PHY binding: the phandle for the PHY device.
-phy-names:
from general PHY binding: Should be "dp".
Optional properties for dp-controller:
-interlaced:
interlace scan mode.
Progressive if defined, Interlaced if not defined
-vsync-active-high:
VSYNC polarity configuration.
High if defined, Low if not defined
-hsync-active-high:
HSYNC polarity configuration.
High if defined, Low if not defined
-samsung,hpd-gpio:
Hotplug detect GPIO.
Indicates which GPIO should be used for hotplug
detection
-video interfaces: Device node can contain video interface port
nodes according to [1].
- display-timings: timings for the connected panel as described by
Documentation/devicetree/bindings/display/panel/display-timing.txt
For the below properties, please refer to Analogix DP binding document:
* Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
-phys (required)
-phy-names (required)
-hpd-gpios (optional)
force-hpd (optional)
Deprecated properties for DisplayPort:
-interlaced: deprecated prop that can parsed from drm_display_mode.
-vsync-active-high: deprecated prop that can parsed from drm_display_mode.
-hsync-active-high: deprecated prop that can parsed from drm_display_mode.
-samsung,ycbcr-coeff: deprecated prop that can parsed from drm_display_mode.
-samsung,dynamic-range: deprecated prop that can parsed from drm_display_mode.
-samsung,color-space: deprecated prop that can parsed from drm_display_info.
-samsung,color-depth: deprecated prop that can parsed from drm_display_info.
-samsung,link-rate: deprecated prop that can reading from monitor by dpcd method.
-samsung,lane-count: deprecated prop that can reading from monitor by dpcd method.
-samsung,hpd-gpio: deprecated name for hpd-gpios.
-------------------------------------------------------------------------------
Example:
SOC specific portion:
dp-controller {
compatible = "samsung,exynos5-dp";
reg = <0x145b0000 0x10000>;
interrupts = <10 3>;
interrupt-parent = <&combiner>;
clocks = <&clock 342>;
clock-names = "dp";
phys = <&dp_phy>;
phy-names = "dp";
};
Board Specific portion:
dp-controller {
display-timings {
native-mode = <&lcd_timing>;
lcd_timing: 1366x768 {
clock-frequency = <70589280>;
hactive = <1366>;
vactive = <768>;
hfront-porch = <40>;
hback-porch = <40>;
hsync-len = <32>;
vback-porch = <10>;
vfront-porch = <12>;
vsync-len = <6>;
};
};
ports {
port@0 {
dp_out: endpoint {
remote-endpoint = <&bridge_in>;
};
};
};
};
...@@ -17,10 +17,12 @@ properties: ...@@ -17,10 +17,12 @@ properties:
compatible: compatible:
const: abt,y030xx067a const: abt,y030xx067a
reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
power-supply: true power-supply: true
reg: true
reset-gpios: true reset-gpios: true
required: required:
......
...@@ -21,7 +21,10 @@ allOf: ...@@ -21,7 +21,10 @@ allOf:
properties: properties:
compatible: compatible:
const: asus,z00t-tm5p5-n35596 const: asus,z00t-tm5p5-n35596
reg: true
reg:
maxItems: 1
reset-gpios: true reset-gpios: true
vdd-supply: vdd-supply:
description: core voltage supply description: core voltage supply
......
...@@ -26,6 +26,9 @@ properties: ...@@ -26,6 +26,9 @@ properties:
compatible: compatible:
const: boe,bf060y8m-aj0 const: boe,bf060y8m-aj0
reg:
maxItems: 1
elvdd-supply: elvdd-supply:
description: EL Driving positive (VDD) supply (4.40-4.80V) description: EL Driving positive (VDD) supply (4.40-4.80V)
elvss-supply: elvss-supply:
...@@ -38,7 +41,6 @@ properties: ...@@ -38,7 +41,6 @@ properties:
description: I/O voltage supply (1.62-1.98V) description: I/O voltage supply (1.62-1.98V)
port: true port: true
reg: true
reset-gpios: true reset-gpios: true
required: required:
......
...@@ -18,9 +18,11 @@ properties: ...@@ -18,9 +18,11 @@ properties:
- const: boe,himax8279d8p - const: boe,himax8279d8p
- const: boe,himax8279d10p - const: boe,himax8279d10p
reg:
maxItems: 1
backlight: true backlight: true
enable-gpios: true enable-gpios: true
reg: true
pp33-gpios: pp33-gpios:
maxItems: 1 maxItems: 1
......
...@@ -18,7 +18,9 @@ properties: ...@@ -18,7 +18,9 @@ properties:
# BOE TH101MB31IG002-28A 10.1" WXGA TFT LCD panel # BOE TH101MB31IG002-28A 10.1" WXGA TFT LCD panel
- boe,th101mb31ig002-28a - boe,th101mb31ig002-28a
reg: true reg:
maxItems: 1
backlight: true backlight: true
enable-gpios: true enable-gpios: true
power-supply: true power-supply: true
......
...@@ -38,7 +38,7 @@ properties: ...@@ -38,7 +38,7 @@ properties:
- starry,ili9882t - starry,ili9882t
reg: reg:
description: the virtual channel number of a DSI peripheral maxItems: 1
enable-gpios: enable-gpios:
description: a GPIO spec for the enable pin description: a GPIO spec for the enable pin
......
...@@ -15,7 +15,10 @@ allOf: ...@@ -15,7 +15,10 @@ allOf:
properties: properties:
compatible: compatible:
const: elida,kd35t133 const: elida,kd35t133
reg: true
reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
reset-gpios: true reset-gpios: true
......
...@@ -17,6 +17,9 @@ properties: ...@@ -17,6 +17,9 @@ properties:
compatible: compatible:
const: fascontek,fs035vg158 const: fascontek,fs035vg158
reg:
maxItems: 1
spi-3wire: true spi-3wire: true
required: required:
......
...@@ -15,7 +15,10 @@ allOf: ...@@ -15,7 +15,10 @@ allOf:
properties: properties:
compatible: compatible:
const: feixin,k101-im2ba02 const: feixin,k101-im2ba02
reg: true
reg:
maxItems: 1
backlight: true backlight: true
reset-gpios: true reset-gpios: true
avdd-supply: avdd-supply:
......
...@@ -21,6 +21,9 @@ properties: ...@@ -21,6 +21,9 @@ properties:
contains: contains:
const: djn,9a-3r063-1102b const: djn,9a-3r063-1102b
reg:
maxItems: 1
vdd1-supply: vdd1-supply:
description: Digital voltage rail description: Digital voltage rail
...@@ -30,7 +33,6 @@ properties: ...@@ -30,7 +33,6 @@ properties:
vsp-supply: vsp-supply:
description: Negative source voltage rail description: Negative source voltage rail
reg: true
port: true port: true
required: required:
......
...@@ -26,7 +26,8 @@ properties: ...@@ -26,7 +26,8 @@ properties:
- powkiddy,x55-panel - powkiddy,x55-panel
- const: himax,hx8394 - const: himax,hx8394
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
......
...@@ -24,6 +24,9 @@ properties: ...@@ -24,6 +24,9 @@ properties:
- newhaven,1.8-128160EF - newhaven,1.8-128160EF
- const: ilitek,ili9163 - const: ilitek,ili9163
reg:
maxItems: 1
spi-max-frequency: spi-max-frequency:
maximum: 32000000 maximum: 32000000
...@@ -32,7 +35,6 @@ properties: ...@@ -32,7 +35,6 @@ properties:
description: Display data/command selection (D/CX) description: Display data/command selection (D/CX)
backlight: true backlight: true
reg: true
reset-gpios: true reset-gpios: true
rotation: true rotation: true
......
...@@ -26,6 +26,9 @@ properties: ...@@ -26,6 +26,9 @@ properties:
- dlink,dir-685-panel - dlink,dir-685-panel
- const: ilitek,ili9322 - const: ilitek,ili9322
reg:
maxItems: 1
reset-gpios: true reset-gpios: true
port: true port: true
......
...@@ -28,7 +28,8 @@ properties: ...@@ -28,7 +28,8 @@ properties:
- canaan,kd233-tft - canaan,kd233-tft
- const: ilitek,ili9341 - const: ilitek,ili9341
reg: true reg:
maxItems: 1
dc-gpios: dc-gpios:
maxItems: 1 maxItems: 1
......
...@@ -20,9 +20,11 @@ properties: ...@@ -20,9 +20,11 @@ properties:
- tianma,tm041xdhg01 - tianma,tm041xdhg01
- const: ilitek,ili9805 - const: ilitek,ili9805
reg:
maxItems: 1
avdd-supply: true avdd-supply: true
dvdd-supply: true dvdd-supply: true
reg: true
required: required:
- compatible - compatible
......
...@@ -24,9 +24,11 @@ properties: ...@@ -24,9 +24,11 @@ properties:
- wanchanglong,w552946aba - wanchanglong,w552946aba
- const: ilitek,ili9881c - const: ilitek,ili9881c
reg:
maxItems: 1
backlight: true backlight: true
power-supply: true power-supply: true
reg: true
reset-gpios: true reset-gpios: true
rotation: true rotation: true
......
...@@ -17,10 +17,12 @@ properties: ...@@ -17,10 +17,12 @@ properties:
compatible: compatible:
const: innolux,ej030na const: innolux,ej030na
reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
power-supply: true power-supply: true
reg: true
reset-gpios: true reset-gpios: true
required: required:
......
...@@ -16,9 +16,11 @@ properties: ...@@ -16,9 +16,11 @@ properties:
compatible: compatible:
const: innolux,p097pfg const: innolux,p097pfg
reg:
maxItems: 1
backlight: true backlight: true
enable-gpios: true enable-gpios: true
reg: true
avdd-supply: avdd-supply:
description: The regulator that provides positive voltage description: The regulator that provides positive voltage
......
...@@ -21,7 +21,8 @@ properties: ...@@ -21,7 +21,8 @@ properties:
- radxa,display-8hd-ad002 - radxa,display-8hd-ad002
- const: jadard,jd9365da-h3 - const: jadard,jd9365da-h3
reg: true reg:
maxItems: 1
vdd-supply: vdd-supply:
description: supply regulator for VDD, usually 3.3V description: supply regulator for VDD, usually 3.3V
......
...@@ -26,7 +26,9 @@ properties: ...@@ -26,7 +26,9 @@ properties:
compatible: compatible:
const: jdi,lpm102a188a const: jdi,lpm102a188a
reg: true reg:
maxItems: 1
enable-gpios: true enable-gpios: true
reset-gpios: true reset-gpios: true
power-supply: true power-supply: true
......
...@@ -16,8 +16,10 @@ properties: ...@@ -16,8 +16,10 @@ properties:
compatible: compatible:
const: jdi,lt070me05000 const: jdi,lt070me05000
reg:
maxItems: 1
enable-gpios: true enable-gpios: true
reg: true
reset-gpios: true reset-gpios: true
vddp-supply: vddp-supply:
......
...@@ -17,10 +17,12 @@ properties: ...@@ -17,10 +17,12 @@ properties:
compatible: compatible:
const: kingdisplay,kd035g6-54nt const: kingdisplay,kd035g6-54nt
reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
power-supply: true power-supply: true
reg: true
reset-gpios: true reset-gpios: true
spi-3wire: true spi-3wire: true
......
...@@ -18,6 +18,9 @@ properties: ...@@ -18,6 +18,9 @@ properties:
compatible: compatible:
const: leadtek,ltk035c5444t const: leadtek,ltk035c5444t
reg:
maxItems: 1
spi-3wire: true spi-3wire: true
required: required:
......
...@@ -18,7 +18,10 @@ properties: ...@@ -18,7 +18,10 @@ properties:
- leadtek,ltk050h3146w - leadtek,ltk050h3146w
- leadtek,ltk050h3146w-a2 - leadtek,ltk050h3146w-a2
- leadtek,ltk050h3148w - leadtek,ltk050h3148w
reg: true
reg:
maxItems: 1
backlight: true backlight: true
reset-gpios: true reset-gpios: true
iovcc-supply: iovcc-supply:
......
...@@ -17,7 +17,10 @@ properties: ...@@ -17,7 +17,10 @@ properties:
enum: enum:
- leadtek,ltk101b4029w - leadtek,ltk101b4029w
- leadtek,ltk500hd1829 - leadtek,ltk500hd1829
reg: true
reg:
maxItems: 1
backlight: true backlight: true
reset-gpios: true reset-gpios: true
iovcc-supply: iovcc-supply:
......
...@@ -21,7 +21,8 @@ properties: ...@@ -21,7 +21,8 @@ properties:
compatible: compatible:
const: lg,lg4573 const: lg,lg4573
reg: true reg:
maxItems: 1
required: required:
- compatible - compatible
......
...@@ -17,6 +17,9 @@ properties: ...@@ -17,6 +17,9 @@ properties:
compatible: compatible:
const: lgphilips,lb035q02 const: lgphilips,lb035q02
reg:
maxItems: 1
label: true label: true
enable-gpios: true enable-gpios: true
port: true port: true
......
...@@ -21,9 +21,11 @@ properties: ...@@ -21,9 +21,11 @@ properties:
compatible: compatible:
const: nec,nl8048hl11 const: nec,nl8048hl11
reg:
maxItems: 1
label: true label: true
port: true port: true
reg: true
reset-gpios: true reset-gpios: true
spi-max-frequency: spi-max-frequency:
......
...@@ -24,7 +24,9 @@ properties: ...@@ -24,7 +24,9 @@ properties:
- powkiddy,rk2023-panel - powkiddy,rk2023-panel
- const: newvision,nv3051d - const: newvision,nv3051d
reg: true reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
reset-gpios: reset-gpios:
......
...@@ -24,7 +24,10 @@ properties: ...@@ -24,7 +24,10 @@ properties:
string determines how the NT35510 panel driver shall be configured string determines how the NT35510 panel driver shall be configured
to work with the indicated panel. The novatek,nt35510 compatible shall to work with the indicated panel. The novatek,nt35510 compatible shall
always be provided as a fallback. always be provided as a fallback.
reg: true
reg:
maxItems: 1
reset-gpios: true reset-gpios: true
vdd-supply: vdd-supply:
description: regulator that supplies the vdd voltage description: regulator that supplies the vdd voltage
......
...@@ -33,6 +33,9 @@ properties: ...@@ -33,6 +33,9 @@ properties:
to work with the indicated panel. The novatek,nt35950 compatible shall to work with the indicated panel. The novatek,nt35950 compatible shall
always be provided as a fallback. always be provided as a fallback.
reg:
maxItems: 1
reset-gpios: reset-gpios:
maxItems: 1 maxItems: 1
description: phandle of gpio for reset line - This should be 8mA, gpio description: phandle of gpio for reset line - This should be 8mA, gpio
...@@ -49,7 +52,6 @@ properties: ...@@ -49,7 +52,6 @@ properties:
backlight: true backlight: true
ports: true ports: true
reg: true
required: required:
- compatible - compatible
......
...@@ -27,6 +27,9 @@ properties: ...@@ -27,6 +27,9 @@ properties:
- lenovo,j606f-boe-nt36523w - lenovo,j606f-boe-nt36523w
- const: novatek,nt36523w - const: novatek,nt36523w
reg:
maxItems: 1
reset-gpios: reset-gpios:
maxItems: 1 maxItems: 1
description: phandle of gpio for reset line - This should be 8mA description: phandle of gpio for reset line - This should be 8mA
...@@ -34,7 +37,6 @@ properties: ...@@ -34,7 +37,6 @@ properties:
vddio-supply: vddio-supply:
description: regulator that supplies the I/O voltage description: regulator that supplies the I/O voltage
reg: true
rotation: true rotation: true
backlight: true backlight: true
......
...@@ -29,6 +29,9 @@ properties: ...@@ -29,6 +29,9 @@ properties:
determines how the NT36672A panel driver is configured for the indicated determines how the NT36672A panel driver is configured for the indicated
panel. The novatek,nt36672a compatible shall always be provided as a fallback. panel. The novatek,nt36672a compatible shall always be provided as a fallback.
reg:
maxItems: 1
reset-gpios: reset-gpios:
maxItems: 1 maxItems: 1
description: phandle of gpio for reset line - This should be 8mA, gpio description: phandle of gpio for reset line - This should be 8mA, gpio
...@@ -44,7 +47,6 @@ properties: ...@@ -44,7 +47,6 @@ properties:
vddneg-supply: vddneg-supply:
description: phandle of the negative boost supply regulator description: phandle of the negative boost supply regulator
reg: true
port: true port: true
backlight: true backlight: true
......
...@@ -38,10 +38,12 @@ properties: ...@@ -38,10 +38,12 @@ properties:
compatible: compatible:
const: olimex,lcd-olinuxino const: olimex,lcd-olinuxino
reg:
maxItems: 1
backlight: true backlight: true
enable-gpios: true enable-gpios: true
power-supply: true power-supply: true
reg: true
required: required:
- compatible - compatible
......
...@@ -71,6 +71,9 @@ properties: ...@@ -71,6 +71,9 @@ properties:
- shineworld,lh133k - shineworld,lh133k
- const: panel-mipi-dbi-spi - const: panel-mipi-dbi-spi
reg:
maxItems: 1
write-only: write-only:
type: boolean type: boolean
description: description:
......
...@@ -16,7 +16,9 @@ properties: ...@@ -16,7 +16,9 @@ properties:
compatible: compatible:
const: raydium,rm67191 const: raydium,rm67191
reg: true reg:
maxItems: 1
port: true port: true
reset-gpios: true reset-gpios: true
width-mm: true width-mm: true
......
...@@ -22,6 +22,9 @@ properties: ...@@ -22,6 +22,9 @@ properties:
- const: fairphone,fp5-rm692e5-boe - const: fairphone,fp5-rm692e5-boe
- const: raydium,rm692e5 - const: raydium,rm692e5
reg:
maxItems: 1
dvdd-supply: dvdd-supply:
description: Digital voltage rail description: Digital voltage rail
...@@ -31,7 +34,6 @@ properties: ...@@ -31,7 +34,6 @@ properties:
vddio-supply: vddio-supply:
description: I/O voltage rail description: I/O voltage rail
reg: true
port: true port: true
required: required:
......
...@@ -14,7 +14,7 @@ properties: ...@@ -14,7 +14,7 @@ properties:
const: ronbo,rb070d30 const: ronbo,rb070d30
reg: reg:
description: MIPI-DSI virtual channel maxItems: 1
power-gpios: power-gpios:
description: GPIO used for the power pin description: GPIO used for the power pin
......
...@@ -33,7 +33,9 @@ properties: ...@@ -33,7 +33,9 @@ properties:
# Samsung S6E3HF2 5.65" 1600x2560 AMOLED panel # Samsung S6E3HF2 5.65" 1600x2560 AMOLED panel
- samsung,s6e3hf2 - samsung,s6e3hf2
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
enable-gpios: true enable-gpios: true
te-gpios: true te-gpios: true
......
...@@ -11,12 +11,15 @@ maintainers: ...@@ -11,12 +11,15 @@ maintainers:
allOf: allOf:
- $ref: panel-common.yaml# - $ref: panel-common.yaml#
- $ref: /schemas/spi/spi-peripheral-props.yaml#
properties: properties:
compatible: compatible:
const: samsung,ams495qa01 const: samsung,ams495qa01
reg: true reg:
maxItems: 1
reset-gpios: reset-gpios:
description: reset gpio, must be GPIO_ACTIVE_LOW description: reset gpio, must be GPIO_ACTIVE_LOW
elvdd-supply: elvdd-supply:
......
...@@ -17,9 +17,11 @@ properties: ...@@ -17,9 +17,11 @@ properties:
compatible: compatible:
const: samsung,ld9040 const: samsung,ld9040
reg:
maxItems: 1
display-timings: true display-timings: true
port: true port: true
reg: true
reset-gpios: true reset-gpios: true
vdd3-supply: vdd3-supply:
......
...@@ -21,7 +21,8 @@ properties: ...@@ -21,7 +21,8 @@ properties:
compatible: compatible:
const: samsung,lms380kf01 const: samsung,lms380kf01
reg: true reg:
maxItems: 1
interrupts: interrupts:
description: provides an optional ESD (electrostatic discharge) description: provides an optional ESD (electrostatic discharge)
......
...@@ -20,7 +20,8 @@ properties: ...@@ -20,7 +20,8 @@ properties:
compatible: compatible:
const: samsung,lms397kf04 const: samsung,lms397kf04
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
......
...@@ -16,8 +16,10 @@ properties: ...@@ -16,8 +16,10 @@ properties:
compatible: compatible:
const: samsung,s6d16d0 const: samsung,s6d16d0
reg:
maxItems: 1
port: true port: true
reg: true
reset-gpios: true reset-gpios: true
vdd1-supply: vdd1-supply:
......
...@@ -20,7 +20,8 @@ properties: ...@@ -20,7 +20,8 @@ properties:
compatible: compatible:
const: samsung,s6d27a1 const: samsung,s6d27a1
reg: true reg:
maxItems: 1
interrupts: interrupts:
description: provides an optional ESD (electrostatic discharge) description: provides an optional ESD (electrostatic discharge)
......
...@@ -24,7 +24,8 @@ properties: ...@@ -24,7 +24,8 @@ properties:
- samsung,ltl101at01 - samsung,ltl101at01
- const: samsung,s6d7aa0 - const: samsung,s6d7aa0
reg: true reg:
maxItems: 1
backlight: backlight:
description: description:
......
...@@ -18,7 +18,9 @@ properties: ...@@ -18,7 +18,9 @@ properties:
compatible: compatible:
const: samsung,s6e63m0 const: samsung,s6e63m0
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
port: true port: true
default-brightness: true default-brightness: true
......
...@@ -15,7 +15,10 @@ allOf: ...@@ -15,7 +15,10 @@ allOf:
properties: properties:
compatible: compatible:
const: samsung,s6e88a0-ams452ef01 const: samsung,s6e88a0-ams452ef01
reg: true
reg:
maxItems: 1
port: true port: true
reset-gpios: true reset-gpios: true
vdd3-supply: vdd3-supply:
......
...@@ -16,7 +16,9 @@ properties: ...@@ -16,7 +16,9 @@ properties:
compatible: compatible:
const: samsung,s6e8aa0 const: samsung,s6e8aa0
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
display-timings: true display-timings: true
......
...@@ -37,7 +37,9 @@ properties: ...@@ -37,7 +37,9 @@ properties:
- enum: - enum:
- sharp,lq101r1sx01 - sharp,lq101r1sx01
reg: true reg:
maxItems: 1
power-supply: true power-supply: true
backlight: true backlight: true
......
...@@ -16,7 +16,9 @@ properties: ...@@ -16,7 +16,9 @@ properties:
compatible: compatible:
const: sharp,ls043t1le01-qhd const: sharp,ls043t1le01-qhd
reg: true reg:
maxItems: 1
backlight: true backlight: true
reset-gpios: true reset-gpios: true
port: true port: true
......
...@@ -16,7 +16,9 @@ properties: ...@@ -16,7 +16,9 @@ properties:
compatible: compatible:
const: sharp,ls060t1sx01 const: sharp,ls060t1sx01
reg: true reg:
maxItems: 1
backlight: true backlight: true
reset-gpios: true reset-gpios: true
port: true port: true
......
...@@ -21,7 +21,9 @@ properties: ...@@ -21,7 +21,9 @@ properties:
- jasonic,jt240mhqs-hwt-ek-e3 - jasonic,jt240mhqs-hwt-ek-e3
- sitronix,st7789v - sitronix,st7789v
reg: true reg:
maxItems: 1
reset-gpios: true reset-gpios: true
power-supply: true power-supply: true
backlight: true backlight: true
......
...@@ -22,7 +22,10 @@ properties: ...@@ -22,7 +22,10 @@ properties:
enum: enum:
- sony,acx424akp - sony,acx424akp
- sony,acx424akm - sony,acx424akm
reg: true
reg:
maxItems: 1
reset-gpios: true reset-gpios: true
vddi-supply: vddi-supply:
description: regulator that supplies the vddi voltage description: regulator that supplies the vddi voltage
......
...@@ -17,6 +17,9 @@ properties: ...@@ -17,6 +17,9 @@ properties:
compatible: compatible:
const: sony,acx565akm const: sony,acx565akm
reg:
maxItems: 1
label: true label: true
reset-gpios: true reset-gpios: true
port: true port: true
......
...@@ -20,7 +20,8 @@ properties: ...@@ -20,7 +20,8 @@ properties:
compatible: compatible:
const: sony,td4353-jdi-tama const: sony,td4353-jdi-tama
reg: true reg:
maxItems: 1
backlight: true backlight: true
width-mm: true width-mm: true
......
...@@ -21,7 +21,8 @@ properties: ...@@ -21,7 +21,8 @@ properties:
compatible: compatible:
const: sony,tulip-truly-nt35521 const: sony,tulip-truly-nt35521
reg: true reg:
maxItems: 1
positive5-supply: positive5-supply:
description: Positive 5V supply description: Positive 5V supply
......
...@@ -19,15 +19,17 @@ properties: ...@@ -19,15 +19,17 @@ properties:
- sharp,ls068b3sx02 - sharp,ls068b3sx02
- const: syna,r63353 - const: syna,r63353
reg:
maxItems: 1
avdd-supply: true avdd-supply: true
dvdd-supply: true dvdd-supply: true
reg: true
required: required:
- compatible - compatible
- reg
- avdd-supply - avdd-supply
- dvdd-supply - dvdd-supply
- reg
- reset-gpios - reset-gpios
- port - port
- backlight - backlight
......
...@@ -22,7 +22,9 @@ properties: ...@@ -22,7 +22,9 @@ properties:
# Toppoly TD043MTEA1 Panel # Toppoly TD043MTEA1 Panel
- tpo,td043mtea1 - tpo,td043mtea1
reg: true reg:
maxItems: 1
label: true label: true
reset-gpios: true reset-gpios: true
backlight: true backlight: true
......
...@@ -52,7 +52,8 @@ properties: ...@@ -52,7 +52,8 @@ properties:
- const: tpo,tpg110 - const: tpo,tpg110
- const: tpo,tpg110 - const: tpo,tpg110
reg: true reg:
maxItems: 1
grestb-gpios: grestb-gpios:
maxItems: 1 maxItems: 1
......
...@@ -20,7 +20,8 @@ properties: ...@@ -20,7 +20,8 @@ properties:
compatible: compatible:
const: visionox,rm69299-1080p-display const: visionox,rm69299-1080p-display
reg: true reg:
maxItems: 1
vdda-supply: vdda-supply:
description: | description: |
......
...@@ -15,7 +15,10 @@ allOf: ...@@ -15,7 +15,10 @@ allOf:
properties: properties:
compatible: compatible:
const: xinpeng,xpp055c272 const: xinpeng,xpp055c272
reg: true
reg:
maxItems: 1
backlight: true backlight: true
port: true port: true
reset-gpios: true reset-gpios: true
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/samsung/samsung,exynos5-dp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung Exynos5250/Exynos5420 SoC Display Port
maintainers:
- Inki Dae <inki.dae@samsung.com>
- Seung-Woo Kim <sw0312.kim@samsung.com>
- Kyungmin Park <kyungmin.park@samsung.com>
- Krzysztof Kozlowski <krzk@kernel.org>
properties:
compatible:
const: samsung,exynos5-dp
reg:
maxItems: 1
clocks:
maxItems: 1
clock-names:
items:
- const: dp
display-timings:
$ref: /schemas/display/panel/display-timings.yaml#
interrupts:
maxItems: 1
hpd-gpios:
description:
Hotplug detect GPIO.
Indicates which GPIO should be used for hotplug detection
phys:
maxItems: 1
phy-names:
items:
- const: dp
power-domains:
maxItems: 1
interlaced:
type: boolean
deprecated: true
description:
Interlace scan mode. Progressive if defined, interlaced if not defined.
vsync-active-high:
type: boolean
deprecated: true
description:
VSYNC polarity configuration. High if defined, low if not defined
hsync-active-high:
type: boolean
deprecated: true
description:
HSYNC polarity configuration. High if defined, low if not defined
ports:
$ref: /schemas/graph.yaml#/properties/ports
properties:
port:
$ref: /schemas/graph.yaml#/properties/port
description:
Port node with one endpoint connected to a dp-connector node.
required:
- port
samsung,hpd-gpios:
maxItems: 1
deprecated: true
samsung,ycbcr-coeff:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can parsed from drm_display_mode.
samsung,dynamic-range:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can parsed from drm_display_mode.
samsung,color-space:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can parsed from drm_display_info.
samsung,color-depth:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can parsed from drm_display_info.
samsung,link-rate:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can reading from monitor by dpcd method.
samsung,lane-count:
$ref: /schemas/types.yaml#/definitions/uint32
deprecated: true
description:
Deprecated prop that can reading from monitor by dpcd method.
required:
- compatible
- reg
- clocks
- clock-names
- interrupts
- phys
- phy-names
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/exynos5250.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
dp-controller@145b0000 {
compatible = "samsung,exynos5-dp";
reg = <0x145b0000 0x1000>;
clocks = <&clock CLK_DP>;
clock-names = "dp";
interrupts = <10 3>;
interrupt-parent = <&combiner>;
phys = <&dp_phy>;
phy-names = "dp";
pinctrl-0 = <&dp_hpd>;
pinctrl-names = "default";
power-domains = <&pd_disp1>;
samsung,color-space = <0>;
samsung,color-depth = <1>;
samsung,link-rate = <0x0a>;
samsung,lane-count = <2>;
hpd-gpios = <&gpx0 7 GPIO_ACTIVE_HIGH>;
ports {
port {
dp_out: endpoint {
remote-endpoint = <&bridge_in>;
};
};
};
};
...@@ -784,7 +784,7 @@ patternProperties: ...@@ -784,7 +784,7 @@ patternProperties:
gpio-2: GPIO4 gpio-2: GPIO4
allOf: allOf:
- $ref: ../pinctrl/pincfg-node.yaml# - $ref: /schemas/pinctrl/pincfg-node.yaml#
properties: properties:
drive-open-drain: true drive-open-drain: true
......
...@@ -25,12 +25,12 @@ properties: ...@@ -25,12 +25,12 @@ properties:
- const: allwinner,sun6i-a31-sc-nmi - const: allwinner,sun6i-a31-sc-nmi
deprecated: true deprecated: true
- const: allwinner,sun7i-a20-sc-nmi - const: allwinner,sun7i-a20-sc-nmi
- items:
- const: allwinner,sun8i-v3s-nmi
- const: allwinner,sun9i-a80-nmi
- const: allwinner,sun9i-a80-nmi - const: allwinner,sun9i-a80-nmi
- items: - items:
- const: allwinner,sun50i-a100-nmi - enum:
- allwinner,sun8i-v3s-nmi
- allwinner,sun50i-a100-nmi
- allwinner,sun50i-h616-nmi
- const: allwinner,sun9i-a80-nmi - const: allwinner,sun9i-a80-nmi
reg: reg:
......
...@@ -48,7 +48,7 @@ properties: ...@@ -48,7 +48,7 @@ properties:
interrupt-controller: true interrupt-controller: true
"#interrupt-cells": "#interrupt-cells":
$ref: "arm,gic.yaml#/properties/#interrupt-cells" $ref: arm,gic.yaml#/properties/#interrupt-cells
required: required:
- reg - reg
......
...@@ -39,6 +39,7 @@ properties: ...@@ -39,6 +39,7 @@ properties:
- renesas,intc-ex-r8a779a0 # R-Car V3U - renesas,intc-ex-r8a779a0 # R-Car V3U
- renesas,intc-ex-r8a779f0 # R-Car S4-8 - renesas,intc-ex-r8a779f0 # R-Car S4-8
- renesas,intc-ex-r8a779g0 # R-Car V4H - renesas,intc-ex-r8a779g0 # R-Car V4H
- renesas,intc-ex-r8a779h0 # R-Car V4M
- const: renesas,irqc - const: renesas,irqc
'#interrupt-cells': '#interrupt-cells':
......
...@@ -44,7 +44,7 @@ patternProperties: ...@@ -44,7 +44,7 @@ patternProperties:
description: description:
Each vpu encoder or decoder correspond a MU, which used for communication Each vpu encoder or decoder correspond a MU, which used for communication
between driver and firmware. Implement via mailbox on driver. between driver and firmware. Implement via mailbox on driver.
$ref: ../mailbox/fsl,mu.yaml# $ref: /schemas/mailbox/fsl,mu.yaml#
"^vpu-core@[0-9a-f]+$": "^vpu-core@[0-9a-f]+$":
......
...@@ -48,8 +48,8 @@ patternProperties: ...@@ -48,8 +48,8 @@ patternProperties:
type: object type: object
allOf: allOf:
- $ref: ../nvmem/nvmem.yaml# - $ref: /schemas/nvmem/nvmem.yaml#
- $ref: ../nvmem/nvmem-deprecated-cells.yaml# - $ref: /schemas/nvmem/nvmem-deprecated-cells.yaml#
unevaluatedProperties: false unevaluatedProperties: false
......
...@@ -29,39 +29,39 @@ properties: ...@@ -29,39 +29,39 @@ properties:
allowable by a module in the slot, in milli-Watts. Presently, modules can allowable by a module in the slot, in milli-Watts. Presently, modules can
be up to 1W, 1.5W or 2W. be up to 1W, 1.5W or 2W.
"mod-def0-gpios": mod-def0-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) module GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) module
presence input gpio signal, active (module absent) high. Must not be presence input gpio signal, active (module absent) high. Must not be
present for SFF modules present for SFF modules
"los-gpios": los-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the Receiver Loss of Signal Indication GPIO phandle and a specifier of the Receiver Loss of Signal Indication
input gpio signal, active (signal lost) high input gpio signal, active (signal lost) high
"tx-fault-gpios": tx-fault-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the Module Transmitter Fault input gpio GPIO phandle and a specifier of the Module Transmitter Fault input gpio
signal, active (fault condition) high signal, active (fault condition) high
"tx-disable-gpios": tx-disable-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the Transmitter Disable output gpio GPIO phandle and a specifier of the Transmitter Disable output gpio
signal, active (Tx disable) high signal, active (Tx disable) high
"rate-select0-gpios": rate-select0-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the Rx Signaling Rate Select (AKA RS0) GPIO phandle and a specifier of the Rx Signaling Rate Select (AKA RS0)
output gpio signal, low - low Rx rate, high - high Rx rate Must not be output gpio signal, low - low Rx rate, high - high Rx rate Must not be
present for SFF modules present for SFF modules
"rate-select1-gpios": rate-select1-gpios:
maxItems: 1 maxItems: 1
description: description:
GPIO phandle and a specifier of the Tx Signaling Rate Select (AKA RS1) GPIO phandle and a specifier of the Tx Signaling Rate Select (AKA RS1)
......
...@@ -65,7 +65,8 @@ properties: ...@@ -65,7 +65,8 @@ properties:
- const: msi - const: msi
ranges: ranges:
maxItems: 1 minItems: 1
maxItems: 3
dma-ranges: dma-ranges:
minItems: 1 minItems: 1
......
...@@ -71,28 +71,6 @@ properties: ...@@ -71,28 +71,6 @@ properties:
items: items:
- const: pci - const: pci
oneOf:
- properties:
interrupts:
maxItems: 1
interrupt-names:
items:
- const: msi
- properties:
interrupts:
minItems: 8
interrupt-names:
items:
- const: msi0
- const: msi1
- const: msi2
- const: msi3
- const: msi4
- const: msi5
- const: msi6
- const: msi7
allOf: allOf:
- $ref: qcom,pcie-common.yaml# - $ref: qcom,pcie-common.yaml#
......
...@@ -48,13 +48,16 @@ properties: ...@@ -48,13 +48,16 @@ properties:
interrupt-controller: interrupt-controller:
description: Interrupt controller node for handling legacy PCI interrupts. description: Interrupt controller node for handling legacy PCI interrupts.
type: object type: object
additionalProperties: false
properties: properties:
"#address-cells": "#address-cells":
const: 0 const: 0
"#interrupt-cells": "#interrupt-cells":
const: 1 const: 1
"interrupt-controller": true
additionalProperties: false interrupt-controller: true
required: required:
- reg - reg
......
...@@ -84,7 +84,7 @@ properties: ...@@ -84,7 +84,7 @@ properties:
"#interrupt-cells": "#interrupt-cells":
const: 1 const: 1
"interrupt-controller": true interrupt-controller: true
required: required:
- "#address-cells" - "#address-cells"
......
...@@ -59,14 +59,14 @@ patternProperties: ...@@ -59,14 +59,14 @@ patternProperties:
"#phy-cells": "#phy-cells":
const: 0 const: 0
"brcm,enable-ssc": brcm,enable-ssc:
$ref: /schemas/types.yaml#/definitions/flag $ref: /schemas/types.yaml#/definitions/flag
description: | description: |
Use spread spectrum clocking (SSC) on this port Use spread spectrum clocking (SSC) on this port
This property is not applicable for "brcm,iproc-ns2-sata-phy", This property is not applicable for "brcm,iproc-ns2-sata-phy",
"brcm,iproc-nsp-sata-phy" and "brcm,iproc-sr-sata-phy". "brcm,iproc-nsp-sata-phy" and "brcm,iproc-sr-sata-phy".
"brcm,rxaeq-mode": brcm,rxaeq-mode:
$ref: /schemas/types.yaml#/definitions/string $ref: /schemas/types.yaml#/definitions/string
description: description:
String that indicates the desired RX equalizer mode. String that indicates the desired RX equalizer mode.
...@@ -75,7 +75,7 @@ patternProperties: ...@@ -75,7 +75,7 @@ patternProperties:
- auto - auto
- manual - manual
"brcm,rxaeq-value": brcm,rxaeq-value:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
description: | description: |
When 'brcm,rxaeq-mode' is set to "manual", provides the RX When 'brcm,rxaeq-mode' is set to "manual", provides the RX
...@@ -83,7 +83,7 @@ patternProperties: ...@@ -83,7 +83,7 @@ patternProperties:
minimum: 0 minimum: 0
maximum: 63 maximum: 63
"brcm,tx-amplitude-millivolt": brcm,tx-amplitude-millivolt:
description: | description: |
Transmit amplitude voltage in millivolt. Transmit amplitude voltage in millivolt.
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
......
...@@ -24,7 +24,7 @@ properties: ...@@ -24,7 +24,7 @@ properties:
type: object type: object
properties: properties:
"SW": SW:
type: object type: object
$ref: regulator.yaml# $ref: regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
......
...@@ -23,7 +23,9 @@ properties: ...@@ -23,7 +23,9 @@ properties:
oneOf: oneOf:
- const: fsl,s32v234-linflexuart - const: fsl,s32v234-linflexuart
- items: - items:
- const: nxp,s32g2-linflexuart - enum:
- nxp,s32g2-linflexuart
- nxp,s32g3-linflexuart
- const: fsl,s32v234-linflexuart - const: fsl,s32v234-linflexuart
reg: reg:
......
...@@ -365,9 +365,9 @@ allOf: ...@@ -365,9 +365,9 @@ allOf:
additionalProperties: false additionalProperties: false
dependencies: dependencies:
"nvidia,suspend-mode": ["nvidia,core-pwr-off-time", "nvidia,cpu-pwr-off-time"] nvidia,suspend-mode: ["nvidia,core-pwr-off-time", "nvidia,cpu-pwr-off-time"]
"nvidia,core-pwr-off-time": ["nvidia,core-pwr-good-time"] nvidia,core-pwr-off-time: ["nvidia,core-pwr-good-time"]
"nvidia,cpu-pwr-off-time": ["nvidia,cpu-pwr-good-time"] nvidia,cpu-pwr-off-time: ["nvidia,cpu-pwr-good-time"]
examples: examples:
- | - |
......
...@@ -103,6 +103,7 @@ properties: ...@@ -103,6 +103,7 @@ properties:
- renesas,r8a779a0-cmt0 # 32-bit CMT0 on R-Car V3U - renesas,r8a779a0-cmt0 # 32-bit CMT0 on R-Car V3U
- renesas,r8a779f0-cmt0 # 32-bit CMT0 on R-Car S4-8 - renesas,r8a779f0-cmt0 # 32-bit CMT0 on R-Car S4-8
- renesas,r8a779g0-cmt0 # 32-bit CMT0 on R-Car V4H - renesas,r8a779g0-cmt0 # 32-bit CMT0 on R-Car V4H
- renesas,r8a779h0-cmt0 # 32-bit CMT0 on R-Car V4M
- const: renesas,rcar-gen4-cmt0 # 32-bit CMT0 on R-Car Gen4 - const: renesas,rcar-gen4-cmt0 # 32-bit CMT0 on R-Car Gen4
- items: - items:
...@@ -110,6 +111,7 @@ properties: ...@@ -110,6 +111,7 @@ properties:
- renesas,r8a779a0-cmt1 # 48-bit CMT on R-Car V3U - renesas,r8a779a0-cmt1 # 48-bit CMT on R-Car V3U
- renesas,r8a779f0-cmt1 # 48-bit CMT on R-Car S4-8 - renesas,r8a779f0-cmt1 # 48-bit CMT on R-Car S4-8
- renesas,r8a779g0-cmt1 # 48-bit CMT on R-Car V4H - renesas,r8a779g0-cmt1 # 48-bit CMT on R-Car V4H
- renesas,r8a779h0-cmt1 # 48-bit CMT on R-Car V4M
- const: renesas,rcar-gen4-cmt1 # 48-bit CMT on R-Car Gen4 - const: renesas,rcar-gen4-cmt1 # 48-bit CMT on R-Car Gen4
reg: reg:
......
...@@ -39,6 +39,7 @@ properties: ...@@ -39,6 +39,7 @@ properties:
- renesas,tmu-r8a779a0 # R-Car V3U - renesas,tmu-r8a779a0 # R-Car V3U
- renesas,tmu-r8a779f0 # R-Car S4-8 - renesas,tmu-r8a779f0 # R-Car S4-8
- renesas,tmu-r8a779g0 # R-Car V4H - renesas,tmu-r8a779g0 # R-Car V4H
- renesas,tmu-r8a779h0 # R-Car V4M
- const: renesas,tmu - const: renesas,tmu
reg: reg:
......
...@@ -33,13 +33,13 @@ properties: ...@@ -33,13 +33,13 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
'ibm,#dma-address-cells': ibm,#dma-address-cells:
description: description:
number of cells that are used to encode the physical address field of number of cells that are used to encode the physical address field of
dma-window properties dma-window properties
$ref: /schemas/types.yaml#/definitions/uint32-array $ref: /schemas/types.yaml#/definitions/uint32-array
'ibm,#dma-size-cells': ibm,#dma-size-cells:
description: description:
number of cells that are used to encode the size field of number of cells that are used to encode the size field of
dma-window properties dma-window properties
......
...@@ -29,6 +29,7 @@ properties: ...@@ -29,6 +29,7 @@ properties:
- mediatek,mt7623-xhci - mediatek,mt7623-xhci
- mediatek,mt7629-xhci - mediatek,mt7629-xhci
- mediatek,mt7986-xhci - mediatek,mt7986-xhci
- mediatek,mt7988-xhci
- mediatek,mt8173-xhci - mediatek,mt8173-xhci
- mediatek,mt8183-xhci - mediatek,mt8183-xhci
- mediatek,mt8186-xhci - mediatek,mt8186-xhci
......
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/watchdog/aspeed,ast2400-wdt.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Aspeed watchdog timer controllers
maintainers:
- Andrew Jeffery <andrew@codeconstruct.com.au>
properties:
compatible:
enum:
- aspeed,ast2400-wdt
- aspeed,ast2500-wdt
- aspeed,ast2600-wdt
reg:
maxItems: 1
clocks:
maxItems: 1
description: >
The clock used to drive the watchdog counter. From the AST2500 no source
other than the 1MHz clock can be selected, so the clocks property is
optional.
aspeed,reset-type:
$ref: /schemas/types.yaml#/definitions/string
enum:
- cpu
- soc
- system
- none
default: system
description: >
The watchdog can be programmed to generate one of three different types of
reset when a timeout occcurs.
Specifying 'cpu' will only reset the processor on a timeout event.
Specifying 'soc' will reset a configurable subset of the SoC's controllers
on a timeout event. Controllers critical to the SoC's operation may remain
untouched. The set of SoC controllers to reset may be specified via the
aspeed,reset-mask property if the node has the aspeed,ast2500-wdt or
aspeed,ast2600-wdt compatible.
Specifying 'system' will reset all controllers on a timeout event, as if
EXTRST had been asserted.
Specifying 'none' will cause the timeout event to have no reset effect.
Another watchdog engine on the chip must be used for chip reset operations.
aspeed,alt-boot:
$ref: /schemas/types.yaml#/definitions/flag
description: >
Direct the watchdog to configure the SoC to boot from the alternative boot
region if a timeout occurs.
aspeed,external-signal:
$ref: /schemas/types.yaml#/definitions/flag
description: >
Assert the timeout event on an external signal pin associated with the
watchdog controller instance. The pin must be muxed appropriately.
aspeed,ext-pulse-duration:
$ref: /schemas/types.yaml#/definitions/uint32
description: >
The duration, in microseconds, of the pulse emitted on the external signal
pin.
aspeed,ext-push-pull:
$ref: /schemas/types.yaml#/definitions/flag
description: >
If aspeed,external-signal is specified in the node, set the external
signal pin's drive type to push-pull. If aspeed,ext-push-pull is not
specified then the pin is configured as open-drain.
aspeed,ext-active-high:
$ref: /schemas/types.yaml#/definitions/flag
description: >
If both aspeed,external-signal and aspeed,ext-push-pull are specified in
the node, set the pulse polarity to active-high. If aspeed,ext-active-high
is not specified then the pin is configured as active-low.
aspeed,reset-mask:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 2
description: >
A bitmask indicating which peripherals will be reset if the watchdog
timer expires. On AST2500 SoCs this should be a single word defined using
the AST2500_WDT_RESET_* macros; on AST2600 SoCs this should be a two-word
array with the first word defined using the AST2600_WDT_RESET1_* macros,
and the second word defined using the AST2600_WDT_RESET2_* macros.
required:
- compatible
- reg
allOf:
- if:
anyOf:
- required:
- aspeed,ext-push-pull
- required:
- aspeed,ext-active-high
- required:
- aspeed,reset-mask
then:
properties:
compatible:
enum:
- aspeed,ast2500-wdt
- aspeed,ast2600-wdt
- if:
required:
- aspeed,ext-active-high
then:
required:
- aspeed,ext-push-pull
additionalProperties: false
examples:
- |
watchdog@1e785000 {
compatible = "aspeed,ast2400-wdt";
reg = <0x1e785000 0x1c>;
aspeed,reset-type = "system";
aspeed,external-signal;
};
- |
#include <dt-bindings/watchdog/aspeed-wdt.h>
watchdog@1e785040 {
compatible = "aspeed,ast2600-wdt";
reg = <0x1e785040 0x40>;
aspeed,reset-type = "soc";
aspeed,reset-mask = <AST2600_WDT_RESET1_DEFAULT
(AST2600_WDT_RESET2_DEFAULT & ~AST2600_WDT_RESET2_LPC)>;
};
Aspeed Watchdog Timer
Required properties:
- compatible: must be one of:
- "aspeed,ast2400-wdt"
- "aspeed,ast2500-wdt"
- "aspeed,ast2600-wdt"
- reg: physical base address of the controller and length of memory mapped
region
Optional properties:
- aspeed,reset-type = "cpu|soc|system|none"
Reset behavior - Whenever a timeout occurs the watchdog can be programmed
to generate one of three different, mutually exclusive, types of resets.
Type "none" can be specified to indicate that no resets are to be done.
This is useful in situations where another watchdog engine on chip is
to perform the reset.
If 'aspeed,reset-type=' is not specified the default is to enable system
reset.
Reset types:
- cpu: Reset CPU on watchdog timeout
- soc: Reset 'System on Chip' on watchdog timeout
- system: Reset system on watchdog timeout
- none: No reset is performed on timeout. Assumes another watchdog
engine is responsible for this.
- aspeed,alt-boot: If property is present then boot from alternate block.
- aspeed,external-signal: If property is present then signal is sent to
external reset counter (only WDT1 and WDT2). If not
specified no external signal is sent.
- aspeed,ext-pulse-duration: External signal pulse duration in microseconds
Optional properties for AST2500-compatible watchdogs:
- aspeed,ext-push-pull: If aspeed,external-signal is present, set the pin's
drive type to push-pull. The default is open-drain.
- aspeed,ext-active-high: If aspeed,external-signal is present and and the pin
is configured as push-pull, then set the pulse
polarity to active-high. The default is active-low.
Optional properties for AST2500- and AST2600-compatible watchdogs:
- aspeed,reset-mask: A bitmask indicating which peripherals will be reset if
the watchdog timer expires. On AST2500 this should be a
single word defined using the AST2500_WDT_RESET_* macros;
on AST2600 this should be a two-word array with the first
word defined using the AST2600_WDT_RESET1_* macros and the
second word defined using the AST2600_WDT_RESET2_* macros.
Examples:
wdt1: watchdog@1e785000 {
compatible = "aspeed,ast2400-wdt";
reg = <0x1e785000 0x1c>;
aspeed,reset-type = "system";
aspeed,external-signal;
};
#include <dt-bindings/watchdog/aspeed-wdt.h>
wdt2: watchdog@1e785040 {
compatible = "aspeed,ast2600-wdt";
reg = <0x1e785040 0x40>;
aspeed,reset-mask = <AST2600_WDT_RESET1_DEFAULT
(AST2600_WDT_RESET2_DEFAULT & ~AST2600_WDT_RESET2_LPC)>;
};
...@@ -486,34 +486,30 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, ...@@ -486,34 +486,30 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
* device that had registered logical PIO mapping, and the return code is * device that had registered logical PIO mapping, and the return code is
* relative to that node. * relative to that node.
*/ */
static u64 __of_translate_address(struct device_node *dev, static u64 __of_translate_address(struct device_node *node,
struct device_node *(*get_parent)(const struct device_node *), struct device_node *(*get_parent)(const struct device_node *),
const __be32 *in_addr, const char *rprop, const __be32 *in_addr, const char *rprop,
struct device_node **host) struct device_node **host)
{ {
struct device_node *parent = NULL; struct device_node *dev __free(device_node) = of_node_get(node);
struct device_node *parent __free(device_node) = get_parent(dev);
struct of_bus *bus, *pbus; struct of_bus *bus, *pbus;
__be32 addr[OF_MAX_ADDR_CELLS]; __be32 addr[OF_MAX_ADDR_CELLS];
int na, ns, pna, pns; int na, ns, pna, pns;
u64 result = OF_BAD_ADDR;
pr_debug("** translation for device %pOF **\n", dev); pr_debug("** translation for device %pOF **\n", dev);
/* Increase refcount at current level */
of_node_get(dev);
*host = NULL; *host = NULL;
/* Get parent & match bus type */
parent = get_parent(dev);
if (parent == NULL) if (parent == NULL)
goto bail; return OF_BAD_ADDR;
bus = of_match_bus(parent); bus = of_match_bus(parent);
/* Count address cells & copy address locally */ /* Count address cells & copy address locally */
bus->count_cells(dev, &na, &ns); bus->count_cells(dev, &na, &ns);
if (!OF_CHECK_COUNTS(na, ns)) { if (!OF_CHECK_COUNTS(na, ns)) {
pr_debug("Bad cell count for %pOF\n", dev); pr_debug("Bad cell count for %pOF\n", dev);
goto bail; return OF_BAD_ADDR;
} }
memcpy(addr, in_addr, na * 4); memcpy(addr, in_addr, na * 4);
...@@ -533,8 +529,7 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -533,8 +529,7 @@ static u64 __of_translate_address(struct device_node *dev,
/* If root, we have finished */ /* If root, we have finished */
if (parent == NULL) { if (parent == NULL) {
pr_debug("reached root node\n"); pr_debug("reached root node\n");
result = of_read_number(addr, na); return of_read_number(addr, na);
break;
} }
/* /*
...@@ -543,11 +538,11 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -543,11 +538,11 @@ static u64 __of_translate_address(struct device_node *dev,
*/ */
iorange = find_io_range_by_fwnode(&dev->fwnode); iorange = find_io_range_by_fwnode(&dev->fwnode);
if (iorange && (iorange->flags != LOGIC_PIO_CPU_MMIO)) { if (iorange && (iorange->flags != LOGIC_PIO_CPU_MMIO)) {
result = of_read_number(addr + 1, na - 1); u64 result = of_read_number(addr + 1, na - 1);
pr_debug("indirectIO matched(%pOF) 0x%llx\n", pr_debug("indirectIO matched(%pOF) 0x%llx\n",
dev, result); dev, result);
*host = of_node_get(dev); *host = no_free_ptr(dev);
break; return result;
} }
/* Get new parent bus and counts */ /* Get new parent bus and counts */
...@@ -555,7 +550,7 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -555,7 +550,7 @@ static u64 __of_translate_address(struct device_node *dev,
pbus->count_cells(dev, &pna, &pns); pbus->count_cells(dev, &pna, &pns);
if (!OF_CHECK_COUNTS(pna, pns)) { if (!OF_CHECK_COUNTS(pna, pns)) {
pr_err("Bad cell count for %pOF\n", dev); pr_err("Bad cell count for %pOF\n", dev);
break; return OF_BAD_ADDR;
} }
pr_debug("parent bus is %s (na=%d, ns=%d) on %pOF\n", pr_debug("parent bus is %s (na=%d, ns=%d) on %pOF\n",
...@@ -563,7 +558,7 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -563,7 +558,7 @@ static u64 __of_translate_address(struct device_node *dev,
/* Apply bus translation */ /* Apply bus translation */
if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop)) if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
break; return OF_BAD_ADDR;
/* Complete the move up one level */ /* Complete the move up one level */
na = pna; na = pna;
...@@ -572,11 +567,8 @@ static u64 __of_translate_address(struct device_node *dev, ...@@ -572,11 +567,8 @@ static u64 __of_translate_address(struct device_node *dev,
of_dump_addr("one level translation:", addr, na); of_dump_addr("one level translation:", addr, na);
} }
bail:
of_node_put(parent);
of_node_put(dev);
return result; unreachable();
} }
u64 of_translate_address(struct device_node *dev, const __be32 *in_addr) u64 of_translate_address(struct device_node *dev, const __be32 *in_addr)
...@@ -654,19 +646,16 @@ EXPORT_SYMBOL(of_translate_dma_address); ...@@ -654,19 +646,16 @@ EXPORT_SYMBOL(of_translate_dma_address);
const __be32 *of_translate_dma_region(struct device_node *dev, const __be32 *prop, const __be32 *of_translate_dma_region(struct device_node *dev, const __be32 *prop,
phys_addr_t *start, size_t *length) phys_addr_t *start, size_t *length)
{ {
struct device_node *parent; struct device_node *parent __free(device_node) = __of_get_dma_parent(dev);
u64 address, size; u64 address, size;
int na, ns; int na, ns;
parent = __of_get_dma_parent(dev);
if (!parent) if (!parent)
return NULL; return NULL;
na = of_bus_n_addr_cells(parent); na = of_bus_n_addr_cells(parent);
ns = of_bus_n_size_cells(parent); ns = of_bus_n_size_cells(parent);
of_node_put(parent);
address = of_translate_dma_address(dev, prop); address = of_translate_dma_address(dev, prop);
if (address == OF_BAD_ADDR) if (address == OF_BAD_ADDR)
return NULL; return NULL;
...@@ -688,21 +677,19 @@ const __be32 *__of_get_address(struct device_node *dev, int index, int bar_no, ...@@ -688,21 +677,19 @@ const __be32 *__of_get_address(struct device_node *dev, int index, int bar_no,
{ {
const __be32 *prop; const __be32 *prop;
unsigned int psize; unsigned int psize;
struct device_node *parent; struct device_node *parent __free(device_node) = of_get_parent(dev);
struct of_bus *bus; struct of_bus *bus;
int onesize, i, na, ns; int onesize, i, na, ns;
/* Get parent & match bus type */
parent = of_get_parent(dev);
if (parent == NULL) if (parent == NULL)
return NULL; return NULL;
/* match the parent's bus type */
bus = of_match_bus(parent); bus = of_match_bus(parent);
if (strcmp(bus->name, "pci") && (bar_no >= 0)) { if (strcmp(bus->name, "pci") && (bar_no >= 0))
of_node_put(parent);
return NULL; return NULL;
}
bus->count_cells(dev, &na, &ns); bus->count_cells(dev, &na, &ns);
of_node_put(parent);
if (!OF_CHECK_ADDR_COUNT(na)) if (!OF_CHECK_ADDR_COUNT(na))
return NULL; return NULL;
...@@ -888,14 +875,13 @@ static u64 of_translate_ioport(struct device_node *dev, const __be32 *in_addr, ...@@ -888,14 +875,13 @@ static u64 of_translate_ioport(struct device_node *dev, const __be32 *in_addr,
*/ */
int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
{ {
struct device_node *node = of_node_get(np); struct device_node *node __free(device_node) = of_node_get(np);
const __be32 *ranges = NULL; const __be32 *ranges = NULL;
bool found_dma_ranges = false; bool found_dma_ranges = false;
struct of_range_parser parser; struct of_range_parser parser;
struct of_range range; struct of_range range;
struct bus_dma_region *r; struct bus_dma_region *r;
int len, num_ranges = 0; int len, num_ranges = 0;
int ret = 0;
while (node) { while (node) {
ranges = of_get_property(node, "dma-ranges", &len); ranges = of_get_property(node, "dma-ranges", &len);
...@@ -905,10 +891,9 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) ...@@ -905,10 +891,9 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
break; break;
/* Once we find 'dma-ranges', then a missing one is an error */ /* Once we find 'dma-ranges', then a missing one is an error */
if (found_dma_ranges && !ranges) { if (found_dma_ranges && !ranges)
ret = -ENODEV; return -ENODEV;
goto out;
}
found_dma_ranges = true; found_dma_ranges = true;
node = of_get_next_dma_parent(node); node = of_get_next_dma_parent(node);
...@@ -916,10 +901,8 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) ...@@ -916,10 +901,8 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
if (!node || !ranges) { if (!node || !ranges) {
pr_debug("no dma-ranges found for node(%pOF)\n", np); pr_debug("no dma-ranges found for node(%pOF)\n", np);
ret = -ENODEV; return -ENODEV;
goto out;
} }
of_dma_range_parser_init(&parser, node); of_dma_range_parser_init(&parser, node);
for_each_of_range(&parser, &range) { for_each_of_range(&parser, &range) {
if (range.cpu_addr == OF_BAD_ADDR) { if (range.cpu_addr == OF_BAD_ADDR) {
...@@ -930,16 +913,12 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) ...@@ -930,16 +913,12 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
num_ranges++; num_ranges++;
} }
if (!num_ranges) { if (!num_ranges)
ret = -EINVAL; return -EINVAL;
goto out;
}
r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL); r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL);
if (!r) { if (!r)
ret = -ENOMEM; return -ENOMEM;
goto out;
}
/* /*
* Record all info in the generic DMA ranges array for struct device, * Record all info in the generic DMA ranges array for struct device,
...@@ -957,9 +936,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) ...@@ -957,9 +936,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
r->size = range.size; r->size = range.size;
r++; r++;
} }
out: return 0;
of_node_put(node);
return ret;
} }
#endif /* CONFIG_HAS_DMA */ #endif /* CONFIG_HAS_DMA */
...@@ -1016,24 +993,18 @@ phys_addr_t __init of_dma_get_max_cpu_address(struct device_node *np) ...@@ -1016,24 +993,18 @@ phys_addr_t __init of_dma_get_max_cpu_address(struct device_node *np)
*/ */
bool of_dma_is_coherent(struct device_node *np) bool of_dma_is_coherent(struct device_node *np)
{ {
struct device_node *node; struct device_node *node __free(device_node) = of_node_get(np);
bool is_coherent = dma_default_coherent;
node = of_node_get(np);
while (node) { while (node) {
if (of_property_read_bool(node, "dma-coherent")) { if (of_property_read_bool(node, "dma-coherent"))
is_coherent = true; return true;
break;
} if (of_property_read_bool(node, "dma-noncoherent"))
if (of_property_read_bool(node, "dma-noncoherent")) { return false;
is_coherent = false;
break;
}
node = of_get_next_dma_parent(node); node = of_get_next_dma_parent(node);
} }
of_node_put(node); return dma_default_coherent;
return is_coherent;
} }
EXPORT_SYMBOL_GPL(of_dma_is_coherent); EXPORT_SYMBOL_GPL(of_dma_is_coherent);
...@@ -1049,20 +1020,14 @@ EXPORT_SYMBOL_GPL(of_dma_is_coherent); ...@@ -1049,20 +1020,14 @@ EXPORT_SYMBOL_GPL(of_dma_is_coherent);
*/ */
static bool of_mmio_is_nonposted(struct device_node *np) static bool of_mmio_is_nonposted(struct device_node *np)
{ {
struct device_node *parent;
bool nonposted;
if (!IS_ENABLED(CONFIG_ARCH_APPLE)) if (!IS_ENABLED(CONFIG_ARCH_APPLE))
return false; return false;
parent = of_get_parent(np); struct device_node *parent __free(device_node) = of_get_parent(np);
if (!parent) if (!parent)
return false; return false;
nonposted = of_property_read_bool(parent, "nonposted-mmio"); return of_property_read_bool(parent, "nonposted-mmio");
of_node_put(parent);
return nonposted;
} }
static int __of_address_to_resource(struct device_node *dev, int index, int bar_no, static int __of_address_to_resource(struct device_node *dev, int index, int bar_no,
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define pr_fmt(fmt) "OF: " fmt #define pr_fmt(fmt) "OF: " fmt
#include <linux/cleanup.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/cpu.h> #include <linux/cpu.h>
...@@ -1393,8 +1394,10 @@ int of_parse_phandle_with_args_map(const struct device_node *np, ...@@ -1393,8 +1394,10 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
const char *stem_name, const char *stem_name,
int index, struct of_phandle_args *out_args) int index, struct of_phandle_args *out_args)
{ {
char *cells_name, *map_name = NULL, *mask_name = NULL; char *cells_name __free(kfree) = kasprintf(GFP_KERNEL, "#%s-cells", stem_name);
char *pass_name = NULL; char *map_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map", stem_name);
char *mask_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-mask", 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] = cpu_to_be32(~0) };
...@@ -1407,27 +1410,13 @@ int of_parse_phandle_with_args_map(const struct device_node *np, ...@@ -1407,27 +1410,13 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
if (index < 0) if (index < 0)
return -EINVAL; return -EINVAL;
cells_name = kasprintf(GFP_KERNEL, "#%s-cells", stem_name); if (!cells_name || !map_name || !mask_name || !pass_name)
if (!cells_name)
return -ENOMEM; return -ENOMEM;
ret = -ENOMEM;
map_name = kasprintf(GFP_KERNEL, "%s-map", stem_name);
if (!map_name)
goto free;
mask_name = kasprintf(GFP_KERNEL, "%s-map-mask", stem_name);
if (!mask_name)
goto free;
pass_name = kasprintf(GFP_KERNEL, "%s-map-pass-thru", stem_name);
if (!pass_name)
goto free;
ret = __of_parse_phandle_with_args(np, list_name, cells_name, -1, index, ret = __of_parse_phandle_with_args(np, list_name, cells_name, -1, index,
out_args); out_args);
if (ret) if (ret)
goto free; return ret;
/* Get the #<list>-cells property */ /* Get the #<list>-cells property */
cur = out_args->np; cur = out_args->np;
...@@ -1444,8 +1433,7 @@ int of_parse_phandle_with_args_map(const struct device_node *np, ...@@ -1444,8 +1433,7 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
/* Get the <list>-map property */ /* Get the <list>-map property */
map = of_get_property(cur, map_name, &map_len); map = of_get_property(cur, map_name, &map_len);
if (!map) { if (!map) {
ret = 0; return 0;
goto free;
} }
map_len /= sizeof(u32); map_len /= sizeof(u32);
...@@ -1521,12 +1509,6 @@ int of_parse_phandle_with_args_map(const struct device_node *np, ...@@ -1521,12 +1509,6 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
put: put:
of_node_put(cur); of_node_put(cur);
of_node_put(new); of_node_put(new);
free:
kfree(mask_name);
kfree(map_name);
kfree(cells_name);
kfree(pass_name);
return ret; return ret;
} }
EXPORT_SYMBOL(of_parse_phandle_with_args_map); EXPORT_SYMBOL(of_parse_phandle_with_args_map);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define pr_fmt(fmt) "OF: " fmt #define pr_fmt(fmt) "OF: " fmt
#include <linux/cleanup.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -306,15 +307,20 @@ int of_detach_node(struct device_node *np) ...@@ -306,15 +307,20 @@ int of_detach_node(struct device_node *np)
} }
EXPORT_SYMBOL_GPL(of_detach_node); EXPORT_SYMBOL_GPL(of_detach_node);
void __of_prop_free(struct property *prop)
{
kfree(prop->name);
kfree(prop->value);
kfree(prop);
}
static void property_list_free(struct property *prop_list) static void property_list_free(struct property *prop_list)
{ {
struct property *prop, *next; struct property *prop, *next;
for (prop = prop_list; prop != NULL; prop = next) { for (prop = prop_list; prop != NULL; prop = next) {
next = prop->next; next = prop->next;
kfree(prop->name); __of_prop_free(prop);
kfree(prop->value);
kfree(prop);
} }
} }
...@@ -427,9 +433,7 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags) ...@@ -427,9 +433,7 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
return new; return new;
err_free: err_free:
kfree(new->name); __of_prop_free(new);
kfree(new->value);
kfree(new);
return NULL; return NULL;
} }
...@@ -471,9 +475,7 @@ struct device_node *__of_node_dup(const struct device_node *np, ...@@ -471,9 +475,7 @@ struct device_node *__of_node_dup(const struct device_node *np,
if (!new_pp) if (!new_pp)
goto err_prop; goto err_prop;
if (__of_add_property(node, new_pp)) { if (__of_add_property(node, new_pp)) {
kfree(new_pp->name); __of_prop_free(new_pp);
kfree(new_pp->value);
kfree(new_pp);
goto err_prop; goto err_prop;
} }
} }
...@@ -933,11 +935,8 @@ static int of_changeset_add_prop_helper(struct of_changeset *ocs, ...@@ -933,11 +935,8 @@ static int of_changeset_add_prop_helper(struct of_changeset *ocs,
return -ENOMEM; return -ENOMEM;
ret = of_changeset_add_property(ocs, np, new_pp); ret = of_changeset_add_property(ocs, np, new_pp);
if (ret) { if (ret)
kfree(new_pp->name); __of_prop_free(new_pp);
kfree(new_pp->value);
kfree(new_pp);
}
return ret; return ret;
} }
...@@ -1033,10 +1032,9 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs, ...@@ -1033,10 +1032,9 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs,
const u32 *array, size_t sz) const u32 *array, size_t sz)
{ {
struct property prop; struct property prop;
__be32 *val; __be32 *val __free(kfree) = kcalloc(sz, sizeof(__be32), GFP_KERNEL);
int i, ret; int i;
val = kcalloc(sz, sizeof(__be32), GFP_KERNEL);
if (!val) if (!val)
return -ENOMEM; return -ENOMEM;
...@@ -1046,9 +1044,6 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs, ...@@ -1046,9 +1044,6 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs,
prop.length = sizeof(u32) * sz; prop.length = sizeof(u32) * sz;
prop.value = (void *)val; prop.value = (void *)val;
ret = of_changeset_add_prop_helper(ocs, np, &prop); return of_changeset_add_prop_helper(ocs, np, &prop);
kfree(val);
return ret;
} }
EXPORT_SYMBOL_GPL(of_changeset_add_prop_u32_array); EXPORT_SYMBOL_GPL(of_changeset_add_prop_u32_array);
...@@ -29,14 +29,15 @@ ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len) ...@@ -29,14 +29,15 @@ ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len)
csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T', csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T',
of_node_get_device_type(np)); of_node_get_device_type(np));
tsize = csize; tsize = csize;
if (csize >= len)
csize = len > 0 ? len - 1 : 0;
len -= csize; len -= csize;
if (str) str += csize;
str += csize;
of_property_for_each_string(np, "compatible", p, compat) { of_property_for_each_string(np, "compatible", p, compat) {
csize = strlen(compat) + 1; csize = strlen(compat) + 1;
tsize += csize; tsize += csize;
if (csize > len) if (csize >= len)
continue; continue;
csize = snprintf(str, len, "C%s", compat); csize = snprintf(str, len, "C%s", compat);
......
...@@ -123,6 +123,7 @@ extern void *__unflatten_device_tree(const void *blob, ...@@ -123,6 +123,7 @@ extern void *__unflatten_device_tree(const void *blob,
* own the devtree lock or work on detached trees only. * own the devtree lock or work on detached trees only.
*/ */
struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags); struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags);
void __of_prop_free(struct property *prop);
struct device_node *__of_node_dup(const struct device_node *np, struct device_node *__of_node_dup(const struct device_node *np,
const char *full_name); const char *full_name);
......
...@@ -437,17 +437,10 @@ void __init fdt_init_reserved_mem(void) ...@@ -437,17 +437,10 @@ void __init fdt_init_reserved_mem(void)
for (i = 0; i < reserved_mem_count; i++) { for (i = 0; i < reserved_mem_count; i++) {
struct reserved_mem *rmem = &reserved_mem[i]; struct reserved_mem *rmem = &reserved_mem[i];
unsigned long node = rmem->fdt_node; unsigned long node = rmem->fdt_node;
int len;
const __be32 *prop;
int err = 0; int err = 0;
bool nomap; bool nomap;
nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL;
prop = of_get_flat_dt_prop(node, "phandle", &len);
if (!prop)
prop = of_get_flat_dt_prop(node, "linux,phandle", &len);
if (prop)
rmem->phandle = of_read_number(prop, len/4);
if (rmem->size == 0) if (rmem->size == 0)
err = __reserved_mem_alloc_size(node, rmem->name, err = __reserved_mem_alloc_size(node, rmem->name,
...@@ -477,19 +470,6 @@ void __init fdt_init_reserved_mem(void) ...@@ -477,19 +470,6 @@ void __init fdt_init_reserved_mem(void)
} }
} }
static inline struct reserved_mem *__find_rmem(struct device_node *node)
{
unsigned int i;
if (!node->phandle)
return NULL;
for (i = 0; i < reserved_mem_count; i++)
if (reserved_mem[i].phandle == node->phandle)
return &reserved_mem[i];
return NULL;
}
struct rmem_assigned_device { struct rmem_assigned_device {
struct device *dev; struct device *dev;
struct reserved_mem *rmem; struct reserved_mem *rmem;
...@@ -534,7 +514,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, ...@@ -534,7 +514,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
return 0; return 0;
} }
rmem = __find_rmem(target); rmem = of_reserved_mem_lookup(target);
of_node_put(target); of_node_put(target);
if (!rmem || !rmem->ops || !rmem->ops->device_init) if (!rmem || !rmem->ops || !rmem->ops->device_init)
......
...@@ -262,9 +262,7 @@ static struct property *dup_and_fixup_symbol_prop( ...@@ -262,9 +262,7 @@ static struct property *dup_and_fixup_symbol_prop(
return new_prop; return new_prop;
err_free_new_prop: err_free_new_prop:
kfree(new_prop->name); __of_prop_free(new_prop);
kfree(new_prop->value);
kfree(new_prop);
err_free_target_path: err_free_target_path:
kfree(target_path); kfree(target_path);
...@@ -361,11 +359,8 @@ static int add_changeset_property(struct overlay_changeset *ovcs, ...@@ -361,11 +359,8 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n", pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n",
target->np, new_prop->name); target->np, new_prop->name);
if (ret) { if (ret)
kfree(new_prop->name); __of_prop_free(new_prop);
kfree(new_prop->value);
kfree(new_prop);
}
return ret; return ret;
} }
......
...@@ -40,15 +40,12 @@ ...@@ -40,15 +40,12 @@
*/ */
bool of_graph_is_present(const struct device_node *node) bool of_graph_is_present(const struct device_node *node)
{ {
struct device_node *ports, *port; struct device_node *ports __free(device_node) = of_get_child_by_name(node, "ports");
ports = of_get_child_by_name(node, "ports");
if (ports) if (ports)
node = ports; node = ports;
port = of_get_child_by_name(node, "port"); struct device_node *port __free(device_node) = of_get_child_by_name(node, "port");
of_node_put(ports);
of_node_put(port);
return !!port; return !!port;
} }
...@@ -579,7 +576,8 @@ EXPORT_SYMBOL_GPL(of_prop_next_string); ...@@ -579,7 +576,8 @@ EXPORT_SYMBOL_GPL(of_prop_next_string);
int of_graph_parse_endpoint(const struct device_node *node, int of_graph_parse_endpoint(const struct device_node *node,
struct of_endpoint *endpoint) struct of_endpoint *endpoint)
{ {
struct device_node *port_node = of_get_parent(node); struct device_node *port_node __free(device_node) =
of_get_parent(node);
WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n", WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n",
__func__, node); __func__, node);
...@@ -594,8 +592,6 @@ int of_graph_parse_endpoint(const struct device_node *node, ...@@ -594,8 +592,6 @@ int of_graph_parse_endpoint(const struct device_node *node,
of_property_read_u32(port_node, "reg", &endpoint->port); of_property_read_u32(port_node, "reg", &endpoint->port);
of_property_read_u32(node, "reg", &endpoint->id); of_property_read_u32(node, "reg", &endpoint->id);
of_node_put(port_node);
return 0; return 0;
} }
EXPORT_SYMBOL(of_graph_parse_endpoint); EXPORT_SYMBOL(of_graph_parse_endpoint);
...@@ -610,25 +606,22 @@ EXPORT_SYMBOL(of_graph_parse_endpoint); ...@@ -610,25 +606,22 @@ EXPORT_SYMBOL(of_graph_parse_endpoint);
*/ */
struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id) struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
{ {
struct device_node *node, *port; struct device_node *node __free(device_node) = of_get_child_by_name(parent, "ports");
node = of_get_child_by_name(parent, "ports");
if (node) if (node)
parent = node; parent = node;
for_each_child_of_node(parent, port) { for_each_child_of_node_scoped(parent, port) {
u32 port_id = 0; u32 port_id = 0;
if (!of_node_name_eq(port, "port")) if (!of_node_name_eq(port, "port"))
continue; continue;
of_property_read_u32(port, "reg", &port_id); of_property_read_u32(port, "reg", &port_id);
if (id == port_id) if (id == port_id)
break; return_ptr(port);
} }
of_node_put(node); return NULL;
return port;
} }
EXPORT_SYMBOL(of_graph_get_port_by_id); EXPORT_SYMBOL(of_graph_get_port_by_id);
...@@ -655,15 +648,13 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, ...@@ -655,15 +648,13 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
* parent port node. * parent port node.
*/ */
if (!prev) { if (!prev) {
struct device_node *node; struct device_node *node __free(device_node) =
of_get_child_by_name(parent, "ports");
node = of_get_child_by_name(parent, "ports");
if (node) if (node)
parent = node; parent = node;
port = of_get_child_by_name(parent, "port"); port = of_get_child_by_name(parent, "port");
of_node_put(node);
if (!port) { if (!port) {
pr_debug("graph: no port node found in %pOF\n", parent); pr_debug("graph: no port node found in %pOF\n", parent);
return NULL; return NULL;
...@@ -1052,15 +1043,13 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, ...@@ -1052,15 +1043,13 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint) struct fwnode_endpoint *endpoint)
{ {
const struct device_node *node = to_of_node(fwnode); const struct device_node *node = to_of_node(fwnode);
struct device_node *port_node = of_get_parent(node); struct device_node *port_node __free(device_node) = of_get_parent(node);
endpoint->local_fwnode = fwnode; endpoint->local_fwnode = fwnode;
of_property_read_u32(port_node, "reg", &endpoint->port); of_property_read_u32(port_node, "reg", &endpoint->port);
of_property_read_u32(node, "reg", &endpoint->id); of_property_read_u32(node, "reg", &endpoint->id);
of_node_put(port_node);
return 0; return 0;
} }
...@@ -1254,6 +1243,7 @@ DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells") ...@@ -1254,6 +1243,7 @@ DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells")
DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL) DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells") DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells")
DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells") DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells")
DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
...@@ -1313,6 +1303,57 @@ static struct device_node *parse_interrupts(struct device_node *np, ...@@ -1313,6 +1303,57 @@ static struct device_node *parse_interrupts(struct device_node *np,
return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np; return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np;
} }
static struct device_node *parse_interrupt_map(struct device_node *np,
const char *prop_name, int index)
{
const __be32 *imap, *imap_end, *addr;
struct of_phandle_args sup_args;
u32 addrcells, intcells;
int i, imaplen;
if (!IS_ENABLED(CONFIG_OF_IRQ))
return NULL;
if (strcmp(prop_name, "interrupt-map"))
return NULL;
if (of_property_read_u32(np, "#interrupt-cells", &intcells))
return NULL;
addrcells = of_bus_n_addr_cells(np);
imap = of_get_property(np, "interrupt-map", &imaplen);
if (!imap || imaplen <= (addrcells + intcells))
return NULL;
imap_end = imap + imaplen;
while (imap < imap_end) {
addr = imap;
imap += addrcells;
sup_args.np = np;
sup_args.args_count = intcells;
for (i = 0; i < intcells; i++)
sup_args.args[i] = be32_to_cpu(imap[i]);
imap += intcells;
/*
* Upon success, the function of_irq_parse_raw() returns
* interrupt controller DT node pointer in sup_args.np.
*/
if (of_irq_parse_raw(addr, &sup_args))
return NULL;
if (!index)
return sup_args.np;
of_node_put(sup_args.np);
imap += sup_args.args_count + 1;
index--;
}
return NULL;
}
static struct device_node *parse_remote_endpoint(struct device_node *np, static struct device_node *parse_remote_endpoint(struct device_node *np,
const char *prop_name, const char *prop_name,
int index) int index)
...@@ -1360,8 +1401,10 @@ static const struct supplier_bindings of_supplier_bindings[] = { ...@@ -1360,8 +1401,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_panel, }, { .parse_prop = parse_panel, },
{ .parse_prop = parse_msi_parent, }, { .parse_prop = parse_msi_parent, },
{ .parse_prop = parse_pses, }, { .parse_prop = parse_pses, },
{ .parse_prop = parse_power_supplies, },
{ .parse_prop = parse_gpio_compat, }, { .parse_prop = parse_gpio_compat, },
{ .parse_prop = parse_interrupts, }, { .parse_prop = parse_interrupts, },
{ .parse_prop = parse_interrupt_map, },
{ .parse_prop = parse_access_controllers, }, { .parse_prop = parse_access_controllers, },
{ .parse_prop = parse_regulators, }, { .parse_prop = parse_regulators, },
{ .parse_prop = parse_gpio, }, { .parse_prop = parse_gpio, },
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define pr_fmt(fmt) "OF: resolver: " fmt #define pr_fmt(fmt) "OF: resolver: " fmt
#include <linux/cleanup.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -74,11 +75,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay, ...@@ -74,11 +75,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
{ {
struct device_node *refnode; struct device_node *refnode;
struct property *prop; struct property *prop;
char *value, *cur, *end, *node_path, *prop_name, *s; char *value __free(kfree) = kmemdup(prop_fixup->value, prop_fixup->length, GFP_KERNEL);
char *cur, *end, *node_path, *prop_name, *s;
int offset, len; int offset, len;
int err = 0; int err = 0;
value = kmemdup(prop_fixup->value, prop_fixup->length, GFP_KERNEL);
if (!value) if (!value)
return -ENOMEM; return -ENOMEM;
...@@ -89,23 +90,19 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay, ...@@ -89,23 +90,19 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
node_path = cur; node_path = cur;
s = strchr(cur, ':'); s = strchr(cur, ':');
if (!s) { if (!s)
err = -EINVAL; return -EINVAL;
goto err_fail;
}
*s++ = '\0'; *s++ = '\0';
prop_name = s; prop_name = s;
s = strchr(s, ':'); s = strchr(s, ':');
if (!s) { if (!s)
err = -EINVAL; return -EINVAL;
goto err_fail;
}
*s++ = '\0'; *s++ = '\0';
err = kstrtoint(s, 10, &offset); err = kstrtoint(s, 10, &offset);
if (err) if (err)
goto err_fail; return err;
refnode = __of_find_node_by_full_path(of_node_get(overlay), node_path); refnode = __of_find_node_by_full_path(of_node_get(overlay), node_path);
if (!refnode) if (!refnode)
...@@ -117,22 +114,16 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay, ...@@ -117,22 +114,16 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
} }
of_node_put(refnode); of_node_put(refnode);
if (!prop) { if (!prop)
err = -ENOENT; return -ENOENT;
goto err_fail;
}
if (offset < 0 || offset + sizeof(__be32) > prop->length) { if (offset < 0 || offset + sizeof(__be32) > prop->length)
err = -EINVAL; return -EINVAL;
goto err_fail;
}
*(__be32 *)(prop->value + offset) = cpu_to_be32(phandle); *(__be32 *)(prop->value + offset) = cpu_to_be32(phandle);
} }
err_fail: return 0;
kfree(value);
return err;
} }
/* compare nodes taking into account that 'name' strips out the @ part */ /* compare nodes taking into account that 'name' strips out the @ part */
......
...@@ -795,15 +795,11 @@ static void __init of_unittest_property_copy(void) ...@@ -795,15 +795,11 @@ static void __init of_unittest_property_copy(void)
new = __of_prop_dup(&p1, GFP_KERNEL); new = __of_prop_dup(&p1, GFP_KERNEL);
unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n"); unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n");
kfree(new->value); __of_prop_free(new);
kfree(new->name);
kfree(new);
new = __of_prop_dup(&p2, GFP_KERNEL); new = __of_prop_dup(&p2, GFP_KERNEL);
unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n"); unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n");
kfree(new->value); __of_prop_free(new);
kfree(new->name);
kfree(new);
#endif #endif
} }
...@@ -3718,9 +3714,7 @@ static __init void of_unittest_overlay_high_level(void) ...@@ -3718,9 +3714,7 @@ static __init void of_unittest_overlay_high_level(void)
goto err_unlock; goto err_unlock;
} }
if (__of_add_property(of_symbols, new_prop)) { if (__of_add_property(of_symbols, new_prop)) {
kfree(new_prop->name); __of_prop_free(new_prop);
kfree(new_prop->value);
kfree(new_prop);
/* "name" auto-generated by unflatten */ /* "name" auto-generated by unflatten */
if (!strcmp(prop->name, "name")) if (!strcmp(prop->name, "name"))
continue; continue;
......
...@@ -11,7 +11,6 @@ struct reserved_mem_ops; ...@@ -11,7 +11,6 @@ struct reserved_mem_ops;
struct reserved_mem { struct reserved_mem {
const char *name; const char *name;
unsigned long fdt_node; unsigned long fdt_node;
unsigned long phandle;
const struct reserved_mem_ops *ops; const struct reserved_mem_ops *ops;
phys_addr_t base; phys_addr_t base;
phys_addr_t size; phys_addr_t size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment