diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/Makefile | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 14 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_32.S | 127 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 65 | ||||
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 154 | ||||
-rw-r--r-- | arch/powerpc/kernel/io.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_platform.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_32.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/stacktrace.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/52xx/lite5200_pm.c | 14 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/Makefile | 5 |
16 files changed, 408 insertions, 14 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 3934e2659407..a5e9912e2d37 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -105,11 +105,13 @@ config ARCH_NO_VIRT_TO_BUS | |||
105 | config PPC | 105 | config PPC |
106 | bool | 106 | bool |
107 | default y | 107 | default y |
108 | select HAVE_DYNAMIC_FTRACE | ||
109 | select HAVE_FTRACE | ||
108 | select HAVE_IDE | 110 | select HAVE_IDE |
109 | select HAVE_OPROFILE | ||
110 | select HAVE_KPROBES | 111 | select HAVE_KPROBES |
111 | select HAVE_KRETPROBES | 112 | select HAVE_KRETPROBES |
112 | select HAVE_LMB | 113 | select HAVE_LMB |
114 | select HAVE_OPROFILE | ||
113 | 115 | ||
114 | config EARLY_PRINTK | 116 | config EARLY_PRINTK |
115 | bool | 117 | bool |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 1cee2f9fdf06..095e04db1c0e 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -273,7 +273,8 @@ endif | |||
273 | initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-)) | 273 | initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-)) |
274 | initrd-y := $(patsubst zImage%, zImage.initrd%, \ | 274 | initrd-y := $(patsubst zImage%, zImage.initrd%, \ |
275 | $(patsubst dtbImage%, dtbImage.initrd%, \ | 275 | $(patsubst dtbImage%, dtbImage.initrd%, \ |
276 | $(patsubst treeImage%, treeImage.initrd%, $(image-y)))) | 276 | $(patsubst simpleImage%, simpleImage.initrd%, \ |
277 | $(patsubst treeImage%, treeImage.initrd%, $(image-y))))) | ||
277 | initrd-y := $(filter-out $(image-y), $(initrd-y)) | 278 | initrd-y := $(filter-out $(image-y), $(initrd-y)) |
278 | targets += $(image-y) $(initrd-y) | 279 | targets += $(image-y) $(initrd-y) |
279 | 280 | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 2346d271fbfd..f3f5e2641432 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -12,6 +12,18 @@ CFLAGS_prom_init.o += -fPIC | |||
12 | CFLAGS_btext.o += -fPIC | 12 | CFLAGS_btext.o += -fPIC |
13 | endif | 13 | endif |
14 | 14 | ||
15 | ifdef CONFIG_FTRACE | ||
16 | # Do not trace early boot code | ||
17 | CFLAGS_REMOVE_cputable.o = -pg | ||
18 | CFLAGS_REMOVE_prom_init.o = -pg | ||
19 | |||
20 | ifdef CONFIG_DYNAMIC_FTRACE | ||
21 | # dynamic ftrace setup. | ||
22 | CFLAGS_REMOVE_ftrace.o = -pg | ||
23 | endif | ||
24 | |||
25 | endif | ||
26 | |||
15 | obj-y := cputable.o ptrace.o syscalls.o \ | 27 | obj-y := cputable.o ptrace.o syscalls.o \ |
16 | irq.o align.o signal_32.o pmc.o vdso.o \ | 28 | irq.o align.o signal_32.o pmc.o vdso.o \ |
17 | init_task.o process.o systbl.o idle.o \ | 29 | init_task.o process.o systbl.o idle.o \ |
@@ -78,6 +90,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \ | |||
78 | obj-$(CONFIG_AUDIT) += audit.o | 90 | obj-$(CONFIG_AUDIT) += audit.o |
79 | obj64-$(CONFIG_AUDIT) += compat_audit.o | 91 | obj64-$(CONFIG_AUDIT) += compat_audit.o |
80 | 92 | ||
93 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | ||
94 | |||
81 | obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o | 95 | obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o |
82 | 96 | ||
83 | ifneq ($(CONFIG_PPC_INDIRECT_IO),y) | 97 | ifneq ($(CONFIG_PPC_INDIRECT_IO),y) |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 0c8614d9875c..7231a708af0d 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/ppc_asm.h> | 30 | #include <asm/ppc_asm.h> |
31 | #include <asm/asm-offsets.h> | 31 | #include <asm/asm-offsets.h> |
32 | #include <asm/unistd.h> | 32 | #include <asm/unistd.h> |
33 | #include <asm/ftrace.h> | ||
33 | 34 | ||
34 | #undef SHOW_SYSCALLS | 35 | #undef SHOW_SYSCALLS |
35 | #undef SHOW_SYSCALLS_TASK | 36 | #undef SHOW_SYSCALLS_TASK |
@@ -1035,3 +1036,129 @@ machine_check_in_rtas: | |||
1035 | /* XXX load up BATs and panic */ | 1036 | /* XXX load up BATs and panic */ |
1036 | 1037 | ||
1037 | #endif /* CONFIG_PPC_RTAS */ | 1038 | #endif /* CONFIG_PPC_RTAS */ |
1039 | |||
1040 | #ifdef CONFIG_FTRACE | ||
1041 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
1042 | _GLOBAL(mcount) | ||
1043 | _GLOBAL(_mcount) | ||
1044 | stwu r1,-48(r1) | ||
1045 | stw r3, 12(r1) | ||
1046 | stw r4, 16(r1) | ||
1047 | stw r5, 20(r1) | ||
1048 | stw r6, 24(r1) | ||
1049 | mflr r3 | ||
1050 | stw r7, 28(r1) | ||
1051 | mfcr r5 | ||
1052 | stw r8, 32(r1) | ||
1053 | stw r9, 36(r1) | ||
1054 | stw r10,40(r1) | ||
1055 | stw r3, 44(r1) | ||
1056 | stw r5, 8(r1) | ||
1057 | subi r3, r3, MCOUNT_INSN_SIZE | ||
1058 | .globl mcount_call | ||
1059 | mcount_call: | ||
1060 | bl ftrace_stub | ||
1061 | nop | ||
1062 | lwz r6, 8(r1) | ||
1063 | lwz r0, 44(r1) | ||
1064 | lwz r3, 12(r1) | ||
1065 | mtctr r0 | ||
1066 | lwz r4, 16(r1) | ||
1067 | mtcr r6 | ||
1068 | lwz r5, 20(r1) | ||
1069 | lwz r6, 24(r1) | ||
1070 | lwz r0, 52(r1) | ||
1071 | lwz r7, 28(r1) | ||
1072 | lwz r8, 32(r1) | ||
1073 | mtlr r0 | ||
1074 | lwz r9, 36(r1) | ||
1075 | lwz r10,40(r1) | ||
1076 | addi r1, r1, 48 | ||
1077 | bctr | ||
1078 | |||
1079 | _GLOBAL(ftrace_caller) | ||
1080 | /* Based off of objdump optput from glibc */ | ||
1081 | stwu r1,-48(r1) | ||
1082 | stw r3, 12(r1) | ||
1083 | stw r4, 16(r1) | ||
1084 | stw r5, 20(r1) | ||
1085 | stw r6, 24(r1) | ||
1086 | mflr r3 | ||
1087 | lwz r4, 52(r1) | ||
1088 | mfcr r5 | ||
1089 | stw r7, 28(r1) | ||
1090 | stw r8, 32(r1) | ||
1091 | stw r9, 36(r1) | ||
1092 | stw r10,40(r1) | ||
1093 | stw r3, 44(r1) | ||
1094 | stw r5, 8(r1) | ||
1095 | subi r3, r3, MCOUNT_INSN_SIZE | ||
1096 | .globl ftrace_call | ||
1097 | ftrace_call: | ||
1098 | bl ftrace_stub | ||
1099 | nop | ||
1100 | lwz r6, 8(r1) | ||
1101 | lwz r0, 44(r1) | ||
1102 | lwz r3, 12(r1) | ||
1103 | mtctr r0 | ||
1104 | lwz r4, 16(r1) | ||
1105 | mtcr r6 | ||
1106 | lwz r5, 20(r1) | ||
1107 | lwz r6, 24(r1) | ||
1108 | lwz r0, 52(r1) | ||
1109 | lwz r7, 28(r1) | ||
1110 | lwz r8, 32(r1) | ||
1111 | mtlr r0 | ||
1112 | lwz r9, 36(r1) | ||
1113 | lwz r10,40(r1) | ||
1114 | addi r1, r1, 48 | ||
1115 | bctr | ||
1116 | #else | ||
1117 | _GLOBAL(mcount) | ||
1118 | _GLOBAL(_mcount) | ||
1119 | stwu r1,-48(r1) | ||
1120 | stw r3, 12(r1) | ||
1121 | stw r4, 16(r1) | ||
1122 | stw r5, 20(r1) | ||
1123 | stw r6, 24(r1) | ||
1124 | mflr r3 | ||
1125 | lwz r4, 52(r1) | ||
1126 | mfcr r5 | ||
1127 | stw r7, 28(r1) | ||
1128 | stw r8, 32(r1) | ||
1129 | stw r9, 36(r1) | ||
1130 | stw r10,40(r1) | ||
1131 | stw r3, 44(r1) | ||
1132 | stw r5, 8(r1) | ||
1133 | |||
1134 | subi r3, r3, MCOUNT_INSN_SIZE | ||
1135 | LOAD_REG_ADDR(r5, ftrace_trace_function) | ||
1136 | lwz r5,0(r5) | ||
1137 | |||
1138 | mtctr r5 | ||
1139 | bctrl | ||
1140 | |||
1141 | nop | ||
1142 | |||
1143 | lwz r6, 8(r1) | ||
1144 | lwz r0, 44(r1) | ||
1145 | lwz r3, 12(r1) | ||
1146 | mtctr r0 | ||
1147 | lwz r4, 16(r1) | ||
1148 | mtcr r6 | ||
1149 | lwz r5, 20(r1) | ||
1150 | lwz r6, 24(r1) | ||
1151 | lwz r0, 52(r1) | ||
1152 | lwz r7, 28(r1) | ||
1153 | lwz r8, 32(r1) | ||
1154 | mtlr r0 | ||
1155 | lwz r9, 36(r1) | ||
1156 | lwz r10,40(r1) | ||
1157 | addi r1, r1, 48 | ||
1158 | bctr | ||
1159 | #endif | ||
1160 | |||
1161 | _GLOBAL(ftrace_stub) | ||
1162 | blr | ||
1163 | |||
1164 | #endif /* CONFIG_MCOUNT */ | ||
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index c0db5b769e55..2f511a969d2c 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <asm/bug.h> | 31 | #include <asm/bug.h> |
32 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
33 | #include <asm/irqflags.h> | 33 | #include <asm/irqflags.h> |
34 | #include <asm/ftrace.h> | ||
34 | 35 | ||
35 | /* | 36 | /* |
36 | * System calls. | 37 | * System calls. |
@@ -870,3 +871,67 @@ _GLOBAL(enter_prom) | |||
870 | ld r0,16(r1) | 871 | ld r0,16(r1) |
871 | mtlr r0 | 872 | mtlr r0 |
872 | blr | 873 | blr |
874 | |||
875 | #ifdef CONFIG_FTRACE | ||
876 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
877 | _GLOBAL(mcount) | ||
878 | _GLOBAL(_mcount) | ||
879 | /* Taken from output of objdump from lib64/glibc */ | ||
880 | mflr r3 | ||
881 | stdu r1, -112(r1) | ||
882 | std r3, 128(r1) | ||
883 | subi r3, r3, MCOUNT_INSN_SIZE | ||
884 | .globl mcount_call | ||
885 | mcount_call: | ||
886 | bl ftrace_stub | ||
887 | nop | ||
888 | ld r0, 128(r1) | ||
889 | mtlr r0 | ||
890 | addi r1, r1, 112 | ||
891 | blr | ||
892 | |||
893 | _GLOBAL(ftrace_caller) | ||
894 | /* Taken from output of objdump from lib64/glibc */ | ||
895 | mflr r3 | ||
896 | ld r11, 0(r1) | ||
897 | stdu r1, -112(r1) | ||
898 | std r3, 128(r1) | ||
899 | ld r4, 16(r11) | ||
900 | subi r3, r3, MCOUNT_INSN_SIZE | ||
901 | .globl ftrace_call | ||
902 | ftrace_call: | ||
903 | bl ftrace_stub | ||
904 | nop | ||
905 | ld r0, 128(r1) | ||
906 | mtlr r0 | ||
907 | addi r1, r1, 112 | ||
908 | _GLOBAL(ftrace_stub) | ||
909 | blr | ||
910 | #else | ||
911 | _GLOBAL(mcount) | ||
912 | blr | ||
913 | |||
914 | _GLOBAL(_mcount) | ||
915 | /* Taken from output of objdump from lib64/glibc */ | ||
916 | mflr r3 | ||
917 | ld r11, 0(r1) | ||
918 | stdu r1, -112(r1) | ||
919 | std r3, 128(r1) | ||
920 | ld r4, 16(r11) | ||
921 | |||
922 | subi r3, r3, MCOUNT_INSN_SIZE | ||
923 | LOAD_REG_ADDR(r5,ftrace_trace_function) | ||
924 | ld r5,0(r5) | ||
925 | ld r5,0(r5) | ||
926 | mtctr r5 | ||
927 | bctrl | ||
928 | |||
929 | nop | ||
930 | ld r0, 128(r1) | ||
931 | mtlr r0 | ||
932 | addi r1, r1, 112 | ||
933 | _GLOBAL(ftrace_stub) | ||
934 | blr | ||
935 | |||
936 | #endif | ||
937 | #endif | ||
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c new file mode 100644 index 000000000000..3855ceb937b0 --- /dev/null +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * Code for replacing ftrace calls with jumps. | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> | ||
5 | * | ||
6 | * Thanks goes out to P.A. Semi, Inc for supplying me with a PPC64 box. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #include <linux/spinlock.h> | ||
11 | #include <linux/hardirq.h> | ||
12 | #include <linux/ftrace.h> | ||
13 | #include <linux/percpu.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/list.h> | ||
16 | |||
17 | #include <asm/cacheflush.h> | ||
18 | #include <asm/ftrace.h> | ||
19 | |||
20 | |||
21 | static unsigned int ftrace_nop = 0x60000000; | ||
22 | |||
23 | #ifdef CONFIG_PPC32 | ||
24 | # define GET_ADDR(addr) addr | ||
25 | #else | ||
26 | /* PowerPC64's functions are data that points to the functions */ | ||
27 | # define GET_ADDR(addr) *(unsigned long *)addr | ||
28 | #endif | ||
29 | |||
30 | |||
31 | static unsigned int notrace ftrace_calc_offset(long ip, long addr) | ||
32 | { | ||
33 | return (int)(addr - ip); | ||
34 | } | ||
35 | |||
36 | notrace unsigned char *ftrace_nop_replace(void) | ||
37 | { | ||
38 | return (char *)&ftrace_nop; | ||
39 | } | ||
40 | |||
41 | notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | ||
42 | { | ||
43 | static unsigned int op; | ||
44 | |||
45 | /* | ||
46 | * It would be nice to just use create_function_call, but that will | ||
47 | * update the code itself. Here we need to just return the | ||
48 | * instruction that is going to be modified, without modifying the | ||
49 | * code. | ||
50 | */ | ||
51 | addr = GET_ADDR(addr); | ||
52 | |||
53 | /* Set to "bl addr" */ | ||
54 | op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc); | ||
55 | |||
56 | /* | ||
57 | * No locking needed, this must be called via kstop_machine | ||
58 | * which in essence is like running on a uniprocessor machine. | ||
59 | */ | ||
60 | return (unsigned char *)&op; | ||
61 | } | ||
62 | |||
63 | #ifdef CONFIG_PPC64 | ||
64 | # define _ASM_ALIGN " .align 3 " | ||
65 | # define _ASM_PTR " .llong " | ||
66 | #else | ||
67 | # define _ASM_ALIGN " .align 2 " | ||
68 | # define _ASM_PTR " .long " | ||
69 | #endif | ||
70 | |||
71 | notrace int | ||
72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
73 | unsigned char *new_code) | ||
74 | { | ||
75 | unsigned replaced; | ||
76 | unsigned old = *(unsigned *)old_code; | ||
77 | unsigned new = *(unsigned *)new_code; | ||
78 | int faulted = 0; | ||
79 | |||
80 | /* | ||
81 | * Note: Due to modules and __init, code can | ||
82 | * disappear and change, we need to protect against faulting | ||
83 | * as well as code changing. | ||
84 | * | ||
85 | * No real locking needed, this code is run through | ||
86 | * kstop_machine. | ||
87 | */ | ||
88 | asm volatile ( | ||
89 | "1: lwz %1, 0(%2)\n" | ||
90 | " cmpw %1, %5\n" | ||
91 | " bne 2f\n" | ||
92 | " stwu %3, 0(%2)\n" | ||
93 | "2:\n" | ||
94 | ".section .fixup, \"ax\"\n" | ||
95 | "3: li %0, 1\n" | ||
96 | " b 2b\n" | ||
97 | ".previous\n" | ||
98 | ".section __ex_table,\"a\"\n" | ||
99 | _ASM_ALIGN "\n" | ||
100 | _ASM_PTR "1b, 3b\n" | ||
101 | ".previous" | ||
102 | : "=r"(faulted), "=r"(replaced) | ||
103 | : "r"(ip), "r"(new), | ||
104 | "0"(faulted), "r"(old) | ||
105 | : "memory"); | ||
106 | |||
107 | if (replaced != old && replaced != new) | ||
108 | faulted = 2; | ||
109 | |||
110 | if (!faulted) | ||
111 | flush_icache_range(ip, ip + 8); | ||
112 | |||
113 | return faulted; | ||
114 | } | ||
115 | |||
116 | notrace int ftrace_update_ftrace_func(ftrace_func_t func) | ||
117 | { | ||
118 | unsigned long ip = (unsigned long)(&ftrace_call); | ||
119 | unsigned char old[MCOUNT_INSN_SIZE], *new; | ||
120 | int ret; | ||
121 | |||
122 | memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); | ||
123 | new = ftrace_call_replace(ip, (unsigned long)func); | ||
124 | ret = ftrace_modify_code(ip, old, new); | ||
125 | |||
126 | return ret; | ||
127 | } | ||
128 | |||
129 | notrace int ftrace_mcount_set(unsigned long *data) | ||
130 | { | ||
131 | unsigned long ip = (long)(&mcount_call); | ||
132 | unsigned long *addr = data; | ||
133 | unsigned char old[MCOUNT_INSN_SIZE], *new; | ||
134 | |||
135 | /* | ||
136 | * Replace the mcount stub with a pointer to the | ||
137 | * ip recorder function. | ||
138 | */ | ||
139 | memcpy(old, &mcount_call, MCOUNT_INSN_SIZE); | ||
140 | new = ftrace_call_replace(ip, *addr); | ||
141 | *addr = ftrace_modify_code(ip, old, new); | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | int __init ftrace_dyn_arch_init(void *data) | ||
147 | { | ||
148 | /* This is running in kstop_machine */ | ||
149 | |||
150 | ftrace_mcount_set(data); | ||
151 | |||
152 | return 0; | ||
153 | } | ||
154 | |||
diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c index e31aca9208eb..1882bf419fa6 100644 --- a/arch/powerpc/kernel/io.c +++ b/arch/powerpc/kernel/io.c | |||
@@ -120,7 +120,8 @@ EXPORT_SYMBOL(_outsl_ns); | |||
120 | 120 | ||
121 | #define IO_CHECK_ALIGN(v,a) ((((unsigned long)(v)) & ((a) - 1)) == 0) | 121 | #define IO_CHECK_ALIGN(v,a) ((((unsigned long)(v)) & ((a) - 1)) == 0) |
122 | 122 | ||
123 | void _memset_io(volatile void __iomem *addr, int c, unsigned long n) | 123 | notrace void |
124 | _memset_io(volatile void __iomem *addr, int c, unsigned long n) | ||
124 | { | 125 | { |
125 | void *p = (void __force *)addr; | 126 | void *p = (void __force *)addr; |
126 | u32 lc = c; | 127 | u32 lc = c; |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index bcc249d90c4d..dcc946e67099 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(irq_desc); | |||
98 | 98 | ||
99 | int distribute_irqs = 1; | 99 | int distribute_irqs = 1; |
100 | 100 | ||
101 | static inline unsigned long get_hard_enabled(void) | 101 | static inline notrace unsigned long get_hard_enabled(void) |
102 | { | 102 | { |
103 | unsigned long enabled; | 103 | unsigned long enabled; |
104 | 104 | ||
@@ -108,13 +108,13 @@ static inline unsigned long get_hard_enabled(void) | |||
108 | return enabled; | 108 | return enabled; |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void set_soft_enabled(unsigned long enable) | 111 | static inline notrace void set_soft_enabled(unsigned long enable) |
112 | { | 112 | { |
113 | __asm__ __volatile__("stb %0,%1(13)" | 113 | __asm__ __volatile__("stb %0,%1(13)" |
114 | : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled))); | 114 | : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled))); |
115 | } | 115 | } |
116 | 116 | ||
117 | void raw_local_irq_restore(unsigned long en) | 117 | notrace void raw_local_irq_restore(unsigned long en) |
118 | { | 118 | { |
119 | /* | 119 | /* |
120 | * get_paca()->soft_enabled = en; | 120 | * get_paca()->soft_enabled = en; |
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 61dd17449ddc..4d96e1db55ee 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -33,13 +33,14 @@ static struct legacy_serial_info { | |||
33 | phys_addr_t taddr; | 33 | phys_addr_t taddr; |
34 | } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; | 34 | } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; |
35 | 35 | ||
36 | static struct __initdata of_device_id parents[] = { | 36 | static struct __initdata of_device_id legacy_serial_parents[] = { |
37 | {.type = "soc",}, | 37 | {.type = "soc",}, |
38 | {.type = "tsi-bridge",}, | 38 | {.type = "tsi-bridge",}, |
39 | {.type = "opb", }, | 39 | {.type = "opb", }, |
40 | {.compatible = "ibm,opb",}, | 40 | {.compatible = "ibm,opb",}, |
41 | {.compatible = "simple-bus",}, | 41 | {.compatible = "simple-bus",}, |
42 | {.compatible = "wrs,epld-localbus",}, | 42 | {.compatible = "wrs,epld-localbus",}, |
43 | {}, | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | static unsigned int legacy_serial_count; | 46 | static unsigned int legacy_serial_count; |
@@ -136,6 +137,11 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
136 | if (of_get_property(np, "clock-frequency", NULL) == NULL) | 137 | if (of_get_property(np, "clock-frequency", NULL) == NULL) |
137 | return -1; | 138 | return -1; |
138 | 139 | ||
140 | /* if reg-shift or offset, don't try to use it */ | ||
141 | if ((of_get_property(np, "reg-shift", NULL) != NULL) || | ||
142 | (of_get_property(np, "reg-offset", NULL) != NULL)) | ||
143 | return -1; | ||
144 | |||
139 | /* if rtas uses this device, don't try to use it as well */ | 145 | /* if rtas uses this device, don't try to use it as well */ |
140 | if (of_get_property(np, "used-by-rtas", NULL) != NULL) | 146 | if (of_get_property(np, "used-by-rtas", NULL) != NULL) |
141 | return -1; | 147 | return -1; |
@@ -322,7 +328,7 @@ void __init find_legacy_serial_ports(void) | |||
322 | struct device_node *parent = of_get_parent(np); | 328 | struct device_node *parent = of_get_parent(np); |
323 | if (!parent) | 329 | if (!parent) |
324 | continue; | 330 | continue; |
325 | if (of_match_node(parents, parent) != NULL) { | 331 | if (of_match_node(legacy_serial_parents, parent) != NULL) { |
326 | index = add_legacy_soc_port(np, np); | 332 | index = add_legacy_soc_port(np, np); |
327 | if (index >= 0 && np == stdout) | 333 | if (index >= 0 && np == stdout) |
328 | legacy_serial_console = index; | 334 | legacy_serial_console = index; |
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index e79ad8afda07..3f37a6e62771 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c | |||
@@ -76,6 +76,8 @@ struct of_device* of_platform_device_create(struct device_node *np, | |||
76 | return NULL; | 76 | return NULL; |
77 | 77 | ||
78 | dev->dma_mask = 0xffffffffUL; | 78 | dev->dma_mask = 0xffffffffUL; |
79 | dev->dev.coherent_dma_mask = DMA_32BIT_MASK; | ||
80 | |||
79 | dev->dev.bus = &of_platform_bus_type; | 81 | dev->dev.bus = &of_platform_bus_type; |
80 | 82 | ||
81 | /* We do not fill the DMA ops for platform devices by default. | 83 | /* We do not fill the DMA ops for platform devices by default. |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index d3ac631cbd26..a8d02506468a 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/div64.h> | 42 | #include <asm/div64.h> |
43 | #include <asm/signal.h> | 43 | #include <asm/signal.h> |
44 | #include <asm/dcr.h> | 44 | #include <asm/dcr.h> |
45 | #include <asm/ftrace.h> | ||
45 | 46 | ||
46 | #ifdef CONFIG_PPC32 | 47 | #ifdef CONFIG_PPC32 |
47 | extern void transfer_to_handler(void); | 48 | extern void transfer_to_handler(void); |
@@ -67,6 +68,10 @@ EXPORT_SYMBOL(single_step_exception); | |||
67 | EXPORT_SYMBOL(sys_sigreturn); | 68 | EXPORT_SYMBOL(sys_sigreturn); |
68 | #endif | 69 | #endif |
69 | 70 | ||
71 | #ifdef CONFIG_FTRACE | ||
72 | EXPORT_SYMBOL(_mcount); | ||
73 | #endif | ||
74 | |||
70 | EXPORT_SYMBOL(strcpy); | 75 | EXPORT_SYMBOL(strcpy); |
71 | EXPORT_SYMBOL(strncpy); | 76 | EXPORT_SYMBOL(strncpy); |
72 | EXPORT_SYMBOL(strcat); | 77 | EXPORT_SYMBOL(strcat); |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 5112a4aa801d..19e8fcb9cea8 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -81,7 +81,7 @@ int ucache_bsize; | |||
81 | * from the address that it was linked at, so we must use RELOC/PTRRELOC | 81 | * from the address that it was linked at, so we must use RELOC/PTRRELOC |
82 | * to access static data (including strings). -- paulus | 82 | * to access static data (including strings). -- paulus |
83 | */ | 83 | */ |
84 | unsigned long __init early_init(unsigned long dt_ptr) | 84 | notrace unsigned long __init early_init(unsigned long dt_ptr) |
85 | { | 85 | { |
86 | unsigned long offset = reloc_offset(); | 86 | unsigned long offset = reloc_offset(); |
87 | struct cpu_spec *spec; | 87 | struct cpu_spec *spec; |
@@ -111,7 +111,7 @@ unsigned long __init early_init(unsigned long dt_ptr) | |||
111 | * This is called very early on the boot process, after a minimal | 111 | * This is called very early on the boot process, after a minimal |
112 | * MMU environment has been set up but before MMU_init is called. | 112 | * MMU environment has been set up but before MMU_init is called. |
113 | */ | 113 | */ |
114 | void __init machine_init(unsigned long dt_ptr, unsigned long phys) | 114 | notrace void __init machine_init(unsigned long dt_ptr, unsigned long phys) |
115 | { | 115 | { |
116 | /* Enable early debugging if any specified (see udbg.h) */ | 116 | /* Enable early debugging if any specified (see udbg.h) */ |
117 | udbg_early_init(); | 117 | udbg_early_init(); |
@@ -133,7 +133,7 @@ void __init machine_init(unsigned long dt_ptr, unsigned long phys) | |||
133 | 133 | ||
134 | #ifdef CONFIG_BOOKE_WDT | 134 | #ifdef CONFIG_BOOKE_WDT |
135 | /* Checks wdt=x and wdt_period=xx command-line option */ | 135 | /* Checks wdt=x and wdt_period=xx command-line option */ |
136 | int __init early_parse_wdt(char *p) | 136 | notrace int __init early_parse_wdt(char *p) |
137 | { | 137 | { |
138 | if (p && strncmp(p, "0", 1) != 0) | 138 | if (p && strncmp(p, "0", 1) != 0) |
139 | booke_wdt_enabled = 1; | 139 | booke_wdt_enabled = 1; |
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c index 962944038430..3cf0d94ba340 100644 --- a/arch/powerpc/kernel/stacktrace.c +++ b/arch/powerpc/kernel/stacktrace.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/stacktrace.h> | 14 | #include <linux/stacktrace.h> |
15 | #include <linux/module.h> | ||
15 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
16 | 17 | ||
17 | /* | 18 | /* |
@@ -44,3 +45,4 @@ void save_stack_trace(struct stack_trace *trace) | |||
44 | sp = newsp; | 45 | sp = newsp; |
45 | } | 46 | } |
46 | } | 47 | } |
48 | EXPORT_SYMBOL_GPL(save_stack_trace); | ||
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 0c3000bf8d75..53d57d17a894 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -64,8 +64,6 @@ SECTIONS | |||
64 | 64 | ||
65 | NOTES | 65 | NOTES |
66 | 66 | ||
67 | BUG_TABLE | ||
68 | |||
69 | /* | 67 | /* |
70 | * Init sections discarded at runtime | 68 | * Init sections discarded at runtime |
71 | */ | 69 | */ |
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c index 41c7fd91e99e..fe92e65103ed 100644 --- a/arch/powerpc/platforms/52xx/lite5200_pm.c +++ b/arch/powerpc/platforms/52xx/lite5200_pm.c | |||
@@ -14,6 +14,7 @@ static struct mpc52xx_sdma __iomem *bes; | |||
14 | static struct mpc52xx_xlb __iomem *xlb; | 14 | static struct mpc52xx_xlb __iomem *xlb; |
15 | static struct mpc52xx_gpio __iomem *gps; | 15 | static struct mpc52xx_gpio __iomem *gps; |
16 | static struct mpc52xx_gpio_wkup __iomem *gpw; | 16 | static struct mpc52xx_gpio_wkup __iomem *gpw; |
17 | static void __iomem *pci; | ||
17 | static void __iomem *sram; | 18 | static void __iomem *sram; |
18 | static const int sram_size = 0x4000; /* 16 kBytes */ | 19 | static const int sram_size = 0x4000; /* 16 kBytes */ |
19 | static void __iomem *mbar; | 20 | static void __iomem *mbar; |
@@ -50,6 +51,8 @@ static int lite5200_pm_prepare(void) | |||
50 | { .type = "builtin", .compatible = "mpc5200", }, /* efika */ | 51 | { .type = "builtin", .compatible = "mpc5200", }, /* efika */ |
51 | {} | 52 | {} |
52 | }; | 53 | }; |
54 | u64 regaddr64 = 0; | ||
55 | const u32 *regaddr_p; | ||
53 | 56 | ||
54 | /* deep sleep? let mpc52xx code handle that */ | 57 | /* deep sleep? let mpc52xx code handle that */ |
55 | if (lite5200_pm_target_state == PM_SUSPEND_STANDBY) | 58 | if (lite5200_pm_target_state == PM_SUSPEND_STANDBY) |
@@ -60,8 +63,12 @@ static int lite5200_pm_prepare(void) | |||
60 | 63 | ||
61 | /* map registers */ | 64 | /* map registers */ |
62 | np = of_find_matching_node(NULL, immr_ids); | 65 | np = of_find_matching_node(NULL, immr_ids); |
63 | mbar = of_iomap(np, 0); | 66 | regaddr_p = of_get_address(np, 0, NULL, NULL); |
67 | if (regaddr_p) | ||
68 | regaddr64 = of_translate_address(np, regaddr_p); | ||
64 | of_node_put(np); | 69 | of_node_put(np); |
70 | |||
71 | mbar = ioremap((u32) regaddr64, 0xC000); | ||
65 | if (!mbar) { | 72 | if (!mbar) { |
66 | printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__); | 73 | printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__); |
67 | return -ENOSYS; | 74 | return -ENOSYS; |
@@ -71,6 +78,7 @@ static int lite5200_pm_prepare(void) | |||
71 | pic = mbar + 0x500; | 78 | pic = mbar + 0x500; |
72 | gps = mbar + 0xb00; | 79 | gps = mbar + 0xb00; |
73 | gpw = mbar + 0xc00; | 80 | gpw = mbar + 0xc00; |
81 | pci = mbar + 0xd00; | ||
74 | bes = mbar + 0x1200; | 82 | bes = mbar + 0x1200; |
75 | xlb = mbar + 0x1f00; | 83 | xlb = mbar + 0x1f00; |
76 | sram = mbar + 0x8000; | 84 | sram = mbar + 0x8000; |
@@ -85,6 +93,7 @@ static struct mpc52xx_sdma sbes; | |||
85 | static struct mpc52xx_xlb sxlb; | 93 | static struct mpc52xx_xlb sxlb; |
86 | static struct mpc52xx_gpio sgps; | 94 | static struct mpc52xx_gpio sgps; |
87 | static struct mpc52xx_gpio_wkup sgpw; | 95 | static struct mpc52xx_gpio_wkup sgpw; |
96 | static char spci[0x200]; | ||
88 | 97 | ||
89 | static void lite5200_save_regs(void) | 98 | static void lite5200_save_regs(void) |
90 | { | 99 | { |
@@ -94,6 +103,7 @@ static void lite5200_save_regs(void) | |||
94 | _memcpy_fromio(&sxlb, xlb, sizeof(*xlb)); | 103 | _memcpy_fromio(&sxlb, xlb, sizeof(*xlb)); |
95 | _memcpy_fromio(&sgps, gps, sizeof(*gps)); | 104 | _memcpy_fromio(&sgps, gps, sizeof(*gps)); |
96 | _memcpy_fromio(&sgpw, gpw, sizeof(*gpw)); | 105 | _memcpy_fromio(&sgpw, gpw, sizeof(*gpw)); |
106 | _memcpy_fromio(spci, pci, 0x200); | ||
97 | 107 | ||
98 | _memcpy_fromio(saved_sram, sram, sram_size); | 108 | _memcpy_fromio(saved_sram, sram, sram_size); |
99 | } | 109 | } |
@@ -103,6 +113,8 @@ static void lite5200_restore_regs(void) | |||
103 | int i; | 113 | int i; |
104 | _memcpy_toio(sram, saved_sram, sram_size); | 114 | _memcpy_toio(sram, saved_sram, sram_size); |
105 | 115 | ||
116 | /* PCI Configuration */ | ||
117 | _memcpy_toio(pci, spci, 0x200); | ||
106 | 118 | ||
107 | /* | 119 | /* |
108 | * GPIOs. Interrupt Master Enable has higher address then other | 120 | * GPIOs. Interrupt Master Enable has higher address then other |
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile index 4d72c8f72159..89774177b209 100644 --- a/arch/powerpc/platforms/powermac/Makefile +++ b/arch/powerpc/platforms/powermac/Makefile | |||
@@ -1,5 +1,10 @@ | |||
1 | CFLAGS_bootx_init.o += -fPIC | 1 | CFLAGS_bootx_init.o += -fPIC |
2 | 2 | ||
3 | ifdef CONFIG_FTRACE | ||
4 | # Do not trace early boot code | ||
5 | CFLAGS_REMOVE_bootx_init.o = -pg | ||
6 | endif | ||
7 | |||
3 | obj-y += pic.o setup.o time.o feature.o pci.o \ | 8 | obj-y += pic.o setup.o time.o feature.o pci.o \ |
4 | sleep.o low_i2c.o cache.o pfunc_core.o \ | 9 | sleep.o low_i2c.o cache.o pfunc_core.o \ |
5 | pfunc_base.o | 10 | pfunc_base.o |