summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
commit71743ba29dea115cd948a74dc5e1182c2e27c6f6 (patch)
tree564d71b11a9e9e2750863ed7f3b17745eda3c455
parentf4d68d907ae46cc1e4a508359310ce73710deab3 (diff)
downloadqemu-openbios-71743ba29dea115cd948a74dc5e1182c2e27c6f6.tar.gz
ppc: move New World uninorth and nvram device node creation to the root device
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>
-rw-r--r--arch/ppc/qemu/init.c12
-rw-r--r--drivers/macio.c5
-rw-r--r--drivers/macio.h1
-rw-r--r--drivers/pci.c1
-rw-r--r--include/drivers/drivers.h2
5 files changed, 14 insertions, 7 deletions
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c
index f72728cc..9056975e 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 33f29f18..62a1e74d 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 925b8812..36cc4bf7 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 d4971095..c2da62fe 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 e568f288..3d6fa122 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);