Commit 339e2fca authored by Linus Torvalds's avatar Linus Torvalds

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

Pull devicetree fixes from Rob Herring:

 - Improve devlink dependency parsing for DT graphs

 - Fix devlink handling of io-channels dependencies

 - Fix PCI addressing in marvell,prestera example

 - A few schema fixes for property constraints

 - Improve performance of DT unprobed devices kselftest

 - Fix regression in DT_SCHEMA_FILES handling

 - Fix compile error in unittest for !OF_DYNAMIC

* tag 'devicetree-fixes-for-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: ufs: samsung,exynos-ufs: Add size constraints on "samsung,sysreg"
  of: property: Add in-ports/out-ports support to of_graph_get_port_parent()
  of: property: Improve finding the supplier of a remote-endpoint property
  of: property: Improve finding the consumer of a remote-endpoint property
  net: marvell,prestera: Fix example PCI bus addressing
  of: unittest: Fix compile in the non-dynamic case
  of: property: fix typo in io-channels
  dt-bindings: tpm: Drop type from "resets"
  dt-bindings: display: nxp,tda998x: Fix 'audio-ports' constraints
  dt-bindings: xilinx: replace Piyush Mehta maintainership
  kselftest: dt: Stop relying on dirname to improve performance
  dt-bindings: don't anchor DT_SCHEMA_FILES to bindings directory
