diff -urN -x CVS linux-2.6.21/arch/arm/boot/compressed/head-at91rm9200.S linux-2.6-stable/arch/arm/boot/compressed/head-at91rm9200.S --- linux-2.6.21/arch/arm/boot/compressed/head-at91rm9200.S Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/boot/compressed/head-at91rm9200.S Tue May 8 12:13:30 2007 @@ -67,6 +67,12 @@ cmp r7, r3 beq 99f + @ Promwad Chub : 1181 + mov r3, #(MACH_TYPE_CHUB & 0xff) + orr r3, r3, #(MACH_TYPE_CHUB & 0xff00) + cmp r7, r3 + beq 99f + @ Unknown board, use the AT91RM9200DK board @ mov r7, #MACH_TYPE_AT91RM9200 mov r7, #(MACH_TYPE_AT91RM9200DK & 0xff) diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/Kconfig linux-2.6-stable/arch/arm/mach-at91/Kconfig --- linux-2.6.21/arch/arm/mach-at91/Kconfig Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/Kconfig Wed May 9 10:20:54 2007 @@ -17,6 +17,9 @@ config ARCH_AT91SAM9263 bool "AT91SAM9263" +config ARCH_AT91SAM9RL + bool "AT91SAM9RL" + endchoice # ---------------------------------------------------------- @@ -87,6 +90,12 @@ help Select this if you are using Sperry-Sun's KAFA board. +config MACH_CHUB + bool "Promwad Chub board" + depends on ARCH_AT91RM9200 + help + Select this if you are using Promwad's Chub board. + endif # ---------------------------------------------------------- @@ -111,6 +120,13 @@ Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit +config MACH_CAM60 + bool "KwikByte CAM60 board" + depends on ARCH_AT91SAM9260 + help + Select this if you are using KwikByte's CAM60 board based on the Atmel AT91SAM9260. + + endif # ---------------------------------------------------------- @@ -145,6 +161,20 @@ # ---------------------------------------------------------- +if ARCH_AT91SAM9RL + +comment "AT91SAM9RL Board Type" + +config MACH_AT91SAM9RLEK + bool "Atmel AT91SAM9RL-EK Evaluation Kit" + depends on ARCH_AT91SAM9RL + help + Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit. + +endif + +# ---------------------------------------------------------- + comment "AT91 Board Options" config MTD_AT91_DATAFLASH_CARD @@ -160,6 +190,20 @@ On AT91SAM926x boards both types of NAND flash can be present (8 and 16 bit data bus width). +config CSB300_WAKE_SW0 + bool "CSB300 SW0 irq0 wakeup" + depends on MACH_CSB337 && PM + help + If you have a CSB300 connected to your CSB337, this lets + SW0 serve as a wakeup button. It uses IRQ0. + +config CSB300_WAKE_SW1 + bool "CSB300 SW1 gpio wakeup" + depends on MACH_CSB337 && PM + help + If you have a CSB300 connected to your CSB337, this lets + SW1 serve as a wakeup button. It uses GPIO. + # ---------------------------------------------------------- comment "AT91 Feature Selections" @@ -170,6 +214,20 @@ Select this if you need to program one or more of the PCK0..PCK3 programmable clock outputs. +config ATMEL_TCLIB + bool "Timer/Counter Library" + help + Select this if you want a library to allocate the Timer/Counter + blocks found on many Atmel processors. This facilitates using + these modules despite processor differences. + +config AT91_SLOW_CLOCK + bool "Suspend-to-RAM uses slow clock mode (EXPERIMENTAL)" + depends on PM && EXPERIMENTAL + help + Select this if you wish to put the CPU into slow clock mode + while in the "Suspend to RAM" state, to save more power. + endmenu endif diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/Makefile linux-2.6-stable/arch/arm/mach-at91/Makefile --- linux-2.6.21/arch/arm/mach-at91/Makefile Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/Makefile Wed May 9 12:37:19 2007 @@ -8,12 +8,15 @@ obj- := obj-$(CONFIG_PM) += pm.o +obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o +obj-$(CONFIG_ATMEL_TCLIB) += tclib.o # CPU-specific support obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o +obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o # AT91RM9200 board-specific support obj-$(CONFIG_MACH_ONEARM) += board-1arm.o @@ -25,9 +28,11 @@ obj-$(CONFIG_MACH_KB9200) += board-kb9202.o obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o obj-$(CONFIG_MACH_KAFA) += board-kafa.o +obj-$(CONFIG_MACH_CHUB) += board-chub.o # AT91SAM9260 board-specific support obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o +obj-$(CONFIG_MACH_CAM60) += board-cam60.o # AT91SAM9261 board-specific support obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o @@ -35,9 +40,13 @@ # AT91SAM9263 board-specific support obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o +# AT91SAM9RL board-specific support +obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o + # LEDs support led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o led-$(CONFIG_MACH_AT91RM9200EK) += leds.o +led-$(CONFIG_MACH_AT91SAM9261EK)+= leds.o led-$(CONFIG_MACH_CSB337) += leds.o led-$(CONFIG_MACH_CSB637) += leds.o led-$(CONFIG_MACH_KB9200) += leds.o @@ -45,7 +54,7 @@ obj-$(CONFIG_LEDS) += $(led-y) # VGA support -#obj-$(CONFIG_FB_S1D13XXX) += ics1523.o +obj-$(CONFIG_FB_S1D13XXX) += ics1523.o ifeq ($(CONFIG_PM_DEBUG),y) diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91rm9200.c linux-2.6-stable/arch/arm/mach-at91/at91rm9200.c --- linux-2.6.21/arch/arm/mach-at91/at91rm9200.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91rm9200.c Tue May 8 12:13:30 2007 @@ -117,6 +117,21 @@ .pmc_mask = 1 << AT91RM9200_ID_PIOD, .type = CLK_TYPE_PERIPHERAL, }; +static struct clk ssc0_clk = { + .name = "ssc0_clk", + .pmc_mask = 1 << AT91RM9200_ID_SSC0, + .type = CLK_TYPE_PERIPHERAL, +}; +static struct clk ssc1_clk = { + .name = "ssc1_clk", + .pmc_mask = 1 << AT91RM9200_ID_SSC1, + .type = CLK_TYPE_PERIPHERAL, +}; +static struct clk ssc2_clk = { + .name = "ssc2_clk", + .pmc_mask = 1 << AT91RM9200_ID_SSC2, + .type = CLK_TYPE_PERIPHERAL, +}; static struct clk tc0_clk = { .name = "tc0_clk", .pmc_mask = 1 << AT91RM9200_ID_TC0, @@ -161,7 +176,9 @@ &udc_clk, &twi_clk, &spi_clk, - // ssc 0 .. ssc2 + &ssc0_clk, + &ssc1_clk, + &ssc2_clk, &tc0_clk, &tc1_clk, &tc2_clk, @@ -250,6 +267,33 @@ /* -------------------------------------------------------------------- + * Timer/Counter library initialization + * -------------------------------------------------------------------- */ +#ifdef CONFIG_ATMEL_TCLIB + +#include "tclib.h" + +static struct atmel_tcblock at91rm9200_tcblocks[] = { + [0] = { + .physaddr = AT91RM9200_BASE_TCB0, + .irq = { AT91RM9200_ID_TC0, AT91RM9200_ID_TC1, AT91RM9200_ID_TC2 }, + .clk = { &tc0_clk, &tc1_clk, &tc2_clk }, + }, + [1] = { + .physaddr = AT91RM9200_BASE_TCB1, + .irq = { AT91RM9200_ID_TC3, AT91RM9200_ID_TC4, AT91RM9200_ID_TC5 }, + .clk = { &tc3_clk, &tc4_clk, &tc5_clk }, + }, +}; + +#define at91rm9200_tc_init() atmel_tc_init(at91rm9200_tcblocks, ARRAY_SIZE(at91rm9200_tcblocks)) + +#else +#define at91rm9200_tc_init() do {} while(0) +#endif + + +/* -------------------------------------------------------------------- * AT91RM9200 processor initialization * -------------------------------------------------------------------- */ void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks) @@ -271,6 +315,9 @@ /* Initialize GPIO subsystem */ at91_gpio_init(at91rm9200_gpio, banks); + + /* Initialize the Timer/Counter blocks */ + at91rm9200_tc_init(); } @@ -284,28 +331,28 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = { 7, /* Advanced Interrupt Controller (FIQ) */ 7, /* System Peripherals */ - 0, /* Parallel IO Controller A */ - 0, /* Parallel IO Controller B */ - 0, /* Parallel IO Controller C */ - 0, /* Parallel IO Controller D */ - 6, /* USART 0 */ - 6, /* USART 1 */ - 6, /* USART 2 */ - 6, /* USART 3 */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ + 1, /* Parallel IO Controller D */ + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ + 5, /* USART 3 */ 0, /* Multimedia Card Interface */ - 4, /* USB Device Port */ - 0, /* Two-Wire Interface */ - 6, /* Serial Peripheral Interface */ - 5, /* Serial Synchronous Controller 0 */ - 5, /* Serial Synchronous Controller 1 */ - 5, /* Serial Synchronous Controller 2 */ + 2, /* USB Device Port */ + 6, /* Two-Wire Interface */ + 5, /* Serial Peripheral Interface */ + 4, /* Serial Synchronous Controller 0 */ + 4, /* Serial Synchronous Controller 1 */ + 4, /* Serial Synchronous Controller 2 */ 0, /* Timer Counter 0 */ 0, /* Timer Counter 1 */ 0, /* Timer Counter 2 */ 0, /* Timer Counter 3 */ 0, /* Timer Counter 4 */ 0, /* Timer Counter 5 */ - 3, /* USB Host port */ + 2, /* USB Host port */ 3, /* Ethernet MAC */ 0, /* Advanced Interrupt Controller (IRQ0) */ 0, /* Advanced Interrupt Controller (IRQ1) */ diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91rm9200_devices.c linux-2.6-stable/arch/arm/mach-at91/at91rm9200_devices.c --- linux-2.6.21/arch/arm/mach-at91/at91rm9200_devices.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91rm9200_devices.c Tue May 8 12:13:30 2007 @@ -480,7 +480,18 @@ * SPI * -------------------------------------------------------------------- */ -#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE) +#if defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE) /* legacy SPI driver */ +#define SPI_DEVNAME "at91_spi" + +#elif defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) /* SPI bitbanging driver */ +#define SPI_DEVNAME "at91_spi" + +#elif defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) /* new SPI driver */ +#define SPI_DEVNAME "atmel_spi" + +#endif + +#ifdef SPI_DEVNAME static u64 spi_dmamask = 0xffffffffUL; static struct resource spi_resources[] = { @@ -497,7 +508,7 @@ }; static struct platform_device at91rm9200_spi_device = { - .name = "at91_spi", + .name = SPI_DEVNAME, .id = 0, .dev = { .dma_mask = &spi_dmamask, @@ -606,6 +617,32 @@ #endif +#if defined(CONFIG_NEW_LEDS) + +static struct platform_device at91_leds = { + .name = "at91_leds", + .id = -1, +}; + +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) +{ + if (!nr) + return; + + at91_leds.dev.platform_data = leds; + + for ( ; nr; nr--, leds++) { + leds->index = nr; /* first record stores number of leds */ + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0); + } + + platform_device_register(&at91_leds); +} +#else +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {} +#endif + + /* -------------------------------------------------------------------- * UART * -------------------------------------------------------------------- */ diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9260.c linux-2.6-stable/arch/arm/mach-at91/at91sam9260.c --- linux-2.6.21/arch/arm/mach-at91/at91sam9260.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9260.c Tue May 8 12:13:30 2007 @@ -119,6 +119,11 @@ .pmc_mask = 1 << AT91SAM9260_ID_SPI1, .type = CLK_TYPE_PERIPHERAL, }; +static struct clk ssc_clk = { + .name = "ssc_clk", + .pmc_mask = 1 << AT91SAM9260_ID_SSC, + .type = CLK_TYPE_PERIPHERAL, +}; static struct clk tc0_clk = { .name = "tc0_clk", .pmc_mask = 1 << AT91SAM9260_ID_TC0, @@ -193,7 +198,7 @@ &twi_clk, &spi0_clk, &spi1_clk, - // ssc + &ssc_clk, &tc0_clk, &tc1_clk, &tc2_clk, @@ -264,6 +269,33 @@ /* -------------------------------------------------------------------- + * Timer/Counter library initialization + * -------------------------------------------------------------------- */ +#ifdef CONFIG_ATMEL_TCLIB + +#include "tclib.h" + +static struct atmel_tcblock at91sam9260_tcblocks[] = { + [0] = { + .physaddr = AT91SAM9260_BASE_TCB0, + .irq = { AT91SAM9260_ID_TC0, AT91SAM9260_ID_TC1, AT91SAM9260_ID_TC2 }, + .clk = { &tc0_clk, &tc1_clk, &tc2_clk }, + }, + [1] = { + .physaddr = AT91SAM9260_BASE_TCB1, + .irq = { AT91SAM9260_ID_TC3, AT91SAM9260_ID_TC4, AT91SAM9260_ID_TC5 }, + .clk = { &tc3_clk, &tc4_clk, &tc5_clk }, + }, +}; + +#define at91sam9260_tc_init() atmel_tc_init(at91sam9260_tcblocks, ARRAY_SIZE(at91sam9260_tcblocks)) + +#else +#define at91sam9260_tc_init() do {} while(0) +#endif + + +/* -------------------------------------------------------------------- * AT91SAM9260 processor initialization * -------------------------------------------------------------------- */ @@ -310,6 +342,9 @@ /* Register GPIO subsystem */ at91_gpio_init(at91sam9260_gpio, 3); + + /* Initialize the Timer/Counter blocks */ + at91sam9260_tc_init(); } /* -------------------------------------------------------------------- @@ -322,30 +357,30 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = { 7, /* Advanced Interrupt Controller */ 7, /* System Peripherals */ - 0, /* Parallel IO Controller A */ - 0, /* Parallel IO Controller B */ - 0, /* Parallel IO Controller C */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ 0, /* Analog-to-Digital Converter */ - 6, /* USART 0 */ - 6, /* USART 1 */ - 6, /* USART 2 */ + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ 0, /* Multimedia Card Interface */ - 4, /* USB Device Port */ - 0, /* Two-Wire Interface */ - 6, /* Serial Peripheral Interface 0 */ - 6, /* Serial Peripheral Interface 1 */ + 2, /* USB Device Port */ + 6, /* Two-Wire Interface */ + 5, /* Serial Peripheral Interface 0 */ + 5, /* Serial Peripheral Interface 1 */ 5, /* Serial Synchronous Controller */ 0, 0, 0, /* Timer Counter 0 */ 0, /* Timer Counter 1 */ 0, /* Timer Counter 2 */ - 3, /* USB Host port */ + 2, /* USB Host port */ 3, /* Ethernet */ 0, /* Image Sensor Interface */ - 6, /* USART 3 */ - 6, /* USART 4 */ - 6, /* USART 5 */ + 5, /* USART 3 */ + 5, /* USART 4 */ + 5, /* USART 5 */ 0, /* Timer Counter 3 */ 0, /* Timer Counter 4 */ 0, /* Timer Counter 5 */ diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9260_devices.c linux-2.6-stable/arch/arm/mach-at91/at91sam9260_devices.c --- linux-2.6.21/arch/arm/mach-at91/at91sam9260_devices.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9260_devices.c Tue May 8 12:13:30 2007 @@ -527,6 +527,32 @@ #endif +#if defined(CONFIG_NEW_LEDS) + +static struct platform_device at91_leds = { + .name = "at91_leds", + .id = -1, +}; + +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) +{ + if (!nr) + return; + + at91_leds.dev.platform_data = leds; + + for ( ; nr; nr--, leds++) { + leds->index = nr; /* first record stores number of leds */ + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0); + } + + platform_device_register(&at91_leds); +} +#else +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {} +#endif + + /* -------------------------------------------------------------------- * UART * -------------------------------------------------------------------- */ diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9261.c linux-2.6-stable/arch/arm/mach-at91/at91sam9261.c --- linux-2.6.21/arch/arm/mach-at91/at91sam9261.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9261.c Tue May 8 12:13:30 2007 @@ -97,6 +97,21 @@ .pmc_mask = 1 << AT91SAM9261_ID_SPI1, .type = CLK_TYPE_PERIPHERAL, }; +static struct clk ssc0_clk = { + .name = "ssc0_clk", + .pmc_mask = 1 << AT91SAM9261_ID_SSC0, + .type = CLK_TYPE_PERIPHERAL, +}; +static struct clk ssc1_clk = { + .name = "ssc1_clk", + .pmc_mask = 1 << AT91SAM9261_ID_SSC1, + .type = CLK_TYPE_PERIPHERAL, +}; +static struct clk ssc2_clk = { + .name = "ssc2_clk", + .pmc_mask = 1 << AT91SAM9261_ID_SSC2, + .type = CLK_TYPE_PERIPHERAL, +}; static struct clk tc0_clk = { .name = "tc0_clk", .pmc_mask = 1 << AT91SAM9261_ID_TC0, @@ -135,7 +150,9 @@ &twi_clk, &spi0_clk, &spi1_clk, - // ssc 0 .. ssc2 + &ssc0_clk, + &ssc1_clk, + &ssc2_clk, &tc0_clk, &tc1_clk, &tc2_clk, @@ -230,6 +247,28 @@ /* -------------------------------------------------------------------- + * Timer/Counter library initialization + * -------------------------------------------------------------------- */ +#ifdef CONFIG_ATMEL_TCLIB + +#include "tclib.h" + +static struct atmel_tcblock at91sam9261_tcblocks[] = { + [0] = { + .physaddr = AT91SAM9261_BASE_TCB0, + .irq = { AT91SAM9261_ID_TC0, AT91SAM9261_ID_TC1, AT91SAM9261_ID_TC2 }, + .clk = { &tc0_clk, &tc1_clk, &tc2_clk }, + } +}; + +#define at91sam9261_tc_init() atmel_tc_init(at91sam9261_tcblocks, ARRAY_SIZE(at91sam9261_tcblocks)) + +#else +#define at91sam9261_tc_init() do {} while(0) +#endif + + +/* -------------------------------------------------------------------- * AT91SAM9261 processor initialization * -------------------------------------------------------------------- */ @@ -250,6 +289,9 @@ /* Register GPIO subsystem */ at91_gpio_init(at91sam9261_gpio, 3); + + /* Initialize the Timer/Counter blocks */ + at91sam9261_tc_init(); } /* -------------------------------------------------------------------- @@ -262,25 +304,25 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = { 7, /* Advanced Interrupt Controller */ 7, /* System Peripherals */ - 0, /* Parallel IO Controller A */ - 0, /* Parallel IO Controller B */ - 0, /* Parallel IO Controller C */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ 0, - 6, /* USART 0 */ - 6, /* USART 1 */ - 6, /* USART 2 */ + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ 0, /* Multimedia Card Interface */ - 4, /* USB Device Port */ - 0, /* Two-Wire Interface */ - 6, /* Serial Peripheral Interface 0 */ - 6, /* Serial Peripheral Interface 1 */ - 5, /* Serial Synchronous Controller 0 */ - 5, /* Serial Synchronous Controller 1 */ - 5, /* Serial Synchronous Controller 2 */ + 2, /* USB Device Port */ + 6, /* Two-Wire Interface */ + 5, /* Serial Peripheral Interface 0 */ + 5, /* Serial Peripheral Interface 1 */ + 4, /* Serial Synchronous Controller 0 */ + 4, /* Serial Synchronous Controller 1 */ + 4, /* Serial Synchronous Controller 2 */ 0, /* Timer Counter 0 */ 0, /* Timer Counter 1 */ 0, /* Timer Counter 2 */ - 3, /* USB Host port */ + 2, /* USB Host port */ 3, /* LCD Controller */ 0, 0, diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9261_devices.c linux-2.6-stable/arch/arm/mach-at91/at91sam9261_devices.c --- linux-2.6.21/arch/arm/mach-at91/at91sam9261_devices.c Thu Apr 26 05:08:32 2007 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9261_devices.c Tue May 8 12:56:33 2007 @@ -14,6 +14,9 @@ #include #include +#include + +#include