diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/setup.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index ec341707e41b..8d75ea21296f 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <asm/smp.h> | 63 | #include <asm/smp.h> |
64 | #include <asm/firmware.h> | 64 | #include <asm/firmware.h> |
65 | #include <asm/eeh.h> | 65 | #include <asm/eeh.h> |
66 | #include <asm/pSeries_reconfig.h> | ||
66 | 67 | ||
67 | #include "plpar_wrappers.h" | 68 | #include "plpar_wrappers.h" |
68 | #include "pseries.h" | 69 | #include "pseries.h" |
@@ -254,6 +255,29 @@ static void __init pseries_discover_pic(void) | |||
254 | " interrupt-controller\n"); | 255 | " interrupt-controller\n"); |
255 | } | 256 | } |
256 | 257 | ||
258 | static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) | ||
259 | { | ||
260 | struct device_node *np = node; | ||
261 | struct pci_dn *pci = NULL; | ||
262 | int err = NOTIFY_OK; | ||
263 | |||
264 | switch (action) { | ||
265 | case PSERIES_RECONFIG_ADD: | ||
266 | pci = np->parent->data; | ||
267 | if (pci) | ||
268 | update_dn_pci_info(np, pci->phb); | ||
269 | break; | ||
270 | default: | ||
271 | err = NOTIFY_DONE; | ||
272 | break; | ||
273 | } | ||
274 | return err; | ||
275 | } | ||
276 | |||
277 | static struct notifier_block pci_dn_reconfig_nb = { | ||
278 | .notifier_call = pci_dn_reconfig_notifier, | ||
279 | }; | ||
280 | |||
257 | static void __init pSeries_setup_arch(void) | 281 | static void __init pSeries_setup_arch(void) |
258 | { | 282 | { |
259 | /* Discover PIC type and setup ppc_md accordingly */ | 283 | /* Discover PIC type and setup ppc_md accordingly */ |
@@ -271,6 +295,7 @@ static void __init pSeries_setup_arch(void) | |||
271 | /* Find and initialize PCI host bridges */ | 295 | /* Find and initialize PCI host bridges */ |
272 | init_pci_config_tokens(); | 296 | init_pci_config_tokens(); |
273 | find_and_init_phbs(); | 297 | find_and_init_phbs(); |
298 | pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb); | ||
274 | eeh_init(); | 299 | eeh_init(); |
275 | 300 | ||
276 | pSeries_nvram_init(); | 301 | pSeries_nvram_init(); |