|
From: Andy P. <at...@us...> - 2002-04-10 19:00:40
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon
In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/xmon
Modified Files:
Makefile adb.c ansidecl.h nonstdio.h ppc-dis.c ppc-opc.c ppc.h
privinst.h setjmp.c start.c start_8xx.c subr_prf.c xmon.c
Log Message:
synch 2.4.15 commit 43
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 19:33:14 -0000 1.1.1.1
+++ Makefile 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,11 +1,14 @@
+# BK Id: SCCS/s.Makefile 1.6 06/27/01 14:49:58 trini
+#
# Makefile for xmon
O_TARGET := x.o
-ifeq ($(CONFIG_8xx),y)
-obj-y := start_8xx.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
+ifdef CONFIG_8xx
+obj-y := start_8xx.o
else
-obj-y := start.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
+obj-y := start.o
endif
+obj-y += xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
include $(TOPDIR)/Rules.make
Index: adb.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/adb.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- adb.c 14 Jan 2001 19:33:15 -0000 1.1.1.1
+++ adb.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.adb.c 1.5 05/17/01 18:14:23 cort
+ */
+/*
* Copyright (C) 1996 Paul Mackerras.
*/
#include "nonstdio.h"
Index: ansidecl.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/ansidecl.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ansidecl.h 14 Jan 2001 19:33:15 -0000 1.1.1.1
+++ ansidecl.h 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,3 +1,6 @@
+/*
+ * BK Id: SCCS/s.ansidecl.h 1.5 05/17/01 18:14:23 cort
+ */
/* ANSI and traditional C compatability macros
Copyright 1991, 1992 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Index: nonstdio.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/nonstdio.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- nonstdio.h 14 Jan 2001 19:33:16 -0000 1.1.1.1
+++ nonstdio.h 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,3 +1,6 @@
+/*
+ * BK Id: SCCS/s.nonstdio.h 1.5 05/17/01 18:14:23 cort
+ */
typedef int FILE;
extern FILE *xmon_stdin, *xmon_stdout;
#define EOF (-1)
Index: ppc-dis.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/ppc-dis.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ppc-dis.c 14 Jan 2001 19:33:16 -0000 1.1.1.1
+++ ppc-dis.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,3 +1,6 @@
+/*
+ * BK Id: SCCS/s.ppc-dis.c 1.5 05/17/01 18:14:23 cort
+ */
/* ppc-dis.c -- Disassemble PowerPC instructions
Copyright 1994 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
Index: ppc-opc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/ppc-opc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ppc-opc.c 14 Jan 2001 19:33:32 -0000 1.1.1.1
+++ ppc-opc.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,3 +1,6 @@
+/*
+ * BK Id: SCCS/s.ppc-opc.c 1.5 05/17/01 18:14:23 cort
+ */
/* ppc-opc.c -- PowerPC opcode list
Copyright 1994 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
Index: ppc.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/ppc.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ppc.h 14 Jan 2001 19:33:33 -0000 1.1.1.1
+++ ppc.h 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,3 +1,6 @@
+/*
+ * BK Id: SCCS/s.ppc.h 1.5 05/17/01 18:14:23 cort
+ */
/* ppc.h -- Header file for PowerPC opcode table
Copyright 1994 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
Index: privinst.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/privinst.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- privinst.h 14 Jan 2001 19:33:34 -0000 1.1.1.1
+++ privinst.h 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.privinst.h 1.5 05/17/01 18:14:23 cort
+ */
+/*
* Copyright (C) 1996 Paul Mackerras.
*/
#include <linux/config.h>
Index: setjmp.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/setjmp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- setjmp.c 14 Jan 2001 19:33:34 -0000 1.1.1.1
+++ setjmp.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.setjmp.c 1.5 05/17/01 18:14:23 cort
+ */
+/*
* Copyright (C) 1996 Paul Mackerras.
*
* NB this file must be compiled with -O2.
Index: start.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/start.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- start.c 25 Feb 2001 23:15:18 -0000 1.1.1.2
+++ start.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.start.c 1.16 08/20/01 22:17:58 paulus
+ */
+/*
* Copyright (C) 1996 Paul Mackerras.
*/
#include <linux/config.h>
@@ -15,6 +18,7 @@
#include <asm/feature.h>
#include <asm/processor.h>
#include <asm/delay.h>
+#include <asm/btext.h>
#ifdef CONFIG_SMP
#include <asm/bitops.h>
#endif
@@ -22,13 +26,11 @@
static volatile unsigned char *sccc, *sccd;
unsigned long TXRDY, RXRDY;
extern void xmon_printf(const char *fmt, ...);
-extern void prom_drawchar(char);
-extern void prom_drawstring(const char *str);
static int xmon_expect(const char *str, unsigned int timeout);
static int console;
static int use_screen;
-static int via_modem = 1;
+static int via_modem;
static int xmon_use_sccb;
static struct device_node *macio_node;
@@ -53,6 +55,7 @@
void
xmon_map_scc(void)
{
+#ifdef CONFIG_ALL_PPC
volatile unsigned char *base;
use_screen = 0;
@@ -61,27 +64,57 @@
struct device_node *np;
unsigned long addr;
#ifdef CONFIG_BOOTX_TEXT
- extern boot_infos_t *disp_bi;
+ if (!machine_is_compatible("iMac")) {
+ extern boot_infos_t *disp_bi;
- /* see if there is a keyboard in the device tree
- with a parent of type "adb" */
- for (np = find_devices("keyboard"); np; np = np->next)
- if (np->parent && np->parent->type
- && strcmp(np->parent->type, "adb") == 0)
- break;
+ /* see if there is a keyboard in the device tree
+ with a parent of type "adb" */
+ for (np = find_devices("keyboard"); np; np = np->next)
+ if (np->parent && np->parent->type
+ && strcmp(np->parent->type, "adb") == 0)
+ break;
- /* needs to be hacked if xmon_printk is to be used
- from within find_via_pmu() */
+ /* needs to be hacked if xmon_printk is to be used
+ from within find_via_pmu() */
#ifdef CONFIG_ADB_PMU
- if (np != NULL && disp_bi && find_via_pmu())
- use_screen = 1;
+ if (np != NULL && disp_bi && find_via_pmu())
+ use_screen = 1;
#endif
#ifdef CONFIG_ADB_CUDA
- if (np != NULL && disp_bi && find_via_cuda())
- use_screen = 1;
+ if (np != NULL && disp_bi && find_via_cuda())
+ use_screen = 1;
#endif
+ }
+ if (!use_screen && (np = find_devices("escc")) != NULL) {
+ /*
+ * look for the device node for the serial port
+ * we're using and see if it says it has a modem
+ */
+ char *name = xmon_use_sccb? "ch-b": "ch-a";
+ char *slots;
+ int l;
+
+ np = np->child;
+ while (np != NULL && strcmp(np->name, name) != 0)
+ np = np->sibling;
+ if (np != NULL) {
+ /* XXX should parse this properly */
+ slots = get_property(np, "slot-names", &l);
+ if (slots != NULL && l >= 10
+ && strcmp(slots+4, "Modem") == 0)
+ via_modem = 1;
+ }
+ }
+ btext_drawstring("xmon uses ");
if (use_screen)
- prom_drawstring("xmon uses screen and keyboard\n");
+ btext_drawstring("screen and keyboard\n");
+ else {
+ if (via_modem)
+ btext_drawstring("modem on ");
+ btext_drawstring(xmon_use_sccb? "printer": "modem");
+ btext_drawstring(" port\n");
+ }
+
#endif /* CONFIG_BOOTX_TEXT */
#ifdef CHRP_ESCC
@@ -113,6 +146,14 @@
TXRDY = 0x20;
RXRDY = 1;
}
+#elif defined(CONFIG_GEMINI)
+ /* should already be mapped by the kernel boot */
+ sccc = (volatile unsigned char *) 0xffeffb0d;
+ sccd = (volatile unsigned char *) 0xffeffb08;
+ TXRDY = 0x20;
+ RXRDY = 1;
+ console = 1;
+#endif /* platform */
}
static int scc_initialized = 0;
@@ -153,7 +194,7 @@
if (use_screen) {
/* write it on the screen */
for (i = 0; i < nb; ++i)
- prom_drawchar(*p++);
+ btext_drawchar(*p++);
goto out;
}
#endif
@@ -194,7 +235,7 @@
static unsigned char xmon_keytab[128] =
"asdfhgzxcv\000bqwer" /* 0x00 - 0x0f */
- "yt123465=97-80o]" /* 0x10 - 0x1f */
+ "yt123465=97-80]o" /* 0x10 - 0x1f */
"u[ip\rlj'k;\\,/nm." /* 0x20 - 0x2f */
"\t `\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
"\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
@@ -202,7 +243,7 @@
static unsigned char xmon_shift_keytab[128] =
"ASDFHGZXCV\000BQWER" /* 0x00 - 0x0f */
- "YT!@#$^%+(&=*)}O" /* 0x10 - 0x1f */
+ "YT!@#$^%+(&_*)}O" /* 0x10 - 0x1f */
"U{IP\rLJ\"K:|<?NM>" /* 0x20 - 0x2f */
"\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
"\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
@@ -221,15 +262,15 @@
do {
if (--t < 0) {
on = 1 - on;
- prom_drawchar(on? 0xdb: 0x20);
- prom_drawchar('\b');
+ btext_drawchar(on? 0xdb: 0x20);
+ btext_drawchar('\b');
t = 200000;
}
do_poll_adb();
} while (xmon_adb_keycode == -1);
k = xmon_adb_keycode;
if (on)
- prom_drawstring(" \b");
+ btext_drawstring(" \b");
/* test for shift keys */
if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) {
@@ -522,7 +563,9 @@
xmon_enter(void)
{
#ifdef CONFIG_ADB_PMU
- pmu_suspend();
+ if (_machine == _MACH_Pmac) {
+ pmu_suspend();
+ }
#endif
}
@@ -530,6 +573,8 @@
xmon_leave(void)
{
#ifdef CONFIG_ADB_PMU
- pmu_resume();
+ if (_machine == _MACH_Pmac) {
+ pmu_resume();
+ }
#endif
}
Index: start_8xx.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/start_8xx.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- start_8xx.c 14 Jan 2001 19:33:40 -0000 1.1.1.1
+++ start_8xx.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.start_8xx.c 1.10 09/14/01 18:01:17 trini
+ */
+/*
* Copyright (C) 1996 Paul Mackerras.
* Copyright (C) 2000 Dan Malek.
* Quick hack of Paul's code to make XMON work on 8xx processors. Lots
@@ -15,7 +18,7 @@
#include <asm/processor.h>
#include <asm/8xx_immap.h>
#include <asm/mpc8xx.h>
-#include "commproc.h"
+#include <asm/commproc.h>
extern void xmon_printf(const char *fmt, ...);
extern int xmon_8xx_write(char *str, int nb);
Index: subr_prf.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/subr_prf.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- subr_prf.c 14 Jan 2001 19:33:35 -0000 1.1.1.1
+++ subr_prf.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.subr_prf.c 1.5 05/17/01 18:14:23 cort
+ */
+/*
* Written by Cort Dougan to replace the version originally used
* by Paul Mackerras, which came from NetBSD and thus had copyright
* conflicts with Linux.
Index: xmon.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/xmon/xmon.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- xmon.c 25 Feb 2001 23:15:18 -0000 1.1.1.2
+++ xmon.c 10 Apr 2002 15:04:13 -0000 1.2
@@ -1,4 +1,7 @@
/*
+ * BK Id: SCCS/s.xmon.c 1.16 09/22/01 15:25:10 trini
+ */
+/*
* Routines providing a simple monitor for use on the PowerMac.
*
* Copyright (C) 1996 Paul Mackerras.
@@ -208,10 +211,11 @@
xmon_irq(int irq, void *d, struct pt_regs *regs)
{
unsigned long flags;
- save_flags(flags);cli();
+ __save_flags(flags);
+ __cli();
printf("Keyboard interrupt\n");
xmon(regs);
- restore_flags(flags);
+ __restore_flags(flags);
}
int
@@ -657,8 +661,7 @@
unsigned stack[2];
struct pt_regs regs;
extern char ret_from_intercept, ret_from_syscall_1, ret_from_syscall_2;
- extern char lost_irq_ret, do_bottom_half_ret, do_signal_ret;
- extern char ret_from_except;
+ extern char do_signal_ret, ret_from_except;
printf("backtrace:\n");
@@ -676,8 +679,6 @@
|| stack[1] == (unsigned) &ret_from_except
|| stack[1] == (unsigned) &ret_from_syscall_1
|| stack[1] == (unsigned) &ret_from_syscall_2
- || stack[1] == (unsigned) &lost_irq_ret
- || stack[1] == (unsigned) &do_bottom_half_ret
|| stack[1] == (unsigned) &do_signal_ret) {
if (mread(sp+16, ®s, sizeof(regs)) != sizeof(regs))
break;
@@ -812,10 +813,12 @@
printf("sprg0-3 = %x %x %x %x\n", get_sprg0(), get_sprg1(),
get_sprg2(), get_sprg3());
printf("srr0 = %x, srr1 = %x\n", get_srr0(), get_srr1());
+#ifdef CONFIG_PPC_STD_MMU
printf("sr0-15 =");
for (i = 0; i < 16; ++i)
printf(" %x", get_sr(i));
printf("\n");
+#endif
asm("mr %0,1" : "=r" (i) :);
printf("sp = %x ", i);
asm("mr %0,2" : "=r" (i) :);
@@ -1016,7 +1019,8 @@
seg_end = (seg << 28) | 0x0ffff000;
if (seg_end > hash_end)
seg_end = hash_end;
- dump_hash_table_seg((hash_ctx << 4) + seg, seg_start, seg_end);
+ dump_hash_table_seg((hash_ctx << 4) + (seg * 0x111),
+ seg_start, seg_end);
seg_start = seg_end + 0x1000;
}
}
|