1 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
2 --- linux-2.6.21/arch/arm/boot/compressed/head-at91rm9200.S Thu Apr 26 05:08:32 2007
3 +++ linux-2.6-stable/arch/arm/boot/compressed/head-at91rm9200.S Tue May 8 12:13:30 2007
8 + @ Promwad Chub : 1181
9 + mov r3, #(MACH_TYPE_CHUB & 0xff)
10 + orr r3, r3, #(MACH_TYPE_CHUB & 0xff00)
14 @ Unknown board, use the AT91RM9200DK board
15 @ mov r7, #MACH_TYPE_AT91RM9200
16 mov r7, #(MACH_TYPE_AT91RM9200DK & 0xff)
17 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/Kconfig linux-2.6-stable/arch/arm/mach-at91/Kconfig
18 --- linux-2.6.21/arch/arm/mach-at91/Kconfig Thu Apr 26 05:08:32 2007
19 +++ linux-2.6-stable/arch/arm/mach-at91/Kconfig Wed May 9 10:20:54 2007
21 config ARCH_AT91SAM9263
24 +config ARCH_AT91SAM9RL
29 # ----------------------------------------------------------
32 Select this if you are using Sperry-Sun's KAFA board.
35 + bool "Promwad Chub board"
36 + depends on ARCH_AT91RM9200
38 + Select this if you are using Promwad's Chub board.
42 # ----------------------------------------------------------
44 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
45 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
48 + bool "KwikByte CAM60 board"
49 + depends on ARCH_AT91SAM9260
51 + Select this if you are using KwikByte's CAM60 board based on the Atmel AT91SAM9260.
52 + <http://www.kwikbyte.com>
56 # ----------------------------------------------------------
59 # ----------------------------------------------------------
63 +comment "AT91SAM9RL Board Type"
65 +config MACH_AT91SAM9RLEK
66 + bool "Atmel AT91SAM9RL-EK Evaluation Kit"
67 + depends on ARCH_AT91SAM9RL
69 + Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
73 +# ----------------------------------------------------------
75 comment "AT91 Board Options"
77 config MTD_AT91_DATAFLASH_CARD
79 On AT91SAM926x boards both types of NAND flash can be present
80 (8 and 16 bit data bus width).
82 +config CSB300_WAKE_SW0
83 + bool "CSB300 SW0 irq0 wakeup"
84 + depends on MACH_CSB337 && PM
86 + If you have a CSB300 connected to your CSB337, this lets
87 + SW0 serve as a wakeup button. It uses IRQ0.
89 +config CSB300_WAKE_SW1
90 + bool "CSB300 SW1 gpio wakeup"
91 + depends on MACH_CSB337 && PM
93 + If you have a CSB300 connected to your CSB337, this lets
94 + SW1 serve as a wakeup button. It uses GPIO.
96 # ----------------------------------------------------------
98 comment "AT91 Feature Selections"
100 Select this if you need to program one or more of the PCK0..PCK3
101 programmable clock outputs.
104 + bool "Timer/Counter Library"
106 + Select this if you want a library to allocate the Timer/Counter
107 + blocks found on many Atmel processors. This facilitates using
108 + these modules despite processor differences.
110 +config AT91_SLOW_CLOCK
111 + bool "Suspend-to-RAM uses slow clock mode (EXPERIMENTAL)"
112 + depends on PM && EXPERIMENTAL
114 + Select this if you wish to put the CPU into slow clock mode
115 + while in the "Suspend to RAM" state, to save more power.
120 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/Makefile linux-2.6-stable/arch/arm/mach-at91/Makefile
121 --- linux-2.6.21/arch/arm/mach-at91/Makefile Thu Apr 26 05:08:32 2007
122 +++ linux-2.6-stable/arch/arm/mach-at91/Makefile Wed May 9 12:37:19 2007
126 obj-$(CONFIG_PM) += pm.o
127 +obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
128 +obj-$(CONFIG_ATMEL_TCLIB) += tclib.o
130 # CPU-specific support
131 obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
132 obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o
133 obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o
134 obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o
135 +obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o
137 # AT91RM9200 board-specific support
138 obj-$(CONFIG_MACH_ONEARM) += board-1arm.o
140 obj-$(CONFIG_MACH_KB9200) += board-kb9202.o
141 obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
142 obj-$(CONFIG_MACH_KAFA) += board-kafa.o
143 +obj-$(CONFIG_MACH_CHUB) += board-chub.o
145 # AT91SAM9260 board-specific support
146 obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
147 +obj-$(CONFIG_MACH_CAM60) += board-cam60.o
149 # AT91SAM9261 board-specific support
150 obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
152 # AT91SAM9263 board-specific support
153 obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
155 +# AT91SAM9RL board-specific support
156 +obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o
159 led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o
160 led-$(CONFIG_MACH_AT91RM9200EK) += leds.o
161 +led-$(CONFIG_MACH_AT91SAM9261EK)+= leds.o
162 led-$(CONFIG_MACH_CSB337) += leds.o
163 led-$(CONFIG_MACH_CSB637) += leds.o
164 led-$(CONFIG_MACH_KB9200) += leds.o
166 obj-$(CONFIG_LEDS) += $(led-y)
169 -#obj-$(CONFIG_FB_S1D13XXX) += ics1523.o
170 +obj-$(CONFIG_FB_S1D13XXX) += ics1523.o
173 ifeq ($(CONFIG_PM_DEBUG),y)
174 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91rm9200.c linux-2.6-stable/arch/arm/mach-at91/at91rm9200.c
175 --- linux-2.6.21/arch/arm/mach-at91/at91rm9200.c Thu Apr 26 05:08:32 2007
176 +++ linux-2.6-stable/arch/arm/mach-at91/at91rm9200.c Tue May 8 12:13:30 2007
178 .pmc_mask = 1 << AT91RM9200_ID_PIOD,
179 .type = CLK_TYPE_PERIPHERAL,
181 +static struct clk ssc0_clk = {
182 + .name = "ssc0_clk",
183 + .pmc_mask = 1 << AT91RM9200_ID_SSC0,
184 + .type = CLK_TYPE_PERIPHERAL,
186 +static struct clk ssc1_clk = {
187 + .name = "ssc1_clk",
188 + .pmc_mask = 1 << AT91RM9200_ID_SSC1,
189 + .type = CLK_TYPE_PERIPHERAL,
191 +static struct clk ssc2_clk = {
192 + .name = "ssc2_clk",
193 + .pmc_mask = 1 << AT91RM9200_ID_SSC2,
194 + .type = CLK_TYPE_PERIPHERAL,
196 static struct clk tc0_clk = {
198 .pmc_mask = 1 << AT91RM9200_ID_TC0,
213 /* --------------------------------------------------------------------
214 + * Timer/Counter library initialization
215 + * -------------------------------------------------------------------- */
216 +#ifdef CONFIG_ATMEL_TCLIB
220 +static struct atmel_tcblock at91rm9200_tcblocks[] = {
222 + .physaddr = AT91RM9200_BASE_TCB0,
223 + .irq = { AT91RM9200_ID_TC0, AT91RM9200_ID_TC1, AT91RM9200_ID_TC2 },
224 + .clk = { &tc0_clk, &tc1_clk, &tc2_clk },
227 + .physaddr = AT91RM9200_BASE_TCB1,
228 + .irq = { AT91RM9200_ID_TC3, AT91RM9200_ID_TC4, AT91RM9200_ID_TC5 },
229 + .clk = { &tc3_clk, &tc4_clk, &tc5_clk },
233 +#define at91rm9200_tc_init() atmel_tc_init(at91rm9200_tcblocks, ARRAY_SIZE(at91rm9200_tcblocks))
236 +#define at91rm9200_tc_init() do {} while(0)
240 +/* --------------------------------------------------------------------
241 * AT91RM9200 processor initialization
242 * -------------------------------------------------------------------- */
243 void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks)
246 /* Initialize GPIO subsystem */
247 at91_gpio_init(at91rm9200_gpio, banks);
249 + /* Initialize the Timer/Counter blocks */
250 + at91rm9200_tc_init();
254 @@ -284,28 +331,28 @@
255 static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
256 7, /* Advanced Interrupt Controller (FIQ) */
257 7, /* System Peripherals */
258 - 0, /* Parallel IO Controller A */
259 - 0, /* Parallel IO Controller B */
260 - 0, /* Parallel IO Controller C */
261 - 0, /* Parallel IO Controller D */
266 + 1, /* Parallel IO Controller A */
267 + 1, /* Parallel IO Controller B */
268 + 1, /* Parallel IO Controller C */
269 + 1, /* Parallel IO Controller D */
274 0, /* Multimedia Card Interface */
275 - 4, /* USB Device Port */
276 - 0, /* Two-Wire Interface */
277 - 6, /* Serial Peripheral Interface */
278 - 5, /* Serial Synchronous Controller 0 */
279 - 5, /* Serial Synchronous Controller 1 */
280 - 5, /* Serial Synchronous Controller 2 */
281 + 2, /* USB Device Port */
282 + 6, /* Two-Wire Interface */
283 + 5, /* Serial Peripheral Interface */
284 + 4, /* Serial Synchronous Controller 0 */
285 + 4, /* Serial Synchronous Controller 1 */
286 + 4, /* Serial Synchronous Controller 2 */
287 0, /* Timer Counter 0 */
288 0, /* Timer Counter 1 */
289 0, /* Timer Counter 2 */
290 0, /* Timer Counter 3 */
291 0, /* Timer Counter 4 */
292 0, /* Timer Counter 5 */
293 - 3, /* USB Host port */
294 + 2, /* USB Host port */
295 3, /* Ethernet MAC */
296 0, /* Advanced Interrupt Controller (IRQ0) */
297 0, /* Advanced Interrupt Controller (IRQ1) */
298 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
299 --- linux-2.6.21/arch/arm/mach-at91/at91rm9200_devices.c Thu Apr 26 05:08:32 2007
300 +++ linux-2.6-stable/arch/arm/mach-at91/at91rm9200_devices.c Tue May 8 12:13:30 2007
303 * -------------------------------------------------------------------- */
305 -#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)
306 +#if defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE) /* legacy SPI driver */
307 +#define SPI_DEVNAME "at91_spi"
309 +#elif defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) /* SPI bitbanging driver */
310 +#define SPI_DEVNAME "at91_spi"
312 +#elif defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) /* new SPI driver */
313 +#define SPI_DEVNAME "atmel_spi"
318 static u64 spi_dmamask = 0xffffffffUL;
320 static struct resource spi_resources[] = {
324 static struct platform_device at91rm9200_spi_device = {
325 - .name = "at91_spi",
326 + .name = SPI_DEVNAME,
329 .dma_mask = &spi_dmamask,
334 +#if defined(CONFIG_NEW_LEDS)
336 +static struct platform_device at91_leds = {
337 + .name = "at91_leds",
341 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
346 + at91_leds.dev.platform_data = leds;
348 + for ( ; nr; nr--, leds++) {
349 + leds->index = nr; /* first record stores number of leds */
350 + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
353 + platform_device_register(&at91_leds);
356 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
360 /* --------------------------------------------------------------------
362 * -------------------------------------------------------------------- */
363 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9260.c linux-2.6-stable/arch/arm/mach-at91/at91sam9260.c
364 --- linux-2.6.21/arch/arm/mach-at91/at91sam9260.c Thu Apr 26 05:08:32 2007
365 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9260.c Tue May 8 12:13:30 2007
367 .pmc_mask = 1 << AT91SAM9260_ID_SPI1,
368 .type = CLK_TYPE_PERIPHERAL,
370 +static struct clk ssc_clk = {
372 + .pmc_mask = 1 << AT91SAM9260_ID_SSC,
373 + .type = CLK_TYPE_PERIPHERAL,
375 static struct clk tc0_clk = {
377 .pmc_mask = 1 << AT91SAM9260_ID_TC0,
390 /* --------------------------------------------------------------------
391 + * Timer/Counter library initialization
392 + * -------------------------------------------------------------------- */
393 +#ifdef CONFIG_ATMEL_TCLIB
397 +static struct atmel_tcblock at91sam9260_tcblocks[] = {
399 + .physaddr = AT91SAM9260_BASE_TCB0,
400 + .irq = { AT91SAM9260_ID_TC0, AT91SAM9260_ID_TC1, AT91SAM9260_ID_TC2 },
401 + .clk = { &tc0_clk, &tc1_clk, &tc2_clk },
404 + .physaddr = AT91SAM9260_BASE_TCB1,
405 + .irq = { AT91SAM9260_ID_TC3, AT91SAM9260_ID_TC4, AT91SAM9260_ID_TC5 },
406 + .clk = { &tc3_clk, &tc4_clk, &tc5_clk },
410 +#define at91sam9260_tc_init() atmel_tc_init(at91sam9260_tcblocks, ARRAY_SIZE(at91sam9260_tcblocks))
413 +#define at91sam9260_tc_init() do {} while(0)
417 +/* --------------------------------------------------------------------
418 * AT91SAM9260 processor initialization
419 * -------------------------------------------------------------------- */
423 /* Register GPIO subsystem */
424 at91_gpio_init(at91sam9260_gpio, 3);
426 + /* Initialize the Timer/Counter blocks */
427 + at91sam9260_tc_init();
430 /* --------------------------------------------------------------------
431 @@ -322,30 +357,30 @@
432 static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
433 7, /* Advanced Interrupt Controller */
434 7, /* System Peripherals */
435 - 0, /* Parallel IO Controller A */
436 - 0, /* Parallel IO Controller B */
437 - 0, /* Parallel IO Controller C */
438 + 1, /* Parallel IO Controller A */
439 + 1, /* Parallel IO Controller B */
440 + 1, /* Parallel IO Controller C */
441 0, /* Analog-to-Digital Converter */
448 0, /* Multimedia Card Interface */
449 - 4, /* USB Device Port */
450 - 0, /* Two-Wire Interface */
451 - 6, /* Serial Peripheral Interface 0 */
452 - 6, /* Serial Peripheral Interface 1 */
453 + 2, /* USB Device Port */
454 + 6, /* Two-Wire Interface */
455 + 5, /* Serial Peripheral Interface 0 */
456 + 5, /* Serial Peripheral Interface 1 */
457 5, /* Serial Synchronous Controller */
460 0, /* Timer Counter 0 */
461 0, /* Timer Counter 1 */
462 0, /* Timer Counter 2 */
463 - 3, /* USB Host port */
464 + 2, /* USB Host port */
466 0, /* Image Sensor Interface */
473 0, /* Timer Counter 3 */
474 0, /* Timer Counter 4 */
475 0, /* Timer Counter 5 */
476 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
477 --- linux-2.6.21/arch/arm/mach-at91/at91sam9260_devices.c Thu Apr 26 05:08:32 2007
478 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9260_devices.c Tue May 8 12:13:30 2007
483 +#if defined(CONFIG_NEW_LEDS)
485 +static struct platform_device at91_leds = {
486 + .name = "at91_leds",
490 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
495 + at91_leds.dev.platform_data = leds;
497 + for ( ; nr; nr--, leds++) {
498 + leds->index = nr; /* first record stores number of leds */
499 + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
502 + platform_device_register(&at91_leds);
505 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
509 /* --------------------------------------------------------------------
511 * -------------------------------------------------------------------- */
512 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9261.c linux-2.6-stable/arch/arm/mach-at91/at91sam9261.c
513 --- linux-2.6.21/arch/arm/mach-at91/at91sam9261.c Thu Apr 26 05:08:32 2007
514 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9261.c Tue May 8 12:13:30 2007
516 .pmc_mask = 1 << AT91SAM9261_ID_SPI1,
517 .type = CLK_TYPE_PERIPHERAL,
519 +static struct clk ssc0_clk = {
520 + .name = "ssc0_clk",
521 + .pmc_mask = 1 << AT91SAM9261_ID_SSC0,
522 + .type = CLK_TYPE_PERIPHERAL,
524 +static struct clk ssc1_clk = {
525 + .name = "ssc1_clk",
526 + .pmc_mask = 1 << AT91SAM9261_ID_SSC1,
527 + .type = CLK_TYPE_PERIPHERAL,
529 +static struct clk ssc2_clk = {
530 + .name = "ssc2_clk",
531 + .pmc_mask = 1 << AT91SAM9261_ID_SSC2,
532 + .type = CLK_TYPE_PERIPHERAL,
534 static struct clk tc0_clk = {
536 .pmc_mask = 1 << AT91SAM9261_ID_TC0,
551 /* --------------------------------------------------------------------
552 + * Timer/Counter library initialization
553 + * -------------------------------------------------------------------- */
554 +#ifdef CONFIG_ATMEL_TCLIB
558 +static struct atmel_tcblock at91sam9261_tcblocks[] = {
560 + .physaddr = AT91SAM9261_BASE_TCB0,
561 + .irq = { AT91SAM9261_ID_TC0, AT91SAM9261_ID_TC1, AT91SAM9261_ID_TC2 },
562 + .clk = { &tc0_clk, &tc1_clk, &tc2_clk },
566 +#define at91sam9261_tc_init() atmel_tc_init(at91sam9261_tcblocks, ARRAY_SIZE(at91sam9261_tcblocks))
569 +#define at91sam9261_tc_init() do {} while(0)
573 +/* --------------------------------------------------------------------
574 * AT91SAM9261 processor initialization
575 * -------------------------------------------------------------------- */
579 /* Register GPIO subsystem */
580 at91_gpio_init(at91sam9261_gpio, 3);
582 + /* Initialize the Timer/Counter blocks */
583 + at91sam9261_tc_init();
586 /* --------------------------------------------------------------------
587 @@ -262,25 +304,25 @@
588 static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
589 7, /* Advanced Interrupt Controller */
590 7, /* System Peripherals */
591 - 0, /* Parallel IO Controller A */
592 - 0, /* Parallel IO Controller B */
593 - 0, /* Parallel IO Controller C */
594 + 1, /* Parallel IO Controller A */
595 + 1, /* Parallel IO Controller B */
596 + 1, /* Parallel IO Controller C */
604 0, /* Multimedia Card Interface */
605 - 4, /* USB Device Port */
606 - 0, /* Two-Wire Interface */
607 - 6, /* Serial Peripheral Interface 0 */
608 - 6, /* Serial Peripheral Interface 1 */
609 - 5, /* Serial Synchronous Controller 0 */
610 - 5, /* Serial Synchronous Controller 1 */
611 - 5, /* Serial Synchronous Controller 2 */
612 + 2, /* USB Device Port */
613 + 6, /* Two-Wire Interface */
614 + 5, /* Serial Peripheral Interface 0 */
615 + 5, /* Serial Peripheral Interface 1 */
616 + 4, /* Serial Synchronous Controller 0 */
617 + 4, /* Serial Synchronous Controller 1 */
618 + 4, /* Serial Synchronous Controller 2 */
619 0, /* Timer Counter 0 */
620 0, /* Timer Counter 1 */
621 0, /* Timer Counter 2 */
622 - 3, /* USB Host port */
623 + 2, /* USB Host port */
624 3, /* LCD Controller */
627 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
628 --- linux-2.6.21/arch/arm/mach-at91/at91sam9261_devices.c Thu Apr 26 05:08:32 2007
629 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9261_devices.c Tue May 8 12:56:33 2007
631 #include <asm/mach/map.h>
633 #include <linux/platform_device.h>
634 +#include <linux/fb.h>
636 +#include <video/atmel_lcdc.h>
638 #include <asm/arch/board.h>
639 #include <asm/arch/gpio.h>
642 * -------------------------------------------------------------------- */
644 -#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE)
645 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
646 static u64 lcdc_dmamask = 0xffffffffUL;
647 -static struct at91fb_info lcdc_data;
648 +static struct atmel_lcdfb_info lcdc_data;
650 static struct resource lcdc_resources[] = {
655 static struct platform_device at91_lcdc_device = {
657 + .name = "atmel_lcdfb",
660 .dma_mask = &lcdc_dmamask,
662 .num_resources = ARRAY_SIZE(lcdc_resources),
665 -void __init at91_add_device_lcdc(struct at91fb_info *data)
666 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
671 platform_device_register(&at91_lcdc_device);
674 -void __init at91_add_device_lcdc(struct at91fb_info *data) {}
675 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
683 +#if defined(CONFIG_NEW_LEDS)
685 +static struct platform_device at91_leds = {
686 + .name = "at91_leds",
690 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
695 + at91_leds.dev.platform_data = leds;
697 + for ( ; nr; nr--, leds++) {
698 + leds->index = nr; /* first record stores number of leds */
699 + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
702 + platform_device_register(&at91_leds);
705 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
709 /* --------------------------------------------------------------------
711 * -------------------------------------------------------------------- */
712 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9263.c linux-2.6-stable/arch/arm/mach-at91/at91sam9263.c
713 --- linux-2.6.21/arch/arm/mach-at91/at91sam9263.c Thu Apr 26 05:08:32 2007
714 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9263.c Tue May 8 12:13:30 2007
716 .pmc_mask = 1 << AT91SAM9263_ID_MCI1,
717 .type = CLK_TYPE_PERIPHERAL,
719 +static struct clk can_clk = {
721 + .pmc_mask = 1 << AT91SAM9263_ID_CAN,
722 + .type = CLK_TYPE_PERIPHERAL,
724 static struct clk twi_clk = {
726 .pmc_mask = 1 << AT91SAM9263_ID_TWI,
727 @@ -102,16 +107,46 @@
728 .pmc_mask = 1 << AT91SAM9263_ID_SPI1,
729 .type = CLK_TYPE_PERIPHERAL,
731 +static struct clk ssc0_clk = {
732 + .name = "ssc0_clk",
733 + .pmc_mask = 1 << AT91SAM9263_ID_SSC0,
734 + .type = CLK_TYPE_PERIPHERAL,
736 +static struct clk ssc1_clk = {
737 + .name = "ssc1_clk",
738 + .pmc_mask = 1 << AT91SAM9263_ID_SSC1,
739 + .type = CLK_TYPE_PERIPHERAL,
741 +static struct clk ac97_clk = {
742 + .name = "ac97_clk",
743 + .pmc_mask = 1 << AT91SAM9263_ID_AC97C,
744 + .type = CLK_TYPE_PERIPHERAL,
746 static struct clk tcb_clk = {
748 .pmc_mask = 1 << AT91SAM9263_ID_TCB,
749 .type = CLK_TYPE_PERIPHERAL,
751 +static struct clk pwmc_clk = {
752 + .name = "pwmc_clk",
753 + .pmc_mask = 1 << AT91SAM9263_ID_PWMC,
754 + .type = CLK_TYPE_PERIPHERAL,
756 static struct clk macb_clk = {
758 .pmc_mask = 1 << AT91SAM9263_ID_EMAC,
759 .type = CLK_TYPE_PERIPHERAL,
761 +static struct clk dma_clk = {
763 + .pmc_mask = 1 << AT91SAM9263_ID_DMA,
764 + .type = CLK_TYPE_PERIPHERAL,
766 +static struct clk twodge_clk = {
767 + .name = "2dge_clk",
768 + .pmc_mask = 1 << AT91SAM9263_ID_2DGE,
769 + .type = CLK_TYPE_PERIPHERAL,
771 static struct clk udc_clk = {
773 .pmc_mask = 1 << AT91SAM9263_ID_UDP,
774 @@ -142,20 +177,21 @@
805 /* --------------------------------------------------------------------
806 + * Timer/Counter library initialization
807 + * -------------------------------------------------------------------- */
808 +#ifdef CONFIG_ATMEL_TCLIB
812 +static struct atmel_tcblock at91sam9263_tcblocks[] = {
814 + .physaddr = AT91SAM9263_BASE_TCB0,
815 + .irq = { AT91SAM9263_ID_TCB, AT91SAM9263_ID_TCB, AT91SAM9263_ID_TCB },
816 + .clk = { &tcb_clk, &tcb_clk, &tcb_clk },
820 +#define at91sam9263_tc_init() atmel_tc_init(at91sam9263_tcblocks, ARRAY_SIZE(at91sam9263_tcblocks))
823 +#define at91sam9263_tc_init() do {} while(0)
827 +/* --------------------------------------------------------------------
828 * AT91SAM9263 processor initialization
829 * -------------------------------------------------------------------- */
833 /* Register GPIO subsystem */
834 at91_gpio_init(at91sam9263_gpio, 5);
836 + /* Initialize the Timer/Counter blocks */
837 + at91sam9263_tc_init();
840 /* --------------------------------------------------------------------
841 @@ -268,34 +329,34 @@
842 static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
843 7, /* Advanced Interrupt Controller (FIQ) */
844 7, /* System Peripherals */
845 - 0, /* Parallel IO Controller A */
846 - 0, /* Parallel IO Controller B */
847 - 0, /* Parallel IO Controller C, D and E */
848 + 1, /* Parallel IO Controller A */
849 + 1, /* Parallel IO Controller B */
850 + 1, /* Parallel IO Controller C, D and E */
859 0, /* Multimedia Card Interface 0 */
860 0, /* Multimedia Card Interface 1 */
862 - 0, /* Two-Wire Interface */
863 - 6, /* Serial Peripheral Interface 0 */
864 - 6, /* Serial Peripheral Interface 1 */
865 - 5, /* Serial Synchronous Controller 0 */
866 - 5, /* Serial Synchronous Controller 1 */
867 - 6, /* AC97 Controller */
869 + 6, /* Two-Wire Interface */
870 + 5, /* Serial Peripheral Interface 0 */
871 + 5, /* Serial Peripheral Interface 1 */
872 + 4, /* Serial Synchronous Controller 0 */
873 + 4, /* Serial Synchronous Controller 1 */
874 + 5, /* AC97 Controller */
875 0, /* Timer Counter 0, 1 and 2 */
876 0, /* Pulse Width Modulation Controller */
879 0, /* 2D Graphic Engine */
880 - 3, /* USB Device Port */
881 + 2, /* USB Device Port */
882 0, /* Image Sensor Interface */
883 3, /* LDC Controller */
884 0, /* DMA Controller */
886 - 3, /* USB Host port */
887 + 2, /* USB Host port */
888 0, /* Advanced Interrupt Controller (IRQ0) */
889 0, /* Advanced Interrupt Controller (IRQ1) */
891 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9263_devices.c linux-2.6-stable/arch/arm/mach-at91/at91sam9263_devices.c
892 --- linux-2.6.21/arch/arm/mach-at91/at91sam9263_devices.c Thu Apr 26 05:08:32 2007
893 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9263_devices.c Thu May 10 12:23:46 2007
895 #include <asm/mach/map.h>
897 #include <linux/platform_device.h>
898 +#include <linux/fb.h>
900 +#include <video/atmel_lcdc.h>
902 #include <asm/arch/board.h>
903 #include <asm/arch/gpio.h>
904 @@ -573,6 +576,180 @@
907 /* --------------------------------------------------------------------
909 + * -------------------------------------------------------------------- */
911 +#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE)
912 +static u64 ac97_dmamask = 0xffffffffUL;
913 +static struct atmel_ac97_data ac97_data;
915 +static struct resource ac97_resources[] = {
917 + .start = AT91SAM9263_BASE_AC97C,
918 + .end = AT91SAM9263_BASE_AC97C + SZ_16K - 1,
919 + .flags = IORESOURCE_MEM,
922 + .start = AT91SAM9263_ID_AC97C,
923 + .end = AT91SAM9263_ID_AC97C,
924 + .flags = IORESOURCE_IRQ,
928 +static struct platform_device at91sam9263_ac97_device = {
932 + .dma_mask = &ac97_dmamask,
933 + .coherent_dma_mask = 0xffffffff,
934 + .platform_data = &ac97_data,
936 + .resource = ac97_resources,
937 + .num_resources = ARRAY_SIZE(ac97_resources),
940 +void __init at91_add_device_ac97(struct atmel_ac97_data *data)
945 + at91_set_A_periph(AT91_PIN_PB0, 0); /* AC97FS */
946 + at91_set_A_periph(AT91_PIN_PB1, 0); /* AC97CK */
947 + at91_set_A_periph(AT91_PIN_PB2, 0); /* AC97TX */
948 + at91_set_A_periph(AT91_PIN_PB3, 0); /* AC97RX */
951 + if (data->reset_pin)
952 + at91_set_gpio_output(data->reset_pin, 0);
954 + ac97_data = *ek_data;
955 + platform_device_register(&at91sam9263_ac97_device);
958 +void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
962 +/* --------------------------------------------------------------------
963 + * Image Sensor Interface
964 + * -------------------------------------------------------------------- */
966 +#if defined(CONFIG_VIDEO_AT91_ISI) || defined(CONFIG_VIDEO_AT91_ISI_MODULE)
968 +struct resource isi_resources[] = {
970 + .start = AT91SAM9263_BASE_ISI,
971 + .end = AT91SAM9263_BASE_ISI + SZ_16K - 1,
972 + .flags = IORESOURCE_MEM,
975 + .start = AT91SAM9263_ID_ISI,
976 + .end = AT91SAM9263_ID_ISI,
977 + .flags = IORESOURCE_IRQ,
981 +static struct platform_device at91sam9263_isi_device = {
982 + .name = "at91_isi",
984 + .resource = isi_resources,
985 + .num_resources = ARRAY_SIZE(isi_resources),
988 +void __init at91_add_device_isi(void)
990 + at91_set_A_periph(AT91_PIN_PE0, 0); /* ISI_D0 */
991 + at91_set_A_periph(AT91_PIN_PE1, 0); /* ISI_D1 */
992 + at91_set_A_periph(AT91_PIN_PE2, 0); /* ISI_D2 */
993 + at91_set_A_periph(AT91_PIN_PE3, 0); /* ISI_D3 */
994 + at91_set_A_periph(AT91_PIN_PE4, 0); /* ISI_D4 */
995 + at91_set_A_periph(AT91_PIN_PE5, 0); /* ISI_D5 */
996 + at91_set_A_periph(AT91_PIN_PE6, 0); /* ISI_D6 */
997 + at91_set_A_periph(AT91_PIN_PE7, 0); /* ISI_D7 */
998 + at91_set_A_periph(AT91_PIN_PE8, 0); /* ISI_PCK */
999 + at91_set_A_periph(AT91_PIN_PE9, 0); /* ISI_HSYNC */
1000 + at91_set_A_periph(AT91_PIN_PE10, 0); /* ISI_VSYNC */
1001 + at91_set_B_periph(AT91_PIN_PE11, 0); /* ISI_MCK (PCK3) */
1002 + at91_set_B_periph(AT91_PIN_PE12, 0); /* ISI_PD8 */
1003 + at91_set_B_periph(AT91_PIN_PE13, 0); /* ISI_PD9 */
1004 + at91_set_B_periph(AT91_PIN_PE14, 0); /* ISI_PD10 */
1005 + at91_set_B_periph(AT91_PIN_PE15, 0); /* ISI_PD11 */
1008 +void __init at91_add_device_isi(void) {}
1012 +/* --------------------------------------------------------------------
1014 + * -------------------------------------------------------------------- */
1016 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
1017 +static u64 lcdc_dmamask = 0xffffffffUL;
1018 +static struct atmel_lcdfb_info lcdc_data;
1020 +static struct resource lcdc_resources[] = {
1022 + .start = AT91SAM9263_LCDC_BASE,
1023 + .end = AT91SAM9263_LCDC_BASE + SZ_4K - 1,
1024 + .flags = IORESOURCE_MEM,
1027 + .start = AT91SAM9263_ID_LCDC,
1028 + .end = AT91SAM9263_ID_LCDC,
1029 + .flags = IORESOURCE_IRQ,
1033 +static struct platform_device at91_lcdc_device = {
1034 + .name = "atmel_lcdfb",
1037 + .dma_mask = &lcdc_dmamask,
1038 + .coherent_dma_mask = 0xffffffff,
1039 + .platform_data = &lcdc_data,
1041 + .resource = lcdc_resources,
1042 + .num_resources = ARRAY_SIZE(lcdc_resources),
1045 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
1050 + at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
1051 + at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
1052 + at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
1053 + at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */
1054 + at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */
1055 + at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */
1056 + at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */
1057 + at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */
1058 + at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */
1059 + at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */
1060 + at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */
1061 + at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */
1062 + at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */
1063 + at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD13 */
1064 + at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */
1065 + at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */
1066 + at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */
1067 + at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */
1068 + at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */
1069 + at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD21 */
1070 + at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */
1071 + at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
1073 + lcdc_data = *data;
1074 + platform_device_register(&at91_lcdc_device);
1077 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
1081 +/* --------------------------------------------------------------------
1083 * -------------------------------------------------------------------- */
1085 @@ -594,6 +771,32 @@
1089 +#if defined(CONFIG_NEW_LEDS)
1091 +static struct platform_device at91_leds = {
1092 + .name = "at91_leds",
1096 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
1101 + at91_leds.dev.platform_data = leds;
1103 + for ( ; nr; nr--, leds++) {
1104 + leds->index = nr; /* first record stores number of leds */
1105 + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
1108 + platform_device_register(&at91_leds);
1111 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
1115 /* --------------------------------------------------------------------
1117 * -------------------------------------------------------------------- */
1118 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9rl.c linux-2.6-stable/arch/arm/mach-at91/at91sam9rl.c
1119 --- linux-2.6.21/arch/arm/mach-at91/at91sam9rl.c Thu Jan 1 02:00:00 1970
1120 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9rl.c Fri May 11 15:48:14 2007
1123 + * arch/arm/mach-at91/at91sam9rl.c
1125 + * Copyright (C) 2005 SAN People
1126 + * Copyright (C) 2007 Atmel Corporation
1128 + * This file is subject to the terms and conditions of the GNU General Public
1129 + * License. See the file COPYING in the main directory of this archive for
1133 +#include <linux/module.h>
1135 +#include <asm/mach/arch.h>
1136 +#include <asm/mach/map.h>
1137 +#include <asm/arch/cpu.h>
1138 +#include <asm/arch/at91sam9rl.h>
1139 +#include <asm/arch/at91_pmc.h>
1140 +#include <asm/arch/at91_rstc.h>
1142 +#include "generic.h"
1145 +static struct map_desc at91sam9rl_io_desc[] __initdata = {
1147 + .virtual = AT91_VA_BASE_SYS,
1148 + .pfn = __phys_to_pfn(AT91_BASE_SYS),
1150 + .type = MT_DEVICE,
1154 +static struct map_desc at91sam9rl_sram_desc[] __initdata = {
1156 + .pfn = __phys_to_pfn(AT91SAM9RL_SRAM_BASE),
1157 + .type = MT_DEVICE,
1161 +/* --------------------------------------------------------------------
1163 + * -------------------------------------------------------------------- */
1166 + * The peripheral clocks.
1168 +static struct clk pioA_clk = {
1169 + .name = "pioA_clk",
1170 + .pmc_mask = 1 << AT91SAM9RL_ID_PIOA,
1171 + .type = CLK_TYPE_PERIPHERAL,
1173 +static struct clk pioB_clk = {
1174 + .name = "pioB_clk",
1175 + .pmc_mask = 1 << AT91SAM9RL_ID_PIOB,
1176 + .type = CLK_TYPE_PERIPHERAL,
1178 +static struct clk pioC_clk = {
1179 + .name = "pioC_clk",
1180 + .pmc_mask = 1 << AT91SAM9RL_ID_PIOC,
1181 + .type = CLK_TYPE_PERIPHERAL,
1183 +static struct clk pioD_clk = {
1184 + .name = "pioD_clk",
1185 + .pmc_mask = 1 << AT91SAM9RL_ID_PIOD,
1186 + .type = CLK_TYPE_PERIPHERAL,
1188 +static struct clk usart0_clk = {
1189 + .name = "usart0_clk",
1190 + .pmc_mask = 1 << AT91SAM9RL_ID_US0,
1191 + .type = CLK_TYPE_PERIPHERAL,
1193 +static struct clk usart1_clk = {
1194 + .name = "usart1_clk",
1195 + .pmc_mask = 1 << AT91SAM9RL_ID_US1,
1196 + .type = CLK_TYPE_PERIPHERAL,
1198 +static struct clk usart2_clk = {
1199 + .name = "usart2_clk",
1200 + .pmc_mask = 1 << AT91SAM9RL_ID_US2,
1201 + .type = CLK_TYPE_PERIPHERAL,
1203 +static struct clk usart3_clk = {
1204 + .name = "usart3_clk",
1205 + .pmc_mask = 1 << AT91SAM9RL_ID_US3,
1206 + .type = CLK_TYPE_PERIPHERAL,
1208 +static struct clk mmc_clk = {
1209 + .name = "mci_clk",
1210 + .pmc_mask = 1 << AT91SAM9RL_ID_MCI,
1211 + .type = CLK_TYPE_PERIPHERAL,
1213 +static struct clk twi0_clk = {
1214 + .name = "twi0_clk",
1215 + .pmc_mask = 1 << AT91SAM9RL_ID_TWI0,
1216 + .type = CLK_TYPE_PERIPHERAL,
1218 +static struct clk twi1_clk = {
1219 + .name = "twi1_clk",
1220 + .pmc_mask = 1 << AT91SAM9RL_ID_TWI1,
1221 + .type = CLK_TYPE_PERIPHERAL,
1223 +static struct clk spi_clk = {
1224 + .name = "spi_clk",
1225 + .pmc_mask = 1 << AT91SAM9RL_ID_SPI,
1226 + .type = CLK_TYPE_PERIPHERAL,
1228 +static struct clk ssc0_clk = {
1229 + .name = "ssc0_clk",
1230 + .pmc_mask = 1 << AT91SAM9RL_ID_SSC0,
1231 + .type = CLK_TYPE_PERIPHERAL,
1233 +static struct clk ssc1_clk = {
1234 + .name = "ssc1_clk",
1235 + .pmc_mask = 1 << AT91SAM9RL_ID_SSC1,
1236 + .type = CLK_TYPE_PERIPHERAL,
1238 +static struct clk tc0_clk = {
1239 + .name = "tc0_clk",
1240 + .pmc_mask = 1 << AT91SAM9RL_ID_TC0,
1241 + .type = CLK_TYPE_PERIPHERAL,
1243 +static struct clk tc1_clk = {
1244 + .name = "tc1_clk",
1245 + .pmc_mask = 1 << AT91SAM9RL_ID_TC1,
1246 + .type = CLK_TYPE_PERIPHERAL,
1248 +static struct clk tc2_clk = {
1249 + .name = "tc2_clk",
1250 + .pmc_mask = 1 << AT91SAM9RL_ID_TC2,
1251 + .type = CLK_TYPE_PERIPHERAL,
1253 +static struct clk pwmc_clk = {
1254 + .name = "pwmc_clk",
1255 + .pmc_mask = 1 << AT91SAM9RL_ID_PWMC,
1256 + .type = CLK_TYPE_PERIPHERAL,
1258 +static struct clk tsc_clk = {
1259 + .name = "tsc_clk",
1260 + .pmc_mask = 1 << AT91SAM9RL_ID_TSC,
1261 + .type = CLK_TYPE_PERIPHERAL,
1263 +static struct clk dma_clk = {
1264 + .name = "dma_clk",
1265 + .pmc_mask = 1 << AT91SAM9RL_ID_DMA,
1266 + .type = CLK_TYPE_PERIPHERAL,
1268 +static struct clk udphs_clk = {
1269 + .name = "udphs_clk",
1270 + .pmc_mask = 1 << AT91SAM9RL_ID_UDPHS,
1271 + .type = CLK_TYPE_PERIPHERAL,
1273 +static struct clk lcdc_clk = {
1274 + .name = "lcdc_clk",
1275 + .pmc_mask = 1 << AT91SAM9RL_ID_LCDC,
1276 + .type = CLK_TYPE_PERIPHERAL,
1278 +static struct clk ac97_clk = {
1279 + .name = "ac97_clk",
1280 + .pmc_mask = 1 << AT91SAM9RL_ID_AC97C,
1281 + .type = CLK_TYPE_PERIPHERAL,
1284 +static struct clk *periph_clocks[] __initdata = {
1312 + * The two programmable clocks.
1313 + * You must configure pin multiplexing to bring these signals out.
1315 +static struct clk pck0 = {
1317 + .pmc_mask = AT91_PMC_PCK0,
1318 + .type = CLK_TYPE_PROGRAMMABLE,
1321 +static struct clk pck1 = {
1323 + .pmc_mask = AT91_PMC_PCK1,
1324 + .type = CLK_TYPE_PROGRAMMABLE,
1328 +static void __init at91sam9rl_register_clocks(void)
1332 + for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
1333 + clk_register(periph_clocks[i]);
1335 + clk_register(&pck0);
1336 + clk_register(&pck1);
1339 +/* --------------------------------------------------------------------
1341 + * -------------------------------------------------------------------- */
1343 +static struct at91_gpio_bank at91sam9rl_gpio[] = {
1345 + .id = AT91SAM9RL_ID_PIOA,
1346 + .offset = AT91_PIOA,
1347 + .clock = &pioA_clk,
1349 + .id = AT91SAM9RL_ID_PIOB,
1350 + .offset = AT91_PIOB,
1351 + .clock = &pioB_clk,
1353 + .id = AT91SAM9RL_ID_PIOC,
1354 + .offset = AT91_PIOC,
1355 + .clock = &pioC_clk,
1357 + .id = AT91SAM9RL_ID_PIOD,
1358 + .offset = AT91_PIOD,
1359 + .clock = &pioD_clk,
1363 +static void at91sam9rl_reset(void)
1365 + at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
1369 +/* --------------------------------------------------------------------
1370 + * Timer/Counter library initialization
1371 + * -------------------------------------------------------------------- */
1372 +#ifdef CONFIG_ATMEL_TCLIB
1376 +static struct atmel_tcblock at91sam9rl_tcblocks[] = {
1378 + .physaddr = AT91SAM9RL_BASE_TCB0,
1379 + .irq = { AT91SAM9RL_ID_TC0, AT91SAM9RL_ID_TC1, AT91SAM9RL_ID_TC2 },
1380 + .clk = { &tc0_clk, &tc1_clk, &tc2_clk },
1384 +#define at91sam9rl_tc_init() atmel_tc_init(at91sam9rl_tcblocks, ARRAY_SIZE(at91sam9rl_tcblocks))
1387 +#define at91sam9rl_tc_init() do {} while(0)
1391 +/* --------------------------------------------------------------------
1392 + * AT91SAM9RL processor initialization
1393 + * -------------------------------------------------------------------- */
1395 +void __init at91sam9rl_initialize(unsigned long main_clock)
1397 + unsigned long cidr, sram_size;
1399 + /* Map peripherals */
1400 + iotable_init(at91sam9rl_io_desc, ARRAY_SIZE(at91sam9rl_io_desc));
1402 + cidr = at91_sys_read(AT91_DBGU_CIDR);
1404 + switch (cidr & AT91_CIDR_SRAMSIZ) {
1405 + case AT91_CIDR_SRAMSIZ_32K:
1406 + sram_size = 2 * SZ_16K;
1408 + case AT91_CIDR_SRAMSIZ_16K:
1410 + sram_size = SZ_16K;
1413 + at91sam9rl_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
1414 + at91sam9rl_sram_desc->length = sram_size;
1417 + iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
1419 + at91_arch_reset = at91sam9rl_reset;
1420 + at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
1422 + /* Init clock subsystem */
1423 + at91_clock_init(main_clock);
1425 + /* Register the processor-specific clocks */
1426 + at91sam9rl_register_clocks();
1428 + /* Register GPIO subsystem */
1429 + at91_gpio_init(at91sam9rl_gpio, 4);
1431 + /* Initialize the Timer/Counter blocks */
1432 + at91sam9rl_tc_init();
1435 +/* --------------------------------------------------------------------
1436 + * Interrupt initialization
1437 + * -------------------------------------------------------------------- */
1440 + * The default interrupt priority levels (0 = lowest, 7 = highest).
1442 +static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
1443 + 7, /* Advanced Interrupt Controller */
1444 + 7, /* System Peripherals */
1445 + 1, /* Parallel IO Controller A */
1446 + 1, /* Parallel IO Controller B */
1447 + 1, /* Parallel IO Controller C */
1448 + 1, /* Parallel IO Controller D */
1453 + 0, /* Multimedia Card Interface */
1454 + 6, /* Two-Wire Interface 0 */
1455 + 6, /* Two-Wire Interface 1 */
1456 + 5, /* Serial Peripheral Interface */
1457 + 4, /* Serial Synchronous Controller 0 */
1458 + 4, /* Serial Synchronous Controller 1 */
1459 + 0, /* Timer Counter 0 */
1460 + 0, /* Timer Counter 1 */
1461 + 0, /* Timer Counter 2 */
1463 + 0, /* Touch Screen Controller */
1464 + 0, /* DMA Controller */
1465 + 2, /* USB Device High speed port */
1466 + 2, /* LCD Controller */
1467 + 6, /* AC97 Controller */
1474 + 0, /* Advanced Interrupt Controller */
1477 +void __init at91sam9rl_init_interrupts(unsigned int priority[NR_AIC_IRQS])
1480 + priority = at91sam9rl_default_irq_priority;
1482 + /* Initialize the AIC interrupt controller */
1483 + at91_aic_init(priority);
1485 + /* Enable GPIO interrupts */
1486 + at91_gpio_irq_setup();
1488 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/at91sam9rl_devices.c linux-2.6-stable/arch/arm/mach-at91/at91sam9rl_devices.c
1489 --- linux-2.6.21/arch/arm/mach-at91/at91sam9rl_devices.c Thu Jan 1 02:00:00 1970
1490 +++ linux-2.6-stable/arch/arm/mach-at91/at91sam9rl_devices.c Fri May 11 16:03:25 2007
1493 + * Copyright (C) 2007 Atmel Corporation
1495 + * This file is subject to the terms and conditions of the GNU General Public
1496 + * License. See the file COPYING in the main directory of this archive for
1500 +#include <asm/mach/arch.h>
1501 +#include <asm/mach/map.h>
1503 +#include <linux/platform_device.h>
1504 +#include <linux/fb.h>
1506 +#include <video/atmel_lcdc.h>
1508 +#include <asm/arch/board.h>
1509 +#include <asm/arch/gpio.h>
1510 +#include <asm/arch/at91sam9rl.h>
1511 +#include <asm/arch/at91sam9rl_matrix.h>
1512 +#include <asm/arch/at91sam926x_mc.h>
1514 +#include "generic.h"
1516 +#define SZ_512 0x00000200
1517 +#define SZ_256 0x00000100
1518 +#define SZ_16 0x00000010
1521 +/* --------------------------------------------------------------------
1523 + * -------------------------------------------------------------------- */
1525 +#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
1526 +static u64 mmc_dmamask = 0xffffffffUL;
1527 +static struct at91_mmc_data mmc_data;
1529 +static struct resource mmc_resources[] = {
1531 + .start = AT91SAM9RL_BASE_MCI,
1532 + .end = AT91SAM9RL_BASE_MCI + SZ_16K - 1,
1533 + .flags = IORESOURCE_MEM,
1536 + .start = AT91SAM9RL_ID_MCI,
1537 + .end = AT91SAM9RL_ID_MCI,
1538 + .flags = IORESOURCE_IRQ,
1542 +static struct platform_device at91sam9rl_mmc_device = {
1543 + .name = "at91_mci",
1546 + .dma_mask = &mmc_dmamask,
1547 + .coherent_dma_mask = 0xffffffff,
1548 + .platform_data = &mmc_data,
1550 + .resource = mmc_resources,
1551 + .num_resources = ARRAY_SIZE(mmc_resources),
1554 +void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
1560 + if (data->det_pin) {
1561 + at91_set_gpio_input(data->det_pin, 1);
1562 + at91_set_deglitch(data->det_pin, 1);
1565 + at91_set_gpio_input(data->wp_pin, 1);
1566 + if (data->vcc_pin)
1567 + at91_set_gpio_output(data->vcc_pin, 0);
1570 + at91_set_A_periph(AT91_PIN_PA2, 0);
1573 + at91_set_A_periph(AT91_PIN_PA1, 1);
1575 + /* DAT0, maybe DAT1..DAT3 */
1576 + at91_set_A_periph(AT91_PIN_PA0, 1);
1577 + if (data->wire4) {
1578 + at91_set_A_periph(AT91_PIN_PA3, 1);
1579 + at91_set_A_periph(AT91_PIN_PA4, 1);
1580 + at91_set_A_periph(AT91_PIN_PA5, 1);
1584 + platform_device_register(&at91sam9rl_mmc_device);
1587 +void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
1591 +/* --------------------------------------------------------------------
1592 + * NAND / SmartMedia
1593 + * -------------------------------------------------------------------- */
1595 +#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
1596 +static struct at91_nand_data nand_data;
1598 +#define NAND_BASE AT91_CHIPSELECT_3
1600 +static struct resource nand_resources[] = {
1602 + .start = NAND_BASE,
1603 + .end = NAND_BASE + SZ_256M - 1,
1604 + .flags = IORESOURCE_MEM,
1608 +static struct platform_device at91_nand_device = {
1609 + .name = "at91_nand",
1612 + .platform_data = &nand_data,
1614 + .resource = nand_resources,
1615 + .num_resources = ARRAY_SIZE(nand_resources),
1618 +void __init at91_add_device_nand(struct at91_nand_data *data)
1620 + unsigned long csa;
1625 + csa = at91_sys_read(AT91_MATRIX_EBICSA);
1626 + at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
1628 + /* set the bus interface characteristics */
1629 + at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
1630 + | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
1632 + at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
1633 + | AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
1635 + at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
1637 + at91_sys_write(AT91_SMC_MODE(3), AT91_SMC_DBW_8 | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
1640 + if (data->enable_pin)
1641 + at91_set_gpio_output(data->enable_pin, 1);
1643 + /* ready/busy pin */
1644 + if (data->rdy_pin)
1645 + at91_set_gpio_input(data->rdy_pin, 1);
1647 + /* card detect pin */
1648 + if (data->det_pin)
1649 + at91_set_gpio_input(data->det_pin, 1);
1651 + at91_set_A_periph(AT91_PIN_PB4, 0); /* NANDOE */
1652 + at91_set_A_periph(AT91_PIN_PB5, 0); /* NANDWE */
1654 + nand_data = *data;
1655 + platform_device_register(&at91_nand_device);
1659 +void __init at91_add_device_nand(struct at91_nand_data *data) {}
1663 +/* --------------------------------------------------------------------
1665 + * -------------------------------------------------------------------- */
1667 +#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
1669 +static struct resource twi_resources[] = {
1671 + .start = AT91SAM9RL_BASE_TWI0,
1672 + .end = AT91SAM9RL_BASE_TWI0 + SZ_16K - 1,
1673 + .flags = IORESOURCE_MEM,
1676 + .start = AT91SAM9RL_ID_TWI0,
1677 + .end = AT91SAM9RL_ID_TWI0,
1678 + .flags = IORESOURCE_IRQ,
1682 +static struct platform_device at91sam9rl_twi_device = {
1683 + .name = "at91_i2c",
1685 + .resource = twi_resources,
1686 + .num_resources = ARRAY_SIZE(twi_resources),
1689 +void __init at91_add_device_i2c(void)
1691 + /* pins used for TWI interface */
1692 + at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */
1693 + at91_set_multi_drive(AT91_PIN_PA23, 1);
1695 + at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */
1696 + at91_set_multi_drive(AT91_PIN_PA24, 1);
1698 + platform_device_register(&at91sam9rl_twi_device);
1701 +void __init at91_add_device_i2c(void) {}
1705 +/* --------------------------------------------------------------------
1707 + * -------------------------------------------------------------------- */
1709 +#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
1710 +static u64 spi_dmamask = 0xffffffffUL;
1712 +static struct resource spi_resources[] = {
1714 + .start = AT91SAM9RL_BASE_SPI,
1715 + .end = AT91SAM9RL_BASE_SPI + SZ_16K - 1,
1716 + .flags = IORESOURCE_MEM,
1719 + .start = AT91SAM9RL_ID_SPI,
1720 + .end = AT91SAM9RL_ID_SPI,
1721 + .flags = IORESOURCE_IRQ,
1725 +static struct platform_device at91sam9rl_spi_device = {
1726 + .name = "atmel_spi",
1729 + .dma_mask = &spi_dmamask,
1730 + .coherent_dma_mask = 0xffffffff,
1732 + .resource = spi_resources,
1733 + .num_resources = ARRAY_SIZE(spi_resources),
1736 +static const unsigned spi_standard_cs[4] = { AT91_PIN_PA28, AT91_PIN_PB7, AT91_PIN_PD8, AT91_PIN_PD9 };
1739 +void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
1742 + unsigned long cs_pin;
1744 + at91_set_A_periph(AT91_PIN_PA25, 0); /* MISO */
1745 + at91_set_A_periph(AT91_PIN_PA26, 0); /* MOSI */
1746 + at91_set_A_periph(AT91_PIN_PA27, 0); /* SPCK */
1748 + /* Enable SPI chip-selects */
1749 + for (i = 0; i < nr_devices; i++) {
1750 + if (devices[i].controller_data)
1751 + cs_pin = (unsigned long) devices[i].controller_data;
1753 + cs_pin = spi_standard_cs[devices[i].chip_select];
1755 + /* enable chip-select pin */
1756 + at91_set_gpio_output(cs_pin, 1);
1758 + /* pass chip-select pin to driver */
1759 + devices[i].controller_data = (void *) cs_pin;
1762 + spi_register_board_info(devices, nr_devices);
1763 + platform_device_register(&at91sam9rl_spi_device);
1766 +void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
1770 +/* --------------------------------------------------------------------
1772 + * -------------------------------------------------------------------- */
1774 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
1775 +static u64 lcdc_dmamask = 0xffffffffUL;
1776 +static struct atmel_lcdfb_info lcdc_data;
1778 +static struct resource lcdc_resources[] = {
1780 + .start = AT91SAM9RL_LCDC_BASE,
1781 + .end = AT91SAM9RL_LCDC_BASE + SZ_4K - 1,
1782 + .flags = IORESOURCE_MEM,
1785 + .start = AT91SAM9RL_ID_LCDC,
1786 + .end = AT91SAM9RL_ID_LCDC,
1787 + .flags = IORESOURCE_IRQ,
1789 +#if defined(CONFIG_FB_INTSRAM)
1791 + .start = AT91SAM9RL_SRAM_BASE,
1792 + .end = AT91SAM9RL_SRAM_BASE + AT91SAM9RL_SRAM_SIZE - 1,
1793 + .flags = IORESOURCE_MEM,
1798 +static struct platform_device at91_lcdc_device = {
1799 + .name = "atmel_lcdfb",
1802 + .dma_mask = &lcdc_dmamask,
1803 + .coherent_dma_mask = 0xffffffff,
1804 + .platform_data = &lcdc_data,
1806 + .resource = lcdc_resources,
1807 + .num_resources = ARRAY_SIZE(lcdc_resources),
1810 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
1816 +#warning "Check this"
1817 + at91_set_B_periph(AT91_PIN_PC5, 0); /* LCDHSYNC */
1818 + at91_set_B_periph(AT91_PIN_PC6, 0); /* LCDDOTCK */
1819 + at91_set_B_periph(AT91_PIN_PC7, 0); /* LCDDEN */
1820 + at91_set_B_periph(AT91_PIN_PC3, 0); /* LCDCC */
1821 + at91_set_B_periph(AT91_PIN_PC9, 0); /* LCDD3 */
1822 + at91_set_B_periph(AT91_PIN_PC10, 0); /* LCDD4 */
1823 + at91_set_B_periph(AT91_PIN_PC11, 0); /* LCDD5 */
1824 + at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD6 */
1825 + at91_set_B_periph(AT91_PIN_PC13, 0); /* LCDD7 */
1826 + at91_set_B_periph(AT91_PIN_PC15, 0); /* LCDD11 */
1827 + at91_set_B_periph(AT91_PIN_PC16, 0); /* LCDD12 */
1828 + at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD13 */
1829 + at91_set_B_periph(AT91_PIN_PC18, 0); /* LCDD14 */
1830 + at91_set_B_periph(AT91_PIN_PC19, 0); /* LCDD15 */
1831 + at91_set_B_periph(AT91_PIN_PC20, 0); /* LCDD18 */
1832 + at91_set_B_periph(AT91_PIN_PC21, 0); /* LCDD19 */
1833 + at91_set_B_periph(AT91_PIN_PC22, 0); /* LCDD20 */
1834 + at91_set_B_periph(AT91_PIN_PC23, 0); /* LCDD21 */
1835 + at91_set_B_periph(AT91_PIN_PC24, 0); /* LCDD22 */
1836 + at91_set_B_periph(AT91_PIN_PC25, 0); /* LCDD23 */
1838 + lcdc_data = *data;
1839 + platform_device_register(&at91_lcdc_device);
1842 +void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
1846 +/* --------------------------------------------------------------------
1848 + * -------------------------------------------------------------------- */
1850 +#if defined(CONFIG_LEDS)
1852 +u8 at91_leds_timer;
1854 +void __init at91_init_leds(u8 cpu_led, u8 timer_led)
1856 + /* Enable GPIO to access the LEDs */
1857 + at91_set_gpio_output(cpu_led, 1);
1858 + at91_set_gpio_output(timer_led, 1);
1860 + at91_leds_cpu = cpu_led;
1861 + at91_leds_timer = timer_led;
1864 +void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
1868 +#if defined(CONFIG_NEW_LEDS)
1870 +static struct platform_device at91_leds = {
1871 + .name = "at91_leds",
1875 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
1880 + at91_leds.dev.platform_data = leds;
1882 + for ( ; nr; nr--, leds++) {
1883 + leds->index = nr; /* first record stores number of leds */
1884 + at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
1887 + platform_device_register(&at91_leds);
1890 +void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
1894 +/* --------------------------------------------------------------------
1896 + * -------------------------------------------------------------------- */
1898 +#if defined(CONFIG_SERIAL_ATMEL)
1899 +static struct resource dbgu_resources[] = {
1901 + .start = AT91_VA_BASE_SYS + AT91_DBGU,
1902 + .end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
1903 + .flags = IORESOURCE_MEM,
1906 + .start = AT91_ID_SYS,
1907 + .end = AT91_ID_SYS,
1908 + .flags = IORESOURCE_IRQ,
1912 +static struct atmel_uart_data dbgu_data = {
1914 + .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1915 + .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
1918 +static struct platform_device at91sam9rl_dbgu_device = {
1919 + .name = "atmel_usart",
1922 + .platform_data = &dbgu_data,
1923 + .coherent_dma_mask = 0xffffffff,
1925 + .resource = dbgu_resources,
1926 + .num_resources = ARRAY_SIZE(dbgu_resources),
1929 +static inline void configure_dbgu_pins(void)
1931 + at91_set_A_periph(AT91_PIN_PA21, 0); /* DRXD */
1932 + at91_set_A_periph(AT91_PIN_PA22, 1); /* DTXD */
1935 +static struct resource uart0_resources[] = {
1937 + .start = AT91SAM9RL_BASE_US0,
1938 + .end = AT91SAM9RL_BASE_US0 + SZ_16K - 1,
1939 + .flags = IORESOURCE_MEM,
1942 + .start = AT91SAM9RL_ID_US0,
1943 + .end = AT91SAM9RL_ID_US0,
1944 + .flags = IORESOURCE_IRQ,
1948 +static struct atmel_uart_data uart0_data = {
1953 +static struct platform_device at91sam9rl_uart0_device = {
1954 + .name = "atmel_usart",
1957 + .platform_data = &uart0_data,
1958 + .coherent_dma_mask = 0xffffffff,
1960 + .resource = uart0_resources,
1961 + .num_resources = ARRAY_SIZE(uart0_resources),
1964 +static inline void configure_usart0_pins(void)
1966 + at91_set_A_periph(AT91_PIN_PA6, 1); /* TXD0 */
1967 + at91_set_A_periph(AT91_PIN_PA7, 0); /* RXD0 */
1968 + at91_set_A_periph(AT91_PIN_PA9, 0); /* RTS0 */
1969 + at91_set_A_periph(AT91_PIN_PA10, 0); /* CTS0 */
1972 +static struct resource uart1_resources[] = {
1974 + .start = AT91SAM9RL_BASE_US1,
1975 + .end = AT91SAM9RL_BASE_US1 + SZ_16K - 1,
1976 + .flags = IORESOURCE_MEM,
1979 + .start = AT91SAM9RL_ID_US1,
1980 + .end = AT91SAM9RL_ID_US1,
1981 + .flags = IORESOURCE_IRQ,
1985 +static struct atmel_uart_data uart1_data = {
1990 +static struct platform_device at91sam9rl_uart1_device = {
1991 + .name = "atmel_usart",
1994 + .platform_data = &uart1_data,
1995 + .coherent_dma_mask = 0xffffffff,
1997 + .resource = uart1_resources,
1998 + .num_resources = ARRAY_SIZE(uart1_resources),
2001 +static inline void configure_usart1_pins(void)
2003 + at91_set_A_periph(AT91_PIN_PA11, 1); /* TXD1 */
2004 + at91_set_A_periph(AT91_PIN_PA12, 0); /* RXD1 */
2007 +static struct resource uart2_resources[] = {
2009 + .start = AT91SAM9RL_BASE_US2,
2010 + .end = AT91SAM9RL_BASE_US2 + SZ_16K - 1,
2011 + .flags = IORESOURCE_MEM,
2014 + .start = AT91SAM9RL_ID_US2,
2015 + .end = AT91SAM9RL_ID_US2,
2016 + .flags = IORESOURCE_IRQ,
2020 +static struct atmel_uart_data uart2_data = {
2025 +static struct platform_device at91sam9rl_uart2_device = {
2026 + .name = "atmel_usart",
2029 + .platform_data = &uart2_data,
2030 + .coherent_dma_mask = 0xffffffff,
2032 + .resource = uart2_resources,
2033 + .num_resources = ARRAY_SIZE(uart2_resources),
2036 +static inline void configure_usart2_pins(void)
2038 + at91_set_A_periph(AT91_PIN_PA13, 1); /* TXD2 */
2039 + at91_set_A_periph(AT91_PIN_PA14, 0); /* RXD2 */
2042 +static struct resource uart3_resources[] = {
2044 + .start = AT91SAM9RL_BASE_US3,
2045 + .end = AT91SAM9RL_BASE_US3 + SZ_16K - 1,
2046 + .flags = IORESOURCE_MEM,
2049 + .start = AT91SAM9RL_ID_US3,
2050 + .end = AT91SAM9RL_ID_US3,
2051 + .flags = IORESOURCE_IRQ,
2055 +static struct atmel_uart_data uart3_data = {
2060 +static struct platform_device at91sam9rl_uart3_device = {
2061 + .name = "atmel_usart",
2064 + .platform_data = &uart3_data,
2065 + .coherent_dma_mask = 0xffffffff,
2067 + .resource = uart3_resources,
2068 + .num_resources = ARRAY_SIZE(uart3_resources),
2071 +static inline void configure_usart3_pins(void)
2073 + at91_set_A_periph(AT91_PIN_PB0, 1); /* TXD3 */
2074 + at91_set_A_periph(AT91_PIN_PB1, 0); /* RXD3 */
2077 +struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
2078 +struct platform_device *atmel_default_console_device; /* the serial console device */
2080 +void __init at91_init_serial(struct at91_uart_config *config)
2084 + /* Fill in list of supported UARTs */
2085 + for (i = 0; i < config->nr_tty; i++) {
2086 + switch (config->tty_map[i]) {
2088 + configure_usart0_pins();
2089 + at91_uarts[i] = &at91sam9rl_uart0_device;
2090 + at91_clock_associate("usart0_clk", &at91sam9rl_uart0_device.dev, "usart");
2093 + configure_usart1_pins();
2094 + at91_uarts[i] = &at91sam9rl_uart1_device;
2095 + at91_clock_associate("usart1_clk", &at91sam9rl_uart1_device.dev, "usart");
2098 + configure_usart2_pins();
2099 + at91_uarts[i] = &at91sam9rl_uart2_device;
2100 + at91_clock_associate("usart2_clk", &at91sam9rl_uart2_device.dev, "usart");
2103 + configure_usart3_pins();
2104 + at91_uarts[i] = &at91sam9rl_uart3_device;
2105 + at91_clock_associate("usart3_clk", &at91sam9rl_uart3_device.dev, "usart");
2108 + configure_dbgu_pins();
2109 + at91_uarts[i] = &at91sam9rl_dbgu_device;
2110 + at91_clock_associate("mck", &at91sam9rl_dbgu_device.dev, "usart");
2115 + at91_uarts[i]->id = i; /* update ID number to mapped ID */
2118 + /* Set serial console device */
2119 + if (config->console_tty < ATMEL_MAX_UART)
2120 + atmel_default_console_device = at91_uarts[config->console_tty];
2121 + if (!atmel_default_console_device)
2122 + printk(KERN_INFO "AT91: No default serial console defined.\n");
2125 +void __init at91_add_device_serial(void)
2129 + for (i = 0; i < ATMEL_MAX_UART; i++) {
2130 + if (at91_uarts[i])
2131 + platform_device_register(at91_uarts[i]);
2135 +void __init at91_init_serial(struct at91_uart_config *config) {}
2136 +void __init at91_add_device_serial(void) {}
2140 +/* -------------------------------------------------------------------- */
2143 + * These devices are always present and don't need any board-specific
2146 +static int __init at91_add_standard_devices(void)
2151 +arch_initcall(at91_add_standard_devices);
2152 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-cam60.c linux-2.6-stable/arch/arm/mach-at91/board-cam60.c
2153 --- linux-2.6.21/arch/arm/mach-at91/board-cam60.c Thu Jan 1 02:00:00 1970
2154 +++ linux-2.6-stable/arch/arm/mach-at91/board-cam60.c Tue May 8 12:13:30 2007
2159 + * based on board-sam9260ek.c
2160 + * Copyright (C) 2005 SAN People
2161 + * Copyright (C) 2006 Atmel
2163 + * This program is free software; you can redistribute it and/or modify
2164 + * it under the terms of the GNU General Public License as published by
2165 + * the Free Software Foundation; either version 2 of the License, or
2166 + * (at your option) any later version.
2168 + * This program is distributed in the hope that it will be useful,
2169 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2170 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2171 + * GNU General Public License for more details.
2173 + * You should have received a copy of the GNU General Public License
2174 + * along with this program; if not, write to the Free Software
2175 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2178 +#include <linux/types.h>
2179 +#include <linux/init.h>
2180 +#include <linux/mm.h>
2181 +#include <linux/module.h>
2182 +#include <linux/platform_device.h>
2183 +#include <linux/spi/spi.h>
2184 +#include <linux/spi/flash.h>
2186 +#include <asm/hardware.h>
2187 +#include <asm/setup.h>
2188 +#include <asm/mach-types.h>
2189 +#include <asm/irq.h>
2191 +#include <asm/mach/arch.h>
2192 +#include <asm/mach/map.h>
2193 +#include <asm/mach/irq.h>
2195 +#include <asm/arch/board.h>
2196 +#include <asm/arch/gpio.h>
2197 +#include <asm/arch/at91sam926x_mc.h>
2199 +#include "generic.h"
2203 + * Serial port configuration.
2204 + * 0 .. 5 = USART0 .. USART5
2207 +static struct at91_uart_config __initdata cam60_uart_config = {
2208 + .console_tty = 0, /* ttyS0 */
2210 + .tty_map = { 6, -1, -1, -1, -1, -1, -1 } /* ttyS0, ..., ttyS6 */
2213 +static void __init cam60_map_io(void)
2215 + /* Initialize processor: 10 MHz crystal */
2216 + at91sam9260_initialize(10000000);
2218 + /* Setup the serial ports and console */
2219 + at91_init_serial(&cam60_uart_config);
2222 +static void __init cam60_init_irq(void)
2224 + at91sam9260_init_interrupts(NULL);
2231 +#if defined(CONFIG_MTD_DATAFLASH)
2232 +static struct mtd_partition __initdata cam60_spi_partitions[] = {
2240 + .offset = MTDPART_OFS_NXTBLK,
2241 + .size = 256 * 1056,
2245 + .offset = MTDPART_OFS_NXTBLK,
2246 + .size = 2222 * 1056,
2249 + .name = "file system",
2250 + .offset = MTDPART_OFS_NXTBLK,
2251 + .size = MTDPART_SIZ_FULL,
2255 +static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
2256 + .name = "spi_flash",
2257 + .parts = cam60_spi_partitions,
2258 + .nr_parts = ARRAY_SIZE(cam60_spi_partitions)
2262 +static struct spi_board_info cam60_spi_devices[] = {
2263 +#if defined(CONFIG_MTD_DATAFLASH)
2264 + { /* DataFlash chip */
2265 + .modalias = "mtd_dataflash",
2267 + .max_speed_hz = 15 * 1000 * 1000,
2269 + .platform_data = &cam60_spi_flash_platform_data
2276 + * MACB Ethernet device
2278 +static struct __initdata at91_eth_data cam60_macb_data = {
2279 + .phy_irq_pin = AT91_PIN_PB5,
2284 +static void __init cam60_board_init(void)
2287 + at91_add_device_serial();
2289 + at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));
2291 + at91_add_device_eth(&cam60_macb_data);
2294 +MACHINE_START(CAM60, "KwikByte CAM60")
2295 + /* Maintainer: KwikByte */
2296 + .phys_io = AT91_BASE_SYS,
2297 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
2298 + .boot_params = AT91_SDRAM_BASE + 0x100,
2299 + .timer = &at91sam926x_timer,
2300 + .map_io = cam60_map_io,
2301 + .init_irq = cam60_init_irq,
2302 + .init_machine = cam60_board_init,
2304 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-chub.c linux-2.6-stable/arch/arm/mach-at91/board-chub.c
2305 --- linux-2.6.21/arch/arm/mach-at91/board-chub.c Thu Jan 1 02:00:00 1970
2306 +++ linux-2.6-stable/arch/arm/mach-at91/board-chub.c Tue May 8 12:13:30 2007
2309 + * linux/arch/arm/mach-at91/board-chub.c
2311 + * Copyright (C) 2005 SAN People, adapted for Promwad Chub board
2314 + * This program is free software; you can redistribute it and/or modify
2315 + * it under the terms of the GNU General Public License as published by
2316 + * the Free Software Foundation; either version 2 of the License, or
2317 + * (at your option) any later version.
2319 + * This program is distributed in the hope that it will be useful,
2320 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2321 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2322 + * GNU General Public License for more details.
2324 + * You should have received a copy of the GNU General Public License
2325 + * along with this program; if not, write to the Free Software
2326 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2329 +#include <linux/types.h>
2330 +#include <linux/init.h>
2331 +#include <linux/mm.h>
2332 +#include <linux/module.h>
2333 +#include <linux/platform_device.h>
2335 +#include <asm/hardware.h>
2336 +#include <asm/setup.h>
2337 +#include <asm/mach-types.h>
2338 +#include <asm/irq.h>
2340 +#include <asm/mach/arch.h>
2341 +#include <asm/mach/map.h>
2342 +#include <asm/mach/irq.h>
2344 +#include <asm/arch/board.h>
2345 +#include <asm/arch/gpio.h>
2347 +#include "generic.h"
2350 + * Serial port configuration.
2351 + * 0 .. 3 = USART0 .. USART3
2354 +static struct at91_uart_config __initdata chub_uart_config = {
2355 + .console_tty = 0, /* ttyS0 */
2357 + .tty_map = { 4, 0, 1, 2, 3 } /* ttyS0, ..., ttyS4 */
2360 +static void __init chub_init_irq(void)
2362 + at91rm9200_init_interrupts(NULL);
2365 +static void __init chub_map_io(void)
2367 + /* Initialize clocks: 18.432 MHz crystal */
2368 + at91rm9200_initialize(18432000, AT91RM9200_PQFP);
2370 + /* Setup the serial ports and console */
2371 + at91_init_serial(&chub_uart_config);
2374 +static struct at91_eth_data __initdata chub_eth_data = {
2375 + .phy_irq_pin = AT91_PIN_PB29,
2379 +static struct mtd_partition __initdata chub_nand_partition[] = {
2381 + .name = "NAND Partition 1",
2383 + .size = MTDPART_SIZ_FULL,
2387 +static struct mtd_partition *nand_partitions(int size, int *num_partitions)
2389 + *num_partitions = ARRAY_SIZE(chub_nand_partition);
2390 + return chub_nand_partition;
2393 +static struct at91_nand_data __initdata chub_nand_data = {
2396 + .enable_pin = AT91_PIN_PA27,
2397 + .partition_info = nand_partitions,
2400 +static struct spi_board_info chub_spi_devices[] = {
2401 + { /* DataFlash chip */
2402 + .modalias = "mtd_dataflash",
2404 + .max_speed_hz = 15 * 1000 * 1000,
2408 +static void __init chub_board_init(void)
2411 + at91_add_device_serial();
2413 + at91_add_device_i2c();
2415 + at91_add_device_eth(&chub_eth_data);
2417 + at91_add_device_spi(chub_spi_devices, ARRAY_SIZE(chub_spi_devices));
2419 + at91_add_device_nand(&chub_nand_data);
2420 + /* Disable write protect for NAND */
2421 + at91_set_gpio_output(AT91_PIN_PB7, 1);
2422 + /* Power enable for 3x RS-232 and 1x RS-485 */
2423 + at91_set_gpio_output(AT91_PIN_PB9, 1);
2424 + /* Disable write protect for FRAM */
2425 + at91_set_gpio_output(AT91_PIN_PA21, 1);
2426 + /* Disable write protect for Dataflash */
2427 + at91_set_gpio_output(AT91_PIN_PA19, 1);
2430 +MACHINE_START(CHUB, "Promwad Chub")
2431 + /* Maintainer: Ivan Kuten AT Promwad DOT com */
2432 + .phys_io = AT91_BASE_SYS,
2433 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
2434 + .boot_params = AT91_SDRAM_BASE + 0x100,
2435 + .timer = &at91rm9200_timer,
2436 + .map_io = chub_map_io,
2437 + .init_irq = chub_init_irq,
2438 + .init_machine = chub_board_init,
2440 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-csb337.c linux-2.6-stable/arch/arm/mach-at91/board-csb337.c
2441 --- linux-2.6.21/arch/arm/mach-at91/board-csb337.c Thu Apr 26 05:08:32 2007
2442 +++ linux-2.6-stable/arch/arm/mach-at91/board-csb337.c Tue May 8 12:13:30 2007
2444 #include <linux/module.h>
2445 #include <linux/platform_device.h>
2446 #include <linux/spi/spi.h>
2447 +#include <linux/interrupt.h>
2448 #include <linux/mtd/physmap.h>
2450 #include <asm/hardware.h>
2453 /* Setup the LEDs */
2454 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
2455 + at91_set_gpio_output(AT91_PIN_PB2, 1); /* third (unused) LED */
2457 /* Setup the serial ports and console */
2458 at91_init_serial(&csb337_uart_config);
2459 @@ -149,6 +151,55 @@
2460 .num_resources = ARRAY_SIZE(csb_flash_resources),
2463 +static struct at91_gpio_led csb337_leds[] = {
2466 + .gpio = AT91_PIN_PB0,
2467 + .trigger = "heartbeat",
2471 + .gpio = AT91_PIN_PB1,
2472 + .trigger = "timer",
2476 + .gpio = AT91_PIN_PB2,
2480 +#if defined(CONFIG_CSB300_WAKE_SW0) || defined(CONFIG_CSB300_WAKE_SW1)
2481 +static irqreturn_t switch_irq_handler(int irq, void *context)
2483 + return IRQ_HANDLED;
2486 +static inline void __init switch_irq_setup(int irq, char *name, unsigned long mode)
2490 + res = request_irq(irq, switch_irq_handler, IRQF_SAMPLE_RANDOM | mode, name, NULL);
2492 + enable_irq_wake(irq);
2495 +static void __init csb300_switches(void)
2497 +#ifdef CONFIG_CSB300_WAKE_SW0
2498 + at91_set_A_periph(AT91_PIN_PB29, 1); /* IRQ0 */
2499 + switch_irq_setup(AT91RM9200_ID_IRQ0, "csb300_sw0", IRQF_TRIGGER_FALLING);
2501 +#ifdef CONFIG_CSB300_WAKE_SW1
2502 + at91_set_gpio_input(AT91_PIN_PB28, 1);
2503 + at91_set_deglitch(AT91_PIN_PB28, 1);
2504 + switch_irq_setup(AT91_PIN_PB28, "csb300_sw1", IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
2506 + /* there's also SW2 at PA21, GPIO or TIOA2 */
2509 +static void __init csb300_switches(void) {}
2512 static void __init csb337_board_init(void)
2515 @@ -168,8 +219,12 @@
2516 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
2518 at91_add_device_mmc(0, &csb337_mmc_data);
2520 + at91_gpio_leds(csb337_leds, ARRAY_SIZE(csb337_leds));
2522 platform_device_register(&csb_flash);
2523 + /* Switches on CSB300 */
2524 + csb300_switches();
2527 MACHINE_START(CSB337, "Cogent CSB337")
2528 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-dk.c linux-2.6-stable/arch/arm/mach-at91/board-dk.c
2529 --- linux-2.6.21/arch/arm/mach-at91/board-dk.c Thu Apr 26 05:08:32 2007
2530 +++ linux-2.6-stable/arch/arm/mach-at91/board-dk.c Tue May 8 14:29:12 2007
2532 at91rm9200_init_interrupts(NULL);
2535 +#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
2536 +#include <video/s1d13xxxfb.h>
2537 +#include <asm/arch/ics1523.h>
2539 +/* EPSON S1D13806 FB */
2540 +#define AT91_FB_REG_BASE 0x30000000L
2541 +#define AT91_FB_REG_SIZE 0x200
2542 +#define AT91_FB_VMEM_BASE 0x30200000L
2543 +#define AT91_FB_VMEM_SIZE 0x140000L
2545 +static void __init dk_init_video(void)
2547 + /* NWAIT Signal */
2548 + at91_set_A_periph(AT91_PIN_PC6, 0);
2550 + /* Initialization of the Static Memory Controller for Chip Select 2 */
2551 + at91_sys_write(AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */
2552 + | AT91_SMC_WSEN | AT91_SMC_NWS_(4) /* wait states */
2553 + | AT91_SMC_TDF_(1) /* float time */
2556 + at91_ics1523_init();
2559 +/* CRT: (active) 640x480 60Hz (PCLK=CLKI=25.175MHz)
2560 + Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
2561 +static const struct s1d13xxxfb_regval dk_s1dfb_initregs[] = {
2562 + {S1DREG_MISC, 0x00}, /* Enable Memory/Register select bit */
2563 + {S1DREG_COM_DISP_MODE, 0x00}, /* disable display output */
2564 + {S1DREG_GPIO_CNF0, 0x00},
2565 + {S1DREG_GPIO_CNF1, 0x00},
2566 + {S1DREG_GPIO_CTL0, 0x08},
2567 + {S1DREG_GPIO_CTL1, 0x00},
2568 + {S1DREG_CLK_CNF, 0x01}, /* no divide, MCLK source is CLKI3 0x02*/
2569 + {S1DREG_LCD_CLK_CNF, 0x00},
2570 + {S1DREG_CRT_CLK_CNF, 0x00},
2571 + {S1DREG_MPLUG_CLK_CNF, 0x00},
2572 + {S1DREG_CPU2MEM_WST_SEL, 0x01}, /* 2*period(MCLK) - 4ns > period(BCLK) */
2573 + {S1DREG_SDRAM_REF_RATE, 0x03}, /* 32768 <= MCLK <= 50000 (MHz) */
2574 + {S1DREG_SDRAM_TC0, 0x00}, /* MCLK source freq (MHz): */
2575 + {S1DREG_SDRAM_TC1, 0x01}, /* 42 <= MCLK <= 50 */
2576 + {S1DREG_MEM_CNF, 0x80}, /* SDRAM Initialization - needed before mem access */
2577 + {S1DREG_PANEL_TYPE, 0x25}, /* std TFT 16bit, 8bit SCP format 2, single passive LCD */
2578 + {S1DREG_MOD_RATE, 0x00}, /* toggle every FPFRAME */
2579 + {S1DREG_LCD_DISP_HWIDTH, 0x4F}, /* 680 pix */
2580 + {S1DREG_LCD_NDISP_HPER, 0x12}, /* 152 pix */
2581 + {S1DREG_TFT_FPLINE_START, 0x01}, /* 13 pix */
2582 + {S1DREG_TFT_FPLINE_PWIDTH, 0x0B}, /* 96 pix */
2583 + {S1DREG_LCD_DISP_VHEIGHT0, 0xDF},
2584 + {S1DREG_LCD_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2585 + {S1DREG_LCD_NDISP_VPER, 0x2C}, /* 44 lines */
2586 + {S1DREG_TFT_FPFRAME_START, 0x0A}, /* 10 lines */
2587 + {S1DREG_TFT_FPFRAME_PWIDTH, 0x01}, /* 2 lines */
2588 + {S1DREG_LCD_DISP_MODE, 0x05}, /* 16 bpp */
2589 + {S1DREG_LCD_MISC, 0x00}, /* dithering enabled, dual panel buffer enabled */
2590 + {S1DREG_LCD_DISP_START0, 0x00},
2591 + {S1DREG_LCD_DISP_START1, 0xC8},
2592 + {S1DREG_LCD_DISP_START2, 0x00},
2593 + {S1DREG_LCD_MEM_OFF0, 0x80},
2594 + {S1DREG_LCD_MEM_OFF1, 0x02},
2595 + {S1DREG_LCD_PIX_PAN, 0x00},
2596 + {S1DREG_LCD_DISP_FIFO_HTC, 0x3B},
2597 + {S1DREG_LCD_DISP_FIFO_LTC, 0x3C},
2598 + {S1DREG_CRT_DISP_HWIDTH, 0x4F}, /* 680 pix */
2599 + {S1DREG_CRT_NDISP_HPER, 0x13}, /* 160 pix */
2600 + {S1DREG_CRT_HRTC_START, 0x01}, /* 13 pix */
2601 + {S1DREG_CRT_HRTC_PWIDTH, 0x0B}, /* 96 pix */
2602 + {S1DREG_CRT_DISP_VHEIGHT0, 0xDF},
2603 + {S1DREG_CRT_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2604 + {S1DREG_CRT_NDISP_VPER, 0x2B}, /* 44 lines */
2605 + {S1DREG_CRT_VRTC_START, 0x09}, /* 10 lines */
2606 + {S1DREG_CRT_VRTC_PWIDTH, 0x01}, /* 2 lines */
2607 + {S1DREG_TV_OUT_CTL, 0x10},
2608 + {S1DREG_CRT_DISP_MODE, 0x05}, /* 16 bpp */
2609 + {S1DREG_CRT_DISP_START0, 0x00},
2610 + {S1DREG_CRT_DISP_START1, 0x00},
2611 + {S1DREG_CRT_DISP_START2, 0x00},
2612 + {S1DREG_CRT_MEM_OFF0, 0x80},
2613 + {S1DREG_CRT_MEM_OFF1, 0x02},
2614 + {S1DREG_CRT_PIX_PAN, 0x00},
2615 + {S1DREG_CRT_DISP_FIFO_HTC, 0x3B},
2616 + {S1DREG_CRT_DISP_FIFO_LTC, 0x3C},
2617 + {S1DREG_LCD_CUR_CTL, 0x00}, /* inactive */
2618 + {S1DREG_LCD_CUR_START, 0x01},
2619 + {S1DREG_LCD_CUR_XPOS0, 0x00},
2620 + {S1DREG_LCD_CUR_XPOS1, 0x00},
2621 + {S1DREG_LCD_CUR_YPOS0, 0x00},
2622 + {S1DREG_LCD_CUR_YPOS1, 0x00},
2623 + {S1DREG_LCD_CUR_BCTL0, 0x00},
2624 + {S1DREG_LCD_CUR_GCTL0, 0x00},
2625 + {S1DREG_LCD_CUR_RCTL0, 0x00},
2626 + {S1DREG_LCD_CUR_BCTL1, 0x1F},
2627 + {S1DREG_LCD_CUR_GCTL1, 0x3F},
2628 + {S1DREG_LCD_CUR_RCTL1, 0x1F},
2629 + {S1DREG_LCD_CUR_FIFO_HTC, 0x00},
2630 + {S1DREG_CRT_CUR_CTL, 0x00}, /* inactive */
2631 + {S1DREG_CRT_CUR_START, 0x01},
2632 + {S1DREG_CRT_CUR_XPOS0, 0x00},
2633 + {S1DREG_CRT_CUR_XPOS1, 0x00},
2634 + {S1DREG_CRT_CUR_YPOS0, 0x00},
2635 + {S1DREG_CRT_CUR_YPOS1, 0x00},
2636 + {S1DREG_CRT_CUR_BCTL0, 0x00},
2637 + {S1DREG_CRT_CUR_GCTL0, 0x00},
2638 + {S1DREG_CRT_CUR_RCTL0, 0x00},
2639 + {S1DREG_CRT_CUR_BCTL1, 0x1F},
2640 + {S1DREG_CRT_CUR_GCTL1, 0x3F},
2641 + {S1DREG_CRT_CUR_RCTL1, 0x1F},
2642 + {S1DREG_CRT_CUR_FIFO_HTC, 0x00},
2643 + {S1DREG_BBLT_CTL0, 0x00},
2644 + {S1DREG_BBLT_CTL0, 0x00},
2645 + {S1DREG_BBLT_CC_EXP, 0x00},
2646 + {S1DREG_BBLT_OP, 0x00},
2647 + {S1DREG_BBLT_SRC_START0, 0x00},
2648 + {S1DREG_BBLT_SRC_START1, 0x00},
2649 + {S1DREG_BBLT_SRC_START2, 0x00},
2650 + {S1DREG_BBLT_DST_START0, 0x00},
2651 + {S1DREG_BBLT_DST_START1, 0x00},
2652 + {S1DREG_BBLT_DST_START2, 0x00},
2653 + {S1DREG_BBLT_MEM_OFF0, 0x00},
2654 + {S1DREG_BBLT_MEM_OFF1, 0x00},
2655 + {S1DREG_BBLT_WIDTH0, 0x00},
2656 + {S1DREG_BBLT_WIDTH1, 0x00},
2657 + {S1DREG_BBLT_HEIGHT0, 0x00},
2658 + {S1DREG_BBLT_HEIGHT1, 0x00},
2659 + {S1DREG_BBLT_BGC0, 0x00},
2660 + {S1DREG_BBLT_BGC1, 0x00},
2661 + {S1DREG_BBLT_FGC0, 0x00},
2662 + {S1DREG_BBLT_FGC1, 0x00},
2663 + {S1DREG_LKUP_MODE, 0x00}, /* LCD LUT r | LCD and CRT/TV LUT w */
2664 + {S1DREG_LKUP_ADDR, 0x00},
2665 + {S1DREG_PS_CNF, 0x00}, /* Power Save disable */
2666 + {S1DREG_PS_STATUS, 0x02}, /* LCD Panel down, mem up */
2667 + {S1DREG_CPU2MEM_WDOGT, 0x00},
2668 + {S1DREG_COM_DISP_MODE, 0x02}, /* enable CRT display output */
2671 +static struct s1d13xxxfb_pdata dk_s1dfb_pdata = {
2672 + .initregs = dk_s1dfb_initregs,
2673 + .initregssize = ARRAY_SIZE(dk_s1dfb_initregs),
2674 + .platform_init_video = dk_init_video,
2677 +static u64 s1dfb_dmamask = 0xffffffffUL;
2679 +static struct resource dk_s1dfb_resource[] = {
2680 + [0] = { /* video mem */
2681 + .name = "s1d13806 memory",
2682 + .start = AT91_FB_VMEM_BASE,
2683 + .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
2684 + .flags = IORESOURCE_MEM,
2686 + [1] = { /* video registers */
2687 + .name = "s1d13806 registers",
2688 + .start = AT91_FB_REG_BASE,
2689 + .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
2690 + .flags = IORESOURCE_MEM,
2694 +static struct platform_device dk_s1dfb_device = {
2695 + .name = "s1d13806fb",
2698 + .dma_mask = &s1dfb_dmamask,
2699 + .coherent_dma_mask = 0xffffffff,
2700 + .platform_data = &dk_s1dfb_pdata,
2702 + .resource = dk_s1dfb_resource,
2703 + .num_resources = ARRAY_SIZE(dk_s1dfb_resource),
2706 +static void __init dk_add_device_video(void)
2708 + platform_device_register(&dk_s1dfb_device);
2711 +static void __init dk_add_device_video(void) {}
2714 static struct at91_eth_data __initdata dk_eth_data = {
2715 .phy_irq_pin = AT91_PIN_PC4,
2718 #define DK_FLASH_SIZE 0x200000
2720 static struct physmap_flash_data dk_flash_data = {
2725 static struct resource dk_flash_resource = {
2726 @@ -170,6 +349,13 @@
2730 +static struct at91_gpio_led dk_leds[] = {
2733 + .gpio = AT91_PIN_PB2,
2734 + .trigger = "timer",
2738 static void __init dk_board_init(void)
2740 @@ -200,8 +386,10 @@
2741 at91_add_device_nand(&dk_nand_data);
2743 platform_device_register(&dk_flash);
2745 + at91_gpio_leds(dk_leds, ARRAY_SIZE(dk_leds));
2747 -// dk_add_device_video();
2748 + dk_add_device_video();
2751 MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
2752 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-ek.c linux-2.6-stable/arch/arm/mach-at91/board-ek.c
2753 --- linux-2.6.21/arch/arm/mach-at91/board-ek.c Thu Apr 26 05:08:32 2007
2754 +++ linux-2.6-stable/arch/arm/mach-at91/board-ek.c Tue May 8 14:29:22 2007
2756 at91rm9200_init_interrupts(NULL);
2759 +#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
2760 +#include <video/s1d13xxxfb.h>
2761 +#include <asm/arch/ics1523.h>
2763 +/* EPSON S1D13806 FB */
2764 +#define AT91_FB_REG_BASE 0x40000000L
2765 +#define AT91_FB_REG_SIZE 0x200
2766 +#define AT91_FB_VMEM_BASE 0x40200000L
2767 +#define AT91_FB_VMEM_SIZE 0x140000L
2769 +static void __init ek_init_video(void)
2771 + /* NWAIT Signal */
2772 + at91_set_A_periph(AT91_PIN_PC6, 0);
2774 + /* Initialization of the Static Memory Controller for Chip Select 3 */
2775 + at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_DBW_16 /* 16 bit */
2776 + | AT91_SMC_WSEN | AT91_SMC_NWS_(5) /* wait states */
2777 + | AT91_SMC_TDF_(1) /* float time */
2780 + at91_ics1523_init();
2783 +/* CRT: (active) 640x480 60Hz (PCLK=CLKI=25.175MHz)
2784 + Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
2785 +static const struct s1d13xxxfb_regval ek_s1dfb_initregs[] = {
2786 + {S1DREG_MISC, 0x00}, /* Enable Memory/Register select bit */
2787 + {S1DREG_COM_DISP_MODE, 0x00}, /* disable display output */
2788 + {S1DREG_GPIO_CNF0, 0xFF}, // 0x00
2789 + {S1DREG_GPIO_CNF1, 0x1F}, // 0x08
2790 + {S1DREG_GPIO_CTL0, 0x00},
2791 + {S1DREG_GPIO_CTL1, 0x00},
2792 + {S1DREG_CLK_CNF, 0x01}, /* no divide, MCLK source is CLKI3 0x02*/
2793 + {S1DREG_LCD_CLK_CNF, 0x00},
2794 + {S1DREG_CRT_CLK_CNF, 0x00},
2795 + {S1DREG_MPLUG_CLK_CNF, 0x00},
2796 + {S1DREG_CPU2MEM_WST_SEL, 0x01}, /* 2*period(MCLK) - 4ns > period(BCLK) */
2797 + {S1DREG_SDRAM_REF_RATE, 0x03}, /* 32768 <= MCLK <= 50000 (MHz) */
2798 + {S1DREG_SDRAM_TC0, 0x00}, /* MCLK source freq (MHz): */
2799 + {S1DREG_SDRAM_TC1, 0x01}, /* 42 <= MCLK <= 50 */
2800 + {S1DREG_MEM_CNF, 0x80}, /* SDRAM Initialization - needed before mem access */
2801 + {S1DREG_PANEL_TYPE, 0x25}, /* std TFT 16bit, 8bit SCP format 2, single passive LCD */
2802 + {S1DREG_MOD_RATE, 0x00}, /* toggle every FPFRAME */
2803 + {S1DREG_LCD_DISP_HWIDTH, 0x4F}, /* 680 pix */
2804 + {S1DREG_LCD_NDISP_HPER, 0x12}, /* 152 pix */
2805 + {S1DREG_TFT_FPLINE_START, 0x01}, /* 13 pix */
2806 + {S1DREG_TFT_FPLINE_PWIDTH, 0x0B}, /* 96 pix */
2807 + {S1DREG_LCD_DISP_VHEIGHT0, 0xDF},
2808 + {S1DREG_LCD_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2809 + {S1DREG_LCD_NDISP_VPER, 0x2C}, /* 44 lines */
2810 + {S1DREG_TFT_FPFRAME_START, 0x0A}, /* 10 lines */
2811 + {S1DREG_TFT_FPFRAME_PWIDTH, 0x01}, /* 2 lines */
2812 + {S1DREG_LCD_DISP_MODE, 0x05}, /* 16 bpp */
2813 + {S1DREG_LCD_MISC, 0x00}, /* dithering enabled, dual panel buffer enabled */
2814 + {S1DREG_LCD_DISP_START0, 0x00},
2815 + {S1DREG_LCD_DISP_START1, 0xC8},
2816 + {S1DREG_LCD_DISP_START2, 0x00},
2817 + {S1DREG_LCD_MEM_OFF0, 0x80},
2818 + {S1DREG_LCD_MEM_OFF1, 0x02},
2819 + {S1DREG_LCD_PIX_PAN, 0x00},
2820 + {S1DREG_LCD_DISP_FIFO_HTC, 0x3B},
2821 + {S1DREG_LCD_DISP_FIFO_LTC, 0x3C},
2822 + {S1DREG_CRT_DISP_HWIDTH, 0x4F}, /* 680 pix */
2823 + {S1DREG_CRT_NDISP_HPER, 0x13}, /* 160 pix */
2824 + {S1DREG_CRT_HRTC_START, 0x01}, /* 13 pix */
2825 + {S1DREG_CRT_HRTC_PWIDTH, 0x0B}, /* 96 pix */
2826 + {S1DREG_CRT_DISP_VHEIGHT0, 0xDF},
2827 + {S1DREG_CRT_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2828 + {S1DREG_CRT_NDISP_VPER, 0x2B}, /* 44 lines */
2829 + {S1DREG_CRT_VRTC_START, 0x09}, /* 10 lines */
2830 + {S1DREG_CRT_VRTC_PWIDTH, 0x01}, /* 2 lines */
2831 + {S1DREG_TV_OUT_CTL, 0x10},
2834 + {S1DREG_CRT_DISP_MODE, 0x05}, /* 16 bpp */
2835 + {S1DREG_CRT_DISP_START0, 0x00},
2836 + {S1DREG_CRT_DISP_START1, 0x00},
2837 + {S1DREG_CRT_DISP_START2, 0x00},
2838 + {S1DREG_CRT_MEM_OFF0, 0x80},
2839 + {S1DREG_CRT_MEM_OFF1, 0x02},
2840 + {S1DREG_CRT_PIX_PAN, 0x00},
2841 + {S1DREG_CRT_DISP_FIFO_HTC, 0x3B},
2842 + {S1DREG_CRT_DISP_FIFO_LTC, 0x3C},
2843 + {S1DREG_LCD_CUR_CTL, 0x00}, /* inactive */
2844 + {S1DREG_LCD_CUR_START, 0x01},
2845 + {S1DREG_LCD_CUR_XPOS0, 0x00},
2846 + {S1DREG_LCD_CUR_XPOS1, 0x00},
2847 + {S1DREG_LCD_CUR_YPOS0, 0x00},
2848 + {S1DREG_LCD_CUR_YPOS1, 0x00},
2849 + {S1DREG_LCD_CUR_BCTL0, 0x00},
2850 + {S1DREG_LCD_CUR_GCTL0, 0x00},
2851 + {S1DREG_LCD_CUR_RCTL0, 0x00},
2852 + {S1DREG_LCD_CUR_BCTL1, 0x1F},
2853 + {S1DREG_LCD_CUR_GCTL1, 0x3F},
2854 + {S1DREG_LCD_CUR_RCTL1, 0x1F},
2855 + {S1DREG_LCD_CUR_FIFO_HTC, 0x00},
2856 + {S1DREG_CRT_CUR_CTL, 0x00}, /* inactive */
2857 + {S1DREG_CRT_CUR_START, 0x01},
2858 + {S1DREG_CRT_CUR_XPOS0, 0x00},
2859 + {S1DREG_CRT_CUR_XPOS1, 0x00},
2860 + {S1DREG_CRT_CUR_YPOS0, 0x00},
2861 + {S1DREG_CRT_CUR_YPOS1, 0x00},
2862 + {S1DREG_CRT_CUR_BCTL0, 0x00},
2863 + {S1DREG_CRT_CUR_GCTL0, 0x00},
2864 + {S1DREG_CRT_CUR_RCTL0, 0x00},
2865 + {S1DREG_CRT_CUR_BCTL1, 0x1F},
2866 + {S1DREG_CRT_CUR_GCTL1, 0x3F},
2867 + {S1DREG_CRT_CUR_RCTL1, 0x1F},
2868 + {S1DREG_CRT_CUR_FIFO_HTC, 0x00},
2869 + {S1DREG_BBLT_CTL0, 0x00},
2870 + {S1DREG_BBLT_CTL0, 0x00},
2871 + {S1DREG_BBLT_CC_EXP, 0x00},
2872 + {S1DREG_BBLT_OP, 0x00},
2873 + {S1DREG_BBLT_SRC_START0, 0x00},
2874 + {S1DREG_BBLT_SRC_START1, 0x00},
2875 + {S1DREG_BBLT_SRC_START2, 0x00},
2876 + {S1DREG_BBLT_DST_START0, 0x00},
2877 + {S1DREG_BBLT_DST_START1, 0x00},
2878 + {S1DREG_BBLT_DST_START2, 0x00},
2879 + {S1DREG_BBLT_MEM_OFF0, 0x00},
2880 + {S1DREG_BBLT_MEM_OFF1, 0x00},
2881 + {S1DREG_BBLT_WIDTH0, 0x00},
2882 + {S1DREG_BBLT_WIDTH1, 0x00},
2883 + {S1DREG_BBLT_HEIGHT0, 0x00},
2884 + {S1DREG_BBLT_HEIGHT1, 0x00},
2885 + {S1DREG_BBLT_BGC0, 0x00},
2886 + {S1DREG_BBLT_BGC1, 0x00},
2887 + {S1DREG_BBLT_FGC0, 0x00},
2888 + {S1DREG_BBLT_FGC1, 0x00},
2889 + {S1DREG_LKUP_MODE, 0x00}, /* LCD LUT r | LCD and CRT/TV LUT w */
2890 + {S1DREG_LKUP_ADDR, 0x00},
2891 + {S1DREG_PS_CNF, 0x10}, /* Power Save disable */
2892 + {S1DREG_PS_STATUS, 0x02}, /* LCD Panel down, mem up */
2893 + {S1DREG_CPU2MEM_WDOGT, 0x00},
2894 + {S1DREG_COM_DISP_MODE, 0x02}, /* enable CRT display output */
2897 +static struct s1d13xxxfb_pdata ek_s1dfb_pdata = {
2898 + .initregs = ek_s1dfb_initregs,
2899 + .initregssize = ARRAY_SIZE(ek_s1dfb_initregs),
2900 + .platform_init_video = ek_init_video,
2903 +static u64 s1dfb_dmamask = 0xffffffffUL;
2905 +static struct resource ek_s1dfb_resource[] = {
2906 + [0] = { /* video mem */
2907 + .name = "s1d13806 memory",
2908 + .start = AT91_FB_VMEM_BASE,
2909 + .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
2910 + .flags = IORESOURCE_MEM,
2912 + [1] = { /* video registers */
2913 + .name = "s1d13806 registers",
2914 + .start = AT91_FB_REG_BASE,
2915 + .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
2916 + .flags = IORESOURCE_MEM,
2920 +static struct platform_device ek_s1dfb_device = {
2921 + .name = "s1d13806fb",
2924 + .dma_mask = &s1dfb_dmamask,
2925 + .coherent_dma_mask = 0xffffffff,
2926 + .platform_data = &ek_s1dfb_pdata,
2928 + .resource = ek_s1dfb_resource,
2929 + .num_resources = ARRAY_SIZE(ek_s1dfb_resource),
2932 +static void __init ek_add_device_video(void)
2934 + platform_device_register(&ek_s1dfb_device);
2937 +static void __init ek_add_device_video(void) {}
2940 static struct at91_eth_data __initdata ek_eth_data = {
2941 .phy_irq_pin = AT91_PIN_PC4,
2944 #define EK_FLASH_SIZE 0x200000
2946 static struct physmap_flash_data ek_flash_data = {
2951 static struct resource ek_flash_resource = {
2952 @@ -132,6 +313,18 @@
2956 +static struct at91_gpio_led ek_leds[] = {
2959 + .gpio = AT91_PIN_PB1,
2960 + .trigger = "heartbeat",
2964 + .gpio = AT91_PIN_PB2,
2965 + .trigger = "timer",
2969 static void __init ek_board_init(void)
2971 @@ -158,8 +351,10 @@
2974 platform_device_register(&ek_flash);
2976 + at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
2978 -// ek_add_device_video();
2979 + ek_add_device_video();
2982 MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
2983 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-kb9202.c linux-2.6-stable/arch/arm/mach-at91/board-kb9202.c
2984 --- linux-2.6.21/arch/arm/mach-at91/board-kb9202.c Thu Apr 26 05:08:32 2007
2985 +++ linux-2.6-stable/arch/arm/mach-at91/board-kb9202.c Tue May 8 12:21:31 2007
2987 #include <asm/arch/board.h>
2988 #include <asm/arch/gpio.h>
2990 +#include <asm/arch/at91rm9200_mc.h>
2992 #include "generic.h"
2995 @@ -111,6 +113,48 @@
2996 .partition_info = nand_partitions,
3000 +#if defined(CONFIG_FB_S1D15605)
3001 +#warning "Rather pass reset pin via platform_data"
3002 +static struct resource kb9202_lcd_resources[] = {
3004 + .start = AT91_CHIPSELECT_2,
3005 + .end = AT91_CHIPSELECT_2 + 0x200FF,
3006 + .flags = IORESOURCE_MEM
3008 + [1] = { /* reset pin */
3009 + .start = AT91_PIN_PC22,
3010 + .end = AT91_PIN_PC22,
3011 + .flags = IORESOURCE_MEM
3015 +static struct platform_device kb9202_lcd_device = {
3016 + .name = "s1d15605fb",
3018 + .num_resources = ARRAY_SIZE(kb9202_lcd_resources),
3019 + .resource = kb9202_lcd_resources,
3022 +static void __init kb9202_add_device_lcd(void)
3024 + /* In case the boot loader did not set the chip select mode and timing */
3025 + at91_sys_write(AT91_SMC_CSR(2),
3026 + AT91_SMC_WSEN | AT91_SMC_NWS_(18) | AT91_SMC_TDF_(1) | AT91_SMC_DBW_8 |
3027 + AT91_SMC_RWSETUP_(1) | AT91_SMC_RWHOLD_(1));
3029 + /* Backlight pin = output, off */
3030 + at91_set_gpio_output(AT91_PIN_PC23, 0);
3032 + /* Reset pin = output, in reset */
3033 + at91_set_gpio_output(AT91_PIN_PC22, 0);
3035 + platform_device_register(&kb9202_lcd_device);
3038 +static void __init kb9202_add_device_lcd(void) {}
3041 static void __init kb9202_board_init(void)
3045 at91_add_device_spi(NULL, 0);
3047 at91_add_device_nand(&kb9202_nand_data);
3049 + kb9202_add_device_lcd();
3052 MACHINE_START(KB9200, "KB920x")
3053 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-sam9260ek.c linux-2.6-stable/arch/arm/mach-at91/board-sam9260ek.c
3054 --- linux-2.6.21/arch/arm/mach-at91/board-sam9260ek.c Thu Apr 26 05:08:32 2007
3055 +++ linux-2.6-stable/arch/arm/mach-at91/board-sam9260ek.c Tue May 8 12:13:30 2007
3060 -#if defined(CONFIG_SND_AT73C213)
3061 +#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
3062 { /* AT73C213 DAC */
3063 - .modalias = "snd_at73c213",
3064 + .modalias = "at73c213",
3066 .max_speed_hz = 10 * 1000 * 1000,
3070 * MACB Ethernet device
3072 -static struct __initdata at91_eth_data ek_macb_data = {
3073 +static struct at91_eth_data __initdata ek_macb_data = {
3074 .phy_irq_pin = AT91_PIN_PA7,
3078 at91_add_device_eth(&ek_macb_data);
3080 at91_add_device_mmc(0, &ek_mmc_data);
3082 + at91_add_device_i2c();
3085 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
3086 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-sam9261ek.c linux-2.6-stable/arch/arm/mach-at91/board-sam9261ek.c
3087 --- linux-2.6.21/arch/arm/mach-at91/board-sam9261ek.c Thu Apr 26 05:08:32 2007
3088 +++ linux-2.6-stable/arch/arm/mach-at91/board-sam9261ek.c Wed May 9 12:37:19 2007
3090 #include <linux/module.h>
3091 #include <linux/platform_device.h>
3092 #include <linux/spi/spi.h>
3093 +#include <linux/spi/ads7846.h>
3094 #include <linux/dm9000.h>
3095 +#include <linux/fb.h>
3097 +#include <video/atmel_lcdc.h>
3099 #include <asm/hardware.h>
3100 #include <asm/setup.h>
3102 /* Initialize processor: 18.432 MHz crystal */
3103 at91sam9261_initialize(18432000);
3105 + /* Setup the LEDs */
3106 + at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
3108 /* Setup the serial ports and console */
3109 at91_init_serial(&ek_uart_config);
3111 @@ -195,6 +202,41 @@
3115 + * ADS7846 Touchscreen
3117 +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
3119 +static int ads7843_pendown_state(void)
3121 + return !at91_get_gpio_value(AT91_PIN_PC2); /* Touchscreen PENIRQ */
3124 +static struct ads7846_platform_data ads_info = {
3130 + .vref_delay_usecs = 100,
3131 + .x_plate_ohms = 450,
3132 + .y_plate_ohms = 250,
3133 + .pressure_max = 15000,
3134 + .debounce_max = 1,
3135 + .debounce_rep = 0,
3136 + .debounce_tol = (~0),
3137 + .get_pendown_state = ads7843_pendown_state,
3140 +static void __init ek_add_device_ts(void)
3142 + at91_set_B_periph(AT91_PIN_PC2, 1); /* External IRQ0, with pullup */
3143 + at91_set_gpio_input(AT91_PIN_PA11, 1); /* Touchscreen BUSY signal */
3146 +static void __init ek_add_device_ts(void) {}
3152 static struct spi_board_info ek_spi_devices[] = {
3153 @@ -204,6 +246,17 @@
3154 .max_speed_hz = 15 * 1000 * 1000,
3157 +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
3159 + .modalias = "ads7846",
3161 + .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
3163 + .platform_data = &ads_info,
3164 + .irq = AT91SAM9261_ID_IRQ0,
3165 + .controller_data = AT91_PIN_PA28, /* CS pin */
3168 #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
3169 { /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
3170 .modalias = "mtd_dataflash",
3172 .max_speed_hz = 15 * 1000 * 1000,
3175 -#elif defined(CONFIG_SND_AT73C213)
3176 +#elif defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
3177 { /* AT73C213 DAC */
3178 - .modalias = "snd_at73c213",
3179 + .modalias = "at73c213",
3181 .max_speed_hz = 10 * 1000 * 1000,
3183 @@ -222,6 +275,65 @@
3190 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
3191 +static struct fb_videomode at91_tft_vga_modes[] = {
3193 + .name = "TX09D50VM1CCA @ 60",
3195 + .xres = 240, .yres = 320,
3196 + .pixclock = KHZ2PICOS(4965),
3198 + .left_margin = 1, .right_margin = 33,
3199 + .upper_margin = 1, .lower_margin = 0,
3200 + .hsync_len = 5, .vsync_len = 1,
3202 + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
3203 + .vmode = FB_VMODE_NONINTERLACED,
3207 +static struct fb_monspecs at91fb_default_monspecs = {
3208 + .manufacturer = "HIT",
3209 + .monitor = "TX09D50VM1CCA",
3211 + .modedb = at91_tft_vga_modes,
3212 + .modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
3219 +#define AT91SAM9261_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
3220 + | ATMEL_LCDC_DISTYPE_TFT \
3221 + | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
3223 +static void at91_lcdc_power_control(int on)
3226 + at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */
3228 + at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */
3232 +static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
3233 + .default_bpp = 16,
3234 + .default_dmacon = ATMEL_LCDC_DMAEN,
3235 + .default_lcdcon2 = AT91SAM9261_DEFAULT_LCDCON2,
3236 + .default_monspecs = &at91fb_default_monspecs,
3237 + .atmel_lcdfb_power_control = at91_lcdc_power_control,
3242 +static struct atmel_lcdfb_info __initdata ek_lcdc_data;
3246 static void __init ek_board_init(void)
3249 @@ -241,10 +353,14 @@
3250 #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
3252 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
3254 + ek_add_device_ts();
3257 at91_add_device_mmc(0, &ek_mmc_data);
3259 + /* LCD Controller */
3260 + at91_add_device_lcdc(&ek_lcdc_data);
3263 MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
3264 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-sam9263ek.c linux-2.6-stable/arch/arm/mach-at91/board-sam9263ek.c
3265 --- linux-2.6.21/arch/arm/mach-at91/board-sam9263ek.c Thu Apr 26 05:08:32 2007
3266 +++ linux-2.6-stable/arch/arm/mach-at91/board-sam9263ek.c Tue May 8 12:56:33 2007
3268 #include <linux/module.h>
3269 #include <linux/platform_device.h>
3270 #include <linux/spi/spi.h>
3271 +#include <linux/spi/ads7846.h>
3272 +#include <linux/fb.h>
3274 +#include <video/atmel_lcdc.h>
3276 #include <asm/hardware.h>
3277 #include <asm/setup.h>
3282 + * ADS7846 Touchscreen
3284 +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
3285 +static int ads7843_pendown_state(void)
3287 + return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */
3290 +static struct ads7846_platform_data ads_info = {
3296 + .vref_delay_usecs = 100,
3297 + .x_plate_ohms = 450,
3298 + .y_plate_ohms = 250,
3299 + .pressure_max = 15000,
3300 + .debounce_max = 1,
3301 + .debounce_rep = 0,
3302 + .debounce_tol = (~0),
3303 + .get_pendown_state = ads7843_pendown_state,
3306 +static void __init ek_add_device_ts(void)
3308 + at91_set_B_periph(AT91_PIN_PA15, 1); /* External IRQ1, with pullup */
3309 + at91_set_gpio_input(AT91_PIN_PA31, 1); /* Touchscreen BUSY signal */
3312 +static void __init ek_add_device_ts(void) {}
3318 static struct spi_board_info ek_spi_devices[] = {
3323 +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
3325 + .modalias = "ads7846",
3327 + .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
3329 + .platform_data = &ads_info,
3330 + .irq = AT91SAM9263_ID_IRQ1,
3336 @@ -112,6 +160,14 @@
3340 + * MACB Ethernet device
3342 +static struct at91_eth_data __initdata ek_macb_data = {
3350 static struct mtd_partition __initdata ek_nand_partition[] = {
3351 @@ -148,6 +204,73 @@
3358 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
3359 +static struct fb_videomode at91_tft_vga_modes[] = {
3361 + .name = "TX09D50VM1CCA @ 60",
3363 + .xres = 240, .yres = 320,
3364 + .pixclock = KHZ2PICOS(4965),
3366 + .left_margin = 1, .right_margin = 33,
3367 + .upper_margin = 1, .lower_margin = 0,
3368 + .hsync_len = 5, .vsync_len = 1,
3370 + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
3371 + .vmode = FB_VMODE_NONINTERLACED,
3375 +static struct fb_monspecs at91fb_default_monspecs = {
3376 + .manufacturer = "HIT",
3377 + .monitor = "TX09D70VM1CCA",
3379 + .modedb = at91_tft_vga_modes,
3380 + .modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
3387 +#define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
3388 + | ATMEL_LCDC_DISTYPE_TFT \
3389 + | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
3391 +static void at91_lcdc_power_control(int on)
3394 + at91_set_gpio_value(AT91_PIN_PD12, 0); /* power up */
3396 + at91_set_gpio_value(AT91_PIN_PD12, 1); /* power down */
3400 +static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
3401 + .default_bpp = 16,
3402 + .default_dmacon = ATMEL_LCDC_DMAEN,
3403 + .default_lcdcon2 = AT91SAM9263_DEFAULT_LCDCON2,
3404 + .default_monspecs = &at91fb_default_monspecs,
3405 + .atmel_lcdfb_power_control = at91_lcdc_power_control,
3410 +static struct atmel_lcdfb_info __initdata ek_lcdc_data;
3417 +static struct atmel_ac97_data ek_ac97_data = {
3418 + .reset_pin = AT91_PIN_PA13,
3422 static void __init ek_board_init(void)
3425 @@ -157,11 +280,22 @@
3427 at91_add_device_udc(&ek_udc_data);
3429 + at91_set_gpio_output(AT91_PIN_PE20, 1); /* select spi0 clock */
3430 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
3432 + ek_add_device_ts();
3434 at91_add_device_mmc(1, &ek_mmc_data);
3436 + at91_add_device_eth(&ek_macb_data);
3438 at91_add_device_nand(&ek_nand_data);
3440 + at91_add_device_i2c();
3441 + /* LCD Controller */
3442 + at91_add_device_lcdc(&ek_lcdc_data);
3444 + at91_add_device_ac97(&ek_ac97_data);
3447 MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
3448 diff -urN -x CVS linux-2.6.21/arch/arm/mach-at91/board-sam9rlek.c linux-2.6-stable/arch/arm/mach-at91/board-sam9rlek.c
3449 --- linux-2.6.21/arch/arm/mach-at91/board-sam9rlek.c Thu Jan 1 02:00:00 1970
3450 +++ linux-2.6-stable/arch/arm/mach-at91/board-sam9rlek.c Wed May 9 10:58:34 2007
3453 + * Copyright (C) 2005 SAN People
3454 + * Copyright (C) 2007 Atmel Corporation
3456 + * This file is subject to the terms and conditions of the GNU General Public
3457 + * License. See the file COPYING in the main directory of this archive for
3461 +#include <linux/types.h>
3462 +#include <linux/init.h>
3463 +#include <linux/mm.h>
3464 +#include <linux/module.h>
3465 +#include <linux/platform_device.h>
3466 +#include <linux/spi/spi.h>
3467 +#include <linux/fb.h>
3468 +#include <linux/clk.h>
3470 +#include <video/atmel_lcdc.h>
3472 +#include <asm/hardware.h>
3473 +#include <asm/setup.h>
3474 +#include <asm/mach-types.h>
3475 +#include <asm/irq.h>
3477 +#include <asm/mach/arch.h>
3478 +#include <asm/mach/map.h>
3479 +#include <asm/mach/irq.h>
3481 +#include <asm/arch/board.h>
3482 +#include <asm/arch/gpio.h>
3483 +#include <asm/arch/at91sam926x_mc.h>
3485 +#include "generic.h"
3489 + * Serial port configuration.
3490 + * 0 .. 3 = USART0 .. USART3
3493 +static struct at91_uart_config __initdata ek_uart_config = {
3494 + .console_tty = 0, /* ttyS0 */
3496 + .tty_map = { 4, 0, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
3499 +static void __init ek_map_io(void)
3501 + /* Initialize processor: 12.000 MHz crystal */
3502 + at91sam9rl_initialize(12000000);
3504 + /* Setup the serial ports and console */
3505 + at91_init_serial(&ek_uart_config);
3508 +static void __init ek_init_irq(void)
3510 + at91sam9rl_init_interrupts(NULL);
3517 +static struct at91_mmc_data __initdata ek_mmc_data = {
3519 + .det_pin = AT91_PIN_PA15,
3520 +// .wp_pin = ... not connected
3521 +// .vcc_pin = ... not connected
3528 +static struct mtd_partition __initdata ek_nand_partition[] = {
3530 + .name = "Partition 1",
3532 + .size = 256 * 1024,
3535 + .name = "Partition 2",
3536 + .offset = 256 * 1024 ,
3537 + .size = MTDPART_SIZ_FULL,
3541 +static struct mtd_partition *nand_partitions(int size, int *num_partitions)
3543 + *num_partitions = ARRAY_SIZE(ek_nand_partition);
3544 + return ek_nand_partition;
3547 +static struct at91_nand_data __initdata ek_nand_data = {
3550 +// .det_pin = ... not connected
3551 + .rdy_pin = AT91_PIN_PD17,
3552 + .enable_pin = AT91_PIN_PB6,
3553 + .partition_info = nand_partitions,
3554 + .bus_width_16 = 0,
3561 +static struct spi_board_info ek_spi_devices[] = {
3562 + { /* DataFlash chip */
3563 + .modalias = "mtd_dataflash",
3565 + .max_speed_hz = 15 * 1000 * 1000,
3574 +#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
3575 +static struct fb_videomode at91_tft_vga_modes[] = {