aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/kernel/misc.S145
-rw-r--r--arch/ppc/kernel/traps.c12
-rw-r--r--arch/ppc/syslib/m8xx_wdt.c13
-rw-r--r--arch/ppc/syslib/prom.c4
-rw-r--r--arch/ppc/xmon/xmon.c5
5 files changed, 146 insertions, 33 deletions
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 3056ede2424d..ae6af29938a1 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -25,6 +25,11 @@
25#include <asm/thread_info.h> 25#include <asm/thread_info.h>
26#include <asm/asm-offsets.h> 26#include <asm/asm-offsets.h>
27 27
28#ifdef CONFIG_8xx
29#define ISYNC_8xx isync
30#else
31#define ISYNC_8xx
32#endif
28 .text 33 .text
29 34
30 .align 5 35 .align 5
@@ -800,8 +805,18 @@ _GLOBAL(_insb)
800 subi r4,r4,1 805 subi r4,r4,1
801 blelr- 806 blelr-
80200: lbz r5,0(r3) 80700: lbz r5,0(r3)
803 eieio 80801: eieio
804 stbu r5,1(r4) 80902: stbu r5,1(r4)
810 ISYNC_8xx
811 .section .fixup,"ax"
81203: blr
813 .text
814 .section __ex_table, "a"
815 .align 2
816 .long 00b, 03b
817 .long 01b, 03b
818 .long 02b, 03b
819 .text
805 bdnz 00b 820 bdnz 00b
806 blr 821 blr
807 822
@@ -811,8 +826,18 @@ _GLOBAL(_outsb)
811 subi r4,r4,1 826 subi r4,r4,1
812 blelr- 827 blelr-
81300: lbzu r5,1(r4) 82800: lbzu r5,1(r4)
814 stb r5,0(r3) 82901: stb r5,0(r3)
815 eieio 83002: eieio
831 ISYNC_8xx
832 .section .fixup,"ax"
83303: blr
834 .text
835 .section __ex_table, "a"
836 .align 2
837 .long 00b, 03b
838 .long 01b, 03b
839 .long 02b, 03b
840 .text
816 bdnz 00b 841 bdnz 00b
817 blr 842 blr
818 843
@@ -822,8 +847,18 @@ _GLOBAL(_insw)
822 subi r4,r4,2 847 subi r4,r4,2
823 blelr- 848 blelr-
82400: lhbrx r5,0,r3 84900: lhbrx r5,0,r3
825 eieio 85001: eieio
826 sthu r5,2(r4) 85102: sthu r5,2(r4)
852 ISYNC_8xx
853 .section .fixup,"ax"
85403: blr
855 .text
856 .section __ex_table, "a"
857 .align 2
858 .long 00b, 03b
859 .long 01b, 03b
860 .long 02b, 03b
861 .text
827 bdnz 00b 862 bdnz 00b
828 blr 863 blr
829 864
@@ -833,8 +868,18 @@ _GLOBAL(_outsw)
833 subi r4,r4,2 868 subi r4,r4,2
834 blelr- 869 blelr-
83500: lhzu r5,2(r4) 87000: lhzu r5,2(r4)
836 eieio 87101: eieio
837 sthbrx r5,0,r3 87202: sthbrx r5,0,r3
873 ISYNC_8xx
874 .section .fixup,"ax"
87503: blr
876 .text
877 .section __ex_table, "a"
878 .align 2
879 .long 00b, 03b
880 .long 01b, 03b
881 .long 02b, 03b
882 .text
838 bdnz 00b 883 bdnz 00b
839 blr 884 blr
840 885
@@ -844,8 +889,18 @@ _GLOBAL(_insl)
844 subi r4,r4,4 889 subi r4,r4,4
845 blelr- 890 blelr-
84600: lwbrx r5,0,r3 89100: lwbrx r5,0,r3
847 eieio 89201: eieio
848 stwu r5,4(r4) 89302: stwu r5,4(r4)
894 ISYNC_8xx
895 .section .fixup,"ax"
89603: blr
897 .text
898 .section __ex_table, "a"
899 .align 2
900 .long 00b, 03b
901 .long 01b, 03b
902 .long 02b, 03b
903 .text
849 bdnz 00b 904 bdnz 00b
850 blr 905 blr
851 906
@@ -855,8 +910,18 @@ _GLOBAL(_outsl)
855 subi r4,r4,4 910 subi r4,r4,4
856 blelr- 911 blelr-
85700: lwzu r5,4(r4) 91200: lwzu r5,4(r4)
858 stwbrx r5,0,r3 91301: stwbrx r5,0,r3
859 eieio 91402: eieio
915 ISYNC_8xx
916 .section .fixup,"ax"
91703: blr
918 .text
919 .section __ex_table, "a"
920 .align 2
921 .long 00b, 03b
922 .long 01b, 03b
923 .long 02b, 03b
924 .text
860 bdnz 00b 925 bdnz 00b
861 blr 926 blr
862 927
@@ -867,8 +932,18 @@ _GLOBAL(_insw_ns)
867 subi r4,r4,2 932 subi r4,r4,2
868 blelr- 933 blelr-
86900: lhz r5,0(r3) 93400: lhz r5,0(r3)
870 eieio 93501: eieio
871 sthu r5,2(r4) 93602: sthu r5,2(r4)
937 ISYNC_8xx
938 .section .fixup,"ax"
93903: blr
940 .text
941 .section __ex_table, "a"
942 .align 2
943 .long 00b, 03b
944 .long 01b, 03b
945 .long 02b, 03b
946 .text
872 bdnz 00b 947 bdnz 00b
873 blr 948 blr
874 949
@@ -879,8 +954,18 @@ _GLOBAL(_outsw_ns)
879 subi r4,r4,2 954 subi r4,r4,2
880 blelr- 955 blelr-
88100: lhzu r5,2(r4) 95600: lhzu r5,2(r4)
882 sth r5,0(r3) 95701: sth r5,0(r3)
883 eieio 95802: eieio
959 ISYNC_8xx
960 .section .fixup,"ax"
96103: blr
962 .text
963 .section __ex_table, "a"
964 .align 2
965 .long 00b, 03b
966 .long 01b, 03b
967 .long 02b, 03b
968 .text
884 bdnz 00b 969 bdnz 00b
885 blr 970 blr
886 971
@@ -891,8 +976,18 @@ _GLOBAL(_insl_ns)
891 subi r4,r4,4 976 subi r4,r4,4
892 blelr- 977 blelr-
89300: lwz r5,0(r3) 97800: lwz r5,0(r3)
894 eieio 97901: eieio
895 stwu r5,4(r4) 98002: stwu r5,4(r4)
981 ISYNC_8xx
982 .section .fixup,"ax"
98303: blr
984 .text
985 .section __ex_table, "a"
986 .align 2
987 .long 00b, 03b
988 .long 01b, 03b
989 .long 02b, 03b
990 .text
896 bdnz 00b 991 bdnz 00b
897 blr 992 blr
898 993
@@ -903,8 +998,18 @@ _GLOBAL(_outsl_ns)
903 subi r4,r4,4 998 subi r4,r4,4
904 blelr- 999 blelr-
90500: lwzu r5,4(r4) 100000: lwzu r5,4(r4)
906 stw r5,0(r3) 100101: stw r5,0(r3)
907 eieio 100202: eieio
1003 ISYNC_8xx
1004 .section .fixup,"ax"
100503: blr
1006 .text
1007 .section __ex_table, "a"
1008 .align 2
1009 .long 00b, 03b
1010 .long 01b, 03b
1011 .long 02b, 03b
1012 .text
908 bdnz 00b 1013 bdnz 00b
909 blr 1014 blr
910 1015
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 16adde6b429d..9dbc4d28fa28 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -49,7 +49,7 @@ extern int xmon_sstep(struct pt_regs *regs);
49extern int xmon_iabr_match(struct pt_regs *regs); 49extern int xmon_iabr_match(struct pt_regs *regs);
50extern int xmon_dabr_match(struct pt_regs *regs); 50extern int xmon_dabr_match(struct pt_regs *regs);
51 51
52void (*debugger)(struct pt_regs *regs) = xmon; 52int (*debugger)(struct pt_regs *regs) = xmon;
53int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt; 53int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
54int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep; 54int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
55int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match; 55int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
@@ -57,7 +57,7 @@ int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
57void (*debugger_fault_handler)(struct pt_regs *regs); 57void (*debugger_fault_handler)(struct pt_regs *regs);
58#else 58#else
59#ifdef CONFIG_KGDB 59#ifdef CONFIG_KGDB
60void (*debugger)(struct pt_regs *regs); 60int (*debugger)(struct pt_regs *regs);
61int (*debugger_bpt)(struct pt_regs *regs); 61int (*debugger_bpt)(struct pt_regs *regs);
62int (*debugger_sstep)(struct pt_regs *regs); 62int (*debugger_sstep)(struct pt_regs *regs);
63int (*debugger_iabr_match)(struct pt_regs *regs); 63int (*debugger_iabr_match)(struct pt_regs *regs);
@@ -159,7 +159,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
159 */ 159 */
160static inline int check_io_access(struct pt_regs *regs) 160static inline int check_io_access(struct pt_regs *regs)
161{ 161{
162#ifdef CONFIG_PPC_PMAC 162#if defined CONFIG_PPC_PMAC || defined CONFIG_8xx
163 unsigned long msr = regs->msr; 163 unsigned long msr = regs->msr;
164 const struct exception_table_entry *entry; 164 const struct exception_table_entry *entry;
165 unsigned int *nip = (unsigned int *)regs->nip; 165 unsigned int *nip = (unsigned int *)regs->nip;
@@ -178,7 +178,11 @@ static inline int check_io_access(struct pt_regs *regs)
178 nip -= 2; 178 nip -= 2;
179 else if (*nip == 0x4c00012c) /* isync */ 179 else if (*nip == 0x4c00012c) /* isync */
180 --nip; 180 --nip;
181 if (*nip == 0x7c0004ac || (*nip >> 26) == 3) { 181 /* eieio from I/O string functions */
182 else if ((*nip) == 0x7c0006ac || *(nip+1) == 0x7c0006ac)
183 nip += 2;
184 if (*nip == 0x7c0004ac || (*nip >> 26) == 3 ||
185 (*(nip+1) >> 26) == 3) {
182 /* sync or twi */ 186 /* sync or twi */
183 unsigned int rb; 187 unsigned int rb;
184 188
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
index c5ac5ce5d7d2..a21632d37e5a 100644
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ b/arch/ppc/syslib/m8xx_wdt.c
@@ -14,6 +14,7 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <asm/io.h>
17#include <asm/8xx_immap.h> 18#include <asm/8xx_immap.h>
18#include <syslib/m8xx_wdt.h> 19#include <syslib/m8xx_wdt.h>
19 20
@@ -29,8 +30,8 @@ void m8xx_wdt_reset(void)
29{ 30{
30 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 31 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
31 32
32 out_be16(imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */ 33 out_be16(&imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
33 out_be16(imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */ 34 out_be16(&imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
34} 35}
35 36
36static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) 37static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
@@ -39,7 +40,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
39 40
40 m8xx_wdt_reset(); 41 m8xx_wdt_reset();
41 42
42 out_be16(imap->im_sit.sit_piscr, in_be16(imap->im_sit.sit_piscr | PISCR_PS)); /* clear irq */ 43 out_be16(&imap->im_sit.sit_piscr, in_be16(&imap->im_sit.sit_piscr) | PISCR_PS); /* clear irq */
43 44
44 return IRQ_HANDLED; 45 return IRQ_HANDLED;
45} 46}
@@ -51,7 +52,7 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
51 u32 sypcr; 52 u32 sypcr;
52 u32 pitrtclk; 53 u32 pitrtclk;
53 54
54 sypcr = in_be32(imap->im_siu_conf.sc_sypcr); 55 sypcr = in_be32(&imap->im_siu_conf.sc_sypcr);
55 56
56 if (!(sypcr & 0x04)) { 57 if (!(sypcr & 0x04)) {
57 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n", 58 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
@@ -87,9 +88,9 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
87 else 88 else
88 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2; 89 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;
89 90
90 out_be32(imap->im_sit.sit_pitc, pitc << 16); 91 out_be32(&imap->im_sit.sit_pitc, pitc << 16);
91 92
92 out_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE); 93 out_be16(&imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
93 94
94 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction)) 95 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
95 panic("m8xx_wdt: error setting up the watchdog irq!"); 96 panic("m8xx_wdt: error setting up the watchdog irq!");
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
index 1b9aa0d6a924..03b1fc9b9501 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -1165,7 +1165,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
1165/* 1165/*
1166 * Add a property to a node 1166 * Add a property to a node
1167 */ 1167 */
1168void 1168int
1169prom_add_property(struct device_node* np, struct property* prop) 1169prom_add_property(struct device_node* np, struct property* prop)
1170{ 1170{
1171 struct property **next = &np->properties; 1171 struct property **next = &np->properties;
@@ -1174,6 +1174,8 @@ prom_add_property(struct device_node* np, struct property* prop)
1174 while (*next) 1174 while (*next)
1175 next = &(*next)->next; 1175 next = &(*next)->next;
1176 *next = prop; 1176 *next = prop;
1177
1178 return 0;
1177} 1179}
1178 1180
1179/* I quickly hacked that one, check against spec ! */ 1181/* I quickly hacked that one, check against spec ! */
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 66bfaa3211a2..2b483b4f1602 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -220,8 +220,7 @@ static void get_tb(unsigned *p)
220 p[1] = lo; 220 p[1] = lo;
221} 221}
222 222
223void 223int xmon(struct pt_regs *excp)
224xmon(struct pt_regs *excp)
225{ 224{
226 struct pt_regs regs; 225 struct pt_regs regs;
227 int msr, cmd; 226 int msr, cmd;
@@ -290,6 +289,8 @@ xmon(struct pt_regs *excp)
290#endif /* CONFIG_SMP */ 289#endif /* CONFIG_SMP */
291 set_msr(msr); /* restore interrupt enable */ 290 set_msr(msr); /* restore interrupt enable */
292 get_tb(start_tb[smp_processor_id()]); 291 get_tb(start_tb[smp_processor_id()]);
292
293 return cmd != 'X';
293} 294}
294 295
295irqreturn_t 296irqreturn_t