diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 18:57:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 18:57:35 -0400 |
commit | 03c0c29aff7e56b722eb6c47eace222b140d0377 (patch) | |
tree | 47267a19b523159cf36a050ef3c35f4dbdb33016 /arch/microblaze/include | |
parent | c60c6a96b7bb0f1f8bb635fdfcf5b592aaf062b4 (diff) | |
parent | 7fb8f881c54beb05dd4d2c947dada1c636581d87 (diff) |
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits)
of/platform: Register of_platform_drivers with an "of:" prefix
of/address: Clean up function declarations
of/spi: call of_register_spi_devices() from spi core code
of: Provide default of_node_to_nid() implementation.
of/device: Make of_device_make_bus_id() usable by other code.
of/irq: Fix endian issues in parsing interrupt specifiers
of: Fix phandle endian issues
of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string
of: remove of_default_bus_ids
of: make of_find_device_by_node generic
microblaze: remove references to of_device and to_of_device
sparc: remove references to of_device and to_of_device
powerpc: remove references to of_device and to_of_device
of/device: Replace of_device with platform_device in includes and core code
of/device: Protect against binding of_platform_drivers to non-OF devices
of: remove asm/of_device.h
of: remove asm/of_platform.h
of/platform: remove all of_bus_type and of_platform_bus_type references
of: Merge of_platform_bus_type with platform_bus_type
drivercore/of: Add OF style matching to platform bus
...
Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just
some obj-y removals by the devicetree branch, while the microblaze
updates added a new file.
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r-- | arch/microblaze/include/asm/irq.h | 24 | ||||
-rw-r--r-- | arch/microblaze/include/asm/of_device.h | 44 | ||||
-rw-r--r-- | arch/microblaze/include/asm/of_platform.h | 54 | ||||
-rw-r--r-- | arch/microblaze/include/asm/page.h | 7 | ||||
-rw-r--r-- | arch/microblaze/include/asm/pci-bridge.h | 5 | ||||
-rw-r--r-- | arch/microblaze/include/asm/prom.h | 115 | ||||
-rw-r--r-- | arch/microblaze/include/asm/topology.h | 10 |
7 files changed, 14 insertions, 245 deletions
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h index 31a35c33df63..ec5583d6111c 100644 --- a/arch/microblaze/include/asm/irq.h +++ b/arch/microblaze/include/asm/irq.h | |||
@@ -27,17 +27,6 @@ extern unsigned int nr_irq; | |||
27 | struct pt_regs; | 27 | struct pt_regs; |
28 | extern void do_IRQ(struct pt_regs *regs); | 28 | extern void do_IRQ(struct pt_regs *regs); |
29 | 29 | ||
30 | /** | ||
31 | * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space | ||
32 | * @device: Device node of the device whose interrupt is to be mapped | ||
33 | * @index: Index of the interrupt to map | ||
34 | * | ||
35 | * This function is a wrapper that chains of_irq_map_one() and | ||
36 | * irq_create_of_mapping() to make things easier to callers | ||
37 | */ | ||
38 | struct device_node; | ||
39 | extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index); | ||
40 | |||
41 | /** FIXME - not implement | 30 | /** FIXME - not implement |
42 | * irq_dispose_mapping - Unmap an interrupt | 31 | * irq_dispose_mapping - Unmap an interrupt |
43 | * @virq: linux virq number of the interrupt to unmap | 32 | * @virq: linux virq number of the interrupt to unmap |
@@ -62,17 +51,4 @@ struct irq_host; | |||
62 | extern unsigned int irq_create_mapping(struct irq_host *host, | 51 | extern unsigned int irq_create_mapping(struct irq_host *host, |
63 | irq_hw_number_t hwirq); | 52 | irq_hw_number_t hwirq); |
64 | 53 | ||
65 | /** | ||
66 | * irq_create_of_mapping - Map a hardware interrupt into linux virq space | ||
67 | * @controller: Device node of the interrupt controller | ||
68 | * @inspec: Interrupt specifier from the device-tree | ||
69 | * @intsize: Size of the interrupt specifier from the device-tree | ||
70 | * | ||
71 | * This function is identical to irq_create_mapping except that it takes | ||
72 | * as input informations straight from the device-tree (typically the results | ||
73 | * of the of_irq_map_*() functions. | ||
74 | */ | ||
75 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
76 | u32 *intspec, unsigned int intsize); | ||
77 | |||
78 | #endif /* _ASM_MICROBLAZE_IRQ_H */ | 54 | #endif /* _ASM_MICROBLAZE_IRQ_H */ |
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h deleted file mode 100644 index 73cb98040982..000000000000 --- a/arch/microblaze/include/asm/of_device.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu> | ||
3 | * | ||
4 | * based on PowerPC of_device.h | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef _ASM_MICROBLAZE_OF_DEVICE_H | ||
12 | #define _ASM_MICROBLAZE_OF_DEVICE_H | ||
13 | #ifdef __KERNEL__ | ||
14 | |||
15 | #include <linux/device.h> | ||
16 | #include <linux/of.h> | ||
17 | |||
18 | /* | ||
19 | * The of_device is a kind of "base class" that is a superset of | ||
20 | * struct device for use by devices attached to an OF node and | ||
21 | * probed using OF properties. | ||
22 | */ | ||
23 | struct of_device { | ||
24 | struct device dev; /* Generic device interface */ | ||
25 | struct pdev_archdata archdata; | ||
26 | }; | ||
27 | |||
28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | ||
29 | char *str, ssize_t len); | ||
30 | |||
31 | extern struct of_device *of_device_alloc(struct device_node *np, | ||
32 | const char *bus_id, | ||
33 | struct device *parent); | ||
34 | |||
35 | extern int of_device_uevent(struct device *dev, | ||
36 | struct kobj_uevent_env *env); | ||
37 | |||
38 | extern void of_device_make_bus_id(struct of_device *dev); | ||
39 | |||
40 | /* This is just here during the transition */ | ||
41 | #include <linux/of_device.h> | ||
42 | |||
43 | #endif /* __KERNEL__ */ | ||
44 | #endif /* _ASM_MICROBLAZE_OF_DEVICE_H */ | ||
diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h deleted file mode 100644 index 37491276c6ca..000000000000 --- a/arch/microblaze/include/asm/of_platform.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. | ||
3 | * <benh@kernel.crashing.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version | ||
8 | * 2 of the License, or (at your option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef _ASM_MICROBLAZE_OF_PLATFORM_H | ||
12 | #define _ASM_MICROBLAZE_OF_PLATFORM_H | ||
13 | |||
14 | /* This is just here during the transition */ | ||
15 | #include <linux/of_platform.h> | ||
16 | |||
17 | /* | ||
18 | * The list of OF IDs below is used for matching bus types in the | ||
19 | * system whose devices are to be exposed as of_platform_devices. | ||
20 | * | ||
21 | * This is the default list valid for most platforms. This file provides | ||
22 | * functions who can take an explicit list if necessary though | ||
23 | * | ||
24 | * The search is always performed recursively looking for children of | ||
25 | * the provided device_node and recursively if such a children matches | ||
26 | * a bus type in the list | ||
27 | */ | ||
28 | |||
29 | static const struct of_device_id of_default_bus_ids[] = { | ||
30 | { .type = "soc", }, | ||
31 | { .compatible = "soc", }, | ||
32 | { .type = "plb5", }, | ||
33 | { .type = "plb4", }, | ||
34 | { .type = "opb", }, | ||
35 | { .type = "simple", }, | ||
36 | {}, | ||
37 | }; | ||
38 | |||
39 | /* Platform devices and busses creation */ | ||
40 | extern struct of_device *of_platform_device_create(struct device_node *np, | ||
41 | const char *bus_id, | ||
42 | struct device *parent); | ||
43 | /* pseudo "matches" value to not do deep probe */ | ||
44 | #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1) | ||
45 | |||
46 | extern int of_platform_bus_probe(struct device_node *root, | ||
47 | const struct of_device_id *matches, | ||
48 | struct device *parent); | ||
49 | |||
50 | extern struct of_device *of_find_device_by_phandle(phandle ph); | ||
51 | |||
52 | extern void of_instantiate_rtc(void); | ||
53 | |||
54 | #endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */ | ||
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h index c12c6dfafd9f..4f268faa0126 100644 --- a/arch/microblaze/include/asm/page.h +++ b/arch/microblaze/include/asm/page.h | |||
@@ -47,13 +47,6 @@ | |||
47 | #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) | 47 | #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) |
48 | #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) | 48 | #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) |
49 | 49 | ||
50 | /* align addr on a size boundary - adjust address up/down if needed */ | ||
51 | #define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1))) | ||
52 | #define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1))) | ||
53 | |||
54 | /* align addr on a size boundary - adjust address up if needed */ | ||
55 | #define _ALIGN(addr, size) _ALIGN_UP(addr, size) | ||
56 | |||
57 | #ifndef CONFIG_MMU | 50 | #ifndef CONFIG_MMU |
58 | /* | 51 | /* |
59 | * PAGE_OFFSET -- the first address of the first page of memory. When not | 52 | * PAGE_OFFSET -- the first address of the first page of memory. When not |
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 0c77cda9f5d8..0c68764ab547 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h | |||
@@ -172,13 +172,8 @@ static inline int pci_has_flag(int flag) | |||
172 | 172 | ||
173 | extern struct list_head hose_list; | 173 | extern struct list_head hose_list; |
174 | 174 | ||
175 | extern unsigned long pci_address_to_pio(phys_addr_t address); | ||
176 | extern int pcibios_vaddr_is_ioport(void __iomem *address); | 175 | extern int pcibios_vaddr_is_ioport(void __iomem *address); |
177 | #else | 176 | #else |
178 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | ||
179 | { | ||
180 | return (unsigned long)-1; | ||
181 | } | ||
182 | static inline int pcibios_vaddr_is_ioport(void __iomem *address) | 177 | static inline int pcibios_vaddr_is_ioport(void __iomem *address) |
183 | { | 178 | { |
184 | return 0; | 179 | return 0; |
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h index e7d67a329bd7..101fa098f62a 100644 --- a/arch/microblaze/include/asm/prom.h +++ b/arch/microblaze/include/asm/prom.h | |||
@@ -20,9 +20,6 @@ | |||
20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
21 | 21 | ||
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | #include <linux/of_fdt.h> | ||
24 | #include <linux/proc_fs.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
27 | #include <asm/atomic.h> | 24 | #include <asm/atomic.h> |
28 | 25 | ||
@@ -50,29 +47,10 @@ extern void pci_create_OF_bus_map(void); | |||
50 | * OF address retreival & translation | 47 | * OF address retreival & translation |
51 | */ | 48 | */ |
52 | 49 | ||
53 | /* Translate an OF address block into a CPU physical address | 50 | #ifdef CONFIG_PCI |
54 | */ | 51 | extern unsigned long pci_address_to_pio(phys_addr_t address); |
55 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | 52 | #define pci_address_to_pio pci_address_to_pio |
56 | 53 | #endif /* CONFIG_PCI */ | |
57 | /* Extract an address from a device, returns the region size and | ||
58 | * the address space flags too. The PCI version uses a BAR number | ||
59 | * instead of an absolute index | ||
60 | */ | ||
61 | extern const u32 *of_get_address(struct device_node *dev, int index, | ||
62 | u64 *size, unsigned int *flags); | ||
63 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
64 | u64 *size, unsigned int *flags); | ||
65 | |||
66 | /* Get an address as a resource. Note that if your address is | ||
67 | * a PIO address, the conversion will fail if the physical address | ||
68 | * can't be internally converted to an IO token with | ||
69 | * pci_address_to_pio(), that is because it's either called to early | ||
70 | * or it can't be matched to any host bridge IO space | ||
71 | */ | ||
72 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
73 | struct resource *r); | ||
74 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
75 | struct resource *r); | ||
76 | 54 | ||
77 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and | 55 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and |
78 | * size parameters. | 56 | * size parameters. |
@@ -88,69 +66,6 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | |||
88 | /* Get the MAC address */ | 66 | /* Get the MAC address */ |
89 | extern const void *of_get_mac_address(struct device_node *np); | 67 | extern const void *of_get_mac_address(struct device_node *np); |
90 | 68 | ||
91 | /* | ||
92 | * OF interrupt mapping | ||
93 | */ | ||
94 | |||
95 | /* This structure is returned when an interrupt is mapped. The controller | ||
96 | * field needs to be put() after use | ||
97 | */ | ||
98 | |||
99 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
100 | |||
101 | struct of_irq { | ||
102 | struct device_node *controller; /* Interrupt controller node */ | ||
103 | u32 size; /* Specifier size */ | ||
104 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
105 | }; | ||
106 | |||
107 | /** | ||
108 | * of_irq_map_init - Initialize the irq remapper | ||
109 | * @flags: flags defining workarounds to enable | ||
110 | * | ||
111 | * Some machines have bugs in the device-tree which require certain workarounds | ||
112 | * to be applied. Call this before any interrupt mapping attempts to enable | ||
113 | * those workarounds. | ||
114 | */ | ||
115 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
116 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
117 | |||
118 | extern void of_irq_map_init(unsigned int flags); | ||
119 | |||
120 | /** | ||
121 | * of_irq_map_raw - Low level interrupt tree parsing | ||
122 | * @parent: the device interrupt parent | ||
123 | * @intspec: interrupt specifier ("interrupts" property of the device) | ||
124 | * @ointsize: size of the passed in interrupt specifier | ||
125 | * @addr: address specifier (start of "reg" property of the device) | ||
126 | * @out_irq: structure of_irq filled by this function | ||
127 | * | ||
128 | * Returns 0 on success and a negative number on error | ||
129 | * | ||
130 | * This function is a low-level interrupt tree walking function. It | ||
131 | * can be used to do a partial walk with synthetized reg and interrupts | ||
132 | * properties, for example when resolving PCI interrupts when no device | ||
133 | * node exist for the parent. | ||
134 | * | ||
135 | */ | ||
136 | |||
137 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | ||
138 | u32 ointsize, const u32 *addr, | ||
139 | struct of_irq *out_irq); | ||
140 | |||
141 | /** | ||
142 | * of_irq_map_one - Resolve an interrupt for a device | ||
143 | * @device: the device whose interrupt is to be resolved | ||
144 | * @index: index of the interrupt to resolve | ||
145 | * @out_irq: structure of_irq filled by this function | ||
146 | * | ||
147 | * This function resolves an interrupt, walking the tree, for a given | ||
148 | * device-tree node. It's the high level pendant to of_irq_map_raw(). | ||
149 | * It also implements the workarounds for OldWolrd Macs. | ||
150 | */ | ||
151 | extern int of_irq_map_one(struct device_node *device, int index, | ||
152 | struct of_irq *out_irq); | ||
153 | |||
154 | /** | 69 | /** |
155 | * of_irq_map_pci - Resolve the interrupt for a PCI device | 70 | * of_irq_map_pci - Resolve the interrupt for a PCI device |
156 | * @pdev: the device whose interrupt is to be resolved | 71 | * @pdev: the device whose interrupt is to be resolved |
@@ -163,20 +78,18 @@ extern int of_irq_map_one(struct device_node *device, int index, | |||
163 | * resolving using the OF tree walking. | 78 | * resolving using the OF tree walking. |
164 | */ | 79 | */ |
165 | struct pci_dev; | 80 | struct pci_dev; |
81 | struct of_irq; | ||
166 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | 82 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
167 | 83 | ||
168 | extern int of_irq_to_resource(struct device_node *dev, int index, | ||
169 | struct resource *r); | ||
170 | |||
171 | /** | ||
172 | * of_iomap - Maps the memory mapped IO for a given device_node | ||
173 | * @device: the device whose io range will be mapped | ||
174 | * @index: index of the io range | ||
175 | * | ||
176 | * Returns a pointer to the mapped memory | ||
177 | */ | ||
178 | extern void __iomem *of_iomap(struct device_node *device, int index); | ||
179 | |||
180 | #endif /* __ASSEMBLY__ */ | 84 | #endif /* __ASSEMBLY__ */ |
181 | #endif /* __KERNEL__ */ | 85 | #endif /* __KERNEL__ */ |
86 | |||
87 | /* These includes are put at the bottom because they may contain things | ||
88 | * that are overridden by this file. Ideally they shouldn't be included | ||
89 | * by this file, but there are a bunch of .c files that currently depend | ||
90 | * on it. Eventually they will be cleaned up. */ | ||
91 | #include <linux/of_fdt.h> | ||
92 | #include <linux/of_irq.h> | ||
93 | #include <linux/platform_device.h> | ||
94 | |||
182 | #endif /* _ASM_MICROBLAZE_PROM_H */ | 95 | #endif /* _ASM_MICROBLAZE_PROM_H */ |
diff --git a/arch/microblaze/include/asm/topology.h b/arch/microblaze/include/asm/topology.h index 96bcea5a9920..5428f333a02c 100644 --- a/arch/microblaze/include/asm/topology.h +++ b/arch/microblaze/include/asm/topology.h | |||
@@ -1,11 +1 @@ | |||
1 | #include <asm-generic/topology.h> | #include <asm-generic/topology.h> | |
2 | |||
3 | #ifndef _ASM_MICROBLAZE_TOPOLOGY_H | ||
4 | #define _ASM_MICROBLAZE_TOPOLOGY_H | ||
5 | |||
6 | struct device_node; | ||
7 | static inline int of_node_to_nid(struct device_node *device) | ||
8 | { | ||
9 | return 0; | ||
10 | } | ||
11 | #endif /* _ASM_MICROBLAZE_TOPOLOGY_H */ | ||