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
Unified · Split
| @@ -28,7 +28,10 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE · 27 unmodified lines | ||
| 28 | 28 | find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ |
| 29 | 29 | -name 'processed-schema*' \) |
| 30 | 30 | |
| 31 | −find_cmd = $(find_all_cmd) | sed 's|^$(srctree)/$(src)/||' | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | sed 's|^|$(srctree)/$(src)/|' | |
| 31 | +find_cmd = $(find_all_cmd) | \ | |
| 32 | + sed 's|^$(srctree)/||' | \ | |
| 33 | + grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | \ | |
| 34 | + sed 's|^|$(srctree)/|' | |
| 32 | 35 | CHK_DT_DOCS := $(shell $(find_cmd)) |
| 33 | 36 | |
| 34 | 37 | quiet_cmd_yamllint = LINT $(src) |
| @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Ceva AHCI SATA Controller |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 10 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 11 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 11 | 12 | |
| 12 | 13 | description: | |
| 13 | 14 | The Ceva SATA controller mostly conforms to the AHCI interface with some |
| @@ -29,19 +29,22 @@ properties: · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | audio-ports: |
| 31 | 31 | description: |
| 32 | − Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst). | |
| 32 | + Array of 2 values per DAI (Documentation/sound/soc/dai.rst). | |
| 33 | 33 | The implementation allows one or two DAIs. |
| 34 | 34 | If two DAIs are defined, they must be of different type. |
| 35 | 35 | $ref: /schemas/types.yaml#/definitions/uint32-matrix |
| 36 | + minItems: 1 | |
| 37 | + maxItems: 2 | |
| 36 | 38 | items: |
| 37 | − minItems: 1 | |
| 38 | 39 | items: |
| 39 | 40 | - description: | |
| 40 | 41 | The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S |
| 41 | 42 | (see include/dt-bindings/display/tda998x.h). |
| 43 | + enum: [ 1, 2 ] | |
| 42 | 44 | - description: |
| 43 | 45 | The second value defines the tda998x AP_ENA reg content when the |
| 44 | 46 | DAI in question is used. |
| 47 | + maximum: 0xff | |
| 45 | 48 | |
| 46 | 49 | '#sound-dai-cells': |
| 47 | 50 | enum: [ 0, 1 ] |
| @@ -12,7 +12,8 @@ description: · 11 unmodified lines | ||
| 12 | 12 | PS_MODE). Every pin can be configured as input/output. |
| 13 | 13 | |
| 14 | 14 | maintainers: |
| 15 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 15 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 16 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 16 | 17 | |
| 17 | 18 | properties: |
| 18 | 19 | compatible: |
| @@ -78,8 +78,8 @@ examples: · 77 unmodified lines | ||
| 78 | 78 | pcie@0 { |
| 79 | 79 | #address-cells = <3>; |
| 80 | 80 | #size-cells = <2>; |
| 81 | − ranges = <0x0 0x0 0x0 0x0 0x0 0x0>; | |
| 82 | − reg = <0x0 0x0 0x0 0x0 0x0 0x0>; | |
| 81 | + ranges = <0x02000000 0x0 0x100000 0x10000000 0x0 0x0>; | |
| 82 | + reg = <0x0 0x1000>; | |
| 83 | 83 | device_type = "pci"; |
| 84 | 84 | |
| 85 | 85 | switch@0,0 { |
| @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Zynq UltraScale+ MPSoC and Versal reset |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 10 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 11 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 11 | 12 | |
| 12 | 13 | description: | |
| 13 | 14 | The Zynq UltraScale+ MPSoC and Versal has several different resets. |
| @@ -42,7 +42,7 @@ properties: · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | resets: |
| 44 | 44 | description: Reset controller to reset the TPM |
| 45 | − $ref: /schemas/types.yaml#/definitions/phandle | |
| 45 | + maxItems: 1 | |
| 46 | 46 | |
| 47 | 47 | reset-gpios: |
| 48 | 48 | description: Output GPIO pin to reset the TPM |
| @@ -55,9 +55,12 @@ properties: · 54 unmodified lines | ||
| 55 | 55 | |
| 56 | 56 | samsung,sysreg: |
| 57 | 57 | $ref: /schemas/types.yaml#/definitions/phandle-array |
| 58 | − description: Should be phandle/offset pair. The phandle to the syscon node | |
| 59 | − which indicates the FSYSx sysreg interface and the offset of | |
| 60 | − the control register for UFS io coherency setting. | |
| 58 | + items: | |
| 59 | + - items: | |
| 60 | + - description: phandle to FSYSx sysreg node | |
| 61 | + - description: offset of the control register for UFS io coherency setting | |
| 62 | + description: | |
| 63 | + Phandle and offset to the FSYSx sysreg for UFS io coherency setting. | |
| 61 | 64 | |
| 62 | 65 | dma-coherent: true |
| 63 | 66 | |
| @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Xilinx SuperSpeed DWC3 USB SoC controller |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 10 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 11 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 11 | 12 | |
| 12 | 13 | properties: |
| 13 | 14 | compatible: |
| @@ -16,8 +16,9 @@ description: · 15 unmodified lines | ||
| 16 | 16 | USB 2.0 traffic. |
| 17 | 17 | |
| 18 | 18 | maintainers: |
| 19 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 20 | 19 | - Michal Simek <michal.simek@amd.com> |
| 20 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 21 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 21 | 22 | |
| 22 | 23 | properties: |
| 23 | 24 | compatible: |
| @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Xilinx udc controller |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Piyush Mehta <piyush.mehta@amd.com> | |
| 10 | + - Mubin Sayyed <mubin.sayyed@amd.com> | |
| 11 | + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> | |
| 11 | 12 | |
| 12 | 13 | properties: |
| 13 | 14 | compatible: |
| @@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node) · 762 unmodified lines | ||
| 763 | 763 | /* Walk 3 levels up only if there is 'ports' node. */ |
| 764 | 764 | for (depth = 3; depth && node; depth--) { |
| 765 | 765 | node = of_get_next_parent(node); |
| 766 | − if (depth == 2 && !of_node_name_eq(node, "ports")) | |
| 766 | + if (depth == 2 && !of_node_name_eq(node, "ports") && | |
| 767 | + !of_node_name_eq(node, "in-ports") && | |
| 768 | + !of_node_name_eq(node, "out-ports")) | |
| 767 | 769 | break; |
| 768 | 770 | } |
| 769 | 771 | return node; |
| @@ -1063,36 +1065,6 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, · 293 unmodified lines | ||
| 1063 | 1065 | return of_device_get_match_data(dev); |
| 1064 | 1066 | } |
| 1065 | 1067 | |
| 1066 | −static struct device_node *of_get_compat_node(struct device_node *np) | |
| 1067 | −{ | |
| 1068 | − of_node_get(np); | |
| 1069 | − | |
| 1070 | − while (np) { | |
| 1071 | − if (!of_device_is_available(np)) { | |
| 1072 | − of_node_put(np); | |
| 1073 | − np = NULL; | |
| 1074 | − } | |
| 1075 | − | |
| 1076 | − if (of_property_present(np, "compatible")) | |
| 1077 | − break; | |
| 1078 | − | |
| 1079 | − np = of_get_next_parent(np); | |
| 1080 | − } | |
| 1081 | − | |
| 1082 | − return np; | |
| 1083 | −} | |
| 1084 | − | |
| 1085 | −static struct device_node *of_get_compat_node_parent(struct device_node *np) | |
| 1086 | −{ | |
| 1087 | − struct device_node *parent, *node; | |
| 1088 | − | |
| 1089 | − parent = of_get_parent(np); | |
| 1090 | − node = of_get_compat_node(parent); | |
| 1091 | − of_node_put(parent); | |
| 1092 | − | |
| 1093 | − return node; | |
| 1094 | −} | |
| 1095 | − | |
| 1096 | 1068 | static void of_link_to_phandle(struct device_node *con_np, |
| 1097 | 1069 | struct device_node *sup_np) |
| 1098 | 1070 | { |
| @@ -1222,10 +1194,10 @@ static struct device_node *parse_##fname(struct device_node *np, \ · 123 unmodified lines | ||
| 1222 | 1194 | * parse_prop.prop_name: Name of property holding a phandle value |
| 1223 | 1195 | * parse_prop.index: For properties holding a list of phandles, this is the |
| 1224 | 1196 | * index into the list |
| 1197 | + * @get_con_dev: If the consumer node containing the property is never converted | |
| 1198 | + * to a struct device, implement this ops so fw_devlink can use it | |
| 1199 | + * to find the true consumer. | |
| 1225 | 1200 | * @optional: Describes whether a supplier is mandatory or not |
| 1226 | − * @node_not_dev: The consumer node containing the property is never converted | |
| 1227 | − * to a struct device. Instead, parse ancestor nodes for the | |
| 1228 | − * compatible property to find a node corresponding to a device. | |
| 1229 | 1201 | * |
| 1230 | 1202 | * Returns: |
| 1231 | 1203 | * parse_prop() return values are |
| @@ -1236,15 +1208,15 @@ static struct device_node *parse_##fname(struct device_node *np, \ · 4 unmodified lines | ||
| 1236 | 1208 | struct supplier_bindings { |
| 1237 | 1209 | struct device_node *(*parse_prop)(struct device_node *np, |
| 1238 | 1210 | const char *prop_name, int index); |
| 1211 | + struct device_node *(*get_con_dev)(struct device_node *np); | |
| 1239 | 1212 | bool optional; |
| 1240 | − bool node_not_dev; | |
| 1241 | 1213 | }; |
| 1242 | 1214 | |
| 1243 | 1215 | DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") |
| 1244 | 1216 | DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells") |
| 1245 | 1217 | DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells") |
| 1246 | 1218 | DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells") |
| 1247 | −DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells") | |
| 1219 | +DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells") | |
| 1248 | 1220 | DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL) |
| 1249 | 1221 | DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells") |
| 1250 | 1222 | DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") |
| @@ -1262,7 +1234,6 @@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL) · 11 unmodified lines | ||
| 1262 | 1234 | DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) |
| 1263 | 1235 | DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) |
| 1264 | 1236 | DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) |
| 1265 | −DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL) | |
| 1266 | 1237 | DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") |
| 1267 | 1238 | DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") |
| 1268 | 1239 | DEFINE_SIMPLE_PROP(leds, "leds", NULL) |
| @@ -1328,6 +1299,17 @@ static struct device_node *parse_interrupts(struct device_node *np, · 59 unmodified lines | ||
| 1328 | 1299 | return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np; |
| 1329 | 1300 | } |
| 1330 | 1301 | |
| 1302 | +static struct device_node *parse_remote_endpoint(struct device_node *np, | |
| 1303 | + const char *prop_name, | |
| 1304 | + int index) | |
| 1305 | +{ | |
| 1306 | + /* Return NULL for index > 0 to signify end of remote-endpoints. */ | |
| 1307 | + if (!index || strcmp(prop_name, "remote-endpoint")) | |
| 1308 | + return NULL; | |
| 1309 | + | |
| 1310 | + return of_graph_get_remote_port_parent(np); | |
| 1311 | +} | |
| 1312 | + | |
| 1331 | 1313 | static const struct supplier_bindings of_supplier_bindings[] = { |
| 1332 | 1314 | { .parse_prop = parse_clocks, }, |
| 1333 | 1315 | { .parse_prop = parse_interconnects, }, |
| @@ -1352,7 +1334,10 @@ static const struct supplier_bindings of_supplier_bindings[] = { · 18 unmodified lines | ||
| 1352 | 1334 | { .parse_prop = parse_pinctrl6, }, |
| 1353 | 1335 | { .parse_prop = parse_pinctrl7, }, |
| 1354 | 1336 | { .parse_prop = parse_pinctrl8, }, |
| 1355 | − { .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, | |
| 1337 | + { | |
| 1338 | + .parse_prop = parse_remote_endpoint, | |
| 1339 | + .get_con_dev = of_graph_get_port_parent, | |
| 1340 | + }, | |
| 1356 | 1341 | { .parse_prop = parse_pwms, }, |
| 1357 | 1342 | { .parse_prop = parse_resets, }, |
| 1358 | 1343 | { .parse_prop = parse_leds, }, |
| @@ -1403,8 +1388,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name) · 44 unmodified lines | ||
| 1403 | 1388 | while ((phandle = s->parse_prop(con_np, prop_name, i))) { |
| 1404 | 1389 | struct device_node *con_dev_np; |
| 1405 | 1390 | |
| 1406 | − con_dev_np = s->node_not_dev | |
| 1407 | − ? of_get_compat_node_parent(con_np) | |
| 1391 | + con_dev_np = s->get_con_dev | |
| 1392 | + ? s->get_con_dev(con_np) | |
| 1408 | 1393 | : of_node_get(con_np); |
| 1409 | 1394 | matched = true; |
| 1410 | 1395 | i++; |
| @@ -50,6 +50,12 @@ static struct unittest_results { · 49 unmodified lines | ||
| 50 | 50 | failed; \ |
| 51 | 51 | }) |
| 52 | 52 | |
| 53 | +#ifdef CONFIG_OF_KOBJ | |
| 54 | +#define OF_KREF_READ(NODE) kref_read(&(NODE)->kobj.kref) | |
| 55 | +#else | |
| 56 | +#define OF_KREF_READ(NODE) 1 | |
| 57 | +#endif | |
| 58 | + | |
| 53 | 59 | /* |
| 54 | 60 | * Expected message may have a message level other than KERN_INFO. |
| 55 | 61 | * 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) · 514 unmodified lines | ||
| 570 | 576 | pr_err("missing testcase data\n"); |
| 571 | 577 | return; |
| 572 | 578 | } |
| 573 | − prefs[i] = kref_read(&p[i]->kobj.kref); | |
| 579 | + prefs[i] = OF_KREF_READ(p[i]); | |
| 574 | 580 | } |
| 575 | 581 | |
| 576 | 582 | 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) · 116 unmodified lines | ||
| 693 | 699 | unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); |
| 694 | 700 | |
| 695 | 701 | for (i = 0; i < ARRAY_SIZE(p); ++i) { |
| 696 | − unittest(prefs[i] == kref_read(&p[i]->kobj.kref), | |
| 702 | + unittest(prefs[i] == OF_KREF_READ(p[i]), | |
| 697 | 703 | "provider%d: expected:%d got:%d\n", |
| 698 | − i, prefs[i], kref_read(&p[i]->kobj.kref)); | |
| 704 | + i, prefs[i], OF_KREF_READ(p[i])); | |
| 699 | 705 | of_node_put(p[i]); |
| 700 | 706 | } |
| 701 | 707 | } |
| @@ -33,8 +33,8 @@ if [[ ! -d "${PDT}" ]]; then · 32 unmodified lines | ||
| 33 | 33 | fi |
| 34 | 34 | |
| 35 | 35 | nodes_compatible=$( |
| 36 | − for node_compat in $(find ${PDT} -name compatible); do | |
| 37 | − node=$(dirname "${node_compat}") | |
| 36 | + for node in $(find ${PDT} -type d); do | |
| 37 | + [ ! -f "${node}"/compatible ] && continue | |
| 38 | 38 | # Check if node is available |
| 39 | 39 | if [[ -e "${node}"/status ]]; then |
| 40 | 40 | status=$(tr -d '\000' < "${node}"/status) |
| @@ -46,10 +46,11 @@ nodes_compatible=$( · 5 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | nodes_dev_bound=$( |
| 48 | 48 | IFS=$'\n' |
| 49 | − for uevent in $(find /sys/devices -name uevent); do | |
| 50 | − if [[ -d "$(dirname "${uevent}")"/driver ]]; then | |
| 51 | − grep '^OF_FULLNAME=' "${uevent}" | sed -e 's|OF_FULLNAME=||' | |
| 52 | − fi | |
| 49 | + for dev_dir in $(find /sys/devices -type d); do | |
| 50 | + [ ! -f "${dev_dir}"/uevent ] && continue | |
| 51 | + [ ! -d "${dev_dir}"/driver ] && continue | |
| 52 | + | |
| 53 | + grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||' | |
| 53 | 54 | done |
| 54 | 55 | ) |
| 55 | 56 | |