GIT 3a57d9b87bb6126144d55af5b3654df1e10d5a48 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6.git#avr32-arch commit 1eb210450a8a20f7be00d9de86c237ed7ed4d017 Author: David Brownell Date: Tue Feb 12 14:45:49 2008 -0800 avr32: start clocksource cleanup Start cleaning up the AVR32 clocksource mess, starting with the cycle counter clocksource: remove unneeded pseudo-RTC (just inline that call to mktime) and associated build warning, and unused sysdev. Add comment about the problem using the cycle counter register, and adjust the clocksource rating accordingly. Later patches can make this usable again (by disabling use of the idle state and providing a proper clocksource without the weak binding hacks) and move towards TCB-based clockevent support (including high resolution timers) that's shared between AT91 and AVR32. Signed-off-by: David Brownell Signed-off-by: Haavard Skinnemoen commit e155f4f180c8f5289ef5b783970cff4bf27873da Author: Haavard Skinnemoen Date: Mon Feb 11 22:46:19 2008 +0100 avr32: Use better asm constraint in prefetch() The pref instruction takes a displacement. Use it. Signed-off-by: Haavard Skinnemoen commit f0de050df889a5770327c6bf41f9f65de1af1b63 Author: Ben Nizette Date: Thu Feb 7 15:28:57 2008 +1100 avr32: pass i2c board info through at32_add_device_twi New-style I2C drivers require that motherboard-mounted I2C devices are registered with the I2C core, typically at arch_initcall time. This can be done nice and neat by passing the struct i2c_board_info[] through at32_add_device_twi just like we do for the SPI board info. While we've got the hood up, remove a duplicate declaration of at32_add_device_twi() in board.h. [hskinnemoen@atmel.com: add missing i2c_board_info forward-declaration] Signed-Off-By: Ben Nizette Signed-off-by: Haavard Skinnemoen commit d14a229a89173bcde95f8be6b8cc6aebd237a0f4 Author: Cyrill Gorcunov Date: Sun Feb 3 14:22:18 2008 +0300 avr32: cleanup - use _AC macro to define PAGE_SIZE PAGE_SIZE is used both from assembly and C code. We want to have type specifiers when using it from C, but this will make the assembler confused, so we need to make it conditional. This is exactly what the _AC macro is for, so using it allows us to get rid of a few lines of cpp noise. Signed-off-by: Cyrill Gorcunov Signed-off-by: Haavard Skinnemoen commit 4ddfeade37b0b5a66fc0bb1169201faa405bac8d Author: Hans-Christian Egtvedt Date: Tue Dec 4 13:15:41 2007 +0100 Generate raw keyboard codes for AVR32 architecture This patchs adds the AVR32 architecture to the list of archs to generate a table of raw keyboard keycodes. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen arch/avr32/kernel/time.c | 45 ++++++--------------------------- arch/avr32/mach-at32ap/at32ap700x.c | 7 ++++- drivers/char/keyboard.c | 3 +- include/asm-avr32/arch-at32ap/board.h | 5 +++- include/asm-avr32/page.h | 8 ++--- include/asm-avr32/processor.h | 2 +- 6 files changed, 24 insertions(+), 46 deletions(-) diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c index 36a46c3..bf2f762 100644 --- a/arch/avr32/kernel/time.c +++ b/arch/avr32/kernel/time.c @@ -38,9 +38,15 @@ cycle_t __weak read_cycle_count(void) return (cycle_t)sysreg_read(COUNT); } +/* + * The architectural cycle count registers are a fine clocksource unless + * the system idle loop use sleep states like "idle": the CPU cycles + * measured by COUNT (and COMPARE) don't happen during sleep states. + * So we rate the clocksource using COUNT as very low quality. + */ struct clocksource __weak clocksource_avr32 = { .name = "avr32", - .rating = 350, + .rating = 50, .read = read_cycle_count, .mask = CLOCKSOURCE_MASK(32), .shift = 16, @@ -55,22 +61,6 @@ struct irqaction timer_irqaction = { .name = "timer", }; -/* - * By default we provide the null RTC ops - */ -static unsigned long null_rtc_get_time(void) -{ - return mktime(2007, 1, 1, 0, 0, 0); -} - -static int null_rtc_set_time(unsigned long sec) -{ - return 0; -} - -static unsigned long (*rtc_get_time)(void) = null_rtc_get_time; -static int (*rtc_set_time)(unsigned long) = null_rtc_set_time; - static void avr32_timer_ack(void) { u32 count; @@ -190,7 +180,7 @@ void __init time_init(void) */ sysreg_write(COMPARE, 0); - xtime.tv_sec = rtc_get_time(); + xtime.tv_sec = mktime(2007, 1, 1, 0, 0, 0); xtime.tv_nsec = 0; set_normalized_timespec(&wall_to_monotonic, @@ -212,22 +202,3 @@ void __init time_init(void) return; } } - -static struct sysdev_class timer_class = { - .name = "timer", -}; - -static struct sys_device timer_device = { - .id = 0, - .cls = &timer_class, -}; - -static int __init init_timer_sysfs(void) -{ - int err = sysdev_class_register(&timer_class); - if (!err) - err = sysdev_register(&timer_device); - return err; -} - -device_initcall(init_timer_sysfs); diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 7678fee..82d7016 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c @@ -989,7 +989,9 @@ static struct clk atmel_twi0_pclk = { .index = 2, }; -struct platform_device *__init at32_add_device_twi(unsigned int id) +struct platform_device *__init at32_add_device_twi(unsigned int id, + struct i2c_board_info *b, + unsigned int n) { struct platform_device *pdev; @@ -1009,6 +1011,9 @@ struct platform_device *__init at32_add_device_twi(unsigned int id) atmel_twi0_pclk.dev = &pdev->dev; + if (b) + i2c_register_board_info(id, b, n); + platform_device_add(pdev); return pdev; diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 4dbd342..9769bf8 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -1033,7 +1033,8 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0); #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\ defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\ defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ - (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) + (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) ||\ + defined(CONFIG_AVR32) #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index 7597b0b..e09bbd5 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h @@ -68,7 +68,10 @@ struct platform_device *at32_add_device_pwm(u32 mask); struct platform_device * at32_add_device_ssc(unsigned int id, unsigned int flags); -struct platform_device *at32_add_device_twi(unsigned int id); +struct i2c_board_info; +struct platform_device *at32_add_device_twi(unsigned int id, + struct i2c_board_info *b, + unsigned int n); struct platform_device *at32_add_device_mci(unsigned int id); struct platform_device *at32_add_device_ac97c(unsigned int id); struct platform_device *at32_add_device_abdac(unsigned int id); diff --git a/include/asm-avr32/page.h b/include/asm-avr32/page.h index 5582968..cbbc5ca 100644 --- a/include/asm-avr32/page.h +++ b/include/asm-avr32/page.h @@ -8,13 +8,11 @@ #ifndef __ASM_AVR32_PAGE_H #define __ASM_AVR32_PAGE_H +#include + /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#ifdef __ASSEMBLY__ -#define PAGE_SIZE (1 << PAGE_SHIFT) -#else -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#endif +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #define PTE_MASK PAGE_MASK diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h index 49a88f5..2abd3de 100644 --- a/include/asm-avr32/processor.h +++ b/include/asm-avr32/processor.h @@ -169,7 +169,7 @@ extern void show_stack_log_lvl(struct task_struct *tsk, unsigned long sp, static inline void prefetch(const void *x) { const char *c = x; - asm volatile("pref %0" : : "r"(c)); + asm volatile("pref %0" : : "RKs16"(*c)); } #define PREFETCH_STRIDE L1_CACHE_BYTES