diff options
-rw-r--r-- | Documentation/devicetree/bindings/serial/8250.txt (renamed from Documentation/devicetree/bindings/serial/of-serial.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/serial/axis,etraxfs-uart.txt | 19 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/submitting-patches.txt | 3 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/vendor-prefixes.txt | 2 | ||||
-rw-r--r-- | drivers/of/Kconfig | 3 | ||||
-rw-r--r-- | drivers/of/base.c | 27 | ||||
-rw-r--r-- | drivers/of/overlay.c | 3 | ||||
-rw-r--r-- | drivers/of/unittest.c | 28 | ||||
-rw-r--r-- | include/linux/of_platform.h | 2 |
9 files changed, 65 insertions, 22 deletions
diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/8250.txt index 91d5ab0e60fc..91d5ab0e60fc 100644 --- a/Documentation/devicetree/bindings/serial/of-serial.txt +++ b/Documentation/devicetree/bindings/serial/8250.txt | |||
diff --git a/Documentation/devicetree/bindings/serial/axis,etraxfs-uart.txt b/Documentation/devicetree/bindings/serial/axis,etraxfs-uart.txt new file mode 100644 index 000000000000..ebcbb62c0a76 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/axis,etraxfs-uart.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | ETRAX FS UART | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "axis,etraxfs-uart" | ||
5 | - reg: offset and length of the register set for the device. | ||
6 | - interrupts: device interrupt | ||
7 | |||
8 | Optional properties: | ||
9 | - {dtr,dsr,ri,cd}-gpios: specify a GPIO for DTR/DSR/RI/CD | ||
10 | line respectively. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | serial@b00260000 { | ||
15 | compatible = "axis,etraxfs-uart"; | ||
16 | reg = <0xb0026000 0x1000>; | ||
17 | interrupts = <68>; | ||
18 | status = "disabled"; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/submitting-patches.txt b/Documentation/devicetree/bindings/submitting-patches.txt index 56742bc70218..7d44eae7ab0b 100644 --- a/Documentation/devicetree/bindings/submitting-patches.txt +++ b/Documentation/devicetree/bindings/submitting-patches.txt | |||
@@ -12,6 +12,9 @@ I. For patch submitters | |||
12 | 12 | ||
13 | devicetree@vger.kernel.org | 13 | devicetree@vger.kernel.org |
14 | 14 | ||
15 | and Cc: the DT maintainers. Use scripts/get_maintainer.pl to identify | ||
16 | all of the DT maintainers. | ||
17 | |||
15 | 3) The Documentation/ portion of the patch should come in the series before | 18 | 3) The Documentation/ portion of the patch should come in the series before |
16 | the code implementing the binding. | 19 | the code implementing the binding. |
17 | 20 | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 389ca1347a77..fae26d014aaf 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -20,6 +20,7 @@ amlogic Amlogic, Inc. | |||
20 | ams AMS AG | 20 | ams AMS AG |
21 | amstaos AMS-Taos Inc. | 21 | amstaos AMS-Taos Inc. |
22 | apm Applied Micro Circuits Corporation (APM) | 22 | apm Applied Micro Circuits Corporation (APM) |
23 | arasan Arasan Chip Systems | ||
23 | arm ARM Ltd. | 24 | arm ARM Ltd. |
24 | armadeus ARMadeus Systems SARL | 25 | armadeus ARMadeus Systems SARL |
25 | asahi-kasei Asahi Kasei Corp. | 26 | asahi-kasei Asahi Kasei Corp. |
@@ -27,6 +28,7 @@ atmel Atmel Corporation | |||
27 | auo AU Optronics Corporation | 28 | auo AU Optronics Corporation |
28 | avago Avago Technologies | 29 | avago Avago Technologies |
29 | avic Shanghai AVIC Optoelectronics Co., Ltd. | 30 | avic Shanghai AVIC Optoelectronics Co., Ltd. |
31 | axis Axis Communications AB | ||
30 | bosch Bosch Sensortec GmbH | 32 | bosch Bosch Sensortec GmbH |
31 | brcm Broadcom Corporation | 33 | brcm Broadcom Corporation |
32 | buffalo Buffalo, Inc. | 34 | buffalo Buffalo, Inc. |
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 38d1c51f58b1..7bcaeec876c0 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig | |||
@@ -84,8 +84,7 @@ config OF_RESOLVE | |||
84 | bool | 84 | bool |
85 | 85 | ||
86 | config OF_OVERLAY | 86 | config OF_OVERLAY |
87 | bool | 87 | bool "Device Tree overlays" |
88 | depends on OF | ||
89 | select OF_DYNAMIC | 88 | select OF_DYNAMIC |
90 | select OF_RESOLVE | 89 | select OF_RESOLVE |
91 | 90 | ||
diff --git a/drivers/of/base.c b/drivers/of/base.c index 0a8aeb8523fe..adb8764861c0 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -714,16 +714,17 @@ static struct device_node *__of_find_node_by_path(struct device_node *parent, | |||
714 | const char *path) | 714 | const char *path) |
715 | { | 715 | { |
716 | struct device_node *child; | 716 | struct device_node *child; |
717 | int len = strchrnul(path, '/') - path; | 717 | int len; |
718 | int term; | 718 | const char *end; |
719 | 719 | ||
720 | end = strchr(path, ':'); | ||
721 | if (!end) | ||
722 | end = strchrnul(path, '/'); | ||
723 | |||
724 | len = end - path; | ||
720 | if (!len) | 725 | if (!len) |
721 | return NULL; | 726 | return NULL; |
722 | 727 | ||
723 | term = strchrnul(path, ':') - path; | ||
724 | if (term < len) | ||
725 | len = term; | ||
726 | |||
727 | __for_each_child_of_node(parent, child) { | 728 | __for_each_child_of_node(parent, child) { |
728 | const char *name = strrchr(child->full_name, '/'); | 729 | const char *name = strrchr(child->full_name, '/'); |
729 | if (WARN(!name, "malformed device_node %s\n", child->full_name)) | 730 | if (WARN(!name, "malformed device_node %s\n", child->full_name)) |
@@ -768,8 +769,12 @@ struct device_node *of_find_node_opts_by_path(const char *path, const char **opt | |||
768 | 769 | ||
769 | /* The path could begin with an alias */ | 770 | /* The path could begin with an alias */ |
770 | if (*path != '/') { | 771 | if (*path != '/') { |
771 | char *p = strchrnul(path, '/'); | 772 | int len; |
772 | int len = separator ? separator - path : p - path; | 773 | const char *p = separator; |
774 | |||
775 | if (!p) | ||
776 | p = strchrnul(path, '/'); | ||
777 | len = p - path; | ||
773 | 778 | ||
774 | /* of_aliases must not be NULL */ | 779 | /* of_aliases must not be NULL */ |
775 | if (!of_aliases) | 780 | if (!of_aliases) |
@@ -794,6 +799,8 @@ struct device_node *of_find_node_opts_by_path(const char *path, const char **opt | |||
794 | path++; /* Increment past '/' delimiter */ | 799 | path++; /* Increment past '/' delimiter */ |
795 | np = __of_find_node_by_path(np, path); | 800 | np = __of_find_node_by_path(np, path); |
796 | path = strchrnul(path, '/'); | 801 | path = strchrnul(path, '/'); |
802 | if (separator && separator < path) | ||
803 | break; | ||
797 | } | 804 | } |
798 | raw_spin_unlock_irqrestore(&devtree_lock, flags); | 805 | raw_spin_unlock_irqrestore(&devtree_lock, flags); |
799 | return np; | 806 | return np; |
@@ -1886,8 +1893,10 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) | |||
1886 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); | 1893 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); |
1887 | if (IS_ENABLED(CONFIG_PPC) && !name) | 1894 | if (IS_ENABLED(CONFIG_PPC) && !name) |
1888 | name = of_get_property(of_aliases, "stdout", NULL); | 1895 | name = of_get_property(of_aliases, "stdout", NULL); |
1889 | if (name) | 1896 | if (name) { |
1890 | of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); | 1897 | of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); |
1898 | add_preferred_console("stdout-path", 0, NULL); | ||
1899 | } | ||
1891 | } | 1900 | } |
1892 | 1901 | ||
1893 | if (!of_aliases) | 1902 | if (!of_aliases) |
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 352b4f28f82c..dee9270ba547 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/idr.h> | ||
22 | 23 | ||
23 | #include "of_private.h" | 24 | #include "of_private.h" |
24 | 25 | ||
@@ -85,7 +86,7 @@ static int of_overlay_apply_single_device_node(struct of_overlay *ov, | |||
85 | struct device_node *target, struct device_node *child) | 86 | struct device_node *target, struct device_node *child) |
86 | { | 87 | { |
87 | const char *cname; | 88 | const char *cname; |
88 | struct device_node *tchild, *grandchild; | 89 | struct device_node *tchild; |
89 | int ret = 0; | 90 | int ret = 0; |
90 | 91 | ||
91 | cname = kbasename(child->full_name); | 92 | cname = kbasename(child->full_name); |
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 0cf9a236d438..aba8946cac46 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c | |||
@@ -92,6 +92,11 @@ static void __init of_selftest_find_node_by_name(void) | |||
92 | "option path test failed\n"); | 92 | "option path test failed\n"); |
93 | of_node_put(np); | 93 | of_node_put(np); |
94 | 94 | ||
95 | np = of_find_node_opts_by_path("/testcase-data:test/option", &options); | ||
96 | selftest(np && !strcmp("test/option", options), | ||
97 | "option path test, subcase #1 failed\n"); | ||
98 | of_node_put(np); | ||
99 | |||
95 | np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); | 100 | np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); |
96 | selftest(np, "NULL option path test failed\n"); | 101 | selftest(np, "NULL option path test failed\n"); |
97 | of_node_put(np); | 102 | of_node_put(np); |
@@ -102,6 +107,12 @@ static void __init of_selftest_find_node_by_name(void) | |||
102 | "option alias path test failed\n"); | 107 | "option alias path test failed\n"); |
103 | of_node_put(np); | 108 | of_node_put(np); |
104 | 109 | ||
110 | np = of_find_node_opts_by_path("testcase-alias:test/alias/option", | ||
111 | &options); | ||
112 | selftest(np && !strcmp("test/alias/option", options), | ||
113 | "option alias path test, subcase #1 failed\n"); | ||
114 | of_node_put(np); | ||
115 | |||
105 | np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); | 116 | np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); |
106 | selftest(np, "NULL option alias path test failed\n"); | 117 | selftest(np, "NULL option alias path test failed\n"); |
107 | of_node_put(np); | 118 | of_node_put(np); |
@@ -378,9 +389,9 @@ static void __init of_selftest_property_string(void) | |||
378 | rc = of_property_match_string(np, "phandle-list-names", "first"); | 389 | rc = of_property_match_string(np, "phandle-list-names", "first"); |
379 | selftest(rc == 0, "first expected:0 got:%i\n", rc); | 390 | selftest(rc == 0, "first expected:0 got:%i\n", rc); |
380 | rc = of_property_match_string(np, "phandle-list-names", "second"); | 391 | rc = of_property_match_string(np, "phandle-list-names", "second"); |
381 | selftest(rc == 1, "second expected:0 got:%i\n", rc); | 392 | selftest(rc == 1, "second expected:1 got:%i\n", rc); |
382 | rc = of_property_match_string(np, "phandle-list-names", "third"); | 393 | rc = of_property_match_string(np, "phandle-list-names", "third"); |
383 | selftest(rc == 2, "third expected:0 got:%i\n", rc); | 394 | selftest(rc == 2, "third expected:2 got:%i\n", rc); |
384 | rc = of_property_match_string(np, "phandle-list-names", "fourth"); | 395 | rc = of_property_match_string(np, "phandle-list-names", "fourth"); |
385 | selftest(rc == -ENODATA, "unmatched string; rc=%i\n", rc); | 396 | selftest(rc == -ENODATA, "unmatched string; rc=%i\n", rc); |
386 | rc = of_property_match_string(np, "missing-property", "blah"); | 397 | rc = of_property_match_string(np, "missing-property", "blah"); |
@@ -478,7 +489,6 @@ static void __init of_selftest_changeset(void) | |||
478 | struct device_node *n1, *n2, *n21, *nremove, *parent, *np; | 489 | struct device_node *n1, *n2, *n21, *nremove, *parent, *np; |
479 | struct of_changeset chgset; | 490 | struct of_changeset chgset; |
480 | 491 | ||
481 | of_changeset_init(&chgset); | ||
482 | n1 = __of_node_dup(NULL, "/testcase-data/changeset/n1"); | 492 | n1 = __of_node_dup(NULL, "/testcase-data/changeset/n1"); |
483 | selftest(n1, "testcase setup failure\n"); | 493 | selftest(n1, "testcase setup failure\n"); |
484 | n2 = __of_node_dup(NULL, "/testcase-data/changeset/n2"); | 494 | n2 = __of_node_dup(NULL, "/testcase-data/changeset/n2"); |
@@ -979,7 +989,7 @@ static int of_path_platform_device_exists(const char *path) | |||
979 | return pdev != NULL; | 989 | return pdev != NULL; |
980 | } | 990 | } |
981 | 991 | ||
982 | #if IS_ENABLED(CONFIG_I2C) | 992 | #if IS_BUILTIN(CONFIG_I2C) |
983 | 993 | ||
984 | /* get the i2c client device instantiated at the path */ | 994 | /* get the i2c client device instantiated at the path */ |
985 | static struct i2c_client *of_path_to_i2c_client(const char *path) | 995 | static struct i2c_client *of_path_to_i2c_client(const char *path) |
@@ -1445,7 +1455,7 @@ static void of_selftest_overlay_11(void) | |||
1445 | return; | 1455 | return; |
1446 | } | 1456 | } |
1447 | 1457 | ||
1448 | #if IS_ENABLED(CONFIG_I2C) && IS_ENABLED(CONFIG_OF_OVERLAY) | 1458 | #if IS_BUILTIN(CONFIG_I2C) && IS_ENABLED(CONFIG_OF_OVERLAY) |
1449 | 1459 | ||
1450 | struct selftest_i2c_bus_data { | 1460 | struct selftest_i2c_bus_data { |
1451 | struct platform_device *pdev; | 1461 | struct platform_device *pdev; |
@@ -1584,7 +1594,7 @@ static struct i2c_driver selftest_i2c_dev_driver = { | |||
1584 | .id_table = selftest_i2c_dev_id, | 1594 | .id_table = selftest_i2c_dev_id, |
1585 | }; | 1595 | }; |
1586 | 1596 | ||
1587 | #if IS_ENABLED(CONFIG_I2C_MUX) | 1597 | #if IS_BUILTIN(CONFIG_I2C_MUX) |
1588 | 1598 | ||
1589 | struct selftest_i2c_mux_data { | 1599 | struct selftest_i2c_mux_data { |
1590 | int nchans; | 1600 | int nchans; |
@@ -1695,7 +1705,7 @@ static int of_selftest_overlay_i2c_init(void) | |||
1695 | "could not register selftest i2c bus driver\n")) | 1705 | "could not register selftest i2c bus driver\n")) |
1696 | return ret; | 1706 | return ret; |
1697 | 1707 | ||
1698 | #if IS_ENABLED(CONFIG_I2C_MUX) | 1708 | #if IS_BUILTIN(CONFIG_I2C_MUX) |
1699 | ret = i2c_add_driver(&selftest_i2c_mux_driver); | 1709 | ret = i2c_add_driver(&selftest_i2c_mux_driver); |
1700 | if (selftest(ret == 0, | 1710 | if (selftest(ret == 0, |
1701 | "could not register selftest i2c mux driver\n")) | 1711 | "could not register selftest i2c mux driver\n")) |
@@ -1707,7 +1717,7 @@ static int of_selftest_overlay_i2c_init(void) | |||
1707 | 1717 | ||
1708 | static void of_selftest_overlay_i2c_cleanup(void) | 1718 | static void of_selftest_overlay_i2c_cleanup(void) |
1709 | { | 1719 | { |
1710 | #if IS_ENABLED(CONFIG_I2C_MUX) | 1720 | #if IS_BUILTIN(CONFIG_I2C_MUX) |
1711 | i2c_del_driver(&selftest_i2c_mux_driver); | 1721 | i2c_del_driver(&selftest_i2c_mux_driver); |
1712 | #endif | 1722 | #endif |
1713 | platform_driver_unregister(&selftest_i2c_bus_driver); | 1723 | platform_driver_unregister(&selftest_i2c_bus_driver); |
@@ -1814,7 +1824,7 @@ static void __init of_selftest_overlay(void) | |||
1814 | of_selftest_overlay_10(); | 1824 | of_selftest_overlay_10(); |
1815 | of_selftest_overlay_11(); | 1825 | of_selftest_overlay_11(); |
1816 | 1826 | ||
1817 | #if IS_ENABLED(CONFIG_I2C) | 1827 | #if IS_BUILTIN(CONFIG_I2C) |
1818 | if (selftest(of_selftest_overlay_i2c_init() == 0, "i2c init failed\n")) | 1828 | if (selftest(of_selftest_overlay_i2c_init() == 0, "i2c init failed\n")) |
1819 | goto out; | 1829 | goto out; |
1820 | 1830 | ||
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 8a860f096c35..611a691145c4 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -84,7 +84,7 @@ static inline int of_platform_populate(struct device_node *root, | |||
84 | static inline void of_platform_depopulate(struct device *parent) { } | 84 | static inline void of_platform_depopulate(struct device *parent) { } |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #ifdef CONFIG_OF_DYNAMIC | 87 | #if defined(CONFIG_OF_DYNAMIC) && defined(CONFIG_OF_ADDRESS) |
88 | extern void of_platform_register_reconfig_notifier(void); | 88 | extern void of_platform_register_reconfig_notifier(void); |
89 | #else | 89 | #else |
90 | static inline void of_platform_register_reconfig_notifier(void) { } | 90 | static inline void of_platform_register_reconfig_notifier(void) { } |