aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 02:52:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 02:52:17 -0500
commit10d0c9705e80bbd3d587c5fad24599aabaca6688 (patch)
tree9456083a1b04b8d98da08d88e937cfeff80e2a7d /arch/mips
parent85b656cf1560e27a89354a23f2c10ba229d2f173 (diff)
parentc11eede69b6ad0ac44ebc1e021a8d2699c5f1f8f (diff)
Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring: "DeviceTree updates for 3.13. This is a bit larger pull request than usual for this cycle with lots of clean-up. - Cross arch clean-up and consolidation of early DT scanning code. - Clean-up and removal of arch prom.h headers. Makes arch specific prom.h optional on all but Sparc. - Addition of interrupts-extended property for devices connected to multiple interrupt controllers. - Refactoring of DT interrupt parsing code in preparation for deferred probe of interrupts. - ARM cpu and cpu topology bindings documentation. - Various DT vendor binding documentation updates" * tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits) powerpc: add missing explicit OF includes for ppc dt/irq: add empty of_irq_count for !OF_IRQ dt: disable self-tests for !OF_IRQ of: irq: Fix interrupt-map entry matching MIPS: Netlogic: replace early_init_devtree() call of: Add Panasonic Corporation vendor prefix of: Add Chunghwa Picture Tubes Ltd. vendor prefix of: Add AU Optronics Corporation vendor prefix of/irq: Fix potential buffer overflow of/irq: Fix bug in interrupt parsing refactor. of: set dma_mask to point to coherent_dma_mask of: add vendor prefix for PHYTEC Messtechnik GmbH DT: sort vendor-prefixes.txt of: Add vendor prefix for Cadence of: Add empty for_each_available_child_of_node() macro definition arm/versatile: Fix versatile irq specifications. of/irq: create interrupts-extended property microblaze/pci: Drop PowerPC-ism from irq parsing of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code. of/irq: Use irq_of_parse_and_map() ...
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/xlp.h1
-rw-r--r--arch/mips/include/asm/prom.h14
-rw-r--r--arch/mips/kernel/prom.c60
-rw-r--r--arch/mips/lantiq/prom.c1
-rw-r--r--arch/mips/mti-sead3/sead3-setup.c2
-rw-r--r--arch/mips/netlogic/xlp/dt.c18
-rw-r--r--arch/mips/netlogic/xlp/setup.c2
-rw-r--r--arch/mips/pci/fixup-lantiq.c13
-rw-r--r--arch/mips/pci/pci-rt3883.c24
-rw-r--r--arch/mips/ralink/of.c1
10 files changed, 24 insertions, 112 deletions
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
index 17daffb280a3..470f2095b346 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
@@ -69,6 +69,7 @@ void nlm_hal_init(void);
69int xlp_get_dram_map(int n, uint64_t *dram_map); 69int xlp_get_dram_map(int n, uint64_t *dram_map);
70 70
71/* Device tree related */ 71/* Device tree related */
72void xlp_early_init_devtree(void);
72void *xlp_dt_init(void *fdtp); 73void *xlp_dt_init(void *fdtp);
73 74
74static inline int cpu_is_xlpii(void) 75static inline int cpu_is_xlpii(void)
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
index 1e7e0961064b..ccd2b75f152c 100644
--- a/arch/mips/include/asm/prom.h
+++ b/arch/mips/include/asm/prom.h
@@ -17,22 +17,8 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/bootinfo.h> 18#include <asm/bootinfo.h>
19 19
20extern int early_init_dt_scan_memory_arch(unsigned long node,
21 const char *uname, int depth, void *data);
22
23extern void device_tree_init(void); 20extern void device_tree_init(void);
24 21
25static inline unsigned long pci_address_to_pio(phys_addr_t address)
26{
27 /*
28 * The ioport address can be directly used by inX() / outX()
29 */
30 BUG_ON(address > IO_SPACE_LIMIT);
31
32 return (unsigned long) address;
33}
34#define pci_address_to_pio pci_address_to_pio
35
36struct boot_param_header; 22struct boot_param_header;
37 23
38extern void __dt_setup_arch(struct boot_param_header *bph); 24extern void __dt_setup_arch(struct boot_param_header *bph);
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 0fa0b69cdd53..3c3b0df8f48d 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -13,12 +13,9 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/bootmem.h> 15#include <linux/bootmem.h>
16#include <linux/initrd.h>
17#include <linux/debugfs.h> 16#include <linux/debugfs.h>
18#include <linux/of.h> 17#include <linux/of.h>
19#include <linux/of_fdt.h> 18#include <linux/of_fdt.h>
20#include <linux/of_irq.h>
21#include <linux/of_platform.h>
22 19
23#include <asm/page.h> 20#include <asm/page.h>
24#include <asm/prom.h> 21#include <asm/prom.h>
@@ -40,13 +37,6 @@ char *mips_get_machine_name(void)
40} 37}
41 38
42#ifdef CONFIG_OF 39#ifdef CONFIG_OF
43int __init early_init_dt_scan_memory_arch(unsigned long node,
44 const char *uname, int depth,
45 void *data)
46{
47 return early_init_dt_scan_memory(node, uname, depth, data);
48}
49
50void __init early_init_dt_add_memory_arch(u64 base, u64 size) 40void __init early_init_dt_add_memory_arch(u64 base, u64 size)
51{ 41{
52 return add_memory_region(base, size, BOOT_MEM_RAM); 42 return add_memory_region(base, size, BOOT_MEM_RAM);
@@ -57,57 +47,11 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
57 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); 47 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
58} 48}
59 49
60#ifdef CONFIG_BLK_DEV_INITRD
61void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
62{
63 initrd_start = (unsigned long)__va(start);
64 initrd_end = (unsigned long)__va(end);
65 initrd_below_start_ok = 1;
66}
67#endif
68
69int __init early_init_dt_scan_model(unsigned long node, const char *uname,
70 int depth, void *data)
71{
72 if (!depth) {
73 char *model = of_get_flat_dt_prop(node, "model", NULL);
74
75 if (model)
76 mips_set_machine_name(model);
77 }
78 return 0;
79}
80
81void __init early_init_devtree(void *params)
82{
83 /* Setup flat device-tree pointer */
84 initial_boot_params = params;
85
86 /* Retrieve various informations from the /chosen node of the
87 * device-tree, including the platform type, initrd location and
88 * size, and more ...
89 */
90 of_scan_flat_dt(early_init_dt_scan_chosen, arcs_cmdline);
91
92
93 /* Scan memory nodes */
94 of_scan_flat_dt(early_init_dt_scan_root, NULL);
95 of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
96
97 /* try to load the mips machine name */
98 of_scan_flat_dt(early_init_dt_scan_model, NULL);
99}
100
101void __init __dt_setup_arch(struct boot_param_header *bph) 50void __init __dt_setup_arch(struct boot_param_header *bph)
102{ 51{
103 if (be32_to_cpu(bph->magic) != OF_DT_HEADER) { 52 if (!early_init_dt_scan(bph))
104 pr_err("DTB has bad magic, ignoring builtin OF DTB\n");
105
106 return; 53 return;
107 }
108
109 initial_boot_params = bph;
110 54
111 early_init_devtree(initial_boot_params); 55 mips_set_machine_name(of_flat_dt_get_machine_name());
112} 56}
113#endif 57#endif
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index 49c460370285..19686c5bc5ed 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/bootinfo.h> 15#include <asm/bootinfo.h>
16#include <asm/time.h> 16#include <asm/time.h>
17#include <asm/prom.h>
17 18
18#include <lantiq.h> 19#include <lantiq.h>
19 20
diff --git a/arch/mips/mti-sead3/sead3-setup.c b/arch/mips/mti-sead3/sead3-setup.c
index b5059dc899f4..928ba84c8a78 100644
--- a/arch/mips/mti-sead3/sead3-setup.c
+++ b/arch/mips/mti-sead3/sead3-setup.c
@@ -10,6 +10,8 @@
10#include <linux/of_fdt.h> 10#include <linux/of_fdt.h>
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12 12
13#include <asm/prom.h>
14
13#include <asm/mips-boards/generic.h> 15#include <asm/mips-boards/generic.h>
14 16
15const char *get_system_type(void) 17const char *get_system_type(void)
diff --git a/arch/mips/netlogic/xlp/dt.c b/arch/mips/netlogic/xlp/dt.c
index 88df445dda76..8316d5454b17 100644
--- a/arch/mips/netlogic/xlp/dt.c
+++ b/arch/mips/netlogic/xlp/dt.c
@@ -39,8 +39,11 @@
39#include <linux/of_platform.h> 39#include <linux/of_platform.h>
40#include <linux/of_device.h> 40#include <linux/of_device.h>
41 41
42#include <asm/prom.h>
43
42extern u32 __dtb_xlp_evp_begin[], __dtb_xlp_svp_begin[], 44extern u32 __dtb_xlp_evp_begin[], __dtb_xlp_svp_begin[],
43 __dtb_xlp_fvp_begin[], __dtb_start[]; 45 __dtb_xlp_fvp_begin[], __dtb_start[];
46static void *xlp_fdt_blob;
44 47
45void __init *xlp_dt_init(void *fdtp) 48void __init *xlp_dt_init(void *fdtp)
46{ 49{
@@ -67,19 +70,26 @@ void __init *xlp_dt_init(void *fdtp)
67 break; 70 break;
68 } 71 }
69 } 72 }
70 initial_boot_params = fdtp; 73 xlp_fdt_blob = fdtp;
71 return fdtp; 74 return fdtp;
72} 75}
73 76
77void __init xlp_early_init_devtree(void)
78{
79 __dt_setup_arch(xlp_fdt_blob);
80 strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
81}
82
74void __init device_tree_init(void) 83void __init device_tree_init(void)
75{ 84{
76 unsigned long base, size; 85 unsigned long base, size;
86 struct boot_param_header *fdtp = xlp_fdt_blob;
77 87
78 if (!initial_boot_params) 88 if (!fdtp)
79 return; 89 return;
80 90
81 base = virt_to_phys((void *)initial_boot_params); 91 base = virt_to_phys(fdtp);
82 size = be32_to_cpu(initial_boot_params->totalsize); 92 size = be32_to_cpu(fdtp->totalsize);
83 93
84 /* Before we do anything, lets reserve the dt blob */ 94 /* Before we do anything, lets reserve the dt blob */
85 reserve_bootmem(base, size, BOOTMEM_DEFAULT); 95 reserve_bootmem(base, size, BOOTMEM_DEFAULT);
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 76a7131e486e..6d981bb337ec 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -98,7 +98,7 @@ void __init plat_mem_setup(void)
98 pm_power_off = nlm_linux_exit; 98 pm_power_off = nlm_linux_exit;
99 99
100 /* memory and bootargs from DT */ 100 /* memory and bootargs from DT */
101 early_init_devtree(initial_boot_params); 101 xlp_early_init_devtree();
102 102
103 if (boot_mem_map.nr_map == 0) { 103 if (boot_mem_map.nr_map == 0) {
104 pr_info("Using DRAM BARs for memory map.\n"); 104 pr_info("Using DRAM BARs for memory map.\n");
diff --git a/arch/mips/pci/fixup-lantiq.c b/arch/mips/pci/fixup-lantiq.c
index 6c829df28dc7..c2ce41ea61d7 100644
--- a/arch/mips/pci/fixup-lantiq.c
+++ b/arch/mips/pci/fixup-lantiq.c
@@ -25,16 +25,5 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
25 25
26int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 26int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
27{ 27{
28 struct of_irq dev_irq; 28 return of_irq_parse_and_map_pci(dev, slot, pin);
29 int irq;
30
31 if (of_irq_map_pci(dev, &dev_irq)) {
32 dev_err(&dev->dev, "trying to map irq for unknown slot:%d pin:%d\n",
33 slot, pin);
34 return 0;
35 }
36 irq = irq_create_of_mapping(dev_irq.controller, dev_irq.specifier,
37 dev_irq.size);
38 dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq);
39 return irq;
40} 29}
diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
index 95c9d41382e7..adeff2bfe4cd 100644
--- a/arch/mips/pci/pci-rt3883.c
+++ b/arch/mips/pci/pci-rt3883.c
@@ -583,29 +583,7 @@ err_put_intc_node:
583 583
584int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 584int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
585{ 585{
586 struct of_irq dev_irq; 586 return of_irq_parse_and_map_pci(dev, slot, pin);
587 int err;
588 int irq;
589
590 err = of_irq_map_pci(dev, &dev_irq);
591 if (err) {
592 pr_err("pci %s: unable to get irq map, err=%d\n",
593 pci_name((struct pci_dev *) dev), err);
594 return 0;
595 }
596
597 irq = irq_create_of_mapping(dev_irq.controller,
598 dev_irq.specifier,
599 dev_irq.size);
600
601 if (irq == 0)
602 pr_crit("pci %s: no irq found for pin %u\n",
603 pci_name((struct pci_dev *) dev), pin);
604 else
605 pr_info("pci %s: using irq %d for pin %u\n",
606 pci_name((struct pci_dev *) dev), irq, pin);
607
608 return irq;
609} 587}
610 588
611int pcibios_plat_dev_init(struct pci_dev *dev) 589int pcibios_plat_dev_init(struct pci_dev *dev)
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 15f21ea96121..eccc5526155e 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -21,6 +21,7 @@
21#include <asm/reboot.h> 21#include <asm/reboot.h>
22#include <asm/bootinfo.h> 22#include <asm/bootinfo.h>
23#include <asm/addrspace.h> 23#include <asm/addrspace.h>
24#include <asm/prom.h>
24 25
25#include "common.h" 26#include "common.h"
26 27