Commit 8c947645 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull devicetree fixes from Rob Herring:

 - Cleanups on properties with standard unit suffixes

 - Fix overwriting dma_range_map if there's no 'dma-ranges' property

 - Fix a bug when creating a /chosen node from ARM ATAGs

 - Add missing properties for TI j721e USB binding

 - Several doc reference updates due to DT schema conversions

* tag 'devicetree-fixes-for-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: Cleanup standard unit properties
  of/device: Update dma_range_map only when dev has valid dma-ranges
  ARM: zImage: atags_to_fdt: Fix node names on added root nodes
  dt-bindings: usb: j721e: add ranges and dma-coherent props
  dt-bindings:iio:adc: update adc.yaml reference
  dt-bindings: memory: mediatek: update mediatek,smi-larb.yaml references
  dt-bindings: display: mediatek: update mediatek,dpi.yaml reference
  ASoC: audio-graph-card: update audio-graph-card.yaml reference
parents 3bf25531 32ada6b0
...@@ -232,7 +232,6 @@ properties: ...@@ -232,7 +232,6 @@ properties:
by this cpu (see ./idle-states.yaml). by this cpu (see ./idle-states.yaml).
capacity-dmips-mhz: capacity-dmips-mhz:
$ref: '/schemas/types.yaml#/definitions/uint32'
description: description:
u32 value representing CPU capacity (see ./cpu-capacity.txt) in u32 value representing CPU capacity (see ./cpu-capacity.txt) in
DMIPS/MHz, relative to highest capacity-dmips-mhz DMIPS/MHz, relative to highest capacity-dmips-mhz
......
...@@ -40,7 +40,7 @@ Optional properties: ...@@ -40,7 +40,7 @@ Optional properties:
documents on how to describe the way the sii902x device is documents on how to describe the way the sii902x device is
connected to the rest of the audio system: connected to the rest of the audio system:
Documentation/devicetree/bindings/sound/simple-card.yaml Documentation/devicetree/bindings/sound/simple-card.yaml
Documentation/devicetree/bindings/sound/audio-graph-card.txt Documentation/devicetree/bindings/sound/audio-graph-card.yaml
Note: In case of the audio-graph-card binding the used port Note: In case of the audio-graph-card binding the used port
index should be 3. index should be 3.
......
...@@ -23,7 +23,7 @@ connected to. ...@@ -23,7 +23,7 @@ connected to.
For a description of the display interface sink function blocks, see For a description of the display interface sink function blocks, see
Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt and Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt and
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt. Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml.
Required properties (all function blocks): Required properties (all function blocks):
- compatible: "mediatek,<chip>-disp-<function>", one of - compatible: "mediatek,<chip>-disp-<function>", one of
...@@ -61,7 +61,7 @@ Required properties (DMA function blocks): ...@@ -61,7 +61,7 @@ Required properties (DMA function blocks):
"mediatek,<chip>-disp-wdma" "mediatek,<chip>-disp-wdma"
the supported chips are mt2701, mt8167 and mt8173. the supported chips are mt2701, mt8167 and mt8173.
- larb: Should contain a phandle pointing to the local arbiter device as defined - larb: Should contain a phandle pointing to the local arbiter device as defined
in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
- iommus: Should point to the respective IOMMU block with master port as - iommus: Should point to the respective IOMMU block with master port as
argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
for details. for details.
......
...@@ -85,7 +85,6 @@ properties: ...@@ -85,7 +85,6 @@ properties:
wlf,micd-timeout-ms: wlf,micd-timeout-ms:
description: description:
Timeout for microphone detection, specified in milliseconds. Timeout for microphone detection, specified in milliseconds.
$ref: "/schemas/types.yaml#/definitions/uint32"
wlf,micd-force-micbias: wlf,micd-force-micbias:
description: description:
......
...@@ -49,7 +49,6 @@ properties: ...@@ -49,7 +49,6 @@ properties:
description: description:
This property controls the Accumulation Dead band which allows to set the This property controls the Accumulation Dead band which allows to set the
level of current below which no accumulation takes place. level of current below which no accumulation takes place.
$ref: /schemas/types.yaml#/definitions/uint32
maximum: 255 maximum: 255
default: 0 default: 0
......
...@@ -73,11 +73,9 @@ properties: ...@@ -73,11 +73,9 @@ properties:
description: | description: |
Temperature sensor trimming factor. It can be used to manually adjust the Temperature sensor trimming factor. It can be used to manually adjust the
temperature measurements within 7.130 degrees Celsius. temperature measurements within 7.130 degrees Celsius.
maxItems: 1 default: 0
items: minimum: 0
default: 0 maximum: 7130
minimum: 0
maximum: 7130
additionalProperties: false additionalProperties: false
......
...@@ -52,7 +52,6 @@ properties: ...@@ -52,7 +52,6 @@ properties:
ti,bus-range-microvolt: ti,bus-range-microvolt:
description: | description: |
This is the operating range of the bus voltage in microvolt This is the operating range of the bus voltage in microvolt
$ref: /schemas/types.yaml#/definitions/uint32
enum: [16000000, 32000000] enum: [16000000, 32000000]
default: 32000000 default: 32000000
......
...@@ -39,11 +39,9 @@ properties: ...@@ -39,11 +39,9 @@ properties:
i2c-gpio,delay-us: i2c-gpio,delay-us:
description: delay between GPIO operations (may depend on each platform) description: delay between GPIO operations (may depend on each platform)
$ref: /schemas/types.yaml#/definitions/uint32
i2c-gpio,timeout-ms: i2c-gpio,timeout-ms:
description: timeout to get data description: timeout to get data
$ref: /schemas/types.yaml#/definitions/uint32
# Deprecated properties, do not use in new device tree sources: # Deprecated properties, do not use in new device tree sources:
gpios: gpios:
......
...@@ -66,21 +66,18 @@ properties: ...@@ -66,21 +66,18 @@ properties:
default: 400000 default: 400000
i2c-sda-hold-time-ns: i2c-sda-hold-time-ns:
maxItems: 1
description: | description: |
The property should contain the SDA hold time in nanoseconds. This option The property should contain the SDA hold time in nanoseconds. This option
is only supported in hardware blocks version 1.11a or newer or on is only supported in hardware blocks version 1.11a or newer or on
Microsemi SoCs. Microsemi SoCs.
i2c-scl-falling-time-ns: i2c-scl-falling-time-ns:
maxItems: 1
description: | description: |
The property should contain the SCL falling time in nanoseconds. The property should contain the SCL falling time in nanoseconds.
This value is used to compute the tLOW period. This value is used to compute the tLOW period.
default: 300 default: 300
i2c-sda-falling-time-ns: i2c-sda-falling-time-ns:
maxItems: 1
description: | description: |
The property should contain the SDA falling time in nanoseconds. The property should contain the SDA falling time in nanoseconds.
This value is used to compute the tHIGH period. This value is used to compute the tHIGH period.
......
...@@ -80,7 +80,7 @@ properties: ...@@ -80,7 +80,7 @@ properties:
type: boolean type: boolean
bipolar: bipolar:
description: see Documentation/devicetree/bindings/iio/adc/adc.txt description: see Documentation/devicetree/bindings/iio/adc/adc.yaml
type: boolean type: boolean
required: required:
......
...@@ -23,7 +23,6 @@ properties: ...@@ -23,7 +23,6 @@ properties:
maxItems: 1 maxItems: 1
shunt-resistor-micro-ohms: shunt-resistor-micro-ohms:
$ref: /schemas/types.yaml#/definitions/uint32
description: | description: |
Value in micro Ohms of the shunt resistor connected between the RS+ and Value in micro Ohms of the shunt resistor connected between the RS+ and
RS- inputs, across which the current is measured. Value needed to compute RS- inputs, across which the current is measured. Value needed to compute
......
...@@ -246,7 +246,6 @@ patternProperties: ...@@ -246,7 +246,6 @@ patternProperties:
Resolution (bits) to use for conversions: Resolution (bits) to use for conversions:
- can be 6, 8, 10 or 12 on stm32f4 - can be 6, 8, 10 or 12 on stm32f4
- can be 8, 10, 12, 14 or 16 on stm32h7 and stm32mp1 - can be 8, 10, 12, 14 or 16 on stm32h7 and stm32mp1
$ref: /schemas/types.yaml#/definitions/uint32
st,adc-channels: st,adc-channels:
description: | description: |
......
...@@ -42,7 +42,6 @@ properties: ...@@ -42,7 +42,6 @@ properties:
const: 1 const: 1
ti,channel0-current-microamp: ti,channel0-current-microamp:
$ref: /schemas/types.yaml#/definitions/uint32
description: Channel 0 current in uA. description: Channel 0 current in uA.
enum: enum:
- 0 - 0
...@@ -51,7 +50,6 @@ properties: ...@@ -51,7 +50,6 @@ properties:
- 20 - 20
ti,channel3-current-microamp: ti,channel3-current-microamp:
$ref: /schemas/types.yaml#/definitions/uint32
description: Channel 3 current in uA. description: Channel 3 current in uA.
enum: enum:
- 0 - 0
......
...@@ -46,31 +46,42 @@ properties: ...@@ -46,31 +46,42 @@ properties:
two properties must be present: two properties must be present:
adi,range-microvolt: adi,range-microvolt:
$ref: /schemas/types.yaml#/definitions/int32-array
description: | description: |
Voltage output range specified as <minimum, maximum> Voltage output range specified as <minimum, maximum>
enum: oneOf:
- [[0, 5000000]] - items:
- [[0, 10000000]] - const: 0
- [[-5000000, 5000000]] - enum: [5000000, 10000000]
- [[-10000000, 10000000]] - items:
- const: -5000000
- const: 5000000
- items:
- const: -10000000
- const: 10000000
adi,range-microamp: adi,range-microamp:
$ref: /schemas/types.yaml#/definitions/int32-array
description: | description: |
Current output range specified as <minimum, maximum> Current output range specified as <minimum, maximum>
enum: oneOf:
- [[0, 20000]] - items:
- [[0, 24000]] - const: 0
- [[4, 24000]] - enum: [20000, 24000]
- [[-20000, 20000]] - items:
- [[-24000, 24000]] - const: 4
- [[-1000, 22000]] - const: 24000
- items:
- const: -20000
- const: 20000
- items:
- const: -24000
- const: 24000
- items:
- const: -1000
- const: 22000
reset-gpios: true reset-gpios: true
adi,dc-dc-ilim-microamp: adi,dc-dc-ilim-microamp:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [150000, 200000, 250000, 300000, 350000, 400000] enum: [150000, 200000, 250000, 300000, 350000, 400000]
description: | description: |
The dc-to-dc converter current limit. The dc-to-dc converter current limit.
......
...@@ -21,7 +21,6 @@ properties: ...@@ -21,7 +21,6 @@ properties:
description: Connected to ADC_RDY pin. description: Connected to ADC_RDY pin.
maxim,led-current-microamp: maxim,led-current-microamp:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 2 minItems: 2
maxItems: 2 maxItems: 2
description: | description: |
......
...@@ -70,11 +70,9 @@ properties: ...@@ -70,11 +70,9 @@ properties:
touchscreen-x-mm: touchscreen-x-mm:
description: horizontal length in mm of the touchscreen description: horizontal length in mm of the touchscreen
$ref: /schemas/types.yaml#/definitions/uint32
touchscreen-y-mm: touchscreen-y-mm:
description: vertical length in mm of the touchscreen description: vertical length in mm of the touchscreen
$ref: /schemas/types.yaml#/definitions/uint32
dependencies: dependencies:
touchscreen-size-x: [ touchscreen-size-y ] touchscreen-size-x: [ touchscreen-size-y ]
......
...@@ -16,7 +16,7 @@ Required properties: ...@@ -16,7 +16,7 @@ Required properties:
- power-domains: a phandle to the power domain, see - power-domains: a phandle to the power domain, see
Documentation/devicetree/bindings/power/power_domain.txt for details. Documentation/devicetree/bindings/power/power_domain.txt for details.
- mediatek,larb: must contain the local arbiters in the current Socs, see - mediatek,larb: must contain the local arbiters in the current Socs, see
Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
for details. for details.
- iommus: should point to the respective IOMMU block with master port as - iommus: should point to the respective IOMMU block with master port as
argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
......
...@@ -14,7 +14,7 @@ Required properties: ...@@ -14,7 +14,7 @@ Required properties:
- power-domains: a phandle to the power domain, see - power-domains: a phandle to the power domain, see
Documentation/devicetree/bindings/power/power_domain.txt for details. Documentation/devicetree/bindings/power/power_domain.txt for details.
- mediatek,larb: must contain the local arbiters in the current SoCs, see - mediatek,larb: must contain the local arbiters in the current SoCs, see
Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
for details. for details.
- iommus: should point to the respective IOMMU block with master port as - iommus: should point to the respective IOMMU block with master port as
argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
......
...@@ -28,7 +28,7 @@ Required properties (DMA function blocks, child node): ...@@ -28,7 +28,7 @@ Required properties (DMA function blocks, child node):
argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
for details. for details.
- mediatek,larb: must contain the local arbiters in the current Socs, see - mediatek,larb: must contain the local arbiters in the current Socs, see
Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
for details. for details.
Example: Example:
......
...@@ -259,7 +259,6 @@ properties: ...@@ -259,7 +259,6 @@ properties:
waiting for I/O signalling and card power supply to be stable, waiting for I/O signalling and card power supply to be stable,
regardless of whether pwrseq-simple is used. Default to 10ms if regardless of whether pwrseq-simple is used. Default to 10ms if
no available. no available.
$ref: /schemas/types.yaml#/definitions/uint32
default: 10 default: 10
supports-cqe: supports-cqe:
......
...@@ -41,13 +41,11 @@ properties: ...@@ -41,13 +41,11 @@ properties:
description: description:
Delay in ms after powering the card and de-asserting the Delay in ms after powering the card and de-asserting the
reset-gpios (if any). reset-gpios (if any).
$ref: /schemas/types.yaml#/definitions/uint32
power-off-delay-us: power-off-delay-us:
description: description:
Delay in us after asserting the reset-gpios (if any) Delay in us after asserting the reset-gpios (if any)
during power off of the card. during power off of the card.
$ref: /schemas/types.yaml#/definitions/uint32
required: required:
- compatible - compatible
......
...@@ -122,7 +122,6 @@ properties: ...@@ -122,7 +122,6 @@ properties:
such as flow control thresholds. such as flow control thresholds.
rx-internal-delay-ps: rx-internal-delay-ps:
$ref: /schemas/types.yaml#/definitions/uint32
description: | description: |
RGMII Receive Clock Delay defined in pico seconds. RGMII Receive Clock Delay defined in pico seconds.
This is used for controllers that have configurable RX internal delays. This is used for controllers that have configurable RX internal delays.
...@@ -140,7 +139,6 @@ properties: ...@@ -140,7 +139,6 @@ properties:
is used for components that can have configurable fifo sizes. is used for components that can have configurable fifo sizes.
tx-internal-delay-ps: tx-internal-delay-ps:
$ref: /schemas/types.yaml#/definitions/uint32
description: | description: |
RGMII Transmit Clock Delay defined in pico seconds. RGMII Transmit Clock Delay defined in pico seconds.
This is used for controllers that have configurable TX internal delays. This is used for controllers that have configurable TX internal delays.
......
...@@ -212,7 +212,6 @@ properties: ...@@ -212,7 +212,6 @@ properties:
Triplet of delays. The 1st cell is reset pre-delay in micro Triplet of delays. The 1st cell is reset pre-delay in micro
seconds. The 2nd cell is reset pulse in micro seconds. The 3rd seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
cell is reset post-delay in micro seconds. cell is reset post-delay in micro seconds.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 3 minItems: 3
maxItems: 3 maxItems: 3
......
...@@ -83,21 +83,18 @@ properties: ...@@ -83,21 +83,18 @@ properties:
for each of the battery capacity lookup table. for each of the battery capacity lookup table.
operating-range-celsius: operating-range-celsius:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: operating temperature range of a battery description: operating temperature range of a battery
items: items:
- description: minimum temperature at which battery can operate - description: minimum temperature at which battery can operate
- description: maximum temperature at which battery can operate - description: maximum temperature at which battery can operate
ambient-celsius: ambient-celsius:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: safe range of ambient temperature description: safe range of ambient temperature
items: items:
- description: alert when ambient temperature is lower than this value - description: alert when ambient temperature is lower than this value
- description: alert when ambient temperature is higher than this value - description: alert when ambient temperature is higher than this value
alert-celsius: alert-celsius:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: safe range of battery temperature description: safe range of battery temperature
items: items:
- description: alert when battery temperature is lower than this value - description: alert when battery temperature is lower than this value
......
...@@ -50,7 +50,6 @@ properties: ...@@ -50,7 +50,6 @@ properties:
maxItems: 1 maxItems: 1
input-current-limit-microamp: input-current-limit-microamp:
$ref: /schemas/types.yaml#/definitions/uint32
description: Maximum input current in micro Amps. description: Maximum input current in micro Amps.
minimum: 50000 minimum: 50000
maximum: 500000 maximum: 500000
......
...@@ -62,7 +62,6 @@ properties: ...@@ -62,7 +62,6 @@ properties:
description: IRQ line information. description: IRQ line information.
dlg,irq-polling-delay-passive-ms: dlg,irq-polling-delay-passive-ms:
$ref: "/schemas/types.yaml#/definitions/uint32"
minimum: 1000 minimum: 1000
maximum: 10000 maximum: 10000
description: | description: |
......
...@@ -72,11 +72,9 @@ properties: ...@@ -72,11 +72,9 @@ properties:
startup-delay-us: startup-delay-us:
description: startup time in microseconds description: startup time in microseconds
$ref: /schemas/types.yaml#/definitions/uint32
off-on-delay-us: off-on-delay-us:
description: off delay time in microseconds description: off delay time in microseconds
$ref: /schemas/types.yaml#/definitions/uint32
enable-active-high: enable-active-high:
description: description:
......
...@@ -27,7 +27,6 @@ properties: ...@@ -27,7 +27,6 @@ properties:
1: chargeable 1: chargeable
quartz-load-femtofarads: quartz-load-femtofarads:
$ref: /schemas/types.yaml#/definitions/uint32
description: description:
The capacitive load of the quartz(x-tal), expressed in femto The capacitive load of the quartz(x-tal), expressed in femto
Farad (fF). The default value shall be listed (if optional), Farad (fF). The default value shall be listed (if optional),
...@@ -47,7 +46,6 @@ properties: ...@@ -47,7 +46,6 @@ properties:
deprecated: true deprecated: true
trickle-resistor-ohms: trickle-resistor-ohms:
$ref: /schemas/types.yaml#/definitions/uint32
description: description:
Selected resistor for trickle charger. Should be given Selected resistor for trickle charger. Should be given
if trickle charger should be enabled. if trickle charger should be enabled.
......
...@@ -88,14 +88,12 @@ properties: ...@@ -88,14 +88,12 @@ properties:
description: description:
Rate at which poll occurs when auto-poll is set. Rate at which poll occurs when auto-poll is set.
default 100ms. default 100ms.
$ref: /schemas/types.yaml#/definitions/uint32
default: 100 default: 100
poll-timeout-ms: poll-timeout-ms:
description: description:
Poll timeout when auto-poll is set, default Poll timeout when auto-poll is set, default
3000ms. 3000ms.
$ref: /schemas/types.yaml#/definitions/uint32
default: 3000 default: 3000
required: required:
......
...@@ -41,14 +41,12 @@ properties: ...@@ -41,14 +41,12 @@ properties:
values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not
mentioned or if the value is unknown, then micbias resistor is set to mentioned or if the value is unknown, then micbias resistor is set to
4k. 4k.
$ref: "/schemas/types.yaml#/definitions/uint32"
enum: [ 0, 2, 4, 8 ] enum: [ 0, 2, 4, 8 ]
micbias-voltage-m-volts: micbias-voltage-m-volts:
description: The bias voltage to be used in mVolts. The voltage can take description: The bias voltage to be used in mVolts. The voltage can take
values from 1.25V to 3V by 250mV steps. If this node is not mentioned values from 1.25V to 3V by 250mV steps. If this node is not mentioned
or the value is unknown, then the value is set to 1.25V. or the value is unknown, then the value is set to 1.25V.
$ref: "/schemas/types.yaml#/definitions/uint32"
enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ] enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ]
lrclk-strength: lrclk-strength:
......
...@@ -21,6 +21,8 @@ properties: ...@@ -21,6 +21,8 @@ properties:
reg: reg:
description: module registers description: module registers
ranges: true
power-domains: power-domains:
description: description:
PM domain provider node and an args specifier containing PM domain provider node and an args specifier containing
...@@ -62,6 +64,8 @@ properties: ...@@ -62,6 +64,8 @@ properties:
'#size-cells': '#size-cells':
const: 2 const: 2
dma-coherent: true
patternProperties: patternProperties:
"^usb@": "^usb@":
type: object type: object
......
...@@ -19,7 +19,6 @@ properties: ...@@ -19,7 +19,6 @@ properties:
pattern: "^watchdog(@.*|-[0-9a-f])?$" pattern: "^watchdog(@.*|-[0-9a-f])?$"
timeout-sec: timeout-sec:
$ref: /schemas/types.yaml#/definitions/uint32
description: description:
Contains the watchdog timeout in seconds. Contains the watchdog timeout in seconds.
......
...@@ -15,7 +15,8 @@ static int node_offset(void *fdt, const char *node_path) ...@@ -15,7 +15,8 @@ static int node_offset(void *fdt, const char *node_path)
{ {
int offset = fdt_path_offset(fdt, node_path); int offset = fdt_path_offset(fdt, node_path);
if (offset == -FDT_ERR_NOTFOUND) if (offset == -FDT_ERR_NOTFOUND)
offset = fdt_add_subnode(fdt, 0, node_path); /* Add the node to root if not found, dropping the leading '/' */
offset = fdt_add_subnode(fdt, 0, node_path + 1);
return offset; return offset;
} }
......
...@@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, ...@@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
mask = DMA_BIT_MASK(ilog2(end) + 1); mask = DMA_BIT_MASK(ilog2(end) + 1);
dev->coherent_dma_mask &= mask; dev->coherent_dma_mask &= mask;
*dev->dma_mask &= mask; *dev->dma_mask &= mask;
/* ...but only set bus limit if we found valid dma-ranges earlier */ /* ...but only set bus limit and range map if we found valid dma-ranges earlier */
if (!ret) if (!ret) {
dev->bus_dma_limit = end; dev->bus_dma_limit = end;
dev->dma_range_map = map;
}
coherent = of_dma_is_coherent(np); coherent = of_dma_is_coherent(np);
dev_dbg(dev, "device is%sdma coherent\n", dev_dbg(dev, "device is%sdma coherent\n",
...@@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, ...@@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
iommu = of_iommu_configure(dev, np, id); iommu = of_iommu_configure(dev, np, id);
if (PTR_ERR(iommu) == -EPROBE_DEFER) { if (PTR_ERR(iommu) == -EPROBE_DEFER) {
/* Don't touch range map if it wasn't set from a valid dma-ranges */
if (!ret)
dev->dma_range_map = NULL;
kfree(map); kfree(map);
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
...@@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, ...@@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
arch_setup_dma_ops(dev, dma_start, size, iommu, coherent); arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
dev->dma_range_map = map;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(of_dma_configure_id); EXPORT_SYMBOL_GPL(of_dma_configure_id);
......
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