patch-2.1.101 linux/arch/ppc/kernel/pmac_setup.c

Next file: linux/arch/ppc/kernel/pmac_support.c
Previous file: linux/arch/ppc/kernel/pmac_pci.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.100/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
@@ -22,6 +22,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -47,6 +48,8 @@
 #include <asm/ide.h>
 #include <asm/pci-bridge.h>
 #include <asm/adb.h>
+#include <asm/cuda.h>
+#include <asm/pmu.h>
 #include <asm/mediabay.h>
 #include <asm/ohare.h>
 #include <asm/mediabay.h>
@@ -58,10 +61,44 @@
 
 #define DEFAULT_ROOT_DEVICE 0x0801	/* sda1 - slightly silly choice */
 
+extern void zs_kgdb_hook(int tty_num);
 static void ohare_init(void);
 
-void
-pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p)
+__pmac
+
+int
+pmac_get_cpuinfo(char *buffer)
+{
+	int len;
+	/* should find motherboard type here as well */
+	len = sprintf(buffer,"machine\t\t: PowerMac\n");
+	return len;
+}
+
+#ifdef CONFIG_SCSI
+/* Find the device number for the disk (if any) at target tgt
+   on host adaptor host.
+   XXX this really really should be in drivers/scsi/sd.c. */
+#include <linux/blkdev.h>
+#include "../../../drivers/scsi/scsi.h"
+#include "../../../drivers/scsi/sd.h"
+#include "../../../drivers/scsi/hosts.h"
+
+kdev_t sd_find_target(void *host, int tgt)
+{
+    Scsi_Disk *dp;
+    int i;
+
+    for (dp = rscsi_disks, i = 0; i < sd_template.dev_max; ++i, ++dp)
+        if (dp->device != NULL && dp->device->host == host
+            && dp->device->id == tgt)
+            return MKDEV(SCSI_DISK_MAJOR, i << 4);
+    return 0;
+}
+#endif
+
+__initfunc(void
+pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p))
 {
 	struct device_node *cpu;
 	int *fp;
@@ -94,6 +131,13 @@
 
 	ohare_init();
 
+#ifdef CONFIG_KGDB
+	zs_kgdb_hook(0);
+#endif
+
+	find_via_cuda();
+	find_via_pmu();
+
 #ifdef CONFIG_FB
 	/* Frame buffer device based console */
 	conswitchp = &fb_con;
@@ -102,7 +146,7 @@
 
 static volatile u32 *feature_addr;
 
-static void ohare_init(void)
+__initfunc(static void ohare_init(void))
 {
 	struct device_node *np;
 
@@ -134,28 +178,20 @@
 int boot_part;
 kdev_t boot_dev;
 
-unsigned long
-powermac_init(unsigned long mem_start, unsigned long mem_end)
+__initfunc(void powermac_init(void))
 {
-#ifdef CONFIG_KGDB
-	extern void zs_kgdb_hook(int tty_num);
-	zs_kgdb_hook(0);
-#endif
 	adb_init();
 	pmac_nvram_init();
 	if (_machine == _MACH_Pmac) {
-		pmac_read_rtc_time();
 		media_bay_init();
 	}
 #ifdef CONFIG_PMAC_CONSOLE
 	pmac_find_display();
 #endif
-
-	return mem_start;
 }
 
-void
-note_scsi_host(struct device_node *node, void *host)
+__initfunc(void
+note_scsi_host(struct device_node *node, void *host))
 {
 	int l;
 	char *p;
@@ -183,29 +219,7 @@
 	}
 }
 
-#ifdef CONFIG_SCSI
-/* Find the device number for the disk (if any) at target tgt
-   on host adaptor host.
-   XXX this really really should be in drivers/scsi/sd.c. */
-#include <linux/blkdev.h>
-#include "../../../drivers/scsi/scsi.h"
-#include "../../../drivers/scsi/sd.h"
-#include "../../../drivers/scsi/hosts.h"
-
-kdev_t sd_find_target(void *host, int tgt)
-{
-    Scsi_Disk *dp;
-    int i;
-
-    for (dp = rscsi_disks, i = 0; i < sd_template.dev_max; ++i, ++dp)
-        if (dp->device != NULL && dp->device->host == host
-            && dp->device->id == tgt)
-            return MKDEV(SCSI_DISK_MAJOR, i << 4);
-    return 0;
-}
-#endif
-
-void find_boot_device(void)
+__initfunc(void find_boot_device(void))
 {
 	kdev_t dev;
 
@@ -223,7 +237,7 @@
 	/* XXX should cope with booting from IDE also */
 }
 
-void note_bootable_part(kdev_t dev, int part)
+__initfunc(void note_bootable_part(kdev_t dev, int part))
 {
 	static int found_boot = 0;
 
@@ -243,7 +257,7 @@
 ide_ioreg_t pmac_ide_regbase[MAX_HWIFS];
 int pmac_ide_irq[MAX_HWIFS];
 
-void pmac_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+__initfunc(void pmac_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq))
 {
 	int i;
 
@@ -268,7 +282,7 @@
 	}
 }
 
-void pmac_ide_probe(void)
+__initfunc(void pmac_ide_probe(void))
 {
 	struct device_node *np;
 	int i;
@@ -325,11 +339,3 @@
 }
 #endif /* CONFIG_BLK_DEV_IDE */
 
-int
-pmac_get_cpuinfo(char *buffer)
-{
-	int len;
-	/* should find motherboard type here as well */
-	len = sprintf(buffer,"machine\t\t: PowerMac\n");
-	return len;
-}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov