diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 11:53:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 11:53:39 -0400 |
commit | ae36e95cf81c98b111b84317adeb358aaffa80e2 (patch) | |
tree | 87ef144d3392cca199448117a737c657b7c4663a /arch | |
parent | cc8a44c671fd3a2c792e9e1f59ea1df52697cc8b (diff) | |
parent | 663d3f7c2e5e1b018a4c53277ccfde40329d98ca (diff) |
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull device tree updates from Grant Likely:
"The branch contains the following device tree changes the v3.17 merge
window:
Group changes to the device tree. In preparation for adding device
tree overlay support, OF_DYNAMIC is reworked so that a set of device
tree changes can be prepared and applied to the tree all at once.
OF_RECONFIG notifiers see the most significant change here so that
users always get a consistent view of the tree. Notifiers generation
is moved from before a change to after it, and notifiers for a group
of changes are emitted after the entire block of changes have been
applied
Automatic console selection from DT. Console drivers can now use
of_console_check() to see if the device node is specified as a console
device. If so then it gets added as a preferred console. UART
devices get this support automatically when uart_add_one_port() is
called.
DT unit tests no longer depend on pre-loaded data in the device tree.
Data is loaded dynamically at the start of unit tests, and then
unloaded again when the tests have completed.
Also contains a few bugfixes for reserved regions and early memory
setup"
* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux: (21 commits)
of: Fixing OF Selftest build error
drivers: of: add automated assignment of reserved regions to client devices
of: Use proper types for checking memory overflow
of: typo fix in __of_prop_dup()
Adding selftest testdata dynamically into live tree
of: Add todo tasklist for Devicetree
of: Transactional DT support.
of: Reorder device tree changes and notifiers
of: Move dynamic node fixups out of powerpc and into common code
of: Make sure attached nodes don't carry along extra children
of: Make devicetree sysfs update functions consistent.
of: Create unlocked versions of node and property add/remove functions
OF: Utility helper functions for dynamic nodes
of: Move CONFIG_OF_DYNAMIC code into a separate file
of: rename of_aliases_mutex to just of_mutex
of/platform: Fix of_platform_device_destroy iteration of devices
of: Migrate of_find_node_by_name() users to for_each_node_by_name()
tty: Update hypervisor tty drivers to use core stdout parsing code.
arm/versatile: Add the uart as the stdout device.
of: Enable console on serial ports specified by /chosen/stdout-path
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/versatile-ab.dts | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/versatile-pb.dts | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 70 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 20 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/udbg_adb.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 3 |
9 files changed, 14 insertions, 93 deletions
diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts index 36c771a2d765..27d0d9c8adf3 100644 --- a/arch/arm/boot/dts/versatile-ab.dts +++ b/arch/arm/boot/dts/versatile-ab.dts | |||
@@ -15,6 +15,10 @@ | |||
15 | i2c0 = &i2c0; | 15 | i2c0 = &i2c0; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | chosen { | ||
19 | stdout-path = &uart0; | ||
20 | }; | ||
21 | |||
18 | memory { | 22 | memory { |
19 | reg = <0x0 0x08000000>; | 23 | reg = <0x0 0x08000000>; |
20 | }; | 24 | }; |
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts index d025048119d3..e36c1e82fea7 100644 --- a/arch/arm/boot/dts/versatile-pb.dts +++ b/arch/arm/boot/dts/versatile-pb.dts | |||
@@ -56,5 +56,3 @@ | |||
56 | }; | 56 | }; |
57 | }; | 57 | }; |
58 | }; | 58 | }; |
59 | |||
60 | #include <testcases.dtsi> | ||
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 1a3b1055f5eb..4e139f8a69ef 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -818,76 +818,6 @@ int cpu_to_chip_id(int cpu) | |||
818 | } | 818 | } |
819 | EXPORT_SYMBOL(cpu_to_chip_id); | 819 | EXPORT_SYMBOL(cpu_to_chip_id); |
820 | 820 | ||
821 | #ifdef CONFIG_PPC_PSERIES | ||
822 | /* | ||
823 | * Fix up the uninitialized fields in a new device node: | ||
824 | * name, type and pci-specific fields | ||
825 | */ | ||
826 | |||
827 | static int of_finish_dynamic_node(struct device_node *node) | ||
828 | { | ||
829 | struct device_node *parent = of_get_parent(node); | ||
830 | int err = 0; | ||
831 | const phandle *ibm_phandle; | ||
832 | |||
833 | node->name = of_get_property(node, "name", NULL); | ||
834 | node->type = of_get_property(node, "device_type", NULL); | ||
835 | |||
836 | if (!node->name) | ||
837 | node->name = "<NULL>"; | ||
838 | if (!node->type) | ||
839 | node->type = "<NULL>"; | ||
840 | |||
841 | if (!parent) { | ||
842 | err = -ENODEV; | ||
843 | goto out; | ||
844 | } | ||
845 | |||
846 | /* We don't support that function on PowerMac, at least | ||
847 | * not yet | ||
848 | */ | ||
849 | if (machine_is(powermac)) | ||
850 | return -ENODEV; | ||
851 | |||
852 | /* fix up new node's phandle field */ | ||
853 | if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL))) | ||
854 | node->phandle = *ibm_phandle; | ||
855 | |||
856 | out: | ||
857 | of_node_put(parent); | ||
858 | return err; | ||
859 | } | ||
860 | |||
861 | static int prom_reconfig_notifier(struct notifier_block *nb, | ||
862 | unsigned long action, void *node) | ||
863 | { | ||
864 | int err; | ||
865 | |||
866 | switch (action) { | ||
867 | case OF_RECONFIG_ATTACH_NODE: | ||
868 | err = of_finish_dynamic_node(node); | ||
869 | if (err < 0) | ||
870 | printk(KERN_ERR "finish_node returned %d\n", err); | ||
871 | break; | ||
872 | default: | ||
873 | err = 0; | ||
874 | break; | ||
875 | } | ||
876 | return notifier_from_errno(err); | ||
877 | } | ||
878 | |||
879 | static struct notifier_block prom_reconfig_nb = { | ||
880 | .notifier_call = prom_reconfig_notifier, | ||
881 | .priority = 10, /* This one needs to run first */ | ||
882 | }; | ||
883 | |||
884 | static int __init prom_reconfig_setup(void) | ||
885 | { | ||
886 | return of_reconfig_notifier_register(&prom_reconfig_nb); | ||
887 | } | ||
888 | __initcall(prom_reconfig_setup); | ||
889 | #endif | ||
890 | |||
891 | bool arch_match_cpu_phys_id(int cpu, u64 phys_id) | 821 | bool arch_match_cpu_phys_id(int cpu, u64 phys_id) |
892 | { | 822 | { |
893 | return (int)phys_id == get_hard_smp_processor_id(cpu); | 823 | return (int)phys_id == get_hard_smp_processor_id(cpu); |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 1413e72bc2e1..4882bfd90e27 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2805,25 +2805,20 @@ set_initial_features(void) | |||
2805 | /* Enable GMAC for now for PCI probing. It will be disabled | 2805 | /* Enable GMAC for now for PCI probing. It will be disabled |
2806 | * later on after PCI probe | 2806 | * later on after PCI probe |
2807 | */ | 2807 | */ |
2808 | np = of_find_node_by_name(NULL, "ethernet"); | 2808 | for_each_node_by_name(np, "ethernet") |
2809 | while(np) { | ||
2810 | if (of_device_is_compatible(np, "K2-GMAC")) | 2809 | if (of_device_is_compatible(np, "K2-GMAC")) |
2811 | g5_gmac_enable(np, 0, 1); | 2810 | g5_gmac_enable(np, 0, 1); |
2812 | np = of_find_node_by_name(np, "ethernet"); | ||
2813 | } | ||
2814 | 2811 | ||
2815 | /* Enable FW before PCI probe. Will be disabled later on | 2812 | /* Enable FW before PCI probe. Will be disabled later on |
2816 | * Note: We should have a batter way to check that we are | 2813 | * Note: We should have a batter way to check that we are |
2817 | * dealing with uninorth internal cell and not a PCI cell | 2814 | * dealing with uninorth internal cell and not a PCI cell |
2818 | * on the external PCI. The code below works though. | 2815 | * on the external PCI. The code below works though. |
2819 | */ | 2816 | */ |
2820 | np = of_find_node_by_name(NULL, "firewire"); | 2817 | for_each_node_by_name(np, "firewire") { |
2821 | while(np) { | ||
2822 | if (of_device_is_compatible(np, "pci106b,5811")) { | 2818 | if (of_device_is_compatible(np, "pci106b,5811")) { |
2823 | macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; | 2819 | macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; |
2824 | g5_fw_enable(np, 0, 1); | 2820 | g5_fw_enable(np, 0, 1); |
2825 | } | 2821 | } |
2826 | np = of_find_node_by_name(np, "firewire"); | ||
2827 | } | 2822 | } |
2828 | } | 2823 | } |
2829 | #else /* CONFIG_PPC64 */ | 2824 | #else /* CONFIG_PPC64 */ |
@@ -2834,13 +2829,11 @@ set_initial_features(void) | |||
2834 | /* Enable GMAC for now for PCI probing. It will be disabled | 2829 | /* Enable GMAC for now for PCI probing. It will be disabled |
2835 | * later on after PCI probe | 2830 | * later on after PCI probe |
2836 | */ | 2831 | */ |
2837 | np = of_find_node_by_name(NULL, "ethernet"); | 2832 | for_each_node_by_name(np, "ethernet") { |
2838 | while(np) { | ||
2839 | if (np->parent | 2833 | if (np->parent |
2840 | && of_device_is_compatible(np->parent, "uni-north") | 2834 | && of_device_is_compatible(np->parent, "uni-north") |
2841 | && of_device_is_compatible(np, "gmac")) | 2835 | && of_device_is_compatible(np, "gmac")) |
2842 | core99_gmac_enable(np, 0, 1); | 2836 | core99_gmac_enable(np, 0, 1); |
2843 | np = of_find_node_by_name(np, "ethernet"); | ||
2844 | } | 2837 | } |
2845 | 2838 | ||
2846 | /* Enable FW before PCI probe. Will be disabled later on | 2839 | /* Enable FW before PCI probe. Will be disabled later on |
@@ -2848,8 +2841,7 @@ set_initial_features(void) | |||
2848 | * dealing with uninorth internal cell and not a PCI cell | 2841 | * dealing with uninorth internal cell and not a PCI cell |
2849 | * on the external PCI. The code below works though. | 2842 | * on the external PCI. The code below works though. |
2850 | */ | 2843 | */ |
2851 | np = of_find_node_by_name(NULL, "firewire"); | 2844 | for_each_node_by_name(np, "firewire") { |
2852 | while(np) { | ||
2853 | if (np->parent | 2845 | if (np->parent |
2854 | && of_device_is_compatible(np->parent, "uni-north") | 2846 | && of_device_is_compatible(np->parent, "uni-north") |
2855 | && (of_device_is_compatible(np, "pci106b,18") || | 2847 | && (of_device_is_compatible(np, "pci106b,18") || |
@@ -2858,18 +2850,16 @@ set_initial_features(void) | |||
2858 | macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; | 2850 | macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; |
2859 | core99_firewire_enable(np, 0, 1); | 2851 | core99_firewire_enable(np, 0, 1); |
2860 | } | 2852 | } |
2861 | np = of_find_node_by_name(np, "firewire"); | ||
2862 | } | 2853 | } |
2863 | 2854 | ||
2864 | /* Enable ATA-100 before PCI probe. */ | 2855 | /* Enable ATA-100 before PCI probe. */ |
2865 | np = of_find_node_by_name(NULL, "ata-6"); | 2856 | np = of_find_node_by_name(NULL, "ata-6"); |
2866 | while(np) { | 2857 | for_each_node_by_name(np, "ata-6") { |
2867 | if (np->parent | 2858 | if (np->parent |
2868 | && of_device_is_compatible(np->parent, "uni-north") | 2859 | && of_device_is_compatible(np->parent, "uni-north") |
2869 | && of_device_is_compatible(np, "kauai-ata")) { | 2860 | && of_device_is_compatible(np, "kauai-ata")) { |
2870 | core99_ata100_enable(np, 1); | 2861 | core99_ata100_enable(np, 1); |
2871 | } | 2862 | } |
2872 | np = of_find_node_by_name(np, "ata-6"); | ||
2873 | } | 2863 | } |
2874 | 2864 | ||
2875 | /* Switch airport off */ | 2865 | /* Switch airport off */ |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index cf7009b8c7b6..7e868ccf3b0d 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -698,7 +698,7 @@ static void __init fixup_nec_usb2(void) | |||
698 | { | 698 | { |
699 | struct device_node *nec; | 699 | struct device_node *nec; |
700 | 700 | ||
701 | for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) { | 701 | for_each_node_by_name(nec, "usb") { |
702 | struct pci_controller *hose; | 702 | struct pci_controller *hose; |
703 | u32 data; | 703 | u32 data; |
704 | const u32 *prop; | 704 | const u32 *prop; |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 5cbd4d67d5c4..af094ae03dbb 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -577,7 +577,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus) | |||
577 | int ok; | 577 | int ok; |
578 | 578 | ||
579 | /* Look for the clock chip */ | 579 | /* Look for the clock chip */ |
580 | while ((cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL) { | 580 | for_each_node_by_name(cc, "i2c-hwclock") { |
581 | p = of_get_parent(cc); | 581 | p = of_get_parent(cc); |
582 | ok = p && of_device_is_compatible(p, "uni-n-i2c"); | 582 | ok = p && of_device_is_compatible(p, "uni-n-i2c"); |
583 | of_node_put(p); | 583 | of_node_put(p); |
diff --git a/arch/powerpc/platforms/powermac/udbg_adb.c b/arch/powerpc/platforms/powermac/udbg_adb.c index 44e0b55a2a02..366bd221edec 100644 --- a/arch/powerpc/platforms/powermac/udbg_adb.c +++ b/arch/powerpc/platforms/powermac/udbg_adb.c | |||
@@ -191,7 +191,7 @@ int __init udbg_adb_init(int force_btext) | |||
191 | * of type "adb". If not, we return a failure, but we keep the | 191 | * of type "adb". If not, we return a failure, but we keep the |
192 | * bext output set for now | 192 | * bext output set for now |
193 | */ | 193 | */ |
194 | for (np = NULL; (np = of_find_node_by_name(np, "keyboard")) != NULL;) { | 194 | for_each_node_by_name(np, "keyboard") { |
195 | struct device_node *parent = of_get_parent(np); | 195 | struct device_node *parent = of_get_parent(np); |
196 | int found = (parent && strcmp(parent->type, "adb") == 0); | 196 | int found = (parent && strcmp(parent->type, "adb") == 0); |
197 | of_node_put(parent); | 197 | of_node_put(parent); |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 7995135170a3..ac01e188faef 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -194,7 +194,7 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) | |||
194 | if (!memblock_size) | 194 | if (!memblock_size) |
195 | return -EINVAL; | 195 | return -EINVAL; |
196 | 196 | ||
197 | p = (u32 *)of_get_property(pr->dn, "ibm,dynamic-memory", NULL); | 197 | p = (u32 *) pr->old_prop->value; |
198 | if (!p) | 198 | if (!p) |
199 | return -EINVAL; | 199 | return -EINVAL; |
200 | 200 | ||
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index cfe8a6389a51..e724d3186e73 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -232,8 +232,7 @@ static void __init pseries_discover_pic(void) | |||
232 | struct device_node *np; | 232 | struct device_node *np; |
233 | const char *typep; | 233 | const char *typep; |
234 | 234 | ||
235 | for (np = NULL; (np = of_find_node_by_name(np, | 235 | for_each_node_by_name(np, "interrupt-controller") { |
236 | "interrupt-controller"));) { | ||
237 | typep = of_get_property(np, "compatible", NULL); | 236 | typep = of_get_property(np, "compatible", NULL); |
238 | if (strstr(typep, "open-pic")) { | 237 | if (strstr(typep, "open-pic")) { |
239 | pSeries_mpic_node = of_node_get(np); | 238 | pSeries_mpic_node = of_node_get(np); |