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 | 7 +++++++ drivers/macio.c | 5 +---- drivers/macio.h | 1 - drivers/pci.c | 1 - include/drivers/drivers.h | 2 ++ 5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index f72728c..d58dae2 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -860,6 +860,13 @@ arch_of_init(void)
#ifdef CONFIG_DRIVER_PCI ob_pci_init(); + + if (machine_id == ARCH_MAC99 || machine_id == ARCH_MAC99_U3) { + ob_unin_init(); + + /* The NewWorld NVRAM is not located in the MacIO device */ + macio_nvram_init("/", 0); + } #endif
printk("\n"); diff --git a/drivers/macio.c b/drivers/macio.c index 5a94252..c01cdfd 100644 --- a/drivers/macio.c +++ b/drivers/macio.c @@ -261,7 +261,7 @@ NODE_METHODS(ob_macio) = { { "dma-sync", ob_macio_dma_sync }, };
-static void +void ob_unin_init(void) { phandle_t dnode; @@ -394,12 +394,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 66e7594..d7047d1 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);