|
From: James S. <jsi...@us...> - 2001-10-06 16:11:17
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv25708/linux/arch/ppc/kernel
Modified Files:
apus_setup.c chrp_setup.c pmac_setup.c prep_setup.c
Log Message:
Synced to 2.4.10
Index: apus_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel/apus_setup.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- apus_setup.c 2001/10/05 03:58:58 1.3
+++ apus_setup.c 2001/10/06 16:11:12 1.4
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.apus_setup.c 1.14 07/06/01 09:19:28 trini
+ * BK Id: SCCS/s.apus_setup.c 1.20 09/08/01 15:47:42 paulus
*/
/*
* linux/arch/ppc/kernel/apus_setup.c
@@ -75,7 +75,6 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/machdep.h>
-#include <asm/init.h>
#include "local_irq.h"
@@ -561,32 +560,8 @@
/*
* IDE stuff.
*/
-void ide_insw(ide_ioreg_t port, void *buf, int ns);
-void ide_outsw(ide_ioreg_t port, void *buf, int ns);
-void
-apus_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
- ide_insw(port, buf, ns);
-}
-
-void
-apus_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
- ide_outsw(port, buf, ns);
-}
-int
-apus_ide_default_irq(ide_ioreg_t base)
-{
- return 0;
-}
-
-ide_ioreg_t
-apus_ide_default_io_base(int index)
-{
- return 0;
-}
-
+#if 0 /* no longer used -- paulus */
void
apus_ide_fix_driveid(struct hd_driveid *id)
{
@@ -632,6 +607,7 @@
}
}
}
+#endif /* 0 */
__init
void apus_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
@@ -952,6 +928,15 @@
return total;
}
+static void __init
+apus_map_io(void)
+{
+ /* Map PPC exception vectors. */
+ io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
+ /* Map chip and ZorroII memory */
+ io_block_mapping(zTwoBase, 0x00000000, 0x01000000, _PAGE_IO);
+}
+
__init
void apus_init_IRQ(void)
{
@@ -974,8 +959,8 @@
}
__init
-void apus_init(unsigned long r3, unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7)
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+ unsigned long r6, unsigned long r7)
{
extern int parse_bootinfo(const struct bi_record *);
extern char _end[];
@@ -1026,19 +1011,13 @@
ppc_md.calibrate_decr = apus_calibrate_decr;
ppc_md.find_end_of_memory = apus_find_end_of_memory;
+ ppc_md.setup_io_mappings = apus_map_io;
ppc_md.nvram_read_val = NULL;
ppc_md.nvram_write_val = NULL;
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
- ppc_ide_md.insw = apus_ide_insw;
- ppc_ide_md.outsw = apus_ide_outsw;
- ppc_ide_md.default_irq = apus_ide_default_irq;
- ppc_ide_md.default_io_base = apus_ide_default_io_base;
- ppc_ide_md.fix_driveid = apus_ide_fix_driveid;
ppc_ide_md.ide_init_hwif = apus_ide_init_hwif_ports;
-
- ppc_ide_md.io_base = _IO_BASE;
#endif
}
Index: chrp_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel/chrp_setup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- chrp_setup.c 2001/07/29 18:24:12 1.2
+++ chrp_setup.c 2001/10/06 16:11:12 1.3
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.chrp_setup.c 1.36 09/08/01 15:47:42 paulus
*/
/*
* linux/arch/ppc/kernel/setup.c
@@ -31,7 +31,6 @@
#include <linux/init.h>
#include <linux/blk.h>
#include <linux/ioport.h>
-#include <linux/console.h>
#include <linux/pci.h>
#include <linux/version.h>
#include <linux/adb.h>
@@ -50,8 +49,9 @@
#include <asm/machdep.h>
#include <asm/irq.h>
#include <asm/hydra.h>
-#include <asm/init.h>
+#include <asm/sections.h>
#include <asm/time.h>
+#include <asm/btext.h>
#include "local_irq.h"
#include "i8259.h"
@@ -67,19 +67,21 @@
void chrp_event_scan(void);
void rtas_display_progress(char *, unsigned short);
void rtas_indicator_progress(char *, unsigned short);
-void bootx_text_progress(char *, unsigned short);
+void btext_progress(char *, unsigned short);
extern unsigned long pmac_find_end_of_memory(void);
-
extern kdev_t boot_dev;
-
extern PTE *Hash, *Hash_end;
extern unsigned long Hash_size, Hash_mask;
extern int probingmem;
extern unsigned long loops_per_jiffy;
-extern int bootx_text_mapped;
static int max_width;
+#ifdef CONFIG_SMP
+extern struct smp_ops_t chrp_smp_ops;
+extern struct smp_ops_t xics_smp_ops;
+#endif
+
static const char *gg2_memtypes[4] = {
"FPM", "SDRAM", "EDO", "BEDO"
};
@@ -231,9 +233,6 @@
chrp_find_bridges();
#ifndef CONFIG_PPC64BRIDGE
- /* PCI bridge config space access area -
- * appears to be not in devtree on longtrail. */
- ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
/*
* Temporary fixes for PCI devices.
* -- Geert
@@ -242,7 +241,6 @@
#endif /* CONFIG_PPC64BRIDGE */
-#ifndef CONFIG_POWER4
/* Some IBM machines don't have the hydra -- Cort */
if (!OpenPIC_Addr) {
struct device_node *root;
@@ -259,7 +257,6 @@
OpenPIC_Addr = ioremap(opprop[n-1], 0x40000);
}
}
-#endif
/*
* Fix the Super I/O configuration
@@ -390,61 +387,14 @@
/*
* IDE stuff.
*/
-unsigned int chrp_ide_irq = 0;
-int chrp_ide_ports_known = 0;
-ide_ioreg_t chrp_ide_regbase[MAX_HWIFS];
-ide_ioreg_t chrp_idedma_regbase;
-void __chrp
-chrp_ide_probe(void)
-{
- struct pci_dev *pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL);
-
- chrp_ide_ports_known = 1;
-
- if(pdev) {
- chrp_ide_regbase[0]=pdev->resource[0].start;
- chrp_ide_regbase[1]=pdev->resource[2].start;
- chrp_idedma_regbase=pdev->resource[4].start;
- chrp_ide_irq=pdev->irq;
- }
-}
-
-void __chrp
-chrp_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
- ide_insw(port+_IO_BASE, buf, ns);
-}
-
-void __chrp
-chrp_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
- ide_outsw(port+_IO_BASE, buf, ns);
-}
-
-int __chrp
-chrp_ide_default_irq(ide_ioreg_t base)
-{
- if (chrp_ide_ports_known == 0)
- chrp_ide_probe();
- return chrp_ide_irq;
-}
-
-ide_ioreg_t __chrp
-chrp_ide_default_io_base(int index)
-{
- if (chrp_ide_ports_known == 0)
- chrp_ide_probe();
- return chrp_ide_regbase[index];
-}
-
-int __chrp
+static int __chrp
chrp_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
-void __chrp
+static void __chrp
chrp_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
@@ -452,14 +402,14 @@
request_region(from, extent, name);
}
-void __chrp
+static void __chrp
chrp_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
}
-void __chrp
+static void __chrp
chrp_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
ide_ioreg_t reg = data_port;
@@ -469,20 +419,42 @@
hw->io_ports[i] = reg;
reg += 1;
}
- if (ctrl_port) {
- hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+}
+#endif
+
+/*
+ * One of the main thing these mappings are needed for is so that
+ * xmon can get to the serial port early on. We probably should
+ * handle the machines with the mpc106 as well as the python (F50)
+ * and the GG2 (longtrail). Actually we should look in the device
+ * tree and do the right thing.
+ */
+static void __init
+chrp_map_io(void)
+{
+ char *name;
+
+ /*
+ * The code below tends to get removed, please don't take it out.
+ * The F50 needs this mapping and it you take it out I'll track you
+ * down and slap your hands. If it causes problems please email me.
+ * -- Cort <co...@fs...>
+ */
+ name = get_property(find_path_device("/"), "name", NULL);
+ if (name && strncmp(name, "IBM-70", 6) == 0
+ && strstr(name, "-F50")) {
+ io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
+ io_block_mapping(0x90000000, 0x90000000, 0x10000000, _PAGE_IO);
+ return;
} else {
- hw->io_ports[IDE_CONTROL_OFFSET] = 0;
+ io_block_mapping(0xf8000000, 0xf8000000, 0x04000000, _PAGE_IO);
}
- if (irq != NULL)
- hw->irq = chrp_ide_irq;
}
-#endif
-
void __init
- chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7)
+chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
+ unsigned long r6, unsigned long r7)
{
#ifdef CONFIG_BLK_DEV_INITRD
/* take care of initrd if we have one */
@@ -522,6 +494,7 @@
ppc_md.calibrate_decr = chrp_calibrate_decr;
ppc_md.find_end_of_memory = pmac_find_end_of_memory;
+ ppc_md.setup_io_mappings = chrp_map_io;
if (rtas_data) {
struct device_node *rtas;
@@ -540,22 +513,23 @@
}
}
#ifdef CONFIG_BOOTX_TEXT
- if (ppc_md.progress == NULL && bootx_text_mapped)
- ppc_md.progress = bootx_text_progress;
+ if (ppc_md.progress == NULL && boot_text_mapped)
+ ppc_md.progress = btext_progress;
#endif
+#ifdef CONFIG_SMP
+#ifndef CONFIG_POWER4
+ ppc_md.smp_ops = &chrp_smp_ops;
+#else
+ ppc_md.smp_ops = &xics_smp_ops;
+#endif /* CONFIG_POWER4 */
+#endif /* CONFIG_SMP */
+
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
- ppc_ide_md.insw = chrp_ide_insw;
- ppc_ide_md.outsw = chrp_ide_outsw;
- ppc_ide_md.default_irq = chrp_ide_default_irq;
- ppc_ide_md.default_io_base = chrp_ide_default_io_base;
ppc_ide_md.ide_check_region = chrp_ide_check_region;
ppc_ide_md.ide_request_region = chrp_ide_request_region;
ppc_ide_md.ide_release_region = chrp_ide_release_region;
- ppc_ide_md.fix_driveid = ppc_generic_ide_fix_driveid;
ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports;
-
- ppc_ide_md.io_base = _IO_BASE;
#endif
/*
@@ -600,7 +574,7 @@
#ifdef CONFIG_BOOTX_TEXT
void
-bootx_text_progress(char *s, unsigned short hex)
+btext_progress(char *s, unsigned short hex)
{
prom_print(s);
prom_print("\n");
Index: pmac_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel/pmac_setup.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pmac_setup.c 2001/10/05 03:58:58 1.4
+++ pmac_setup.c 2001/10/06 16:11:13 1.5
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.pmac_setup.c 1.24 07/06/01 14:49:51 trini
+ * BK Id: SCCS/s.pmac_setup.c 1.39 09/08/01 15:47:42 paulus
*/
/*
* linux/arch/ppc/kernel/setup.c
@@ -49,7 +49,7 @@
#include <linux/pmu.h>
#include <asm/processor.h>
-#include <asm/init.h>
+#include <asm/sections.h>
#include <asm/prom.h>
#include <asm/system.h>
#include <asm/pgtable.h>
@@ -62,6 +62,8 @@
#include <asm/machdep.h>
#include <asm/dma.h>
#include <asm/bootx.h>
+#include <asm/cputable.h>
+#include <asm/btext.h>
#include <asm/time.h>
#include "local_irq.h"
@@ -107,13 +109,16 @@
sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
#ifdef CONFIG_SMP
+extern struct smp_ops_t psurge_smp_ops;
+extern struct smp_ops_t core99_smp_ops;
+
volatile static long int core99_l2_cache;
-void __pmac
+void __init
core99_init_l2(void)
{
int cpu = smp_processor_id();
- if ( (_get_PVR() >> 16) != 8 && (_get_PVR() >> 16) != 12 )
+ if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
return;
if (cpu == 0){
@@ -240,6 +245,9 @@
{
struct device_node *cpu;
int *fp;
+ unsigned long pvr;
+
+ pvr = PVR_VER(mfspr(PVR));
/* Set loops_per_jiffy to a half-way reasonable value,
for use until calibrate_delay gets called. */
@@ -247,18 +255,12 @@
if (cpu != 0) {
fp = (int *) get_property(cpu, "clock-frequency", NULL);
if (fp != 0) {
- switch (_get_PVR() >> 16) {
- case 4: /* 604 */
- case 8: /* G3 */
- case 9: /* 604e */
- case 10: /* mach V (604ev5) */
- case 12: /* G4 */
- case 20: /* 620 */
+ if (pvr == 4 || pvr >= 8)
+ /* 604, G3, G4 etc. */
loops_per_jiffy = *fp / HZ;
- break;
- default: /* 601, 603, etc. */
+ else
+ /* 601, 603, etc. */
loops_per_jiffy = *fp / (2*HZ);
- }
} else
loops_per_jiffy = 50000000 / HZ;
}
@@ -266,14 +268,13 @@
/* this area has the CPU identification register
and some registers used by smp boards */
sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
- __ioremap(0xffc00000, 0x400000, pgprot_val(PAGE_READONLY));
ohare_init();
/* Lookup PCI hosts */
pmac_find_bridges();
/* Checks "l2cr-value" property in the registry */
- if ( (_get_PVR() >> 16) == 8 || (_get_PVR() >> 16) == 12 ) {
+ if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) {
struct device_node *np = find_devices("cpus");
if (np == 0)
np = find_type_devices("cpu");
@@ -305,9 +306,19 @@
#ifdef CONFIG_ADB_CUDA
find_via_cuda();
+#else
+ if (find_devices("via-cuda")) {
+ printk("WARNING ! Your machine is Cuda based but your kernel\n");
+ printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n");
+ }
#endif
#ifdef CONFIG_ADB_PMU
find_via_pmu();
+#else
+ if (find_devices("via-pmu")) {
+ printk("WARNING ! Your machine is PMU based but your kernel\n");
+ printk(" wasn't compiled with CONFIG_ADB_PMU option !\n");
+ }
#endif
#ifdef CONFIG_NVRAM
pmac_nvram_init();
@@ -318,6 +329,14 @@
else
#endif
ROOT_DEV = to_kdev_t(DEFAULT_ROOT_DEVICE);
+
+#ifdef CONFIG_SMP
+ /* Check for Core99 */
+ if (find_devices("uni-n"))
+ ppc_md.smp_ops = &core99_smp_ops;
+ else
+ ppc_md.smp_ops = &psurge_smp_ops;
+#endif /* CONFIG_SMP */
}
static void __init ohare_init(void)
@@ -432,9 +451,11 @@
static int found_boot = 0;
char *p;
- /* Do nothing if the root has been set already. */
+ /* Do nothing if the root has been mounted already. */
+ if (init_task.fs->rootmnt != NULL)
+ return;
if ((goodness <= current_root_goodness) &&
- (ROOT_DEV != to_kdev_t(DEFAULT_ROOT_DEVICE)))
+ (ROOT_DEV != to_kdev_t(DEFAULT_ROOT_DEVICE)))
return;
p = strstr(saved_command_line, "root=");
if (p != NULL && (p == saved_command_line || p[-1] == ' '))
@@ -520,41 +541,7 @@
/*
* IDE stuff.
*/
-void __pmac
-pmac_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
- _insw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-}
-
-void __pmac
-pmac_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
- _outsw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-}
-
-int __pmac
-pmac_ide_default_irq(ide_ioreg_t base)
-{
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
- extern int pmac_ide_get_irq(ide_ioreg_t base);
- return pmac_ide_get_irq(base);
-#else
- return 0;
-#endif
-}
-
-ide_ioreg_t __pmac
-pmac_ide_default_io_base(int index)
-{
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
- extern ide_ioreg_t pmac_ide_get_base(int index);
- return pmac_ide_get_base(index);
-#else
- return 0;
-#endif
-}
-
-int __pmac
+static int __pmac
pmac_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
/*
@@ -563,11 +550,11 @@
* register, it should be OK.
*/
if (from < ~_IO_BASE)
- return 0;
- return check_region(from, extent);
+ return check_region(from, extent);
+ return 0;
}
-void __pmac
+static void __pmac
pmac_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
@@ -576,7 +563,7 @@
request_region(from, extent, name);
}
-void __pmac
+static void __pmac
pmac_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
@@ -584,21 +571,24 @@
release_region(from, extent);
}
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-/* This is declared in drivers/block/ide-pmac.c */
-void __pmac
-pmac_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq);
-#else
/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
+ * This is only used if we have a PCI IDE controller, not
+ * for the IDE controller in the ohare/paddington/heathrow/keylargo.
*/
-void __pmac
-pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
+static void __pmac
+pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+ ide_ioreg_t ctrl_port, int *irq)
{
+ ide_ioreg_t reg = data_port;
+ int i;
+
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
}
#endif
-#endif
/*
* Read in a property describing some pieces of memory.
@@ -719,19 +709,16 @@
ppc_md.find_end_of_memory = pmac_find_end_of_memory;
#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
- ppc_ide_md.insw = pmac_ide_insw;
- ppc_ide_md.outsw = pmac_ide_outsw;
- ppc_ide_md.default_irq = pmac_ide_default_irq;
- ppc_ide_md.default_io_base = pmac_ide_default_io_base;
ppc_ide_md.ide_check_region = pmac_ide_check_region;
ppc_ide_md.ide_request_region = pmac_ide_request_region;
ppc_ide_md.ide_release_region = pmac_ide_release_region;
- ppc_ide_md.fix_driveid = ppc_generic_ide_fix_driveid;
ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
#endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
+
#ifdef CONFIG_BOOTX_TEXT
ppc_md.progress = pmac_progress;
#endif /* CONFIG_BOOTX_TEXT */
+
if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
}
@@ -745,7 +732,7 @@
{
if (disp_bi == 0)
return;
- prom_drawstring(s);
- prom_drawchar('\n');
+ btext_drawstring(s);
+ btext_drawchar('\n');
}
#endif /* CONFIG_BOOTX_TEXT */
Index: prep_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel/prep_setup.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- prep_setup.c 2001/10/05 08:48:44 1.4
+++ prep_setup.c 2001/10/06 16:11:13 1.5
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.prep_setup.c 1.26 08/05/01 16:18:54 trini
+ * BK Id: SCCS/s.prep_setup.c 1.36 09/08/01 15:47:42 paulus
*/
/*
* linux/arch/ppc/kernel/setup.c
@@ -7,6 +7,9 @@
* Copyright (C) 1995 Linus Torvalds
* Adapted from 'alpha' version by Gary Thomas
* Modified by Cort Dougan (co...@cs...)
+ *
+ * Support for PReP (Motorola MTX/MVME)
+ * by Troy Benjegerdes (ho...@dr...)
*/
/*
@@ -37,7 +40,7 @@
#include <linux/pci.h>
#include <linux/ide.h>
-#include <asm/init.h>
+#include <asm/sections.h>
#include <asm/mmu.h>
#include <asm/processor.h>
#include <asm/residual.h>
@@ -75,6 +78,7 @@
extern unsigned char rs_nvram_read_val(int addr);
extern void rs_nvram_write_val(int addr,
unsigned char val);
+extern void ibm_prep_init(void);
extern void prep_find_bridges(void);
extern char saved_command_line[256];
@@ -316,13 +320,20 @@
/*print_residual_device_info();*/
- raven_init();
+ switch (_prep_type) {
+ case _PREP_Motorola:
+ raven_init();
+ break;
+ case _PREP_IBM:
+ ibm_prep_init();
+ break;
+ }
#ifdef CONFIG_VGA_CONSOLE
/* remap the VGA memory */
vgacon_remap_base = 0xf0000000;
/*vgacon_remap_base = ioremap(0xc0000000, 0xba000);*/
- conswitchp = &vga_con;
+ conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
@@ -649,23 +660,6 @@
}
}
-#if 0
-void __prep
-prep_do_IRQ(struct pt_regs *regs, int cpu)
-{
- int irq;
-
- if ( (irq = i8259_irq(0)) < 0 )
- {
- printk(KERN_DEBUG "Bogus interrupt from PC = %lx\n",
- regs->nip);
- ppc_spurious_interrupts++;
- return;
- }
- ppc_irq_dispatch_handler( regs, irq );
-}
-#endif
-
int __prep
prep_get_irq(struct pt_regs *regs)
{
@@ -688,18 +682,6 @@
/*
* IDE stuff.
*/
-void __prep
-prep_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
- _insw((unsigned short *)((port)+_IO_BASE), buf, ns);
-}
-
-void __prep
-prep_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
- _outsw((unsigned short *)((port)+_IO_BASE), buf, ns);
-}
-
int __prep
prep_ide_default_irq(ide_ioreg_t base)
{
@@ -708,8 +690,9 @@
case 0x170: return 13;
case 0x1e8: return 11;
case 0x168: return 10;
- default:
- return 0;
+ case 0xfff0: return 14; /* MCP(N)750 ide0 */
+ case 0xffe0: return 15; /* MCP(N)750 ide1 */
+ default: return 0;
}
}
@@ -767,6 +750,45 @@
}
#endif
+#ifdef CONFIG_SMP
+/* PReP (MTX) support */
+static int
+smp_prep_probe(void)
+{
+ extern int mot_multi;
+
+ if (mot_multi) {
+ openpic_request_IPIs();
+ smp_hw_index[1] = 1;
+ return 2;
+ }
+
+ return 1;
+}
+
+static void
+smp_prep_kick_cpu(int nr)
+{
+ *(unsigned long *)KERNELBASE = nr;
+ asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
+ printk("CPU1 reset, waiting\n");
+}
+
+static void
+smp_prep_setup_cpu(int cpu_nr)
+{
+ if (OpenPIC_Addr)
+ do_openpic_setup_cpu();
+}
+
+static struct smp_ops_t prep_smp_ops = {
+ smp_openpic_message_pass,
+ smp_prep_probe,
+ smp_prep_kick_cpu,
+ smp_prep_setup_cpu,
+};
+#endif /* CONFIG_SMP */
+
/*
* This finds the amount of physical ram and does necessary
* setup for prep. This is pretty architecture specific so
@@ -775,29 +797,39 @@
*/
unsigned long __init prep_find_end_of_memory(void)
{
- unsigned long total;
+ unsigned long total = 0;
+ extern unsigned int boot_mem_size;
+
#ifdef CONFIG_PREP_RESIDUAL
total = res->TotalMemory;
-#else
- total = 0;
#endif
- if (total == 0 )
- {
+ if (total == 0 && boot_mem_size != 0)
+ total = boot_mem_size;
+
+ if (total == 0) {
/*
* I need a way to probe the amount of memory if the residual
* data doesn't contain it. -- Cort
*/
- printk("Ramsize from residual data was 0 -- Probing for value\n");
total = 0x02000000;
- printk("Ramsize default to be %ldM\n", total>>20);
+ printk(KERN_INFO "Ramsize from residual data was 0"
+ " -- defaulting to %ldM\n", total>>20);
}
return (total);
}
-unsigned long *MotSave_SmpIar;
-unsigned char *MotSave_CpusState[2];
+/*
+ * Setup the bat mappings we're going to load that cover
+ * the io areas. RAM was mapped by mapin_ram().
+ * -- Cort
+ */
+void __init prep_map_io(void)
+{
+ io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
+ io_block_mapping(0xf0000000, 0xc0000000, 0x08000000, _PAGE_IO);
+}
void __init
prep_init2(void)
@@ -825,13 +857,6 @@
{
memcpy((void *)res,(void *)(r3+KERNELBASE),
sizeof(RESIDUAL));
-
- /* These need to be saved for the Motorola Prep
- * MVME4600 and Dual MTX boards.
- */
- MotSave_SmpIar = &old_res->VitalProductData.SmpIar;
- MotSave_CpusState[0] = &old_res->Cpus[0].CpuState;
- MotSave_CpusState[1] = &old_res->Cpus[1].CpuState;
}
#endif
@@ -899,17 +924,18 @@
}
ppc_md.find_end_of_memory = prep_find_end_of_memory;
+ ppc_md.setup_io_mappings = prep_map_io;
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
- ppc_ide_md.insw = prep_ide_insw;
- ppc_ide_md.outsw = prep_ide_outsw;
ppc_ide_md.default_irq = prep_ide_default_irq;
ppc_ide_md.default_io_base = prep_ide_default_io_base;
ppc_ide_md.ide_check_region = prep_ide_check_region;
ppc_ide_md.ide_request_region = prep_ide_request_region;
ppc_ide_md.ide_release_region = prep_ide_release_region;
- ppc_ide_md.fix_driveid = NULL;
ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports;
-#endif
- ppc_ide_md.io_base = _IO_BASE;
+#endif
+
+#ifdef CONFIG_SMP
+ ppc_md.smp_ops = &prep_smp_ops;
+#endif /* CONFIG_SMP */
}
|