diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-13 20:07:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-13 20:07:28 -0400 |
commit | 45d447406a19cbfd42720f066f156f4eb9d68801 (patch) | |
tree | 57a2224dea60dfcc6ff58130230f2ffa48bbe01a /arch | |
parent | 210af919c949a7d6bd330916ef376cec2907d81e (diff) | |
parent | 78f3cdfa2ac0aa2b72b3ee7e4b3c3e550230179f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6:
xtensa: Fix linker script to include .literal sections
xtensa: update s6105_defconfig for ccount calibration
xtensa: implement ccount calibration for s6000
xtensa: fix wrong extern declaration renamed in code using it
xtensa: register gpio chip before use
xtensa: always use correct stack pointer for stack traces
xtensa: Fix checksum header file
xtensa: Fix architecture specific Kconfig
Diffstat (limited to 'arch')
-rw-r--r-- | arch/xtensa/Kconfig | 7 | ||||
-rw-r--r-- | arch/xtensa/configs/s6105_defconfig | 3 | ||||
-rw-r--r-- | arch/xtensa/include/asm/checksum.h | 6 | ||||
-rw-r--r-- | arch/xtensa/include/asm/timex.h | 4 | ||||
-rw-r--r-- | arch/xtensa/kernel/Makefile | 21 | ||||
-rw-r--r-- | arch/xtensa/kernel/traps.c | 16 | ||||
-rw-r--r-- | arch/xtensa/kernel/vmlinux.lds.S | 4 | ||||
-rw-r--r-- | arch/xtensa/platforms/s6105/setup.c | 3 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/Makefile | 1 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/delay.c | 27 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/gpio.c | 3 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/include/variant/gpio.h | 6 |
12 files changed, 81 insertions, 20 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index fa6dc4dd3b19..ebe228d02b08 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -80,6 +80,7 @@ config XTENSA_VARIANT_S6000 | |||
80 | bool "s6000 - Stretch software configurable processor" | 80 | bool "s6000 - Stretch software configurable processor" |
81 | select VARIANT_IRQ_SWITCH | 81 | select VARIANT_IRQ_SWITCH |
82 | select ARCH_REQUIRE_GPIOLIB | 82 | select ARCH_REQUIRE_GPIOLIB |
83 | select XTENSA_CALIBRATE_CCOUNT | ||
83 | endchoice | 84 | endchoice |
84 | 85 | ||
85 | config XTENSA_UNALIGNED_USER | 86 | config XTENSA_UNALIGNED_USER |
@@ -137,6 +138,8 @@ config PCI | |||
137 | 138 | ||
138 | source "drivers/pci/Kconfig" | 139 | source "drivers/pci/Kconfig" |
139 | 140 | ||
141 | endmenu | ||
142 | |||
140 | menu "Platform options" | 143 | menu "Platform options" |
141 | 144 | ||
142 | choice | 145 | choice |
@@ -153,8 +156,6 @@ config XTENSA_PLATFORM_ISS | |||
153 | 156 | ||
154 | config XTENSA_PLATFORM_XT2000 | 157 | config XTENSA_PLATFORM_XT2000 |
155 | bool "XT2000" | 158 | bool "XT2000" |
156 | select XTENSA_CALIBRATE_CCOUNT | ||
157 | select PCI | ||
158 | help | 159 | help |
159 | XT2000 is the name of Tensilica's feature-rich emulation platform. | 160 | XT2000 is the name of Tensilica's feature-rich emulation platform. |
160 | This hardware is capable of running a full Linux distribution. | 161 | This hardware is capable of running a full Linux distribution. |
@@ -192,8 +193,6 @@ config CMDLINE | |||
192 | 193 | ||
193 | source "mm/Kconfig" | 194 | source "mm/Kconfig" |
194 | 195 | ||
195 | endmenu | ||
196 | |||
197 | config HOTPLUG | 196 | config HOTPLUG |
198 | bool "Support for hot-pluggable devices" | 197 | bool "Support for hot-pluggable devices" |
199 | help | 198 | help |
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig index 6e1deff41590..768bee006037 100644 --- a/arch/xtensa/configs/s6105_defconfig +++ b/arch/xtensa/configs/s6105_defconfig | |||
@@ -115,7 +115,7 @@ CONFIG_XTENSA_VARIANT_S6000=y | |||
115 | CONFIG_PREEMPT=y | 115 | CONFIG_PREEMPT=y |
116 | # CONFIG_MATH_EMULATION is not set | 116 | # CONFIG_MATH_EMULATION is not set |
117 | # CONFIG_HIGHMEM is not set | 117 | # CONFIG_HIGHMEM is not set |
118 | # CONFIG_XTENSA_CALIBRATE_CCOUNT is not set | 118 | CONFIG_XTENSA_CALIBRATE_CCOUNT=y |
119 | CONFIG_SERIAL_CONSOLE=y | 119 | CONFIG_SERIAL_CONSOLE=y |
120 | # CONFIG_XTENSA_ISS_NETWORK is not set | 120 | # CONFIG_XTENSA_ISS_NETWORK is not set |
121 | 121 | ||
@@ -131,7 +131,6 @@ CONFIG_SERIAL_CONSOLE=y | |||
131 | # CONFIG_XTENSA_PLATFORM_ISS is not set | 131 | # CONFIG_XTENSA_PLATFORM_ISS is not set |
132 | # CONFIG_XTENSA_PLATFORM_XT2000 is not set | 132 | # CONFIG_XTENSA_PLATFORM_XT2000 is not set |
133 | CONFIG_XTENSA_PLATFORM_S6105=y | 133 | CONFIG_XTENSA_PLATFORM_S6105=y |
134 | CONFIG_XTENSA_CPU_CLOCK=300 | ||
135 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 134 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
136 | CONFIG_CMDLINE_BOOL=y | 135 | CONFIG_CMDLINE_BOOL=y |
137 | CONFIG_CMDLINE="console=ttyS1,38400 debug bootmem_debug loglevel=7" | 136 | CONFIG_CMDLINE="console=ttyS1,38400 debug bootmem_debug loglevel=7" |
diff --git a/arch/xtensa/include/asm/checksum.h b/arch/xtensa/include/asm/checksum.h index f84d3f00774a..e4d831a30772 100644 --- a/arch/xtensa/include/asm/checksum.h +++ b/arch/xtensa/include/asm/checksum.h | |||
@@ -113,7 +113,8 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) | |||
113 | are modified, we must also specify them as outputs, or gcc | 113 | are modified, we must also specify them as outputs, or gcc |
114 | will assume they contain their original values. */ | 114 | will assume they contain their original values. */ |
115 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr) | 115 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr) |
116 | : "1" (iph), "2" (ihl)); | 116 | : "1" (iph), "2" (ihl) |
117 | : "memory"); | ||
117 | 118 | ||
118 | return csum_fold(sum); | 119 | return csum_fold(sum); |
119 | } | 120 | } |
@@ -227,7 +228,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
227 | "1:\t" | 228 | "1:\t" |
228 | : "=r" (sum), "=&r" (__dummy) | 229 | : "=r" (sum), "=&r" (__dummy) |
229 | : "r" (saddr), "r" (daddr), | 230 | : "r" (saddr), "r" (daddr), |
230 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); | 231 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) |
232 | : "memory"); | ||
231 | 233 | ||
232 | return csum_fold(sum); | 234 | return csum_fold(sum); |
233 | } | 235 | } |
diff --git a/arch/xtensa/include/asm/timex.h b/arch/xtensa/include/asm/timex.h index b83a8181d448..053bc4272106 100644 --- a/arch/xtensa/include/asm/timex.h +++ b/arch/xtensa/include/asm/timex.h | |||
@@ -39,9 +39,9 @@ | |||
39 | 39 | ||
40 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT | 40 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT |
41 | extern unsigned long ccount_per_jiffy; | 41 | extern unsigned long ccount_per_jiffy; |
42 | extern unsigned long ccount_nsec; | 42 | extern unsigned long nsec_per_ccount; |
43 | #define CCOUNT_PER_JIFFY ccount_per_jiffy | 43 | #define CCOUNT_PER_JIFFY ccount_per_jiffy |
44 | #define NSEC_PER_CCOUNT ccount_nsec | 44 | #define NSEC_PER_CCOUNT nsec_per_ccount |
45 | #else | 45 | #else |
46 | #define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ)) | 46 | #define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ)) |
47 | #define NSEC_PER_CCOUNT (1000UL / CONFIG_XTENSA_CPU_CLOCK) | 47 | #define NSEC_PER_CCOUNT (1000UL / CONFIG_XTENSA_CPU_CLOCK) |
diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile index 7419dbccf027..fe3186de6a33 100644 --- a/arch/xtensa/kernel/Makefile +++ b/arch/xtensa/kernel/Makefile | |||
@@ -4,15 +4,30 @@ | |||
4 | 4 | ||
5 | extra-y := head.o vmlinux.lds | 5 | extra-y := head.o vmlinux.lds |
6 | 6 | ||
7 | |||
8 | obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \ | 7 | obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \ |
9 | setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \ | 8 | setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \ |
10 | pci-dma.o init_task.o io.o | 9 | pci-dma.o init_task.o io.o |
11 | 10 | ||
12 | ## windowspill.o | ||
13 | |||
14 | obj-$(CONFIG_KGDB) += xtensa-stub.o | 11 | obj-$(CONFIG_KGDB) += xtensa-stub.o |
15 | obj-$(CONFIG_PCI) += pci.o | 12 | obj-$(CONFIG_PCI) += pci.o |
16 | obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o | 13 | obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o |
17 | 14 | ||
15 | # In the Xtensa architecture, assembly generates literals which must always | ||
16 | # precede the L32R instruction with a relative offset less than 256 kB. | ||
17 | # Therefore, the .text and .literal section must be combined in parenthesis | ||
18 | # in the linker script, such as: *(.literal .text). | ||
19 | # | ||
20 | # We need to post-process the generated vmlinux.lds scripts to convert | ||
21 | # *(xxx.text) to *(xxx.literal xxx.text) for the following text sections: | ||
22 | # .text .ref.text .*init.text .*exit.text .text.* | ||
23 | # | ||
24 | # Replicate rules in scripts/Makefile.build | ||
25 | |||
26 | sed-y = -e 's/(\(\.[a-z]*it\|\.ref\|\)\.text)/(\1.literal \1.text)/g' \ | ||
27 | -e 's/(\(\.text\.[a-z]*\))/(\1.literal \1)/g' | ||
28 | |||
29 | quiet_cmd__cpp_lds_S = LDS $@ | ||
30 | cmd__cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ $< | sed $(sed-y) >$@ | ||
18 | 31 | ||
32 | $(obj)/vmlinux.lds: $(src)/vmlinux.lds.S FORCE | ||
33 | $(call if_changed_dep,_cpp_lds_S) | ||
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 9f0b71189e94..ba9ab9349782 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -369,6 +369,18 @@ void show_regs(struct pt_regs * regs) | |||
369 | regs->syscall); | 369 | regs->syscall); |
370 | } | 370 | } |
371 | 371 | ||
372 | static __always_inline unsigned long *stack_pointer(struct task_struct *task) | ||
373 | { | ||
374 | unsigned long *sp; | ||
375 | |||
376 | if (!task || task == current) | ||
377 | __asm__ __volatile__ ("mov %0, a1\n" : "=a"(sp)); | ||
378 | else | ||
379 | sp = (unsigned long *)task->thread.sp; | ||
380 | |||
381 | return sp; | ||
382 | } | ||
383 | |||
372 | void show_trace(struct task_struct *task, unsigned long *sp) | 384 | void show_trace(struct task_struct *task, unsigned long *sp) |
373 | { | 385 | { |
374 | unsigned long a0, a1, pc; | 386 | unsigned long a0, a1, pc; |
@@ -377,7 +389,7 @@ void show_trace(struct task_struct *task, unsigned long *sp) | |||
377 | if (sp) | 389 | if (sp) |
378 | a1 = (unsigned long)sp; | 390 | a1 = (unsigned long)sp; |
379 | else | 391 | else |
380 | a1 = task->thread.sp; | 392 | a1 = (unsigned long)stack_pointer(task); |
381 | 393 | ||
382 | sp_start = a1 & ~(THREAD_SIZE-1); | 394 | sp_start = a1 & ~(THREAD_SIZE-1); |
383 | sp_end = sp_start + THREAD_SIZE; | 395 | sp_end = sp_start + THREAD_SIZE; |
@@ -420,7 +432,7 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
420 | unsigned long *stack; | 432 | unsigned long *stack; |
421 | 433 | ||
422 | if (!sp) | 434 | if (!sp) |
423 | sp = (unsigned long *)task->thread.sp; | 435 | sp = stack_pointer(task); |
424 | stack = sp; | 436 | stack = sp; |
425 | 437 | ||
426 | printk("\nStack: "); | 438 | printk("\nStack: "); |
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 5accf51053da..41c159cd872f 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -87,7 +87,7 @@ SECTIONS | |||
87 | { | 87 | { |
88 | /* The HEAD_TEXT section must be the first section! */ | 88 | /* The HEAD_TEXT section must be the first section! */ |
89 | HEAD_TEXT | 89 | HEAD_TEXT |
90 | *(.literal .text) | 90 | TEXT_TEXT |
91 | VMLINUX_SYMBOL(__sched_text_start) = .; | 91 | VMLINUX_SYMBOL(__sched_text_start) = .; |
92 | *(.sched.literal .sched.text) | 92 | *(.sched.literal .sched.text) |
93 | VMLINUX_SYMBOL(__sched_text_end) = .; | 93 | VMLINUX_SYMBOL(__sched_text_end) = .; |
@@ -139,8 +139,6 @@ SECTIONS | |||
139 | __init_begin = .; | 139 | __init_begin = .; |
140 | .init.text : { | 140 | .init.text : { |
141 | _sinittext = .; | 141 | _sinittext = .; |
142 | *(.init.literal) *(.cpuinit.literal) | ||
143 | *(.devinit.literal) *(.meminit.literal) | ||
144 | INIT_TEXT | 142 | INIT_TEXT |
145 | _einittext = .; | 143 | _einittext = .; |
146 | } | 144 | } |
diff --git a/arch/xtensa/platforms/s6105/setup.c b/arch/xtensa/platforms/s6105/setup.c index ae041d5027a2..855ddeadc43d 100644 --- a/arch/xtensa/platforms/s6105/setup.c +++ b/arch/xtensa/platforms/s6105/setup.c | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <asm/bootparam.h> | 10 | #include <asm/bootparam.h> |
11 | 11 | ||
12 | #include <variant/hardware.h> | 12 | #include <variant/hardware.h> |
13 | #include <variant/gpio.h> | ||
14 | |||
13 | #include <platform/gpio.h> | 15 | #include <platform/gpio.h> |
14 | 16 | ||
15 | void platform_halt(void) | 17 | void platform_halt(void) |
@@ -47,6 +49,7 @@ void __init platform_setup(char **cmdline) | |||
47 | 49 | ||
48 | void __init platform_init(bp_tag_t *first) | 50 | void __init platform_init(bp_tag_t *first) |
49 | { | 51 | { |
52 | s6_gpio_init(); | ||
50 | gpio_request(GPIO_LED1_NGREEN, "led1_green"); | 53 | gpio_request(GPIO_LED1_NGREEN, "led1_green"); |
51 | gpio_request(GPIO_LED1_RED, "led1_red"); | 54 | gpio_request(GPIO_LED1_RED, "led1_red"); |
52 | gpio_direction_output(GPIO_LED1_NGREEN, 1); | 55 | gpio_direction_output(GPIO_LED1_NGREEN, 1); |
diff --git a/arch/xtensa/variants/s6000/Makefile b/arch/xtensa/variants/s6000/Makefile index 03b3975468bd..d83f3805130c 100644 --- a/arch/xtensa/variants/s6000/Makefile +++ b/arch/xtensa/variants/s6000/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # s6000 Makefile | 1 | # s6000 Makefile |
2 | 2 | ||
3 | obj-y += irq.o gpio.o | 3 | obj-y += irq.o gpio.o |
4 | obj-$(CONFIG_XTENSA_CALIBRATE_CCOUNT) += delay.o | ||
diff --git a/arch/xtensa/variants/s6000/delay.c b/arch/xtensa/variants/s6000/delay.c new file mode 100644 index 000000000000..54b2b573f166 --- /dev/null +++ b/arch/xtensa/variants/s6000/delay.c | |||
@@ -0,0 +1,27 @@ | |||
1 | #include <asm/delay.h> | ||
2 | #include <asm/timex.h> | ||
3 | #include <asm/io.h> | ||
4 | #include <variant/hardware.h> | ||
5 | |||
6 | #define LOOPS 10 | ||
7 | void platform_calibrate_ccount(void) | ||
8 | { | ||
9 | u32 uninitialized_var(a); | ||
10 | u32 uninitialized_var(u); | ||
11 | u32 b; | ||
12 | u32 tstamp = S6_REG_GREG1 + S6_GREG1_GLOBAL_TIMER; | ||
13 | int i = LOOPS+1; | ||
14 | do { | ||
15 | u32 t = u; | ||
16 | asm volatile( | ||
17 | "1: l32i %0, %2, 0 ;" | ||
18 | " beq %0, %1, 1b ;" | ||
19 | : "=&a"(u) : "a"(t), "a"(tstamp)); | ||
20 | b = xtensa_get_ccount(); | ||
21 | if (i == LOOPS) | ||
22 | a = b; | ||
23 | } while (--i >= 0); | ||
24 | b -= a; | ||
25 | nsec_per_ccount = (LOOPS * 10000) / b; | ||
26 | ccount_per_jiffy = b * (100000UL / (LOOPS * HZ)); | ||
27 | } | ||
diff --git a/arch/xtensa/variants/s6000/gpio.c b/arch/xtensa/variants/s6000/gpio.c index 33a8d952934c..79317fdcf14c 100644 --- a/arch/xtensa/variants/s6000/gpio.c +++ b/arch/xtensa/variants/s6000/gpio.c | |||
@@ -64,8 +64,7 @@ static struct gpio_chip gpiochip = { | |||
64 | .exported = 0, /* no exporting to userspace */ | 64 | .exported = 0, /* no exporting to userspace */ |
65 | }; | 65 | }; |
66 | 66 | ||
67 | static int gpio_init(void) | 67 | int s6_gpio_init(void) |
68 | { | 68 | { |
69 | return gpiochip_add(&gpiochip); | 69 | return gpiochip_add(&gpiochip); |
70 | } | 70 | } |
71 | device_initcall(gpio_init); | ||
diff --git a/arch/xtensa/variants/s6000/include/variant/gpio.h b/arch/xtensa/variants/s6000/include/variant/gpio.h new file mode 100644 index 000000000000..8327f62167eb --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/gpio.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _XTENSA_VARIANT_S6000_GPIO_H | ||
2 | #define _XTENSA_VARIANT_S6000_GPIO_H | ||
3 | |||
4 | extern int s6_gpio_init(void); | ||
5 | |||
6 | #endif /* _XTENSA_VARIANT_S6000_GPIO_H */ | ||