Whilst the NVRAM device node exists under the mac-io device node for Old World Macs, both itself and the Uninorth device node exist under the root device node on New World Macs.
Move creation of both device nodes to arch_of_init() for New World machines to enable the active package and current instance to be set correctly during device tree construction.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- arch/ppc/qemu/init.c | 12 +++++++++++- drivers/macio.c | 5 +---- drivers/macio.h | 1 - drivers/pci.c | 1 - include/drivers/drivers.h | 2 ++ 5 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index f72728c..9056975 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -859,7 +859,17 @@ arch_of_init(void) feval("['] ppc-dma-sync to (dma-sync)");
#ifdef CONFIG_DRIVER_PCI - ob_pci_init(); + switch (machine_id) { + case ARCH_MAC99: + case ARCH_MAC99_U3: + /* The NewWorld NVRAM is not located in the MacIO device */ + macio_nvram_init("/", 0); + ob_pci_init(); + ob_unin_init(); + break; + default: + ob_pci_init(); + } #endif
printk("\n"); diff --git a/drivers/macio.c b/drivers/macio.c index 33f29f1..62a1e74 100644 --- a/drivers/macio.c +++ b/drivers/macio.c @@ -262,7 +262,7 @@ NODE_METHODS(ob_macio) = { { "dma-sync", ob_macio_dma_sync }, };
-static void +void ob_unin_init(void) { phandle_t dnode; @@ -395,12 +395,9 @@ ob_macio_keylargo_init(const char *path, phys_addr_t addr) cuda_init(path, addr); }
- /* The NewWorld NVRAM is not located in the MacIO device */ - macio_nvram_init("/", 0); escc_init(path, addr); macio_ide_init(path, addr, 2); openpic_init(path, addr); - ob_unin_init();
aliases = find_dev("/aliases"); set_property(aliases, "mac-io", path, strlen(path) + 1); diff --git a/drivers/macio.h b/drivers/macio.h index 925b881..36cc4bf 100644 --- a/drivers/macio.h +++ b/drivers/macio.h @@ -2,4 +2,3 @@ extern phandle_t pic_handle;
void ob_macio_heathrow_init(const char *path, phys_addr_t addr); void ob_macio_keylargo_init(const char *path, phys_addr_t addr); -void macio_nvram_init(const char *path, phys_addr_t addr); diff --git a/drivers/pci.c b/drivers/pci.c index d497109..c2da62f 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -31,7 +31,6 @@ #include "pci.h" #include "pci_database.h" #ifdef CONFIG_DRIVER_MACIO -#include "cuda.h" #include "macio.h" #endif #ifdef CONFIG_DRIVER_USB diff --git a/include/drivers/drivers.h b/include/drivers/drivers.h index e568f28..3d6fa12 100644 --- a/include/drivers/drivers.h +++ b/include/drivers/drivers.h @@ -149,6 +149,8 @@ void ob_virtio_init(const char *path, const char *dev_name, uint64_t common_cfg, int macio_get_nvram_size(void); void macio_nvram_put(char *buf); void macio_nvram_get(char *buf); +void macio_nvram_init(const char *path, phys_addr_t addr); +void ob_unin_init(void);
/* drivers/timer.c */ void setup_timers(void);