GIT cd22e0cc6aa34266a4e3baef804a76801f704666 git://www.atmel.no/~hskinnemoen/linux/kernel/avr32.git#avr32-arch commit Author: Haavard Skinnemoen Date: Tue May 29 21:33:37 2007 +0200 [AVR32] STK1000: Set SPI_MODE_3 in the ltv350qv board info In the latest incarnation of the ltv350qv driver the call to spi_setup() has been removed. So we need to initialize things more carefully in the board info struct. Signed-off-by: Haavard Skinnemoen commit 5f40c95e5e2ca06beac82dc7c54a512392aa6ee5 Author: David Brownell Date: Fri May 25 18:47:47 2007 -0700 [AVR32] faster avr32 unaligned access Use a more conventional implementation for unaligned access, and include an AT32AP-specific optimization: the CPU will handle unaligned words. The result is always faster and smaller for 8, 16, and 32 bit values. For 64 bit quantities, it's presumably larger. Signed-off-by: David Brownell Signed-off-by: Haavard Skinnemoen commit 9dc022901225fb9d55ffb89f9bfbc2042b75a46c Author: David Brownell Date: Thu May 24 13:52:08 2007 -0700 [AVR32] gpio_*_cansleep() fix The AVR32 was missing the gpio_*_cansleep() calls, breaking compilation for some code using them. Signed-off-by: David Brownell Signed-off-by: Haavard Skinnemoen commit 79e9d5469b20e00537605a89daac7573ed91cf58 Author: Andrea Righi Date: Wed May 23 14:14:52 2007 -0700 [AVR32] ratelimit segfault reporting rate Limit the rate of the kernel logging for the segfaults of user applications, to avoid potential message floods or denial-of-service attacks. Signed-off-by: Andrea Righi Cc: Haavard Skinnemoen Signed-off-by: Andrew Morton Signed-off-by: Haavard Skinnemoen arch/avr32/boards/atstk1000/atstk1002.c | 1 + arch/avr32/mm/fault.c | 2 +- include/asm-avr32/arch-at32ap/gpio.h | 2 ++ include/asm-avr32/unaligned.h | 29 ++++++++++++++++++++--------- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index fe1dbe2..e253e86 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c @@ -42,6 +42,7 @@ static struct spi_board_info spi0_board_ .modalias = "ltv350qv", .max_speed_hz = 16000000, .chip_select = 1, + .mode = SPI_MODE_3, }, }; diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c index e011f1c..4b24952 100644 --- a/arch/avr32/mm/fault.c +++ b/arch/avr32/mm/fault.c @@ -158,7 +158,7 @@ bad_area: up_read(&mm->mmap_sem); if (user_mode(regs)) { - if (exception_trace) + if (exception_trace && printk_ratelimit()) printk("%s%s[%d]: segfault at %08lx pc %08lx " "sp %08lx ecr %lu\n", is_init(tsk) ? KERN_EMERG : KERN_INFO, diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h index 80a21aa..af7f953 100644 --- a/include/asm-avr32/arch-at32ap/gpio.h +++ b/include/asm-avr32/arch-at32ap/gpio.h @@ -14,6 +14,8 @@ int gpio_direction_output(unsigned int g int gpio_get_value(unsigned int gpio); void gpio_set_value(unsigned int gpio, int value); +#include /* cansleep wrappers */ + static inline int gpio_to_irq(unsigned int gpio) { return gpio + GPIO_IRQ_BASE; diff --git a/include/asm-avr32/unaligned.h b/include/asm-avr32/unaligned.h index 3042723..7913617 100644 --- a/include/asm-avr32/unaligned.h +++ b/include/asm-avr32/unaligned.h @@ -6,20 +6,31 @@ #define __ASM_AVR32_UNALIGNED_H * implementation. The AVR32 AP implementation can handle unaligned * words, but halfwords must be halfword-aligned, and doublewords must * be word-aligned. - * - * TODO: Make all this CPU-specific and optimize. */ -#include +#include -/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ +#ifdef CONFIG_CPU_AT32AP7000 +/* REVISIT calling memmove() may be smaller for 64-bit values ... */ + +#undef get_unaligned #define get_unaligned(ptr) \ - ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) + ___get_unaligned(ptr, sizeof((*ptr))) +#define ___get_unaligned(ptr, size) \ + ((size == 4) ? *(ptr) : __get_unaligned(ptr, size)) + +#undef put_unaligned +#define put_unaligned(val, ptr) \ + ___put_unaligned((__u64)(val), ptr, sizeof((*ptr))) +#define ___put_unaligned(val, ptr, size) \ +do { \ + if (size == 4) \ + *(ptr) = (val); \ + else \ + __put_unaligned(val, ptr, size); \ +} while (0) -#define put_unaligned(val, ptr) \ - ({ __typeof__(*(ptr)) __tmp = (val); \ - memmove((ptr), &__tmp, sizeof(*(ptr))); \ - (void)0; }) +#endif #endif /* __ASM_AVR32_UNALIGNED_H */