1 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/Kconfig linux-2.6/arch/arm/mach-at91/Kconfig
2 --- linux-2.6.25/arch/arm/mach-at91/Kconfig 2008-05-03 00:15:44.000000000 +0200
3 +++ linux-2.6/arch/arm/mach-at91/Kconfig 2008-04-25 21:15:43.000000000 +0200
6 config ARCH_AT91SAM9260
7 bool "AT91SAM9260 or AT91SAM9XE"
9 + select GENERIC_CLOCKEVENTS
11 config ARCH_AT91SAM9261
14 + select GENERIC_CLOCKEVENTS
16 config ARCH_AT91SAM9263
19 + select GENERIC_CLOCKEVENTS
21 config ARCH_AT91SAM9RL
24 + select GENERIC_CLOCKEVENTS
29 + select GENERIC_CLOCKEVENTS
34 depends on ARCH_AT91RM9200
36 Select this if you are using Ajeco's 1ARM Single Board Computer.
37 - <http://www.ajeco.fi/products.htm>
38 + <http://www.ajeco.fi/eng/products_e.htm>
40 config ARCH_AT91RM9200DK
41 bool "Atmel AT91RM9200-DK Development board"
43 depends on ARCH_AT91RM9200
45 Select this if you are using KwikByte's KB920x board.
46 - <http://kwikbyte.com/KB9202_description_new.htm>
47 + <http://www.kwikbyte.com/KB9202.html>
49 config MACH_PICOTUX2XX
53 Select this if you are using Sperry-Sun's KAFA board.
56 + bool "Promwad Chub board"
57 + depends on ARCH_AT91RM9200
59 + Select this if you are using Promwad's Chub board.
61 +config MACH_HOMEMATIC
62 + bool "eQ-3 HomeMatic"
63 + depends on ARCH_AT91RM9200
65 + Select this if you are using eQ-3's HomeMatic device.
66 + <http://www.eq-3.com>
69 + bool "emQbit ECB_AT91 SBC"
70 + depends on ARCH_AT91RM9200
72 + Select this if you are using emQbit's ECB_AT91 board.
73 + <http://wiki.emqbit.com/free-ecb-at91>
76 + bool "Sweda TMS Board"
77 + depends on ARCH_AT91RM9200
79 + Select this if you are using Sweda TMS-100 board.
82 + bool "Toptech TT9200"
83 + depends on ARCH_AT91RM9200
85 + Select this if you are using Toptech's TT9200 board.
89 # ----------------------------------------------------------
91 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
92 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
95 + bool "KwikByte KB9260 (CAM60) board"
96 + depends on ARCH_AT91SAM9260
98 + Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260.
99 + <http://www.kwikbyte.com/KB9260.html>
101 +config MACH_SAM9_L9260
102 + bool "Olimex SAM9-L9260 board"
103 + depends on ARCH_AT91SAM9260
105 + Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
106 + <http://www.olimex.com/dev/sam9-L9260.html>
108 +config MACH_USB_A9260
109 + bool "CALAO USB-A9260"
110 + depends on ARCH_AT91SAM9260
112 + Select this if you are using a Calao Systems USB-A9260.
113 + <http://www.calao-systems.com>
115 +config MACH_QIL_A9260
116 + bool "CALAO QIL-A9260 board"
117 + depends on ARCH_AT91SAM9260
119 + Select this if you are using a Calao Systems QIL-A9260 Board.
120 + <http://www.calao-systems.com>
124 # ----------------------------------------------------------
126 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
127 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
129 +config MACH_USB_A9263
130 + bool "CALAO USB-A9263"
131 + depends on ARCH_AT91SAM9263
133 + Select this if you are using a Calao Systems USB-A9263.
134 + <http://www.calao-systems.com>
138 # ----------------------------------------------------------
141 config MTD_AT91_DATAFLASH_CARD
142 bool "Enable DataFlash Card support"
143 - depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91CAP9ADK)
144 + depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK)
146 Enable support for the DataFlash card.
149 Select this if you need to program one or more of the PCK0..PCK3
150 programmable clock outputs.
152 +config AT91_SLOW_CLOCK
153 + bool "Suspend-to-RAM disables main oscillator"
156 + Select this if you want Suspend-to-RAM to save the most power
157 + possible (without powering off the CPU) by disabling the PLLs
158 + and main oscillator so that only the 32 KiHz clock is available.
160 + When only that slow-clock is available, some peripherals lose
161 + functionality. Many can't issue wakeup events unless faster
162 + clocks are available. Some lose their operating state and
163 + need to be completely re-initialized.
166 int "Kernel HZ (jiffies per second)"
168 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/Makefile linux-2.6/arch/arm/mach-at91/Makefile
169 --- linux-2.6.25/arch/arm/mach-at91/Makefile 2008-05-03 00:15:44.000000000 +0200
170 +++ linux-2.6/arch/arm/mach-at91/Makefile 2008-04-25 21:15:43.000000000 +0200
172 obj-$(CONFIG_MACH_KB9200) += board-kb9202.o
173 obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
174 obj-$(CONFIG_MACH_KAFA) += board-kafa.o
175 +obj-$(CONFIG_MACH_CHUB) += board-chub.o
176 obj-$(CONFIG_MACH_PICOTUX2XX) += board-picotux200.o
177 +obj-$(CONFIG_MACH_HOMEMATIC) += board-homematic.o
178 +obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o
179 +obj-$(CONFIG_MACH_SWEDATMS) += board-tms.o
180 +obj-$(CONFIG_MACH_TT9200) += board-tt9200.o
182 # AT91SAM9260 board-specific support
183 obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
184 +obj-$(CONFIG_MACH_CAM60) += board-cam60.o
185 +obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o
186 +obj-$(CONFIG_MACH_USB_A9260) += board-usb-a9260.o
187 +obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o
189 # AT91SAM9261 board-specific support
190 obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
192 # AT91SAM9263 board-specific support
193 obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
194 +obj-$(CONFIG_MACH_USB_A9263) += board-usb-a9263.o
196 # AT91SAM9RL board-specific support
197 obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o
202 +obj-$(CONFIG_FB_S1D13XXX) += ics1523.o
205 obj-$(CONFIG_PM) += pm.o
206 +obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
208 ifeq ($(CONFIG_PM_DEBUG),y)
209 CFLAGS_pm.o += -DDEBUG
210 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91cap9.c linux-2.6/arch/arm/mach-at91/at91cap9.c
211 --- linux-2.6.25/arch/arm/mach-at91/at91cap9.c 2008-05-03 00:15:44.000000000 +0200
212 +++ linux-2.6/arch/arm/mach-at91/at91cap9.c 2008-05-05 22:01:39.000000000 +0200
216 #include <linux/module.h>
217 +#include <linux/pm.h>
219 #include <asm/mach/arch.h>
220 #include <asm/mach/map.h>
221 +#include <asm/arch/cpu.h>
222 #include <asm/arch/at91cap9.h>
223 #include <asm/arch/at91_pmc.h>
224 #include <asm/arch/at91_rstc.h>
225 +#include <asm/arch/at91_shdwc.h>
230 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
233 +static void at91cap9_poweroff(void)
235 + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
239 /* --------------------------------------------------------------------
240 * AT91CAP9 processor initialization
241 * -------------------------------------------------------------------- */
243 iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
245 at91_arch_reset = at91cap9_reset;
246 + pm_power_off = at91cap9_poweroff;
247 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
249 /* Init clock subsystem */
252 /* Register GPIO subsystem */
253 at91_gpio_init(at91cap9_gpio, 4);
255 + /* Remember the silicon revision */
256 + if (cpu_is_at91cap9_revB())
258 + else if (cpu_is_at91cap9_revC())
262 /* --------------------------------------------------------------------
263 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91cap9_devices.c linux-2.6/arch/arm/mach-at91/at91cap9_devices.c
264 --- linux-2.6.25/arch/arm/mach-at91/at91cap9_devices.c 2008-05-03 00:15:44.000000000 +0200
265 +++ linux-2.6/arch/arm/mach-at91/at91cap9_devices.c 2008-05-05 22:01:39.000000000 +0200
268 #include <asm/mach/arch.h>
269 #include <asm/mach/map.h>
270 +#include <asm/mach/irq.h>
272 #include <linux/dma-mapping.h>
273 #include <linux/platform_device.h>
274 -#include <linux/mtd/physmap.h>
275 +#include <linux/i2c-gpio.h>
277 #include <video/atmel_lcdc.h>
279 #include <asm/arch/board.h>
280 +#include <asm/arch/cpu.h>
281 #include <asm/arch/gpio.h>
282 #include <asm/arch/at91cap9.h>
283 -#include <asm/arch/at91sam926x_mc.h>
284 #include <asm/arch/at91cap9_matrix.h>
285 +#include <asm/arch/at91sam9_smc.h>
293 + if (cpu_is_at91cap9_revB())
294 + set_irq_type(AT91CAP9_ID_UHP, IRQT_HIGH);
296 /* Enable VBus control for UHP ports */
297 for (i = 0; i < data->ports; i++) {
298 if (data->vbus_pin[i])
302 /* --------------------------------------------------------------------
303 + * USB HS Device (Gadget)
304 + * -------------------------------------------------------------------- */
306 +#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
308 +static struct resource usba_udc_resources[] = {
310 + .start = AT91CAP9_UDPHS_FIFO,
311 + .end = AT91CAP9_UDPHS_FIFO + SZ_512K - 1,
312 + .flags = IORESOURCE_MEM,
315 + .start = AT91CAP9_BASE_UDPHS,
316 + .end = AT91CAP9_BASE_UDPHS + SZ_1K - 1,
317 + .flags = IORESOURCE_MEM,
320 + .start = AT91CAP9_ID_UDPHS,
321 + .end = AT91CAP9_ID_UDPHS,
322 + .flags = IORESOURCE_IRQ,
326 +#define EP(nam, idx, maxpkt, maxbk, dma, isoc) \
330 + .fifo_size = maxpkt, \
331 + .nr_banks = maxbk, \
333 + .can_isoc = isoc, \
336 +static struct usba_ep_data usba_udc_ep[] = {
337 + EP("ep0", 0, 64, 1, 0, 0),
338 + EP("ep1", 1, 1024, 3, 1, 1),
339 + EP("ep2", 2, 1024, 3, 1, 1),
340 + EP("ep3", 3, 1024, 2, 1, 1),
341 + EP("ep4", 4, 1024, 2, 1, 1),
342 + EP("ep5", 5, 1024, 2, 1, 0),
343 + EP("ep6", 6, 1024, 2, 1, 0),
344 + EP("ep7", 7, 1024, 2, 0, 0),
350 + * pdata doesn't have room for any endpoints, so we need to
351 + * append room for the ones we need right after it.
354 + struct usba_platform_data pdata;
355 + struct usba_ep_data ep[8];
358 +static struct platform_device at91_usba_udc_device = {
359 + .name = "atmel_usba_udc",
362 + .platform_data = &usba_udc_data.pdata,
364 + .resource = usba_udc_resources,
365 + .num_resources = ARRAY_SIZE(usba_udc_resources),
368 +void __init at91_add_device_usba(struct usba_platform_data *data)
370 + if (cpu_is_at91cap9_revB()) {
371 + set_irq_type(AT91CAP9_ID_UDPHS, IRQT_HIGH);
372 + at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS |
373 + AT91_MATRIX_UDPHS_BYPASS_LOCK);
376 + at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS);
379 + * Invalid pins are 0 on AT91, but the usba driver is shared
380 + * with AVR32, which use negative values instead. Once/if
381 + * gpio_is_valid() is ported to AT91, revisit this code.
383 + usba_udc_data.pdata.vbus_pin = -EINVAL;
384 + usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
385 + memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));;
387 + if (data && data->vbus_pin > 0) {
388 + at91_set_gpio_input(data->vbus_pin, 0);
389 + at91_set_deglitch(data->vbus_pin, 1);
390 + usba_udc_data.pdata.vbus_pin = data->vbus_pin;
393 + /* Pullup pin is handled internally by USB device peripheral */
396 + at91_clock_associate("utmi_clk", &at91_usba_udc_device.dev, "hclk");
397 + at91_clock_associate("udphs_clk", &at91_usba_udc_device.dev, "pclk");
399 + platform_device_register(&at91_usba_udc_device);
402 +void __init at91_add_device_usba(struct usba_platform_data *data) {}
406 +/* --------------------------------------------------------------------
408 * -------------------------------------------------------------------- */
414 - at91_clock_associate("mci0_clk", &at91cap9_mmc1_device.dev, "mci_clk");
415 + at91_clock_associate("mci0_clk", &at91cap9_mmc0_device.dev, "mci_clk");
416 platform_device_register(&at91cap9_mmc0_device);
419 @@ -283,10 +392,15 @@
420 #define NAND_BASE AT91_CHIPSELECT_3
422 static struct resource nand_resources[] = {
426 .end = NAND_BASE + SZ_256M - 1,
427 .flags = IORESOURCE_MEM,
430 + .start = AT91_BASE_SYS + AT91_ECC,
431 + .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
432 + .flags = IORESOURCE_MEM,
437 void __init at91_add_device_nand(struct at91_nand_data *data) {}
441 /* --------------------------------------------------------------------
443 * -------------------------------------------------------------------- */
444 @@ -532,17 +647,64 @@
447 /* --------------------------------------------------------------------
448 + * Timer/Counter block
449 + * -------------------------------------------------------------------- */
451 +#ifdef CONFIG_ATMEL_TCLIB
453 +static struct resource tcb_resources[] = {
455 + .start = AT91CAP9_BASE_TCB0,
456 + .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1,
457 + .flags = IORESOURCE_MEM,
460 + .start = AT91CAP9_ID_TCB,
461 + .end = AT91CAP9_ID_TCB,
462 + .flags = IORESOURCE_IRQ,
466 +static struct platform_device at91cap9_tcb_device = {
467 + .name = "atmel_tcb",
469 + .resource = tcb_resources,
470 + .num_resources = ARRAY_SIZE(tcb_resources),
473 +static void __init at91_add_device_tc(void)
475 + /* this chip has one clock and irq for all three TC channels */
476 + at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk");
477 + platform_device_register(&at91cap9_tcb_device);
480 +static void __init at91_add_device_tc(void) { }
484 +/* --------------------------------------------------------------------
486 * -------------------------------------------------------------------- */
488 +static struct resource rtt_resources[] = {
490 + .start = AT91_BASE_SYS + AT91_RTT,
491 + .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
492 + .flags = IORESOURCE_MEM,
496 static struct platform_device at91cap9_rtt_device = {
499 - .num_resources = 0,
501 + .resource = rtt_resources,
502 + .num_resources = ARRAY_SIZE(rtt_resources),
505 static void __init at91_add_device_rtt(void)
507 + device_init_wakeup(&at91cap9_rtt_device.dev, 1);
508 platform_device_register(&at91cap9_rtt_device);
515 + if (cpu_is_at91cap9_revB())
516 + set_irq_type(AT91CAP9_ID_LCDC, IRQT_HIGH);
518 at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
519 at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
520 at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
522 at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */
525 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
526 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
527 struct platform_device *atmel_default_console_device; /* the serial console device */
529 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
530 @@ -1031,8 +1196,6 @@
532 if (portnr < ATMEL_MAX_UART)
533 atmel_default_console_device = at91_uarts[portnr];
534 - if (!atmel_default_console_device)
535 - printk(KERN_INFO "AT91: No default serial console defined.\n");
538 void __init at91_add_device_serial(void)
539 @@ -1043,6 +1206,9 @@
541 platform_device_register(at91_uarts[i]);
544 + if (!atmel_default_console_device)
545 + printk(KERN_INFO "AT91: No default serial console defined.\n");
548 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
549 @@ -1060,6 +1226,7 @@
551 at91_add_device_rtt();
552 at91_add_device_watchdog();
553 + at91_add_device_tc();
557 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91rm9200_devices.c linux-2.6/arch/arm/mach-at91/at91rm9200_devices.c
558 --- linux-2.6.25/arch/arm/mach-at91/at91rm9200_devices.c 2008-05-03 00:15:44.000000000 +0200
559 +++ linux-2.6/arch/arm/mach-at91/at91rm9200_devices.c 2008-04-25 21:15:43.000000000 +0200
562 * -------------------------------------------------------------------- */
564 -#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
565 +#if defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE) /* legacy SPI driver */
566 +#define SPI_DEVNAME "at91_spi"
568 +#elif defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) /* SPI bitbanging driver */
569 +#define SPI_DEVNAME "at91_spi"
571 +#elif defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) /* new SPI driver */
572 +#define SPI_DEVNAME "atmel_spi"
577 static u64 spi_dmamask = DMA_BIT_MASK(32);
579 static struct resource spi_resources[] = {
583 static struct platform_device at91rm9200_spi_device = {
584 - .name = "atmel_spi",
585 + .name = SPI_DEVNAME,
588 .dma_mask = &spi_dmamask,
591 at91_set_gpio_output(cs_pin, 1);
593 +#if defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)
595 + * Force peripheral mode when using the legacy SPI driver.
597 + at91_set_A_periph(cs_pin, 0);
600 /* pass chip-select pin to driver */
601 devices[i].controller_data = (void *) cs_pin;
605 /* --------------------------------------------------------------------
606 + * Timer/Counter blocks
607 + * -------------------------------------------------------------------- */
609 +#ifdef CONFIG_ATMEL_TCLIB
611 +static struct resource tcb0_resources[] = {
613 + .start = AT91RM9200_BASE_TCB0,
614 + .end = AT91RM9200_BASE_TCB0 + SZ_16K - 1,
615 + .flags = IORESOURCE_MEM,
618 + .start = AT91RM9200_ID_TC0,
619 + .end = AT91RM9200_ID_TC0,
620 + .flags = IORESOURCE_IRQ,
623 + .start = AT91RM9200_ID_TC1,
624 + .end = AT91RM9200_ID_TC1,
625 + .flags = IORESOURCE_IRQ,
628 + .start = AT91RM9200_ID_TC2,
629 + .end = AT91RM9200_ID_TC2,
630 + .flags = IORESOURCE_IRQ,
634 +static struct platform_device at91rm9200_tcb0_device = {
635 + .name = "atmel_tcb",
637 + .resource = tcb0_resources,
638 + .num_resources = ARRAY_SIZE(tcb0_resources),
641 +static struct resource tcb1_resources[] = {
643 + .start = AT91RM9200_BASE_TCB1,
644 + .end = AT91RM9200_BASE_TCB1 + SZ_16K - 1,
645 + .flags = IORESOURCE_MEM,
648 + .start = AT91RM9200_ID_TC3,
649 + .end = AT91RM9200_ID_TC3,
650 + .flags = IORESOURCE_IRQ,
653 + .start = AT91RM9200_ID_TC4,
654 + .end = AT91RM9200_ID_TC4,
655 + .flags = IORESOURCE_IRQ,
658 + .start = AT91RM9200_ID_TC5,
659 + .end = AT91RM9200_ID_TC5,
660 + .flags = IORESOURCE_IRQ,
664 +static struct platform_device at91rm9200_tcb1_device = {
665 + .name = "atmel_tcb",
667 + .resource = tcb1_resources,
668 + .num_resources = ARRAY_SIZE(tcb1_resources),
671 +static void __init at91_add_device_tc(void)
673 + /* this chip has a separate clock and irq for each TC channel */
674 + at91_clock_associate("tc0_clk", &at91rm9200_tcb0_device.dev, "t0_clk");
675 + at91_clock_associate("tc1_clk", &at91rm9200_tcb0_device.dev, "t1_clk");
676 + at91_clock_associate("tc2_clk", &at91rm9200_tcb0_device.dev, "t2_clk");
677 + platform_device_register(&at91rm9200_tcb0_device);
679 + at91_clock_associate("tc3_clk", &at91rm9200_tcb1_device.dev, "t0_clk");
680 + at91_clock_associate("tc4_clk", &at91rm9200_tcb1_device.dev, "t1_clk");
681 + at91_clock_associate("tc5_clk", &at91rm9200_tcb1_device.dev, "t2_clk");
682 + platform_device_register(&at91rm9200_tcb1_device);
685 +static void __init at91_add_device_tc(void) { }
689 +/* --------------------------------------------------------------------
691 * -------------------------------------------------------------------- */
695 static void __init at91_add_device_rtc(void)
697 + device_init_wakeup(&at91rm9200_rtc_device.dev, 1);
698 platform_device_register(&at91rm9200_rtc_device);
701 @@ -1019,7 +1121,7 @@
702 at91_set_B_periph(AT91_PIN_PB0, 0); /* RTS3 */
705 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
706 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
707 struct platform_device *atmel_default_console_device; /* the serial console device */
709 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
710 @@ -1110,8 +1212,6 @@
712 if (portnr < ATMEL_MAX_UART)
713 atmel_default_console_device = at91_uarts[portnr];
714 - if (!atmel_default_console_device)
715 - printk(KERN_INFO "AT91: No default serial console defined.\n");
718 void __init at91_add_device_serial(void)
719 @@ -1122,6 +1222,9 @@
721 platform_device_register(at91_uarts[i]);
724 + if (!atmel_default_console_device)
725 + printk(KERN_INFO "AT91: No default serial console defined.\n");
728 void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
729 @@ -1141,6 +1244,7 @@
731 at91_add_device_rtc();
732 at91_add_device_watchdog();
733 + at91_add_device_tc();
737 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91rm9200_time.c linux-2.6/arch/arm/mach-at91/at91rm9200_time.c
738 --- linux-2.6.25/arch/arm/mach-at91/at91rm9200_time.c 2008-05-03 00:15:33.000000000 +0200
739 +++ linux-2.6/arch/arm/mach-at91/at91rm9200_time.c 2008-04-25 21:15:43.000000000 +0200
746 /* Use "raw" primitives so we behave correctly on RT kernels. */
747 raw_local_irq_save(flags);
749 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9260.c linux-2.6/arch/arm/mach-at91/at91sam9260.c
750 --- linux-2.6.25/arch/arm/mach-at91/at91sam9260.c 2008-05-03 00:15:44.000000000 +0200
751 +++ linux-2.6/arch/arm/mach-at91/at91sam9260.c 2008-04-25 21:15:43.000000000 +0200
755 #include <linux/module.h>
756 +#include <linux/pm.h>
758 #include <asm/mach/arch.h>
759 #include <asm/mach/map.h>
761 #include <asm/arch/at91sam9260.h>
762 #include <asm/arch/at91_pmc.h>
763 #include <asm/arch/at91_rstc.h>
764 +#include <asm/arch/at91_shdwc.h>
769 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
772 +static void at91sam9260_poweroff(void)
774 + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
778 /* --------------------------------------------------------------------
779 * AT91SAM9260 processor initialization
781 iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
783 at91_arch_reset = at91sam9260_reset;
784 + pm_power_off = at91sam9260_poweroff;
785 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
786 | (1 << AT91SAM9260_ID_IRQ2);
788 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9260_devices.c linux-2.6/arch/arm/mach-at91/at91sam9260_devices.c
789 --- linux-2.6.25/arch/arm/mach-at91/at91sam9260_devices.c 2008-05-03 00:15:44.000000000 +0200
790 +++ linux-2.6/arch/arm/mach-at91/at91sam9260_devices.c 2008-04-25 21:15:43.000000000 +0200
792 #include <asm/arch/board.h>
793 #include <asm/arch/gpio.h>
794 #include <asm/arch/at91sam9260.h>
795 -#include <asm/arch/at91sam926x_mc.h>
796 #include <asm/arch/at91sam9260_matrix.h>
797 +#include <asm/arch/at91sam9_smc.h>
801 @@ -288,10 +288,15 @@
802 #define NAND_BASE AT91_CHIPSELECT_3
804 static struct resource nand_resources[] = {
808 .end = NAND_BASE + SZ_256M - 1,
809 .flags = IORESOURCE_MEM,
812 + .start = AT91_BASE_SYS + AT91_ECC,
813 + .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
814 + .flags = IORESOURCE_MEM,
821 /* --------------------------------------------------------------------
822 + * Timer/Counter blocks
823 + * -------------------------------------------------------------------- */
825 +#ifdef CONFIG_ATMEL_TCLIB
827 +static struct resource tcb0_resources[] = {
829 + .start = AT91SAM9260_BASE_TCB0,
830 + .end = AT91SAM9260_BASE_TCB0 + SZ_16K - 1,
831 + .flags = IORESOURCE_MEM,
834 + .start = AT91SAM9260_ID_TC0,
835 + .end = AT91SAM9260_ID_TC0,
836 + .flags = IORESOURCE_IRQ,
839 + .start = AT91SAM9260_ID_TC1,
840 + .end = AT91SAM9260_ID_TC1,
841 + .flags = IORESOURCE_IRQ,
844 + .start = AT91SAM9260_ID_TC2,
845 + .end = AT91SAM9260_ID_TC2,
846 + .flags = IORESOURCE_IRQ,
850 +static struct platform_device at91sam9260_tcb0_device = {
851 + .name = "atmel_tcb",
853 + .resource = tcb0_resources,
854 + .num_resources = ARRAY_SIZE(tcb0_resources),
857 +static struct resource tcb1_resources[] = {
859 + .start = AT91SAM9260_BASE_TCB1,
860 + .end = AT91SAM9260_BASE_TCB1 + SZ_16K - 1,
861 + .flags = IORESOURCE_MEM,
864 + .start = AT91SAM9260_ID_TC3,
865 + .end = AT91SAM9260_ID_TC3,
866 + .flags = IORESOURCE_IRQ,
869 + .start = AT91SAM9260_ID_TC4,
870 + .end = AT91SAM9260_ID_TC4,
871 + .flags = IORESOURCE_IRQ,
874 + .start = AT91SAM9260_ID_TC5,
875 + .end = AT91SAM9260_ID_TC5,
876 + .flags = IORESOURCE_IRQ,
880 +static struct platform_device at91sam9260_tcb1_device = {
881 + .name = "atmel_tcb",
883 + .resource = tcb1_resources,
884 + .num_resources = ARRAY_SIZE(tcb1_resources),
887 +static void __init at91_add_device_tc(void)
889 + /* this chip has a separate clock and irq for each TC channel */
890 + at91_clock_associate("tc0_clk", &at91sam9260_tcb0_device.dev, "t0_clk");
891 + at91_clock_associate("tc1_clk", &at91sam9260_tcb0_device.dev, "t1_clk");
892 + at91_clock_associate("tc2_clk", &at91sam9260_tcb0_device.dev, "t2_clk");
893 + platform_device_register(&at91sam9260_tcb0_device);
895 + at91_clock_associate("tc3_clk", &at91sam9260_tcb1_device.dev, "t0_clk");
896 + at91_clock_associate("tc4_clk", &at91sam9260_tcb1_device.dev, "t1_clk");
897 + at91_clock_associate("tc5_clk", &at91sam9260_tcb1_device.dev, "t2_clk");
898 + platform_device_register(&at91sam9260_tcb1_device);
901 +static void __init at91_add_device_tc(void) { }
905 +/* --------------------------------------------------------------------
907 * -------------------------------------------------------------------- */
909 @@ -553,13 +642,14 @@
911 static struct platform_device at91sam9260_rtt_device = {
915 .resource = rtt_resources,
916 .num_resources = ARRAY_SIZE(rtt_resources),
919 static void __init at91_add_device_rtt(void)
921 + device_init_wakeup(&at91sam9260_rtt_device.dev, 1);
922 platform_device_register(&at91sam9260_rtt_device);
926 at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */
929 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
930 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
931 struct platform_device *atmel_default_console_device; /* the serial console device */
933 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
934 @@ -1073,8 +1163,6 @@
936 if (portnr < ATMEL_MAX_UART)
937 atmel_default_console_device = at91_uarts[portnr];
938 - if (!atmel_default_console_device)
939 - printk(KERN_INFO "AT91: No default serial console defined.\n");
942 void __init at91_add_device_serial(void)
943 @@ -1085,6 +1173,9 @@
945 platform_device_register(at91_uarts[i]);
948 + if (!atmel_default_console_device)
949 + printk(KERN_INFO "AT91: No default serial console defined.\n");
952 void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
953 @@ -1103,6 +1194,7 @@
955 at91_add_device_rtt();
956 at91_add_device_watchdog();
957 + at91_add_device_tc();
961 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9261.c linux-2.6/arch/arm/mach-at91/at91sam9261.c
962 --- linux-2.6.25/arch/arm/mach-at91/at91sam9261.c 2008-05-03 00:15:44.000000000 +0200
963 +++ linux-2.6/arch/arm/mach-at91/at91sam9261.c 2008-04-25 21:15:43.000000000 +0200
967 #include <linux/module.h>
968 +#include <linux/pm.h>
970 #include <asm/mach/arch.h>
971 #include <asm/mach/map.h>
972 #include <asm/arch/at91sam9261.h>
973 #include <asm/arch/at91_pmc.h>
974 #include <asm/arch/at91_rstc.h>
975 +#include <asm/arch/at91_shdwc.h>
980 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
983 +static void at91sam9261_poweroff(void)
985 + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
989 /* --------------------------------------------------------------------
990 * AT91SAM9261 processor initialization
992 iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
994 at91_arch_reset = at91sam9261_reset;
995 + pm_power_off = at91sam9261_poweroff;
996 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
997 | (1 << AT91SAM9261_ID_IRQ2);
999 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9261_devices.c linux-2.6/arch/arm/mach-at91/at91sam9261_devices.c
1000 --- linux-2.6.25/arch/arm/mach-at91/at91sam9261_devices.c 2008-05-03 00:15:44.000000000 +0200
1001 +++ linux-2.6/arch/arm/mach-at91/at91sam9261_devices.c 2008-04-25 21:15:43.000000000 +0200
1003 #include <asm/arch/gpio.h>
1004 #include <asm/arch/at91sam9261.h>
1005 #include <asm/arch/at91sam9261_matrix.h>
1006 -#include <asm/arch/at91sam926x_mc.h>
1007 +#include <asm/arch/at91sam9_smc.h>
1009 #include "generic.h"
1011 @@ -548,6 +548,55 @@
1014 /* --------------------------------------------------------------------
1015 + * Timer/Counter block
1016 + * -------------------------------------------------------------------- */
1018 +#ifdef CONFIG_ATMEL_TCLIB
1020 +static struct resource tcb_resources[] = {
1022 + .start = AT91SAM9261_BASE_TCB0,
1023 + .end = AT91SAM9261_BASE_TCB0 + SZ_16K - 1,
1024 + .flags = IORESOURCE_MEM,
1027 + .start = AT91SAM9261_ID_TC0,
1028 + .end = AT91SAM9261_ID_TC0,
1029 + .flags = IORESOURCE_IRQ,
1032 + .start = AT91SAM9261_ID_TC1,
1033 + .end = AT91SAM9261_ID_TC1,
1034 + .flags = IORESOURCE_IRQ,
1037 + .start = AT91SAM9261_ID_TC2,
1038 + .end = AT91SAM9261_ID_TC2,
1039 + .flags = IORESOURCE_IRQ,
1043 +static struct platform_device at91sam9261_tcb_device = {
1044 + .name = "atmel_tcb",
1046 + .resource = tcb_resources,
1047 + .num_resources = ARRAY_SIZE(tcb_resources),
1050 +static void __init at91_add_device_tc(void)
1052 + /* this chip has a separate clock and irq for each TC channel */
1053 + at91_clock_associate("tc0_clk", &at91sam9261_tcb_device.dev, "t0_clk");
1054 + at91_clock_associate("tc1_clk", &at91sam9261_tcb_device.dev, "t1_clk");
1055 + at91_clock_associate("tc2_clk", &at91sam9261_tcb_device.dev, "t2_clk");
1056 + platform_device_register(&at91sam9261_tcb_device);
1059 +static void __init at91_add_device_tc(void) { }
1063 +/* --------------------------------------------------------------------
1065 * -------------------------------------------------------------------- */
1067 @@ -561,13 +610,14 @@
1069 static struct platform_device at91sam9261_rtt_device = {
1073 .resource = rtt_resources,
1074 .num_resources = ARRAY_SIZE(rtt_resources),
1077 static void __init at91_add_device_rtt(void)
1079 + device_init_wakeup(&at91sam9261_rtt_device.dev, 1);
1080 platform_device_register(&at91sam9261_rtt_device);
1084 at91_set_B_periph(AT91_PIN_PA16, 0); /* CTS2 */
1087 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1088 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1089 struct platform_device *atmel_default_console_device; /* the serial console device */
1091 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
1092 @@ -1019,8 +1069,6 @@
1094 if (portnr < ATMEL_MAX_UART)
1095 atmel_default_console_device = at91_uarts[portnr];
1096 - if (!atmel_default_console_device)
1097 - printk(KERN_INFO "AT91: No default serial console defined.\n");
1100 void __init at91_add_device_serial(void)
1101 @@ -1031,6 +1079,9 @@
1103 platform_device_register(at91_uarts[i]);
1106 + if (!atmel_default_console_device)
1107 + printk(KERN_INFO "AT91: No default serial console defined.\n");
1110 void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
1111 @@ -1050,6 +1101,7 @@
1113 at91_add_device_rtt();
1114 at91_add_device_watchdog();
1115 + at91_add_device_tc();
1119 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9263.c linux-2.6/arch/arm/mach-at91/at91sam9263.c
1120 --- linux-2.6.25/arch/arm/mach-at91/at91sam9263.c 2008-05-03 00:15:44.000000000 +0200
1121 +++ linux-2.6/arch/arm/mach-at91/at91sam9263.c 2008-04-25 21:15:43.000000000 +0200
1125 #include <linux/module.h>
1126 +#include <linux/pm.h>
1128 #include <asm/mach/arch.h>
1129 #include <asm/mach/map.h>
1130 #include <asm/arch/at91sam9263.h>
1131 #include <asm/arch/at91_pmc.h>
1132 #include <asm/arch/at91_rstc.h>
1133 +#include <asm/arch/at91_shdwc.h>
1135 #include "generic.h"
1137 @@ -271,6 +273,11 @@
1138 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
1141 +static void at91sam9263_poweroff(void)
1143 + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
1147 /* --------------------------------------------------------------------
1148 * AT91SAM9263 processor initialization
1150 iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc));
1152 at91_arch_reset = at91sam9263_reset;
1153 + pm_power_off = at91sam9263_poweroff;
1154 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
1156 /* Init clock subsystem */
1157 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9263_devices.c linux-2.6/arch/arm/mach-at91/at91sam9263_devices.c
1158 --- linux-2.6.25/arch/arm/mach-at91/at91sam9263_devices.c 2008-05-03 00:15:44.000000000 +0200
1159 +++ linux-2.6/arch/arm/mach-at91/at91sam9263_devices.c 2008-04-25 21:16:23.000000000 +0200
1161 #include <asm/arch/board.h>
1162 #include <asm/arch/gpio.h>
1163 #include <asm/arch/at91sam9263.h>
1164 -#include <asm/arch/at91sam926x_mc.h>
1165 #include <asm/arch/at91sam9263_matrix.h>
1166 +#include <asm/arch/at91sam9_smc.h>
1168 #include "generic.h"
1174 - at91_clock_associate("mci0_clk", &at91sam9263_mmc1_device.dev, "mci_clk");
1175 + at91_clock_associate("mci0_clk", &at91sam9263_mmc0_device.dev, "mci_clk");
1176 platform_device_register(&at91sam9263_mmc0_device);
1179 @@ -358,10 +358,15 @@
1180 #define NAND_BASE AT91_CHIPSELECT_3
1182 static struct resource nand_resources[] = {
1186 .end = NAND_BASE + SZ_256M - 1,
1187 .flags = IORESOURCE_MEM,
1190 + .start = AT91_BASE_SYS + AT91_ECC0,
1191 + .end = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1,
1192 + .flags = IORESOURCE_MEM,
1196 @@ -783,6 +788,43 @@
1199 /* --------------------------------------------------------------------
1200 + * Timer/Counter block
1201 + * -------------------------------------------------------------------- */
1203 +#ifdef CONFIG_ATMEL_TCLIB
1205 +static struct resource tcb_resources[] = {
1207 + .start = AT91SAM9263_BASE_TCB0,
1208 + .end = AT91SAM9263_BASE_TCB0 + SZ_16K - 1,
1209 + .flags = IORESOURCE_MEM,
1212 + .start = AT91SAM9263_ID_TCB,
1213 + .end = AT91SAM9263_ID_TCB,
1214 + .flags = IORESOURCE_IRQ,
1218 +static struct platform_device at91sam9263_tcb_device = {
1219 + .name = "atmel_tcb",
1221 + .resource = tcb_resources,
1222 + .num_resources = ARRAY_SIZE(tcb_resources),
1225 +static void __init at91_add_device_tc(void)
1227 + /* this chip has one clock and irq for all three TC channels */
1228 + at91_clock_associate("tcb_clk", &at91sam9263_tcb_device.dev, "t0_clk");
1229 + platform_device_register(&at91sam9263_tcb_device);
1232 +static void __init at91_add_device_tc(void) { }
1236 +/* --------------------------------------------------------------------
1238 * -------------------------------------------------------------------- */
1242 static void __init at91_add_device_rtt(void)
1244 + device_init_wakeup(&at91sam9263_rtt0_device.dev, 1);
1245 platform_device_register(&at91sam9263_rtt0_device);
1246 + device_init_wakeup(&at91sam9263_rtt1_device.dev, 1);
1247 platform_device_register(&at91sam9263_rtt1_device);
1254 - * Return the device node so that board init code can use it as the
1255 - * parent for the device node reflecting how it's used on this board.
1257 * SSC controllers are accessed through library code, instead of any
1258 * kind of all-singing/all-dancing driver. For example one could be
1259 * used by a particular I2S audio codec's driver, while another one
1260 @@ -1146,7 +1187,7 @@
1261 at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */
1264 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1265 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1266 struct platform_device *atmel_default_console_device; /* the serial console device */
1268 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
1269 @@ -1227,8 +1268,6 @@
1271 if (portnr < ATMEL_MAX_UART)
1272 atmel_default_console_device = at91_uarts[portnr];
1273 - if (!atmel_default_console_device)
1274 - printk(KERN_INFO "AT91: No default serial console defined.\n");
1277 void __init at91_add_device_serial(void)
1278 @@ -1239,9 +1278,12 @@
1280 platform_device_register(at91_uarts[i]);
1283 + if (!atmel_default_console_device)
1284 + printk(KERN_INFO "AT91: No default serial console defined.\n");
1287 -void __init at91_init_serial(struct at91_uart_config *config) {}
1288 +void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
1289 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
1290 void __init at91_set_serial_console(unsigned portnr) {}
1291 void __init at91_add_device_serial(void) {}
1292 @@ -1257,6 +1299,7 @@
1294 at91_add_device_rtt();
1295 at91_add_device_watchdog();
1296 + at91_add_device_tc();
1300 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam926x_time.c linux-2.6/arch/arm/mach-at91/at91sam926x_time.c
1301 --- linux-2.6.25/arch/arm/mach-at91/at91sam926x_time.c 2008-05-03 00:15:44.000000000 +0200
1302 +++ linux-2.6/arch/arm/mach-at91/at91sam926x_time.c 2008-04-25 21:15:43.000000000 +0200
1305 - * linux/arch/arm/mach-at91/at91sam926x_time.c
1306 + * at91sam926x_time.c - Periodic Interval Timer (PIT) for at91sam926x
1308 * Copyright (C) 2005-2006 M. Amine SAYA, ATMEL Rousset, France
1309 * Revision 2005 M. Nicolas Diremdjian, ATMEL Rousset, France
1310 + * Converted to ClockSource/ClockEvents by David Brownell.
1312 * This program is free software; you can redistribute it and/or modify
1313 * it under the terms of the GNU General Public License version 2 as
1314 * published by the Free Software Foundation.
1317 -#include <linux/init.h>
1318 #include <linux/interrupt.h>
1319 #include <linux/irq.h>
1320 #include <linux/kernel.h>
1321 -#include <linux/sched.h>
1322 -#include <linux/time.h>
1323 +#include <linux/clk.h>
1324 +#include <linux/clockchips.h>
1326 -#include <asm/hardware.h>
1327 -#include <asm/io.h>
1328 #include <asm/mach/time.h>
1330 #include <asm/arch/at91_pit.h>
1331 @@ -26,85 +23,167 @@
1332 #define PIT_CPIV(x) ((x) & AT91_PIT_CPIV)
1333 #define PIT_PICNT(x) (((x) & AT91_PIT_PICNT) >> 20)
1335 +static u32 pit_cycle; /* write-once */
1336 +static u32 pit_cnt; /* access only w/system irq blocked */
1340 - * Returns number of microseconds since last timer interrupt. Note that interrupts
1341 - * will have been disabled by do_gettimeofday()
1342 - * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
1343 + * Clocksource: just a monotonic counter of MCK/16 cycles.
1344 + * We don't care whether or not PIT irqs are enabled.
1346 -static unsigned long at91sam926x_gettimeoffset(void)
1347 +static cycle_t read_pit_clk(void)
1349 - unsigned long elapsed;
1350 - unsigned long t = at91_sys_read(AT91_PIT_PIIR);
1351 + unsigned long flags;
1355 + raw_local_irq_save(flags);
1356 + elapsed = pit_cnt;
1357 + t = at91_sys_read(AT91_PIT_PIIR);
1358 + raw_local_irq_restore(flags);
1360 + elapsed += PIT_PICNT(t) * pit_cycle;
1361 + elapsed += PIT_CPIV(t);
1365 +static struct clocksource pit_clk = {
1368 + .read = read_pit_clk,
1370 + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
1374 - elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t); /* hardware clock cycles */
1376 + * Clockevent device: interrupts every 1/HZ (== pit_cycles * MCK/16)
1379 +pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
1381 + unsigned long flags;
1383 - return (unsigned long)(elapsed * jiffies_to_usecs(1)) / LATCH;
1385 + case CLOCK_EVT_MODE_PERIODIC:
1386 + /* update clocksource counter, then enable the IRQ */
1387 + raw_local_irq_save(flags);
1388 + pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
1389 + at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
1390 + | AT91_PIT_PITIEN);
1391 + raw_local_irq_restore(flags);
1393 + case CLOCK_EVT_MODE_ONESHOT:
1396 + case CLOCK_EVT_MODE_SHUTDOWN:
1397 + case CLOCK_EVT_MODE_UNUSED:
1398 + /* disable irq, leaving the clocksource active */
1399 + at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
1401 + case CLOCK_EVT_MODE_RESUME:
1406 +static struct clock_event_device pit_clkevt = {
1408 + .features = CLOCK_EVT_FEAT_PERIODIC,
1411 + .cpumask = CPU_MASK_CPU0,
1412 + .set_mode = pit_clkevt_mode,
1417 * IRQ handler for the timer.
1419 -static irqreturn_t at91sam926x_timer_interrupt(int irq, void *dev_id)
1420 +static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
1422 - volatile long nr_ticks;
1424 - if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) { /* This is a shared interrupt */
1425 - /* Get number to ticks performed before interrupt and clear PIT interrupt */
1426 + /* The PIT interrupt may be disabled, and is shared */
1427 + if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC)
1428 + && (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS)) {
1429 + unsigned nr_ticks;
1431 + /* Get number of ticks performed before irq, and ack it */
1432 nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
1435 + pit_cnt += pit_cycle;
1436 + pit_clkevt.event_handler(&pit_clkevt);
1442 - return IRQ_NONE; /* not handled */
1448 -static struct irqaction at91sam926x_timer_irq = {
1449 +static struct irqaction at91sam926x_pit_irq = {
1450 .name = "at91_tick",
1451 .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
1452 - .handler = at91sam926x_timer_interrupt
1453 + .handler = at91sam926x_pit_interrupt
1456 -void at91sam926x_timer_reset(void)
1457 +static void at91sam926x_pit_reset(void)
1459 - /* Disable timer */
1460 + /* Disable timer and irqs */
1461 at91_sys_write(AT91_PIT_MR, 0);
1463 - /* Clear any pending interrupts */
1464 - (void) at91_sys_read(AT91_PIT_PIVR);
1465 + /* Clear any pending interrupts, wait for PIT to stop counting */
1466 + while (PIT_CPIV(at91_sys_read(AT91_PIT_PIVR)) != 0)
1469 - /* Set Period Interval timer and enable its interrupt */
1470 - at91_sys_write(AT91_PIT_MR, (LATCH & AT91_PIT_PIV) | AT91_PIT_PITIEN | AT91_PIT_PITEN);
1471 + /* Start PIT but don't enable IRQ */
1472 + at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
1476 - * Set up timer interrupt.
1477 + * Set up both clocksource and clockevent support.
1479 -void __init at91sam926x_timer_init(void)
1480 +static void __init at91sam926x_pit_init(void)
1482 + unsigned long pit_rate;
1486 + * Use our actual MCK to figure out how many MCK/16 ticks per
1487 + * 1/HZ period (instead of a compile-time constant LATCH).
1489 + pit_rate = clk_get_rate(clk_get(NULL, "mck")) / 16;
1490 + pit_cycle = (pit_rate + HZ/2) / HZ;
1491 + WARN_ON(((pit_cycle - 1) & ~AT91_PIT_PIV) != 0);
1493 /* Initialize and enable the timer */
1494 - at91sam926x_timer_reset();
1495 + at91sam926x_pit_reset();
1497 - /* Make IRQs happen for the system timer. */
1498 - setup_irq(AT91_ID_SYS, &at91sam926x_timer_irq);
1500 + * Register clocksource. The high order bits of PIV are unused,
1501 + * so this isn't a 32-bit counter unless we get clockevent irqs.
1503 + pit_clk.mult = clocksource_hz2mult(pit_rate, pit_clk.shift);
1504 + bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */;
1505 + pit_clk.mask = CLOCKSOURCE_MASK(bits);
1506 + clocksource_register(&pit_clk);
1508 + /* Set up irq handler */
1509 + setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
1511 + /* Set up and register clockevents */
1512 + pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift);
1513 + clockevents_register_device(&pit_clkevt);
1517 -static void at91sam926x_timer_suspend(void)
1518 +static void at91sam926x_pit_suspend(void)
1521 at91_sys_write(AT91_PIT_MR, 0);
1524 -#define at91sam926x_timer_suspend NULL
1527 struct sys_timer at91sam926x_timer = {
1528 - .init = at91sam926x_timer_init,
1529 - .offset = at91sam926x_gettimeoffset,
1530 - .suspend = at91sam926x_timer_suspend,
1531 - .resume = at91sam926x_timer_reset,
1532 + .init = at91sam926x_pit_init,
1533 + .suspend = at91sam926x_pit_suspend,
1534 + .resume = at91sam926x_pit_reset,
1537 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9rl.c linux-2.6/arch/arm/mach-at91/at91sam9rl.c
1538 --- linux-2.6.25/arch/arm/mach-at91/at91sam9rl.c 2007-10-09 22:31:38.000000000 +0200
1539 +++ linux-2.6/arch/arm/mach-at91/at91sam9rl.c 2008-04-25 21:15:43.000000000 +0200
1543 #include <linux/module.h>
1544 +#include <linux/pm.h>
1546 #include <asm/mach/arch.h>
1547 #include <asm/mach/map.h>
1549 #include <asm/arch/at91sam9rl.h>
1550 #include <asm/arch/at91_pmc.h>
1551 #include <asm/arch/at91_rstc.h>
1552 +#include <asm/arch/at91_shdwc.h>
1554 #include "generic.h"
1556 @@ -244,6 +246,11 @@
1557 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
1560 +static void at91sam9rl_poweroff(void)
1562 + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
1566 /* --------------------------------------------------------------------
1567 * AT91SAM9RL processor initialization
1569 iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
1571 at91_arch_reset = at91sam9rl_reset;
1572 + pm_power_off = at91sam9rl_poweroff;
1573 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
1575 /* Init clock subsystem */
1576 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/at91sam9rl_devices.c linux-2.6/arch/arm/mach-at91/at91sam9rl_devices.c
1577 --- linux-2.6.25/arch/arm/mach-at91/at91sam9rl_devices.c 2008-05-03 00:15:44.000000000 +0200
1578 +++ linux-2.6/arch/arm/mach-at91/at91sam9rl_devices.c 2008-05-02 00:52:36.000000000 +0200
1579 @@ -20,12 +20,107 @@
1580 #include <asm/arch/gpio.h>
1581 #include <asm/arch/at91sam9rl.h>
1582 #include <asm/arch/at91sam9rl_matrix.h>
1583 -#include <asm/arch/at91sam926x_mc.h>
1584 +#include <asm/arch/at91sam9_smc.h>
1586 #include "generic.h"
1589 /* --------------------------------------------------------------------
1590 + * USB HS Device (Gadget)
1591 + * -------------------------------------------------------------------- */
1593 +#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
1595 +static struct resource usba_udc_resources[] = {
1597 + .start = AT91SAM9RL_UDPHS_FIFO,
1598 + .end = AT91SAM9RL_UDPHS_FIFO + SZ_512K - 1,
1599 + .flags = IORESOURCE_MEM,
1602 + .start = AT91SAM9RL_BASE_UDPHS,
1603 + .end = AT91SAM9RL_BASE_UDPHS + SZ_1K - 1,
1604 + .flags = IORESOURCE_MEM,
1607 + .start = AT91SAM9RL_ID_UDPHS,
1608 + .end = AT91SAM9RL_ID_UDPHS,
1609 + .flags = IORESOURCE_IRQ,
1613 +#define EP(nam, idx, maxpkt, maxbk, dma, isoc) \
1617 + .fifo_size = maxpkt, \
1618 + .nr_banks = maxbk, \
1620 + .can_isoc = isoc, \
1623 +static struct usba_ep_data usba_udc_ep[] __initdata = {
1624 + EP("ep0", 0, 64, 1, 0, 0),
1625 + EP("ep1", 1, 1024, 2, 1, 1),
1626 + EP("ep2", 2, 1024, 2, 1, 1),
1627 + EP("ep3", 3, 1024, 3, 1, 0),
1628 + EP("ep4", 4, 1024, 3, 1, 0),
1629 + EP("ep5", 5, 1024, 3, 1, 1),
1630 + EP("ep6", 6, 1024, 3, 1, 1),
1636 + * pdata doesn't have room for any endpoints, so we need to
1637 + * append room for the ones we need right after it.
1640 + struct usba_platform_data pdata;
1641 + struct usba_ep_data ep[7];
1644 +static struct platform_device at91_usba_udc_device = {
1645 + .name = "atmel_usba_udc",
1648 + .platform_data = &usba_udc_data.pdata,
1650 + .resource = usba_udc_resources,
1651 + .num_resources = ARRAY_SIZE(usba_udc_resources),
1654 +void __init at91_add_device_usba(struct usba_platform_data *data)
1657 + * Invalid pins are 0 on AT91, but the usba driver is shared
1658 + * with AVR32, which use negative values instead. Once/if
1659 + * gpio_is_valid() is ported to AT91, revisit this code.
1661 + usba_udc_data.pdata.vbus_pin = -EINVAL;
1662 + usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
1663 + memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));;
1665 + if (data && data->vbus_pin > 0) {
1666 + at91_set_gpio_input(data->vbus_pin, 0);
1667 + at91_set_deglitch(data->vbus_pin, 1);
1668 + usba_udc_data.pdata.vbus_pin = data->vbus_pin;
1671 + /* Pullup pin is handled internally by USB device peripheral */
1674 + at91_clock_associate("utmi_clk", &at91_usba_udc_device.dev, "hclk");
1675 + at91_clock_associate("udphs_clk", &at91_usba_udc_device.dev, "pclk");
1677 + platform_device_register(&at91_usba_udc_device);
1680 +void __init at91_add_device_usba(struct usba_platform_data *data) {}
1684 +/* --------------------------------------------------------------------
1686 * -------------------------------------------------------------------- */
1688 @@ -105,10 +200,15 @@
1689 #define NAND_BASE AT91_CHIPSELECT_3
1691 static struct resource nand_resources[] = {
1695 .end = NAND_BASE + SZ_256M - 1,
1696 .flags = IORESOURCE_MEM,
1699 + .start = AT91_BASE_SYS + AT91_ECC,
1700 + .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
1701 + .flags = IORESOURCE_MEM,
1705 @@ -385,6 +485,100 @@
1708 /* --------------------------------------------------------------------
1709 + * Timer/Counter block
1710 + * -------------------------------------------------------------------- */
1712 +#ifdef CONFIG_ATMEL_TCLIB
1714 +static struct resource tcb_resources[] = {
1716 + .start = AT91SAM9RL_BASE_TCB0,
1717 + .end = AT91SAM9RL_BASE_TCB0 + SZ_16K - 1,
1718 + .flags = IORESOURCE_MEM,
1721 + .start = AT91SAM9RL_ID_TC0,
1722 + .end = AT91SAM9RL_ID_TC0,
1723 + .flags = IORESOURCE_IRQ,
1726 + .start = AT91SAM9RL_ID_TC1,
1727 + .end = AT91SAM9RL_ID_TC1,
1728 + .flags = IORESOURCE_IRQ,
1731 + .start = AT91SAM9RL_ID_TC2,
1732 + .end = AT91SAM9RL_ID_TC2,
1733 + .flags = IORESOURCE_IRQ,
1737 +static struct platform_device at91sam9rl_tcb_device = {
1738 + .name = "atmel_tcb",
1740 + .resource = tcb_resources,
1741 + .num_resources = ARRAY_SIZE(tcb_resources),
1744 +static void __init at91_add_device_tc(void)
1746 + /* this chip has a separate clock and irq for each TC channel */
1747 + at91_clock_associate("tc0_clk", &at91sam9rl_tcb_device.dev, "t0_clk");
1748 + at91_clock_associate("tc1_clk", &at91sam9rl_tcb_device.dev, "t1_clk");
1749 + at91_clock_associate("tc2_clk", &at91sam9rl_tcb_device.dev, "t2_clk");
1750 + platform_device_register(&at91sam9rl_tcb_device);
1753 +static void __init at91_add_device_tc(void) { }
1757 +/* --------------------------------------------------------------------
1759 + * -------------------------------------------------------------------- */
1761 +#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
1762 +static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
1764 +static struct resource tsadcc_resources[] = {
1766 + .start = AT91SAM9RL_BASE_TSC,
1767 + .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
1768 + .flags = IORESOURCE_MEM,
1771 + .start = AT91SAM9RL_ID_TSC,
1772 + .end = AT91SAM9RL_ID_TSC,
1773 + .flags = IORESOURCE_IRQ,
1777 +static struct platform_device at91_tsadcc_device = {
1778 + .name = "atmel_tsadcc",
1781 + .dma_mask = &tsadcc_dmamask,
1782 + .coherent_dma_mask = DMA_BIT_MASK(32),
1784 + .resource = tsadcc_resources,
1785 + .num_resources = ARRAY_SIZE(tsadcc_resources),
1788 +void __init at91_add_device_tsadcc(void)
1790 + at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */
1791 + at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */
1792 + at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */
1793 + at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */
1795 + platform_device_register(&at91_tsadcc_device);
1798 +void __init at91_add_device_tsadcc(void) {}
1802 +/* --------------------------------------------------------------------
1804 * -------------------------------------------------------------------- */
1808 static void __init at91_add_device_rtc(void)
1810 + device_init_wakeup(&at91sam9rl_rtc_device.dev, 1);
1811 platform_device_register(&at91sam9rl_rtc_device);
1814 @@ -418,13 +613,14 @@
1816 static struct platform_device at91sam9rl_rtt_device = {
1820 .resource = rtt_resources,
1821 .num_resources = ARRAY_SIZE(rtt_resources),
1824 static void __init at91_add_device_rtt(void)
1826 + device_init_wakeup(&at91sam9rl_rtt_device.dev, 1);
1827 platform_device_register(&at91sam9rl_rtt_device);
1834 - * Return the device node so that board init code can use it as the
1835 - * parent for the device node reflecting how it's used on this board.
1837 * SSC controllers are accessed through library code, instead of any
1838 * kind of all-singing/all-dancing driver. For example one could be
1839 * used by a particular I2S audio codec's driver, while another one
1841 at91_set_B_periph(AT91_PIN_PD3, 0); /* CTS3 */
1844 -static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1845 +static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1846 struct platform_device *atmel_default_console_device; /* the serial console device */
1848 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
1849 @@ -893,8 +1086,6 @@
1851 if (portnr < ATMEL_MAX_UART)
1852 atmel_default_console_device = at91_uarts[portnr];
1853 - if (!atmel_default_console_device)
1854 - printk(KERN_INFO "AT91: No default serial console defined.\n");
1857 void __init at91_add_device_serial(void)
1858 @@ -905,6 +1096,9 @@
1860 platform_device_register(at91_uarts[i]);
1863 + if (!atmel_default_console_device)
1864 + printk(KERN_INFO "AT91: No default serial console defined.\n");
1867 void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
1868 @@ -925,6 +1119,7 @@
1869 at91_add_device_rtc();
1870 at91_add_device_rtt();
1871 at91_add_device_watchdog();
1872 + at91_add_device_tc();
1876 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-cam60.c linux-2.6/arch/arm/mach-at91/board-cam60.c
1877 --- linux-2.6.25/arch/arm/mach-at91/board-cam60.c 1970-01-01 02:00:00.000000000 +0200
1878 +++ linux-2.6/arch/arm/mach-at91/board-cam60.c 2008-04-25 21:15:43.000000000 +0200
1881 + * KwikByte CAM60 (KB9260)
1883 + * based on board-sam9260ek.c
1884 + * Copyright (C) 2005 SAN People
1885 + * Copyright (C) 2006 Atmel
1887 + * This program is free software; you can redistribute it and/or modify
1888 + * it under the terms of the GNU General Public License as published by
1889 + * the Free Software Foundation; either version 2 of the License, or
1890 + * (at your option) any later version.
1892 + * This program is distributed in the hope that it will be useful,
1893 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1894 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1895 + * GNU General Public License for more details.
1897 + * You should have received a copy of the GNU General Public License
1898 + * along with this program; if not, write to the Free Software
1899 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1902 +#include <linux/types.h>
1903 +#include <linux/init.h>
1904 +#include <linux/mm.h>
1905 +#include <linux/module.h>
1906 +#include <linux/platform_device.h>
1907 +#include <linux/spi/spi.h>
1908 +#include <linux/spi/flash.h>
1910 +#include <asm/hardware.h>
1911 +#include <asm/setup.h>
1912 +#include <asm/mach-types.h>
1913 +#include <asm/irq.h>
1915 +#include <asm/mach/arch.h>
1916 +#include <asm/mach/map.h>
1917 +#include <asm/mach/irq.h>
1919 +#include <asm/arch/board.h>
1920 +#include <asm/arch/gpio.h>
1922 +#include "generic.h"
1925 +static void __init cam60_map_io(void)
1927 + /* Initialize processor: 10 MHz crystal */
1928 + at91sam9260_initialize(10000000);
1930 + /* DGBU on ttyS0. (Rx & Tx only) */
1931 + at91_register_uart(0, 0, 0);
1933 + /* set serial console to ttyS0 (ie, DBGU) */
1934 + at91_set_serial_console(0);
1937 +static void __init cam60_init_irq(void)
1939 + at91sam9260_init_interrupts(NULL);
1946 +static struct at91_usbh_data __initdata cam60_usbh_data = {
1954 +#if defined(CONFIG_MTD_DATAFLASH)
1955 +static struct mtd_partition __initdata cam60_spi_partitions[] = {
1963 + .offset = MTDPART_OFS_NXTBLK,
1964 + .size = 256 * 1056,
1968 + .offset = MTDPART_OFS_NXTBLK,
1969 + .size = 2222 * 1056,
1972 + .name = "file system",
1973 + .offset = MTDPART_OFS_NXTBLK,
1974 + .size = MTDPART_SIZ_FULL,
1978 +static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
1979 + .name = "spi_flash",
1980 + .parts = cam60_spi_partitions,
1981 + .nr_parts = ARRAY_SIZE(cam60_spi_partitions)
1985 +static struct spi_board_info cam60_spi_devices[] = {
1986 +#if defined(CONFIG_MTD_DATAFLASH)
1987 + { /* DataFlash chip */
1988 + .modalias = "mtd_dataflash",
1990 + .max_speed_hz = 15 * 1000 * 1000,
1992 + .platform_data = &cam60_spi_flash_platform_data
1999 + * MACB Ethernet device
2001 +static struct __initdata at91_eth_data cam60_macb_data = {
2002 + .phy_irq_pin = AT91_PIN_PB5,
2010 +static struct mtd_partition __initdata cam60_nand_partition[] = {
2012 + .name = "nand_fs",
2014 + .size = MTDPART_SIZ_FULL,
2018 +static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
2020 + *num_partitions = ARRAY_SIZE(cam60_nand_partition);
2021 + return cam60_nand_partition;
2024 +static struct at91_nand_data __initdata cam60_nand_data = {
2027 + // .det_pin = ... not there
2028 + .rdy_pin = AT91_PIN_PA9,
2029 + .enable_pin = AT91_PIN_PA7,
2030 + .partition_info = nand_partitions,
2034 +static void __init cam60_board_init(void)
2037 + at91_add_device_serial();
2039 + at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));
2041 + at91_add_device_eth(&cam60_macb_data);
2043 + /* enable USB power supply circuit */
2044 + at91_set_gpio_output(AT91_PIN_PB18, 1);
2045 + at91_add_device_usbh(&cam60_usbh_data);
2047 + at91_add_device_nand(&cam60_nand_data);
2050 +MACHINE_START(CAM60, "KwikByte CAM60")
2051 + /* Maintainer: KwikByte */
2052 + .phys_io = AT91_BASE_SYS,
2053 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
2054 + .boot_params = AT91_SDRAM_BASE + 0x100,
2055 + .timer = &at91sam926x_timer,
2056 + .map_io = cam60_map_io,
2057 + .init_irq = cam60_init_irq,
2058 + .init_machine = cam60_board_init,
2060 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-cap9adk.c linux-2.6/arch/arm/mach-at91/board-cap9adk.c
2061 --- linux-2.6.25/arch/arm/mach-at91/board-cap9adk.c 2008-05-03 00:15:44.000000000 +0200
2062 +++ linux-2.6/arch/arm/mach-at91/board-cap9adk.c 2008-05-05 22:01:39.000000000 +0200
2064 #include <asm/hardware.h>
2065 #include <asm/setup.h>
2066 #include <asm/mach-types.h>
2067 -#include <asm/irq.h>
2069 #include <asm/mach/arch.h>
2070 #include <asm/mach/map.h>
2071 -#include <asm/mach/irq.h>
2073 #include <asm/arch/board.h>
2074 #include <asm/arch/gpio.h>
2075 #include <asm/arch/at91cap9_matrix.h>
2076 -#include <asm/arch/at91sam926x_mc.h>
2077 +#include <asm/arch/at91sam9_smc.h>
2079 #include "generic.h"
2086 + * USB HS Device port
2088 +static struct usba_platform_data __initdata cap9adk_usba_udc_data = {
2089 + .vbus_pin = AT91_PIN_PB31,
2093 * ADS7846 Touchscreen
2096 .modalias = "ads7846",
2097 .chip_select = 3, /* can be 2 or 3, depending on J2 jumper */
2098 - .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
2099 + .max_speed_hz = 125000 * 16, /* max sample rate * clocks per sample */
2101 .platform_data = &ads_info,
2102 .irq = AT91_PIN_PC4,
2105 at91_add_device_serial();
2107 - set_irq_type(AT91CAP9_ID_UHP, IRQT_HIGH);
2108 at91_add_device_usbh(&cap9adk_usbh_data);
2110 + at91_add_device_usba(&cap9adk_usba_udc_data);
2112 at91_add_device_spi(cap9adk_spi_devices, ARRAY_SIZE(cap9adk_spi_devices));
2116 at91_add_device_i2c(NULL, 0);
2117 /* LCD Controller */
2118 - set_irq_type(AT91CAP9_ID_LCDC, IRQT_HIGH);
2119 at91_add_device_lcdc(&cap9adk_lcdc_data);
2121 at91_add_device_ac97(&cap9adk_ac97_data);
2122 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-carmeva.c linux-2.6/arch/arm/mach-at91/board-carmeva.c
2123 --- linux-2.6.25/arch/arm/mach-at91/board-carmeva.c 2008-05-03 00:15:33.000000000 +0200
2124 +++ linux-2.6/arch/arm/mach-at91/board-carmeva.c 2008-04-25 21:15:43.000000000 +0200
2126 #include "generic.h"
2130 - * Serial port configuration.
2131 - * 0 .. 3 = USART0 .. USART3
2134 -static struct at91_uart_config __initdata carmeva_uart_config = {
2135 - .console_tty = 0, /* ttyS0 */
2137 - .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
2140 static void __init carmeva_map_io(void)
2142 /* Initialize processor: 20.000 MHz crystal */
2143 at91rm9200_initialize(20000000, AT91RM9200_BGA);
2145 - /* Setup the serial ports and console */
2146 - at91_init_serial(&carmeva_uart_config);
2147 + /* DBGU on ttyS0. (Rx & Tx only) */
2148 + at91_register_uart(0, 0, 0);
2150 + /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
2151 + at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
2152 + | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
2155 + /* set serial console to ttyS0 (ie, DBGU) */
2156 + at91_set_serial_console(0);
2159 static void __init carmeva_init_irq(void)
2160 @@ -117,6 +114,30 @@
2164 +static struct gpio_led carmeva_leds[] = {
2165 + { /* "user led 1", LED9 */
2167 + .gpio = AT91_PIN_PA21,
2169 + .default_trigger = "heartbeat",
2171 + { /* "user led 2", LED10 */
2173 + .gpio = AT91_PIN_PA25,
2176 + { /* "user led 3", LED11 */
2178 + .gpio = AT91_PIN_PA26,
2181 + { /* "user led 4", LED12 */
2183 + .gpio = AT91_PIN_PA18,
2188 static void __init carmeva_board_init(void)
2192 // at91_add_device_cf(&carmeva_cf_data);
2194 at91_add_device_mmc(0, &carmeva_mmc_data);
2196 + at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
2199 MACHINE_START(CARMEVA, "Carmeva")
2200 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-chub.c linux-2.6/arch/arm/mach-at91/board-chub.c
2201 --- linux-2.6.25/arch/arm/mach-at91/board-chub.c 1970-01-01 02:00:00.000000000 +0200
2202 +++ linux-2.6/arch/arm/mach-at91/board-chub.c 2008-04-25 21:15:43.000000000 +0200
2205 + * linux/arch/arm/mach-at91/board-chub.c
2207 + * Copyright (C) 2005 SAN People, adapted for Promwad Chub board
2210 + * This program is free software; you can redistribute it and/or modify
2211 + * it under the terms of the GNU General Public License as published by
2212 + * the Free Software Foundation; either version 2 of the License, or
2213 + * (at your option) any later version.
2215 + * This program is distributed in the hope that it will be useful,
2216 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2217 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2218 + * GNU General Public License for more details.
2220 + * You should have received a copy of the GNU General Public License
2221 + * along with this program; if not, write to the Free Software
2222 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2225 +#include <linux/types.h>
2226 +#include <linux/init.h>
2227 +#include <linux/mm.h>
2228 +#include <linux/module.h>
2229 +#include <linux/platform_device.h>
2231 +#include <asm/hardware.h>
2232 +#include <asm/setup.h>
2233 +#include <asm/mach-types.h>
2234 +#include <asm/irq.h>
2236 +#include <asm/mach/arch.h>
2237 +#include <asm/mach/map.h>
2238 +#include <asm/mach/irq.h>
2240 +#include <asm/arch/board.h>
2241 +#include <asm/arch/gpio.h>
2243 +#include "generic.h"
2246 + * Serial port configuration.
2247 + * 0 .. 3 = USART0 .. USART3
2250 +static struct at91_uart_config __initdata chub_uart_config = {
2251 + .console_tty = 0, /* ttyS0 */
2253 + .tty_map = { 4, 0, 1, 2, 3 } /* ttyS0, ..., ttyS4 */
2256 +static void __init chub_init_irq(void)
2258 + at91rm9200_init_interrupts(NULL);
2261 +static void __init chub_map_io(void)
2263 + /* Initialize clocks: 18.432 MHz crystal */
2264 + at91rm9200_initialize(18432000, AT91RM9200_PQFP);
2266 + /* Setup the serial ports and console */
2267 + at91_init_serial(&chub_uart_config);
2270 +static struct at91_eth_data __initdata chub_eth_data = {
2271 + .phy_irq_pin = AT91_PIN_PB29,
2275 +static struct mtd_partition __initdata chub_nand_partition[] = {
2277 + .name = "NAND Partition 1",
2279 + .size = MTDPART_SIZ_FULL,
2283 +static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
2285 + *num_partitions = ARRAY_SIZE(chub_nand_partition);
2286 + return chub_nand_partition;
2289 +static struct at91_nand_data __initdata chub_nand_data = {
2292 + .enable_pin = AT91_PIN_PA27,
2293 + .partition_info = nand_partitions,
2296 +static struct spi_board_info chub_spi_devices[] = {
2297 + { /* DataFlash chip */
2298 + .modalias = "mtd_dataflash",
2300 + .max_speed_hz = 15 * 1000 * 1000,
2304 +static void __init chub_board_init(void)
2307 + at91_add_device_serial();
2309 + at91_add_device_i2c(NULL, 0);
2311 + at91_add_device_eth(&chub_eth_data);
2313 + at91_add_device_spi(chub_spi_devices, ARRAY_SIZE(chub_spi_devices));
2315 + at91_add_device_nand(&chub_nand_data);
2316 + /* Disable write protect for NAND */
2317 + at91_set_gpio_output(AT91_PIN_PB7, 1);
2318 + /* Power enable for 3x RS-232 and 1x RS-485 */
2319 + at91_set_gpio_output(AT91_PIN_PB9, 1);
2320 + /* Disable write protect for FRAM */
2321 + at91_set_gpio_output(AT91_PIN_PA21, 1);
2322 + /* Disable write protect for Dataflash */
2323 + at91_set_gpio_output(AT91_PIN_PA19, 1);
2326 +MACHINE_START(CHUB, "Promwad Chub")
2327 + /* Maintainer: Ivan Kuten AT Promwad DOT com */
2328 + .phys_io = AT91_BASE_SYS,
2329 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
2330 + .boot_params = AT91_SDRAM_BASE + 0x100,
2331 + .timer = &at91rm9200_timer,
2332 + .map_io = chub_map_io,
2333 + .init_irq = chub_init_irq,
2334 + .init_machine = chub_board_init,
2336 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-csb337.c linux-2.6/arch/arm/mach-at91/board-csb337.c
2337 --- linux-2.6.25/arch/arm/mach-at91/board-csb337.c 2008-05-03 00:15:44.000000000 +0200
2338 +++ linux-2.6/arch/arm/mach-at91/board-csb337.c 2008-05-02 00:05:42.000000000 +0200
2341 /* Setup the LEDs */
2342 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
2343 + at91_set_gpio_output(AT91_PIN_PB2, 1); /* third (unused) LED */
2345 /* Setup the serial ports and console */
2346 at91_init_serial(&csb337_uart_config);
2347 @@ -202,11 +203,11 @@
2349 static void __init csb300_add_device_buttons(void)
2351 - at91_set_gpio_input(AT91_PIN_PB29, 0); /* sw0 */
2352 + at91_set_gpio_input(AT91_PIN_PB29, 1); /* sw0 */
2353 at91_set_deglitch(AT91_PIN_PB29, 1);
2354 - at91_set_gpio_input(AT91_PIN_PB28, 0); /* sw1 */
2355 + at91_set_gpio_input(AT91_PIN_PB28, 1); /* sw1 */
2356 at91_set_deglitch(AT91_PIN_PB28, 1);
2357 - at91_set_gpio_input(AT91_PIN_PA21, 0); /* sw2 */
2358 + at91_set_gpio_input(AT91_PIN_PA21, 1); /* sw2 */
2359 at91_set_deglitch(AT91_PIN_PA21, 1);
2361 platform_device_register(&csb300_button_device);
2363 .gpio = AT91_PIN_PB0,
2365 .default_trigger = "ide-disk",
2371 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-csb637.c linux-2.6/arch/arm/mach-at91/board-csb637.c
2372 --- linux-2.6.25/arch/arm/mach-at91/board-csb637.c 2008-05-03 00:15:33.000000000 +0200
2373 +++ linux-2.6/arch/arm/mach-at91/board-csb637.c 2008-04-25 21:15:43.000000000 +0200
2375 #include "generic.h"
2379 - * Serial port configuration.
2380 - * 0 .. 3 = USART0 .. USART3
2383 -static struct at91_uart_config __initdata csb637_uart_config = {
2384 - .console_tty = 0, /* ttyS0 */
2386 - .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
2389 static void __init csb637_map_io(void)
2391 /* Initialize processor: 3.6864 MHz crystal */
2392 at91rm9200_initialize(3686400, AT91RM9200_BGA);
2394 - /* Setup the LEDs */
2395 - at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
2396 + /* DBGU on ttyS0. (Rx & Tx only) */
2397 + at91_register_uart(0, 0, 0);
2399 - /* Setup the serial ports and console */
2400 - at91_init_serial(&csb637_uart_config);
2401 + /* make console=ttyS0 (ie, DBGU) the default */
2402 + at91_set_serial_console(0);
2405 static void __init csb637_init_irq(void)
2406 @@ -118,8 +107,19 @@
2407 .num_resources = ARRAY_SIZE(csb_flash_resources),
2410 +static struct gpio_led csb_leds[] = {
2413 + .gpio = AT91_PIN_PB2,
2415 + .default_trigger = "heartbeat",
2419 static void __init csb637_board_init(void)
2422 + at91_gpio_leds(csb_leds, ARRAY_SIZE(csb_leds));
2424 at91_add_device_serial();
2426 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-dk.c linux-2.6/arch/arm/mach-at91/board-dk.c
2427 --- linux-2.6.25/arch/arm/mach-at91/board-dk.c 2008-05-03 00:15:44.000000000 +0200
2428 +++ linux-2.6/arch/arm/mach-at91/board-dk.c 2008-05-03 00:44:06.000000000 +0200
2430 #include <linux/init.h>
2431 #include <linux/mm.h>
2432 #include <linux/module.h>
2433 +#include <linux/dma-mapping.h>
2434 #include <linux/platform_device.h>
2435 #include <linux/spi/spi.h>
2436 #include <linux/mtd/physmap.h>
2438 #include "generic.h"
2442 - * Serial port configuration.
2443 - * 0 .. 3 = USART0 .. USART3
2446 -static struct at91_uart_config __initdata dk_uart_config = {
2447 - .console_tty = 0, /* ttyS0 */
2449 - .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
2452 static void __init dk_map_io(void)
2454 /* Initialize processor: 18.432 MHz crystal */
2456 /* Setup the LEDs */
2457 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
2459 - /* Setup the serial ports and console */
2460 - at91_init_serial(&dk_uart_config);
2461 + /* DBGU on ttyS0. (Rx & Tx only) */
2462 + at91_register_uart(0, 0, 0);
2464 + /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
2465 + at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
2466 + | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
2469 + /* set serial console to ttyS0 (ie, DBGU) */
2470 + at91_set_serial_console(0);
2473 static void __init dk_init_irq(void)
2475 at91rm9200_init_interrupts(NULL);
2478 +#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
2479 +#include <video/s1d13xxxfb.h>
2480 +#include <asm/arch/ics1523.h>
2482 +/* EPSON S1D13806 FB */
2483 +#define AT91_FB_REG_BASE 0x30000000L
2484 +#define AT91_FB_REG_SIZE 0x200
2485 +#define AT91_FB_VMEM_BASE 0x30200000L
2486 +#define AT91_FB_VMEM_SIZE 0x140000L
2488 +static void dk_init_video(void)
2490 + /* NWAIT Signal */
2491 + at91_set_A_periph(AT91_PIN_PC6, 0);
2493 + /* Initialization of the Static Memory Controller for Chip Select 2 */
2494 + at91_sys_write(AT91_SMC_CSR(2), AT91_SMC_DBW_16 /* 16 bit */
2495 + | AT91_SMC_WSEN | AT91_SMC_NWS_(4) /* wait states */
2496 + | AT91_SMC_TDF_(1) /* float time */
2499 + at91_ics1523_init();
2502 +/* CRT: (active) 640x480 60Hz (PCLK=CLKI=25.175MHz)
2503 + Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
2504 +static const struct s1d13xxxfb_regval dk_s1dfb_initregs[] = {
2505 + {S1DREG_MISC, 0x00}, /* Enable Memory/Register select bit */
2506 + {S1DREG_COM_DISP_MODE, 0x00}, /* disable display output */
2507 + {S1DREG_GPIO_CNF0, 0x00},
2508 + {S1DREG_GPIO_CNF1, 0x00},
2509 + {S1DREG_GPIO_CTL0, 0x08},
2510 + {S1DREG_GPIO_CTL1, 0x00},
2511 + {S1DREG_CLK_CNF, 0x01}, /* no divide, MCLK source is CLKI3 0x02*/
2512 + {S1DREG_LCD_CLK_CNF, 0x00},
2513 + {S1DREG_CRT_CLK_CNF, 0x00},
2514 + {S1DREG_MPLUG_CLK_CNF, 0x00},
2515 + {S1DREG_CPU2MEM_WST_SEL, 0x01}, /* 2*period(MCLK) - 4ns > period(BCLK) */
2516 + {S1DREG_SDRAM_REF_RATE, 0x03}, /* 32768 <= MCLK <= 50000 (MHz) */
2517 + {S1DREG_SDRAM_TC0, 0x00}, /* MCLK source freq (MHz): */
2518 + {S1DREG_SDRAM_TC1, 0x01}, /* 42 <= MCLK <= 50 */
2519 + {S1DREG_MEM_CNF, 0x80}, /* SDRAM Initialization - needed before mem access */
2520 + {S1DREG_PANEL_TYPE, 0x25}, /* std TFT 16bit, 8bit SCP format 2, single passive LCD */
2521 + {S1DREG_MOD_RATE, 0x00}, /* toggle every FPFRAME */
2522 + {S1DREG_LCD_DISP_HWIDTH, 0x4F}, /* 680 pix */
2523 + {S1DREG_LCD_NDISP_HPER, 0x12}, /* 152 pix */
2524 + {S1DREG_TFT_FPLINE_START, 0x01}, /* 13 pix */
2525 + {S1DREG_TFT_FPLINE_PWIDTH, 0x0B}, /* 96 pix */
2526 + {S1DREG_LCD_DISP_VHEIGHT0, 0xDF},
2527 + {S1DREG_LCD_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2528 + {S1DREG_LCD_NDISP_VPER, 0x2C}, /* 44 lines */
2529 + {S1DREG_TFT_FPFRAME_START, 0x0A}, /* 10 lines */
2530 + {S1DREG_TFT_FPFRAME_PWIDTH, 0x01}, /* 2 lines */
2531 + {S1DREG_LCD_DISP_MODE, 0x05}, /* 16 bpp */
2532 + {S1DREG_LCD_MISC, 0x00}, /* dithering enabled, dual panel buffer enabled */
2533 + {S1DREG_LCD_DISP_START0, 0x00},
2534 + {S1DREG_LCD_DISP_START1, 0xC8},
2535 + {S1DREG_LCD_DISP_START2, 0x00},
2536 + {S1DREG_LCD_MEM_OFF0, 0x80},
2537 + {S1DREG_LCD_MEM_OFF1, 0x02},
2538 + {S1DREG_LCD_PIX_PAN, 0x00},
2539 + {S1DREG_LCD_DISP_FIFO_HTC, 0x3B},
2540 + {S1DREG_LCD_DISP_FIFO_LTC, 0x3C},
2541 + {S1DREG_CRT_DISP_HWIDTH, 0x4F}, /* 680 pix */
2542 + {S1DREG_CRT_NDISP_HPER, 0x13}, /* 160 pix */
2543 + {S1DREG_CRT_HRTC_START, 0x01}, /* 13 pix */
2544 + {S1DREG_CRT_HRTC_PWIDTH, 0x0B}, /* 96 pix */
2545 + {S1DREG_CRT_DISP_VHEIGHT0, 0xDF},
2546 + {S1DREG_CRT_DISP_VHEIGHT1, 0x01}, /* 480 lines */
2547 + {S1DREG_CRT_NDISP_VPER, 0x2B}, /* 44 lines */
2548 + {S1DREG_CRT_VRTC_START, 0x09}, /* 10 lines */
2549 + {S1DREG_CRT_VRTC_PWIDTH, 0x01}, /* 2 lines */
2550 + {S1DREG_TV_OUT_CTL, 0x10},
2551 + {S1DREG_CRT_DISP_MODE, 0x05}, /* 16 bpp */
2552 + {S1DREG_CRT_DISP_START0, 0x00},
2553 + {S1DREG_CRT_DISP_START1, 0x00},
2554 + {S1DREG_CRT_DISP_START2, 0x00},
2555 + {S1DREG_CRT_MEM_OFF0, 0x80},
2556 + {S1DREG_CRT_MEM_OFF1, 0x02},
2557 + {S1DREG_CRT_PIX_PAN, 0x00},
2558 + {S1DREG_CRT_DISP_FIFO_HTC, 0x3B},
2559 + {S1DREG_CRT_DISP_FIFO_LTC, 0x3C},
2560 + {S1DREG_LCD_CUR_CTL, 0x00}, /* inactive */
2561 + {S1DREG_LCD_CUR_START, 0x01},
2562 + {S1DREG_LCD_CUR_XPOS0, 0x00},
2563 + {S1DREG_LCD_CUR_XPOS1, 0x00},
2564 + {S1DREG_LCD_CUR_YPOS0, 0x00},
2565 + {S1DREG_LCD_CUR_YPOS1, 0x00},
2566 + {S1DREG_LCD_CUR_BCTL0, 0x00},
2567 + {S1DREG_LCD_CUR_GCTL0, 0x00},
2568 + {S1DREG_LCD_CUR_RCTL0, 0x00},
2569 + {S1DREG_LCD_CUR_BCTL1, 0x1F},
2570 + {S1DREG_LCD_CUR_GCTL1, 0x3F},
2571 + {S1DREG_LCD_CUR_RCTL1, 0x1F},
2572 + {S1DREG_LCD_CUR_FIFO_HTC, 0x00},
2573 + {S1DREG_CRT_CUR_CTL, 0x00}, /* inactive */
2574 + {S1DREG_CRT_CUR_START, 0x01},
2575 + {S1DREG_CRT_CUR_XPOS0, 0x00},
2576 + {S1DREG_CRT_CUR_XPOS1, 0x00},
2577 + {S1DREG_CRT_CUR_YPOS0, 0x00},
2578 + {S1DREG_CRT_CUR_YPOS1, 0x00},
2579 + {S1DREG_CRT_CUR_BCTL0, 0x00},
2580 + {S1DREG_CRT_CUR_GCTL0, 0x00},
2581 + {S1DREG_CRT_CUR_RCTL0, 0x00},
2582 + {S1DREG_CRT_CUR_BCTL1, 0x1F},
2583 + {S1DREG_CRT_CUR_GCTL1, 0x3F},
2584 + {S1DREG_CRT_CUR_RCTL1, 0x1F},
2585 + {S1DREG_CRT_CUR_FIFO_HTC, 0x00},
2586 + {S1DREG_BBLT_CTL0, 0x00},
2587 + {S1DREG_BBLT_CTL0, 0x00},
2588 + {S1DREG_BBLT_CC_EXP, 0x00},
2589 + {S1DREG_BBLT_OP, 0x00},
2590 + {S1DREG_BBLT_SRC_START0, 0x00},
2591 + {S1DREG_BBLT_SRC_START1, 0x00},
2592 + {S1DREG_BBLT_SRC_START2, 0x00},
2593 + {S1DREG_BBLT_DST_START0, 0x00},
2594 + {S1DREG_BBLT_DST_START1, 0x00},
2595 + {S1DREG_BBLT_DST_START2, 0x00},
2596 + {S1DREG_BBLT_MEM_OFF0, 0x00},
2597 + {S1DREG_BBLT_MEM_OFF1, 0x00},
2598 + {S1DREG_BBLT_WIDTH0, 0x00},
2599 + {S1DREG_BBLT_WIDTH1, 0x00},
2600 + {S1DREG_BBLT_HEIGHT0, 0x00},
2601 + {S1DREG_BBLT_HEIGHT1, 0x00},
2602 + {S1DREG_BBLT_BGC0, 0x00},
2603 + {S1DREG_BBLT_BGC1, 0x00},
2604 + {S1DREG_BBLT_FGC0, 0x00},
2605 + {S1DREG_BBLT_FGC1, 0x00},
2606 + {S1DREG_LKUP_MODE, 0x00}, /* LCD LUT r | LCD and CRT/TV LUT w */
2607 + {S1DREG_LKUP_ADDR, 0x00},
2608 + {S1DREG_PS_CNF, 0x00}, /* Power Save disable */
2609 + {S1DREG_PS_STATUS, 0x02}, /* LCD Panel down, mem up */
2610 + {S1DREG_CPU2MEM_WDOGT, 0x00},
2611 + {S1DREG_COM_DISP_MODE, 0x02}, /* enable CRT display output */
2614 +static struct s1d13xxxfb_pdata dk_s1dfb_pdata = {
2615 + .initregs = dk_s1dfb_initregs,
2616 + .initregssize = ARRAY_SIZE(dk_s1dfb_initregs),
2617 + .platform_init_video = dk_init_video,
2620 +static u64 s1dfb_dmamask = DMA_BIT_MASK(32);
2622 +static struct resource dk_s1dfb_resource[] = {
2623 + [0] = { /* video mem */
2624 + .name = "s1d13806 memory",
2625 + .start = AT91_FB_VMEM_BASE,
2626 + .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
2627 + .flags = IORESOURCE_MEM,
2629 + [1] = { /* video registers */
2630 + .name = "s1d13806 registers",
2631 + .start = AT91_FB_REG_BASE,
2632 + .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
2633 + .flags = IORESOURCE_MEM,
2637 +static struct platform_device dk_s1dfb_device = {
2638 + .name = "s1d13806fb",
2641 + .dma_mask = &s1dfb_dmamask,
2642 + .coherent_dma_mask = DMA_BIT_MASK(32),
2643 + .platform_data = &dk_s1dfb_pdata,
2645 + .resource = dk_s1dfb_resource,
2646 + .num_resources = ARRAY_SIZE(dk_s1dfb_resource),
2649 +static void __init dk_add_device_video(void)
2651 + platform_device_register(&dk_s1dfb_device);
2654 +static void __init dk_add_device_video(void) {}
2657 static struct at91_eth_data __initdata dk_eth_data = {
2658 .phy_irq_pin = AT91_PIN_PC4,
2661 #define DK_FLASH_SIZE 0x200000
2663 static struct physmap_flash_data dk_flash_data = {
2668 static struct resource dk_flash_resource = {
2669 @@ -223,8 +400,12 @@
2670 platform_device_register(&dk_flash);
2672 at91_gpio_leds(dk_leds, ARRAY_SIZE(dk_leds));
2673 + /* SSC (to LM4549 audio codec) */
2674 + at91_add_device_ssc(AT91RM9200_ID_SSC1, ATMEL_SSC_TD | ATMEL_SSC_RX);
2675 + /* SSC (to SI3021 line interface) */
2676 + at91_add_device_ssc(AT91RM9200_ID_SSC2, ATMEL_SSC_TD | ATMEL_SSC_TK | ATMEL_SSC_RD | ATMEL_SSC_RF);
2678 -// dk_add_device_video();
2679 + dk_add_device_video();
2682 MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
2683 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-eb9200.c linux-2.6/arch/arm/mach-at91/board-eb9200.c
2684 --- linux-2.6.25/arch/arm/mach-at91/board-eb9200.c 2008-05-03 00:15:33.000000000 +0200
2685 +++ linux-2.6/arch/arm/mach-at91/board-eb9200.c 2008-04-25 21:15:43.000000000 +0200
2687 #include "generic.h"
2691 - * Serial port configuration.
2692 - * 0 .. 3 = USART0 .. USART3
2695 -static struct at91_uart_config __initdata eb9200_uart_config = {
2696 - .console_tty = 0, /* ttyS0 */
2698 - .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
2701 static void __init eb9200_map_io(void)
2703 /* Initialize processor: 18.432 MHz crystal */
2704 at91rm9200_initialize(18432000, AT91RM9200_BGA);
2706 - /* Setup the serial ports and console */
2707 - at91_init_serial(&eb9200_uart_config);
2708 + /* DBGU on ttyS0. (Rx & Tx only) */
2709 + at91_register_uart(0, 0, 0);
2711 + /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
2712 + at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
2713 + | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
2716 + /* USART2 on ttyS2. (Rx, Tx) - IRDA */
2717 + at91_register_uart(AT91RM9200_ID_US2, 2, 0);
2719 + /* set serial console to ttyS0 (ie, DBGU) */
2720 + at91_set_serial_console(0);
2723 static void __init eb9200_init_irq(void)
2724 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-ecbat91.c linux-2.6/arch/arm/mach-at91/board-ecbat91.c
2725 --- linux-2.6.25/arch/arm/mach-at91/board-ecbat91.c 1970-01-01 02:00:00.000000000 +0200
2726 +++ linux-2.6/arch/arm/mach-at91/board-ecbat91.c 2008-04-25 21:15:43.000000000 +0200
2729 + * linux/arch/arm/mach-at91rm9200/board-ecbat91.c
2730 + * Copyright (C) 2007 emQbit.com.
2732 + * We started from board-dk.c, which is Copyright (C) 2005 SAN People.
2734 + * This program is free software; you can redistribute it and/or modify
2735 + * it under the terms of the GNU General Public License as published by
2736 + * the Free Software Foundation; either version 2 of the License, or
2737 + * (at your option) any later version.
2739 + * This program is distributed in the hope that it will be useful,
2740 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2741 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2742 + * GNU General Public License for more details.
2744 + * You should have received a copy of the GNU General Public License
2745 + * along with this program; if not, write to the Free Software
2746 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2749 +#include <linux/types.h>
2750 +#include <linux/init.h>
2751 +#include <linux/mm.h>
2752 +#include <linux/module.h>
2753 +#include <linux/platform_device.h>
2754 +#include <linux/spi/spi.h>
2755 +#include <linux/spi/flash.h>
2757 +#include <asm/hardware.h>
2758 +#include <asm/setup.h>
2759 +#include <asm/mach-types.h>
2760 +#include <asm/irq.h>
2762 +#include <asm/mach/arch.h>
2763 +#include <asm/mach/map.h>
2764 +#include <asm/mach/irq.h>
2766 +#include <asm/arch/board.h>
2767 +#include <asm/arch/gpio.h>
2769 +#include "generic.h"
2772 +static void __init ecb_at91map_io(void)
2774 + /* Initialize processor: 18.432 MHz crystal */
2775 + at91rm9200_initialize(18432000, AT91RM9200_PQFP);
2777 + /* Setup the LEDs */
2778 + at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
2780 + /* DBGU on ttyS0. (Rx & Tx only) */
2781 + at91_register_uart(0, 0, 0);
2783 + /* USART0 on ttyS1. (Rx & Tx only) */
2784 + at91_register_uart(AT91RM9200_ID_US0, 1, 0);
2786 + /* set serial console to ttyS0 (ie, DBGU) */
2787 + at91_set_serial_console(0);
2790 +static void __init ecb_at91init_irq(void)
2792 + at91rm9200_init_interrupts(NULL);
2795 +static struct at91_eth_data __initdata ecb_at91eth_data = {
2796 + .phy_irq_pin = AT91_PIN_PC4,
2800 +static struct at91_usbh_data __initdata ecb_at91usbh_data = {
2804 +static struct at91_mmc_data __initdata ecb_at91mmc_data = {
2810 +#if defined(CONFIG_MTD_DATAFLASH)
2811 +static struct mtd_partition __initdata my_flash0_partitions[] =
2814 + .name = "Darrell-loader",
2820 + .offset = MTDPART_OFS_NXTBLK,
2821 + .size = 110 * 1056,
2823 + { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
2824 + .name = "Uoot-env",
2825 + .offset = MTDPART_OFS_NXTBLK,
2828 + { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
2830 + .offset = MTDPART_OFS_NXTBLK,
2831 + .size = 1534 * 1056,
2833 + { /* 190200 - jffs2 root filesystem */
2834 + .name = "Filesystem",
2835 + .offset = MTDPART_OFS_NXTBLK,
2836 + .size = MTDPART_SIZ_FULL, /* 26 sectors */
2840 +static struct flash_platform_data __initdata my_flash0_platform = {
2841 + .name = "Removable flash card",
2842 + .parts = my_flash0_partitions,
2843 + .nr_parts = ARRAY_SIZE(my_flash0_partitions)
2848 +static struct spi_board_info __initdata ecb_at91spi_devices[] = {
2849 + { /* DataFlash chip */
2850 + .modalias = "mtd_dataflash",
2852 + .max_speed_hz = 10 * 1000 * 1000,
2854 +#if defined(CONFIG_MTD_DATAFLASH)
2855 + .platform_data = &my_flash0_platform,
2858 + { /* User accessable spi - cs1 (250KHz) */
2859 + .modalias = "spi-cs1",
2861 + .max_speed_hz = 250 * 1000,
2863 + { /* User accessable spi - cs2 (1MHz) */
2864 + .modalias = "spi-cs2",
2866 + .max_speed_hz = 1 * 1000 * 1000,
2868 + { /* User accessable spi - cs3 (10MHz) */
2869 + .modalias = "spi-cs3",
2871 + .max_speed_hz = 10 * 1000 * 1000,
2875 +static void __init ecb_at91board_init(void)
2878 + at91_add_device_serial();
2881 + at91_add_device_eth(&ecb_at91eth_data);
2884 + at91_add_device_usbh(&ecb_at91usbh_data);
2887 + at91_add_device_i2c(NULL, 0);
2890 + at91_add_device_mmc(0, &ecb_at91mmc_data);
2893 + at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
2896 +MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
2897 + /* Maintainer: emQbit.com */
2898 + .phys_io = AT91_BASE_SYS,
2899 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
2900 + .boot_params = AT91_SDRAM_BASE + 0x100,
2901 + .timer = &at91rm9200_timer,
2902 + .map_io = ecb_at91map_io,
2903 + .init_irq = ecb_at91init_irq,
2904 + .init_machine = ecb_at91board_init,
2906 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-ek.c linux-2.6/arch/arm/mach-at91/board-ek.c
2907 --- linux-2.6.25/arch/arm/mach-at91/board-ek.c 2008-05-03 00:15:44.000000000 +0200
2908 +++ linux-2.6/arch/arm/mach-at91/board-ek.c 2008-05-03 00:44:38.000000000 +0200
2910 #include <linux/init.h>
2911 #include <linux/mm.h>
2912 #include <linux/module.h>
2913 +#include <linux/dma-mapping.h>
2914 #include <linux/platform_device.h>
2915 #include <linux/spi/spi.h>
2916 #include <linux/mtd/physmap.h>
2918 #include "generic.h"
2922 - * Serial port configuration.
2923 - * 0 .. 3 = USART0 .. USART3
2926 -static struct at91_uart_config __initdata ek_uart_config = {
2927 - .console_tty = 0, /* ttyS0 */
2929 - .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
2932 static void __init ek_map_io(void)
2934 /* Initialize processor: 18.432 MHz crystal */
2936 /* Setup the LEDs */
2937 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
2939 - /* Setup the serial ports and console */
2940 - at91_init_serial(&ek_uart_config);
2941 + /* DBGU on ttyS0. (Rx & Tx only) */
2942 + at91_register_uart(0, 0, 0);
2944 + /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
2945 + at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
2946 + | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
2949 + /* set serial console to ttyS0 (ie, DBGU) */
2950 + at91_set_serial_console(0);
2953 static void __init ek_init_irq(void)
2955 at91rm9200_init_interrupts(NULL);
2958 +#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
2959 +#include <video/s1d13xxxfb.h>
2960 +#include <asm/arch/ics1523.h>
2962 +/* EPSON S1D13806 FB */
2963 +#define AT91_FB_REG_BASE 0x40000000L
2964 +#define AT91_FB_REG_SIZE 0x200
2965 +#define AT91_FB_VMEM_BASE 0x40200000L
2966 +#define AT91_FB_VMEM_SIZE 0x140000L
2968 +static void ek_init_video(void)
2970 + /* NWAIT Signal */
2971 + at91_set_A_periph(AT91_PIN_PC6, 0);
2973 + /* Initialization of the Static Memory Controller for Chip Select 3 */
2974 + at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_DBW_16 /* 16 bit */
2975 + | AT91_SMC_WSEN | AT91_SMC_NWS_(5) /* wait states */
2976 + | AT91_SMC_TDF_(1) /* float time */
2979 + at91_ics1523_init();
2982 +/* CRT: (active) 640x480 60Hz (PCLK=CLKI=25.175MHz)
2983 + Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
2984 +static const struct s1d13xxxfb_regval ek_s1dfb_initregs[] = {
2985 + {S1DREG_MISC, 0x00}, /* Enable Memory/Register select bit */
2986 + {S1DREG_COM_DISP_MODE, 0x00}, /* disable display output */
2987 + {S1DREG_GPIO_CNF0, 0xFF}, // 0x00
2988 + {S1DREG_GPIO_CNF1, 0x1F}, // 0x08
2989 + {S1DREG_GPIO_CTL0, 0x00},
2990 + {S1DREG_GPIO_CTL1, 0x00},
2991 + {S1DREG_CLK_CNF, 0x01}, /* no divide, MCLK source is CLKI3 0x02*/
2992 + {S1DREG_LCD_CLK_CNF, 0x00},
2993 + {S1DREG_CRT_CLK_CNF, 0x00},
2994 + {S1DREG_MPLUG_CLK_CNF, 0x00},
2995 + {S1DREG_CPU2MEM_WST_SEL, 0x01}, /* 2*period(MCLK) - 4ns > period(BCLK) */
2996 + {S1DREG_SDRAM_REF_RATE, 0x03}, /* 32768 <= MCLK <= 50000 (MHz) */
2997 + {S1DREG_SDRAM_TC0, 0x00}, /* MCLK source freq (MHz): */
2998 + {S1DREG_SDRAM_TC1, 0x01}, /* 42 <= MCLK <= 50 */
2999 + {S1DREG_MEM_CNF, 0x80}, /* SDRAM Initialization - needed before mem access */
3000 + {S1DREG_PANEL_TYPE, 0x25}, /* std TFT 16bit, 8bit SCP format 2, single passive LCD */
3001 + {S1DREG_MOD_RATE, 0x00}, /* toggle every FPFRAME */
3002 + {S1DREG_LCD_DISP_HWIDTH, 0x4F}, /* 680 pix */
3003 + {S1DREG_LCD_NDISP_HPER, 0x12}, /* 152 pix */
3004 + {S1DREG_TFT_FPLINE_START, 0x01}, /* 13 pix */
3005 + {S1DREG_TFT_FPLINE_PWIDTH, 0x0B}, /* 96 pix */
3006 + {S1DREG_LCD_DISP_VHEIGHT0, 0xDF},
3007 + {S1DREG_LCD_DISP_VHEIGHT1, 0x01}, /* 480 lines */
3008 + {S1DREG_LCD_NDISP_VPER, 0x2C}, /* 44 lines */
3009 + {S1DREG_TFT_FPFRAME_START, 0x0A}, /* 10 lines */
3010 + {S1DREG_TFT_FPFRAME_PWIDTH, 0x01}, /* 2 lines */
3011 + {S1DREG_LCD_DISP_MODE, 0x05}, /* 16 bpp */
3012 + {S1DREG_LCD_MISC, 0x00}, /* dithering enabled, dual panel buffer enabled */
3013 + {S1DREG_LCD_DISP_START0, 0x00},
3014 + {S1DREG_LCD_DISP_START1, 0xC8},
3015 + {S1DREG_LCD_DISP_START2, 0x00},
3016 + {S1DREG_LCD_MEM_OFF0, 0x80},
3017 + {S1DREG_LCD_MEM_OFF1, 0x02},
3018 + {S1DREG_LCD_PIX_PAN, 0x00},
3019 + {S1DREG_LCD_DISP_FIFO_HTC, 0x3B},
3020 + {S1DREG_LCD_DISP_FIFO_LTC, 0x3C},
3021 + {S1DREG_CRT_DISP_HWIDTH, 0x4F}, /* 680 pix */
3022 + {S1DREG_CRT_NDISP_HPER, 0x13}, /* 160 pix */
3023 + {S1DREG_CRT_HRTC_START, 0x01}, /* 13 pix */
3024 + {S1DREG_CRT_HRTC_PWIDTH, 0x0B}, /* 96 pix */
3025 + {S1DREG_CRT_DISP_VHEIGHT0, 0xDF},
3026 + {S1DREG_CRT_DISP_VHEIGHT1, 0x01}, /* 480 lines */
3027 + {S1DREG_CRT_NDISP_VPER, 0x2B}, /* 44 lines */
3028 + {S1DREG_CRT_VRTC_START, 0x09}, /* 10 lines */
3029 + {S1DREG_CRT_VRTC_PWIDTH, 0x01}, /* 2 lines */
3030 + {S1DREG_TV_OUT_CTL, 0x10},
3033 + {S1DREG_CRT_DISP_MODE, 0x05}, /* 16 bpp */
3034 + {S1DREG_CRT_DISP_START0, 0x00},
3035 + {S1DREG_CRT_DISP_START1, 0x00},
3036 + {S1DREG_CRT_DISP_START2, 0x00},
3037 + {S1DREG_CRT_MEM_OFF0, 0x80},
3038 + {S1DREG_CRT_MEM_OFF1, 0x02},
3039 + {S1DREG_CRT_PIX_PAN, 0x00},
3040 + {S1DREG_CRT_DISP_FIFO_HTC, 0x3B},
3041 + {S1DREG_CRT_DISP_FIFO_LTC, 0x3C},
3042 + {S1DREG_LCD_CUR_CTL, 0x00}, /* inactive */
3043 + {S1DREG_LCD_CUR_START, 0x01},
3044 + {S1DREG_LCD_CUR_XPOS0, 0x00},
3045 + {S1DREG_LCD_CUR_XPOS1, 0x00},
3046 + {S1DREG_LCD_CUR_YPOS0, 0x00},
3047 + {S1DREG_LCD_CUR_YPOS1, 0x00},
3048 + {S1DREG_LCD_CUR_BCTL0, 0x00},
3049 + {S1DREG_LCD_CUR_GCTL0, 0x00},
3050 + {S1DREG_LCD_CUR_RCTL0, 0x00},
3051 + {S1DREG_LCD_CUR_BCTL1, 0x1F},
3052 + {S1DREG_LCD_CUR_GCTL1, 0x3F},
3053 + {S1DREG_LCD_CUR_RCTL1, 0x1F},
3054 + {S1DREG_LCD_CUR_FIFO_HTC, 0x00},
3055 + {S1DREG_CRT_CUR_CTL, 0x00}, /* inactive */
3056 + {S1DREG_CRT_CUR_START, 0x01},
3057 + {S1DREG_CRT_CUR_XPOS0, 0x00},
3058 + {S1DREG_CRT_CUR_XPOS1, 0x00},
3059 + {S1DREG_CRT_CUR_YPOS0, 0x00},
3060 + {S1DREG_CRT_CUR_YPOS1, 0x00},
3061 + {S1DREG_CRT_CUR_BCTL0, 0x00},
3062 + {S1DREG_CRT_CUR_GCTL0, 0x00},
3063 + {S1DREG_CRT_CUR_RCTL0, 0x00},
3064 + {S1DREG_CRT_CUR_BCTL1, 0x1F},
3065 + {S1DREG_CRT_CUR_GCTL1, 0x3F},
3066 + {S1DREG_CRT_CUR_RCTL1, 0x1F},
3067 + {S1DREG_CRT_CUR_FIFO_HTC, 0x00},
3068 + {S1DREG_BBLT_CTL0, 0x00},
3069 + {S1DREG_BBLT_CTL0, 0x00},
3070 + {S1DREG_BBLT_CC_EXP, 0x00},
3071 + {S1DREG_BBLT_OP, 0x00},
3072 + {S1DREG_BBLT_SRC_START0, 0x00},
3073 + {S1DREG_BBLT_SRC_START1, 0x00},
3074 + {S1DREG_BBLT_SRC_START2, 0x00},
3075 + {S1DREG_BBLT_DST_START0, 0x00},
3076 + {S1DREG_BBLT_DST_START1, 0x00},
3077 + {S1DREG_BBLT_DST_START2, 0x00},
3078 + {S1DREG_BBLT_MEM_OFF0, 0x00},
3079 + {S1DREG_BBLT_MEM_OFF1, 0x00},
3080 + {S1DREG_BBLT_WIDTH0, 0x00},
3081 + {S1DREG_BBLT_WIDTH1, 0x00},
3082 + {S1DREG_BBLT_HEIGHT0, 0x00},
3083 + {S1DREG_BBLT_HEIGHT1, 0x00},
3084 + {S1DREG_BBLT_BGC0, 0x00},
3085 + {S1DREG_BBLT_BGC1, 0x00},
3086 + {S1DREG_BBLT_FGC0, 0x00},
3087 + {S1DREG_BBLT_FGC1, 0x00},
3088 + {S1DREG_LKUP_MODE, 0x00}, /* LCD LUT r | LCD and CRT/TV LUT w */
3089 + {S1DREG_LKUP_ADDR, 0x00},
3090 + {S1DREG_PS_CNF, 0x10}, /* Power Save disable */
3091 + {S1DREG_PS_STATUS, 0x02}, /* LCD Panel down, mem up */
3092 + {S1DREG_CPU2MEM_WDOGT, 0x00},
3093 + {S1DREG_COM_DISP_MODE, 0x02}, /* enable CRT display output */
3096 +static struct s1d13xxxfb_pdata ek_s1dfb_pdata = {
3097 + .initregs = ek_s1dfb_initregs,
3098 + .initregssize = ARRAY_SIZE(ek_s1dfb_initregs),
3099 + .platform_init_video = ek_init_video,
3102 +static u64 s1dfb_dmamask = DMA_BIT_MASK(32);
3104 +static struct resource ek_s1dfb_resource[] = {
3105 + [0] = { /* video mem */
3106 + .name = "s1d13806 memory",
3107 + .start = AT91_FB_VMEM_BASE,
3108 + .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
3109 + .flags = IORESOURCE_MEM,
3111 + [1] = { /* video registers */
3112 + .name = "s1d13806 registers",
3113 + .start = AT91_FB_REG_BASE,
3114 + .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
3115 + .flags = IORESOURCE_MEM,
3119 +static struct platform_device ek_s1dfb_device = {
3120 + .name = "s1d13806fb",
3123 + .dma_mask = &s1dfb_dmamask,
3124 + .coherent_dma_mask = DMA_BIT_MASK(32),
3125 + .platform_data = &ek_s1dfb_pdata,
3127 + .resource = ek_s1dfb_resource,
3128 + .num_resources = ARRAY_SIZE(ek_s1dfb_resource),
3131 +static void __init ek_add_device_video(void)
3133 + platform_device_register(&ek_s1dfb_device);
3136 +static void __init ek_add_device_video(void) {}
3139 static struct at91_eth_data __initdata ek_eth_data = {
3140 .phy_irq_pin = AT91_PIN_PC4,
3143 #define EK_FLASH_SIZE 0x200000
3145 static struct physmap_flash_data ek_flash_data = {
3150 static struct resource ek_flash_resource = {
3153 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
3155 -// ek_add_device_video();
3156 + ek_add_device_video();
3159 MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
3160 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-homematic.c linux-2.6/arch/arm/mach-at91/board-homematic.c
3161 --- linux-2.6.25/arch/arm/mach-at91/board-homematic.c 1970-01-01 02:00:00.000000000 +0200
3162 +++ linux-2.6/arch/arm/mach-at91/board-homematic.c 2008-04-25 21:15:43.000000000 +0200
3165 + * linux/arch/arm/mach-at91/board-homematic.c
3167 + * Copyright (C) 2007 eQ-3 Entwicklung GmbH
3170 + * Copyright (C) 2005 SAN People
3172 + * This program is free software; you can redistribute it and/or modify
3173 + * it under the terms of the GNU General Public License as published by
3174 + * the Free Software Foundation; either version 2 of the License, or
3175 + * (at your option) any later version.
3177 + * This program is distributed in the hope that it will be useful,
3178 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3179 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3180 + * GNU General Public License for more details.
3182 + * You should have received a copy of the GNU General Public License
3183 + * along with this program; if not, write to the Free Software
3184 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3187 +#include <linux/types.h>
3188 +#include <linux/init.h>
3189 +#include <linux/mm.h>
3190 +#include <linux/module.h>
3191 +#include <linux/platform_device.h>
3192 +#include <linux/spi/spi.h>
3193 +#include <linux/mtd/physmap.h>
3195 +#include <asm/hardware.h>
3196 +#include <asm/setup.h>
3197 +#include <asm/mach-types.h>
3198 +#include <asm/irq.h>
3200 +#include <asm/mach/arch.h>
3201 +#include <asm/mach/map.h>
3202 +#include <asm/mach/irq.h>
3204 +#include <asm/arch/board.h>
3205 +#include <asm/arch/gpio.h>
3206 +#include <asm/arch/at91rm9200_mc.h>
3208 +#include "generic.h"
3212 + * Serial port configuration.
3213 + * 0 .. 3 = USART0 .. USART3
3216 +static struct at91_uart_config __initdata homematic_uart_config = {
3217 + .console_tty = 0, /* ttyS0 */
3219 + .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
3222 +static void __init homematic_map_io(void)
3224 + /* Initialize processor: 18.432 MHz crystal */
3225 + at91rm9200_initialize(18432000, AT91RM9200_BGA);
3227 + /* Setup the serial ports and console */
3228 + at91_init_serial(&homematic_uart_config);
3231 +static void __init homematic_init_irq(void)
3233 + at91rm9200_init_interrupts(NULL);
3236 +static struct at91_eth_data __initdata homematic_eth_data = {
3237 + .phy_irq_pin = AT91_PIN_PC4,
3241 +static struct at91_usbh_data __initdata homematic_usbh_data = {
3245 +static struct at91_udc_data __initdata homematic_udc_data = {
3246 + .vbus_pin = AT91_PIN_PD4,
3247 + .pullup_pin = AT91_PIN_PD5,
3250 +static struct at91_mmc_data __initdata homematic_mmc_data = {
3255 +static struct spi_board_info homematic_spi_devices[] = {
3256 + { /* DataFlash chip */
3257 + .modalias = "mtd_dataflash",
3259 + .max_speed_hz = 15 * 1000 * 1000,
3263 +static struct mtd_partition __initdata homematic_nand_partition[] = {
3267 + .size = 0x02000000,
3269 + .name = "storage",
3270 + .offset = 0x02000000,
3271 + .size = MTDPART_SIZ_FULL,
3275 +static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
3277 + *num_partitions = ARRAY_SIZE(homematic_nand_partition);
3278 + return homematic_nand_partition;
3281 +static struct at91_nand_data __initdata homematic_nand_data = {
3284 +// .det_pin = AT91_PIN_PB1,
3285 + .rdy_pin = AT91_PIN_PC2,
3286 + .enable_pin = AT91_PIN_PC0,
3287 + .partition_info = nand_partitions,
3290 +static void __init homematic_board_init(void)
3293 + at91_add_device_serial();
3295 + at91_add_device_eth(&homematic_eth_data);
3297 + at91_add_device_usbh(&homematic_usbh_data);
3299 + at91_add_device_udc(&homematic_udc_data);
3300 + at91_set_multi_drive(homematic_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
3302 + at91_add_device_i2c(NULL, 0);
3304 + at91_add_device_spi(homematic_spi_devices, ARRAY_SIZE(homematic_spi_devices));
3305 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
3306 + /* DataFlash card */
3307 + at91_set_gpio_output(AT91_PIN_PB7, 0);
3310 + at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
3311 + at91_add_device_mmc(0, &homematic_mmc_data);
3314 + at91_add_device_nand(&homematic_nand_data);
3317 +MACHINE_START(HOMEMATIC, "HomeMatic")
3318 + /* Maintainer: eQ-3 */
3319 + .phys_io = AT91_BASE_SYS,
3320 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
3321 + .boot_params = AT91_SDRAM_BASE + 0x100,
3322 + .timer = &at91rm9200_timer,
3323 + .map_io = homematic_map_io,
3324 + .init_irq = homematic_init_irq,
3325 + .init_machine = homematic_board_init,
3327 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-kb9202.c linux-2.6/arch/arm/mach-at91/board-kb9202.c
3328 --- linux-2.6.25/arch/arm/mach-at91/board-kb9202.c 2008-05-03 00:15:33.000000000 +0200
3329 +++ linux-2.6/arch/arm/mach-at91/board-kb9202.c 2008-04-25 21:15:43.000000000 +0200
3331 #include <asm/arch/board.h>
3332 #include <asm/arch/gpio.h>
3334 -#include "generic.h"
3335 +#include <asm/arch/at91rm9200_mc.h>
3337 +#include "generic.h"
3340 - * Serial port configuration.
3341 - * 0 .. 3 = USART0 .. USART3
3344 -static struct at91_uart_config __initdata kb9202_uart_config = {
3345 - .console_tty = 0, /* ttyS0 */
3347 - .tty_map = { 4, 0, 1, -1, -1 } /* ttyS0, ..., ttyS4 */
3350 static void __init kb9202_map_io(void)
3353 /* Set up the LEDs */
3354 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
3356 - /* Setup the serial ports and console */
3357 - at91_init_serial(&kb9202_uart_config);
3358 + /* DBGU on ttyS0. (Rx & Tx only) */
3359 + at91_register_uart(0, 0, 0);
3361 + /* USART0 on ttyS1 (Rx & Tx only) */
3362 + at91_register_uart(AT91RM9200_ID_US0, 1, 0);
3364 + /* USART1 on ttyS2 (Rx & Tx only) - IRDA (optional) */
3365 + at91_register_uart(AT91RM9200_ID_US1, 2, 0);
3367 + /* USART3 on ttyS3 (Rx, Tx, CTS, RTS) - RS485 (optional) */
3368 + at91_register_uart(AT91RM9200_ID_US3, 3, ATMEL_UART_CTS | ATMEL_UART_RTS);
3370 + /* set serial console to ttyS0 (ie, DBGU) */
3371 + at91_set_serial_console(0);
3374 static void __init kb9202_init_irq(void)
3375 @@ -111,6 +114,48 @@
3376 .partition_info = nand_partitions,
3380 +#if defined(CONFIG_FB_S1D15605)
3381 +#warning "The Reset pin must be passed via platform_data, not this way"
3382 +static struct resource kb9202_lcd_resources[] = {
3384 + .start = AT91_CHIPSELECT_2,
3385 + .end = AT91_CHIPSELECT_2 + 0x200FF,
3386 + .flags = IORESOURCE_MEM
3388 + [1] = { /* reset pin */
3389 + .start = AT91_PIN_PC22,
3390 + .end = AT91_PIN_PC22,
3391 + .flags = IORESOURCE_MEM
3395 +static struct platform_device kb9202_lcd_device = {
3396 + .name = "s1d15605fb",
3398 + .num_resources = ARRAY_SIZE(kb9202_lcd_resources),
3399 + .resource = kb9202_lcd_resources,
3402 +static void __init kb9202_add_device_lcd(void)
3404 + /* In case the boot loader did not set the chip select mode and timing */
3405 + at91_sys_write(AT91_SMC_CSR(2),
3406 + AT91_SMC_WSEN | AT91_SMC_NWS_(18) | AT91_SMC_TDF_(1) | AT91_SMC_DBW_8 |
3407 + AT91_SMC_RWSETUP_(1) | AT91_SMC_RWHOLD_(1));
3409 + /* Backlight pin = output, off */
3410 + at91_set_gpio_output(AT91_PIN_PC23, 0);
3412 + /* Reset pin = output, in reset */
3413 + at91_set_gpio_output(AT91_PIN_PC22, 0);
3415 + platform_device_register(&kb9202_lcd_device);
3418 +static void __init kb9202_add_device_lcd(void) {}
3421 static void __init kb9202_board_init(void)
3425 at91_add_device_spi(NULL, 0);
3427 at91_add_device_nand(&kb9202_nand_data);
3429 + kb9202_add_device_lcd();
3432 MACHINE_START(KB9200, "KB920x")
3433 diff -urN -x CVS linux-2.6.25/arch/arm/mach-at91/board-qil-a9260.c linux-2.6/arch/arm/mach-at91/board-qil-a9260.c
3434 --- linux-2.6.25/arch/arm/mach-at91/board-qil-a9260.c 1970-01-01 02:00:00.000000000 +0200
3435 +++ linux-2.6/arch/arm/mach-at91/board-qil-a9260.c 2008-04-25 21:15:43.000000000 +0200
3438 + * linux/arch/arm/mach-at91/board-qil-a9260.c
3440 + * Copyright (C) 2005 SAN People
3441 + * Copyright (C) 2006 Atmel
3442 + * Copyright (C) 2007 Calao-systems
3444 + * This program is free software; you can redistribute it and/or modify
3445 + * it under the terms of the GNU General Public License as published by
3446 + * the Free Software Foundation; either version 2 of the License, or
3447 + * (at your option) any later version.
3449 + * This program is distributed in the hope that it will be useful,
3450 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3451 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3452 + * GNU General Public License for more details.
3454 + * You should have received a copy of the GNU General Public License
3455 + * along with this program; if not, write to the Free Software
3456 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3459 +#include <linux/types.h>
3460 +#include <linux/init.h>
3461 +#include <linux/mm.h>
3462 +#include <linux/module.h>
3463 +#include <linux/platform_device.h>
3464 +#include <linux/spi/spi.h>
3465 +#include <linux/gpio_keys.h>
3466 +#include <linux/input.h>
3467 +#include <linux/clk.h>
3469 +#include <asm/hardware.h>
3470 +#include <asm/setup.h>
3471 +#include <asm/mach-types.h>
3472 +#include <asm/irq.h>
3474 +#include <asm/mach/arch.h>
3475 +#include <asm/mach/map.h>
3476 +#include <asm/mach/irq.h>
3478 +#include <asm/arch/board.h>
3479 +#include <asm/arch/gpio.h>
3480 +#include <asm/arch/at91_shdwc.h>
3482 +#include "generic.h"
3485 +static void __init ek_map_io(void)
3487 + /* Initialize processor: 12.000 MHz crystal */
3488 + at91sam9260_initialize(12000000);
3490 + /* DGBU on ttyS0. (Rx & Tx only) */
3491 + at91_register_uart(0, 0, 0);
3493 + /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
3494 + at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
3495 + | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
3498 + /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */
3499 + at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
3501 + /* USART2 on ttyS3. (Rx, Tx, CTS, RTS) */
3502 + at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS);
3504 + /* set serial console to ttyS1 (ie, USART0) */
3505 + at91_set_serial_console(1);
3509 +static void __init ek_init_irq(void)
3511 + at91sam9260_init_interrupts(NULL);
3518 +static struct at91_usbh_data __initdata ek_usbh_data = {