[OpenBIOS] r421 - openbios-devel/drivers

svn at openbios.org svn at openbios.org
Sat Jan 24 08:31:46 CET 2009


Author: blueswirl
Date: 2009-01-24 08:31:45 +0100 (Sat, 24 Jan 2009)
New Revision: 421

Modified:
   openbios-devel/drivers/obio.c
Log:
Add slavioconfig only for SS-4, SS-5 and S3GX

Modified: openbios-devel/drivers/obio.c
===================================================================
--- openbios-devel/drivers/obio.c	2009-01-23 20:09:26 UTC (rev 420)
+++ openbios-devel/drivers/obio.c	2009-01-24 07:31:45 UTC (rev 421)
@@ -116,7 +116,7 @@
 }
 
 static void
-ob_eccmemctl_init(void)
+ob_eccmemctl_init(uint64_t base)
 {
     uint32_t version, *regs;
     const char *mc_type;
@@ -535,17 +535,27 @@
     for (;;);
 }
 
-static void dummy_mach_init(void)
+static void dummy_mach_init(uint64_t base)
 {
 }
 
+static void
+ss5_init(uint64_t base)
+{
+    ob_new_obio_device("slavioconfig", NULL);
+
+    ob_reg(base, SLAVIO_SCONFIG, SCONFIG_REGS, 0);
+
+    fword("finish-device");
+}
+
 struct machdef {
     uint16_t machine_id;
     const char *banner_name;
     const char *model;
     const char *name;
     int mid_offset;
-    void (*initfn)(void);
+    void (*initfn)(uint64_t base);
 };
 
 static const struct machdef sun4m_defs[] = {
@@ -555,7 +565,7 @@
         .model = "SUNW,501-3059",
         .name = "SUNW,SPARCstation-5",
         .mid_offset = 0,
-        .initfn = dummy_mach_init,
+        .initfn = ss5_init,
     },
     {
         .machine_id = 33,
@@ -579,7 +589,7 @@
         .model = "SUNW,501-2572",
         .name = "SUNW,SPARCstation-4",
         .mid_offset = 0,
-        .initfn = dummy_mach_init,
+        .initfn = ss5_init,
     },
     {
         .machine_id = 36,
@@ -595,7 +605,7 @@
         .model = "S3",
         .name = "Tadpole_S3GX",
         .mid_offset = 0,
-        .initfn = dummy_mach_init,
+        .initfn = ss5_init,
     },
     {
         .machine_id = 64,
@@ -768,8 +778,6 @@
 
     mach = id_machine(machine_id);
 
-    mach->initfn();
-
     push_str(mach->banner_name);
     fword("encode-string");
     push_str("banner-name");
@@ -786,6 +794,8 @@
     push_str("name");
     fword("property");
 
+    mach->initfn(base);
+
     // Add cpus
     temp = fw_cfg_read_i32(FW_CFG_NB_CPUS);
 
@@ -968,18 +978,7 @@
     fword("finish-device");
 }
 
-
 static void
-ob_sconfig_init(uint64_t base, uint64_t offset)
-{
-    ob_new_obio_device("slavioconfig", NULL);
-
-    ob_reg(base, offset, SCONFIG_REGS, 0);
-
-    fword("finish-device");
-}
-
-static void
 ob_auxio_init(uint64_t base, uint64_t offset)
 {
     ob_new_obio_device("auxio", NULL);
@@ -1262,8 +1261,6 @@
     if (fd_offset != (unsigned long) -1)
         ob_fd_init(slavio_base, fd_offset, FD_INTR);
 
-    ob_sconfig_init(slavio_base, SLAVIO_SCONFIG);
-
     ob_auxio_init(slavio_base, aux1_offset);
 
     if (aux2_offset != (unsigned long) -1)




More information about the OpenBIOS mailing list