aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-02-23 22:05:47 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-23 22:05:47 -0500
commita00428f5b149e36b8225b2a0812742a6dfb07b8c (patch)
treea78869cd67cf78a0eb091fb0ea5d397734bd6738 /arch/ppc
parent774fee58c465ea1c7e9775e347ec307bcf2deeb3 (diff)
parentfb5c594c2acc441f0d2d8f457484a0e0e9285db3 (diff)
Merge ../powerpc-merge
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/kernel/head.S1
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c8
-rw-r--r--arch/ppc/xmon/adb.c212
-rw-r--r--arch/ppc/xmon/start.c184
-rw-r--r--arch/ppc/xmon/xmon.c108
5 files changed, 5 insertions, 508 deletions
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index c5a890dca9cf..53ea845fb911 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -751,6 +751,7 @@ AltiVecUnavailable:
751#ifdef CONFIG_ALTIVEC 751#ifdef CONFIG_ALTIVEC
752 bne load_up_altivec /* if from user, just load it up */ 752 bne load_up_altivec /* if from user, just load it up */
753#endif /* CONFIG_ALTIVEC */ 753#endif /* CONFIG_ALTIVEC */
754 addi r3,r1,STACK_FRAME_OVERHEAD
754 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception) 755 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
755 756
756#ifdef CONFIG_PPC64BRIDGE 757#ifdef CONFIG_PPC64BRIDGE
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 15bd9b448a48..82adb4601348 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -93,15 +93,8 @@ EXPORT_SYMBOL(test_and_change_bit);
93EXPORT_SYMBOL(strcpy); 93EXPORT_SYMBOL(strcpy);
94EXPORT_SYMBOL(strncpy); 94EXPORT_SYMBOL(strncpy);
95EXPORT_SYMBOL(strcat); 95EXPORT_SYMBOL(strcat);
96EXPORT_SYMBOL(strncat);
97EXPORT_SYMBOL(strchr);
98EXPORT_SYMBOL(strrchr);
99EXPORT_SYMBOL(strpbrk);
100EXPORT_SYMBOL(strstr);
101EXPORT_SYMBOL(strlen); 96EXPORT_SYMBOL(strlen);
102EXPORT_SYMBOL(strnlen);
103EXPORT_SYMBOL(strcmp); 97EXPORT_SYMBOL(strcmp);
104EXPORT_SYMBOL(strncmp);
105EXPORT_SYMBOL(strcasecmp); 98EXPORT_SYMBOL(strcasecmp);
106EXPORT_SYMBOL(__div64_32); 99EXPORT_SYMBOL(__div64_32);
107 100
@@ -253,7 +246,6 @@ EXPORT_SYMBOL(memcpy);
253EXPORT_SYMBOL(cacheable_memcpy); 246EXPORT_SYMBOL(cacheable_memcpy);
254EXPORT_SYMBOL(memset); 247EXPORT_SYMBOL(memset);
255EXPORT_SYMBOL(memmove); 248EXPORT_SYMBOL(memmove);
256EXPORT_SYMBOL(memscan);
257EXPORT_SYMBOL(memcmp); 249EXPORT_SYMBOL(memcmp);
258EXPORT_SYMBOL(memchr); 250EXPORT_SYMBOL(memchr);
259 251
diff --git a/arch/ppc/xmon/adb.c b/arch/ppc/xmon/adb.c
deleted file mode 100644
index e91384dcccac..000000000000
--- a/arch/ppc/xmon/adb.c
+++ /dev/null
@@ -1,212 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 */
4#include "nonstdio.h"
5#include "privinst.h"
6
7#define scanhex xmon_scanhex
8#define skipbl xmon_skipbl
9
10#define ADB_B (*(volatile unsigned char *)0xf3016000)
11#define ADB_SR (*(volatile unsigned char *)0xf3017400)
12#define ADB_ACR (*(volatile unsigned char *)0xf3017600)
13#define ADB_IFR (*(volatile unsigned char *)0xf3017a00)
14
15static inline void eieio(void) { asm volatile ("eieio" : :); }
16
17#define N_ADB_LOG 1000
18struct adb_log {
19 unsigned char b;
20 unsigned char ifr;
21 unsigned char acr;
22 unsigned int time;
23} adb_log[N_ADB_LOG];
24int n_adb_log;
25
26void
27init_adb_log(void)
28{
29 adb_log[0].b = ADB_B;
30 adb_log[0].ifr = ADB_IFR;
31 adb_log[0].acr = ADB_ACR;
32 adb_log[0].time = get_dec();
33 n_adb_log = 0;
34}
35
36void
37dump_adb_log(void)
38{
39 unsigned t, t0;
40 struct adb_log *ap;
41 int i;
42
43 ap = adb_log;
44 t0 = ap->time;
45 for (i = 0; i <= n_adb_log; ++i, ++ap) {
46 t = t0 - ap->time;
47 printf("b=%x ifr=%x acr=%x at %d.%.7d\n", ap->b, ap->ifr, ap->acr,
48 t / 1000000000, (t % 1000000000) / 100);
49 }
50}
51
52void
53adb_chklog(void)
54{
55 struct adb_log *ap = &adb_log[n_adb_log + 1];
56
57 ap->b = ADB_B;
58 ap->ifr = ADB_IFR;
59 ap->acr = ADB_ACR;
60 if (ap->b != ap[-1].b || (ap->ifr & 4) != (ap[-1].ifr & 4)
61 || ap->acr != ap[-1].acr) {
62 ap->time = get_dec();
63 ++n_adb_log;
64 }
65}
66
67int
68adb_bitwait(int bmask, int bval, int fmask, int fval)
69{
70 int i;
71 struct adb_log *ap;
72
73 for (i = 10000; i > 0; --i) {
74 adb_chklog();
75 ap = &adb_log[n_adb_log];
76 if ((ap->b & bmask) == bval && (ap->ifr & fmask) == fval)
77 return 0;
78 }
79 return -1;
80}
81
82int
83adb_wait(void)
84{
85 if (adb_bitwait(0, 0, 4, 4) < 0) {
86 printf("adb: ready wait timeout\n");
87 return -1;
88 }
89 return 0;
90}
91
92void
93adb_readin(void)
94{
95 int i, j;
96 unsigned char d[64];
97
98 if (ADB_B & 8) {
99 printf("ADB_B: %x\n", ADB_B);
100 return;
101 }
102 i = 0;
103 adb_wait();
104 j = ADB_SR;
105 eieio();
106 ADB_B &= ~0x20;
107 eieio();
108 for (;;) {
109 if (adb_wait() < 0)
110 break;
111 d[i++] = ADB_SR;
112 eieio();
113 if (ADB_B & 8)
114 break;
115 ADB_B ^= 0x10;
116 eieio();
117 }
118 ADB_B |= 0x30;
119 if (adb_wait() == 0)
120 j = ADB_SR;
121 for (j = 0; j < i; ++j)
122 printf("%.2x ", d[j]);
123 printf("\n");
124}
125
126int
127adb_write(unsigned char *d, int i)
128{
129 int j;
130 unsigned x;
131
132 if ((ADB_B & 8) == 0) {
133 printf("r: ");
134 adb_readin();
135 }
136 for (;;) {
137 ADB_ACR = 0x1c;
138 eieio();
139 ADB_SR = d[0];
140 eieio();
141 ADB_B &= ~0x20;
142 eieio();
143 if (ADB_B & 8)
144 break;
145 ADB_ACR = 0xc;
146 eieio();
147 ADB_B |= 0x20;
148 eieio();
149 adb_readin();
150 }
151 adb_wait();
152 for (j = 1; j < i; ++j) {
153 ADB_SR = d[j];
154 eieio();
155 ADB_B ^= 0x10;
156 eieio();
157 if (adb_wait() < 0)
158 break;
159 }
160 ADB_ACR = 0xc;
161 eieio();
162 x = ADB_SR;
163 eieio();
164 ADB_B |= 0x30;
165 return j;
166}
167
168void
169adbcmds(void)
170{
171 char cmd;
172 unsigned rtcu, rtcl, dec, pdec, x;
173 int i, j;
174 unsigned char d[64];
175
176 cmd = skipbl();
177 switch (cmd) {
178 case 't':
179 for (;;) {
180 rtcl = get_rtcl();
181 rtcu = get_rtcu();
182 dec = get_dec();
183 printf("rtc u=%u l=%u dec=%x (%d = %d.%.7d)\n",
184 rtcu, rtcl, dec, pdec - dec, (pdec - dec) / 1000000000,
185 ((pdec - dec) % 1000000000) / 100);
186 pdec = dec;
187 if (cmd == 'x')
188 break;
189 while (xmon_read(stdin, &cmd, 1) != 1)
190 ;
191 }
192 break;
193 case 'r':
194 init_adb_log();
195 while (adb_bitwait(8, 0, 0, 0) == 0)
196 adb_readin();
197 break;
198 case 'w':
199 i = 0;
200 while (scanhex(&x))
201 d[i++] = x;
202 init_adb_log();
203 j = adb_write(d, i);
204 printf("sent %d bytes\n", j);
205 while (adb_bitwait(8, 0, 0, 0) == 0)
206 adb_readin();
207 break;
208 case 'l':
209 dump_adb_log();
210 break;
211 }
212}
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index 4344cbe9b5c5..ff86b2d814cb 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -6,16 +6,11 @@
6#include <asm/machdep.h> 6#include <asm/machdep.h>
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/page.h> 8#include <asm/page.h>
9#include <linux/adb.h>
10#include <linux/pmu.h>
11#include <linux/cuda.h>
12#include <linux/kernel.h> 9#include <linux/kernel.h>
13#include <linux/errno.h> 10#include <linux/errno.h>
14#include <linux/sysrq.h> 11#include <linux/sysrq.h>
15#include <linux/bitops.h> 12#include <linux/bitops.h>
16#include <asm/xmon.h> 13#include <asm/xmon.h>
17#include <asm/prom.h>
18#include <asm/bootx.h>
19#include <asm/machdep.h> 14#include <asm/machdep.h>
20#include <asm/errno.h> 15#include <asm/errno.h>
21#include <asm/processor.h> 16#include <asm/processor.h>
@@ -26,9 +21,7 @@ static volatile unsigned char *sccc, *sccd;
26unsigned int TXRDY, RXRDY, DLAB; 21unsigned int TXRDY, RXRDY, DLAB;
27static int xmon_expect(const char *str, unsigned int timeout); 22static int xmon_expect(const char *str, unsigned int timeout);
28 23
29static int use_screen;
30static int via_modem; 24static int via_modem;
31static int xmon_use_sccb;
32 25
33#define TB_SPEED 25000000 26#define TB_SPEED 25000000
34 27
@@ -46,47 +39,6 @@ void buf_access(void)
46 sccd[3] &= ~DLAB; /* reset DLAB */ 39 sccd[3] &= ~DLAB; /* reset DLAB */
47} 40}
48 41
49extern int adb_init(void);
50
51#ifdef CONFIG_PPC_CHRP
52/*
53 * This looks in the "ranges" property for the primary PCI host bridge
54 * to find the physical address of the start of PCI/ISA I/O space.
55 * It is basically a cut-down version of pci_process_bridge_OF_ranges.
56 */
57static unsigned long chrp_find_phys_io_base(void)
58{
59 struct device_node *node;
60 unsigned int *ranges;
61 unsigned long base = CHRP_ISA_IO_BASE;
62 int rlen = 0;
63 int np;
64
65 node = find_devices("isa");
66 if (node != NULL) {
67 node = node->parent;
68 if (node == NULL || node->type == NULL
69 || strcmp(node->type, "pci") != 0)
70 node = NULL;
71 }
72 if (node == NULL)
73 node = find_devices("pci");
74 if (node == NULL)
75 return base;
76
77 ranges = (unsigned int *) get_property(node, "ranges", &rlen);
78 np = prom_n_addr_cells(node) + 5;
79 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
80 if ((ranges[0] >> 24) == 1 && ranges[2] == 0) {
81 /* I/O space starting at 0, grab the phys base */
82 base = ranges[np - 3];
83 break;
84 }
85 ranges += np;
86 }
87 return base;
88}
89#endif /* CONFIG_PPC_CHRP */
90 42
91#ifdef CONFIG_MAGIC_SYSRQ 43#ifdef CONFIG_MAGIC_SYSRQ
92static void sysrq_handle_xmon(int key, struct pt_regs *regs, 44static void sysrq_handle_xmon(int key, struct pt_regs *regs,
@@ -109,22 +61,6 @@ xmon_map_scc(void)
109#ifdef CONFIG_PPC_MULTIPLATFORM 61#ifdef CONFIG_PPC_MULTIPLATFORM
110 volatile unsigned char *base; 62 volatile unsigned char *base;
111 63
112#ifdef CONFIG_PPC_CHRP
113 base = (volatile unsigned char *) isa_io_base;
114 if (_machine == _MACH_chrp)
115 base = (volatile unsigned char *)
116 ioremap(chrp_find_phys_io_base(), 0x1000);
117
118 sccc = base + 0x3fd;
119 sccd = base + 0x3f8;
120 if (xmon_use_sccb) {
121 sccc -= 0x100;
122 sccd -= 0x100;
123 }
124 TXRDY = 0x20;
125 RXRDY = 1;
126 DLAB = 0x80;
127#endif /* CONFIG_PPC_CHRP */
128#elif defined(CONFIG_GEMINI) 64#elif defined(CONFIG_GEMINI)
129 /* should already be mapped by the kernel boot */ 65 /* should already be mapped by the kernel boot */
130 sccc = (volatile unsigned char *) 0xffeffb0d; 66 sccc = (volatile unsigned char *) 0xffeffb0d;
@@ -143,22 +79,9 @@ xmon_map_scc(void)
143 register_sysrq_key('x', &sysrq_xmon_op); 79 register_sysrq_key('x', &sysrq_xmon_op);
144} 80}
145 81
146static int scc_initialized = 0; 82static int scc_initialized;
147 83
148void xmon_init_scc(void); 84void xmon_init_scc(void);
149extern void cuda_poll(void);
150
151static inline void do_poll_adb(void)
152{
153#ifdef CONFIG_ADB_PMU
154 if (sys_ctrler == SYS_CTRLER_PMU)
155 pmu_poll_adb();
156#endif /* CONFIG_ADB_PMU */
157#ifdef CONFIG_ADB_CUDA
158 if (sys_ctrler == SYS_CTRLER_CUDA)
159 cuda_poll();
160#endif /* CONFIG_ADB_CUDA */
161}
162 85
163int 86int
164xmon_write(void *handle, void *ptr, int nb) 87xmon_write(void *handle, void *ptr, int nb)
@@ -176,20 +99,12 @@ xmon_write(void *handle, void *ptr, int nb)
176 break; 99 break;
177#endif 100#endif
178 101
179#ifdef CONFIG_BOOTX_TEXT
180 if (use_screen) {
181 /* write it on the screen */
182 for (i = 0; i < nb; ++i)
183 btext_drawchar(*p++);
184 goto out;
185 }
186#endif
187 if (!scc_initialized) 102 if (!scc_initialized)
188 xmon_init_scc(); 103 xmon_init_scc();
189 ct = 0; 104 ct = 0;
190 for (i = 0; i < nb; ++i) { 105 for (i = 0; i < nb; ++i) {
191 while ((*sccc & TXRDY) == 0) 106 while ((*sccc & TXRDY) == 0)
192 do_poll_adb(); 107 ;
193 c = p[i]; 108 c = p[i];
194 if (c == '\n' && !ct) { 109 if (c == '\n' && !ct) {
195 c = '\r'; 110 c = '\r';
@@ -203,7 +118,6 @@ xmon_write(void *handle, void *ptr, int nb)
203 eieio(); 118 eieio();
204 } 119 }
205 120
206 out:
207#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
208 if (!locked) 122 if (!locked)
209 clear_bit(0, &xmon_write_lock); 123 clear_bit(0, &xmon_write_lock);
@@ -212,65 +126,7 @@ xmon_write(void *handle, void *ptr, int nb)
212} 126}
213 127
214int xmon_wants_key; 128int xmon_wants_key;
215int xmon_adb_keycode;
216
217#ifdef CONFIG_BOOTX_TEXT
218static int xmon_adb_shiftstate;
219
220static unsigned char xmon_keytab[128] =
221 "asdfhgzxcv\000bqwer" /* 0x00 - 0x0f */
222 "yt123465=97-80]o" /* 0x10 - 0x1f */
223 "u[ip\rlj'k;\\,/nm." /* 0x20 - 0x2f */
224 "\t `\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
225 "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
226 "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */
227
228static unsigned char xmon_shift_keytab[128] =
229 "ASDFHGZXCV\000BQWER" /* 0x00 - 0x0f */
230 "YT!@#$^%+(&_*)}O" /* 0x10 - 0x1f */
231 "U{IP\rLJ\"K:|<?NM>" /* 0x20 - 0x2f */
232 "\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */
233 "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */
234 "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */
235
236static int
237xmon_get_adb_key(void)
238{
239 int k, t, on;
240 129
241 xmon_wants_key = 1;
242 for (;;) {
243 xmon_adb_keycode = -1;
244 t = 0;
245 on = 0;
246 do {
247 if (--t < 0) {
248 on = 1 - on;
249 btext_drawchar(on? 0xdb: 0x20);
250 btext_drawchar('\b');
251 t = 200000;
252 }
253 do_poll_adb();
254 } while (xmon_adb_keycode == -1);
255 k = xmon_adb_keycode;
256 if (on)
257 btext_drawstring(" \b");
258
259 /* test for shift keys */
260 if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) {
261 xmon_adb_shiftstate = (k & 0x80) == 0;
262 continue;
263 }
264 if (k >= 0x80)
265 continue; /* ignore up transitions */
266 k = (xmon_adb_shiftstate? xmon_shift_keytab: xmon_keytab)[k];
267 if (k != 0)
268 break;
269 }
270 xmon_wants_key = 0;
271 return k;
272}
273#endif /* CONFIG_BOOTX_TEXT */
274 130
275int 131int
276xmon_read(void *handle, void *ptr, int nb) 132xmon_read(void *handle, void *ptr, int nb)
@@ -278,18 +134,11 @@ xmon_read(void *handle, void *ptr, int nb)
278 char *p = ptr; 134 char *p = ptr;
279 int i; 135 int i;
280 136
281#ifdef CONFIG_BOOTX_TEXT
282 if (use_screen) {
283 for (i = 0; i < nb; ++i)
284 *p++ = xmon_get_adb_key();
285 return i;
286 }
287#endif
288 if (!scc_initialized) 137 if (!scc_initialized)
289 xmon_init_scc(); 138 xmon_init_scc();
290 for (i = 0; i < nb; ++i) { 139 for (i = 0; i < nb; ++i) {
291 while ((*sccc & RXRDY) == 0) 140 while ((*sccc & RXRDY) == 0)
292 do_poll_adb(); 141 ;
293 buf_access(); 142 buf_access();
294 *p++ = *sccd; 143 *p++ = *sccd;
295 } 144 }
@@ -300,7 +149,7 @@ int
300xmon_read_poll(void) 149xmon_read_poll(void)
301{ 150{
302 if ((*sccc & RXRDY) == 0) { 151 if ((*sccc & RXRDY) == 0) {
303 do_poll_adb(); 152 ;
304 return -1; 153 return -1;
305 } 154 }
306 buf_access(); 155 buf_access();
@@ -310,15 +159,6 @@ xmon_read_poll(void)
310void 159void
311xmon_init_scc(void) 160xmon_init_scc(void)
312{ 161{
313 if ( _machine == _MACH_chrp )
314 {
315 sccd[3] = 0x83; eieio(); /* LCR = 8N1 + DLAB */
316 sccd[0] = 12; eieio(); /* DLL = 9600 baud */
317 sccd[1] = 0; eieio();
318 sccd[2] = 0; eieio(); /* FCR = 0 */
319 sccd[3] = 3; eieio(); /* LCR = 8N1 */
320 sccd[1] = 0; eieio(); /* IER = 0 */
321 }
322 scc_initialized = 1; 162 scc_initialized = 1;
323 if (via_modem) { 163 if (via_modem) {
324 for (;;) { 164 for (;;) {
@@ -334,22 +174,6 @@ xmon_init_scc(void)
334 } 174 }
335} 175}
336 176
337#if 0
338extern int (*prom_entry)(void *);
339
340int
341xmon_exit(void)
342{
343 struct prom_args {
344 char *service;
345 } args;
346
347 for (;;) {
348 args.service = "exit";
349 (*prom_entry)(&args);
350 }
351}
352#endif
353 177
354void *xmon_stdin; 178void *xmon_stdin;
355void *xmon_stdout; 179void *xmon_stdout;
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index bdaf6597b4c2..06fa44b5c647 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -12,8 +12,6 @@
12#include <linux/kallsyms.h> 12#include <linux/kallsyms.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/string.h> 14#include <asm/string.h>
15#include <asm/prom.h>
16#include <asm/bootx.h>
17#include <asm/machdep.h> 15#include <asm/machdep.h>
18#include <asm/xmon.h> 16#include <asm/xmon.h>
19#include "nonstdio.h" 17#include "nonstdio.h"
@@ -101,9 +99,6 @@ void cacheflush(void);
101static void cpu_cmd(void); 99static void cpu_cmd(void);
102#endif /* CONFIG_SMP */ 100#endif /* CONFIG_SMP */
103static void csum(void); 101static void csum(void);
104#ifdef CONFIG_BOOTX_TEXT
105static void vidcmds(void);
106#endif
107static void bootcmds(void); 102static void bootcmds(void);
108static void proccall(void); 103static void proccall(void);
109static void printtime(void); 104static void printtime(void);
@@ -522,11 +517,6 @@ cmds(struct pt_regs *excp)
522 cpu_cmd(); 517 cpu_cmd();
523 break; 518 break;
524#endif /* CONFIG_SMP */ 519#endif /* CONFIG_SMP */
525#ifdef CONFIG_BOOTX_TEXT
526 case 'v':
527 vidcmds();
528 break;
529#endif
530 case 'z': 520 case 'z':
531 bootcmds(); 521 bootcmds();
532 break; 522 break;
@@ -618,43 +608,6 @@ static void cpu_cmd(void)
618} 608}
619#endif /* CONFIG_SMP */ 609#endif /* CONFIG_SMP */
620 610
621#ifdef CONFIG_BOOTX_TEXT
622extern boot_infos_t disp_bi;
623
624static void vidcmds(void)
625{
626 int c = inchar();
627 unsigned int val, w;
628 extern int boot_text_mapped;
629
630 if (!boot_text_mapped)
631 return;
632 if (c != '\n' && scanhex(&val)) {
633 switch (c) {
634 case 'd':
635 w = disp_bi.dispDeviceRowBytes
636 / (disp_bi.dispDeviceDepth >> 3);
637 disp_bi.dispDeviceDepth = val;
638 disp_bi.dispDeviceRowBytes = w * (val >> 3);
639 return;
640 case 'p':
641 disp_bi.dispDeviceRowBytes = val;
642 return;
643 case 'w':
644 disp_bi.dispDeviceRect[2] = val;
645 return;
646 case 'h':
647 disp_bi.dispDeviceRect[3] = val;
648 return;
649 }
650 }
651 printf("W = %d (0x%x) H = %d (0x%x) D = %d (0x%x) P = %d (0x%x)\n",
652 disp_bi.dispDeviceRect[2], disp_bi.dispDeviceRect[2],
653 disp_bi.dispDeviceRect[3], disp_bi.dispDeviceRect[3],
654 disp_bi.dispDeviceDepth, disp_bi.dispDeviceDepth,
655 disp_bi.dispDeviceRowBytes, disp_bi.dispDeviceRowBytes);
656}
657#endif /* CONFIG_BOOTX_TEXT */
658 611
659static unsigned short fcstab[256] = { 612static unsigned short fcstab[256] = {
660 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 613 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
@@ -1020,7 +973,6 @@ dump_hash_table(void)
1020} 973}
1021#else 974#else
1022 975
1023#ifndef CONFIG_PPC64BRIDGE
1024static void 976static void
1025dump_hash_table_seg(unsigned seg, unsigned start, unsigned end) 977dump_hash_table_seg(unsigned seg, unsigned start, unsigned end)
1026{ 978{
@@ -1079,66 +1031,6 @@ dump_hash_table_seg(unsigned seg, unsigned start, unsigned end)
1079 printf(" ... %x\n", last_va); 1031 printf(" ... %x\n", last_va);
1080} 1032}
1081 1033
1082#else /* CONFIG_PPC64BRIDGE */
1083static void
1084dump_hash_table_seg(unsigned seg, unsigned start, unsigned end)
1085{
1086 extern void *Hash;
1087 extern unsigned long Hash_size;
1088 unsigned *htab = Hash;
1089 unsigned hsize = Hash_size;
1090 unsigned v, hmask, va, last_va;
1091 int found, last_found, i;
1092 unsigned *hg, w1, last_w2, last_va0;
1093
1094 last_found = 0;
1095 hmask = hsize / 128 - 1;
1096 va = start;
1097 start = (start >> 12) & 0xffff;
1098 end = (end >> 12) & 0xffff;
1099 for (v = start; v < end; ++v) {
1100 found = 0;
1101 hg = htab + (((v ^ seg) & hmask) * 32);
1102 w1 = 1 | (seg << 12) | ((v & 0xf800) >> 4);
1103 for (i = 0; i < 8; ++i, hg += 4) {
1104 if (hg[1] == w1) {
1105 found = 1;
1106 break;
1107 }
1108 }
1109 if (!found) {
1110 w1 ^= 2;
1111 hg = htab + ((~(v ^ seg) & hmask) * 32);
1112 for (i = 0; i < 8; ++i, hg += 4) {
1113 if (hg[1] == w1) {
1114 found = 1;
1115 break;
1116 }
1117 }
1118 }
1119 if (!(last_found && found && (hg[3] & ~0x180) == last_w2 + 4096)) {
1120 if (last_found) {
1121 if (last_va != last_va0)
1122 printf(" ... %x", last_va);
1123 printf("\n");
1124 }
1125 if (found) {
1126 printf("%x to %x", va, hg[3]);
1127 last_va0 = va;
1128 }
1129 last_found = found;
1130 }
1131 if (found) {
1132 last_w2 = hg[3] & ~0x180;
1133 last_va = va;
1134 }
1135 va += 4096;
1136 }
1137 if (last_found)
1138 printf(" ... %x\n", last_va);
1139}
1140#endif /* CONFIG_PPC64BRIDGE */
1141
1142static unsigned hash_ctx; 1034static unsigned hash_ctx;
1143static unsigned hash_start; 1035static unsigned hash_start;
1144static unsigned hash_end; 1036static unsigned hash_end;