diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-30 06:12:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-30 06:14:14 -0400 |
commit | c8049966b7f903ce61e94efbbddf581cf8860b85 (patch) | |
tree | 991493610dd07896da5b62079bac78c32a110dfa /arch/sparc64/kernel/pci.c | |
parent | edbe805b2b1044659e0727136213bdf42bd1b9d0 (diff) |
sparc64: Convert FIRE PCI controller driver into a real driver.
And now all the by-hand PCI controller probing junk in pci.c can die too.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index c2ff2de4da5a..2da32e4c985b 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -164,79 +164,6 @@ void pci_config_write32(u32 *addr, u32 val) | |||
164 | spin_unlock_irqrestore(&pci_poke_lock, flags); | 164 | spin_unlock_irqrestore(&pci_poke_lock, flags); |
165 | } | 165 | } |
166 | 166 | ||
167 | /* Probe for all PCI controllers in the system. */ | ||
168 | extern void fire_pci_init(struct device_node *, const char *); | ||
169 | |||
170 | static struct { | ||
171 | char *model_name; | ||
172 | void (*init)(struct device_node *, const char *); | ||
173 | } pci_controller_table[] __initdata = { | ||
174 | { "pciex108e,80f0", fire_pci_init }, | ||
175 | }; | ||
176 | #define PCI_NUM_CONTROLLER_TYPES ARRAY_SIZE(pci_controller_table) | ||
177 | |||
178 | static int __init pci_controller_init(const char *model_name, int namelen, struct device_node *dp) | ||
179 | { | ||
180 | int i; | ||
181 | |||
182 | for (i = 0; i < PCI_NUM_CONTROLLER_TYPES; i++) { | ||
183 | if (!strncmp(model_name, | ||
184 | pci_controller_table[i].model_name, | ||
185 | namelen)) { | ||
186 | pci_controller_table[i].init(dp, model_name); | ||
187 | return 1; | ||
188 | } | ||
189 | } | ||
190 | |||
191 | return 0; | ||
192 | } | ||
193 | |||
194 | static int __init pci_controller_scan(int (*handler)(const char *, int, struct device_node *)) | ||
195 | { | ||
196 | struct device_node *dp; | ||
197 | int count = 0; | ||
198 | |||
199 | for_each_node_by_name(dp, "pci") { | ||
200 | struct property *prop; | ||
201 | int len; | ||
202 | |||
203 | prop = of_find_property(dp, "model", &len); | ||
204 | if (!prop) | ||
205 | prop = of_find_property(dp, "compatible", &len); | ||
206 | |||
207 | if (prop) { | ||
208 | const char *model = prop->value; | ||
209 | int item_len = 0; | ||
210 | |||
211 | /* Our value may be a multi-valued string in the | ||
212 | * case of some compatible properties. For sanity, | ||
213 | * only try the first one. | ||
214 | */ | ||
215 | while (model[item_len] && len) { | ||
216 | len--; | ||
217 | item_len++; | ||
218 | } | ||
219 | |||
220 | if (handler(model, item_len, dp)) | ||
221 | count++; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | return count; | ||
226 | } | ||
227 | |||
228 | /* Find each controller in the system, attach and initialize | ||
229 | * software state structure for each and link into the | ||
230 | * pci_pbm_root. Setup the controller enough such | ||
231 | * that bus scanning can be done. | ||
232 | */ | ||
233 | static void __init pci_controller_probe(void) | ||
234 | { | ||
235 | printk("PCI: Probing for controllers.\n"); | ||
236 | |||
237 | pci_controller_scan(pci_controller_init); | ||
238 | } | ||
239 | |||
240 | static int ofpci_verbose; | 167 | static int ofpci_verbose; |
241 | 168 | ||
242 | static int __init ofpci_debug(char *str) | 169 | static int __init ofpci_debug(char *str) |
@@ -773,29 +700,6 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm) | |||
773 | return bus; | 700 | return bus; |
774 | } | 701 | } |
775 | 702 | ||
776 | static void __init pci_scan_each_controller_bus(void) | ||
777 | { | ||
778 | struct pci_pbm_info *pbm; | ||
779 | |||
780 | for (pbm = pci_pbm_root; pbm; pbm = pbm->next) { | ||
781 | if (pbm->scan_bus) | ||
782 | pbm->scan_bus(pbm); | ||
783 | } | ||
784 | } | ||
785 | |||
786 | static int __init pcibios_init(void) | ||
787 | { | ||
788 | pci_controller_probe(); | ||
789 | if (pci_pbm_root == NULL) | ||
790 | return 0; | ||
791 | |||
792 | pci_scan_each_controller_bus(); | ||
793 | |||
794 | return 0; | ||
795 | } | ||
796 | |||
797 | subsys_initcall(pcibios_init); | ||
798 | |||
799 | void __devinit pcibios_fixup_bus(struct pci_bus *pbus) | 703 | void __devinit pcibios_fixup_bus(struct pci_bus *pbus) |
800 | { | 704 | { |
801 | struct pci_pbm_info *pbm = pbus->sysdata; | 705 | struct pci_pbm_info *pbm = pbus->sysdata; |