aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-10-01 12:55:53 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-10-01 12:55:53 -0400
commit8a84fc15ae5cafcc366dd85cf8e1ab2040679abc (patch)
tree5d8dce194c9667fa92e9ec9f545cec867a9a1e0d /arch/ppc
parent28b79ff9661b22e4c41c0d00d4ab8503e810f13d (diff)
parent82965addad66fce61a92c5f03104ea90b0b87124 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Manually resolve conflict in include/mtd/Kbuild Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/Kconfig9
-rw-r--r--arch/ppc/kernel/misc.S88
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c9
-rw-r--r--arch/ppc/kernel/setup.c21
-rw-r--r--arch/ppc/kernel/time.c13
-rw-r--r--arch/ppc/kernel/traps.c2
-rw-r--r--arch/ppc/mm/fault.c4
-rw-r--r--arch/ppc/mm/init.c23
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.h1
-rw-r--r--arch/ppc/platforms/85xx/sbc85xx.h18
-rw-r--r--arch/ppc/syslib/m8260_pci_erratum9.c16
-rw-r--r--arch/ppc/xmon/start.c28
-rw-r--r--arch/ppc/xmon/xmon.c28
13 files changed, 94 insertions, 166 deletions
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index a04cdf0159..fdd9e7b662 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -953,6 +953,9 @@ config NR_CPUS
953config HIGHMEM 953config HIGHMEM
954 bool "High memory support" 954 bool "High memory support"
955 955
956config ARCH_POPULATES_NODE_MAP
957 def_bool y
958
956source kernel/Kconfig.hz 959source kernel/Kconfig.hz
957source kernel/Kconfig.preempt 960source kernel/Kconfig.preempt
958source "mm/Kconfig" 961source "mm/Kconfig"
@@ -1204,7 +1207,7 @@ config PCI_DOMAINS
1204 default PCI 1207 default PCI
1205 1208
1206config MPC83xx_PCI2 1209config MPC83xx_PCI2
1207 bool " Supprt for 2nd PCI host controller" 1210 bool "Support for 2nd PCI host controller"
1208 depends on PCI && MPC834x 1211 depends on PCI && MPC834x
1209 default y if MPC834x_SYS 1212 default y if MPC834x_SYS
1210 1213
@@ -1223,12 +1226,12 @@ config PCI_8260
1223 default y 1226 default y
1224 1227
1225config 8260_PCI9 1228config 8260_PCI9
1226 bool " Enable workaround for MPC826x erratum PCI 9" 1229 bool "Enable workaround for MPC826x erratum PCI 9"
1227 depends on PCI_8260 && !ADS8272 1230 depends on PCI_8260 && !ADS8272
1228 default y 1231 default y
1229 1232
1230choice 1233choice
1231 prompt " IDMA channel for PCI 9 workaround" 1234 prompt "IDMA channel for PCI 9 workaround"
1232 depends on 8260_PCI9 1235 depends on 8260_PCI9
1233 1236
1234config 8260_PCI9_IDMA1 1237config 8260_PCI9_IDMA1
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 2fa0075f2b..50b4bbd068 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -768,91 +768,6 @@ _GLOBAL(_outsb)
768 bdnz 00b 768 bdnz 00b
769 blr 769 blr
770 770
771_GLOBAL(_insw)
772 cmpwi 0,r5,0
773 mtctr r5
774 subi r4,r4,2
775 blelr-
77600: lhbrx r5,0,r3
77701: eieio
77802: sthu r5,2(r4)
779 ISYNC_8xx
780 .section .fixup,"ax"
78103: blr
782 .text
783 .section __ex_table, "a"
784 .align 2
785 .long 00b, 03b
786 .long 01b, 03b
787 .long 02b, 03b
788 .text
789 bdnz 00b
790 blr
791
792_GLOBAL(_outsw)
793 cmpwi 0,r5,0
794 mtctr r5
795 subi r4,r4,2
796 blelr-
79700: lhzu r5,2(r4)
79801: eieio
79902: sthbrx r5,0,r3
800 ISYNC_8xx
801 .section .fixup,"ax"
80203: blr
803 .text
804 .section __ex_table, "a"
805 .align 2
806 .long 00b, 03b
807 .long 01b, 03b
808 .long 02b, 03b
809 .text
810 bdnz 00b
811 blr
812
813_GLOBAL(_insl)
814 cmpwi 0,r5,0
815 mtctr r5
816 subi r4,r4,4
817 blelr-
81800: lwbrx r5,0,r3
81901: eieio
82002: stwu r5,4(r4)
821 ISYNC_8xx
822 .section .fixup,"ax"
82303: blr
824 .text
825 .section __ex_table, "a"
826 .align 2
827 .long 00b, 03b
828 .long 01b, 03b
829 .long 02b, 03b
830 .text
831 bdnz 00b
832 blr
833
834_GLOBAL(_outsl)
835 cmpwi 0,r5,0
836 mtctr r5
837 subi r4,r4,4
838 blelr-
83900: lwzu r5,4(r4)
84001: stwbrx r5,0,r3
84102: eieio
842 ISYNC_8xx
843 .section .fixup,"ax"
84403: blr
845 .text
846 .section __ex_table, "a"
847 .align 2
848 .long 00b, 03b
849 .long 01b, 03b
850 .long 02b, 03b
851 .text
852 bdnz 00b
853 blr
854
855_GLOBAL(__ide_mm_insw)
856_GLOBAL(_insw_ns) 771_GLOBAL(_insw_ns)
857 cmpwi 0,r5,0 772 cmpwi 0,r5,0
858 mtctr r5 773 mtctr r5
@@ -874,7 +789,6 @@ _GLOBAL(_insw_ns)
874 bdnz 00b 789 bdnz 00b
875 blr 790 blr
876 791
877_GLOBAL(__ide_mm_outsw)
878_GLOBAL(_outsw_ns) 792_GLOBAL(_outsw_ns)
879 cmpwi 0,r5,0 793 cmpwi 0,r5,0
880 mtctr r5 794 mtctr r5
@@ -896,7 +810,6 @@ _GLOBAL(_outsw_ns)
896 bdnz 00b 810 bdnz 00b
897 blr 811 blr
898 812
899_GLOBAL(__ide_mm_insl)
900_GLOBAL(_insl_ns) 813_GLOBAL(_insl_ns)
901 cmpwi 0,r5,0 814 cmpwi 0,r5,0
902 mtctr r5 815 mtctr r5
@@ -918,7 +831,6 @@ _GLOBAL(_insl_ns)
918 bdnz 00b 831 bdnz 00b
919 blr 832 blr
920 833
921_GLOBAL(__ide_mm_outsl)
922_GLOBAL(_outsl_ns) 834_GLOBAL(_outsl_ns)
923 cmpwi 0,r5,0 835 cmpwi 0,r5,0
924 mtctr r5 836 mtctr r5
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index d173540138..c8b65ca8a3 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -115,17 +115,8 @@ EXPORT_SYMBOL(outw);
115EXPORT_SYMBOL(outl); 115EXPORT_SYMBOL(outl);
116EXPORT_SYMBOL(outsl);*/ 116EXPORT_SYMBOL(outsl);*/
117 117
118EXPORT_SYMBOL(__ide_mm_insl);
119EXPORT_SYMBOL(__ide_mm_outsw);
120EXPORT_SYMBOL(__ide_mm_insw);
121EXPORT_SYMBOL(__ide_mm_outsl);
122
123EXPORT_SYMBOL(_insb); 118EXPORT_SYMBOL(_insb);
124EXPORT_SYMBOL(_outsb); 119EXPORT_SYMBOL(_outsb);
125EXPORT_SYMBOL(_insw);
126EXPORT_SYMBOL(_outsw);
127EXPORT_SYMBOL(_insl);
128EXPORT_SYMBOL(_outsl);
129EXPORT_SYMBOL(_insw_ns); 120EXPORT_SYMBOL(_insw_ns);
130EXPORT_SYMBOL(_outsw_ns); 121EXPORT_SYMBOL(_outsw_ns);
131EXPORT_SYMBOL(_insl_ns); 122EXPORT_SYMBOL(_insl_ns);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index a74f46d982..75fe13815b 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -86,10 +86,6 @@ int ppc_do_canonicalize_irqs;
86EXPORT_SYMBOL(ppc_do_canonicalize_irqs); 86EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
87#endif 87#endif
88 88
89#ifdef CONFIG_MAGIC_SYSRQ
90unsigned long SYSRQ_KEY = 0x54;
91#endif /* CONFIG_MAGIC_SYSRQ */
92
93#ifdef CONFIG_VGA_CONSOLE 89#ifdef CONFIG_VGA_CONSOLE
94unsigned long vgacon_remap_base; 90unsigned long vgacon_remap_base;
95#endif 91#endif
@@ -127,11 +123,8 @@ void machine_restart(char *cmd)
127 ppc_md.restart(cmd); 123 ppc_md.restart(cmd);
128} 124}
129 125
130void machine_power_off(void) 126static void ppc_generic_power_off(void)
131{ 127{
132#ifdef CONFIG_NVRAM
133 nvram_sync();
134#endif
135 ppc_md.power_off(); 128 ppc_md.power_off();
136} 129}
137 130
@@ -143,7 +136,17 @@ void machine_halt(void)
143 ppc_md.halt(); 136 ppc_md.halt();
144} 137}
145 138
146void (*pm_power_off)(void) = machine_power_off; 139void (*pm_power_off)(void) = ppc_generic_power_off;
140
141void machine_power_off(void)
142{
143#ifdef CONFIG_NVRAM
144 nvram_sync();
145#endif
146 if (pm_power_off)
147 pm_power_off();
148 ppc_generic_power_off();
149}
147 150
148#ifdef CONFIG_TAU 151#ifdef CONFIG_TAU
149extern u32 cpu_temp(unsigned long cpu); 152extern u32 cpu_temp(unsigned long cpu);
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
index 6ab8cc7226..187388625a 100644
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -80,8 +80,6 @@ unsigned tb_to_us;
80unsigned tb_last_stamp; 80unsigned tb_last_stamp;
81unsigned long tb_to_ns_scale; 81unsigned long tb_to_ns_scale;
82 82
83extern unsigned long wall_jiffies;
84
85/* used for timezone offset */ 83/* used for timezone offset */
86static long timezone_offset; 84static long timezone_offset;
87 85
@@ -153,7 +151,7 @@ void timer_interrupt(struct pt_regs * regs)
153 /* We are in an interrupt, no need to save/restore flags */ 151 /* We are in an interrupt, no need to save/restore flags */
154 write_seqlock(&xtime_lock); 152 write_seqlock(&xtime_lock);
155 tb_last_stamp = jiffy_stamp; 153 tb_last_stamp = jiffy_stamp;
156 do_timer(regs); 154 do_timer(1);
157 155
158 /* 156 /*
159 * update the rtc when needed, this should be performed on the 157 * update the rtc when needed, this should be performed on the
@@ -173,8 +171,7 @@ void timer_interrupt(struct pt_regs * regs)
173 */ 171 */
174 if ( ppc_md.set_rtc_time && ntp_synced() && 172 if ( ppc_md.set_rtc_time && ntp_synced() &&
175 xtime.tv_sec - last_rtc_update >= 659 && 173 xtime.tv_sec - last_rtc_update >= 659 &&
176 abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && 174 abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ) {
177 jiffies - wall_jiffies == 1) {
178 if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0) 175 if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
179 last_rtc_update = xtime.tv_sec+1; 176 last_rtc_update = xtime.tv_sec+1;
180 else 177 else
@@ -200,7 +197,7 @@ void do_gettimeofday(struct timeval *tv)
200{ 197{
201 unsigned long flags; 198 unsigned long flags;
202 unsigned long seq; 199 unsigned long seq;
203 unsigned delta, lost_ticks, usec, sec; 200 unsigned delta, usec, sec;
204 201
205 do { 202 do {
206 seq = read_seqbegin_irqsave(&xtime_lock, flags); 203 seq = read_seqbegin_irqsave(&xtime_lock, flags);
@@ -214,10 +211,9 @@ void do_gettimeofday(struct timeval *tv)
214 if (!smp_tb_synchronized) 211 if (!smp_tb_synchronized)
215 delta = 0; 212 delta = 0;
216#endif /* CONFIG_SMP */ 213#endif /* CONFIG_SMP */
217 lost_ticks = jiffies - wall_jiffies;
218 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 214 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
219 215
220 usec += mulhwu(tb_to_us, tb_ticks_per_jiffy * lost_ticks + delta); 216 usec += mulhwu(tb_to_us, delta);
221 while (usec >= 1000000) { 217 while (usec >= 1000000) {
222 sec++; 218 sec++;
223 usec -= 1000000; 219 usec -= 1000000;
@@ -258,7 +254,6 @@ int do_settimeofday(struct timespec *tv)
258 * still reasonable when gettimeofday resolution is 1 jiffy. 254 * still reasonable when gettimeofday resolution is 1 jiffy.
259 */ 255 */
260 tb_delta = tb_ticks_since(last_jiffy_stamp(smp_processor_id())); 256 tb_delta = tb_ticks_since(last_jiffy_stamp(smp_processor_id()));
261 tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy;
262 257
263 new_nsec -= 1000 * mulhwu(tb_to_us, tb_delta); 258 new_nsec -= 1000 * mulhwu(tb_to_us, tb_delta);
264 259
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index d7a433049b..aafc8e8893 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -119,7 +119,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
119 * generate the same exception over and over again and we get 119 * generate the same exception over and over again and we get
120 * nowhere. Better to kill it and let the kernel panic. 120 * nowhere. Better to kill it and let the kernel panic.
121 */ 121 */
122 if (current->pid == 1) { 122 if (is_init(current)) {
123 __sighandler_t handler; 123 __sighandler_t handler;
124 124
125 spin_lock_irq(&current->sighand->siglock); 125 spin_lock_irq(&current->sighand->siglock);
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
index 5cdfb71fcb..465f451f3b 100644
--- a/arch/ppc/mm/fault.c
+++ b/arch/ppc/mm/fault.c
@@ -239,7 +239,7 @@ good_area:
239 /* protection fault */ 239 /* protection fault */
240 if (error_code & 0x08000000) 240 if (error_code & 0x08000000)
241 goto bad_area; 241 goto bad_area;
242 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 242 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
243 goto bad_area; 243 goto bad_area;
244 } 244 }
245 245
@@ -291,7 +291,7 @@ bad_area:
291 */ 291 */
292out_of_memory: 292out_of_memory:
293 up_read(&mm->mmap_sem); 293 up_read(&mm->mmap_sem);
294 if (current->pid == 1) { 294 if (is_init(current)) {
295 yield(); 295 yield();
296 down_read(&mm->mmap_sem); 296 down_read(&mm->mmap_sem);
297 goto survive; 297 goto survive;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 523392d460..410200046a 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -358,8 +358,8 @@ void __init do_init_bootmem(void)
358 */ 358 */
359void __init paging_init(void) 359void __init paging_init(void)
360{ 360{
361 unsigned long zones_size[MAX_NR_ZONES], i; 361 unsigned long start_pfn, end_pfn;
362 362 unsigned long max_zone_pfns[MAX_NR_ZONES];
363#ifdef CONFIG_HIGHMEM 363#ifdef CONFIG_HIGHMEM
364 map_page(PKMAP_BASE, 0, 0); /* XXX gross */ 364 map_page(PKMAP_BASE, 0, 0); /* XXX gross */
365 pkmap_page_table = pte_offset_kernel(pmd_offset(pgd_offset_k 365 pkmap_page_table = pte_offset_kernel(pmd_offset(pgd_offset_k
@@ -369,19 +369,18 @@ void __init paging_init(void)
369 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN); 369 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN);
370 kmap_prot = PAGE_KERNEL; 370 kmap_prot = PAGE_KERNEL;
371#endif /* CONFIG_HIGHMEM */ 371#endif /* CONFIG_HIGHMEM */
372 372 /* All pages are DMA-able so we put them all in the DMA zone. */
373 /* 373 start_pfn = __pa(PAGE_OFFSET) >> PAGE_SHIFT;
374 * All pages are DMA-able so we put them all in the DMA zone. 374 end_pfn = start_pfn + (total_memory >> PAGE_SHIFT);
375 */ 375 add_active_range(0, start_pfn, end_pfn);
376 zones_size[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
377 for (i = 1; i < MAX_NR_ZONES; i++)
378 zones_size[i] = 0;
379 376
380#ifdef CONFIG_HIGHMEM 377#ifdef CONFIG_HIGHMEM
381 zones_size[ZONE_HIGHMEM] = (total_memory - total_lowmem) >> PAGE_SHIFT; 378 max_zone_pfns[0] = total_lowmem >> PAGE_SHIFT;
379 max_zone_pfns[1] = total_memory >> PAGE_SHIFT;
380#else
381 max_zone_pfns[0] = total_memory >> PAGE_SHIFT;
382#endif /* CONFIG_HIGHMEM */ 382#endif /* CONFIG_HIGHMEM */
383 383 free_area_init_nodes(max_zone_pfns);
384 free_area_init(zones_size);
385} 384}
386 385
387void __init mem_init(void) 386void __init mem_init(void)
diff --git a/arch/ppc/platforms/85xx/sbc8560.h b/arch/ppc/platforms/85xx/sbc8560.h
index c7d61cf3a4..e5e156f601 100644
--- a/arch/ppc/platforms/85xx/sbc8560.h
+++ b/arch/ppc/platforms/85xx/sbc8560.h
@@ -14,6 +14,7 @@
14#define __MACH_SBC8560_H__ 14#define __MACH_SBC8560_H__
15 15
16#include <platforms/85xx/sbc85xx.h> 16#include <platforms/85xx/sbc85xx.h>
17#include <asm/irq.h>
17 18
18#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) 19#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
19 20
diff --git a/arch/ppc/platforms/85xx/sbc85xx.h b/arch/ppc/platforms/85xx/sbc85xx.h
index 21ea7a5563..51df4dc04e 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.h
+++ b/arch/ppc/platforms/85xx/sbc85xx.h
@@ -49,4 +49,22 @@ extern void sbc8560_init_IRQ(void) __init;
49 49
50#define MPC85XX_PCI1_IO_SIZE 0x01000000 50#define MPC85XX_PCI1_IO_SIZE 0x01000000
51 51
52/* FCC1 Clock Source Configuration. These can be
53 * redefined in the board specific file.
54 * Can only choose from CLK9-12 */
55#define F1_RXCLK 12
56#define F1_TXCLK 11
57
58/* FCC2 Clock Source Configuration. These can be
59 * redefined in the board specific file.
60 * Can only choose from CLK13-16 */
61#define F2_RXCLK 13
62#define F2_TXCLK 14
63
64/* FCC3 Clock Source Configuration. These can be
65 * redefined in the board specific file.
66 * Can only choose from CLK13-16 */
67#define F3_RXCLK 15
68#define F3_TXCLK 16
69
52#endif /* __PLATFORMS_85XX_SBC85XX_H__ */ 70#endif /* __PLATFORMS_85XX_SBC85XX_H__ */
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 974581ea48..5475709ce0 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -339,20 +339,6 @@ void insl(unsigned port, void *buf, int nl)
339 idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0); 339 idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0);
340} 340}
341 341
342void insw_ns(unsigned port, void *buf, int ns)
343{
344 u8 *addr = (u8 *)(port + _IO_BASE);
345
346 idma_pci9_read((u8 *)buf, (u8 *)addr, ns*sizeof(u16), sizeof(u16), 0);
347}
348
349void insl_ns(unsigned port, void *buf, int nl)
350{
351 u8 *addr = (u8 *)(port + _IO_BASE);
352
353 idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0);
354}
355
356void *memcpy_fromio(void *dest, unsigned long src, size_t count) 342void *memcpy_fromio(void *dest, unsigned long src, size_t count)
357{ 343{
358 unsigned long pa = iopa((unsigned long) src); 344 unsigned long pa = iopa((unsigned long) src);
@@ -373,8 +359,6 @@ EXPORT_SYMBOL(inl);
373EXPORT_SYMBOL(insb); 359EXPORT_SYMBOL(insb);
374EXPORT_SYMBOL(insw); 360EXPORT_SYMBOL(insw);
375EXPORT_SYMBOL(insl); 361EXPORT_SYMBOL(insl);
376EXPORT_SYMBOL(insw_ns);
377EXPORT_SYMBOL(insl_ns);
378EXPORT_SYMBOL(memcpy_fromio); 362EXPORT_SYMBOL(memcpy_fromio);
379 363
380#endif /* ifdef CONFIG_8260_PCI9 */ 364#endif /* ifdef CONFIG_8260_PCI9 */
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index f7e9298695..d74a883e5b 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -15,6 +15,7 @@
15#include <asm/processor.h> 15#include <asm/processor.h>
16#include <asm/delay.h> 16#include <asm/delay.h>
17#include <asm/btext.h> 17#include <asm/btext.h>
18#include <asm/ibm4xx.h>
18 19
19static volatile unsigned char *sccc, *sccd; 20static volatile unsigned char *sccc, *sccd;
20unsigned int TXRDY, RXRDY, DLAB; 21unsigned int TXRDY, RXRDY, DLAB;
@@ -57,23 +58,30 @@ static struct sysrq_key_op sysrq_xmon_op =
57void 58void
58xmon_map_scc(void) 59xmon_map_scc(void)
59{ 60{
60#ifdef CONFIG_PPC_PREP 61#if defined(CONFIG_GEMINI)
61 volatile unsigned char *base;
62
63#elif defined(CONFIG_GEMINI)
64 /* should already be mapped by the kernel boot */ 62 /* should already be mapped by the kernel boot */
65 sccc = (volatile unsigned char *) 0xffeffb0d;
66 sccd = (volatile unsigned char *) 0xffeffb08; 63 sccd = (volatile unsigned char *) 0xffeffb08;
67 TXRDY = 0x20;
68 RXRDY = 1;
69 DLAB = 0x80;
70#elif defined(CONFIG_405GP) 64#elif defined(CONFIG_405GP)
71 sccc = (volatile unsigned char *)0xef600305;
72 sccd = (volatile unsigned char *)0xef600300; 65 sccd = (volatile unsigned char *)0xef600300;
66#elif defined(CONFIG_440EP)
67 sccd = (volatile unsigned char *) ioremap(PPC440EP_UART0_ADDR, 8);
68#elif defined(CONFIG_440SP)
69 sccd = (volatile unsigned char *) ioremap64(PPC440SP_UART0_ADDR, 8);
70#elif defined(CONFIG_440SPE)
71 sccd = (volatile unsigned char *) ioremap64(PPC440SPE_UART0_ADDR, 8);
72#elif defined(CONFIG_44x)
73 /* This is the default for 44x platforms. Any boards that have a
74 different UART address need to be put in cases before this or the
75 port will be mapped incorrectly */
76 sccd = (volatile unsigned char *) ioremap64(PPC440GP_UART0_ADDR, 8);
77#endif /* platform */
78
79#ifndef CONFIG_PPC_PREP
80 sccc = sccd + 5;
73 TXRDY = 0x20; 81 TXRDY = 0x20;
74 RXRDY = 1; 82 RXRDY = 1;
75 DLAB = 0x80; 83 DLAB = 0x80;
76#endif /* platform */ 84#endif
77 85
78 register_sysrq_key('x', &sysrq_xmon_op); 86 register_sysrq_key('x', &sysrq_xmon_op);
79} 87}
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 37d234f933..b1a91744fd 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -153,6 +153,12 @@ static int xmon_trace[NR_CPUS];
153#define SSTEP 1 /* stepping because of 's' command */ 153#define SSTEP 1 /* stepping because of 's' command */
154#define BRSTEP 2 /* stepping over breakpoint */ 154#define BRSTEP 2 /* stepping over breakpoint */
155 155
156#ifdef CONFIG_4xx
157#define MSR_SSTEP_ENABLE 0x200
158#else
159#define MSR_SSTEP_ENABLE 0x400
160#endif
161
156static struct pt_regs *xmon_regs[NR_CPUS]; 162static struct pt_regs *xmon_regs[NR_CPUS];
157 163
158extern inline void sync(void) 164extern inline void sync(void)
@@ -211,6 +217,14 @@ static void get_tb(unsigned *p)
211 p[1] = lo; 217 p[1] = lo;
212} 218}
213 219
220static inline void xmon_enable_sstep(struct pt_regs *regs)
221{
222 regs->msr |= MSR_SSTEP_ENABLE;
223#ifdef CONFIG_4xx
224 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
225#endif
226}
227
214int xmon(struct pt_regs *excp) 228int xmon(struct pt_regs *excp)
215{ 229{
216 struct pt_regs regs; 230 struct pt_regs regs;
@@ -254,10 +268,10 @@ int xmon(struct pt_regs *excp)
254 cmd = cmds(excp); 268 cmd = cmds(excp);
255 if (cmd == 's') { 269 if (cmd == 's') {
256 xmon_trace[smp_processor_id()] = SSTEP; 270 xmon_trace[smp_processor_id()] = SSTEP;
257 excp->msr |= 0x400; 271 xmon_enable_sstep(excp);
258 } else if (at_breakpoint(excp->nip)) { 272 } else if (at_breakpoint(excp->nip)) {
259 xmon_trace[smp_processor_id()] = BRSTEP; 273 xmon_trace[smp_processor_id()] = BRSTEP;
260 excp->msr |= 0x400; 274 xmon_enable_sstep(excp);
261 } else { 275 } else {
262 xmon_trace[smp_processor_id()] = 0; 276 xmon_trace[smp_processor_id()] = 0;
263 insert_bpts(); 277 insert_bpts();
@@ -298,7 +312,7 @@ xmon_bpt(struct pt_regs *regs)
298 remove_bpts(); 312 remove_bpts();
299 excprint(regs); 313 excprint(regs);
300 xmon_trace[smp_processor_id()] = BRSTEP; 314 xmon_trace[smp_processor_id()] = BRSTEP;
301 regs->msr |= 0x400; 315 xmon_enable_sstep(regs);
302 } else { 316 } else {
303 xmon(regs); 317 xmon(regs);
304 } 318 }
@@ -385,7 +399,7 @@ insert_bpts(void)
385 } 399 }
386 store_inst((void *) bp->address); 400 store_inst((void *) bp->address);
387 } 401 }
388#if !defined(CONFIG_8xx) 402#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
389 if (dabr.enabled) 403 if (dabr.enabled)
390 set_dabr(dabr.address); 404 set_dabr(dabr.address);
391 if (iabr.enabled) 405 if (iabr.enabled)
@@ -400,7 +414,7 @@ remove_bpts(void)
400 struct bpt *bp; 414 struct bpt *bp;
401 unsigned instr; 415 unsigned instr;
402 416
403#if !defined(CONFIG_8xx) 417#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
404 set_dabr(0); 418 set_dabr(0);
405 set_iabr(0); 419 set_iabr(0);
406#endif 420#endif
@@ -677,7 +691,7 @@ bpt_cmds(void)
677 691
678 cmd = inchar(); 692 cmd = inchar();
679 switch (cmd) { 693 switch (cmd) {
680#if !defined(CONFIG_8xx) 694#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
681 case 'd': 695 case 'd':
682 mode = 7; 696 mode = 7;
683 cmd = inchar(); 697 cmd = inchar();
@@ -792,7 +806,7 @@ backtrace(struct pt_regs *excp)
792 for (; sp != 0; sp = stack[0]) { 806 for (; sp != 0; sp = stack[0]) {
793 if (mread(sp, stack, sizeof(stack)) != sizeof(stack)) 807 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
794 break; 808 break;
795 printf("[%.8lx] ", stack); 809 printf("[%.8lx] ", stack[0]);
796 xmon_print_symbol(stack[1], " ", "\n"); 810 xmon_print_symbol(stack[1], " ", "\n");
797 if (stack[1] == (unsigned) &ret_from_except 811 if (stack[1] == (unsigned) &ret_from_except
798 || stack[1] == (unsigned) &ret_from_except_full 812 || stack[1] == (unsigned) &ret_from_except_full