diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig | 3 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ftrace.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 27 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 26 |
10 files changed, 39 insertions, 31 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 5b1527883fcb..525c13a4de93 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -108,8 +108,7 @@ config ARCH_NO_VIRT_TO_BUS | |||
108 | config PPC | 108 | config PPC |
109 | bool | 109 | bool |
110 | default y | 110 | default y |
111 | select HAVE_DYNAMIC_FTRACE | 111 | select HAVE_FUNCTION_TRACER |
112 | select HAVE_FTRACE | ||
113 | select ARCH_WANT_OPTIONAL_GPIOLIB | 112 | select ARCH_WANT_OPTIONAL_GPIOLIB |
114 | select HAVE_IDE | 113 | select HAVE_IDE |
115 | select HAVE_IOREMAP_PROT | 114 | select HAVE_IOREMAP_PROT |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 24dd1a37f8fb..1f0667069940 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -122,7 +122,7 @@ KBUILD_CFLAGS += -mcpu=powerpc | |||
122 | endif | 122 | endif |
123 | 123 | ||
124 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. | 124 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. |
125 | ifeq ($(CONFIG_FTRACE),y) | 125 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
126 | KBUILD_CFLAGS += -mno-sched-epilog | 126 | KBUILD_CFLAGS += -mno-sched-epilog |
127 | endif | 127 | endif |
128 | 128 | ||
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index de921326cca8..b298f7a631e6 100644 --- a/arch/powerpc/include/asm/ftrace.h +++ b/arch/powerpc/include/asm/ftrace.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_POWERPC_FTRACE | 1 | #ifndef _ASM_POWERPC_FTRACE |
2 | #define _ASM_POWERPC_FTRACE | 2 | #define _ASM_POWERPC_FTRACE |
3 | 3 | ||
4 | #ifdef CONFIG_FTRACE | 4 | #ifdef CONFIG_FUNCTION_TRACER |
5 | #define MCOUNT_ADDR ((long)(_mcount)) | 5 | #define MCOUNT_ADDR ((long)(_mcount)) |
6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | 6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ |
7 | 7 | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index fdb58253fa5b..92673b43858d 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -12,7 +12,7 @@ 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 | 15 | ifdef CONFIG_FUNCTION_TRACER |
16 | # Do not trace early boot code | 16 | # Do not trace early boot code |
17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog | 17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog |
18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog | 18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 1cbbf7033641..7ecc0d1855c3 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
@@ -1158,7 +1158,7 @@ machine_check_in_rtas: | |||
1158 | 1158 | ||
1159 | #endif /* CONFIG_PPC_RTAS */ | 1159 | #endif /* CONFIG_PPC_RTAS */ |
1160 | 1160 | ||
1161 | #ifdef CONFIG_FTRACE | 1161 | #ifdef CONFIG_FUNCTION_TRACER |
1162 | #ifdef CONFIG_DYNAMIC_FTRACE | 1162 | #ifdef CONFIG_DYNAMIC_FTRACE |
1163 | _GLOBAL(mcount) | 1163 | _GLOBAL(mcount) |
1164 | _GLOBAL(_mcount) | 1164 | _GLOBAL(_mcount) |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index fd8b4bae9b04..e6d52845854f 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -884,7 +884,7 @@ _GLOBAL(enter_prom) | |||
884 | mtlr r0 | 884 | mtlr r0 |
885 | blr | 885 | blr |
886 | 886 | ||
887 | #ifdef CONFIG_FTRACE | 887 | #ifdef CONFIG_FUNCTION_TRACER |
888 | #ifdef CONFIG_DYNAMIC_FTRACE | 888 | #ifdef CONFIG_DYNAMIC_FTRACE |
889 | _GLOBAL(mcount) | 889 | _GLOBAL(mcount) |
890 | _GLOBAL(_mcount) | 890 | _GLOBAL(_mcount) |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 3855ceb937b0..f4b006ed0ab1 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -28,17 +28,17 @@ static unsigned int ftrace_nop = 0x60000000; | |||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | 30 | ||
31 | static unsigned int notrace ftrace_calc_offset(long ip, long addr) | 31 | static unsigned int ftrace_calc_offset(long ip, long addr) |
32 | { | 32 | { |
33 | return (int)(addr - ip); | 33 | return (int)(addr - ip); |
34 | } | 34 | } |
35 | 35 | ||
36 | notrace unsigned char *ftrace_nop_replace(void) | 36 | unsigned char *ftrace_nop_replace(void) |
37 | { | 37 | { |
38 | return (char *)&ftrace_nop; | 38 | return (char *)&ftrace_nop; |
39 | } | 39 | } |
40 | 40 | ||
41 | notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | 41 | unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) |
42 | { | 42 | { |
43 | static unsigned int op; | 43 | static unsigned int op; |
44 | 44 | ||
@@ -68,7 +68,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
68 | # define _ASM_PTR " .long " | 68 | # define _ASM_PTR " .long " |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | notrace int | 71 | int |
72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | 72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
73 | unsigned char *new_code) | 73 | unsigned char *new_code) |
74 | { | 74 | { |
@@ -113,7 +113,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |||
113 | return faulted; | 113 | return faulted; |
114 | } | 114 | } |
115 | 115 | ||
116 | notrace int ftrace_update_ftrace_func(ftrace_func_t func) | 116 | int ftrace_update_ftrace_func(ftrace_func_t func) |
117 | { | 117 | { |
118 | unsigned long ip = (unsigned long)(&ftrace_call); | 118 | unsigned long ip = (unsigned long)(&ftrace_call); |
119 | unsigned char old[MCOUNT_INSN_SIZE], *new; | 119 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
@@ -126,23 +126,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |||
126 | return ret; | 126 | return ret; |
127 | } | 127 | } |
128 | 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) | 129 | int __init ftrace_dyn_arch_init(void *data) |
147 | { | 130 | { |
148 | /* This is running in kstop_machine */ | 131 | /* This is running in kstop_machine */ |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 8edc2359c419..260089dccfb0 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(single_step_exception); | |||
68 | EXPORT_SYMBOL(sys_sigreturn); | 68 | EXPORT_SYMBOL(sys_sigreturn); |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifdef CONFIG_FTRACE | 71 | #ifdef CONFIG_FUNCTION_TRACER |
72 | EXPORT_SYMBOL(_mcount); | 72 | EXPORT_SYMBOL(_mcount); |
73 | #endif | 73 | #endif |
74 | 74 | ||
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile index be60d64be7ad..50f169392551 100644 --- a/arch/powerpc/platforms/powermac/Makefile +++ b/arch/powerpc/platforms/powermac/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | CFLAGS_bootx_init.o += -fPIC | 1 | CFLAGS_bootx_init.o += -fPIC |
2 | 2 | ||
3 | ifdef CONFIG_FTRACE | 3 | ifdef CONFIG_FUNCTION_TRACER |
4 | # Do not trace early boot code | 4 | # Do not trace early boot code |
5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog | 5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog |
6 | endif | 6 | endif |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 01b884b25696..26ecb96f9731 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -223,6 +223,8 @@ static int gfar_mdio_of_init_one(struct device_node *np) | |||
223 | if (ret) | 223 | if (ret) |
224 | return ret; | 224 | return ret; |
225 | 225 | ||
226 | /* The gianfar device will try to use the same ID created below to find | ||
227 | * this bus, to coordinate register access (since they share). */ | ||
226 | mdio_dev = platform_device_register_simple("fsl-gianfar_mdio", | 228 | mdio_dev = platform_device_register_simple("fsl-gianfar_mdio", |
227 | res.start&0xfffff, &res, 1); | 229 | res.start&0xfffff, &res, 1); |
228 | if (IS_ERR(mdio_dev)) | 230 | if (IS_ERR(mdio_dev)) |
@@ -394,6 +396,30 @@ static int __init gfar_of_init(void) | |||
394 | of_node_put(mdio); | 396 | of_node_put(mdio); |
395 | } | 397 | } |
396 | 398 | ||
399 | /* Get MDIO bus controlled by this eTSEC, if any. Normally only | ||
400 | * eTSEC 1 will control an MDIO bus, not necessarily the same | ||
401 | * bus that its PHY is on ('mdio' above), so we can't just use | ||
402 | * that. What we do is look for a gianfar mdio device that has | ||
403 | * overlapping registers with this device. That's really the | ||
404 | * whole point, to find the device sharing our registers to | ||
405 | * coordinate access with it. | ||
406 | */ | ||
407 | for_each_compatible_node(mdio, NULL, "fsl,gianfar-mdio") { | ||
408 | if (of_address_to_resource(mdio, 0, &res)) | ||
409 | continue; | ||
410 | |||
411 | if (res.start >= r[0].start && res.end <= r[0].end) { | ||
412 | /* Get the ID the mdio bus platform device was | ||
413 | * registered with. gfar_data.bus_id is | ||
414 | * different because it's for finding a PHY, | ||
415 | * while this is for finding a MII bus. | ||
416 | */ | ||
417 | gfar_data.mdio_bus = res.start&0xfffff; | ||
418 | of_node_put(mdio); | ||
419 | break; | ||
420 | } | ||
421 | } | ||
422 | |||
397 | ret = | 423 | ret = |
398 | platform_device_add_data(gfar_dev, &gfar_data, | 424 | platform_device_add_data(gfar_dev, &gfar_data, |
399 | sizeof(struct | 425 | sizeof(struct |