[OpenBIOS] [PATCH 5/7] PPC: Add U3 based Mac machine

Alexander Graf agraf at suse.de
Mon Feb 22 17:14:46 CET 2010


Linux on PPC64 knows only so many chipsets. One of the is the U3. So
we can use that when we're emulating a PPC64 machine, making Linux happy.

Signed-off-by: Alexander Graf <agraf at suse.de>
---
 arch/ppc/qemu/init.c   |   23 +++++++++++------------
 drivers/pci_database.c |    8 +++++++-
 include/openbios/pci.h |    1 +
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c
index 0363689..2243f72 100644
--- a/arch/ppc/qemu/init.c
+++ b/arch/ppc/qemu/init.c
@@ -63,6 +63,7 @@ enum {
     ARCH_PREP = 0,
     ARCH_MAC99,
     ARCH_HEATHROW,
+    ARCH_MAC99_U3,
 };
 
 int is_apple(void)
@@ -77,7 +78,8 @@ int is_oldworld(void)
 
 int is_newworld(void)
 {
-	return machine_id == ARCH_MAC99;
+	return (machine_id == ARCH_MAC99) ||
+               (machine_id == ARCH_MAC99_U3);
 }
 
 static const pci_arch_t known_arch[] = {
@@ -95,6 +97,13 @@ static const pci_arch_t known_arch[] = {
 			  0xf2000000, 0x00800000, 0x00000000, 0x01000000,
 			  { 8, 9, 10, 11 }
 		       },
+        [ARCH_MAC99_U3] = { "MAC99_U3", PCI_VENDOR_ID_APPLE,
+                            PCI_DEVICE_ID_APPLE_U3_AGP,
+                            0xf0800000, 0xf0c00000,
+                            0xf0000000, 0x02000000, 0x80000000, 0x10000000,
+                            0xf2000000, 0x00800000, 0x00000000, 0x01000000,
+                            { 0x1b, 0x1c, 0x1d, 0x1e }
+                          },
         [ARCH_HEATHROW] = { "HEATHROW", PCI_VENDOR_ID_MOTOROLA,
                             PCI_DEVICE_ID_MOTOROLA_MPC106,
                             0xfec00000, 0xfee00000,
@@ -557,6 +566,7 @@ arch_of_init( void )
 		break;
 
 	case ARCH_MAC99:
+	case ARCH_MAC99_U3:
 	case ARCH_PREP:
 	default:
 
@@ -597,17 +607,6 @@ arch_of_init( void )
 	push_str("system-id");
 	fword("property");
 
-	/* pci info */
-
-	if (machine_id == ARCH_MAC99) {
-		push_str("/pci");
-		fword("find-device");
-		push_str("u3-agp");
-		fword("encode-string");
-		push_str("compatible");
-		fword("property");
-	}
-
 	/* memory info */
 
 	push_str("/memory");
diff --git a/drivers/pci_database.c b/drivers/pci_database.c
index 4682a12..56fd1bb 100644
--- a/drivers/pci_database.c
+++ b/drivers/pci_database.c
@@ -280,6 +280,12 @@ static const pci_subclass_t mem_subclass[] = {
 
 static const pci_dev_t hbrg_devices[] = {
     {
+        PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U3_AGP, NULL,
+        "pci", "AAPL,UniNorth", "u3-agp\0",
+        3, 2, 1,
+        host_config_cb, NULL,
+    },
+    {
         PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_AGP, NULL,
         "pci", "AAPL,UniNorth", "uni-north\0",
         3, 2, 1,
@@ -1084,7 +1090,7 @@ static const pci_dev_t misc_pci[] = {
     {
         PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_KEYL,
         "mac-io", "mac-io", "AAPL,Keylargo", "Keylargo\0",
-        1, 1, 2,
+        1, 1, 1,
         &macio_keylargo_config_cb, NULL,
     },
     {
diff --git a/include/openbios/pci.h b/include/openbios/pci.h
index 4f87ded..8814b7a 100644
--- a/include/openbios/pci.h
+++ b/include/openbios/pci.h
@@ -187,6 +187,7 @@ extern const pci_arch_t *arch;
 #define PCI_DEVICE_ID_APPLE_UNI_N_PCI    0x001f
 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP    0x0020
 #define PCI_DEVICE_ID_APPLE_UNI_N_KEYL   0x0022
+#define PCI_DEVICE_ID_APPLE_U3_AGP       0x004b
 
 #define PCI_VENDOR_ID_SUN                0x108e
 #define PCI_DEVICE_ID_SUN_EBUS           0x1000
-- 
1.6.0.2




More information about the OpenBIOS mailing list