diff options
Diffstat (limited to 'arch/xtensa')
27 files changed, 141 insertions, 285 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 0859bfd8ae93..5d43c1f8ada8 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -1,8 +1,3 @@ | |||
1 | # For a description of the syntax of this configuration file, | ||
2 | # see Documentation/kbuild/kconfig-language.txt. | ||
3 | |||
4 | mainmenu "Linux/Xtensa Kernel Configuration" | ||
5 | |||
6 | config FRAME_POINTER | 1 | config FRAME_POINTER |
7 | def_bool n | 2 | def_bool n |
8 | 3 | ||
@@ -12,6 +7,8 @@ config ZONE_DMA | |||
12 | config XTENSA | 7 | config XTENSA |
13 | def_bool y | 8 | def_bool y |
14 | select HAVE_IDE | 9 | select HAVE_IDE |
10 | select HAVE_GENERIC_HARDIRQS | ||
11 | select GENERIC_IRQ_SHOW | ||
15 | help | 12 | help |
16 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 13 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
17 | primarily for embedded systems. These processors are both | 14 | primarily for embedded systems. These processors are both |
@@ -23,15 +20,9 @@ config XTENSA | |||
23 | config RWSEM_XCHGADD_ALGORITHM | 20 | config RWSEM_XCHGADD_ALGORITHM |
24 | def_bool y | 21 | def_bool y |
25 | 22 | ||
26 | config GENERIC_FIND_NEXT_BIT | ||
27 | def_bool y | ||
28 | |||
29 | config GENERIC_HWEIGHT | 23 | config GENERIC_HWEIGHT |
30 | def_bool y | 24 | def_bool y |
31 | 25 | ||
32 | config GENERIC_HARDIRQS | ||
33 | def_bool y | ||
34 | |||
35 | config GENERIC_GPIO | 26 | config GENERIC_GPIO |
36 | def_bool y | 27 | def_bool y |
37 | 28 | ||
diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile index 40aa55b485be..70fd1453e172 100644 --- a/arch/xtensa/boot/Makefile +++ b/arch/xtensa/boot/Makefile | |||
@@ -14,7 +14,7 @@ HOSTFLAGS += -Iarch/$(ARCH)/boot/include | |||
14 | 14 | ||
15 | BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#") | 15 | BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#") |
16 | 16 | ||
17 | export EXTRA_CFLAGS | 17 | export ccflags-y |
18 | export BIG_ENDIAN | 18 | export BIG_ENDIAN |
19 | 19 | ||
20 | subdir-y := lib | 20 | subdir-y := lib |
diff --git a/arch/xtensa/boot/lib/Makefile b/arch/xtensa/boot/lib/Makefile index d3d2aa2d883a..ad8952e8a07f 100644 --- a/arch/xtensa/boot/lib/Makefile +++ b/arch/xtensa/boot/lib/Makefile | |||
@@ -6,7 +6,7 @@ zlib := inffast.c inflate.c inftrees.c | |||
6 | 6 | ||
7 | lib-y += $(zlib:.c=.o) zmem.o | 7 | lib-y += $(zlib:.c=.o) zmem.o |
8 | 8 | ||
9 | EXTRA_CFLAGS += -Ilib/zlib_inflate | 9 | ccflags-y := -Ilib/zlib_inflate |
10 | 10 | ||
11 | quiet_cmd_copy_zlib = COPY $@ | 11 | quiet_cmd_copy_zlib = COPY $@ |
12 | cmd_copy_zlib = cat $< > $@ | 12 | cmd_copy_zlib = cat $< > $@ |
diff --git a/arch/xtensa/configs/common_defconfig b/arch/xtensa/configs/common_defconfig index 1d230ee081b4..b90038e40dd3 100644 --- a/arch/xtensa/configs/common_defconfig +++ b/arch/xtensa/configs/common_defconfig | |||
@@ -32,7 +32,7 @@ CONFIG_LOG_BUF_SHIFT=14 | |||
32 | # CONFIG_HOTPLUG is not set | 32 | # CONFIG_HOTPLUG is not set |
33 | CONFIG_KOBJECT_UEVENT=y | 33 | CONFIG_KOBJECT_UEVENT=y |
34 | # CONFIG_IKCONFIG is not set | 34 | # CONFIG_IKCONFIG is not set |
35 | # CONFIG_EMBEDDED is not set | 35 | # CONFIG_EXPERT is not set |
36 | CONFIG_KALLSYMS=y | 36 | CONFIG_KALLSYMS=y |
37 | # CONFIG_KALLSYMS_ALL is not set | 37 | # CONFIG_KALLSYMS_ALL is not set |
38 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 38 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig index 7368164843b9..0234cd198c54 100644 --- a/arch/xtensa/configs/iss_defconfig +++ b/arch/xtensa/configs/iss_defconfig | |||
@@ -55,7 +55,7 @@ CONFIG_LOG_BUF_SHIFT=14 | |||
55 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | 55 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set |
56 | CONFIG_SYSCTL=y | 56 | CONFIG_SYSCTL=y |
57 | CONFIG_ANON_INODES=y | 57 | CONFIG_ANON_INODES=y |
58 | CONFIG_EMBEDDED=y | 58 | CONFIG_EXPERT=y |
59 | CONFIG_SYSCTL_SYSCALL=y | 59 | CONFIG_SYSCTL_SYSCALL=y |
60 | CONFIG_KALLSYMS=y | 60 | CONFIG_KALLSYMS=y |
61 | # CONFIG_KALLSYMS_ALL is not set | 61 | # CONFIG_KALLSYMS_ALL is not set |
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig index bb84fbc9921f..4891abbf16bc 100644 --- a/arch/xtensa/configs/s6105_defconfig +++ b/arch/xtensa/configs/s6105_defconfig | |||
@@ -23,7 +23,6 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | |||
23 | # | 23 | # |
24 | CONFIG_EXPERIMENTAL=y | 24 | CONFIG_EXPERIMENTAL=y |
25 | CONFIG_BROKEN_ON_SMP=y | 25 | CONFIG_BROKEN_ON_SMP=y |
26 | CONFIG_LOCK_KERNEL=y | ||
27 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 26 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
28 | CONFIG_LOCALVERSION="" | 27 | CONFIG_LOCALVERSION="" |
29 | CONFIG_LOCALVERSION_AUTO=y | 28 | CONFIG_LOCALVERSION_AUTO=y |
@@ -55,7 +54,7 @@ CONFIG_BLK_DEV_INITRD=y | |||
55 | CONFIG_INITRAMFS_SOURCE="" | 54 | CONFIG_INITRAMFS_SOURCE="" |
56 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 55 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
57 | CONFIG_SYSCTL=y | 56 | CONFIG_SYSCTL=y |
58 | CONFIG_EMBEDDED=y | 57 | CONFIG_EXPERT=y |
59 | CONFIG_SYSCTL_SYSCALL=y | 58 | CONFIG_SYSCTL_SYSCALL=y |
60 | CONFIG_KALLSYMS=y | 59 | CONFIG_KALLSYMS=y |
61 | # CONFIG_KALLSYMS_ALL is not set | 60 | # CONFIG_KALLSYMS_ALL is not set |
@@ -598,7 +597,7 @@ CONFIG_DEBUG_NOMMU_REGIONS=y | |||
598 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | 597 | # CONFIG_CONTEXT_SWITCH_TRACER is not set |
599 | # CONFIG_BOOT_TRACER is not set | 598 | # CONFIG_BOOT_TRACER is not set |
600 | # CONFIG_TRACE_BRANCH_PROFILING is not set | 599 | # CONFIG_TRACE_BRANCH_PROFILING is not set |
601 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | 600 | # CONFIG_DYNAMIC_DEBUG is not set |
602 | # CONFIG_SAMPLES is not set | 601 | # CONFIG_SAMPLES is not set |
603 | 602 | ||
604 | # | 603 | # |
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h index 6c3930397bd3..c8fac8d8190d 100644 --- a/arch/xtensa/include/asm/bitops.h +++ b/arch/xtensa/include/asm/bitops.h | |||
@@ -106,7 +106,7 @@ static inline unsigned long __fls(unsigned long word) | |||
106 | 106 | ||
107 | #include <asm-generic/bitops/fls64.h> | 107 | #include <asm-generic/bitops/fls64.h> |
108 | #include <asm-generic/bitops/find.h> | 108 | #include <asm-generic/bitops/find.h> |
109 | #include <asm-generic/bitops/ext2-non-atomic.h> | 109 | #include <asm-generic/bitops/le.h> |
110 | 110 | ||
111 | #ifdef __XTENSA_EL__ | 111 | #ifdef __XTENSA_EL__ |
112 | # define ext2_set_bit_atomic(lock,nr,addr) \ | 112 | # define ext2_set_bit_atomic(lock,nr,addr) \ |
@@ -125,7 +125,6 @@ static inline unsigned long __fls(unsigned long word) | |||
125 | #include <asm-generic/bitops/hweight.h> | 125 | #include <asm-generic/bitops/hweight.h> |
126 | #include <asm-generic/bitops/lock.h> | 126 | #include <asm-generic/bitops/lock.h> |
127 | #include <asm-generic/bitops/sched.h> | 127 | #include <asm-generic/bitops/sched.h> |
128 | #include <asm-generic/bitops/minix.h> | ||
129 | 128 | ||
130 | #endif /* __KERNEL__ */ | 129 | #endif /* __KERNEL__ */ |
131 | 130 | ||
diff --git a/arch/xtensa/include/asm/dma.h b/arch/xtensa/include/asm/dma.h index 137ca3945b07..bb099a373b5a 100644 --- a/arch/xtensa/include/asm/dma.h +++ b/arch/xtensa/include/asm/dma.h | |||
@@ -37,7 +37,7 @@ | |||
37 | * the size of the statically mapped kernel segment | 37 | * the size of the statically mapped kernel segment |
38 | * (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB. | 38 | * (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB. |
39 | * | 39 | * |
40 | * NOTE: When the entire KSEG area is DMA capable, we substract | 40 | * NOTE: When the entire KSEG area is DMA capable, we subtract |
41 | * one from the max address so that the virt_to_phys() macro | 41 | * one from the max address so that the virt_to_phys() macro |
42 | * works correctly on the address (otherwise the address | 42 | * works correctly on the address (otherwise the address |
43 | * enters another area, and virt_to_phys() may not return | 43 | * enters another area, and virt_to_phys() may not return |
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/asm/ioctls.h index ab1800012ed9..fd1d1369a407 100644 --- a/arch/xtensa/include/asm/ioctls.h +++ b/arch/xtensa/include/asm/ioctls.h | |||
@@ -98,7 +98,9 @@ | |||
98 | #define TCSETSF2 _IOW('T', 45, struct termios2) | 98 | #define TCSETSF2 _IOW('T', 45, struct termios2) |
99 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 99 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
100 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 100 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
101 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
101 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | 102 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ |
103 | #define TIOCVHANGUP _IO('T', 0x37) | ||
102 | 104 | ||
103 | #define TIOCSERCONFIG _IO('T', 83) | 105 | #define TIOCSERCONFIG _IO('T', 83) |
104 | #define TIOCSERGWILD _IOR('T', 84, int) | 106 | #define TIOCSERGWILD _IOR('T', 84, int) |
diff --git a/arch/xtensa/include/asm/irqflags.h b/arch/xtensa/include/asm/irqflags.h new file mode 100644 index 000000000000..dae9a8bdcb17 --- /dev/null +++ b/arch/xtensa/include/asm/irqflags.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Xtensa IRQ flags handling functions | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_IRQFLAGS_H | ||
12 | #define _XTENSA_IRQFLAGS_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | |||
16 | static inline unsigned long arch_local_save_flags(void) | ||
17 | { | ||
18 | unsigned long flags; | ||
19 | asm volatile("rsr %0,"__stringify(PS) : "=a" (flags)); | ||
20 | return flags; | ||
21 | } | ||
22 | |||
23 | static inline unsigned long arch_local_irq_save(void) | ||
24 | { | ||
25 | unsigned long flags; | ||
26 | asm volatile("rsil %0, "__stringify(LOCKLEVEL) | ||
27 | : "=a" (flags) :: "memory"); | ||
28 | return flags; | ||
29 | } | ||
30 | |||
31 | static inline void arch_local_irq_disable(void) | ||
32 | { | ||
33 | arch_local_irq_save(); | ||
34 | } | ||
35 | |||
36 | static inline void arch_local_irq_enable(void) | ||
37 | { | ||
38 | unsigned long flags; | ||
39 | asm volatile("rsil %0, 0" : "=a" (flags) :: "memory"); | ||
40 | } | ||
41 | |||
42 | static inline void arch_local_irq_restore(unsigned long flags) | ||
43 | { | ||
44 | asm volatile("wsr %0, "__stringify(PS)" ; rsync" | ||
45 | :: "a" (flags) : "memory"); | ||
46 | } | ||
47 | |||
48 | static inline bool arch_irqs_disabled_flags(unsigned long flags) | ||
49 | { | ||
50 | return (flags & 0xf) != 0; | ||
51 | } | ||
52 | |||
53 | static inline bool arch_irqs_disabled(void) | ||
54 | { | ||
55 | return arch_irqs_disabled_flags(arch_local_save_flags()); | ||
56 | } | ||
57 | |||
58 | #endif /* _XTENSA_IRQFLAGS_H */ | ||
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h index fca4db425f6e..30789010733d 100644 --- a/arch/xtensa/include/asm/mman.h +++ b/arch/xtensa/include/asm/mman.h | |||
@@ -83,6 +83,9 @@ | |||
83 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | 83 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ |
84 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | 84 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ |
85 | 85 | ||
86 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
87 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
88 | |||
86 | /* compatibility flags */ | 89 | /* compatibility flags */ |
87 | #define MAP_FILE 0 | 90 | #define MAP_FILE 0 |
88 | 91 | ||
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 161bb89e98c8..7a5591a71f85 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h | |||
@@ -171,10 +171,6 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*); | |||
171 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 171 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
172 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 172 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
173 | 173 | ||
174 | #ifdef CONFIG_MMU | ||
175 | #define WANT_PAGE_VIRTUAL | ||
176 | #endif | ||
177 | |||
178 | #endif /* __ASSEMBLY__ */ | 174 | #endif /* __ASSEMBLY__ */ |
179 | 175 | ||
180 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 176 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 76bf35554117..b03c043ce75b 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h | |||
@@ -324,10 +324,7 @@ ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | |||
324 | #define pte_offset_kernel(dir,addr) \ | 324 | #define pte_offset_kernel(dir,addr) \ |
325 | ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr)) | 325 | ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr)) |
326 | #define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr)) | 326 | #define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr)) |
327 | #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr)) | ||
328 | |||
329 | #define pte_unmap(pte) do { } while (0) | 327 | #define pte_unmap(pte) do { } while (0) |
330 | #define pte_unmap_nested(pte) do { } while (0) | ||
331 | 328 | ||
332 | 329 | ||
333 | /* | 330 | /* |
diff --git a/arch/xtensa/include/asm/rwsem.h b/arch/xtensa/include/asm/rwsem.h index e39edf5c86f2..249619e7e7f2 100644 --- a/arch/xtensa/include/asm/rwsem.h +++ b/arch/xtensa/include/asm/rwsem.h | |||
@@ -17,44 +17,12 @@ | |||
17 | #error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead." | 17 | #error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead." |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | #include <linux/list.h> | ||
21 | #include <linux/spinlock.h> | ||
22 | #include <asm/atomic.h> | ||
23 | #include <asm/system.h> | ||
24 | |||
25 | /* | ||
26 | * the semaphore definition | ||
27 | */ | ||
28 | struct rw_semaphore { | ||
29 | signed long count; | ||
30 | #define RWSEM_UNLOCKED_VALUE 0x00000000 | 20 | #define RWSEM_UNLOCKED_VALUE 0x00000000 |
31 | #define RWSEM_ACTIVE_BIAS 0x00000001 | 21 | #define RWSEM_ACTIVE_BIAS 0x00000001 |
32 | #define RWSEM_ACTIVE_MASK 0x0000ffff | 22 | #define RWSEM_ACTIVE_MASK 0x0000ffff |
33 | #define RWSEM_WAITING_BIAS (-0x00010000) | 23 | #define RWSEM_WAITING_BIAS (-0x00010000) |
34 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | 24 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS |
35 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 25 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
36 | spinlock_t wait_lock; | ||
37 | struct list_head wait_list; | ||
38 | }; | ||
39 | |||
40 | #define __RWSEM_INITIALIZER(name) \ | ||
41 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | ||
42 | LIST_HEAD_INIT((name).wait_list) } | ||
43 | |||
44 | #define DECLARE_RWSEM(name) \ | ||
45 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | ||
46 | |||
47 | extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); | ||
48 | extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); | ||
49 | extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); | ||
50 | extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); | ||
51 | |||
52 | static inline void init_rwsem(struct rw_semaphore *sem) | ||
53 | { | ||
54 | sem->count = RWSEM_UNLOCKED_VALUE; | ||
55 | spin_lock_init(&sem->wait_lock); | ||
56 | INIT_LIST_HEAD(&sem->wait_list); | ||
57 | } | ||
58 | 26 | ||
59 | /* | 27 | /* |
60 | * lock for reading | 28 | * lock for reading |
@@ -160,9 +128,4 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
160 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 128 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
161 | } | 129 | } |
162 | 130 | ||
163 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
164 | { | ||
165 | return (sem->count != 0); | ||
166 | } | ||
167 | |||
168 | #endif /* _XTENSA_RWSEM_H */ | 131 | #endif /* _XTENSA_RWSEM_H */ |
diff --git a/arch/xtensa/include/asm/system.h b/arch/xtensa/include/asm/system.h index 62b1e8f3c13c..1e7e09ab6cd7 100644 --- a/arch/xtensa/include/asm/system.h +++ b/arch/xtensa/include/asm/system.h | |||
@@ -12,41 +12,10 @@ | |||
12 | #define _XTENSA_SYSTEM_H | 12 | #define _XTENSA_SYSTEM_H |
13 | 13 | ||
14 | #include <linux/stringify.h> | 14 | #include <linux/stringify.h> |
15 | #include <linux/irqflags.h> | ||
15 | 16 | ||
16 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
17 | 18 | ||
18 | /* interrupt control */ | ||
19 | |||
20 | #define local_save_flags(x) \ | ||
21 | __asm__ __volatile__ ("rsr %0,"__stringify(PS) : "=a" (x)); | ||
22 | #define local_irq_restore(x) do { \ | ||
23 | __asm__ __volatile__ ("wsr %0, "__stringify(PS)" ; rsync" \ | ||
24 | :: "a" (x) : "memory"); } while(0); | ||
25 | #define local_irq_save(x) do { \ | ||
26 | __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL) \ | ||
27 | : "=a" (x) :: "memory");} while(0); | ||
28 | |||
29 | static inline void local_irq_disable(void) | ||
30 | { | ||
31 | unsigned long flags; | ||
32 | __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL) | ||
33 | : "=a" (flags) :: "memory"); | ||
34 | } | ||
35 | static inline void local_irq_enable(void) | ||
36 | { | ||
37 | unsigned long flags; | ||
38 | __asm__ __volatile__ ("rsil %0, 0" : "=a" (flags) :: "memory"); | ||
39 | |||
40 | } | ||
41 | |||
42 | static inline int irqs_disabled(void) | ||
43 | { | ||
44 | unsigned long flags; | ||
45 | local_save_flags(flags); | ||
46 | return flags & 0xf; | ||
47 | } | ||
48 | |||
49 | |||
50 | #define smp_read_barrier_depends() do { } while(0) | 19 | #define smp_read_barrier_depends() do { } while(0) |
51 | #define read_barrier_depends() do { } while(0) | 20 | #define read_barrier_depends() do { } while(0) |
52 | 21 | ||
diff --git a/arch/xtensa/include/asm/types.h b/arch/xtensa/include/asm/types.h index c89569a8da0c..b1c981e39b52 100644 --- a/arch/xtensa/include/asm/types.h +++ b/arch/xtensa/include/asm/types.h | |||
@@ -32,10 +32,6 @@ typedef unsigned short umode_t; | |||
32 | 32 | ||
33 | #define BITS_PER_LONG 32 | 33 | #define BITS_PER_LONG 32 |
34 | 34 | ||
35 | /* Dma addresses are 32-bits wide. */ | ||
36 | |||
37 | typedef u32 dma_addr_t; | ||
38 | |||
39 | #endif /* __KERNEL__ */ | 35 | #endif /* __KERNEL__ */ |
40 | #endif | 36 | #endif |
41 | 37 | ||
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index b8528426ab1f..5b0c18c1cce1 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * User space memory access functions | 4 | * User space memory access functions |
5 | * | 5 | * |
6 | * These routines provide basic accessing functions to the user memory | 6 | * These routines provide basic accessing functions to the user memory |
7 | * space for the kernel. This header file provides fuctions such as: | 7 | * space for the kernel. This header file provides functions such as: |
8 | * | 8 | * |
9 | * This file is subject to the terms and conditions of the GNU General Public | 9 | * This file is subject to the terms and conditions of the GNU General Public |
10 | * License. See the file "COPYING" in the main directory of this archive | 10 | * License. See the file "COPYING" in the main directory of this archive |
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index 528042c2951e..a6f934f37f1a 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h | |||
@@ -683,8 +683,10 @@ __SYSCALL(305, sys_ni_syscall, 0) | |||
683 | __SYSCALL(306, sys_eventfd, 1) | 683 | __SYSCALL(306, sys_eventfd, 1) |
684 | #define __NR_recvmmsg 307 | 684 | #define __NR_recvmmsg 307 |
685 | __SYSCALL(307, sys_recvmmsg, 5) | 685 | __SYSCALL(307, sys_recvmmsg, 5) |
686 | #define __NR_setns 308 | ||
687 | __SYSCALL(308, sys_setns, 2) | ||
686 | 688 | ||
687 | #define __NR_syscall_count 308 | 689 | #define __NR_syscall_count 309 |
688 | 690 | ||
689 | /* | 691 | /* |
690 | * sysxtensa syscall handler | 692 | * sysxtensa syscall handler |
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 5fd01f6aaf37..6223f3346b5c 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -1026,7 +1026,7 @@ ENTRY(fast_syscall_unrecoverable) | |||
1026 | * TRY adds an entry to the __ex_table fixup table for the immediately | 1026 | * TRY adds an entry to the __ex_table fixup table for the immediately |
1027 | * following instruction. | 1027 | * following instruction. |
1028 | * | 1028 | * |
1029 | * CATCH catches any exception that occurred at one of the preceeding TRY | 1029 | * CATCH catches any exception that occurred at one of the preceding TRY |
1030 | * statements and continues from there | 1030 | * statements and continues from there |
1031 | * | 1031 | * |
1032 | * Usage TRY l32i a0, a1, 0 | 1032 | * Usage TRY l32i a0, a1, 0 |
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index c64a5d387de5..4340ee076bd5 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
@@ -35,7 +35,6 @@ atomic_t irq_err_count; | |||
35 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | 35 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs) |
36 | { | 36 | { |
37 | struct pt_regs *old_regs = set_irq_regs(regs); | 37 | struct pt_regs *old_regs = set_irq_regs(regs); |
38 | struct irq_desc *desc = irq_desc + irq; | ||
39 | 38 | ||
40 | if (irq >= NR_IRQS) { | 39 | if (irq >= NR_IRQS) { |
41 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", | 40 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", |
@@ -57,104 +56,63 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | |||
57 | sp - sizeof(struct thread_info)); | 56 | sp - sizeof(struct thread_info)); |
58 | } | 57 | } |
59 | #endif | 58 | #endif |
60 | desc->handle_irq(irq, desc); | 59 | generic_handle_irq(irq); |
61 | 60 | ||
62 | irq_exit(); | 61 | irq_exit(); |
63 | set_irq_regs(old_regs); | 62 | set_irq_regs(old_regs); |
64 | } | 63 | } |
65 | 64 | ||
66 | /* | 65 | int arch_show_interrupts(struct seq_file *p, int prec) |
67 | * Generic, controller-independent functions: | ||
68 | */ | ||
69 | |||
70 | int show_interrupts(struct seq_file *p, void *v) | ||
71 | { | 66 | { |
72 | int i = *(loff_t *) v, j; | 67 | seq_printf(p, "%*s: ", prec, "ERR"); |
73 | struct irqaction * action; | 68 | seq_printf(p, "%10u\n", atomic_read(&irq_err_count)); |
74 | unsigned long flags; | ||
75 | |||
76 | if (i == 0) { | ||
77 | seq_printf(p, " "); | ||
78 | for_each_online_cpu(j) | ||
79 | seq_printf(p, "CPU%d ",j); | ||
80 | seq_putc(p, '\n'); | ||
81 | } | ||
82 | |||
83 | if (i < NR_IRQS) { | ||
84 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
85 | action = irq_desc[i].action; | ||
86 | if (!action) | ||
87 | goto skip; | ||
88 | seq_printf(p, "%3d: ",i); | ||
89 | #ifndef CONFIG_SMP | ||
90 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
91 | #else | ||
92 | for_each_online_cpu(j) | ||
93 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
94 | #endif | ||
95 | seq_printf(p, " %14s", irq_desc[i].chip->typename); | ||
96 | seq_printf(p, " %s", action->name); | ||
97 | |||
98 | for (action=action->next; action; action = action->next) | ||
99 | seq_printf(p, ", %s", action->name); | ||
100 | |||
101 | seq_putc(p, '\n'); | ||
102 | skip: | ||
103 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
104 | } else if (i == NR_IRQS) { | ||
105 | seq_printf(p, "NMI: "); | ||
106 | for_each_online_cpu(j) | ||
107 | seq_printf(p, "%10u ", nmi_count(j)); | ||
108 | seq_putc(p, '\n'); | ||
109 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); | ||
110 | } | ||
111 | return 0; | 69 | return 0; |
112 | } | 70 | } |
113 | 71 | ||
114 | static void xtensa_irq_mask(unsigned int irq) | 72 | static void xtensa_irq_mask(struct irq_data *d) |
115 | { | 73 | { |
116 | cached_irq_mask &= ~(1 << irq); | 74 | cached_irq_mask &= ~(1 << d->irq); |
117 | set_sr (cached_irq_mask, INTENABLE); | 75 | set_sr (cached_irq_mask, INTENABLE); |
118 | } | 76 | } |
119 | 77 | ||
120 | static void xtensa_irq_unmask(unsigned int irq) | 78 | static void xtensa_irq_unmask(struct irq_data *d) |
121 | { | 79 | { |
122 | cached_irq_mask |= 1 << irq; | 80 | cached_irq_mask |= 1 << d->irq; |
123 | set_sr (cached_irq_mask, INTENABLE); | 81 | set_sr (cached_irq_mask, INTENABLE); |
124 | } | 82 | } |
125 | 83 | ||
126 | static void xtensa_irq_enable(unsigned int irq) | 84 | static void xtensa_irq_enable(struct irq_data *d) |
127 | { | 85 | { |
128 | variant_irq_enable(irq); | 86 | variant_irq_enable(d->irq); |
129 | xtensa_irq_unmask(irq); | 87 | xtensa_irq_unmask(d->irq); |
130 | } | 88 | } |
131 | 89 | ||
132 | static void xtensa_irq_disable(unsigned int irq) | 90 | static void xtensa_irq_disable(struct irq_data *d) |
133 | { | 91 | { |
134 | xtensa_irq_mask(irq); | 92 | xtensa_irq_mask(d->irq); |
135 | variant_irq_disable(irq); | 93 | variant_irq_disable(d->irq); |
136 | } | 94 | } |
137 | 95 | ||
138 | static void xtensa_irq_ack(unsigned int irq) | 96 | static void xtensa_irq_ack(struct irq_data *d) |
139 | { | 97 | { |
140 | set_sr(1 << irq, INTCLEAR); | 98 | set_sr(1 << d->irq, INTCLEAR); |
141 | } | 99 | } |
142 | 100 | ||
143 | static int xtensa_irq_retrigger(unsigned int irq) | 101 | static int xtensa_irq_retrigger(struct irq_data *d) |
144 | { | 102 | { |
145 | set_sr (1 << irq, INTSET); | 103 | set_sr (1 << d->irq, INTSET); |
146 | return 1; | 104 | return 1; |
147 | } | 105 | } |
148 | 106 | ||
149 | 107 | ||
150 | static struct irq_chip xtensa_irq_chip = { | 108 | static struct irq_chip xtensa_irq_chip = { |
151 | .name = "xtensa", | 109 | .name = "xtensa", |
152 | .enable = xtensa_irq_enable, | 110 | .irq_enable = xtensa_irq_enable, |
153 | .disable = xtensa_irq_disable, | 111 | .irq_disable = xtensa_irq_disable, |
154 | .mask = xtensa_irq_mask, | 112 | .irq_mask = xtensa_irq_mask, |
155 | .unmask = xtensa_irq_unmask, | 113 | .irq_unmask = xtensa_irq_unmask, |
156 | .ack = xtensa_irq_ack, | 114 | .irq_ack = xtensa_irq_ack, |
157 | .retrigger = xtensa_irq_retrigger, | 115 | .irq_retrigger = xtensa_irq_retrigger, |
158 | }; | 116 | }; |
159 | 117 | ||
160 | void __init init_IRQ(void) | 118 | void __init init_IRQ(void) |
@@ -165,25 +123,25 @@ void __init init_IRQ(void) | |||
165 | int mask = 1 << index; | 123 | int mask = 1 << index; |
166 | 124 | ||
167 | if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) | 125 | if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) |
168 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 126 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
169 | handle_simple_irq); | 127 | handle_simple_irq); |
170 | 128 | ||
171 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) | 129 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) |
172 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 130 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
173 | handle_edge_irq); | 131 | handle_edge_irq); |
174 | 132 | ||
175 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) | 133 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) |
176 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 134 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
177 | handle_level_irq); | 135 | handle_level_irq); |
178 | 136 | ||
179 | else if (mask & XCHAL_INTTYPE_MASK_TIMER) | 137 | else if (mask & XCHAL_INTTYPE_MASK_TIMER) |
180 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 138 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
181 | handle_edge_irq); | 139 | handle_edge_irq); |
182 | 140 | ||
183 | else /* XCHAL_INTTYPE_MASK_WRITE_ERROR */ | 141 | else /* XCHAL_INTTYPE_MASK_WRITE_ERROR */ |
184 | /* XCHAL_INTTYPE_MASK_NMI */ | 142 | /* XCHAL_INTTYPE_MASK_NMI */ |
185 | 143 | ||
186 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 144 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
187 | handle_level_irq); | 145 | handle_level_irq); |
188 | } | 146 | } |
189 | 147 | ||
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 9d4e1ceb3f09..c72c9473ef99 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -256,9 +256,11 @@ int ptrace_pokeusr(struct task_struct *child, long regno, long val) | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 259 | long arch_ptrace(struct task_struct *child, long request, |
260 | unsigned long addr, unsigned long data) | ||
260 | { | 261 | { |
261 | int ret = -EPERM; | 262 | int ret = -EPERM; |
263 | void __user *datap = (void __user *) data; | ||
262 | 264 | ||
263 | switch (request) { | 265 | switch (request) { |
264 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | 266 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
@@ -267,7 +269,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
267 | break; | 269 | break; |
268 | 270 | ||
269 | case PTRACE_PEEKUSR: /* read register specified by addr. */ | 271 | case PTRACE_PEEKUSR: /* read register specified by addr. */ |
270 | ret = ptrace_peekusr(child, addr, (void __user *) data); | 272 | ret = ptrace_peekusr(child, addr, datap); |
271 | break; | 273 | break; |
272 | 274 | ||
273 | case PTRACE_POKETEXT: /* write the word at location addr. */ | 275 | case PTRACE_POKETEXT: /* write the word at location addr. */ |
@@ -280,19 +282,19 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
280 | break; | 282 | break; |
281 | 283 | ||
282 | case PTRACE_GETREGS: | 284 | case PTRACE_GETREGS: |
283 | ret = ptrace_getregs(child, (void __user *) data); | 285 | ret = ptrace_getregs(child, datap); |
284 | break; | 286 | break; |
285 | 287 | ||
286 | case PTRACE_SETREGS: | 288 | case PTRACE_SETREGS: |
287 | ret = ptrace_setregs(child, (void __user *) data); | 289 | ret = ptrace_setregs(child, datap); |
288 | break; | 290 | break; |
289 | 291 | ||
290 | case PTRACE_GETXTREGS: | 292 | case PTRACE_GETXTREGS: |
291 | ret = ptrace_getxregs(child, (void __user *) data); | 293 | ret = ptrace_getxregs(child, datap); |
292 | break; | 294 | break; |
293 | 295 | ||
294 | case PTRACE_SETXTREGS: | 296 | case PTRACE_SETXTREGS: |
295 | ret = ptrace_setxregs(child, (void __user *) data); | 297 | ret = ptrace_setxregs(child, datap); |
296 | break; | 298 | break; |
297 | 299 | ||
298 | default: | 300 | default: |
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 19df764f6399..f3e5eb43f71c 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c | |||
@@ -96,16 +96,12 @@ again: | |||
96 | update_process_times(user_mode(get_irq_regs())); | 96 | update_process_times(user_mode(get_irq_regs())); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | write_seqlock(&xtime_lock); | 99 | xtime_update(1); /* Linux handler in kernel/time/timekeeping */ |
100 | |||
101 | do_timer(1); /* Linux handler in kernel/timer.c */ | ||
102 | 100 | ||
103 | /* Note that writing CCOMPARE clears the interrupt. */ | 101 | /* Note that writing CCOMPARE clears the interrupt. */ |
104 | 102 | ||
105 | next += CCOUNT_PER_JIFFY; | 103 | next += CCOUNT_PER_JIFFY; |
106 | set_linux_timer(next); | 104 | set_linux_timer(next); |
107 | |||
108 | write_sequnlock(&xtime_lock); | ||
109 | } | 105 | } |
110 | 106 | ||
111 | /* Allow platform to do something useful (Wdog). */ | 107 | /* Allow platform to do something useful (Wdog). */ |
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 9b526154c9ba..88ecea3facb4 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -155,7 +155,7 @@ SECTIONS | |||
155 | INIT_RAM_FS | 155 | INIT_RAM_FS |
156 | } | 156 | } |
157 | 157 | ||
158 | PERCPU(PAGE_SIZE) | 158 | PERCPU_SECTION(XCHAL_ICACHE_LINESIZE) |
159 | 159 | ||
160 | /* We need this dummy segment here */ | 160 | /* We need this dummy segment here */ |
161 | 161 | ||
diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c index 4bb91a970f1f..ca81654f3ec2 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c | |||
@@ -14,8 +14,6 @@ | |||
14 | #include <asm/mmu_context.h> | 14 | #include <asm/mmu_context.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | 16 | ||
17 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | ||
18 | |||
19 | void __init paging_init(void) | 17 | void __init paging_init(void) |
20 | { | 18 | { |
21 | memset(swapper_pg_dir, 0, PAGE_SIZE); | 19 | memset(swapper_pg_dir, 0, PAGE_SIZE); |
diff --git a/arch/xtensa/mm/pgtable.c b/arch/xtensa/mm/pgtable.c deleted file mode 100644 index 697992738205..000000000000 --- a/arch/xtensa/mm/pgtable.c +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* | ||
2 | * arch/xtensa/mm/pgtable.c | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | * | ||
10 | * Chris Zankel <chris@zankel.net> | ||
11 | */ | ||
12 | |||
13 | #if (DCACHE_SIZE > PAGE_SIZE) | ||
14 | |||
15 | pte_t* pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | ||
16 | { | ||
17 | pte_t *pte = NULL, *p; | ||
18 | int color = ADDR_COLOR(address); | ||
19 | int i; | ||
20 | |||
21 | p = (pte_t*) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, COLOR_ORDER); | ||
22 | |||
23 | if (likely(p)) { | ||
24 | split_page(virt_to_page(p), COLOR_ORDER); | ||
25 | |||
26 | for (i = 0; i < COLOR_SIZE; i++) { | ||
27 | if (ADDR_COLOR(p) == color) | ||
28 | pte = p; | ||
29 | else | ||
30 | free_page(p); | ||
31 | p += PTRS_PER_PTE; | ||
32 | } | ||
33 | clear_page(pte); | ||
34 | } | ||
35 | return pte; | ||
36 | } | ||
37 | |||
38 | #ifdef PROFILING | ||
39 | |||
40 | int mask; | ||
41 | int hit; | ||
42 | int flush; | ||
43 | |||
44 | #endif | ||
45 | |||
46 | struct page* pte_alloc_one(struct mm_struct *mm, unsigned long address) | ||
47 | { | ||
48 | struct page *page = NULL, *p; | ||
49 | int color = ADDR_COLOR(address); | ||
50 | |||
51 | p = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); | ||
52 | |||
53 | if (likely(p)) { | ||
54 | split_page(p, COLOR_ORDER); | ||
55 | |||
56 | for (i = 0; i < PAGE_ORDER; i++) { | ||
57 | if (PADDR_COLOR(page_address(p)) == color) | ||
58 | page = p; | ||
59 | else | ||
60 | __free_page(p); | ||
61 | p++; | ||
62 | } | ||
63 | clear_highpage(page); | ||
64 | } | ||
65 | |||
66 | return page; | ||
67 | } | ||
68 | |||
69 | #endif | ||
70 | |||
71 | |||
72 | |||
diff --git a/arch/xtensa/platforms/s6105/device.c b/arch/xtensa/platforms/s6105/device.c index 65333ffefb07..4f4fc971042f 100644 --- a/arch/xtensa/platforms/s6105/device.c +++ b/arch/xtensa/platforms/s6105/device.c | |||
@@ -120,7 +120,7 @@ static int __init prepare_phy_irq(int pin) | |||
120 | irq = gpio_to_irq(pin); | 120 | irq = gpio_to_irq(pin); |
121 | if (irq < 0) | 121 | if (irq < 0) |
122 | goto free; | 122 | goto free; |
123 | if (set_irq_type(irq, IRQ_TYPE_LEVEL_LOW) < 0) | 123 | if (irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW) < 0) |
124 | goto free; | 124 | goto free; |
125 | return irq; | 125 | return irq; |
126 | free: | 126 | free: |
diff --git a/arch/xtensa/variants/s6000/gpio.c b/arch/xtensa/variants/s6000/gpio.c index 380a70fff756..7af0757e001b 100644 --- a/arch/xtensa/variants/s6000/gpio.c +++ b/arch/xtensa/variants/s6000/gpio.c | |||
@@ -85,30 +85,29 @@ int s6_gpio_init(u32 afsel) | |||
85 | return gpiochip_add(&gpiochip); | 85 | return gpiochip_add(&gpiochip); |
86 | } | 86 | } |
87 | 87 | ||
88 | static void ack(unsigned int irq) | 88 | static void ack(struct irq_data *d) |
89 | { | 89 | { |
90 | writeb(1 << (irq - IRQ_BASE), S6_REG_GPIO + S6_GPIO_IC); | 90 | writeb(1 << (d->irq - IRQ_BASE), S6_REG_GPIO + S6_GPIO_IC); |
91 | } | 91 | } |
92 | 92 | ||
93 | static void mask(unsigned int irq) | 93 | static void mask(struct irq_data *d) |
94 | { | 94 | { |
95 | u8 r = readb(S6_REG_GPIO + S6_GPIO_IE); | 95 | u8 r = readb(S6_REG_GPIO + S6_GPIO_IE); |
96 | r &= ~(1 << (irq - IRQ_BASE)); | 96 | r &= ~(1 << (d->irq - IRQ_BASE)); |
97 | writeb(r, S6_REG_GPIO + S6_GPIO_IE); | 97 | writeb(r, S6_REG_GPIO + S6_GPIO_IE); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void unmask(unsigned int irq) | 100 | static void unmask(struct irq_data *d) |
101 | { | 101 | { |
102 | u8 m = readb(S6_REG_GPIO + S6_GPIO_IE); | 102 | u8 m = readb(S6_REG_GPIO + S6_GPIO_IE); |
103 | m |= 1 << (irq - IRQ_BASE); | 103 | m |= 1 << (d->irq - IRQ_BASE); |
104 | writeb(m, S6_REG_GPIO + S6_GPIO_IE); | 104 | writeb(m, S6_REG_GPIO + S6_GPIO_IE); |
105 | } | 105 | } |
106 | 106 | ||
107 | static int set_type(unsigned int irq, unsigned int type) | 107 | static int set_type(struct irq_data *d, unsigned int type) |
108 | { | 108 | { |
109 | const u8 m = 1 << (irq - IRQ_BASE); | 109 | const u8 m = 1 << (d->irq - IRQ_BASE); |
110 | irq_flow_handler_t handler; | 110 | irq_flow_handler_t handler; |
111 | struct irq_desc *desc; | ||
112 | u8 reg; | 111 | u8 reg; |
113 | 112 | ||
114 | if (type == IRQ_TYPE_PROBE) { | 113 | if (type == IRQ_TYPE_PROBE) { |
@@ -129,8 +128,7 @@ static int set_type(unsigned int irq, unsigned int type) | |||
129 | handler = handle_edge_irq; | 128 | handler = handle_edge_irq; |
130 | } | 129 | } |
131 | writeb(reg, S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_IS); | 130 | writeb(reg, S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_IS); |
132 | desc = irq_to_desc(irq); | 131 | __irq_set_handler_locked(irq, handler); |
133 | desc->handle_irq = handler; | ||
134 | 132 | ||
135 | reg = readb(S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_IEV); | 133 | reg = readb(S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_IEV); |
136 | if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)) | 134 | if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)) |
@@ -150,22 +148,23 @@ static int set_type(unsigned int irq, unsigned int type) | |||
150 | 148 | ||
151 | static struct irq_chip gpioirqs = { | 149 | static struct irq_chip gpioirqs = { |
152 | .name = "GPIO", | 150 | .name = "GPIO", |
153 | .ack = ack, | 151 | .irq_ack = ack, |
154 | .mask = mask, | 152 | .irq_mask = mask, |
155 | .unmask = unmask, | 153 | .irq_unmask = unmask, |
156 | .set_type = set_type, | 154 | .irq_set_type = set_type, |
157 | }; | 155 | }; |
158 | 156 | ||
159 | static u8 demux_masks[4]; | 157 | static u8 demux_masks[4]; |
160 | 158 | ||
161 | static void demux_irqs(unsigned int irq, struct irq_desc *desc) | 159 | static void demux_irqs(unsigned int irq, struct irq_desc *desc) |
162 | { | 160 | { |
163 | u8 *mask = get_irq_desc_data(desc); | 161 | struct irq_chip *chip = irq_desc_get_chip(desc); |
162 | u8 *mask = irq_desc_get_handler_data(desc); | ||
164 | u8 pending; | 163 | u8 pending; |
165 | int cirq; | 164 | int cirq; |
166 | 165 | ||
167 | desc->chip->mask(irq); | 166 | chip->irq_mask(&desc->irq_data); |
168 | desc->chip->ack(irq); | 167 | chip->irq_ack(&desc->irq_data)); |
169 | pending = readb(S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_MIS) & *mask; | 168 | pending = readb(S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_MIS) & *mask; |
170 | cirq = IRQ_BASE - 1; | 169 | cirq = IRQ_BASE - 1; |
171 | while (pending) { | 170 | while (pending) { |
@@ -174,7 +173,7 @@ static void demux_irqs(unsigned int irq, struct irq_desc *desc) | |||
174 | pending >>= n; | 173 | pending >>= n; |
175 | generic_handle_irq(cirq); | 174 | generic_handle_irq(cirq); |
176 | } | 175 | } |
177 | desc->chip->unmask(irq); | 176 | chip->irq_unmask(&desc->irq_data)); |
178 | } | 177 | } |
179 | 178 | ||
180 | extern const signed char *platform_irq_mappings[XTENSA_NR_IRQS]; | 179 | extern const signed char *platform_irq_mappings[XTENSA_NR_IRQS]; |
@@ -219,11 +218,11 @@ void __init variant_init_irq(void) | |||
219 | i = ffs(mask); | 218 | i = ffs(mask); |
220 | cirq += i; | 219 | cirq += i; |
221 | mask >>= i; | 220 | mask >>= i; |
222 | set_irq_chip(cirq, &gpioirqs); | 221 | irq_set_chip(cirq, &gpioirqs); |
223 | set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); | 222 | irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); |
224 | } while (mask); | 223 | } while (mask); |
225 | set_irq_data(irq, demux_masks + n); | 224 | irq_set_handler_data(irq, demux_masks + n); |
226 | set_irq_chained_handler(irq, demux_irqs); | 225 | irq_set_chained_handler(irq, demux_irqs); |
227 | if (++n == ARRAY_SIZE(demux_masks)) | 226 | if (++n == ARRAY_SIZE(demux_masks)) |
228 | break; | 227 | break; |
229 | } | 228 | } |