patch-2.4.21 linux-2.4.21/arch/ppc/platforms/chrp_setup.c
Next file: linux-2.4.21/arch/ppc/platforms/chrp_smp.c
Previous file: linux-2.4.21/arch/ppc/platforms/chrp_pci.c
Back to the patch index
Back to the overall index
- Lines: 181
- Date:
2003-06-13 07:51:31.000000000 -0700
- Orig file:
linux-2.4.20/arch/ppc/platforms/chrp_setup.c
- Orig date:
2002-11-28 15:53:11.000000000 -0800
diff -urN linux-2.4.20/arch/ppc/platforms/chrp_setup.c linux-2.4.21/arch/ppc/platforms/chrp_setup.c
@@ -1,7 +1,4 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
- */
-/*
* arch/ppc/platforms/setup.c
*
* Copyright (C) 1995 Linus Torvalds
@@ -56,6 +53,11 @@
#include <asm/i8259.h>
#include <asm/open_pic.h>
+#ifdef CONFIG_SERIAL
+#include <linux/serial.h>
+#include <linux/serialP.h>
+#endif
+
unsigned long chrp_get_rtc_time(void);
int chrp_set_rtc_time(unsigned long nowtime);
void chrp_calibrate_decr(void);
@@ -81,13 +83,11 @@
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;
-static int max_width;
-static int is_briq;
-unsigned int* briq_SPOR; /* To be replaced by RTAS when available */
+
+static int max_width __chrpdata;
+int chrp_is_briq __chrpdata;
+unsigned int* briq_SPOR __chrpdata; /* To be replaced by RTAS when available */
#ifdef CONFIG_SMP
extern struct smp_ops_t chrp_smp_ops;
@@ -411,8 +411,6 @@
chrp_init_irq_openpic(unsigned long intack)
{
int i;
- unsigned char* chrp_int_ack_special = 0;
- int nmi_irq = -1;
unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
chrp_find_openpic();
@@ -421,12 +419,14 @@
OpenPIC_InitSenses = init_senses;
OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS;
- if (intack)
- chrp_int_ack_special = (unsigned char *) ioremap(intack, 1);
- openpic_init(1, NUM_8259_INTERRUPTS, chrp_int_ack_special, nmi_irq);
+ openpic_init(NUM_8259_INTERRUPTS);
+ /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
+ openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
+ i8259_irq);
+
for (i = 0; i < NUM_8259_INTERRUPTS; i++)
irq_desc[i].handler = &i8259_pic;
- i8259_init(0);
+ i8259_init(intack);
}
static void __init
@@ -492,7 +492,7 @@
chrp_init2(void)
{
- if (is_briq)
+ if (chrp_is_briq)
briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4);
#ifdef CONFIG_NVRAM
/* Fix me: currently, a lot of pmac_nvram routines are marked __pmac, and
@@ -500,7 +500,7 @@
* Among others, it cracks on briQ.
* Please implement a CHRP specific version. --BenH
*/
- if (!is_briq)
+ if (!chrp_is_briq)
pmac_nvram_init();
#endif
/* This is to be replaced by RTAS when available */
@@ -532,46 +532,6 @@
#endif /* CONFIG_VT && (CONFIG_ADB_KEYBOARD || CONFIG_INPUT) */
}
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-/*
- * IDE stuff.
- */
-
-static int __chrp
-chrp_ide_check_region(ide_ioreg_t from, unsigned int extent)
-{
- return check_region(from, extent);
-}
-
-static void __chrp
-chrp_ide_request_region(ide_ioreg_t from,
- unsigned int extent,
- const char *name)
-{
- request_region(from, extent, name);
-}
-
-static void __chrp
-chrp_ide_release_region(ide_ioreg_t from,
- unsigned int extent)
-{
- release_region(from, extent);
-}
-
-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;
- 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
-
void __init
chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
@@ -595,7 +555,15 @@
/* Check if it's a briq */
machine = get_property(root, "model", NULL);
- is_briq = machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0;
+ chrp_is_briq = machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0;
+#ifdef CONFIG_SERIAL
+ if (chrp_is_briq) {
+ /* briQ has a different serial clock */
+ extern struct serial_state rs_table[];
+ rs_table[0].baud_base = (7372800 / 16);
+ rs_table[1].baud_base = (7372800 / 16);
+ }
+#endif /* CONFIG_SERIAL */
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.show_percpuinfo = of_show_percpuinfo;
@@ -606,7 +574,7 @@
ppc_md.init = chrp_init2;
- ppc_md.restart = is_briq ? briq_restart : chrp_restart;
+ ppc_md.restart = chrp_is_briq ? briq_restart : chrp_restart;
ppc_md.power_off = chrp_power_off;
ppc_md.halt = chrp_halt;
@@ -623,8 +591,10 @@
ppc_md.kbd_getkeycode = pckbd_getkeycode;
ppc_md.kbd_translate = pckbd_translate;
ppc_md.kbd_unexpected_up = pckbd_unexpected_up;
- ppc_md.kbd_leds = pckbd_leds;
- ppc_md.kbd_init_hw = pckbd_init_hw;
+ if (!chrp_is_briq) {
+ ppc_md.kbd_leds = pckbd_leds;
+ ppc_md.kbd_init_hw = pckbd_init_hw;
+ }
#ifdef CONFIG_MAGIC_SYSRQ
ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
@@ -657,10 +627,6 @@
#endif /* CONFIG_SMP */
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
- 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.ide_init_hwif = chrp_ide_init_hwif_ports;
#endif
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)