aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-avr32')
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap700x.h (renamed from include/asm-avr32/arch-at32ap/at32ap7000.h)8
-rw-r--r--include/asm-avr32/arch-at32ap/cpu.h3
-rw-r--r--include/asm-avr32/arch-at32ap/gpio.h34
-rw-r--r--include/asm-avr32/arch-at32ap/io.h4
-rw-r--r--include/asm-avr32/arch-at32ap/irq.h4
-rw-r--r--include/asm-avr32/delay.h2
-rw-r--r--include/asm-avr32/irq.h5
-rw-r--r--include/asm-avr32/kdebug.h1
-rw-r--r--include/asm-avr32/ocd.h5
-rw-r--r--include/asm-avr32/pgalloc.h6
-rw-r--r--include/asm-avr32/processor.h14
-rw-r--r--include/asm-avr32/ptrace.h13
-rw-r--r--include/asm-avr32/setup.h2
-rw-r--r--include/asm-avr32/socket.h2
-rw-r--r--include/asm-avr32/thread_info.h1
-rw-r--r--include/asm-avr32/timex.h3
-rw-r--r--include/asm-avr32/unistd.h2
17 files changed, 78 insertions, 31 deletions
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap700x.h
index 3914d7b94ff4..31e48b0e7324 100644
--- a/include/asm-avr32/arch-at32ap/at32ap7000.h
+++ b/include/asm-avr32/arch-at32ap/at32ap700x.h
@@ -7,14 +7,12 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#ifndef __ASM_ARCH_AT32AP7000_H__ 10#ifndef __ASM_ARCH_AT32AP700X_H__
11#define __ASM_ARCH_AT32AP7000_H__ 11#define __ASM_ARCH_AT32AP700X_H__
12 12
13#define GPIO_PERIPH_A 0 13#define GPIO_PERIPH_A 0
14#define GPIO_PERIPH_B 1 14#define GPIO_PERIPH_B 1
15 15
16#define NR_GPIO_CONTROLLERS 4
17
18/* 16/*
19 * Pin numbers identifying specific GPIO pins on the chip. They can 17 * Pin numbers identifying specific GPIO pins on the chip. They can
20 * also be converted to IRQ numbers by passing them through 18 * also be converted to IRQ numbers by passing them through
@@ -32,4 +30,4 @@
32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N)) 30#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N)) 31#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
34 32
35#endif /* __ASM_ARCH_AT32AP7000_H__ */ 33#endif /* __ASM_ARCH_AT32AP700X_H__ */
diff --git a/include/asm-avr32/arch-at32ap/cpu.h b/include/asm-avr32/arch-at32ap/cpu.h
index a762f42cbb71..44d0bfa1f409 100644
--- a/include/asm-avr32/arch-at32ap/cpu.h
+++ b/include/asm-avr32/arch-at32ap/cpu.h
@@ -14,7 +14,7 @@
14 * Only AT32AP7000 is defined for now. We can identify the specific 14 * Only AT32AP7000 is defined for now. We can identify the specific
15 * chip at runtime, but I'm not sure if it's really worth it. 15 * chip at runtime, but I'm not sure if it's really worth it.
16 */ 16 */
17#ifdef CONFIG_CPU_AT32AP7000 17#ifdef CONFIG_CPU_AT32AP700X
18# define cpu_is_at32ap7000() (1) 18# define cpu_is_at32ap7000() (1)
19#else 19#else
20# define cpu_is_at32ap7000() (0) 20# define cpu_is_at32ap7000() (0)
@@ -30,5 +30,6 @@
30#define cpu_is_at91sam9261() (0) 30#define cpu_is_at91sam9261() (0)
31#define cpu_is_at91sam9263() (0) 31#define cpu_is_at91sam9263() (0)
32#define cpu_is_at91sam9rl() (0) 32#define cpu_is_at91sam9rl() (0)
33#define cpu_is_at91cap9() (0)
33 34
34#endif /* __ASM_ARCH_CPU_H */ 35#endif /* __ASM_ARCH_CPU_H */
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h
index af7f9535bab3..0180f584ef03 100644
--- a/include/asm-avr32/arch-at32ap/gpio.h
+++ b/include/asm-avr32/arch-at32ap/gpio.h
@@ -5,20 +5,36 @@
5#include <asm/irq.h> 5#include <asm/irq.h>
6 6
7 7
8/* Arch-neutral GPIO API */ 8/* Some GPIO chips can manage IRQs; some can't. The exact numbers can
9int __must_check gpio_request(unsigned int gpio, const char *label); 9 * be changed if needed, but for the moment they're not configurable.
10void gpio_free(unsigned int gpio); 10 */
11#define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32)
11 12
12int gpio_direction_input(unsigned int gpio);
13int gpio_direction_output(unsigned int gpio, int value);
14int gpio_get_value(unsigned int gpio);
15void gpio_set_value(unsigned int gpio, int value);
16 13
17#include <asm-generic/gpio.h> /* cansleep wrappers */ 14/* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */
15#include <asm-generic/gpio.h>
16
17static inline int gpio_get_value(unsigned int gpio)
18{
19 return __gpio_get_value(gpio);
20}
21
22static inline void gpio_set_value(unsigned int gpio, int value)
23{
24 __gpio_set_value(gpio, value);
25}
26
27static inline int gpio_cansleep(unsigned int gpio)
28{
29 return __gpio_cansleep(gpio);
30}
31
18 32
19static inline int gpio_to_irq(unsigned int gpio) 33static inline int gpio_to_irq(unsigned int gpio)
20{ 34{
21 return gpio + GPIO_IRQ_BASE; 35 if (gpio < NR_GPIO_IRQS)
36 return gpio + GPIO_IRQ_BASE;
37 return -EINVAL;
22} 38}
23 39
24static inline int irq_to_gpio(unsigned int irq) 40static inline int irq_to_gpio(unsigned int irq)
diff --git a/include/asm-avr32/arch-at32ap/io.h b/include/asm-avr32/arch-at32ap/io.h
index ee59e401f041..4ec6abc68ea3 100644
--- a/include/asm-avr32/arch-at32ap/io.h
+++ b/include/asm-avr32/arch-at32ap/io.h
@@ -4,7 +4,7 @@
4/* For "bizarre" halfword swapping */ 4/* For "bizarre" halfword swapping */
5#include <linux/byteorder/swabb.h> 5#include <linux/byteorder/swabb.h>
6 6
7#if defined(CONFIG_AP7000_32_BIT_SMC) 7#if defined(CONFIG_AP700X_32_BIT_SMC)
8# define __swizzle_addr_b(addr) (addr ^ 3UL) 8# define __swizzle_addr_b(addr) (addr ^ 3UL)
9# define __swizzle_addr_w(addr) (addr ^ 2UL) 9# define __swizzle_addr_w(addr) (addr ^ 2UL)
10# define __swizzle_addr_l(addr) (addr) 10# define __swizzle_addr_l(addr) (addr)
@@ -14,7 +14,7 @@
14# define __mem_ioswabb(a, x) (x) 14# define __mem_ioswabb(a, x) (x)
15# define __mem_ioswabw(a, x) swab16(x) 15# define __mem_ioswabw(a, x) swab16(x)
16# define __mem_ioswabl(a, x) swab32(x) 16# define __mem_ioswabl(a, x) swab32(x)
17#elif defined(CONFIG_AP7000_16_BIT_SMC) 17#elif defined(CONFIG_AP700X_16_BIT_SMC)
18# define __swizzle_addr_b(addr) (addr ^ 1UL) 18# define __swizzle_addr_b(addr) (addr ^ 1UL)
19# define __swizzle_addr_w(addr) (addr) 19# define __swizzle_addr_w(addr) (addr)
20# define __swizzle_addr_l(addr) (addr) 20# define __swizzle_addr_l(addr) (addr)
diff --git a/include/asm-avr32/arch-at32ap/irq.h b/include/asm-avr32/arch-at32ap/irq.h
index 5adffab9a577..608e350368c7 100644
--- a/include/asm-avr32/arch-at32ap/irq.h
+++ b/include/asm-avr32/arch-at32ap/irq.h
@@ -3,11 +3,11 @@
3 3
4#define EIM_IRQ_BASE NR_INTERNAL_IRQS 4#define EIM_IRQ_BASE NR_INTERNAL_IRQS
5#define NR_EIM_IRQS 32 5#define NR_EIM_IRQS 32
6
7#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n)) 6#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n))
8 7
9#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS) 8#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS)
10#define NR_GPIO_IRQS (5 * 32) 9#define NR_GPIO_CTLR (5 /*internal*/ + 1 /*external*/)
10#define NR_GPIO_IRQS (NR_GPIO_CTLR * 32)
11 11
12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS) 12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS)
13 13
diff --git a/include/asm-avr32/delay.h b/include/asm-avr32/delay.h
index cc3b2e3343b3..a0ed9a9839a5 100644
--- a/include/asm-avr32/delay.h
+++ b/include/asm-avr32/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
12 12
13extern void __udelay(unsigned long usecs); 13extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long nsecs); 14extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs); 15extern void __const_udelay(unsigned long xloops);
16extern void __delay(unsigned long loops); 16extern void __delay(unsigned long loops);
17 17
18#define udelay(n) (__builtin_constant_p(n) ? \ 18#define udelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h
index 83e6549d7783..9315724c0596 100644
--- a/include/asm-avr32/irq.h
+++ b/include/asm-avr32/irq.h
@@ -11,4 +11,9 @@
11 11
12#define irq_canonicalize(i) (i) 12#define irq_canonicalize(i) (i)
13 13
14#ifndef __ASSEMBLER__
15int nmi_enable(void);
16void nmi_disable(void);
17#endif
18
14#endif /* __ASM_AVR32_IOCTLS_H */ 19#endif /* __ASM_AVR32_IOCTLS_H */
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h
index fd7e99046b2f..ca4f9542365a 100644
--- a/include/asm-avr32/kdebug.h
+++ b/include/asm-avr32/kdebug.h
@@ -5,6 +5,7 @@
5enum die_val { 5enum die_val {
6 DIE_BREAKPOINT, 6 DIE_BREAKPOINT,
7 DIE_SSTEP, 7 DIE_SSTEP,
8 DIE_NMI,
8}; 9};
9 10
10#endif /* __ASM_AVR32_KDEBUG_H */ 11#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/include/asm-avr32/ocd.h b/include/asm-avr32/ocd.h
index 996405e0393f..6bef09490235 100644
--- a/include/asm-avr32/ocd.h
+++ b/include/asm-avr32/ocd.h
@@ -533,6 +533,11 @@ static inline void __ocd_write(unsigned int reg, unsigned long value)
533#define ocd_read(reg) __ocd_read(OCD_##reg) 533#define ocd_read(reg) __ocd_read(OCD_##reg)
534#define ocd_write(reg, value) __ocd_write(OCD_##reg, value) 534#define ocd_write(reg, value) __ocd_write(OCD_##reg, value)
535 535
536struct task_struct;
537
538void ocd_enable(struct task_struct *child);
539void ocd_disable(struct task_struct *child);
540
536#endif /* !__ASSEMBLER__ */ 541#endif /* !__ASSEMBLER__ */
537 542
538#endif /* __ASM_AVR32_OCD_H */ 543#endif /* __ASM_AVR32_OCD_H */
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h
index 0e680f47209f..b77e364b4c44 100644
--- a/include/asm-avr32/pgalloc.h
+++ b/include/asm-avr32/pgalloc.h
@@ -30,7 +30,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
30 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); 30 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
31} 31}
32 32
33static inline void pgd_free(pgd_t *pgd) 33static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
34{ 34{
35 kfree(pgd); 35 kfree(pgd);
36} 36}
@@ -55,12 +55,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
55 return pte; 55 return pte;
56} 56}
57 57
58static inline void pte_free_kernel(pte_t *pte) 58static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
59{ 59{
60 free_page((unsigned long)pte); 60 free_page((unsigned long)pte);
61} 61}
62 62
63static inline void pte_free(struct page *pte) 63static inline void pte_free(struct mm_struct *mm, struct page *pte)
64{ 64{
65 __free_page(pte); 65 __free_page(pte);
66} 66}
diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h
index a52576b25afe..4212551c1cd9 100644
--- a/include/asm-avr32/processor.h
+++ b/include/asm-avr32/processor.h
@@ -57,11 +57,25 @@ struct avr32_cpuinfo {
57 unsigned short cpu_revision; 57 unsigned short cpu_revision;
58 enum tlb_config tlb_config; 58 enum tlb_config tlb_config;
59 unsigned long features; 59 unsigned long features;
60 u32 device_id;
60 61
61 struct cache_info icache; 62 struct cache_info icache;
62 struct cache_info dcache; 63 struct cache_info dcache;
63}; 64};
64 65
66static inline unsigned int avr32_get_manufacturer_id(struct avr32_cpuinfo *cpu)
67{
68 return (cpu->device_id >> 1) & 0x7f;
69}
70static inline unsigned int avr32_get_product_number(struct avr32_cpuinfo *cpu)
71{
72 return (cpu->device_id >> 12) & 0xffff;
73}
74static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu)
75{
76 return (cpu->device_id >> 28) & 0x0f;
77}
78
65extern struct avr32_cpuinfo boot_cpu_data; 79extern struct avr32_cpuinfo boot_cpu_data;
66 80
67#ifdef CONFIG_SMP 81#ifdef CONFIG_SMP
diff --git a/include/asm-avr32/ptrace.h b/include/asm-avr32/ptrace.h
index 8c5dba5e33df..9e2d44f4e0fe 100644
--- a/include/asm-avr32/ptrace.h
+++ b/include/asm-avr32/ptrace.h
@@ -121,7 +121,15 @@ struct pt_regs {
121}; 121};
122 122
123#ifdef __KERNEL__ 123#ifdef __KERNEL__
124# define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER) 124
125#include <asm/ocd.h>
126
127#define arch_ptrace_attach(child) ocd_enable(child)
128
129#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
130#define instruction_pointer(regs) ((regs)->pc)
131#define profile_pc(regs) instruction_pointer(regs)
132
125extern void show_regs (struct pt_regs *); 133extern void show_regs (struct pt_regs *);
126 134
127static __inline__ int valid_user_regs(struct pt_regs *regs) 135static __inline__ int valid_user_regs(struct pt_regs *regs)
@@ -141,9 +149,6 @@ static __inline__ int valid_user_regs(struct pt_regs *regs)
141 return 0; 149 return 0;
142} 150}
143 151
144#define instruction_pointer(regs) ((regs)->pc)
145
146#define profile_pc(regs) instruction_pointer(regs)
147 152
148#endif /* __KERNEL__ */ 153#endif /* __KERNEL__ */
149 154
diff --git a/include/asm-avr32/setup.h b/include/asm-avr32/setup.h
index b0828d43e110..ea3070ff13a5 100644
--- a/include/asm-avr32/setup.h
+++ b/include/asm-avr32/setup.h
@@ -110,7 +110,7 @@ struct tagtable {
110 int (*parse)(struct tag *); 110 int (*parse)(struct tag *);
111}; 111};
112 112
113#define __tag __attribute_used__ __attribute__((__section__(".taglist.init"))) 113#define __tag __used __attribute__((__section__(".taglist.init")))
114#define __tagtable(tag, fn) \ 114#define __tagtable(tag, fn) \
115 static struct tagtable __tagtable_##fn __tag = { tag, fn } 115 static struct tagtable __tagtable_##fn __tag = { tag, fn }
116 116
diff --git a/include/asm-avr32/socket.h b/include/asm-avr32/socket.h
index a0d0507a5034..35863f260929 100644
--- a/include/asm-avr32/socket.h
+++ b/include/asm-avr32/socket.h
@@ -52,4 +52,6 @@
52#define SO_TIMESTAMPNS 35 52#define SO_TIMESTAMPNS 35
53#define SCM_TIMESTAMPNS SO_TIMESTAMPNS 53#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
54 54
55#define SO_MARK 36
56
55#endif /* __ASM_AVR32_SOCKET_H */ 57#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/include/asm-avr32/thread_info.h b/include/asm-avr32/thread_info.h
index 184b574289b4..07049f6c0d41 100644
--- a/include/asm-avr32/thread_info.h
+++ b/include/asm-avr32/thread_info.h
@@ -88,6 +88,7 @@ static inline struct thread_info *current_thread_info(void)
88#define TIF_MEMDIE 6 88#define TIF_MEMDIE 6
89#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */ 89#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */
90#define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */ 90#define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */
91#define TIF_DEBUG 30 /* debugging enabled */
91#define TIF_USERSPACE 31 /* true if FS sets userspace */ 92#define TIF_USERSPACE 31 /* true if FS sets userspace */
92 93
93#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 94#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
diff --git a/include/asm-avr32/timex.h b/include/asm-avr32/timex.h
index 5e44ecb3ce0c..187dcf38b210 100644
--- a/include/asm-avr32/timex.h
+++ b/include/asm-avr32/timex.h
@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void)
34 return 0; 34 return 0;
35} 35}
36 36
37extern int read_current_timer(unsigned long *timer_value); 37#define ARCH_HAS_READ_CURRENT_TIMER
38#define ARCH_HAS_READ_CURRENT_TIMER 1
39 38
40#endif /* __ASM_AVR32_TIMEX_H */ 39#endif /* __ASM_AVR32_TIMEX_H */
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index de09009593f8..89861a27543e 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -297,7 +297,7 @@
297 297
298#define __NR_utimensat 278 298#define __NR_utimensat 278
299#define __NR_signalfd 279 299#define __NR_signalfd 279
300#define __NR_timerfd 280 300/* 280 was __NR_timerfd */
301#define __NR_eventfd 281 301#define __NR_eventfd 281
302 302
303#ifdef __KERNEL__ 303#ifdef __KERNEL__