parents a00cf198 4e06ec07
...@@ -28,7 +28,10 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE ...@@ -28,7 +28,10 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
-name 'processed-schema*' \) -name 'processed-schema*' \)
find_cmd = $(find_all_cmd) | sed 's|^$(srctree)/$(src)/||' | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | sed 's|^|$(srctree)/$(src)/|' find_cmd = $(find_all_cmd) | \
sed 's|^$(srctree)/||' | \
grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | \
sed 's|^|$(srctree)/|'
CHK_DT_DOCS := $(shell $(find_cmd)) CHK_DT_DOCS := $(shell $(find_cmd))
quiet_cmd_yamllint = LINT $(src) quiet_cmd_yamllint = LINT $(src)
......
...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# ...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ceva AHCI SATA Controller title: Ceva AHCI SATA Controller
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com> - Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
description: | description: |
The Ceva SATA controller mostly conforms to the AHCI interface with some The Ceva SATA controller mostly conforms to the AHCI interface with some
......
...@@ -29,19 +29,22 @@ properties: ...@@ -29,19 +29,22 @@ properties:
audio-ports: audio-ports:
description: description:
Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst). Array of 2 values per DAI (Documentation/sound/soc/dai.rst).
The implementation allows one or two DAIs. The implementation allows one or two DAIs.
If two DAIs are defined, they must be of different type. If two DAIs are defined, they must be of different type.
$ref: /schemas/types.yaml#/definitions/uint32-matrix $ref: /schemas/types.yaml#/definitions/uint32-matrix
minItems: 1
maxItems: 2
items: items:
minItems: 1
items: items:
- description: | - description: |
The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S
(see include/dt-bindings/display/tda998x.h). (see include/dt-bindings/display/tda998x.h).
enum: [ 1, 2 ]
- description: - description:
The second value defines the tda998x AP_ENA reg content when the The second value defines the tda998x AP_ENA reg content when the
DAI in question is used. DAI in question is used.
maximum: 0xff
'#sound-dai-cells': '#sound-dai-cells':
enum: [ 0, 1 ] enum: [ 0, 1 ]
......
...@@ -12,7 +12,8 @@ description: ...@@ -12,7 +12,8 @@ description:
PS_MODE). Every pin can be configured as input/output. PS_MODE). Every pin can be configured as input/output.
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com> - Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties: properties:
compatible: compatible:
......
...@@ -78,8 +78,8 @@ examples: ...@@ -78,8 +78,8 @@ examples:
pcie@0 { pcie@0 {
#address-cells = <3>; #address-cells = <3>;
#size-cells = <2>; #size-cells = <2>;
ranges = <0x0 0x0 0x0 0x0 0x0 0x0>; ranges = <0x02000000 0x0 0x100000 0x10000000 0x0 0x0>;
reg = <0x0 0x0 0x0 0x0 0x0 0x0>; reg = <0x0 0x1000>;
device_type = "pci"; device_type = "pci";
switch@0,0 { switch@0,0 {
......
...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# ...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Zynq UltraScale+ MPSoC and Versal reset title: Zynq UltraScale+ MPSoC and Versal reset
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com> - Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
description: | description: |
The Zynq UltraScale+ MPSoC and Versal has several different resets. The Zynq UltraScale+ MPSoC and Versal has several different resets.
......
...@@ -42,7 +42,7 @@ properties: ...@@ -42,7 +42,7 @@ properties:
resets: resets:
description: Reset controller to reset the TPM description: Reset controller to reset the TPM
$ref: /schemas/types.yaml#/definitions/phandle maxItems: 1
reset-gpios: reset-gpios:
description: Output GPIO pin to reset the TPM description: Output GPIO pin to reset the TPM
......
...@@ -55,9 +55,12 @@ properties: ...@@ -55,9 +55,12 @@ properties:
samsung,sysreg: samsung,sysreg:
$ref: /schemas/types.yaml#/definitions/phandle-array $ref: /schemas/types.yaml#/definitions/phandle-array
description: Should be phandle/offset pair. The phandle to the syscon node items:
which indicates the FSYSx sysreg interface and the offset of - items:
the control register for UFS io coherency setting. - description: phandle to FSYSx sysreg node
- description: offset of the control register for UFS io coherency setting
description:
Phandle and offset to the FSYSx sysreg for UFS io coherency setting.
dma-coherent: true dma-coherent: true
......
...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# ...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Xilinx SuperSpeed DWC3 USB SoC controller title: Xilinx SuperSpeed DWC3 USB SoC controller
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com> - Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties: properties:
compatible: compatible:
......
...@@ -16,8 +16,9 @@ description: ...@@ -16,8 +16,9 @@ description:
USB 2.0 traffic. USB 2.0 traffic.
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Michal Simek <michal.simek@amd.com> - Michal Simek <michal.simek@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties: properties:
compatible: compatible:
......
...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# ...@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Xilinx udc controller title: Xilinx udc controller
maintainers: maintainers:
- Piyush Mehta <piyush.mehta@amd.com> - Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties: properties:
compatible: compatible:
......
...@@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node) ...@@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node)
/* Walk 3 levels up only if there is 'ports' node. */ /* Walk 3 levels up only if there is 'ports' node. */
for (depth = 3; depth && node; depth--) { for (depth = 3; depth && node; depth--) {
node = of_get_next_parent(node); node = of_get_next_parent(node);
if (depth == 2 && !of_node_name_eq(node, "ports")) if (depth == 2 && !of_node_name_eq(node, "ports") &&
!of_node_name_eq(node, "in-ports") &&
!of_node_name_eq(node, "out-ports"))
break; break;
} }
return node; return node;
...@@ -1063,36 +1065,6 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, ...@@ -1063,36 +1065,6 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
return of_device_get_match_data(dev); return of_device_get_match_data(dev);
} }
static struct device_node *of_get_compat_node(struct device_node *np)
{
of_node_get(np);
while (np) {
if (!of_device_is_available(np)) {
of_node_put(np);
np = NULL;
}
if (of_property_present(np, "compatible"))
break;
np = of_get_next_parent(np);
}
return np;
}
static struct device_node *of_get_compat_node_parent(struct device_node *np)
{
struct device_node *parent, *node;
parent = of_get_parent(np);
node = of_get_compat_node(parent);
of_node_put(parent);
return node;
}
static void of_link_to_phandle(struct device_node *con_np, static void of_link_to_phandle(struct device_node *con_np,
struct device_node *sup_np) struct device_node *sup_np)
{ {
...@@ -1222,10 +1194,10 @@ static struct device_node *parse_##fname(struct device_node *np, \ ...@@ -1222,10 +1194,10 @@ static struct device_node *parse_##fname(struct device_node *np, \
* parse_prop.prop_name: Name of property holding a phandle value * parse_prop.prop_name: Name of property holding a phandle value
* parse_prop.index: For properties holding a list of phandles, this is the * parse_prop.index: For properties holding a list of phandles, this is the
* index into the list * index into the list
* @get_con_dev: If the consumer node containing the property is never converted
* to a struct device, implement this ops so fw_devlink can use it
* to find the true consumer.
* @optional: Describes whether a supplier is mandatory or not * @optional: Describes whether a supplier is mandatory or not
* @node_not_dev: The consumer node containing the property is never converted
* to a struct device. Instead, parse ancestor nodes for the
* compatible property to find a node corresponding to a device.
* *
* Returns: * Returns:
* parse_prop() return values are * parse_prop() return values are
...@@ -1236,15 +1208,15 @@ static struct device_node *parse_##fname(struct device_node *np, \ ...@@ -1236,15 +1208,15 @@ static struct device_node *parse_##fname(struct device_node *np, \
struct supplier_bindings { struct supplier_bindings {
struct device_node *(*parse_prop)(struct device_node *np, struct device_node *(*parse_prop)(struct device_node *np,
const char *prop_name, int index); const char *prop_name, int index);
struct device_node *(*get_con_dev)(struct device_node *np);
bool optional; bool optional;
bool node_not_dev;
}; };
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells") DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells") DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells") DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells") DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL) DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL)
DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells") DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
...@@ -1262,7 +1234,6 @@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL) ...@@ -1262,7 +1234,6 @@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL)
DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
DEFINE_SIMPLE_PROP(leds, "leds", NULL) DEFINE_SIMPLE_PROP(leds, "leds", NULL)
...@@ -1328,6 +1299,17 @@ static struct device_node *parse_interrupts(struct device_node *np, ...@@ -1328,6 +1299,17 @@ 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_remote_endpoint(struct device_node *np,
const char *prop_name,
int index)
{
/* Return NULL for index > 0 to signify end of remote-endpoints. */
if (!index || strcmp(prop_name, "remote-endpoint"))
return NULL;
return of_graph_get_remote_port_parent(np);
}
static const struct supplier_bindings of_supplier_bindings[] = { static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_clocks, }, { .parse_prop = parse_clocks, },
{ .parse_prop = parse_interconnects, }, { .parse_prop = parse_interconnects, },
...@@ -1352,7 +1334,10 @@ static const struct supplier_bindings of_supplier_bindings[] = { ...@@ -1352,7 +1334,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_pinctrl6, }, { .parse_prop = parse_pinctrl6, },
{ .parse_prop = parse_pinctrl7, }, { .parse_prop = parse_pinctrl7, },
{ .parse_prop = parse_pinctrl8, }, { .parse_prop = parse_pinctrl8, },
{ .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, {
.parse_prop = parse_remote_endpoint,
.get_con_dev = of_graph_get_port_parent,
},
{ .parse_prop = parse_pwms, }, { .parse_prop = parse_pwms, },
{ .parse_prop = parse_resets, }, { .parse_prop = parse_resets, },
{ .parse_prop = parse_leds, }, { .parse_prop = parse_leds, },
...@@ -1403,8 +1388,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name) ...@@ -1403,8 +1388,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
while ((phandle = s->parse_prop(con_np, prop_name, i))) { while ((phandle = s->parse_prop(con_np, prop_name, i))) {
struct device_node *con_dev_np; struct device_node *con_dev_np;
con_dev_np = s->node_not_dev con_dev_np = s->get_con_dev
? of_get_compat_node_parent(con_np) ? s->get_con_dev(con_np)
: of_node_get(con_np); : of_node_get(con_np);
matched = true; matched = true;
i++; i++;
......
...@@ -50,6 +50,12 @@ static struct unittest_results { ...@@ -50,6 +50,12 @@ static struct unittest_results {
failed; \ failed; \
}) })
#ifdef CONFIG_OF_KOBJ
#define OF_KREF_READ(NODE) kref_read(&(NODE)->kobj.kref)
#else
#define OF_KREF_READ(NODE) 1
#endif
/* /*
* Expected message may have a message level other than KERN_INFO. * Expected message may have a message level other than KERN_INFO.
* Print the expected message only if the current loglevel will allow * Print the expected message only if the current loglevel will allow
...@@ -570,7 +576,7 @@ static void __init of_unittest_parse_phandle_with_args_map(void) ...@@ -570,7 +576,7 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
pr_err("missing testcase data\n"); pr_err("missing testcase data\n");
return; return;
} }
prefs[i] = kref_read(&p[i]->kobj.kref); prefs[i] = OF_KREF_READ(p[i]);
} }
rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
...@@ -693,9 +699,9 @@ static void __init of_unittest_parse_phandle_with_args_map(void) ...@@ -693,9 +699,9 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
for (i = 0; i < ARRAY_SIZE(p); ++i) { for (i = 0; i < ARRAY_SIZE(p); ++i) {
unittest(prefs[i] == kref_read(&p[i]->kobj.kref), unittest(prefs[i] == OF_KREF_READ(p[i]),
"provider%d: expected:%d got:%d\n", "provider%d: expected:%d got:%d\n",
i, prefs[i], kref_read(&p[i]->kobj.kref)); i, prefs[i], OF_KREF_READ(p[i]));
of_node_put(p[i]); of_node_put(p[i]);
} }
} }
......
...@@ -33,8 +33,8 @@ if [[ ! -d "${PDT}" ]]; then ...@@ -33,8 +33,8 @@ if [[ ! -d "${PDT}" ]]; then
fi fi
nodes_compatible=$( nodes_compatible=$(
for node_compat in $(find ${PDT} -name compatible); do for node in $(find ${PDT} -type d); do
node=$(dirname "${node_compat}") [ ! -f "${node}"/compatible ] && continue
# Check if node is available # Check if node is available
if [[ -e "${node}"/status ]]; then if [[ -e "${node}"/status ]]; then
status=$(tr -d '\000' < "${node}"/status) status=$(tr -d '\000' < "${node}"/status)
...@@ -46,10 +46,11 @@ nodes_compatible=$( ...@@ -46,10 +46,11 @@ nodes_compatible=$(
nodes_dev_bound=$( nodes_dev_bound=$(
IFS=$'\n' IFS=$'\n'
for uevent in $(find /sys/devices -name uevent); do for dev_dir in $(find /sys/devices -type d); do
if [[ -d "$(dirname "${uevent}")"/driver ]]; then [ ! -f "${dev_dir}"/uevent ] && continue
grep '^OF_FULLNAME=' "${uevent}" | sed -e 's|OF_FULLNAME=||' [ ! -d "${dev_dir}"/driver ] && continue
fi
grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||'
done done
) )
......
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