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:
compatible:
const: abt,y030xx067a
reg:
maxItems: 1
backlight: true
port: true
power-supply: true
reg: true
reset-gpios: true
required:
......
......@@ -21,7 +21,10 @@ allOf:
properties:
compatible:
const: asus,z00t-tm5p5-n35596
reg: true
reg:
maxItems: 1
reset-gpios: true
vdd-supply:
description: core voltage supply
......
......@@ -26,6 +26,9 @@ properties:
compatible:
const: boe,bf060y8m-aj0
reg:
maxItems: 1
elvdd-supply:
description: EL Driving positive (VDD) supply (4.40-4.80V)
elvss-supply:
......@@ -38,7 +41,6 @@ properties:
description: I/O voltage supply (1.62-1.98V)
port: true
reg: true
reset-gpios: true
required:
......
......@@ -18,9 +18,11 @@ properties:
- const: boe,himax8279d8p
- const: boe,himax8279d10p
reg:
maxItems: 1
backlight: true
enable-gpios: true
reg: true
pp33-gpios:
maxItems: 1
......
......@@ -18,7 +18,9 @@ properties:
# BOE TH101MB31IG002-28A 10.1" WXGA TFT LCD panel
- boe,th101mb31ig002-28a
reg: true
reg:
maxItems: 1
backlight: true
enable-gpios: true
power-supply: true
......
......@@ -38,7 +38,7 @@ properties:
- starry,ili9882t
reg:
description: the virtual channel number of a DSI peripheral
maxItems: 1
enable-gpios:
description: a GPIO spec for the enable pin
......
......@@ -15,7 +15,10 @@ allOf:
properties:
compatible:
const: elida,kd35t133
reg: true
reg:
maxItems: 1
backlight: true
port: true
reset-gpios: true
......
......@@ -17,6 +17,9 @@ properties:
compatible:
const: fascontek,fs035vg158
reg:
maxItems: 1
spi-3wire: true
required:
......
......@@ -15,7 +15,10 @@ allOf:
properties:
compatible:
const: feixin,k101-im2ba02
reg: true
reg:
maxItems: 1
backlight: true
reset-gpios: true
avdd-supply:
......
......@@ -21,6 +21,9 @@ properties:
contains:
const: djn,9a-3r063-1102b
reg:
maxItems: 1
vdd1-supply:
description: Digital voltage rail
......@@ -30,7 +33,6 @@ properties:
vsp-supply:
description: Negative source voltage rail
reg: true
port: true
required:
......
......@@ -26,7 +26,8 @@ properties:
- powkiddy,x55-panel
- const: himax,hx8394
reg: true
reg:
maxItems: 1
reset-gpios: true
......
......@@ -24,6 +24,9 @@ properties:
- newhaven,1.8-128160EF
- const: ilitek,ili9163
reg:
maxItems: 1
spi-max-frequency:
maximum: 32000000
......@@ -32,7 +35,6 @@ properties:
description: Display data/command selection (D/CX)
backlight: true
reg: true
reset-gpios: true
rotation: true
......
......@@ -26,6 +26,9 @@ properties:
- dlink,dir-685-panel
- const: ilitek,ili9322
reg:
maxItems: 1
reset-gpios: true
port: true
......
......@@ -28,7 +28,8 @@ properties:
- canaan,kd233-tft
- const: ilitek,ili9341
reg: true
reg:
maxItems: 1
dc-gpios:
maxItems: 1
......
......@@ -20,9 +20,11 @@ properties:
- tianma,tm041xdhg01
- const: ilitek,ili9805
reg:
maxItems: 1
avdd-supply: true
dvdd-supply: true
reg: true
required:
- compatible
......
......@@ -24,9 +24,11 @@ properties:
- wanchanglong,w552946aba
- const: ilitek,ili9881c
reg:
maxItems: 1
backlight: true
power-supply: true
reg: true
reset-gpios: true
rotation: true
......
......@@ -17,10 +17,12 @@ properties:
compatible:
const: innolux,ej030na
reg:
maxItems: 1
backlight: true
port: true
power-supply: true
reg: true
reset-gpios: true
required:
......
......@@ -16,9 +16,11 @@ properties:
compatible:
const: innolux,p097pfg
reg:
maxItems: 1
backlight: true
enable-gpios: true
reg: true
avdd-supply:
description: The regulator that provides positive voltage
......
......@@ -21,7 +21,8 @@ properties:
- radxa,display-8hd-ad002
- const: jadard,jd9365da-h3
reg: true
reg:
maxItems: 1
vdd-supply:
description: supply regulator for VDD, usually 3.3V
......
......@@ -26,7 +26,9 @@ properties:
compatible:
const: jdi,lpm102a188a
reg: true
reg:
maxItems: 1
enable-gpios: true
reset-gpios: true
power-supply: true
......
......@@ -16,8 +16,10 @@ properties:
compatible:
const: jdi,lt070me05000
reg:
maxItems: 1
enable-gpios: true
reg: true
reset-gpios: true
vddp-supply:
......
......@@ -17,10 +17,12 @@ properties:
compatible:
const: kingdisplay,kd035g6-54nt
reg:
maxItems: 1
backlight: true
port: true
power-supply: true
reg: true
reset-gpios: true
spi-3wire: true
......
......@@ -18,6 +18,9 @@ properties:
compatible:
const: leadtek,ltk035c5444t
reg:
maxItems: 1
spi-3wire: true
required:
......
......@@ -18,7 +18,10 @@ properties:
- leadtek,ltk050h3146w
- leadtek,ltk050h3146w-a2
- leadtek,ltk050h3148w
reg: true
reg:
maxItems: 1
backlight: true
reset-gpios: true
iovcc-supply:
......
......@@ -17,7 +17,10 @@ properties:
enum:
- leadtek,ltk101b4029w
- leadtek,ltk500hd1829
reg: true
reg:
maxItems: 1
backlight: true
reset-gpios: true
iovcc-supply:
......
......@@ -21,7 +21,8 @@ properties:
compatible:
const: lg,lg4573
reg: true
reg:
maxItems: 1
required:
- compatible
......
......@@ -17,6 +17,9 @@ properties:
compatible:
const: lgphilips,lb035q02
reg:
maxItems: 1
label: true
enable-gpios: true
port: true
......
......@@ -21,9 +21,11 @@ properties:
compatible:
const: nec,nl8048hl11
reg:
maxItems: 1
label: true
port: true
reg: true
reset-gpios: true
spi-max-frequency:
......
......@@ -24,7 +24,9 @@ properties:
- powkiddy,rk2023-panel
- const: newvision,nv3051d
reg: true
reg:
maxItems: 1
backlight: true
port: true
reset-gpios:
......
......@@ -24,7 +24,10 @@ properties:
string determines how the NT35510 panel driver shall be configured
to work with the indicated panel. The novatek,nt35510 compatible shall
always be provided as a fallback.
reg: true
reg:
maxItems: 1
reset-gpios: true
vdd-supply:
description: regulator that supplies the vdd voltage
......
......@@ -33,6 +33,9 @@ properties:
to work with the indicated panel. The novatek,nt35950 compatible shall
always be provided as a fallback.
reg:
maxItems: 1
reset-gpios:
maxItems: 1
description: phandle of gpio for reset line - This should be 8mA, gpio
......@@ -49,7 +52,6 @@ properties:
backlight: true
ports: true
reg: true
required:
- compatible
......
......@@ -27,6 +27,9 @@ properties:
- lenovo,j606f-boe-nt36523w
- const: novatek,nt36523w
reg:
maxItems: 1
reset-gpios:
maxItems: 1
description: phandle of gpio for reset line - This should be 8mA
......@@ -34,7 +37,6 @@ properties:
vddio-supply:
description: regulator that supplies the I/O voltage
reg: true
rotation: true
backlight: true
......
......@@ -29,6 +29,9 @@ properties:
determines how the NT36672A panel driver is configured for the indicated
panel. The novatek,nt36672a compatible shall always be provided as a fallback.
reg:
maxItems: 1
reset-gpios:
maxItems: 1
description: phandle of gpio for reset line - This should be 8mA, gpio
......@@ -44,7 +47,6 @@ properties:
vddneg-supply:
description: phandle of the negative boost supply regulator
reg: true
port: true
backlight: true
......
......@@ -38,10 +38,12 @@ properties:
compatible:
const: olimex,lcd-olinuxino
reg:
maxItems: 1
backlight: true
enable-gpios: true
power-supply: true
reg: true
required:
- compatible
......
......@@ -71,6 +71,9 @@ properties:
- shineworld,lh133k
- const: panel-mipi-dbi-spi
reg:
maxItems: 1
write-only:
type: boolean
description:
......
......@@ -16,7 +16,9 @@ properties:
compatible:
const: raydium,rm67191
reg: true
reg:
maxItems: 1
port: true
reset-gpios: true
width-mm: true
......
......@@ -22,6 +22,9 @@ properties:
- const: fairphone,fp5-rm692e5-boe
- const: raydium,rm692e5
reg:
maxItems: 1
dvdd-supply:
description: Digital voltage rail
......@@ -31,7 +34,6 @@ properties:
vddio-supply:
description: I/O voltage rail
reg: true
port: true
required:
......
......@@ -14,7 +14,7 @@ properties:
const: ronbo,rb070d30
reg:
description: MIPI-DSI virtual channel
maxItems: 1
power-gpios:
description: GPIO used for the power pin
......
......@@ -33,7 +33,9 @@ properties:
# Samsung S6E3HF2 5.65" 1600x2560 AMOLED panel
- samsung,s6e3hf2
reg: true
reg:
maxItems: 1
reset-gpios: true
enable-gpios: true
te-gpios: true
......
......@@ -11,12 +11,15 @@ maintainers:
allOf:
- $ref: panel-common.yaml#
- $ref: /schemas/spi/spi-peripheral-props.yaml#
properties:
compatible:
const: samsung,ams495qa01
reg: true
reg:
maxItems: 1
reset-gpios:
description: reset gpio, must be GPIO_ACTIVE_LOW
elvdd-supply:
......
......@@ -17,9 +17,11 @@ properties:
compatible:
const: samsung,ld9040
reg:
maxItems: 1
display-timings: true
port: true
reg: true
reset-gpios: true
vdd3-supply:
......
......@@ -21,7 +21,8 @@ properties:
compatible:
const: samsung,lms380kf01
reg: true
reg:
maxItems: 1
interrupts:
description: provides an optional ESD (electrostatic discharge)
......
......@@ -20,7 +20,8 @@ properties:
compatible:
const: samsung,lms397kf04
reg: true
reg:
maxItems: 1
reset-gpios: true
......
......@@ -16,8 +16,10 @@ properties:
compatible:
const: samsung,s6d16d0
reg:
maxItems: 1
port: true
reg: true
reset-gpios: true
vdd1-supply:
......
......@@ -20,7 +20,8 @@ properties:
compatible:
const: samsung,s6d27a1
reg: true
reg:
maxItems: 1
interrupts:
description: provides an optional ESD (electrostatic discharge)
......
......@@ -24,7 +24,8 @@ properties:
- samsung,ltl101at01
- const: samsung,s6d7aa0
reg: true
reg:
maxItems: 1
backlight:
description:
......
......@@ -18,7 +18,9 @@ properties:
compatible:
const: samsung,s6e63m0
reg: true
reg:
maxItems: 1
reset-gpios: true
port: true
default-brightness: true
......
......@@ -15,7 +15,10 @@ allOf:
properties:
compatible:
const: samsung,s6e88a0-ams452ef01
reg: true
reg:
maxItems: 1
port: true
reset-gpios: true
vdd3-supply:
......
......@@ -16,7 +16,9 @@ properties:
compatible:
const: samsung,s6e8aa0
reg: true
reg:
maxItems: 1
reset-gpios: true
display-timings: true
......
......@@ -37,7 +37,9 @@ properties:
- enum:
- sharp,lq101r1sx01
reg: true
reg:
maxItems: 1
power-supply: true
backlight: true
......
......@@ -16,7 +16,9 @@ properties:
compatible:
const: sharp,ls043t1le01-qhd
reg: true
reg:
maxItems: 1
backlight: true
reset-gpios: true
port: true
......
......@@ -16,7 +16,9 @@ properties:
compatible:
const: sharp,ls060t1sx01
reg: true
reg:
maxItems: 1
backlight: true
reset-gpios: true
port: true
......
......@@ -21,7 +21,9 @@ properties:
- jasonic,jt240mhqs-hwt-ek-e3
- sitronix,st7789v
reg: true
reg:
maxItems: 1
reset-gpios: true
power-supply: true
backlight: true
......
......@@ -22,7 +22,10 @@ properties:
enum:
- sony,acx424akp
- sony,acx424akm
reg: true
reg:
maxItems: 1
reset-gpios: true
vddi-supply:
description: regulator that supplies the vddi voltage
......
......@@ -17,6 +17,9 @@ properties:
compatible:
const: sony,acx565akm
reg:
maxItems: 1
label: true
reset-gpios: true
port: true
......
......@@ -20,7 +20,8 @@ properties:
compatible:
const: sony,td4353-jdi-tama
reg: true
reg:
maxItems: 1
backlight: true
width-mm: true
......
......@@ -21,7 +21,8 @@ properties:
compatible:
const: sony,tulip-truly-nt35521
reg: true
reg:
maxItems: 1
positive5-supply:
description: Positive 5V supply
......
......@@ -19,15 +19,17 @@ properties:
- sharp,ls068b3sx02
- const: syna,r63353
reg:
maxItems: 1
avdd-supply: true
dvdd-supply: true
reg: true
required:
- compatible
- reg
- avdd-supply
- dvdd-supply
- reg
- reset-gpios
- port
- backlight
......
......@@ -22,7 +22,9 @@ properties:
# Toppoly TD043MTEA1 Panel
- tpo,td043mtea1
reg: true
reg:
maxItems: 1
label: true
reset-gpios: true
backlight: true
......
......@@ -52,7 +52,8 @@ properties:
- const: tpo,tpg110
- const: tpo,tpg110
reg: true
reg:
maxItems: 1
grestb-gpios:
maxItems: 1
......
......@@ -20,7 +20,8 @@ properties:
compatible:
const: visionox,rm69299-1080p-display
reg: true
reg:
maxItems: 1
vdda-supply:
description: |
......
......@@ -15,7 +15,10 @@ allOf:
properties:
compatible:
const: xinpeng,xpp055c272
reg: true
reg:
maxItems: 1
backlight: true
port: 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:
gpio-2: GPIO4
allOf:
- $ref: ../pinctrl/pincfg-node.yaml#
- $ref: /schemas/pinctrl/pincfg-node.yaml#
properties:
drive-open-drain: true
......
......@@ -25,12 +25,12 @@ properties:
- const: allwinner,sun6i-a31-sc-nmi
deprecated: true
- const: allwinner,sun7i-a20-sc-nmi
- items:
- const: allwinner,sun8i-v3s-nmi
- const: allwinner,sun9i-a80-nmi
- const: allwinner,sun9i-a80-nmi
- items:
- const: allwinner,sun50i-a100-nmi
- enum:
- allwinner,sun8i-v3s-nmi
- allwinner,sun50i-a100-nmi
- allwinner,sun50i-h616-nmi
- const: allwinner,sun9i-a80-nmi
reg:
......
......@@ -48,7 +48,7 @@ properties:
interrupt-controller: true
"#interrupt-cells":
$ref: "arm,gic.yaml#/properties/#interrupt-cells"
$ref: arm,gic.yaml#/properties/#interrupt-cells
required:
- reg
......
......@@ -39,6 +39,7 @@ properties:
- renesas,intc-ex-r8a779a0 # R-Car V3U
- renesas,intc-ex-r8a779f0 # R-Car S4-8
- renesas,intc-ex-r8a779g0 # R-Car V4H
- renesas,intc-ex-r8a779h0 # R-Car V4M
- const: renesas,irqc
'#interrupt-cells':
......
......@@ -44,7 +44,7 @@ patternProperties:
description:
Each vpu encoder or decoder correspond a MU, which used for communication
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]+$":
......
......@@ -48,8 +48,8 @@ patternProperties:
type: object
allOf:
- $ref: ../nvmem/nvmem.yaml#
- $ref: ../nvmem/nvmem-deprecated-cells.yaml#
- $ref: /schemas/nvmem/nvmem.yaml#
- $ref: /schemas/nvmem/nvmem-deprecated-cells.yaml#
unevaluatedProperties: false
......
......@@ -29,39 +29,39 @@ properties:
allowable by a module in the slot, in milli-Watts. Presently, modules can
be up to 1W, 1.5W or 2W.
"mod-def0-gpios":
mod-def0-gpios:
maxItems: 1
description:
GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) module
presence input gpio signal, active (module absent) high. Must not be
present for SFF modules
"los-gpios":
los-gpios:
maxItems: 1
description:
GPIO phandle and a specifier of the Receiver Loss of Signal Indication
input gpio signal, active (signal lost) high
"tx-fault-gpios":
tx-fault-gpios:
maxItems: 1
description:
GPIO phandle and a specifier of the Module Transmitter Fault input gpio
signal, active (fault condition) high
"tx-disable-gpios":
tx-disable-gpios:
maxItems: 1
description:
GPIO phandle and a specifier of the Transmitter Disable output gpio
signal, active (Tx disable) high
"rate-select0-gpios":
rate-select0-gpios:
maxItems: 1
description:
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
present for SFF modules
"rate-select1-gpios":
rate-select1-gpios:
maxItems: 1
description:
GPIO phandle and a specifier of the Tx Signaling Rate Select (AKA RS1)
......
......@@ -65,7 +65,8 @@ properties:
- const: msi
ranges:
maxItems: 1
minItems: 1
maxItems: 3
dma-ranges:
minItems: 1
......
......@@ -71,28 +71,6 @@ properties:
items:
- 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:
- $ref: qcom,pcie-common.yaml#
......
......@@ -48,13 +48,16 @@ properties:
interrupt-controller:
description: Interrupt controller node for handling legacy PCI interrupts.
type: object
additionalProperties: false
properties:
"#address-cells":
const: 0
"#interrupt-cells":
const: 1
"interrupt-controller": true
additionalProperties: false
interrupt-controller: true
required:
- reg
......
......@@ -84,7 +84,7 @@ properties:
"#interrupt-cells":
const: 1
"interrupt-controller": true
interrupt-controller: true
required:
- "#address-cells"
......
......@@ -59,14 +59,14 @@ patternProperties:
"#phy-cells":
const: 0
"brcm,enable-ssc":
brcm,enable-ssc:
$ref: /schemas/types.yaml#/definitions/flag
description: |
Use spread spectrum clocking (SSC) on this port
This property is not applicable for "brcm,iproc-ns2-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
description:
String that indicates the desired RX equalizer mode.
......@@ -75,7 +75,7 @@ patternProperties:
- auto
- manual
"brcm,rxaeq-value":
brcm,rxaeq-value:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
When 'brcm,rxaeq-mode' is set to "manual", provides the RX
......@@ -83,7 +83,7 @@ patternProperties:
minimum: 0
maximum: 63
"brcm,tx-amplitude-millivolt":
brcm,tx-amplitude-millivolt:
description: |
Transmit amplitude voltage in millivolt.
$ref: /schemas/types.yaml#/definitions/uint32
......
......@@ -24,7 +24,7 @@ properties:
type: object
properties:
"SW":
SW:
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
......
......@@ -23,7 +23,9 @@ properties:
oneOf:
- const: fsl,s32v234-linflexuart
- items:
- const: nxp,s32g2-linflexuart
- enum:
- nxp,s32g2-linflexuart
- nxp,s32g3-linflexuart
- const: fsl,s32v234-linflexuart
reg:
......
......@@ -365,9 +365,9 @@ allOf:
additionalProperties: false
dependencies:
"nvidia,suspend-mode": ["nvidia,core-pwr-off-time", "nvidia,cpu-pwr-off-time"]
"nvidia,core-pwr-off-time": ["nvidia,core-pwr-good-time"]
"nvidia,cpu-pwr-off-time": ["nvidia,cpu-pwr-good-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,cpu-pwr-off-time: ["nvidia,cpu-pwr-good-time"]
examples:
- |
......
......@@ -103,6 +103,7 @@ properties:
- renesas,r8a779a0-cmt0 # 32-bit CMT0 on R-Car V3U
- renesas,r8a779f0-cmt0 # 32-bit CMT0 on R-Car S4-8
- 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
- items:
......@@ -110,6 +111,7 @@ properties:
- renesas,r8a779a0-cmt1 # 48-bit CMT on R-Car V3U
- renesas,r8a779f0-cmt1 # 48-bit CMT on R-Car S4-8
- 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
reg:
......
......@@ -39,6 +39,7 @@ properties:
- renesas,tmu-r8a779a0 # R-Car V3U
- renesas,tmu-r8a779f0 # R-Car S4-8
- renesas,tmu-r8a779g0 # R-Car V4H
- renesas,tmu-r8a779h0 # R-Car V4M
- const: renesas,tmu
reg:
......
......@@ -33,13 +33,13 @@ properties:
reg:
maxItems: 1
'ibm,#dma-address-cells':
ibm,#dma-address-cells:
description:
number of cells that are used to encode the physical address field of
dma-window properties
$ref: /schemas/types.yaml#/definitions/uint32-array
'ibm,#dma-size-cells':
ibm,#dma-size-cells:
description:
number of cells that are used to encode the size field of
dma-window properties
......
......@@ -29,6 +29,7 @@ properties:
- mediatek,mt7623-xhci
- mediatek,mt7629-xhci
- mediatek,mt7986-xhci
- mediatek,mt7988-xhci
- mediatek,mt8173-xhci
- mediatek,mt8183-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,
* device that had registered logical PIO mapping, and the return code is
* 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 *),
const __be32 *in_addr, const char *rprop,
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;
__be32 addr[OF_MAX_ADDR_CELLS];
int na, ns, pna, pns;
u64 result = OF_BAD_ADDR;
pr_debug("** translation for device %pOF **\n", dev);
/* Increase refcount at current level */
of_node_get(dev);
*host = NULL;
/* Get parent & match bus type */
parent = get_parent(dev);
if (parent == NULL)
goto bail;
return OF_BAD_ADDR;
bus = of_match_bus(parent);
/* Count address cells & copy address locally */
bus->count_cells(dev, &na, &ns);
if (!OF_CHECK_COUNTS(na, ns)) {
pr_debug("Bad cell count for %pOF\n", dev);
goto bail;
return OF_BAD_ADDR;
}
memcpy(addr, in_addr, na * 4);
......@@ -533,8 +529,7 @@ static u64 __of_translate_address(struct device_node *dev,
/* If root, we have finished */
if (parent == NULL) {
pr_debug("reached root node\n");
result = of_read_number(addr, na);
break;
return of_read_number(addr, na);
}
/*
......@@ -543,11 +538,11 @@ static u64 __of_translate_address(struct device_node *dev,
*/
iorange = find_io_range_by_fwnode(&dev->fwnode);
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",
dev, result);
*host = of_node_get(dev);
break;
*host = no_free_ptr(dev);
return result;
}
/* Get new parent bus and counts */
......@@ -555,7 +550,7 @@ static u64 __of_translate_address(struct device_node *dev,
pbus->count_cells(dev, &pna, &pns);
if (!OF_CHECK_COUNTS(pna, pns)) {
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",
......@@ -563,7 +558,7 @@ static u64 __of_translate_address(struct device_node *dev,
/* Apply bus translation */
if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
break;
return OF_BAD_ADDR;
/* Complete the move up one level */
na = pna;
......@@ -572,11 +567,8 @@ static u64 __of_translate_address(struct device_node *dev,
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)
......@@ -654,19 +646,16 @@ EXPORT_SYMBOL(of_translate_dma_address);
const __be32 *of_translate_dma_region(struct device_node *dev, const __be32 *prop,
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;
int na, ns;
parent = __of_get_dma_parent(dev);
if (!parent)
return NULL;
na = of_bus_n_addr_cells(parent);
ns = of_bus_n_size_cells(parent);
of_node_put(parent);
address = of_translate_dma_address(dev, prop);
if (address == OF_BAD_ADDR)
return NULL;
......@@ -688,21 +677,19 @@ const __be32 *__of_get_address(struct device_node *dev, int index, int bar_no,
{
const __be32 *prop;
unsigned int psize;
struct device_node *parent;
struct device_node *parent __free(device_node) = of_get_parent(dev);
struct of_bus *bus;
int onesize, i, na, ns;
/* Get parent & match bus type */
parent = of_get_parent(dev);
if (parent == NULL)
return NULL;
/* match the parent's bus type */
bus = of_match_bus(parent);
if (strcmp(bus->name, "pci") && (bar_no >= 0)) {
of_node_put(parent);
if (strcmp(bus->name, "pci") && (bar_no >= 0))
return NULL;
}
bus->count_cells(dev, &na, &ns);
of_node_put(parent);
if (!OF_CHECK_ADDR_COUNT(na))
return NULL;
......@@ -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)
{
struct device_node *node = of_node_get(np);
struct device_node *node __free(device_node) = of_node_get(np);
const __be32 *ranges = NULL;
bool found_dma_ranges = false;
struct of_range_parser parser;
struct of_range range;
struct bus_dma_region *r;
int len, num_ranges = 0;
int ret = 0;
while (node) {
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)
break;
/* Once we find 'dma-ranges', then a missing one is an error */
if (found_dma_ranges && !ranges) {
ret = -ENODEV;
goto out;
}
if (found_dma_ranges && !ranges)
return -ENODEV;
found_dma_ranges = true;
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)
if (!node || !ranges) {
pr_debug("no dma-ranges found for node(%pOF)\n", np);
ret = -ENODEV;
goto out;
return -ENODEV;
}
of_dma_range_parser_init(&parser, node);
for_each_of_range(&parser, &range) {
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)
num_ranges++;
}
if (!num_ranges) {
ret = -EINVAL;
goto out;
}
if (!num_ranges)
return -EINVAL;
r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL);
if (!r) {
ret = -ENOMEM;
goto out;
}
if (!r)
return -ENOMEM;
/*
* 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)
r->size = range.size;
r++;
}
out:
of_node_put(node);
return ret;
return 0;
}
#endif /* CONFIG_HAS_DMA */
......@@ -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)
{
struct device_node *node;
bool is_coherent = dma_default_coherent;
node = of_node_get(np);
struct device_node *node __free(device_node) = of_node_get(np);
while (node) {
if (of_property_read_bool(node, "dma-coherent")) {
is_coherent = true;
break;
}
if (of_property_read_bool(node, "dma-noncoherent")) {
is_coherent = false;
break;
}
if (of_property_read_bool(node, "dma-coherent"))
return true;
if (of_property_read_bool(node, "dma-noncoherent"))
return false;
node = of_get_next_dma_parent(node);
}
of_node_put(node);
return is_coherent;
return dma_default_coherent;
}
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)
{
struct device_node *parent;
bool nonposted;
if (!IS_ENABLED(CONFIG_ARCH_APPLE))
return false;
parent = of_get_parent(np);
struct device_node *parent __free(device_node) = of_get_parent(np);
if (!parent)
return false;
nonposted = of_property_read_bool(parent, "nonposted-mmio");
of_node_put(parent);
return nonposted;
return of_property_read_bool(parent, "nonposted-mmio");
}
static int __of_address_to_resource(struct device_node *dev, int index, int bar_no,
......
......@@ -16,6 +16,7 @@
#define pr_fmt(fmt) "OF: " fmt
#include <linux/cleanup.h>
#include <linux/console.h>
#include <linux/ctype.h>
#include <linux/cpu.h>
......@@ -1393,8 +1394,10 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
const char *stem_name,
int index, struct of_phandle_args *out_args)
{
char *cells_name, *map_name = NULL, *mask_name = NULL;
char *pass_name = NULL;
char *cells_name __free(kfree) = kasprintf(GFP_KERNEL, "#%s-cells", stem_name);
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;
const __be32 *map, *mask, *pass;
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,
if (index < 0)
return -EINVAL;
cells_name = kasprintf(GFP_KERNEL, "#%s-cells", stem_name);
if (!cells_name)
if (!cells_name || !map_name || !mask_name || !pass_name)
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,
out_args);
if (ret)
goto free;
return ret;
/* Get the #<list>-cells property */
cur = out_args->np;
......@@ -1444,8 +1433,7 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
/* Get the <list>-map property */
map = of_get_property(cur, map_name, &map_len);
if (!map) {
ret = 0;
goto free;
return 0;
}
map_len /= sizeof(u32);
......@@ -1521,12 +1509,6 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
put:
of_node_put(cur);
of_node_put(new);
free:
kfree(mask_name);
kfree(map_name);
kfree(cells_name);
kfree(pass_name);
return ret;
}
EXPORT_SYMBOL(of_parse_phandle_with_args_map);
......
......@@ -9,6 +9,7 @@
#define pr_fmt(fmt) "OF: " fmt
#include <linux/cleanup.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/spinlock.h>
......@@ -306,15 +307,20 @@ int of_detach_node(struct device_node *np)
}
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)
{
struct property *prop, *next;
for (prop = prop_list; prop != NULL; prop = next) {
next = prop->next;
kfree(prop->name);
kfree(prop->value);
kfree(prop);
__of_prop_free(prop);
}
}
......@@ -427,9 +433,7 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
return new;
err_free:
kfree(new->name);
kfree(new->value);
kfree(new);
__of_prop_free(new);
return NULL;
}
......@@ -471,9 +475,7 @@ struct device_node *__of_node_dup(const struct device_node *np,
if (!new_pp)
goto err_prop;
if (__of_add_property(node, new_pp)) {
kfree(new_pp->name);
kfree(new_pp->value);
kfree(new_pp);
__of_prop_free(new_pp);
goto err_prop;
}
}
......@@ -933,11 +935,8 @@ static int of_changeset_add_prop_helper(struct of_changeset *ocs,
return -ENOMEM;
ret = of_changeset_add_property(ocs, np, new_pp);
if (ret) {
kfree(new_pp->name);
kfree(new_pp->value);
kfree(new_pp);
}
if (ret)
__of_prop_free(new_pp);
return ret;
}
......@@ -1033,10 +1032,9 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs,
const u32 *array, size_t sz)
{
struct property prop;
__be32 *val;
int i, ret;
__be32 *val __free(kfree) = kcalloc(sz, sizeof(__be32), GFP_KERNEL);
int i;
val = kcalloc(sz, sizeof(__be32), GFP_KERNEL);
if (!val)
return -ENOMEM;
......@@ -1046,9 +1044,6 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs,
prop.length = sizeof(u32) * sz;
prop.value = (void *)val;
ret = of_changeset_add_prop_helper(ocs, np, &prop);
kfree(val);
return ret;
return of_changeset_add_prop_helper(ocs, np, &prop);
}
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)
csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T',
of_node_get_device_type(np));
tsize = csize;
if (csize >= len)
csize = len > 0 ? len - 1 : 0;
len -= csize;
if (str)
str += csize;
str += csize;
of_property_for_each_string(np, "compatible", p, compat) {
csize = strlen(compat) + 1;
tsize += csize;
if (csize > len)
if (csize >= len)
continue;
csize = snprintf(str, len, "C%s", compat);
......
......@@ -123,6 +123,7 @@ extern void *__unflatten_device_tree(const void *blob,
* own the devtree lock or work on detached trees only.
*/
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,
const char *full_name);
......
......@@ -437,17 +437,10 @@ void __init fdt_init_reserved_mem(void)
for (i = 0; i < reserved_mem_count; i++) {
struct reserved_mem *rmem = &reserved_mem[i];
unsigned long node = rmem->fdt_node;
int len;
const __be32 *prop;
int err = 0;
bool nomap;
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)
err = __reserved_mem_alloc_size(node, rmem->name,
......@@ -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 device *dev;
struct reserved_mem *rmem;
......@@ -534,7 +514,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
return 0;
}
rmem = __find_rmem(target);
rmem = of_reserved_mem_lookup(target);
of_node_put(target);
if (!rmem || !rmem->ops || !rmem->ops->device_init)
......
......@@ -262,9 +262,7 @@ static struct property *dup_and_fixup_symbol_prop(
return new_prop;
err_free_new_prop:
kfree(new_prop->name);
kfree(new_prop->value);
kfree(new_prop);
__of_prop_free(new_prop);
err_free_target_path:
kfree(target_path);
......@@ -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",
target->np, new_prop->name);
if (ret) {
kfree(new_prop->name);
kfree(new_prop->value);
kfree(new_prop);
}
if (ret)
__of_prop_free(new_prop);
return ret;
}
......
......@@ -40,15 +40,12 @@
*/
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)
node = ports;
port = of_get_child_by_name(node, "port");
of_node_put(ports);
of_node_put(port);
struct device_node *port __free(device_node) = of_get_child_by_name(node, "port");
return !!port;
}
......@@ -579,7 +576,8 @@ EXPORT_SYMBOL_GPL(of_prop_next_string);
int of_graph_parse_endpoint(const struct device_node *node,
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",
__func__, 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(node, "reg", &endpoint->id);
of_node_put(port_node);
return 0;
}
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 *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)
parent = node;
for_each_child_of_node(parent, port) {
for_each_child_of_node_scoped(parent, port) {
u32 port_id = 0;
if (!of_node_name_eq(port, "port"))
continue;
of_property_read_u32(port, "reg", &port_id);
if (id == port_id)
break;
return_ptr(port);
}
of_node_put(node);
return port;
return NULL;
}
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,
* parent port node.
*/
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)
parent = node;
port = of_get_child_by_name(parent, "port");
of_node_put(node);
if (!port) {
pr_debug("graph: no port node found in %pOF\n", parent);
return NULL;
......@@ -1052,15 +1043,13 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint)
{
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;
of_property_read_u32(port_node, "reg", &endpoint->port);
of_property_read_u32(node, "reg", &endpoint->id);
of_node_put(port_node);
return 0;
}
......@@ -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(access_controllers, "access-controllers", "#access-controller-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(gpio, "-gpio", "#gpio-cells")
......@@ -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;
}
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,
const char *prop_name,
int index)
......@@ -1360,8 +1401,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_panel, },
{ .parse_prop = parse_msi_parent, },
{ .parse_prop = parse_pses, },
{ .parse_prop = parse_power_supplies, },
{ .parse_prop = parse_gpio_compat, },
{ .parse_prop = parse_interrupts, },
{ .parse_prop = parse_interrupt_map, },
{ .parse_prop = parse_access_controllers, },
{ .parse_prop = parse_regulators, },
{ .parse_prop = parse_gpio, },
......
......@@ -8,6 +8,7 @@
#define pr_fmt(fmt) "OF: resolver: " fmt
#include <linux/cleanup.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
......@@ -74,11 +75,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
{
struct device_node *refnode;
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 err = 0;
value = kmemdup(prop_fixup->value, prop_fixup->length, GFP_KERNEL);
if (!value)
return -ENOMEM;
......@@ -89,23 +90,19 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
node_path = cur;
s = strchr(cur, ':');
if (!s) {
err = -EINVAL;
goto err_fail;
}
if (!s)
return -EINVAL;
*s++ = '\0';
prop_name = s;
s = strchr(s, ':');
if (!s) {
err = -EINVAL;
goto err_fail;
}
if (!s)
return -EINVAL;
*s++ = '\0';
err = kstrtoint(s, 10, &offset);
if (err)
goto err_fail;
return err;
refnode = __of_find_node_by_full_path(of_node_get(overlay), node_path);
if (!refnode)
......@@ -117,22 +114,16 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
}
of_node_put(refnode);
if (!prop) {
err = -ENOENT;
goto err_fail;
}
if (!prop)
return -ENOENT;
if (offset < 0 || offset + sizeof(__be32) > prop->length) {
err = -EINVAL;
goto err_fail;
}
if (offset < 0 || offset + sizeof(__be32) > prop->length)
return -EINVAL;
*(__be32 *)(prop->value + offset) = cpu_to_be32(phandle);
}
err_fail:
kfree(value);
return err;
return 0;
}
/* compare nodes taking into account that 'name' strips out the @ part */
......
......@@ -795,15 +795,11 @@ static void __init of_unittest_property_copy(void)
new = __of_prop_dup(&p1, GFP_KERNEL);
unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n");
kfree(new->value);
kfree(new->name);
kfree(new);
__of_prop_free(new);
new = __of_prop_dup(&p2, GFP_KERNEL);
unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n");
kfree(new->value);
kfree(new->name);
kfree(new);
__of_prop_free(new);
#endif
}
......@@ -3718,9 +3714,7 @@ static __init void of_unittest_overlay_high_level(void)
goto err_unlock;
}
if (__of_add_property(of_symbols, new_prop)) {
kfree(new_prop->name);
kfree(new_prop->value);
kfree(new_prop);
__of_prop_free(new_prop);
/* "name" auto-generated by unflatten */
if (!strcmp(prop->name, "name"))
continue;
......
......@@ -11,7 +11,6 @@ struct reserved_mem_ops;
struct reserved_mem {
const char *name;
unsigned long fdt_node;
unsigned long phandle;
const struct reserved_mem_ops *ops;
phys_addr_t base;
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