summaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/chrpboot/main.c20
-rw-r--r--arch/ppc/chrpboot/piggyback.c3
-rw-r--r--arch/ppc/coffboot/piggyback.c3
-rw-r--r--arch/ppc/config.in7
-rw-r--r--arch/ppc/configs/common_defconfig26
-rw-r--r--arch/ppc/defconfig26
-rw-r--r--arch/ppc/kernel/Makefile20
-rw-r--r--arch/ppc/kernel/apus_setup.c159
-rw-r--r--arch/ppc/kernel/entry.S4
-rw-r--r--arch/ppc/kernel/hashtable.S80
-rw-r--r--arch/ppc/kernel/head.S7
-rw-r--r--arch/ppc/kernel/irq.c3
-rw-r--r--arch/ppc/kernel/misc.S11
-rw-r--r--arch/ppc/kernel/mk_defs.c1
-rw-r--r--arch/ppc/kernel/pmac_pic.c24
-rw-r--r--arch/ppc/kernel/ppc_htab.c9
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c17
-rw-r--r--arch/ppc/kernel/process.c2
-rw-r--r--arch/ppc/kernel/prom.c1
-rw-r--r--arch/ppc/kernel/setup.c60
-rw-r--r--arch/ppc/kernel/smp.c3
-rw-r--r--arch/ppc/mm/init.c86
-rw-r--r--arch/ppc/mm/mem_pieces.c2
-rw-r--r--arch/ppc/xmon/xmon.c46
24 files changed, 381 insertions, 239 deletions
diff --git a/arch/ppc/chrpboot/main.c b/arch/ppc/chrpboot/main.c
index d54a429a9..91bf4d8c4 100644
--- a/arch/ppc/chrpboot/main.c
+++ b/arch/ppc/chrpboot/main.c
@@ -10,7 +10,6 @@
#include "../coffboot/zlib.h"
#include <asm/bootinfo.h>
#include <asm/processor.h>
-#define __KERNEL__
#include <asm/page.h>
extern void *finddevice(const char *);
@@ -49,17 +48,8 @@ chrpboot(int a1, int a2, void *prom)
printf("chrpboot starting: loaded at 0x%x\n\r", &_start);
- if (initrd_len) {
- initrd_size = initrd_len;
- initrd_start = (RAM_END - initrd_size) & ~0xFFF;
- a1 = initrd_start;
- a2 = initrd_size;
- printf("initial ramdisk moving 0x%x <- 0x%x (%x bytes)\n\r", initrd_start,
- initrd_data,initrd_size);
- memcpy((char *)initrd_start, initrd_data, initrd_size);
- end_avail = (char *)initrd_start;
- } else
- end_avail = (char *) RAM_END;
+ end_avail = (char *) RAM_END;
+
im = image_data;
len = image_len;
dst = (void *) PROG_START;
@@ -98,7 +88,7 @@ chrpboot(int a1, int a2, void *prom)
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_SYSMAP;
- rec->data[0] = sysmap_data;
+ rec->data[0] = (unsigned long)sysmap_data;
rec->data[1] = sysmap_len;
rec->size = sizeof(struct bi_record) + sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
@@ -129,6 +119,10 @@ void *zalloc(void *x, unsigned items, unsigned size)
void zfree(void *x, void *addr, unsigned nb)
{
+ nb = (nb + 7) & -8;
+ if (addr == (avail_ram - nb)) {
+ avail_ram -= nb;
+ }
}
#define HEAD_CRC 2
diff --git a/arch/ppc/chrpboot/piggyback.c b/arch/ppc/chrpboot/piggyback.c
index 172025802..304bc8f11 100644
--- a/arch/ppc/chrpboot/piggyback.c
+++ b/arch/ppc/chrpboot/piggyback.c
@@ -1,8 +1,9 @@
#include <stdio.h>
+#include <unistd.h>
extern long ce_exec_config[];
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int i, cnt, pos, len;
unsigned int cksum, val;
diff --git a/arch/ppc/coffboot/piggyback.c b/arch/ppc/coffboot/piggyback.c
index 172025802..304bc8f11 100644
--- a/arch/ppc/coffboot/piggyback.c
+++ b/arch/ppc/coffboot/piggyback.c
@@ -1,8 +1,9 @@
#include <stdio.h>
+#include <unistd.h>
extern long ce_exec_config[];
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int i, cnt, pos, len;
unsigned int cksum, val;
diff --git a/arch/ppc/config.in b/arch/ppc/config.in
index 8bb23afa2..7d0ab5fa0 100644
--- a/arch/ppc/config.in
+++ b/arch/ppc/config.in
@@ -47,12 +47,9 @@ if [ "$CONFIG_8xx" = "y" ]; then
fi
if [ "$CONFIG_6xx" = "y" ]; then
choice 'Machine Type' \
- "PowerMac CONFIG_PMAC \
- PReP/MTX CONFIG_PREP \
- CHRP CONFIG_CHRP \
- PowerMac/PReP/CHRP CONFIG_ALL_PPC \
+ "PowerMac/PReP/MTX/CHRP CONFIG_ALL_PPC \
Gemini CONFIG_GEMINI \
- APUS CONFIG_APUS" PowerMac
+ APUS CONFIG_APUS" PowerMac/PReP/MTX/CHRP
fi
if [ "$CONFIG_PPC64" = "y" ]; then
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig
index 17217702f..4ba96bde9 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/common_defconfig
@@ -17,9 +17,6 @@ CONFIG_6xx=y
# CONFIG_PPC64 is not set
# CONFIG_82xx is not set
# CONFIG_8xx is not set
-# CONFIG_PMAC is not set
-# CONFIG_PREP is not set
-# CONFIG_CHRP is not set
CONFIG_ALL_PPC=y
# CONFIG_GEMINI is not set
# CONFIG_APUS is not set
@@ -286,30 +283,29 @@ CONFIG_GMAC=y
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_RTL8139 is not set
-# CONFIG_DM9102 is not set
# CONFIG_AT1700 is not set
# CONFIG_DEPCA is not set
# CONFIG_NET_ISA is not set
-CONFIG_NET_EISA=y
+CONFIG_NET_PCI=y
CONFIG_PCNET32=y
# CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
-# CONFIG_CS89x0 is not set
CONFIG_DE4X5=y
-# CONFIG_DEC_ELCP is not set
+# CONFIG_TULIP is not set
# CONFIG_DGRS is not set
-# CONFIG_EEXPRESS_PRO100 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_EEPRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
+# CONFIG_RTL8129 is not set
+# CONFIG_8139TOO is not set
# CONFIG_SIS900 is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
-# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
#
@@ -499,6 +495,7 @@ CONFIG_USB_OHCI=y
# CONFIG_USB_DC2XX is not set
# CONFIG_USB_STORAGE is not set
# CONFIG_USB_DABUSB is not set
+# CONFIG_USB_PLUSB is not set
#
# USB HID
@@ -508,13 +505,15 @@ CONFIG_USB_KBD=y
CONFIG_USB_MOUSE=y
# CONFIG_USB_GRAPHIRE is not set
# CONFIG_USB_WMFORCE is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_KEYBDEV=y
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_MIX is not set
+# CONFIG_INPUT_MOUSEDEV_DIGITIZER is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
#
-# Filesystems
+# File systems
#
# CONFIG_QUOTA is not set
CONFIG_AUTOFS_FS=y
@@ -535,6 +534,7 @@ CONFIG_ISO9660_FS=y
# CONFIG_NTFS_FS is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig
index 17217702f..4ba96bde9 100644
--- a/arch/ppc/defconfig
+++ b/arch/ppc/defconfig
@@ -17,9 +17,6 @@ CONFIG_6xx=y
# CONFIG_PPC64 is not set
# CONFIG_82xx is not set
# CONFIG_8xx is not set
-# CONFIG_PMAC is not set
-# CONFIG_PREP is not set
-# CONFIG_CHRP is not set
CONFIG_ALL_PPC=y
# CONFIG_GEMINI is not set
# CONFIG_APUS is not set
@@ -286,30 +283,29 @@ CONFIG_GMAC=y
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_RTL8139 is not set
-# CONFIG_DM9102 is not set
# CONFIG_AT1700 is not set
# CONFIG_DEPCA is not set
# CONFIG_NET_ISA is not set
-CONFIG_NET_EISA=y
+CONFIG_NET_PCI=y
CONFIG_PCNET32=y
# CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
-# CONFIG_CS89x0 is not set
CONFIG_DE4X5=y
-# CONFIG_DEC_ELCP is not set
+# CONFIG_TULIP is not set
# CONFIG_DGRS is not set
-# CONFIG_EEXPRESS_PRO100 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_EEPRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
+# CONFIG_RTL8129 is not set
+# CONFIG_8139TOO is not set
# CONFIG_SIS900 is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
-# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
#
@@ -499,6 +495,7 @@ CONFIG_USB_OHCI=y
# CONFIG_USB_DC2XX is not set
# CONFIG_USB_STORAGE is not set
# CONFIG_USB_DABUSB is not set
+# CONFIG_USB_PLUSB is not set
#
# USB HID
@@ -508,13 +505,15 @@ CONFIG_USB_KBD=y
CONFIG_USB_MOUSE=y
# CONFIG_USB_GRAPHIRE is not set
# CONFIG_USB_WMFORCE is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_KEYBDEV=y
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_MIX is not set
+# CONFIG_INPUT_MOUSEDEV_DIGITIZER is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
#
-# Filesystems
+# File systems
#
# CONFIG_QUOTA is not set
CONFIG_AUTOFS_FS=y
@@ -535,6 +534,7 @@ CONFIG_ISO9660_FS=y
# CONFIG_NTFS_FS is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index ea7c7c6e7..0f7167622 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -88,24 +88,14 @@ endif
ifeq ($(CONFIG_NVRAM),y)
O_OBJS += pmac_nvram.o
endif
-ifeq ($(CONFIG_6xx),y)
- O_OBJS += open_pic.o indirect_pci.o
-endif
-ifeq ($(CONFIG_PPC64),y)
- O_OBJS += open_pic.o indirect_pci.o
-endif
ifeq ($(CONFIG_APUS),y)
O_OBJS += apus_setup.o
endif
-ifeq ($(CONFIG_PMAC),y)
- O_OBJS += pmac_pic.o pmac_setup.o pmac_time.o feature.o pmac_pci.o prom.o
-endif
-ifeq ($(CONFIG_CHRP),y)
- O_OBJS += chrp_pci.o pmac_pci.o chrp_setup.o i8259.o \
- chrp_time.o pmac_time.o prom.o
-endif
-ifeq ($(CONFIG_PREP),y)
- O_OBJS += prep_pci.o i8259.o prep_setup.o prep_nvram.o prep_time.o residual.o
+ifeq ($(CONFIG_ALL_PPC),y)
+ O_OBJS += pmac_pic.o pmac_setup.o pmac_time.o feature.o pmac_pci.o prom.o \
+ chrp_setup.o chrp_time.o chrp_pci.o open_pic.o indirect_pci.o \
+ prep_pci.o i8259.o prep_nvram.o prep_time.o residual.o
+ OX_OBJS += prep_setup.o
endif
ifeq ($(CONFIG_GEMINI),y)
O_OBJS += gemini_prom.o gemini_pci.o gemini_setup.o
diff --git a/arch/ppc/kernel/apus_setup.c b/arch/ppc/kernel/apus_setup.c
index 5f0c4b06e..a54efc6fd 100644
--- a/arch/ppc/kernel/apus_setup.c
+++ b/arch/ppc/kernel/apus_setup.c
@@ -10,7 +10,7 @@
* TODO:
* This file needs a *really* good cleanup. Restructure and optimize.
* Make sure it can be compiled for non-APUS configs. Begin to move
- * Amiga specific stuff into linux/machine/amiga.
+ * Amiga specific stuff into mach/amiga.
*/
#include <linux/config.h>
@@ -27,6 +27,10 @@
#include <asm/logging.h>
#endif
+/* Needs INITSERIAL call in head.S! */
+#undef APUS_DEBUG
+
+
#include <linux/ide.h>
#define T_CHAR (0x0000) /* char: don't touch */
#define T_SHORT (0x4000) /* short: 12 -> 21 */
@@ -60,37 +64,6 @@ static u_short driveid_types[] = {
#define num_driveid_types (sizeof(driveid_types)/sizeof(*driveid_types))
-#if 0 /* Get rid of this crud */
-/* Get the IDE stuff from the 68k file */
-#define ide_init_hwif_ports m68k_ide_init_hwif_ports
-#define ide_default_irq m68k_ide_default_irq
-#undef ide_request_irq
-#define ide_request_irq m68k_ide_request_irq
-#undef ide_free_irq
-#define ide_free_irq m68k_ide_free_irq
-#define ide_default_io_base m68k_ide_default_io_base
-#define ide_check_region m68k_ide_check_region
-#define ide_request_region m68k_ide_request_region
-#define ide_release_region m68k_ide_release_region
-#define ide_fix_driveid m68k_ide_fix_driveid
-#define ide_init_default_hwifs m68k_ide_init_default_hwifs
-#define select_t m68k_select_t
-//#include <asm/hdreg.h>
-#include <asm-m68k/ide.h>
-#undef ide_free_irq
-#undef select_t
-#undef ide_request_irq
-#undef ide_init_default_hwifs
-#undef ide_init_hwif_ports
-#undef ide_default_irq
-#undef ide_default_io_base
-#undef ide_check_region
-#undef ide_request_region
-#undef ide_release_region
-#undef ide_fix_driveid
-/*-------------------------------------------*/
-#endif
-
#include <asm/bootinfo.h>
#include <asm/setup.h>
#include <asm/amigahw.h>
@@ -764,6 +737,12 @@ void apus_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
/****************************************************** IRQ stuff */
__apus
+static unsigned int apus_irq_cannonicalize(unsigned int irq)
+{
+ return irq;
+}
+
+__apus
int apus_get_irq_list(char *buf)
{
#ifdef CONFIG_APUS
@@ -922,6 +901,114 @@ static void apus_kbd_init_hw(void)
}
+/****************************************************** debugging */
+
+/* some serial hardware definitions */
+#define SDR_OVRUN (1<<15)
+#define SDR_RBF (1<<14)
+#define SDR_TBE (1<<13)
+#define SDR_TSRE (1<<12)
+
+#define AC_SETCLR (1<<15)
+#define AC_UARTBRK (1<<11)
+
+#define SER_DTR (1<<7)
+#define SER_RTS (1<<6)
+#define SER_DCD (1<<5)
+#define SER_CTS (1<<4)
+#define SER_DSR (1<<3)
+
+static __inline__ void ser_RTSon(void)
+{
+ ciab.pra &= ~SER_RTS; /* active low */
+}
+
+__apus
+int __debug_ser_out( unsigned char c )
+{
+ custom.serdat = c | 0x100;
+ mb();
+ while (!(custom.serdatr & 0x2000))
+ barrier();
+ return 1;
+}
+
+__apus
+unsigned char __debug_ser_in( void )
+{
+ unsigned char c;
+
+ /* XXX: is that ok?? derived from amiga_ser.c... */
+ while( !(custom.intreqr & IF_RBF) )
+ barrier();
+ c = custom.serdatr;
+ /* clear the interrupt, so that another character can be read */
+ custom.intreq = IF_RBF;
+ return c;
+}
+
+__apus
+int __debug_serinit( void )
+{
+ unsigned long flags;
+
+ save_flags (flags);
+ cli();
+
+ /* turn off Rx and Tx interrupts */
+ custom.intena = IF_RBF | IF_TBE;
+
+ /* clear any pending interrupt */
+ custom.intreq = IF_RBF | IF_TBE;
+
+ restore_flags (flags);
+
+ /*
+ * set the appropriate directions for the modem control flags,
+ * and clear RTS and DTR
+ */
+ ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
+ ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
+
+#ifdef CONFIG_KGDB
+ /* turn Rx interrupts on for GDB */
+ custom.intena = IF_SETCLR | IF_RBF;
+ ser_RTSon();
+#endif
+
+ return 0;
+}
+
+__apus
+void __debug_print_hex(unsigned long x)
+{
+ int i;
+ char hexchars[] = "0123456789ABCDEF";
+
+ for (i = 0; i < 8; i++) {
+ __debug_ser_out(hexchars[(x >> 28) & 15]);
+ x <<= 4;
+ }
+ __debug_ser_out('\n');
+ __debug_ser_out('\r');
+}
+
+__apus
+void __debug_print_string(char* s)
+{
+ unsigned char c;
+ while((c = *s++))
+ __debug_ser_out(c);
+ __debug_ser_out('\n');
+ __debug_ser_out('\r');
+}
+
+__apus
+static void apus_progress(char *s, unsigned short value)
+{
+ __debug_print_string(s);
+}
+
/****************************************************** init */
/* The number of spurious interrupts */
@@ -970,7 +1057,7 @@ void apus_init_IRQ(void)
int i;
for ( i = 0 ; i < NR_IRQS ; i++ )
- irq_desc[i].ctl = &amiga_irqctrl;
+ irq_desc[i].handler = &amiga_irqctrl;
for (i = 0; i < NUM_IRQ_NODES; i++)
nodes[i].handler = NULL;
@@ -1015,7 +1102,7 @@ void apus_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = apus_setup_arch;
ppc_md.setup_residual = NULL;
ppc_md.get_cpuinfo = apus_get_cpuinfo;
- ppc_md.irq_cannonicalize = NULL;
+ ppc_md.irq_cannonicalize = apus_irq_cannonicalize;
ppc_md.init_IRQ = apus_init_IRQ;
ppc_md.get_irq = apus_get_irq;
ppc_md.post_irq = apus_post_irq;
@@ -1023,6 +1110,10 @@ void apus_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.heartbeat = apus_heartbeat;
ppc_md.heartbeat_count = 1;
#endif
+#ifdef APUS_DEBUG
+ __debug_serinit();
+ ppc_md.progress = apus_progress;
+#endif
ppc_md.init = NULL;
ppc_md.restart = apus_restart;
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 013812afc..cc647a58b 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -435,7 +435,7 @@ _GLOBAL(fake_interrupt)
* here so it's easy to add arch-specific sections later.
* -- Cort
*/
-#if defined(CONFIG_CHRP) || defined(CONFIG_PMAC) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
/*
* On CHRP, the Run-Time Abstraction Services (RTAS) have to be
* called with the MMU off.
@@ -475,4 +475,4 @@ enter_rtas:
mtspr SRR0,r8
mtspr SRR1,r9
rfi /* return to caller */
-#endif /* CONFIG_CHRP || CONFIG_PMAC || CONFIG_ALL_PPC */
+#endif /* CONFIG_ALL_PPC */
diff --git a/arch/ppc/kernel/hashtable.S b/arch/ppc/kernel/hashtable.S
index c87385c53..5593ebe18 100644
--- a/arch/ppc/kernel/hashtable.S
+++ b/arch/ppc/kernel/hashtable.S
@@ -115,11 +115,6 @@ hash_page:
stw r6,0(r2) /* update PTE (accessed/dirty bits) */
/* Convert linux-style PTE to low word of PPC-style PTE */
-#ifdef CONFIG_PPC64
- /* clear the high 32 bits just in case */
- clrldi r6,r6,32
- clrldi r4,r4,32
-#endif /* CONFIG_PPC64 */
rlwinm r4,r6,32-9,31,31 /* _PAGE_HWWRITE -> PP lsb */
rlwimi r6,r6,32-1,31,31 /* _PAGE_USER -> PP (both bits now) */
ori r4,r4,0xe04 /* clear out reserved bits */
@@ -151,10 +146,6 @@ hash_page:
.globl hash_page_patch_A
hash_page_patch_A:
lis r4,Hash_base@h /* base address of hash table */
-#ifdef CONFIG_PPC64
- /* just in case */
- clrldi r4,r4,32
-#endif
rlwimi r4,r5,32-1,26-Hash_bits,25 /* (VSID & hash_mask) << 6 */
rlwinm r0,r3,32-6,26-Hash_bits,25 /* (PI & hash_mask) << 6 */
xor r4,r4,r0 /* make primary hash */
@@ -169,43 +160,89 @@ hash_page_patch_A:
/* Search the primary PTEG for a PTE whose 1st word matches r5 */
mtctr r2
addi r3,r4,-8
-1: lwzu r0,8(r3) /* get next PTE */
+1:
+#ifdef CONFIG_PPC64
+ lwzu r0,16(r3) /* get next PTE */
+#else
+ lwzu r0,8(r3) /* get next PTE */
+#endif
cmp 0,r0,r5
bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
beq+ found_slot
/* Search the secondary PTEG for a matching PTE */
+#ifdef CONFIG_PPC64
+ ori r5,r5,0x2 /* set H (secondary hash) bit */
+#else
ori r5,r5,0x40 /* set H (secondary hash) bit */
+#endif
.globl hash_page_patch_B
hash_page_patch_B:
xoris r3,r4,Hash_msk>>16 /* compute secondary hash */
xori r3,r3,0xffc0
+#ifdef CONFIG_PPC64
+ addi r3,r3,-16
+#else
addi r3,r3,-8
+#endif
mtctr r2
-2: lwzu r0,8(r3)
+2:
+#ifdef CONFIG_PPC64
+ lwzu r0,16(r3)
+#else
+ lwzu r0,8(r3)
+#endif
cmp 0,r0,r5
bdnzf 2,2b
beq+ found_slot
+#ifdef CONFIG_PPC64
+ xori r5,r5,0x2 /* clear H bit again */
+#else
xori r5,r5,0x40 /* clear H bit again */
+#endif
/* Search the primary PTEG for an empty slot */
10: mtctr r2
+#ifdef CONFIG_PPC64
+ addi r3,r4,-16 /* search primary PTEG */
+#else
addi r3,r4,-8 /* search primary PTEG */
-1: lwzu r0,8(r3) /* get next PTE */
+#endif
+1:
+#ifdef CONFIG_PPC64
+ lwzu r0,16(r3) /* get next PTE */
+ andi. r0,r0,1
+#else
+ lwzu r0,8(r3) /* get next PTE */
rlwinm. r0,r0,0,0,0 /* only want to check valid bit */
+#endif
bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
beq+ found_empty
/* Search the secondary PTEG for an empty slot */
+#ifdef CONFIG_PPC64
+ ori r5,r5,0x2 /* set H (secondary hash) bit */
+#else
ori r5,r5,0x40 /* set H (secondary hash) bit */
+#endif
.globl hash_page_patch_C
hash_page_patch_C:
xoris r3,r4,Hash_msk>>16 /* compute secondary hash */
xori r3,r3,0xffc0
+#ifdef CONFIG_PPC64
+ addi r3,r3,-16
+#else
addi r3,r3,-8
+#endif
mtctr r2
-2: lwzu r0,8(r3)
+2:
+#ifdef CONFIG_PPC64
+ lwzu r0,16(r3)
+ andi. r0,r0,1
+#else
+ lwzu r0,8(r3)
rlwinm. r0,r0,0,0,0 /* only want to check valid bit */
+#endif
bdnzf 2,2b
beq+ found_empty
@@ -218,12 +255,21 @@ hash_page_patch_C:
* advantage to putting the PTE in the primary PTEG, we always
* put the PTE in the primary PTEG.
*/
+#ifdef CONFIG_PPC64
+ xori r5,r5,0x2 /* clear H bit again */
+#else
xori r5,r5,0x40 /* clear H bit again */
+#endif
lis r3,next_slot@ha
tophys(r3,r3)
lwz r2,next_slot@l(r3)
+#ifdef CONFIG_PPC64
+ addi r2,r2,16
+ andi. r2,r2,0x78
+#else
addi r2,r2,8
andi. r2,r2,0x38
+#endif
stw r2,next_slot@l(r3)
add r3,r4,r2
11:
@@ -237,9 +283,17 @@ hash_page_patch_C:
#ifndef __SMP__
/* Store PTE in PTEG */
found_empty:
+#ifdef CONFIG_PPC64
+ std r5,0(r3)
+#else
stw r5,0(r3)
+#endif
found_slot:
+#ifdef CONFIG_PPC64
+ std r6,8(r3)
+#else
stw r6,4(r3)
+#endif
sync
#else /* __SMP__ */
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index dd16b8c27..b6d44ecb3 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -1328,18 +1328,15 @@ load_up_mmu:
/* Load the SDR1 register (hash table base & size) */
lis r6,_SDR1@ha
tophys(r6,r6)
-#ifdef CONFIG_PPC64
- ld r6,_SDR1@l(r6)
+ lwz r6,_SDR1@l(r6)
mtspr SDR1,r6
+#ifdef CONFIG_PPC64
/* clear the v bit in the ASR so we can
* behave as if we have segment registers
* -- Cort
*/
clrldi r6,r6,63
mtasr r6
-#else
- lwz r6,_SDR1@l(r6)
- mtspr SDR1,r6
#endif /* CONFIG_PPC64 */
li r0,16 /* load up segment register values */
mtctr r0 /* for context 0 */
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index fd77fbc36..ffac1871a 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -70,8 +70,6 @@ volatile unsigned char *chrp_int_ack_special;
#define MAXCOUNT 10000000
-#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
-
irq_desc_t irq_desc[NR_IRQS];
int ppc_spurious_interrupts = 0;
unsigned int local_bh_count[NR_CPUS];
@@ -81,7 +79,6 @@ unsigned int ppc_cached_irq_mask[NR_MASK_WORDS];
unsigned int ppc_lost_interrupts[NR_MASK_WORDS];
atomic_t ppc_n_lost_interrupts;
-
/* nasty hack for shared irq's since we need to do kmalloc calls but
* can't very early in the boot when we need to do a request irq.
* this needs to be removed.
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 50f63eeb4..8444bb4a0 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -241,12 +241,21 @@ _GLOBAL(__flush_page_to_ram)
rlwinm r5,r5,16,16,31
cmpi 0,r5,1
beqlr /* for 601, do nothing */
+ li r4,0x0FFF
+ andc r3,r3,r4 /* Get page base address */
li r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
mtctr r4
+ mr r6,r3
0: dcbst 0,r3 /* Write line to ram */
addi r3,r3,CACHE_LINE_SIZE
bdnz 0b
sync
+ mtctr r4
+1: icbi 0,r6
+ addi r6,r6,CACHE_LINE_SIZE
+ bdnz 1b
+ sync
+ isync
blr
/*
@@ -270,7 +279,7 @@ _GLOBAL(__flush_icache_page)
sync
isync
blr
-
+
/*
* Clear a page using the dcbz instruction, which doesn't cause any
* memory traffic (except to write out any cache lines which get
diff --git a/arch/ppc/kernel/mk_defs.c b/arch/ppc/kernel/mk_defs.c
index 4f3c6834d..c381ea073 100644
--- a/arch/ppc/kernel/mk_defs.c
+++ b/arch/ppc/kernel/mk_defs.c
@@ -99,6 +99,7 @@ main(void)
DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr));
DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link));
DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr));
+ DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer));
DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
diff --git a/arch/ppc/kernel/pmac_pic.c b/arch/ppc/kernel/pmac_pic.c
index d13875c9f..b0276ca2c 100644
--- a/arch/ppc/kernel/pmac_pic.c
+++ b/arch/ppc/kernel/pmac_pic.c
@@ -39,6 +39,17 @@ extern int pmac_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn
extern int pmac_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned short val);
+/*
+ * Mark an irq as "lost". This is only used on the pmac
+ * since it can lose interrupts (see pmac_set_irq_mask).
+ * -- Cort
+ */
+void __pmac __no_use_set_lost(unsigned long irq_nr)
+{
+ if (!test_and_set_bit(irq_nr, ppc_lost_interrupts))
+ atomic_inc(&ppc_n_lost_interrupts);
+}
+
static void pmac_openpic_mask_irq(unsigned int irq_nr)
{
openpic_disable_irq(irq_nr);
@@ -105,10 +116,8 @@ static void __pmac pmac_set_irq_mask(unsigned int irq_nr)
*/
if ((bit & ppc_cached_irq_mask[i])
&& (ld_le32(&pmac_irq_hw[i]->level) & bit)
- && !(ld_le32(&pmac_irq_hw[i]->flag) & bit)) {
- if (!test_and_set_bit(irq_nr, ppc_lost_interrupts))
- atomic_inc(&ppc_n_lost_interrupts);
- }
+ && !(ld_le32(&pmac_irq_hw[i]->flag) & bit))
+ __set_lost((ulong)irq_nr);
}
static void __pmac pmac_mask_irq(unsigned int irq_nr)
@@ -174,6 +183,8 @@ pmac_get_irq(struct pt_regs *regs)
unsigned long bits = 0;
#ifdef __SMP__
+ void pmac_smp_message_recv(void);
+
/* IPI's are a hack on the powersurge -- Cort */
if ( smp_processor_id() != 0 )
{
@@ -182,12 +193,12 @@ pmac_get_irq(struct pt_regs *regs)
if (xmon_2nd)
xmon(regs);
#endif
- smp_message_recv();
+ pmac_smp_message_recv();
return -2; /* ignore, already handled */
}
#endif /* __SMP__ */
- /* Yeah, I know, this could be a separate do_IRQ function */
+ /* Yeah, I know, this could be a separate get_irq function */
if (has_openpic)
{
irq = openpic_irq(smp_processor_id());
@@ -376,6 +387,7 @@ pmac_pic_init(void)
irqctrler = NULL;
}
+ int_control.int_set_lost = __no_use_set_lost;
/*
* G3 powermacs and 1999 G3 PowerBooks have 64 interrupts,
* 1998 G3 Series PowerBooks have 128,
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index 264a24d48..da46f3c1c 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -44,19 +44,12 @@ extern unsigned long htab_evicts;
extern unsigned long pte_misses;
extern unsigned long pte_errors;
-static struct file_operations ppc_htab_operations = {
+struct file_operations ppc_htab_operations = {
llseek: ppc_htab_lseek,
read: ppc_htab_read,
write: ppc_htab_write,
};
-/*
- * proc files can do almost nothing..
- */
-struct inode_operations proc_ppc_htab_inode_operations = {
- &ppc_htab_operations, /* default proc file-ops */
-};
-
/* these will go into processor.h when I'm done debugging -- Cort */
#define MMCR0 952
#define MMCR0_PMC1_CYCLES (0x1<<7)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 757715512..87c8d4082 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -34,6 +34,7 @@
#include <asm/feature.h>
#include <asm/dma.h>
#include <asm/machdep.h>
+#include <asm/hw_irq.h>
#ifdef __SMP__
#include <asm/smplock.h>
#endif /* __SMP__ */
@@ -50,7 +51,6 @@ extern void AlignmentException(struct pt_regs *regs);
extern void ProgramCheckException(struct pt_regs *regs);
extern void SingleStepException(struct pt_regs *regs);
extern int sys_sigreturn(struct pt_regs *regs);
-extern atomic_t ppc_n_lost_interrupts;
extern void do_lost_interrupts(unsigned long);
extern int do_signal(sigset_t *, struct pt_regs *);
@@ -69,6 +69,7 @@ EXPORT_SYMBOL(ProgramCheckException);
EXPORT_SYMBOL(SingleStepException);
EXPORT_SYMBOL(sys_sigreturn);
EXPORT_SYMBOL(ppc_n_lost_interrupts);
+EXPORT_SYMBOL(ppc_lost_interrupts);
EXPORT_SYMBOL(do_lost_interrupts);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
@@ -88,7 +89,7 @@ EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
EXPORT_SYMBOL(DMA_MODE_READ);
EXPORT_SYMBOL(DMA_MODE_WRITE);
#ifndef CONFIG_8xx
-#if defined(CONFIG_PREP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
EXPORT_SYMBOL(_prep_type);
EXPORT_SYMBOL(ucSystemType);
#endif
@@ -125,7 +126,6 @@ EXPORT_SYMBOL(strtok);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strnlen);
-EXPORT_SYMBOL(strspn);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strncmp);
@@ -227,7 +227,7 @@ EXPORT_SYMBOL(pmu_register_sleep_notifier);
EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
EXPORT_SYMBOL(pmu_enable_irled);
#endif CONFIG_PMAC_PBOOK
-#if defined(CONFIG_PMAC) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
EXPORT_SYMBOL(find_devices);
EXPORT_SYMBOL(find_type_devices);
EXPORT_SYMBOL(find_compatible_devices);
@@ -243,8 +243,8 @@ EXPORT_SYMBOL(pci_device_loc);
EXPORT_SYMBOL(feature_set);
EXPORT_SYMBOL(feature_clear);
EXPORT_SYMBOL(feature_test);
-#endif /* defined(CONFIG_PMAC) || defined(CONFIG_ALL_PPC) */
-#if defined(CONFIG_SCSI) && (defined(CONFIG_PMAC) || defined(CONFIG_ALL_PPC))
+#endif /* defined(CONFIG_ALL_PPC) */
+#if defined(CONFIG_SCSI) && defined(CONFIG_ALL_PPC)
EXPORT_SYMBOL(note_scsi_host);
#endif
EXPORT_SYMBOL(kd_mksound);
@@ -270,7 +270,6 @@ EXPORT_SYMBOL(screen_info);
EXPORT_SYMBOL(int_control);
EXPORT_SYMBOL(timer_interrupt_intercept);
EXPORT_SYMBOL(timer_interrupt);
-extern unsigned long do_IRQ_intercept;
EXPORT_SYMBOL(do_IRQ_intercept);
EXPORT_SYMBOL(irq_desc);
void ppc_irq_dispatch_handler(struct pt_regs *, int);
@@ -278,3 +277,7 @@ EXPORT_SYMBOL(ppc_irq_dispatch_handler);
EXPORT_SYMBOL(decrementer_count);
EXPORT_SYMBOL(get_wchan);
EXPORT_SYMBOL(console_drivers);
+#ifdef CONFIG_XMON
+EXPORT_SYMBOL(xmon);
+#endif
+EXPORT_SYMBOL(down_read_failed);
diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
index 41382b2d7..5c01d3c72 100644
--- a/arch/ppc/kernel/process.c
+++ b/arch/ppc/kernel/process.c
@@ -158,7 +158,7 @@ enable_kernel_altivec(void)
if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
giveup_altivec(current);
else
- giveup_altivec(NULL): /* just enable AltiVec for kernel - force */
+ giveup_altivec(NULL); /* just enable AltiVec for kernel - force */
#else
giveup_altivec(last_task_used_altivec);
#endif /* __SMP __ */
diff --git a/arch/ppc/kernel/prom.c b/arch/ppc/kernel/prom.c
index b86e2a153..4ee638f62 100644
--- a/arch/ppc/kernel/prom.c
+++ b/arch/ppc/kernel/prom.c
@@ -604,7 +604,6 @@ prom_init(int r3, int r4, prom_entry pp)
/* XXX: hack - don't start cpu 0, this cpu -- Cort */
if ( smp_chrp_cpu_nr++ == 0 )
continue;
- RELOC(smp_ibm_chrp_hack) = 1;
prom_print(RELOC("starting cpu "));
prom_print(path);
*(unsigned long *)(0x4) = 0;
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 7502ad08e..5a57ba8a2 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -733,17 +733,13 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id)
id->eide_dma_time = __le16_to_cpu(id->eide_dma_time);
id->eide_pio = __le16_to_cpu(id->eide_pio);
id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy);
- id->word69 = __le16_to_cpu(id->word69);
- id->word70 = __le16_to_cpu(id->word70);
- id->word71 = __le16_to_cpu(id->word71);
- id->word72 = __le16_to_cpu(id->word72);
- id->word73 = __le16_to_cpu(id->word73);
- id->word74 = __le16_to_cpu(id->word74);
+ for (i=0; i<2 i++)
+ id->words69_70[i] = __le16_to_cpu(id->words69_70[i]);
+ for (i=0; i<4 i++)
+ id->words71_74[i] = __le16_to_cpu(id->words71_74[i]);
id->queue_depth = __le16_to_cpu(id->queue_depth);
- id->word76 = __le16_to_cpu(id->word76);
- id->word77 = __le16_to_cpu(id->word77);
- id->word78 = __le16_to_cpu(id->word78);
- id->word79 = __le16_to_cpu(id->word79);
+ for (i=0; i<4 i++)
+ id->words76_79[i] = __le16_to_cpu(id->words76_79[i]);
id->major_rev_num = __le16_to_cpu(id->major_rev_num);
id->minor_rev_num = __le16_to_cpu(id->minor_rev_num);
id->command_set_1 = __le16_to_cpu(id->command_set_1);
@@ -758,40 +754,14 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id)
id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues);
id->word92 = __le16_to_cpu(id->word92);
id->hw_config = __le16_to_cpu(id->hw_config);
- id->word94 = __le16_to_cpu(id->word94);
- id->word95 = __le16_to_cpu(id->word95);
- id->word96 = __le16_to_cpu(id->word96);
- id->word97 = __le16_to_cpu(id->word97);
- id->word98 = __le16_to_cpu(id->word98);
- id->word99 = __le16_to_cpu(id->word99);
- id->word100 = __le16_to_cpu(id->word100);
- id->word101 = __le16_to_cpu(id->word101);
- id->word102 = __le16_to_cpu(id->word102);
- id->word103 = __le16_to_cpu(id->word103);
- id->word104 = __le16_to_cpu(id->word104);
- id->word105 = __le16_to_cpu(id->word105);
- id->word106 = __le16_to_cpu(id->word106);
- id->word107 = __le16_to_cpu(id->word107);
- id->word108 = __le16_to_cpu(id->word108);
- id->word109 = __le16_to_cpu(id->word109);
- id->word110 = __le16_to_cpu(id->word110);
- id->word111 = __le16_to_cpu(id->word111);
- id->word112 = __le16_to_cpu(id->word112);
- id->word113 = __le16_to_cpu(id->word113);
- id->word114 = __le16_to_cpu(id->word114);
- id->word115 = __le16_to_cpu(id->word115);
- id->word116 = __le16_to_cpu(id->word116);
- id->word117 = __le16_to_cpu(id->word117);
- id->word118 = __le16_to_cpu(id->word118);
- id->word119 = __le16_to_cpu(id->word119);
- id->word120 = __le16_to_cpu(id->word120);
- id->word121 = __le16_to_cpu(id->word121);
- id->word122 = __le16_to_cpu(id->word122);
- id->word123 = __le16_to_cpu(id->word123);
- id->word124 = __le16_to_cpu(id->word124);
- id->word125 = __le16_to_cpu(id->word125);
- id->word126 = __le16_to_cpu(id->word126);
+ for (i=0; i<34; i++)
+ id->words94_125[i] = __le16_to_cpu(id->words94_125[i]);
+ id->last_lun = __le16_to_cpu(id->last_lun);
id->word127 = __le16_to_cpu(id->word127);
- for (i=0; i<127; i++)
- id->reserved[i] = __le16_to_cpu(id->reserved[i]);
+ id->dlf = __le16_to_cpu(id->dlf);
+ id->csfo = __le16_to_cpu(id->csfo);
+ for (i=0; i<31; i++)
+ id->words130_159[i] = __le16_to_cpu(id->words130_159[i]);
+ for (i=0; i<97; i++)
+ id->words160_255[i] = __le16_to_cpu(id->words160_255[i]);
}
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index 83dff9246..97543348b 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -12,6 +12,7 @@
* (troy@microux.com, hozer@drgw.net)
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp.h>
@@ -445,8 +446,10 @@ void __init smp_callin(void)
*/
if ( _machine & (_MACH_gemini|_MACH_chrp|_MACH_prep) )
do_openpic_setup_cpu();
+#ifdef CONFIG_GEMINI
if ( _machine == _MACH_gemini )
gemini_init_l2();
+#endif
while(!smp_commenced)
barrier();
__sti();
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 25d728fdd..2faccd042 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -115,11 +115,7 @@ extern struct task_struct *current_set[NR_CPUS];
PTE *Hash, *Hash_end;
unsigned long Hash_size, Hash_mask;
#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-#ifdef CONFIG_PPC64
-unsigned long long _SDR1;
-#else
unsigned long _SDR1;
-#endif
static void hash_init(void);
union ubat { /* BAT register values to be loaded */
@@ -423,10 +419,9 @@ __ioremap(unsigned long addr, unsigned long size, unsigned long flags)
/*
* Is it a candidate for a BAT mapping?
*/
-
for (i = 0; i < size; i += PAGE_SIZE)
map_page(v+i, p+i, flags);
-out:
+out:
return (void *) (v + (addr & ~PAGE_MASK));
}
@@ -593,7 +588,7 @@ mmu_context_overflow(void)
#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
static void get_mem_prop(char *, struct mem_pieces *);
-#if defined(CONFIG_PMAC) || defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
/*
* Read in a property describing some pieces of memory.
*/
@@ -616,7 +611,7 @@ static void __init get_mem_prop(char *name, struct mem_pieces *mp)
mem_pieces_sort(mp);
mem_pieces_coalesce(mp);
}
-#endif /* CONFIG_PMAC || CONFIG_CHRP || CONFIG_ALL_PPC */
+#endif /* CONFIG_ALL_PPC */
/*
* Set up one of the I/D BAT (block address translation) register pairs.
@@ -921,10 +916,11 @@ void __init MMU_init(void)
if ( ppc_md.progress ) ppc_md.progress("MMU:hash init", 0x300);
hash_init();
#ifdef CONFIG_PPC64
- _SDR1 = 0; /* temporary hack to just use bats -- Cort */
-#else
+ _SDR1 = __pa(Hash) | (ffz(~Hash_size) - 7)-11;
+#else
_SDR1 = __pa(Hash) | (Hash_mask >> 10);
-#endif
+#endif
+
ioremap_base = 0xf8000000;
if ( ppc_md.progress ) ppc_md.progress("MMU:mapin", 0x301);
@@ -947,7 +943,7 @@ void __init MMU_init(void)
setbat(0, 0xf8000000, 0xf8000000, 0x08000000, IO_PAGE);
#ifdef CONFIG_PPC64
/* temporary hack to get working until page tables are stable -- Cort*/
- setbat(1, 0x80000000, 0xc0000000, 0x10000000, IO_PAGE);
+/* setbat(1, 0x80000000, 0xc0000000, 0x10000000, IO_PAGE);*/
setbat(3, 0xd0000000, 0xd0000000, 0x10000000, IO_PAGE);
#else
setbat(1, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
@@ -1118,7 +1114,7 @@ void __init paging_init(void)
/*
* All pages are DMA-able so we put them all in the DMA zone.
*/
- zones_size[0] = virt_to_phys(end_of_DRAM) >> PAGE_SHIFT;
+ zones_size[0] = ((unsigned long)end_of_DRAM - KERNELBASE) >> PAGE_SHIFT;
for (i = 1; i < MAX_NR_ZONES; i++)
zones_size[i] = 0;
free_area_init(zones_size);
@@ -1132,9 +1128,9 @@ void __init mem_init(void)
int codepages = 0;
int datapages = 0;
int initpages = 0;
-#if defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
extern unsigned int rtas_data, rtas_size;
-#endif /* defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC) */
+#endif /* defined(CONFIG_ALL_PPC) */
max_mapnr = max_low_pfn;
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
num_physpages = max_mapnr; /* RAM is assumed contiguous */
@@ -1150,13 +1146,13 @@ void __init mem_init(void)
}
#endif /* CONFIG_BLK_DEV_INITRD */
-#if defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
/* mark the RTAS pages as reserved */
if ( rtas_data )
for (addr = rtas_data; addr < PAGE_ALIGN(rtas_data+rtas_size) ;
addr += PAGE_SIZE)
SetPageReserved(mem_map + MAP_NR(addr));
-#endif /* defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC) */
+#endif /* defined(CONFIG_ALL_PPC) */
if ( sysmap_size )
for (addr = (unsigned long)sysmap;
addr < PAGE_ALIGN((unsigned long)sysmap+sysmap_size) ;
@@ -1178,13 +1174,14 @@ void __init mem_init(void)
printk("Memory: %luk available (%dk kernel code, %dk data, %dk init) [%08x,%08lx]\n",
(unsigned long)nr_free_pages()<< (PAGE_SHIFT-10),
- codepages, datapages, initpages,
+ codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
+ initpages<< (PAGE_SHIFT-10),
PAGE_OFFSET, (unsigned long) end_of_DRAM);
mem_init_done = 1;
}
#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-#if defined(CONFIG_PMAC) || defined(CONFIG_CHRP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
/*
* On systems with Open Firmware, collect information about
* physical RAM and which pieces are already in use.
@@ -1195,9 +1192,13 @@ void __init mem_init(void)
unsigned long __init *pmac_find_end_of_memory(void)
{
unsigned long a, total;
-
- /* max amount of RAM we allow -- Cort */
-#define RAM_LIMIT (768<<20)
+ unsigned long ram_limit = 0xf0000000 - KERNELBASE;
+ /* allow 0x08000000 for IO space */
+ if ( _machine & (_MACH_prep|_MACH_Pmac) )
+ ram_limit = 0xd8000000 - KERNELBASE;
+#ifdef CONFIG_PPC64
+ ram_limit = 64<<20;
+#endif
memory_node = find_devices("memory");
if (memory_node == NULL) {
@@ -1222,16 +1223,8 @@ unsigned long __init *pmac_find_end_of_memory(void)
a = phys_mem.regions[0].address;
if (a != 0)
panic("RAM doesn't start at physical address 0");
- /*
- * XXX:
- * Make sure ram mappings don't stomp on IO space
- * This is a temporary hack to keep this from happening
- * until we move the KERNELBASE and can allocate RAM up
- * to our nearest IO area.
- * -- Cort
- */
- if (__max_memory == 0 || __max_memory > RAM_LIMIT)
- __max_memory = RAM_LIMIT;
+ if (__max_memory == 0 || __max_memory > ram_limit)
+ __max_memory = ram_limit;
if (phys_mem.regions[0].size >= __max_memory) {
phys_mem.regions[0].size = __max_memory;
phys_mem.n_regions = 1;
@@ -1247,12 +1240,11 @@ unsigned long __init *pmac_find_end_of_memory(void)
set_phys_avail(&phys_mem);
-#undef RAM_LIMIT
return __va(total);
}
-#endif /* CONFIG_PMAC || CONFIG_CHRP || CONFIG_ALL_PPC */
+#endif /* CONFIG_ALL_PPC */
-#if defined(CONFIG_PREP) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_ALL_PPC)
/*
* This finds the amount of physical ram and does necessary
* setup for prep. This is pretty architecture specific so
@@ -1279,7 +1271,7 @@ unsigned long __init *prep_find_end_of_memory(void)
return (__va(total));
}
-#endif /* defined(CONFIG_PREP) || defined(CONFIG_ALL_PPC) */
+#endif /* defined(CONFIG_ALL_PPC) */
#if defined(CONFIG_GEMINI)
@@ -1389,16 +1381,12 @@ static void __init hash_init(void)
* up to a maximum of 2MB.
*/
ramsize = (ulong)end_of_DRAM - KERNELBASE;
-#ifdef CONFIG_PPC64
- Hash_mask = 0;
- for (h = 256<<10; h < ramsize / 256 && h < 4<<20; h *= 2, Hash_mask++)
- ;
- Hash_size = h;
- Hash_mask <<= 10; /* so setting _SDR1 works the same -- Cort */
-#else
for (h = 64<<10; h < ramsize / 256 && h < 2<<20; h *= 2)
;
Hash_size = h;
+#ifdef CONFIG_PPC64
+ Hash_mask = (h >> 7) - 1;
+#else
Hash_mask = (h >> 6) - 1;
#endif
@@ -1433,7 +1421,11 @@ static void __init hash_init(void)
/*
* Patch up the instructions in head.S:hash_page
*/
+#ifdef CONFIG_PPC64
+ Hash_bits = ffz(~Hash_size) - 7;
+#else
Hash_bits = ffz(~Hash_size) - 6;
+#endif
hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
| (__pa(Hash) >> 16);
hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0)
@@ -1443,9 +1435,17 @@ static void __init hash_init(void)
hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0)
| ((26 - Hash_bits) << 6);
hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff)
+#ifdef CONFIG_PPC64
+ | (Hash_mask >> 11);
+#else
| (Hash_mask >> 10);
+#endif
hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff)
+#ifdef CONFIG_PPC64
+ | (Hash_mask >> 11);
+#else
| (Hash_mask >> 10);
+#endif
#if 0 /* see hash_page in head.S, note also patch_C ref below */
hash_page_patch_D[0] = (hash_page_patch_D[0] & ~0xffff)
| (Hash_mask >> 10);
diff --git a/arch/ppc/mm/mem_pieces.c b/arch/ppc/mm/mem_pieces.c
index e695d5a0a..309a526f5 100644
--- a/arch/ppc/mm/mem_pieces.c
+++ b/arch/ppc/mm/mem_pieces.c
@@ -127,7 +127,7 @@ mem_pieces_print(struct mem_pieces *mp)
printk("\n");
}
-#if defined(CONFIG_PREP) || defined(CONFIG_APUS) || defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_APUS) || defined(CONFIG_ALL_PPC)
/*
* Add some memory to an array of pieces
*/
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index a0da2f1b4..d18d74dfd 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -75,11 +75,14 @@ static void take_input(char *);
static unsigned read_spr(int);
static void write_spr(int, unsigned);
static void super_regs(void);
+static void print_sysmap(void);
static void remove_bpts(void);
static void insert_bpts(void);
static struct bpt *at_breakpoint(unsigned pc);
static void bpt_cmds(void);
static void cacheflush(void);
+static char *pretty_lookup_name(unsigned long addr);
+static char *lookup_name(unsigned long addr);
extern int print_insn_big_powerpc(FILE *, unsigned long, unsigned);
extern void printf(const char *fmt, ...);
@@ -101,6 +104,7 @@ Commands:\n\
mm move a block of memory\n\
ms set a block of memory\n\
md compare two blocks of memory\n\
+ M print System.map\n\
r print registers\n\
S print special registers\n\
t print backtrace\n\
@@ -337,6 +341,8 @@ cmds(struct pt_regs *excp)
else
excprint(excp);
break;
+ case 'M':
+ print_sysmap();
case 'S':
super_regs();
break;
@@ -514,8 +520,10 @@ getsp()
void
excprint(struct pt_regs *fp)
{
- printf("vector: %x at pc = %x, msr = %x, sp = %x [%x]\n",
- fp->trap, fp->nip, fp->msr, fp->gpr[1], fp);
+ printf("vector: %x at pc = %x %s",
+ fp->trap, fp->nip,/* pretty_lookup_name(fp->nip)*/"");
+ printf(", msr = %x, sp = %x [%x]\n",
+ fp->msr, fp->gpr[1], fp);
if (fp->trap == 0x300 || fp->trap == 0x600)
printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr);
if (current)
@@ -597,6 +605,14 @@ extern char exc_prolog;
extern char dec_exc;
void
+print_sysmap(void)
+{
+ extern char *sysmap;
+ if ( sysmap )
+ printf("System.map: \n%s", sysmap);
+}
+
+void
super_regs()
{
int i, cmd;
@@ -1345,9 +1361,26 @@ char *str;
lineptr = str;
}
+/*
+ * We use this array a lot here. We assume we don't have multiple
+ * instances of xmon running and that we don't use the return value of
+ * any functions other than printing them.
+ * -- Cort
+ */
char last[64];
-char *
-lookup_addr(unsigned long addr)
+static char *pretty_lookup_name(unsigned long addr)
+{
+ if ( lookup_name(addr) )
+ {
+ sprintf(last, " (%s)", lookup_name(addr));
+ return last;
+ }
+ else
+ return NULL;
+}
+
+
+static char *lookup_name(unsigned long addr)
{
extern char *sysmap;
extern unsigned long sysmap_size;
@@ -1357,10 +1390,6 @@ lookup_addr(unsigned long addr)
if ( !sysmap || !sysmap_size )
return NULL;
- /* adjust if addr is relative to kernelbase */
- if ( addr < PAGE_OFFSET )
- addr += PAGE_OFFSET;
-
cmp = simple_strtoul(c, &c, 8);
strcpy( last, strsep( &c, "\n"));
while ( c < (sysmap+sysmap_size) )
@@ -1372,3 +1401,4 @@ lookup_addr(unsigned long addr)
}
return last;
}
+