diff options
author | Matteo Croce <rootkit85@yahoo.it> | 2008-04-23 20:25:37 +0000 |
---|---|---|
committer | Matteo Croce <rootkit85@yahoo.it> | 2008-04-23 20:25:37 +0000 |
commit | 40e2538d62e4b3627699c91beaf613bc58753dec (patch) | |
tree | 5543327610d85b4d5058182a3be9ce01c96bb7a5 /target | |
parent | 69999abeda2fe3922261b8da6a98f287dbf72eb9 (diff) | |
download | mtk-20170518-40e2538d62e4b3627699c91beaf613bc58753dec.zip mtk-20170518-40e2538d62e4b3627699c91beaf613bc58753dec.tar.gz mtk-20170518-40e2538d62e4b3627699c91beaf613bc58753dec.tar.bz2 |
AVR32: sync with latest Atmel source (closes #3371)
SVN-Revision: 10932
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/avr32/config-default | 92 | ||||
-rw-r--r-- | target/linux/avr32/patches/100-git_sync.patch | 6182 |
2 files changed, 4703 insertions, 1571 deletions
diff --git a/target/linux/avr32/config-default b/target/linux/avr32/config-default index f335257..42c4515 100644 --- a/target/linux/avr32/config-default +++ b/target/linux/avr32/config-default @@ -2,48 +2,66 @@ CONFIG_AP700X_16_BIT_SMC=y # CONFIG_AP700X_32_BIT_SMC is not set # CONFIG_AP700X_8_BIT_SMC is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -# CONFIG_ATM_DRIVERS is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set +# CONFIG_ARCH_SPARSEMEM_ENABLE is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y # CONFIG_ATMEL_PWM is not set # CONFIG_ATMEL_SSC is not set +# CONFIG_ATMEL_TCLIB is not set CONFIG_AVR32=y +CONFIG_BASE_SMALL=0 +CONFIG_BITREVERSE=y CONFIG_BOARD_ATNGW100=y # CONFIG_BOARD_ATNGW100_I2C_GPIO is not set # CONFIG_BOARD_ATSTK1000 is not set # CONFIG_BROADCOM_PHY is not set # CONFIG_BT is not set CONFIG_CPU_AT32AP7000=y +CONFIG_CPU_AT32AP700X=y # CONFIG_CPU_FREQ is not set -# CONFIG_CPU_FREQ_DEBUG is not set -# CONFIG_CPU_FREQ_STAT is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_AT32AP=y +# CONFIG_CRYPTO_HW is not set +# CONFIG_DEBUG_BUGVERBOSE is not set CONFIG_DW_DMAC=y CONFIG_ENTRY_ADDRESS=0x90000000 # CONFIG_FIXED_PHY is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_GPIO=y # CONFIG_GEN_RTC is not set # CONFIG_GPIO_DEV is not set -# CONFIG_HZ_100 is not set -CONFIG_HZ=250 -CONFIG_HZ_250=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +# CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set # CONFIG_HW_RANDOM is not set -# CONFIG_I2C is not set +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ATMELTWI is not set +CONFIG_I2C_BOARDINFO=y +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IDE is not set CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LEDS_ALIX is not set CONFIG_LEDS_GPIO=y +CONFIG_LOADER_U_BOOT=y +CONFIG_LOAD_ADDRESS=0x10000000 CONFIG_MACB=y # CONFIG_MDIO_BITBANG is not set +CONFIG_MTD=y # CONFIG_MTD_ABSENT is not set CONFIG_MTD_BLKDEVS=y -# CONFIG_MTD_BLOCK2MTD is not set CONFIG_MTD_BLOCK=y +# CONFIG_MTD_BLOCK2MTD is not set +CONFIG_MTD_CFI=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_CFI_AMDSTD=y CONFIG_MTD_CFI_I1=y @@ -53,7 +71,6 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_INTELEXT is not set # CONFIG_MTD_CFI_STAA is not set CONFIG_MTD_CFI_UTIL=y -CONFIG_MTD_CFI=y CONFIG_MTD_CHAR=y CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set @@ -65,51 +82,62 @@ CONFIG_MTD_DATAFLASH=y # CONFIG_MTD_DOC2001PLUS is not set CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_JEDECPROBE is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set CONFIG_MTD_MAP_BANK_WIDTH_2=y # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set # CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_NAND is not set -# CONFIG_NETDEV_1000 is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set # CONFIG_MTD_ONENAND is not set CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_PHRAM is not set +CONFIG_MTD_PHYSMAP=y CONFIG_MTD_PHYSMAP_BANKWIDTH=2 CONFIG_MTD_PHYSMAP_LEN=0x0 CONFIG_MTD_PHYSMAP_START=0x80000000 -CONFIG_MTD_PHYSMAP=y # CONFIG_MTD_PLATRAM is not set # CONFIG_MTD_RAM is not set # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_SLRAM is not set -CONFIG_MTD=y +# CONFIG_NEED_NODE_MEMMAP_SIZE is not set # CONFIG_NMI_DEBUGGING is not set +CONFIG_NO_HZ=y # CONFIG_OWNERSHIP_TRACE is not set +CONFIG_PERFORMANCE_COUNTERS=y +CONFIG_PHYLIB=y CONFIG_PHYS_OFFSET=0x10000000 CONFIG_PLATFORM_AT32AP=y # CONFIG_QSEMI_PHY is not set # CONFIG_RTC is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_SCSI_WAIT_SCAN=m # CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL_CONSOLE=y CONFIG_SERIAL_ATMEL_PDC=y # CONFIG_SERIAL_ATMEL_TTYAT is not set -CONFIG_SERIAL_ATMEL=y +CONFIG_SLABINFO=y # CONFIG_SMSC_PHY is not set -# CONFIG_SPI_AT25 is not set +# CONFIG_SND_ATMEL_AC97 is not set +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPI=y CONFIG_SPI_ATMEL=y # CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_DEBUG is not set +# CONFIG_SPI_GPIO is not set CONFIG_SPI_MASTER=y # CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_TLE62X0 is not set -CONFIG_SPI=y +CONFIG_SSB_POSSIBLE=y CONFIG_SUBARCH_AVR32B=y -# CONFIG_UNUSED_SYMBOLS is not set +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_TICK_ONESHOT=y +# CONFIG_USB_ARCH_HAS_EHCI is not set +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set # CONFIG_USER_NS is not set +# CONFIG_VGASTATE is not set # CONFIG_WATCHDOG is not set +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/avr32/patches/100-git_sync.patch b/target/linux/avr32/patches/100-git_sync.patch index bfbc8c1..20c08cf 100644 --- a/target/linux/avr32/patches/100-git_sync.patch +++ b/target/linux/avr32/patches/100-git_sync.patch @@ -1,184 +1,7 @@ - Documentation/kernel-parameters.txt | 5 + - MAINTAINERS | 6 + - Makefile | 2 +- - arch/arm/mach-at91/at91sam9261_devices.c | 14 + - arch/arm/mach-at91/at91sam9rl_devices.c | 14 + - arch/arm/mach-at91/board-sam9261ek.c | 1 + - arch/arm/mach-at91/board-sam9263ek.c | 1 + - arch/avr32/Kconfig | 54 +- - arch/avr32/Kconfig.debug | 10 - - arch/avr32/Makefile | 4 +- - arch/avr32/boards/atngw100/Kconfig | 12 + - arch/avr32/boards/atngw100/setup.c | 14 +- - arch/avr32/boards/atstk1000/Kconfig | 101 ++- - arch/avr32/boards/atstk1000/Makefile | 2 + - arch/avr32/boards/atstk1000/atstk1000.h | 2 + - arch/avr32/boards/atstk1000/atstk1002.c | 129 +-- - arch/avr32/boards/atstk1000/atstk1003.c | 181 +++ - arch/avr32/boards/atstk1000/atstk1004.c | 152 +++ - arch/avr32/boards/atstk1000/setup.c | 64 + - arch/avr32/configs/atngw100_defconfig | 423 +++++--- - arch/avr32/configs/atstk1002_defconfig | 661 ++++++++--- - arch/avr32/configs/atstk1003_defconfig | 1032 ++++++++++++++++ - arch/avr32/configs/atstk1004_defconfig | 627 ++++++++++ - arch/avr32/drivers/Makefile | 1 + - arch/avr32/drivers/dw-dmac.c | 761 ++++++++++++ - arch/avr32/drivers/dw-dmac.h | 42 + - arch/avr32/kernel/Makefile | 4 +- - arch/avr32/kernel/cpu.c | 96 ++- - arch/avr32/kernel/dma-controller.c | 34 + - arch/avr32/kernel/irq.c | 11 + - arch/avr32/kernel/kprobes.c | 5 +- - arch/avr32/kernel/nmi_debug.c | 82 ++ - arch/avr32/kernel/ocd.c | 163 +++ - arch/avr32/kernel/process.c | 5 +- - arch/avr32/kernel/ptrace.c | 5 +- - arch/avr32/kernel/setup.c | 2 + - arch/avr32/kernel/signal.c | 7 - - arch/avr32/kernel/traps.c | 21 +- - arch/avr32/mach-at32ap/Kconfig | 19 +- - arch/avr32/mach-at32ap/Makefile | 5 +- - arch/avr32/mach-at32ap/at32ap7000.c | 1730 -------------------------- - arch/avr32/mach-at32ap/at32ap700x.c | 1809 ++++++++++++++++++++++++++++ - arch/avr32/mach-at32ap/extint.c | 59 +- - arch/avr32/mach-at32ap/gpio-dev.c | 573 +++++++++ - arch/avr32/mach-at32ap/pio.c | 76 ++ - arch/avr32/mm/dma-coherent.c | 7 + - arch/avr32/mm/tlb.c | 2 +- - arch/avr32/oprofile/Makefile | 8 + - arch/avr32/oprofile/op_model_avr32.c | 235 ++++ - drivers/i2c/busses/Kconfig | 8 + - drivers/i2c/busses/Makefile | 1 + - drivers/i2c/busses/i2c-atmeltwi.c | 436 +++++++ - drivers/i2c/busses/i2c-atmeltwi.h | 117 ++ - drivers/leds/Kconfig | 7 + - drivers/leds/Makefile | 1 + - drivers/leds/leds-atmel-pwm.c | 155 +++ - drivers/misc/Kconfig | 9 + - drivers/misc/Makefile | 1 + - drivers/misc/atmel_pwm.c | 409 +++++++ - drivers/mmc/host/Kconfig | 10 + - drivers/mmc/host/Makefile | 1 + - drivers/mmc/host/atmel-mci.c | 1176 ++++++++++++++++++ - drivers/mmc/host/atmel-mci.h | 192 +++ - drivers/mtd/chips/cfi_cmdset_0001.c | 43 + - drivers/mtd/chips/cfi_cmdset_0002.c | 6 +- - drivers/pcmcia/Kconfig | 7 + - drivers/pcmcia/Makefile | 1 + - drivers/pcmcia/at32_cf.c | 533 ++++++++ - drivers/serial/Kconfig | 15 + - drivers/serial/atmel_serial.c | 884 +++++++++++--- - drivers/spi/atmel_spi.c | 173 ++- - drivers/video/atmel_lcdfb.c | 149 +++- - drivers/video/backlight/Kconfig | 13 + - drivers/video/console/Kconfig | 2 +- - drivers/watchdog/Kconfig | 2 +- - include/asm-avr32/arch-at32ap/at32ap7000.h | 35 - - include/asm-avr32/arch-at32ap/at32ap700x.h | 35 + - include/asm-avr32/arch-at32ap/board.h | 11 +- - include/asm-avr32/arch-at32ap/cpu.h | 2 +- - include/asm-avr32/arch-at32ap/io.h | 4 +- - include/asm-avr32/arch-at32ap/portmux.h | 12 + - include/asm-avr32/dma-controller.h | 166 +++ - include/asm-avr32/irq.h | 5 + - include/asm-avr32/kdebug.h | 1 + - include/asm-avr32/ocd.h | 5 + - include/asm-avr32/processor.h | 14 + - include/asm-avr32/ptrace.h | 13 +- - include/asm-avr32/thread_info.h | 1 + - include/linux/atmel_pwm.h | 70 ++ - include/video/atmel_lcdc.h | 25 +- - kernel/ptrace.c | 2 + - sound/Kconfig | 2 + - sound/Makefile | 2 +- - sound/avr32/Kconfig | 11 + - sound/avr32/Makefile | 3 + - sound/avr32/ac97c.c | 914 ++++++++++++++ - sound/avr32/ac97c.h | 71 ++ - sound/oss/Kconfig | 4 + - sound/oss/Makefile | 1 + - sound/oss/at32_abdac.c | 722 +++++++++++ - sound/oss/at32_abdac.h | 59 + - 101 files changed, 13294 insertions(+), 2520 deletions(-) - create mode 100644 arch/avr32/boards/atngw100/Kconfig - create mode 100644 arch/avr32/boards/atstk1000/atstk1003.c - create mode 100644 arch/avr32/boards/atstk1000/atstk1004.c - create mode 100644 arch/avr32/configs/atstk1003_defconfig - create mode 100644 arch/avr32/configs/atstk1004_defconfig - create mode 100644 arch/avr32/drivers/Makefile - create mode 100644 arch/avr32/drivers/dw-dmac.c - create mode 100644 arch/avr32/drivers/dw-dmac.h - create mode 100644 arch/avr32/kernel/dma-controller.c - create mode 100644 arch/avr32/kernel/nmi_debug.c - create mode 100644 arch/avr32/kernel/ocd.c - delete mode 100644 arch/avr32/mach-at32ap/at32ap7000.c - create mode 100644 arch/avr32/mach-at32ap/at32ap700x.c - create mode 100644 arch/avr32/mach-at32ap/gpio-dev.c - create mode 100644 arch/avr32/oprofile/Makefile - create mode 100644 arch/avr32/oprofile/op_model_avr32.c - create mode 100644 drivers/i2c/busses/i2c-atmeltwi.c - create mode 100644 drivers/i2c/busses/i2c-atmeltwi.h - create mode 100644 drivers/leds/leds-atmel-pwm.c - create mode 100644 drivers/misc/atmel_pwm.c - create mode 100644 drivers/mmc/host/atmel-mci.c - create mode 100644 drivers/mmc/host/atmel-mci.h - create mode 100644 drivers/pcmcia/at32_cf.c - delete mode 100644 include/asm-avr32/arch-at32ap/at32ap7000.h - create mode 100644 include/asm-avr32/arch-at32ap/at32ap700x.h - create mode 100644 include/asm-avr32/dma-controller.h - create mode 100644 include/linux/atmel_pwm.h - create mode 100644 sound/avr32/Kconfig - create mode 100644 sound/avr32/Makefile - create mode 100644 sound/avr32/ac97c.c - create mode 100644 sound/avr32/ac97c.h - create mode 100644 sound/oss/at32_abdac.c - create mode 100644 sound/oss/at32_abdac.h - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index c417877..17fc60e 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -34,6 +34,7 @@ parameter is applicable: - ALSA ALSA sound support is enabled. - APIC APIC support is enabled. - APM Advanced Power Management support is enabled. -+ AVR32 AVR32 architecture is enabled. - AX25 Appropriate AX.25 support is enabled. - BLACKFIN Blackfin architecture is enabled. - DRM Direct Rendering Management support is enabled. -@@ -1123,6 +1124,10 @@ and is between 256 and 4096 characters. It is defined in the file - of returning the full 64-bit number. - The default is to return 64-bit inode numbers. - -+ nmi_debug= [KNL,AVR32] Specify one or more actions to take -+ when a NMI is triggered. -+ Format: [state][,regs][,debounce][,die] -+ - nmi_watchdog= [KNL,BUGS=X86-32] Debugging features for SMP kernels - - no387 [BUGS=X86-32] Tells the kernel to use the 387 maths -diff --git a/MAINTAINERS b/MAINTAINERS -index 2340cfb..e349a9e 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -671,6 +671,12 @@ W: http://www.atmel.com/products/AT91/ - W: http://www.at91.com/ - S: Maintained - -+ATMEL AT91 / AT32 SERIAL DRIVER -+P: Haavard Skinnemoen -+M: hskinnemoen@atmel.com -+L: linux-kernel@vger.kernel.org -+S: Supported -+ - ATMEL LCDFB DRIVER - P: Nicolas Ferre - M: nicolas.ferre@atmel.com -diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c -index 64979a9..bfa3d18 100644 ---- a/arch/arm/mach-at91/at91sam9261_devices.c -+++ b/arch/arm/mach-at91/at91sam9261_devices.c -@@ -530,6 +530,20 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +diff -urN linux-2.6.24.3/arch/arm/mach-at91/at91sam9261_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9261_devices.c +--- linux-2.6.24.3/arch/arm/mach-at91/at91sam9261_devices.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9261_devices.c 2008-04-23 20:12:35.000000000 +0200 +@@ -530,6 +530,20 @@ at91_set_B_periph(AT91_PIN_PB27, 0); /* LCDD22 */ at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */ @@ -199,11 +22,10 @@ index 64979a9..bfa3d18 100644 lcdc_data = *data; platform_device_register(&at91_lcdc_device); } -diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c -index 2bd60a3..84ee029 100644 ---- a/arch/arm/mach-at91/at91sam9rl_devices.c -+++ b/arch/arm/mach-at91/at91sam9rl_devices.c -@@ -375,6 +375,20 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +diff -urN linux-2.6.24.3/arch/arm/mach-at91/at91sam9rl_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9rl_devices.c +--- linux-2.6.24.3/arch/arm/mach-at91/at91sam9rl_devices.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9rl_devices.c 2008-04-23 20:12:35.000000000 +0200 +@@ -375,6 +375,20 @@ at91_set_B_periph(AT91_PIN_PC24, 0); /* LCDD22 */ at91_set_B_periph(AT91_PIN_PC25, 0); /* LCDD23 */ @@ -224,11 +46,10 @@ index 2bd60a3..84ee029 100644 lcdc_data = *data; platform_device_register(&at91_lcdc_device); } -diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c -index 550ae59..0d275bb 100644 ---- a/arch/arm/mach-at91/board-sam9261ek.c -+++ b/arch/arm/mach-at91/board-sam9261ek.c -@@ -322,6 +322,7 @@ static void at91_lcdc_power_control(int on) +diff -urN linux-2.6.24.3/arch/arm/mach-at91/board-sam9261ek.c avr32-2.6/arch/arm/mach-at91/board-sam9261ek.c +--- linux-2.6.24.3/arch/arm/mach-at91/board-sam9261ek.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9261ek.c 2008-04-23 20:12:35.000000000 +0200 +@@ -322,6 +322,7 @@ /* Driver datas */ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { @@ -236,11 +57,10 @@ index 550ae59..0d275bb 100644 .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN, .default_lcdcon2 = AT91SAM9261_DEFAULT_LCDCON2, -diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c -index ab9dcc0..39bded2 100644 ---- a/arch/arm/mach-at91/board-sam9263ek.c -+++ b/arch/arm/mach-at91/board-sam9263ek.c -@@ -250,6 +250,7 @@ static void at91_lcdc_power_control(int on) +diff -urN linux-2.6.24.3/arch/arm/mach-at91/board-sam9263ek.c avr32-2.6/arch/arm/mach-at91/board-sam9263ek.c +--- linux-2.6.24.3/arch/arm/mach-at91/board-sam9263ek.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9263ek.c 2008-04-23 20:12:35.000000000 +0200 +@@ -250,6 +250,7 @@ /* Driver datas */ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { @@ -248,169 +68,49 @@ index ab9dcc0..39bded2 100644 .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN, .default_lcdcon2 = AT91SAM9263_DEFAULT_LCDCON2, -diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig -index b77abce..3f09270 100644 ---- a/arch/avr32/Kconfig -+++ b/arch/avr32/Kconfig -@@ -54,6 +54,9 @@ config ARCH_HAS_ILOG2_U32 - config ARCH_HAS_ILOG2_U64 - def_bool n +diff -urN linux-2.6.24.3/arch/arm/mach-at91/Kconfig avr32-2.6/arch/arm/mach-at91/Kconfig +--- linux-2.6.24.3/arch/arm/mach-at91/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/arm/mach-at91/Kconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -219,6 +219,36 @@ + Select this if you need to program one or more of the PCK0..PCK3 + programmable clock outputs. -+config ARCH_SUPPORTS_OPROFILE -+ def_bool y ++choice ++ prompt "Select a UART for early kernel messages" + - config GENERIC_HWEIGHT - def_bool y - -@@ -81,19 +84,23 @@ config PLATFORM_AT32AP - select MMU - select PERFORMANCE_COUNTERS - --choice -- prompt "AVR32 CPU type" -- default CPU_AT32AP7000 -+# -+# CPU types -+# - --config CPU_AT32AP7000 -- bool "AT32AP7000" -+# AP7000 derivatives -+config CPU_AT32AP700X -+ bool - select PLATFORM_AT32AP --endchoice -- --# --# CPU Daughterboards for ATSTK1000 --config BOARD_ATSTK1002 -+config CPU_AT32AP7000 -+ bool -+ select CPU_AT32AP700X -+config CPU_AT32AP7001 -+ bool -+ select CPU_AT32AP700X -+config CPU_AT32AP7002 - bool -+ select CPU_AT32AP700X - - choice - prompt "AVR32 board type" -@@ -101,15 +108,18 @@ choice - - config BOARD_ATSTK1000 - bool "ATSTK1000 evaluation board" -- select BOARD_ATSTK1002 if CPU_AT32AP7000 - - config BOARD_ATNGW100 - bool "ATNGW100 Network Gateway" -+ select CPU_AT32AP7000 - endchoice - - if BOARD_ATSTK1000 - source "arch/avr32/boards/atstk1000/Kconfig" - endif -+if BOARD_ATNGW100 -+source "arch/avr32/boards/atngw100/Kconfig" -+endif - - choice - prompt "Boot loader type" -@@ -123,15 +133,15 @@ source "arch/avr32/mach-at32ap/Kconfig" - - config LOAD_ADDRESS - hex -- default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y -+ default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y - - config ENTRY_ADDRESS - hex -- default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y -+ default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y - - config PHYS_OFFSET - hex -- default 0x10000000 if CPU_AT32AP7000=y -+ default 0x10000000 if CPU_AT32AP700X=y - - source "kernel/Kconfig.preempt" - -@@ -163,6 +173,20 @@ config OWNERSHIP_TRACE - enabling Nexus-compliant debuggers to keep track of the PID of the - currently executing task. - -+config NMI_DEBUGGING -+ bool "NMI Debugging" -+ default n -+ help -+ Say Y here and pass the nmi_debug command-line parameter to -+ the kernel to turn on NMI debugging. Depending on the value -+ of the nmi_debug option, various pieces of information will -+ be dumped to the console when a Non-Maskable Interrupt -+ happens. ++config AT91_EARLY_DBGU ++ bool "DBGU" + -+config DW_DMAC -+ tristate "Synopsys DesignWare DMA Controller support" -+ default y if CPU_AT32AP7000 ++config AT91_EARLY_USART0 ++ bool "USART0" + - # FPU emulation goes here - - source "kernel/Kconfig.hz" -@@ -219,6 +243,8 @@ source "drivers/Kconfig" - - source "fs/Kconfig" - -+source "kernel/Kconfig.instrumentation" ++config AT91_EARLY_USART1 ++ bool "USART1" ++ ++config AT91_EARLY_USART2 ++ bool "USART2" ++ depends on ! ARCH_AT91X40 ++ ++config AT91_EARLY_USART3 ++ bool "USART3" ++ depends on (ARCH_AT91RM9200 || ARCH_AT91SAM9RL || ARCH_AT91SAM9260) ++ ++config AT91_EARLY_USART4 ++ bool "USART4" ++ depends on ARCH_AT91SAM9260 ++ ++config AT91_EARLY_USART5 ++ bool "USART5" ++ depends on ARCH_AT91SAM9260 ++ ++endchoice + - source "arch/avr32/Kconfig.debug" - - source "security/Kconfig" -diff --git a/arch/avr32/Kconfig.debug b/arch/avr32/Kconfig.debug -index 64ace00..2283933 100644 ---- a/arch/avr32/Kconfig.debug -+++ b/arch/avr32/Kconfig.debug -@@ -6,14 +6,4 @@ config TRACE_IRQFLAGS_SUPPORT - - source "lib/Kconfig.debug" - --config KPROBES -- bool "Kprobes" -- depends on DEBUG_KERNEL -- help -- Kprobes allows you to trap at almost any kernel address and -- execute a callback function. register_kprobe() establishes -- a probepoint and specifies the callback. Kprobes is useful -- for kernel debugging, non-intrusive instrumentation and testing. -- If in doubt, say "N". -- endmenu -diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile -index 8791864..2d7bacd 100644 ---- a/arch/avr32/Makefile -+++ b/arch/avr32/Makefile -@@ -16,7 +16,7 @@ KBUILD_AFLAGS += -mrelax -mno-pic - CFLAGS_MODULE += -mno-relax - LDFLAGS_vmlinux += --relax - --cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000 -+cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap - - KBUILD_CFLAGS += $(cpuflags-y) - KBUILD_AFLAGS += $(cpuflags-y) -@@ -31,6 +31,8 @@ core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ - core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ - core-y += arch/avr32/kernel/ - core-y += arch/avr32/mm/ -+drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ -+drivers-y += arch/avr32/drivers/ - libs-y += arch/avr32/lib/ - archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap -diff --git a/arch/avr32/boards/atngw100/Kconfig b/arch/avr32/boards/atngw100/Kconfig -new file mode 100644 -index 0000000..5d922df ---- /dev/null -+++ b/arch/avr32/boards/atngw100/Kconfig + endif +diff -urN linux-2.6.24.3/arch/avr32/boards/atngw100/Kconfig avr32-2.6/arch/avr32/boards/atngw100/Kconfig +--- linux-2.6.24.3/arch/avr32/boards/atngw100/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atngw100/Kconfig 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,12 @@ +# NGW100 customization + @@ -424,10 +124,9 @@ index 0000000..5d922df + + Choose 'Y' here if you're having i2c-related problems and + want to rule out the i2c bus driver. -diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c -index 52987c8..383b825 100644 ---- a/arch/avr32/boards/atngw100/setup.c -+++ b/arch/avr32/boards/atngw100/setup.c +diff -urN linux-2.6.24.3/arch/avr32/boards/atngw100/setup.c avr32-2.6/arch/avr32/boards/atngw100/setup.c +--- linux-2.6.24.3/arch/avr32/boards/atngw100/setup.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atngw100/setup.c 2008-04-23 20:12:35.000000000 +0200 @@ -20,7 +20,7 @@ #include <asm/io.h> #include <asm/setup.h> @@ -437,7 +136,13 @@ index 52987c8..383b825 100644 #include <asm/arch/board.h> #include <asm/arch/init.h> #include <asm/arch/portmux.h> -@@ -42,6 +42,11 @@ static struct spi_board_info spi0_board_info[] __initdata = { +@@ -37,11 +37,16 @@ + static struct spi_board_info spi0_board_info[] __initdata = { + { + .modalias = "mtd_dataflash", +- .max_speed_hz = 10000000, ++ .max_speed_hz = 8000000, + .chip_select = 0, }, }; @@ -449,7 +154,7 @@ index 52987c8..383b825 100644 /* * The next two functions should go away as the boot loader is * supposed to initialize the macb address registers with a valid -@@ -124,6 +129,7 @@ static struct platform_device ngw_gpio_leds = { +@@ -124,6 +129,7 @@ } }; @@ -457,7 +162,7 @@ index 52987c8..383b825 100644 static struct i2c_gpio_platform_data i2c_gpio_data = { .sda_pin = GPIO_PIN_PA(6), .scl_pin = GPIO_PIN_PA(7), -@@ -139,6 +145,7 @@ static struct platform_device i2c_gpio_device = { +@@ -139,6 +145,7 @@ .platform_data = &i2c_gpio_data, }, }; @@ -465,7 +170,7 @@ index 52987c8..383b825 100644 static int __init atngw100_init(void) { -@@ -157,6 +164,7 @@ static int __init atngw100_init(void) +@@ -157,6 +164,7 @@ set_hw_addr(at32_add_device_eth(1, ð_data[1])); at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); @@ -473,7 +178,7 @@ index 52987c8..383b825 100644 at32_add_device_usba(0, NULL); for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { -@@ -165,11 +173,15 @@ static int __init atngw100_init(void) +@@ -165,11 +173,15 @@ } platform_device_register(&ngw_gpio_leds); @@ -484,193 +189,14 @@ index 52987c8..383b825 100644 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); platform_device_register(&i2c_gpio_device); +#else -+ at32_add_device_twi(0); ++ at32_add_device_twi(0, NULL, 0); +#endif return 0; } -diff --git a/arch/avr32/boards/atstk1000/Kconfig b/arch/avr32/boards/atstk1000/Kconfig -index 718578f..56a8d8e 100644 ---- a/arch/avr32/boards/atstk1000/Kconfig -+++ b/arch/avr32/boards/atstk1000/Kconfig -@@ -1,34 +1,53 @@ - # STK1000 customization - --if BOARD_ATSTK1002 -+if BOARD_ATSTK1000 - --config BOARD_ATSTK1002_CUSTOM -- bool "Non-default STK-1002 jumper settings" -+choice -+ prompt "ATSTK1000 CPU daughterboard type" -+ default BOARD_ATSTK1002 -+ -+config BOARD_ATSTK1002 -+ bool "ATSTK1002" -+ select CPU_AT32AP7000 -+ -+config BOARD_ATSTK1003 -+ bool "ATSTK1003" -+ select CPU_AT32AP7001 -+ -+config BOARD_ATSTK1004 -+ bool "ATSTK1004" -+ select CPU_AT32AP7002 -+ -+endchoice -+ -+ -+config BOARD_ATSTK100X_CUSTOM -+ bool "Non-default STK1002/STK1003/STK1004 jumper settings" - help - You will normally leave the jumpers on the CPU card at their - default settings. If you need to use certain peripherals, - you will need to change some of those jumpers. - --if BOARD_ATSTK1002_CUSTOM -+if BOARD_ATSTK100X_CUSTOM - --config BOARD_ATSTK1002_SW1_CUSTOM -+config BOARD_ATSTK100X_SW1_CUSTOM - bool "SW1: use SSC1 (not SPI0)" - help - This also prevents using the external DAC as an audio interface, - and means you can't initialize the on-board QVGA display. - --config BOARD_ATSTK1002_SW2_CUSTOM -+config BOARD_ATSTK100X_SW2_CUSTOM - bool "SW2: use IRDA or TIMER0 (not UART-A, MMC/SD, and PS2-A)" - help - If you change this you'll want an updated boot loader putting - the console on UART-C not UART-A. - --config BOARD_ATSTK1002_SW3_CUSTOM -+config BOARD_ATSTK100X_SW3_CUSTOM - bool "SW3: use TIMER1 (not SSC0 and GCLK)" - help - This also prevents using the external DAC as an audio interface. - --config BOARD_ATSTK1002_SW4_CUSTOM -+config BOARD_ATSTK100X_SW4_CUSTOM - bool "SW4: use ISI/Camera (not GPIOs, SPI1, and PS2-B)" - help - To use the camera interface you'll need a custom card (on the -@@ -36,27 +55,29 @@ config BOARD_ATSTK1002_SW4_CUSTOM - - config BOARD_ATSTK1002_SW5_CUSTOM - bool "SW5: use MACB1 (not LCDC)" -+ depends on BOARD_ATSTK1002 - - config BOARD_ATSTK1002_SW6_CUSTOM - bool "SW6: more GPIOs (not MACB0)" -+ depends on BOARD_ATSTK1002 - - endif # custom - --config BOARD_ATSTK1002_SPI1 -+config BOARD_ATSTK100X_SPI1 - bool "Configure SPI1 controller" -- depends on !BOARD_ATSTK1002_SW4_CUSTOM -+ depends on !BOARD_ATSTK100X_SW4_CUSTOM - help - All the signals for the second SPI controller are available on - GPIO lines and accessed through the J1 jumper block. Say "y" - here to configure that SPI controller. - --config BOARD_ATSTK1002_J2_LED -+config BOARD_ATSTK1000_J2_LED - bool -- default BOARD_ATSTK1002_J2_LED8 || BOARD_ATSTK1002_J2_RGB -+ default BOARD_ATSTK1000_J2_LED8 || BOARD_ATSTK1000_J2_RGB - - choice - prompt "LEDs connected to J2:" -- depends on LEDS_GPIO && !BOARD_ATSTK1002_SW4_CUSTOM -+ depends on LEDS_GPIO && !BOARD_ATSTK100X_SW4_CUSTOM - optional - help - Select this if you have jumpered the J2 jumper block to the -@@ -64,16 +85,64 @@ choice - IDC cable. A default "heartbeat" trigger is provided, but - you can of course override this. - --config BOARD_ATSTK1002_J2_LED8 -+config BOARD_ATSTK1000_J2_LED8 - bool "LED0..LED7" - help - Select this if J2 is jumpered to LED0..LED7 amber leds. - --config BOARD_ATSTK1002_J2_RGB -+config BOARD_ATSTK1000_J2_RGB - bool "RGB leds" - help - Select this if J2 is jumpered to the RGB leds. - - endchoice - --endif # stk 1002 -+config BOARD_ATSTK1000_EXTDAC -+ bool -+ depends on !BOARD_ATSTK100X_SW1_CUSTOM && !BOARD_ATSTK100X_SW3_CUSTOM -+ default y -+ -+config BOARD_ATSTK100X_ENABLE_AC97 -+ bool "Use AC97C instead of ABDAC" -+ help -+ Select this if you want to use the built-in AC97 controller -+ instead of the built-in Audio Bitstream DAC. These share -+ the same I/O pins on the AP7000, so both can't be enabled -+ at the same time. -+ -+ Note that the STK1000 kit doesn't ship with an AC97 codec on -+ board, so say N unless you've got an expansion board with an -+ AC97 codec on it that you want to use. -+ -+config BOARD_ATSTK1000_CF_HACKS -+ bool "ATSTK1000 CompactFlash hacks" -+ depends on !BOARD_ATSTK100X_SW4_CUSTOM -+ help -+ Select this if you have re-routed the CompactFlash RESET and -+ CD signals to GPIOs on your STK1000. This is necessary for -+ reset and card detection to work properly, although some CF -+ cards may be able to cope without reset. -+ -+config BOARD_ATSTK1000_CF_RESET_PIN -+ hex "CompactFlash RESET pin" -+ default 0x30 -+ depends on BOARD_ATSTK1000_CF_HACKS -+ help -+ Select which GPIO pin to use for the CompactFlash RESET -+ signal. This is specified as a hexadecimal number and should -+ be defined as 0x20 * gpio_port + pin. -+ -+ The default is 0x30, which is pin 16 on PIOB, aka GPIO14. -+ -+config BOARD_ATSTK1000_CF_DETECT_PIN -+ hex "CompactFlash DETECT pin" -+ default 0x3e -+ depends on BOARD_ATSTK1000_CF_HACKS -+ help -+ Select which GPIO pin to use for the CompactFlash CD -+ signal. This is specified as a hexadecimal number and should -+ be defined as 0x20 * gpio_port + pin. -+ -+ The default is 0x3e, which is pin 30 on PIOB, aka GPIO15. -+ -+endif # stk 1000 -diff --git a/arch/avr32/boards/atstk1000/Makefile b/arch/avr32/boards/atstk1000/Makefile -index 8e09922..beead86 100644 ---- a/arch/avr32/boards/atstk1000/Makefile -+++ b/arch/avr32/boards/atstk1000/Makefile -@@ -1,2 +1,4 @@ - obj-y += setup.o flash.o - obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o -+obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o -+obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o -diff --git a/arch/avr32/boards/atstk1000/atstk1000.h b/arch/avr32/boards/atstk1000/atstk1000.h -index 9a49ed0..9392d32 100644 ---- a/arch/avr32/boards/atstk1000/atstk1000.h -+++ b/arch/avr32/boards/atstk1000/atstk1000.h +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1000.h avr32-2.6/arch/avr32/boards/atstk1000/atstk1000.h +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1000.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1000.h 2008-04-23 19:33:28.000000000 +0200 @@ -12,4 +12,6 @@ extern struct atmel_lcdfb_info atstk1000_lcdc_data; @@ -678,10 +204,9 @@ index 9a49ed0..9392d32 100644 +void atstk1000_setup_j2_leds(void); + #endif /* __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H */ -diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c -index 5be0d13..90436fa 100644 ---- a/arch/avr32/boards/atstk1000/atstk1002.c -+++ b/arch/avr32/boards/atstk1000/atstk1002.c +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1002.c avr32-2.6/arch/avr32/boards/atstk1000/atstk1002.c +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1002.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1002.c 2008-04-23 20:12:35.000000000 +0200 @@ -11,7 +11,6 @@ #include <linux/etherdevice.h> #include <linux/init.h> @@ -699,7 +224,7 @@ index 5be0d13..90436fa 100644 #include <asm/arch/board.h> #include <asm/arch/init.h> #include <asm/arch/portmux.h> -@@ -49,18 +48,16 @@ static struct eth_platform_data __initdata eth_data[2] = { +@@ -49,18 +48,16 @@ }, }; @@ -721,7 +246,7 @@ index 5be0d13..90436fa 100644 { /* AT73C213 */ .modalias = "at73c213", -@@ -80,12 +77,25 @@ static struct spi_board_info spi0_board_info[] __initdata = { +@@ -80,12 +77,25 @@ }; #endif @@ -748,7 +273,7 @@ index 5be0d13..90436fa 100644 /* * The next two functions should go away as the boot loader is * supposed to initialize the macb address registers with a valid -@@ -141,68 +151,8 @@ static void __init set_hw_addr(struct platform_device *pdev) +@@ -141,68 +151,8 @@ clk_put(pclk); } @@ -819,7 +344,7 @@ index 5be0d13..90436fa 100644 { struct clk *gclk; struct clk *pll; -@@ -220,7 +170,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) +@@ -220,7 +170,7 @@ } at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); @@ -828,7 +353,7 @@ index 5be0d13..90436fa 100644 err_set_clk: clk_put(pll); -@@ -229,12 +179,16 @@ err_pll: +@@ -229,12 +179,16 @@ err_gclk: return; } @@ -848,7 +373,7 @@ index 5be0d13..90436fa 100644 at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ #else at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ -@@ -271,7 +225,7 @@ static int __init atstk1002_init(void) +@@ -271,7 +225,7 @@ at32_add_system_devices(); @@ -857,7 +382,7 @@ index 5be0d13..90436fa 100644 at32_add_device_usart(1); #else at32_add_device_usart(0); -@@ -281,12 +235,16 @@ static int __init atstk1002_init(void) +@@ -281,12 +235,16 @@ #ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM set_hw_addr(at32_add_device_eth(0, ð_data[0])); #endif @@ -869,46 +394,49 @@ index 5be0d13..90436fa 100644 +#ifdef CONFIG_BOARD_ATSTK100X_SPI1 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); #endif -+ at32_add_device_twi(0); ++ at32_add_device_twi(0, NULL, 0); +#ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM + at32_add_device_mci(0, NULL); +#endif #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM set_hw_addr(at32_add_device_eth(1, ð_data[1])); #else -@@ -294,17 +252,18 @@ static int __init atstk1002_init(void) +@@ -294,18 +252,23 @@ fbmem_start, fbmem_size); #endif at32_add_device_usba(0, NULL); -#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM +- at32_add_device_ssc(0, ATMEL_SSC_TX); +#ifdef CONFIG_BOARD_ATSTK100X_ENABLE_AC97 + at32_add_device_ac97c(0); +#else + at32_add_device_abdac(0); -+#endif -+#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM - at32_add_device_ssc(0, ATMEL_SSC_TX); #endif -+ at32_add_device_cf(0, 2, &cf0_data); - +- - setup_j2_leds(); - -#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM -#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM - at73c213_set_clk(&at73c213_data); --#endif --#endif ++#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM ++ at32_add_device_ssc(0, ATMEL_SSC_TX); + #endif ++ at32_add_device_cf(0, 2, &cf0_data); ++#ifdef CONFIG_BOARD_ATSTK100X_ENABLE_PSIF ++ at32_add_device_psif(0); ++ at32_add_device_psif(1); + #endif + + atstk1000_setup_j2_leds(); + atstk1002_setup_extdac(); - ++ return 0; } -diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c -new file mode 100644 -index 0000000..768d204 ---- /dev/null -+++ b/arch/avr32/boards/atstk1000/atstk1003.c -@@ -0,0 +1,181 @@ + postcore_initcall(atstk1002_init); +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1003.c avr32-2.6/arch/avr32/boards/atstk1000/atstk1003.c +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1003.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1003.c 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,185 @@ +/* + * ATSTK1003 daughterboard-specific init code + * @@ -1083,6 +611,10 @@ index 0000000..768d204 + at32_add_device_ssc(0, ATMEL_SSC_TX); +#endif + at32_add_device_cf(0, 2, &cf0_data); ++#ifdef CONFIG_BOARD_ATSTK100X_ENABLE_PSIF ++ at32_add_device_psif(0); ++ at32_add_device_psif(1); ++#endif + + atstk1000_setup_j2_leds(); + atstk1003_setup_extdac(); @@ -1090,12 +622,10 @@ index 0000000..768d204 + return 0; +} +postcore_initcall(atstk1003_init); -diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c -new file mode 100644 -index 0000000..96015dd ---- /dev/null -+++ b/arch/avr32/boards/atstk1000/atstk1004.c -@@ -0,0 +1,152 @@ +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1004.c avr32-2.6/arch/avr32/boards/atstk1000/atstk1004.c +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/atstk1004.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1004.c 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,156 @@ +/* + * ATSTK1003 daughterboard-specific init code + * @@ -1241,6 +771,10 @@ index 0000000..96015dd +#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM + at32_add_device_ssc(0, ATMEL_SSC_TX); +#endif ++#ifdef CONFIG_BOARD_ATSTK100X_ENABLE_PSIF ++ at32_add_device_psif(0); ++ at32_add_device_psif(1); ++#endif + + atstk1000_setup_j2_leds(); + atstk1004_setup_extdac(); @@ -1248,10 +782,198 @@ index 0000000..96015dd + return 0; +} +postcore_initcall(atstk1004_init); -diff --git a/arch/avr32/boards/atstk1000/setup.c b/arch/avr32/boards/atstk1000/setup.c -index c9af409..8bedf93 100644 ---- a/arch/avr32/boards/atstk1000/setup.c -+++ b/arch/avr32/boards/atstk1000/setup.c +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/Kconfig avr32-2.6/arch/avr32/boards/atstk1000/Kconfig +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/Kconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -1,34 +1,53 @@ + # STK1000 customization + +-if BOARD_ATSTK1002 ++if BOARD_ATSTK1000 + +-config BOARD_ATSTK1002_CUSTOM +- bool "Non-default STK-1002 jumper settings" ++choice ++ prompt "ATSTK1000 CPU daughterboard type" ++ default BOARD_ATSTK1002 ++ ++config BOARD_ATSTK1002 ++ bool "ATSTK1002" ++ select CPU_AT32AP7000 ++ ++config BOARD_ATSTK1003 ++ bool "ATSTK1003" ++ select CPU_AT32AP7001 ++ ++config BOARD_ATSTK1004 ++ bool "ATSTK1004" ++ select CPU_AT32AP7002 ++ ++endchoice ++ ++ ++config BOARD_ATSTK100X_CUSTOM ++ bool "Non-default STK1002/STK1003/STK1004 jumper settings" + help + You will normally leave the jumpers on the CPU card at their + default settings. If you need to use certain peripherals, + you will need to change some of those jumpers. + +-if BOARD_ATSTK1002_CUSTOM ++if BOARD_ATSTK100X_CUSTOM + +-config BOARD_ATSTK1002_SW1_CUSTOM ++config BOARD_ATSTK100X_SW1_CUSTOM + bool "SW1: use SSC1 (not SPI0)" + help + This also prevents using the external DAC as an audio interface, + and means you can't initialize the on-board QVGA display. + +-config BOARD_ATSTK1002_SW2_CUSTOM ++config BOARD_ATSTK100X_SW2_CUSTOM + bool "SW2: use IRDA or TIMER0 (not UART-A, MMC/SD, and PS2-A)" + help + If you change this you'll want an updated boot loader putting + the console on UART-C not UART-A. + +-config BOARD_ATSTK1002_SW3_CUSTOM ++config BOARD_ATSTK100X_SW3_CUSTOM + bool "SW3: use TIMER1 (not SSC0 and GCLK)" + help + This also prevents using the external DAC as an audio interface. + +-config BOARD_ATSTK1002_SW4_CUSTOM ++config BOARD_ATSTK100X_SW4_CUSTOM + bool "SW4: use ISI/Camera (not GPIOs, SPI1, and PS2-B)" + help + To use the camera interface you'll need a custom card (on the +@@ -36,27 +55,29 @@ + + config BOARD_ATSTK1002_SW5_CUSTOM + bool "SW5: use MACB1 (not LCDC)" ++ depends on BOARD_ATSTK1002 + + config BOARD_ATSTK1002_SW6_CUSTOM + bool "SW6: more GPIOs (not MACB0)" ++ depends on BOARD_ATSTK1002 + + endif # custom + +-config BOARD_ATSTK1002_SPI1 ++config BOARD_ATSTK100X_SPI1 + bool "Configure SPI1 controller" +- depends on !BOARD_ATSTK1002_SW4_CUSTOM ++ depends on !BOARD_ATSTK100X_SW4_CUSTOM + help + All the signals for the second SPI controller are available on + GPIO lines and accessed through the J1 jumper block. Say "y" + here to configure that SPI controller. + +-config BOARD_ATSTK1002_J2_LED ++config BOARD_ATSTK1000_J2_LED + bool +- default BOARD_ATSTK1002_J2_LED8 || BOARD_ATSTK1002_J2_RGB ++ default BOARD_ATSTK1000_J2_LED8 || BOARD_ATSTK1000_J2_RGB + + choice + prompt "LEDs connected to J2:" +- depends on LEDS_GPIO && !BOARD_ATSTK1002_SW4_CUSTOM ++ depends on LEDS_GPIO && !BOARD_ATSTK100X_SW4_CUSTOM + optional + help + Select this if you have jumpered the J2 jumper block to the +@@ -64,16 +85,77 @@ + IDC cable. A default "heartbeat" trigger is provided, but + you can of course override this. + +-config BOARD_ATSTK1002_J2_LED8 ++config BOARD_ATSTK1000_J2_LED8 + bool "LED0..LED7" + help + Select this if J2 is jumpered to LED0..LED7 amber leds. + +-config BOARD_ATSTK1002_J2_RGB ++config BOARD_ATSTK1000_J2_RGB + bool "RGB leds" + help + Select this if J2 is jumpered to the RGB leds. + + endchoice + +-endif # stk 1002 ++config BOARD_ATSTK1000_EXTDAC ++ bool ++ depends on !BOARD_ATSTK100X_SW1_CUSTOM && !BOARD_ATSTK100X_SW3_CUSTOM ++ default y ++ ++config BOARD_ATSTK100X_ENABLE_AC97 ++ bool "Use AC97C instead of ABDAC" ++ help ++ Select this if you want to use the built-in AC97 controller ++ instead of the built-in Audio Bitstream DAC. These share ++ the same I/O pins on the AP7000, so both can't be enabled ++ at the same time. ++ ++ Note that the STK1000 kit doesn't ship with an AC97 codec on ++ board, so say N unless you've got an expansion board with an ++ AC97 codec on it that you want to use. ++ ++config BOARD_ATSTK1000_CF_HACKS ++ bool "ATSTK1000 CompactFlash hacks" ++ depends on !BOARD_ATSTK100X_SW4_CUSTOM ++ help ++ Select this if you have re-routed the CompactFlash RESET and ++ CD signals to GPIOs on your STK1000. This is necessary for ++ reset and card detection to work properly, although some CF ++ cards may be able to cope without reset. ++ ++config BOARD_ATSTK1000_CF_RESET_PIN ++ hex "CompactFlash RESET pin" ++ default 0x30 ++ depends on BOARD_ATSTK1000_CF_HACKS ++ help ++ Select which GPIO pin to use for the CompactFlash RESET ++ signal. This is specified as a hexadecimal number and should ++ be defined as 0x20 * gpio_port + pin. ++ ++ The default is 0x30, which is pin 16 on PIOB, aka GPIO14. ++ ++config BOARD_ATSTK1000_CF_DETECT_PIN ++ hex "CompactFlash DETECT pin" ++ default 0x3e ++ depends on BOARD_ATSTK1000_CF_HACKS ++ help ++ Select which GPIO pin to use for the CompactFlash CD ++ signal. This is specified as a hexadecimal number and should ++ be defined as 0x20 * gpio_port + pin. ++ ++ The default is 0x3e, which is pin 30 on PIOB, aka GPIO15. ++ ++config BOARD_ATSTK100X_ENABLE_PSIF ++ bool "Enable PSIF peripheral (PS/2 support)" ++ default n ++ help ++ Select this if you want to use the PSIF peripheral to hook up PS/2 ++ devices to your STK1000. This will require a hardware modification to ++ work correctly, since PS/2 devices require 5 volt power and signals, ++ while the STK1000 only provides 3.3 volt. ++ ++ Say N if you have not modified the hardware to boost the voltage, say ++ Y if you have level convertion hardware or a PS/2 device capable of ++ operating on 3.3 volt. ++ ++endif # stk 1000 +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/Makefile avr32-2.6/arch/avr32/boards/atstk1000/Makefile +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/Makefile 2008-04-23 19:33:28.000000000 +0200 +@@ -1,2 +1,4 @@ + obj-y += setup.o flash.o + obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o ++obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o ++obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o +diff -urN linux-2.6.24.3/arch/avr32/boards/atstk1000/setup.c avr32-2.6/arch/avr32/boards/atstk1000/setup.c +--- linux-2.6.24.3/arch/avr32/boards/atstk1000/setup.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atstk1000/setup.c 2008-04-23 19:33:28.000000000 +0200 @@ -10,13 +10,17 @@ #include <linux/bootmem.h> #include <linux/fb.h> @@ -1270,7 +992,7 @@ index c9af409..8bedf93 100644 #include "atstk1000.h" -@@ -61,3 +65,63 @@ struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = { +@@ -61,3 +65,63 @@ .default_monspecs = &atstk1000_default_monspecs, .guard_time = 2, }; @@ -1334,17 +1056,16 @@ index c9af409..8bedf93 100644 + +} +#endif /* CONFIG_BOARD_ATSTK1000_J2_LED */ -diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig -index b799a68..2ddc6f5 100644 ---- a/arch/avr32/configs/atngw100_defconfig -+++ b/arch/avr32/configs/atngw100_defconfig -@@ -1,46 +1,51 @@ +diff -urN linux-2.6.24.3/arch/avr32/configs/atngw100_defconfig avr32-2.6/arch/avr32/configs/atngw100_defconfig +--- linux-2.6.24.3/arch/avr32/configs/atngw100_defconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/configs/atngw100_defconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -1,46 +1,52 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.22-rc5 -# Sat Jun 23 15:40:05 2007 +# Linux kernel version: 2.6.24 -+# Tue Feb 5 16:37:27 2008 ++# Thu Mar 6 12:49:54 2008 # CONFIG_AVR32=y CONFIG_GENERIC_GPIO=y @@ -1356,6 +1077,7 @@ index b799a68..2ddc6f5 100644 CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_TIME=y ++CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set @@ -1399,7 +1121,7 @@ index b799a68..2ddc6f5 100644 CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set CONFIG_BLK_DEV_INITRD=y -@@ -61,35 +66,28 @@ CONFIG_FUTEX=y +@@ -61,35 +67,28 @@ CONFIG_ANON_INODES=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y @@ -1438,7 +1160,15 @@ index b799a68..2ddc6f5 100644 # # IO Schedulers -@@ -111,17 +109,20 @@ CONFIG_SUBARCH_AVR32B=y +@@ -107,21 +106,28 @@ + # + # System Type and features + # ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y + CONFIG_SUBARCH_AVR32B=y CONFIG_MMU=y CONFIG_PERFORMANCE_COUNTERS=y CONFIG_PLATFORM_AT32AP=y @@ -1462,7 +1192,7 @@ index b799a68..2ddc6f5 100644 CONFIG_LOAD_ADDRESS=0x10000000 CONFIG_ENTRY_ADDRESS=0x90000000 CONFIG_PHYS_OFFSET=0x10000000 -@@ -141,10 +142,14 @@ CONFIG_FLATMEM_MANUAL=y +@@ -141,10 +147,14 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set @@ -1477,7 +1207,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_300 is not set -@@ -153,13 +158,31 @@ CONFIG_HZ=250 +@@ -153,13 +163,31 @@ CONFIG_CMDLINE="" # @@ -1489,7 +1219,7 @@ index b799a68..2ddc6f5 100644 # -# PCCARD (PCMCIA/CardBus) support +# CPU Frequency scaling - # ++# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=y +# CONFIG_CPU_FREQ_DEBUG is not set @@ -1507,12 +1237,12 @@ index b799a68..2ddc6f5 100644 + +# +# Bus options -+# + # +# CONFIG_ARCH_SUPPORTS_MSI is not set # CONFIG_PCCARD is not set # -@@ -213,6 +236,7 @@ CONFIG_INET_TUNNEL=y +@@ -213,6 +241,7 @@ CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_MODE_BEET=y @@ -1520,7 +1250,7 @@ index b799a68..2ddc6f5 100644 CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set -@@ -240,6 +264,7 @@ CONFIG_IPV6_SIT=y +@@ -240,6 +269,7 @@ # CONFIG_NETWORK_SECMARK is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set @@ -1528,7 +1258,7 @@ index b799a68..2ddc6f5 100644 # # Core Netfilter Configuration -@@ -252,6 +277,7 @@ CONFIG_NF_CONNTRACK_MARK=y +@@ -252,6 +282,7 @@ # CONFIG_NF_CONNTRACK_EVENTS is not set CONFIG_NF_CT_PROTO_GRE=m # CONFIG_NF_CT_PROTO_SCTP is not set @@ -1536,7 +1266,7 @@ index b799a68..2ddc6f5 100644 CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m -@@ -269,9 +295,11 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m +@@ -269,9 +300,11 @@ CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m # CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set @@ -1548,7 +1278,7 @@ index b799a68..2ddc6f5 100644 CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m # CONFIG_NETFILTER_XT_MATCH_DCCP is not set -@@ -284,6 +312,7 @@ CONFIG_NETFILTER_XT_MATCH_MAC=m +@@ -284,6 +317,7 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m CONFIG_NETFILTER_XT_MATCH_POLICY=m CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m @@ -1556,7 +1286,7 @@ index b799a68..2ddc6f5 100644 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m CONFIG_NETFILTER_XT_MATCH_QUOTA=m CONFIG_NETFILTER_XT_MATCH_REALM=m -@@ -292,6 +321,8 @@ CONFIG_NETFILTER_XT_MATCH_STATE=m +@@ -292,6 +326,8 @@ CONFIG_NETFILTER_XT_MATCH_STATISTIC=m CONFIG_NETFILTER_XT_MATCH_STRING=m CONFIG_NETFILTER_XT_MATCH_TCPMSS=m @@ -1565,7 +1295,7 @@ index b799a68..2ddc6f5 100644 CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m # -@@ -359,13 +390,19 @@ CONFIG_IP6_NF_TARGET_REJECT=m +@@ -359,13 +395,19 @@ CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_HL=m CONFIG_IP6_NF_RAW=m @@ -1586,7 +1316,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set -@@ -373,10 +410,6 @@ CONFIG_VLAN_8021Q=m +@@ -373,10 +415,6 @@ # CONFIG_LAPB is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -1597,7 +1327,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y -@@ -384,6 +417,7 @@ CONFIG_NET_CLS_ROUTE=y +@@ -384,6 +422,7 @@ # Network testing # # CONFIG_NET_PKTGEN is not set @@ -1605,7 +1335,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -@@ -397,6 +431,7 @@ CONFIG_NET_CLS_ROUTE=y +@@ -397,6 +436,7 @@ # CONFIG_MAC80211 is not set # CONFIG_IEEE80211 is not set # CONFIG_RFKILL is not set @@ -1613,7 +1343,7 @@ index b799a68..2ddc6f5 100644 # # Device Drivers -@@ -405,16 +440,13 @@ CONFIG_NET_CLS_ROUTE=y +@@ -405,16 +445,13 @@ # # Generic Driver Options # @@ -1631,7 +1361,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_CONNECTOR is not set CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set -@@ -434,6 +466,7 @@ CONFIG_MTD_BLOCK=y +@@ -434,6 +471,7 @@ # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set @@ -1639,7 +1369,7 @@ index b799a68..2ddc6f5 100644 # # RAM/ROM/Flash chip drivers -@@ -493,20 +526,8 @@ CONFIG_MTD_DATAFLASH=y +@@ -493,20 +531,8 @@ # UBI - Unsorted block images # # CONFIG_MTD_UBI is not set @@ -1661,7 +1391,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set -@@ -517,11 +538,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 +@@ -517,11 +543,13 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -1670,11 +1400,17 @@ index b799a68..2ddc6f5 100644 -# Misc devices -# -# CONFIG_BLINK is not set -+# CONFIG_MISC_DEVICES is not set ++CONFIG_MISC_DEVICES=y ++# CONFIG_ATMEL_PWM is not set ++CONFIG_ATMEL_TCLIB=y ++CONFIG_ATMEL_TCB_CLKSRC=y ++CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 ++# CONFIG_EEPROM_93CX6 is not set ++# CONFIG_ATMEL_SSC is not set # CONFIG_IDE is not set # -@@ -529,30 +546,42 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +@@ -529,30 +557,42 @@ # # CONFIG_RAID_ATTRS is not set # CONFIG_SCSI is not set @@ -1698,16 +1434,13 @@ index b799a68..2ddc6f5 100644 # CONFIG_EQUALIZER is not set CONFIG_TUN=m -# CONFIG_PHYLIB is not set -- --# --# Ethernet (10 or 100Mbit) --# +# CONFIG_VETH is not set +CONFIG_PHYLIB=y -+ -+# + + # +-# Ethernet (10 or 100Mbit) +# MII PHY device drivers -+# + # +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set @@ -1731,7 +1464,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set -@@ -571,21 +600,14 @@ CONFIG_PPP_DEFLATE=m +@@ -571,21 +611,14 @@ CONFIG_PPP_BSDCOMP=m CONFIG_PPP_MPPE=m CONFIG_PPPOE=m @@ -1754,7 +1487,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_PHONE is not set # -@@ -615,28 +637,57 @@ CONFIG_SLHC=m +@@ -615,28 +648,57 @@ # CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL_CONSOLE=y @@ -1775,17 +1508,19 @@ index b799a68..2ddc6f5 100644 # CONFIG_GEN_RTC is not set # CONFIG_R3964 is not set # CONFIG_RAW_DRIVER is not set -+# CONFIG_TCG_TPM is not set +- +-# +-# TPM devices +-# + # CONFIG_TCG_TPM is not set +-# CONFIG_I2C is not set +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m - - # --# TPM devices ++ ++# +# I2C Algorithms - # --# CONFIG_TCG_TPM is not set --# CONFIG_I2C is not set ++# +CONFIG_I2C_ALGOBIT=m +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set @@ -1820,7 +1555,7 @@ index b799a68..2ddc6f5 100644 # # SPI support -@@ -655,13 +706,25 @@ CONFIG_SPI_ATMEL=y +@@ -655,13 +717,25 @@ # SPI Protocol Masters # # CONFIG_SPI_AT25 is not set @@ -1850,7 +1585,7 @@ index b799a68..2ddc6f5 100644 # # Multifunction device drivers -@@ -678,23 +741,21 @@ CONFIG_SPI_ATMEL=y +@@ -678,23 +752,21 @@ # # Graphics support # @@ -1878,16 +1613,12 @@ index b799a68..2ddc6f5 100644 # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set # CONFIG_USB_ARCH_HAS_EHCI is not set -@@ -706,12 +767,48 @@ CONFIG_SPI_ATMEL=y +@@ -706,12 +778,48 @@ # # USB Gadget Support # -# CONFIG_USB_GADGET is not set -# CONFIG_MMC is not set -- --# --# LED devices --# +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set @@ -1924,24 +1655,21 @@ index b799a68..2ddc6f5 100644 +CONFIG_MMC_BLOCK=y +# CONFIG_MMC_BLOCK_BOUNCE is not set +# CONFIG_SDIO_UART is not set -+ -+# + + # +-# LED devices +# MMC/SD Host Controller Drivers -+# + # +CONFIG_MMC_ATMELMCI=y +CONFIG_MMC_SPI=m CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y -@@ -726,53 +823,71 @@ CONFIG_LEDS_GPIO=y +@@ -726,53 +834,71 @@ CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y - -- --# --# LED drivers --# +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y @@ -1949,6 +1677,10 @@ index b799a68..2ddc6f5 100644 +# CONFIG_RTC_DEBUG is not set # +-# LED drivers +-# +- +-# -# LED Triggers -# - @@ -2026,7 +1758,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set -@@ -781,7 +896,8 @@ CONFIG_JBD=y +@@ -781,7 +907,8 @@ # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -2036,7 +1768,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_QUOTA is not set # CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set -@@ -814,7 +930,6 @@ CONFIG_SYSFS=y +@@ -814,7 +941,6 @@ CONFIG_TMPFS=y # CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLB_PAGE is not set @@ -2044,7 +1776,7 @@ index b799a68..2ddc6f5 100644 CONFIG_CONFIGFS_FS=y # -@@ -830,10 +945,12 @@ CONFIG_CONFIGFS_FS=y +@@ -830,10 +956,12 @@ CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y @@ -2057,7 +1789,7 @@ index b799a68..2ddc6f5 100644 CONFIG_JFFS2_RTIME=y # CONFIG_JFFS2_RUBIN is not set # CONFIG_CRAMFS is not set -@@ -842,19 +959,21 @@ CONFIG_JFFS2_RTIME=y +@@ -842,19 +970,21 @@ # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set @@ -2084,7 +1816,7 @@ index b799a68..2ddc6f5 100644 CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_SUNRPC_BIND34 is not set -@@ -871,23 +990,18 @@ CONFIG_CIFS=m +@@ -871,23 +1001,18 @@ # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -2111,7 +1843,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set -@@ -908,7 +1022,7 @@ CONFIG_NLS_CODEPAGE_850=y +@@ -908,7 +1033,7 @@ # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set @@ -2120,7 +1852,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set -@@ -921,18 +1035,19 @@ CONFIG_NLS_ISO8859_1=y +@@ -921,18 +1046,19 @@ # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set @@ -2146,7 +1878,7 @@ index b799a68..2ddc6f5 100644 CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set -@@ -941,12 +1056,17 @@ CONFIG_MAGIC_SYSRQ=y +@@ -941,12 +1067,17 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_SHIRQ is not set CONFIG_DETECT_SOFTLOCKUP=y @@ -2164,7 +1896,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set # CONFIG_DEBUG_KOBJECT is not set -@@ -954,21 +1074,21 @@ CONFIG_DEBUG_BUGVERBOSE=y +@@ -954,21 +1085,21 @@ # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set @@ -2191,7 +1923,7 @@ index b799a68..2ddc6f5 100644 CONFIG_CRYPTO=y CONFIG_CRYPTO_ALGAPI=y CONFIG_CRYPTO_BLKCIPHER=y -@@ -989,6 +1109,7 @@ CONFIG_CRYPTO_ECB=m +@@ -989,6 +1120,7 @@ CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_PCBC=m # CONFIG_CRYPTO_LRW is not set @@ -2199,7 +1931,7 @@ index b799a68..2ddc6f5 100644 # CONFIG_CRYPTO_CRYPTD is not set CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_FCRYPT is not set -@@ -1002,15 +1123,14 @@ CONFIG_CRYPTO_DES=y +@@ -1002,15 +1134,14 @@ CONFIG_CRYPTO_ARC4=m # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set @@ -2218,7 +1950,7 @@ index b799a68..2ddc6f5 100644 # # Library routines -@@ -1018,8 +1138,9 @@ CONFIG_CRYPTO_DEFLATE=y +@@ -1018,8 +1149,9 @@ CONFIG_BITREVERSE=y CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set @@ -2229,17 +1961,16 @@ index b799a68..2ddc6f5 100644 # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y -diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig -index 3b977fd..46e1c78 100644 ---- a/arch/avr32/configs/atstk1002_defconfig -+++ b/arch/avr32/configs/atstk1002_defconfig -@@ -1,48 +1,48 @@ +diff -urN linux-2.6.24.3/arch/avr32/configs/atstk1002_defconfig avr32-2.6/arch/avr32/configs/atstk1002_defconfig +--- linux-2.6.24.3/arch/avr32/configs/atstk1002_defconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/configs/atstk1002_defconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -1,48 +1,49 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.22-rc5 -# Sat Jun 23 15:32:08 2007 +# Linux kernel version: 2.6.24 -+# Tue Feb 5 18:00:06 2008 ++# Thu Mar 6 12:49:17 2008 # CONFIG_AVR32=y CONFIG_GENERIC_GPIO=y @@ -2251,6 +1982,7 @@ index 3b977fd..46e1c78 100644 CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_TIME=y ++CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set @@ -2297,7 +2029,7 @@ index 3b977fd..46e1c78 100644 CONFIG_SYSFS_DEPRECATED=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y -@@ -63,35 +63,28 @@ CONFIG_FUTEX=y +@@ -63,35 +64,28 @@ CONFIG_ANON_INODES=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y @@ -2336,7 +2068,7 @@ index 3b977fd..46e1c78 100644 # # IO Schedulers -@@ -99,12 +92,12 @@ CONFIG_BLOCK=y +@@ -99,32 +93,49 @@ CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set # CONFIG_IOSCHED_DEADLINE is not set @@ -2353,7 +2085,12 @@ index 3b977fd..46e1c78 100644 # # System Type and features -@@ -113,18 +106,30 @@ CONFIG_SUBARCH_AVR32B=y + # ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y + CONFIG_SUBARCH_AVR32B=y CONFIG_MMU=y CONFIG_PERFORMANCE_COUNTERS=y CONFIG_PLATFORM_AT32AP=y @@ -2373,6 +2110,7 @@ index 3b977fd..46e1c78 100644 +CONFIG_BOARD_ATSTK1000_EXTDAC=y +# CONFIG_BOARD_ATSTK100X_ENABLE_AC97 is not set +# CONFIG_BOARD_ATSTK1000_CF_HACKS is not set ++# CONFIG_BOARD_ATSTK100X_ENABLE_PSIF is not set CONFIG_LOADER_U_BOOT=y # @@ -2388,7 +2126,7 @@ index 3b977fd..46e1c78 100644 CONFIG_LOAD_ADDRESS=0x10000000 CONFIG_ENTRY_ADDRESS=0x90000000 CONFIG_PHYS_OFFSET=0x10000000 -@@ -144,10 +149,14 @@ CONFIG_FLATMEM_MANUAL=y +@@ -144,10 +155,14 @@ CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set @@ -2403,7 +2141,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_300 is not set -@@ -156,13 +165,31 @@ CONFIG_HZ=250 +@@ -156,13 +171,31 @@ CONFIG_CMDLINE="" # @@ -2431,14 +2169,14 @@ index 3b977fd..46e1c78 100644 +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_AT32AP=y + - # -+# Bus options +# ++# Bus options + # +# CONFIG_ARCH_SUPPORTS_MSI is not set # CONFIG_PCCARD is not set # -@@ -182,7 +209,12 @@ CONFIG_NET=y +@@ -182,7 +215,12 @@ CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y @@ -2452,7 +2190,7 @@ index 3b977fd..46e1c78 100644 CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set -@@ -191,36 +223,52 @@ CONFIG_IP_PNP=y +@@ -191,36 +229,52 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_IP_PNP_BOOTP is not set # CONFIG_IP_PNP_RARP is not set @@ -2517,7 +2255,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set -@@ -228,16 +276,13 @@ CONFIG_DEFAULT_TCP_CONG="cubic" +@@ -228,16 +282,13 @@ # CONFIG_LAPB is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -2535,7 +2273,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -@@ -251,6 +296,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" +@@ -251,6 +302,7 @@ # CONFIG_MAC80211 is not set # CONFIG_IEEE80211 is not set # CONFIG_RFKILL is not set @@ -2543,7 +2281,7 @@ index 3b977fd..46e1c78 100644 # # Device Drivers -@@ -259,16 +305,13 @@ CONFIG_DEFAULT_TCP_CONG="cubic" +@@ -259,16 +311,13 @@ # # Generic Driver Options # @@ -2561,7 +2299,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_CONNECTOR is not set CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set -@@ -288,6 +331,7 @@ CONFIG_MTD_BLOCK=y +@@ -288,6 +337,7 @@ # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set @@ -2569,7 +2307,7 @@ index 3b977fd..46e1c78 100644 # # RAM/ROM/Flash chip drivers -@@ -327,6 +371,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +@@ -327,6 +377,8 @@ # # Self-contained MTD device drivers # @@ -2578,7 +2316,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set -@@ -345,20 +391,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +@@ -345,20 +397,8 @@ # UBI - Unsorted block images # # CONFIG_MTD_UBI is not set @@ -2600,7 +2338,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set -@@ -369,42 +403,88 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 +@@ -369,42 +409,91 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -2611,6 +2349,9 @@ index 3b977fd..46e1c78 100644 -# CONFIG_BLINK is not set +CONFIG_MISC_DEVICES=y +CONFIG_ATMEL_PWM=m ++CONFIG_ATMEL_TCLIB=y ++CONFIG_ATMEL_TCB_CLKSRC=y ++CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 +# CONFIG_EEPROM_93CX6 is not set +CONFIG_ATMEL_SSC=m # CONFIG_IDE is not set @@ -2639,9 +2380,8 @@ index 3b977fd..46e1c78 100644 +# CONFIG_BLK_DEV_SR_VENDOR is not set +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_SCH is not set - - # --# Network device support ++ ++# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_MULTI_LUN is not set @@ -2649,10 +2389,11 @@ index 3b977fd..46e1c78 100644 +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m -+ + # +-# Network device support +# SCSI Transports -+# + # +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set @@ -2673,16 +2414,13 @@ index 3b977fd..46e1c78 100644 # CONFIG_EQUALIZER is not set CONFIG_TUN=m -# CONFIG_PHYLIB is not set -- --# --# Ethernet (10 or 100Mbit) --# +# CONFIG_VETH is not set +CONFIG_PHYLIB=y -+ -+# + + # +-# Ethernet (10 or 100Mbit) +# MII PHY device drivers -+# + # +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set @@ -2706,7 +2444,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set -@@ -423,27 +503,54 @@ CONFIG_PPP_DEFLATE=m +@@ -423,27 +512,54 @@ CONFIG_PPP_BSDCOMP=m # CONFIG_PPP_MPPE is not set # CONFIG_PPPOE is not set @@ -2717,23 +2455,28 @@ index 3b977fd..46e1c78 100644 # CONFIG_NETCONSOLE is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set -+# CONFIG_ISDN is not set -+# CONFIG_PHONE is not set +- +-# +-# ISDN subsystem +-# + # CONFIG_ISDN is not set +- +-# +-# Telephony Support +-# + # CONFIG_PHONE is not set # --# ISDN subsystem -+# Input device support + # Input device support # --# CONFIG_ISDN is not set +-# CONFIG_INPUT is not set +CONFIG_INPUT=m +# CONFIG_INPUT_FF_MEMLESS is not set +CONFIG_INPUT_POLLDEV=m - - # --# Telephony Support ++ ++# +# Userland interfaces - # --# CONFIG_PHONE is not set ++# +CONFIG_INPUT_MOUSEDEV=m +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 @@ -2741,12 +2484,10 @@ index 3b977fd..46e1c78 100644 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=m +# CONFIG_INPUT_EVBUG is not set - - # --# Input device support ++ ++# +# Input Device Drivers - # --# CONFIG_INPUT is not set ++# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set @@ -2767,7 +2508,7 @@ index 3b977fd..46e1c78 100644 # # Hardware I/O ports -@@ -467,40 +574,94 @@ CONFIG_SLHC=m +@@ -467,40 +583,94 @@ # CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL_CONSOLE=y @@ -2792,13 +2533,10 @@ index 3b977fd..46e1c78 100644 +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m - - # --# TPM devices ++ ++# +# I2C Algorithms - # --# CONFIG_TCG_TPM is not set --# CONFIG_I2C is not set ++# +CONFIG_I2C_ALGOBIT=m +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set @@ -2832,24 +2570,28 @@ index 3b977fd..46e1c78 100644 +# CONFIG_I2C_DEBUG_CHIP is not set # - # SPI support +-# TPM devices ++# SPI support # --# CONFIG_SPI is not set --# CONFIG_SPI_MASTER is not set +-# CONFIG_TCG_TPM is not set +-# CONFIG_I2C is not set +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y # --# Dallas's 1-wire bus +-# SPI support +# SPI Master Controller Drivers -+# + # +-# CONFIG_SPI is not set +-# CONFIG_SPI_MASTER is not set +CONFIG_SPI_ATMEL=y +# CONFIG_SPI_BITBANG is not set -+ + # +-# Dallas's 1-wire bus +# SPI Protocol Masters -+# + # +# CONFIG_SPI_AT25 is not set +CONFIG_SPI_SPIDEV=m +# CONFIG_SPI_TLE62X0 is not set @@ -2873,7 +2615,7 @@ index 3b977fd..46e1c78 100644 # # Multifunction device drivers -@@ -517,23 +678,104 @@ CONFIG_UNIX98_PTYS=y +@@ -517,23 +687,104 @@ # # Graphics support # @@ -2953,10 +2695,11 @@ index 3b977fd..46e1c78 100644 +# AVR32 devices +# +CONFIG_SND_ATMEL_AC97=m -+ -+# + + # +-# USB support +# SPI devices -+# + # +CONFIG_SND_AT73C213=m +CONFIG_SND_AT73C213_TARGET_BITRATE=48000 + @@ -2968,11 +2711,10 @@ index 3b977fd..46e1c78 100644 +# +# SoC Audio support for SuperH +# - - # --# USB support ++ ++# +# Open Sound System - # ++# +CONFIG_SOUND_PRIME=m +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set @@ -2983,7 +2725,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set # CONFIG_USB_ARCH_HAS_EHCI is not set -@@ -545,63 +787,137 @@ CONFIG_UNIX98_PTYS=y +@@ -545,63 +796,137 @@ # # USB Gadget Support # @@ -3139,7 +2881,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y -@@ -609,7 +925,7 @@ CONFIG_INOTIFY_USER=y +@@ -609,7 +934,7 @@ # CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -3148,7 +2890,7 @@ index 3b977fd..46e1c78 100644 # # CD-ROM/DVD Filesystems -@@ -637,8 +953,7 @@ CONFIG_SYSFS=y +@@ -637,8 +962,7 @@ CONFIG_TMPFS=y # CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLB_PAGE is not set @@ -3158,7 +2900,7 @@ index 3b977fd..46e1c78 100644 # # Miscellaneous filesystems -@@ -652,11 +967,12 @@ CONFIG_CONFIGFS_FS=m +@@ -652,11 +976,12 @@ # CONFIG_EFS_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 @@ -3172,7 +2914,7 @@ index 3b977fd..46e1c78 100644 CONFIG_JFFS2_RTIME=y # CONFIG_JFFS2_RUBIN is not set # CONFIG_CRAMFS is not set -@@ -665,10 +981,7 @@ CONFIG_JFFS2_RTIME=y +@@ -665,10 +990,7 @@ # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set @@ -3184,7 +2926,7 @@ index 3b977fd..46e1c78 100644 CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set -@@ -688,17 +1001,12 @@ CONFIG_SUNRPC=y +@@ -688,17 +1010,12 @@ # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -3202,7 +2944,7 @@ index 3b977fd..46e1c78 100644 CONFIG_NLS=m CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=m -@@ -739,17 +1047,18 @@ CONFIG_NLS_ISO8859_1=m +@@ -739,17 +1056,18 @@ # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=m @@ -3226,7 +2968,7 @@ index 3b977fd..46e1c78 100644 CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set -@@ -758,12 +1067,17 @@ CONFIG_DEBUG_FS=y +@@ -758,12 +1076,17 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_SHIRQ is not set CONFIG_DETECT_SOFTLOCKUP=y @@ -3244,7 +2986,7 @@ index 3b977fd..46e1c78 100644 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set # CONFIG_DEBUG_KOBJECT is not set -@@ -771,22 +1085,63 @@ CONFIG_DEBUG_BUGVERBOSE=y +@@ -771,22 +1094,63 @@ # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set @@ -3314,7 +3056,7 @@ index 3b977fd..46e1c78 100644 # # Library routines -@@ -794,10 +1149,10 @@ CONFIG_FORCED_INLINING=y +@@ -794,10 +1158,10 @@ CONFIG_BITREVERSE=y CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set @@ -3327,16 +3069,14 @@ index 3b977fd..46e1c78 100644 CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_PLIST=y -diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig -new file mode 100644 -index 0000000..d8a6595 ---- /dev/null -+++ b/arch/avr32/configs/atstk1003_defconfig -@@ -0,0 +1,1032 @@ +diff -urN linux-2.6.24.3/arch/avr32/configs/atstk1003_defconfig avr32-2.6/arch/avr32/configs/atstk1003_defconfig +--- linux-2.6.24.3/arch/avr32/configs/atstk1003_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/configs/atstk1003_defconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,1041 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24 -+# Tue Feb 5 18:08:36 2008 ++# Thu Mar 6 12:50:27 2008 +# +CONFIG_AVR32=y +CONFIG_GENERIC_GPIO=y @@ -3348,6 +3088,7 @@ index 0000000..d8a6595 +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_TIME=y ++CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set @@ -3442,6 +3183,10 @@ index 0000000..d8a6595 +# +# System Type and features +# ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_SUBARCH_AVR32B=y +CONFIG_MMU=y +CONFIG_PERFORMANCE_COUNTERS=y @@ -3461,6 +3206,7 @@ index 0000000..d8a6595 +CONFIG_BOARD_ATSTK1000_EXTDAC=y +# CONFIG_BOARD_ATSTK100X_ENABLE_AC97 is not set +# CONFIG_BOARD_ATSTK1000_CF_HACKS is not set ++# CONFIG_BOARD_ATSTK100X_ENABLE_PSIF is not set +CONFIG_LOADER_U_BOOT=y + +# @@ -3721,6 +3467,9 @@ index 0000000..d8a6595 +# CONFIG_ATA_OVER_ETH is not set +CONFIG_MISC_DEVICES=y +CONFIG_ATMEL_PWM=m ++CONFIG_ATMEL_TCLIB=y ++CONFIG_ATMEL_TCB_CLKSRC=y ++CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 +# CONFIG_EEPROM_93CX6 is not set +CONFIG_ATMEL_SSC=m +# CONFIG_IDE is not set @@ -4365,16 +4114,14 @@ index 0000000..d8a6595 +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y -diff --git a/arch/avr32/configs/atstk1004_defconfig b/arch/avr32/configs/atstk1004_defconfig -new file mode 100644 -index 0000000..559b065 ---- /dev/null -+++ b/arch/avr32/configs/atstk1004_defconfig -@@ -0,0 +1,627 @@ +diff -urN linux-2.6.24.3/arch/avr32/configs/atstk1004_defconfig avr32-2.6/arch/avr32/configs/atstk1004_defconfig +--- linux-2.6.24.3/arch/avr32/configs/atstk1004_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/configs/atstk1004_defconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,639 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24 -+# Tue Feb 5 18:13:33 2008 ++# Thu Mar 6 12:51:05 2008 +# +CONFIG_AVR32=y +CONFIG_GENERIC_GPIO=y @@ -4386,6 +4133,7 @@ index 0000000..559b065 +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_TIME=y ++CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set @@ -4445,6 +4193,10 @@ index 0000000..559b065 +# +# System Type and features +# ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_SUBARCH_AVR32B=y +CONFIG_MMU=y +CONFIG_PERFORMANCE_COUNTERS=y @@ -4462,6 +4214,7 @@ index 0000000..559b065 +CONFIG_BOARD_ATSTK1000_EXTDAC=y +# CONFIG_BOARD_ATSTK100X_ENABLE_AC97 is not set +# CONFIG_BOARD_ATSTK1000_CF_HACKS is not set ++# CONFIG_BOARD_ATSTK100X_ENABLE_PSIF is not set +CONFIG_LOADER_U_BOOT=y + +# @@ -4698,7 +4451,13 @@ index 0000000..559b065 +# +# CONFIG_MTD_UBI is not set +# CONFIG_PARPORT is not set -+# CONFIG_MISC_DEVICES is not set ++CONFIG_MISC_DEVICES=y ++# CONFIG_ATMEL_PWM is not set ++CONFIG_ATMEL_TCLIB=y ++CONFIG_ATMEL_TCB_CLKSRC=y ++CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 ++# CONFIG_EEPROM_93CX6 is not set ++# CONFIG_ATMEL_SSC is not set + +# +# SCSI device support @@ -4998,18 +4757,9 @@ index 0000000..559b065 +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y -diff --git a/arch/avr32/drivers/Makefile b/arch/avr32/drivers/Makefile -new file mode 100644 -index 0000000..b429b75 ---- /dev/null -+++ b/arch/avr32/drivers/Makefile -@@ -0,0 +1 @@ -+obj-$(CONFIG_DW_DMAC) += dw-dmac.o -diff --git a/arch/avr32/drivers/dw-dmac.c b/arch/avr32/drivers/dw-dmac.c -new file mode 100644 -index 0000000..224eb30 ---- /dev/null -+++ b/arch/avr32/drivers/dw-dmac.c +diff -urN linux-2.6.24.3/arch/avr32/drivers/dw-dmac.c avr32-2.6/arch/avr32/drivers/dw-dmac.c +--- linux-2.6.24.3/arch/avr32/drivers/dw-dmac.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/drivers/dw-dmac.c 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,761 @@ +/* + * Driver for the Synopsys DesignWare DMA Controller @@ -5772,11 +5522,9 @@ index 0000000..224eb30 +MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller driver"); +MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>"); +MODULE_LICENSE("GPL"); -diff --git a/arch/avr32/drivers/dw-dmac.h b/arch/avr32/drivers/dw-dmac.h -new file mode 100644 -index 0000000..1f67921 ---- /dev/null -+++ b/arch/avr32/drivers/dw-dmac.h +diff -urN linux-2.6.24.3/arch/avr32/drivers/dw-dmac.h avr32-2.6/arch/avr32/drivers/dw-dmac.h +--- linux-2.6.24.3/arch/avr32/drivers/dw-dmac.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/drivers/dw-dmac.h 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,42 @@ +/* + * Driver for the Synopsys DesignWare DMA Controller @@ -5820,27 +5568,167 @@ index 0000000..1f67921 +#define DW_DMAC_CHAN_DSR 0x050 + +#endif /* __AVR32_DW_DMAC_H__ */ -diff --git a/arch/avr32/kernel/Makefile b/arch/avr32/kernel/Makefile -index 2d6d48f..88226b6 100644 ---- a/arch/avr32/kernel/Makefile -+++ b/arch/avr32/kernel/Makefile -@@ -6,9 +6,11 @@ extra-y := head.o vmlinux.lds +diff -urN linux-2.6.24.3/arch/avr32/drivers/Makefile avr32-2.6/arch/avr32/drivers/Makefile +--- linux-2.6.24.3/arch/avr32/drivers/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/drivers/Makefile 2008-04-23 19:33:28.000000000 +0200 +@@ -0,0 +1 @@ ++obj-$(CONFIG_DW_DMAC) += dw-dmac.o +diff -urN linux-2.6.24.3/arch/avr32/Kconfig avr32-2.6/arch/avr32/Kconfig +--- linux-2.6.24.3/arch/avr32/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/Kconfig 2008-04-23 20:12:35.000000000 +0200 +@@ -45,6 +45,9 @@ + config GENERIC_TIME + def_bool y - obj-$(CONFIG_SUBARCH_AVR32B) += entry-avr32b.o - obj-y += syscall_table.o syscall-stubs.o irq.o --obj-y += setup.o traps.o semaphore.o ptrace.o -+obj-y += setup.o traps.o semaphore.o ocd.o ptrace.o - obj-y += signal.o sys_avr32.o process.o time.o - obj-y += init_task.o switch_to.o cpu.o -+obj-y += dma-controller.o - obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o - obj-$(CONFIG_KPROBES) += kprobes.o - obj-$(CONFIG_STACKTRACE) += stacktrace.o -+obj-$(CONFIG_NMI_DEBUGGING) += nmi_debug.o -diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c -index 2714cf6..b8409ca 100644 ---- a/arch/avr32/kernel/cpu.c -+++ b/arch/avr32/kernel/cpu.c ++config GENERIC_CLOCKEVENTS ++ def_bool y ++ + config RWSEM_XCHGADD_ALGORITHM + def_bool n + +@@ -54,6 +57,9 @@ + config ARCH_HAS_ILOG2_U64 + def_bool n + ++config ARCH_SUPPORTS_OPROFILE ++ def_bool y ++ + config GENERIC_HWEIGHT + def_bool y + +@@ -68,6 +74,8 @@ + + menu "System Type and features" + ++source "kernel/time/Kconfig" ++ + config SUBARCH_AVR32B + bool + config MMU +@@ -81,19 +89,23 @@ + select MMU + select PERFORMANCE_COUNTERS + +-choice +- prompt "AVR32 CPU type" +- default CPU_AT32AP7000 ++# ++# CPU types ++# + +-config CPU_AT32AP7000 +- bool "AT32AP7000" ++# AP7000 derivatives ++config CPU_AT32AP700X ++ bool + select PLATFORM_AT32AP +-endchoice +- +-# +-# CPU Daughterboards for ATSTK1000 +-config BOARD_ATSTK1002 ++config CPU_AT32AP7000 ++ bool ++ select CPU_AT32AP700X ++config CPU_AT32AP7001 ++ bool ++ select CPU_AT32AP700X ++config CPU_AT32AP7002 + bool ++ select CPU_AT32AP700X + + choice + prompt "AVR32 board type" +@@ -101,15 +113,18 @@ + + config BOARD_ATSTK1000 + bool "ATSTK1000 evaluation board" +- select BOARD_ATSTK1002 if CPU_AT32AP7000 + + config BOARD_ATNGW100 + bool "ATNGW100 Network Gateway" ++ select CPU_AT32AP7000 + endchoice + + if BOARD_ATSTK1000 + source "arch/avr32/boards/atstk1000/Kconfig" + endif ++if BOARD_ATNGW100 ++source "arch/avr32/boards/atngw100/Kconfig" ++endif + + choice + prompt "Boot loader type" +@@ -123,15 +138,15 @@ + + config LOAD_ADDRESS + hex +- default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y ++ default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y + + config ENTRY_ADDRESS + hex +- default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y ++ default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y + + config PHYS_OFFSET + hex +- default 0x10000000 if CPU_AT32AP7000=y ++ default 0x10000000 if CPU_AT32AP700X=y + + source "kernel/Kconfig.preempt" + +@@ -163,6 +178,20 @@ + enabling Nexus-compliant debuggers to keep track of the PID of the + currently executing task. + ++config NMI_DEBUGGING ++ bool "NMI Debugging" ++ default n ++ help ++ Say Y here and pass the nmi_debug command-line parameter to ++ the kernel to turn on NMI debugging. Depending on the value ++ of the nmi_debug option, various pieces of information will ++ be dumped to the console when a Non-Maskable Interrupt ++ happens. ++ ++config DW_DMAC ++ tristate "Synopsys DesignWare DMA Controller support" ++ default y if CPU_AT32AP7000 ++ + # FPU emulation goes here + + source "kernel/Kconfig.hz" +@@ -219,6 +248,8 @@ + + source "fs/Kconfig" + ++source "kernel/Kconfig.instrumentation" ++ + source "arch/avr32/Kconfig.debug" + + source "security/Kconfig" +diff -urN linux-2.6.24.3/arch/avr32/Kconfig.debug avr32-2.6/arch/avr32/Kconfig.debug +--- linux-2.6.24.3/arch/avr32/Kconfig.debug 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/Kconfig.debug 2008-04-23 19:33:28.000000000 +0200 +@@ -6,14 +6,4 @@ + + source "lib/Kconfig.debug" + +-config KPROBES +- bool "Kprobes" +- depends on DEBUG_KERNEL +- help +- Kprobes allows you to trap at almost any kernel address and +- execute a callback function. register_kprobe() establishes +- a probepoint and specifies the callback. Kprobes is useful +- for kernel debugging, non-intrusive instrumentation and testing. +- If in doubt, say "N". +- + endmenu +diff -urN linux-2.6.24.3/arch/avr32/kernel/cpu.c avr32-2.6/arch/avr32/kernel/cpu.c +--- linux-2.6.24.3/arch/avr32/kernel/cpu.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/cpu.c 2008-04-23 19:33:28.000000000 +0200 @@ -13,6 +13,7 @@ #include <linux/percpu.h> #include <linux/param.h> @@ -5849,7 +5737,7 @@ index 2714cf6..b8409ca 100644 #include <asm/setup.h> #include <asm/sysreg.h> -@@ -187,9 +188,20 @@ static int __init topology_init(void) +@@ -187,9 +188,20 @@ subsys_initcall(topology_init); @@ -5871,7 +5759,7 @@ index 2714cf6..b8409ca 100644 }; #define NR_CPU_NAMES ARRAY_SIZE(cpu_names) -@@ -206,12 +218,32 @@ static const char *mmu_types[] = { +@@ -206,12 +218,32 @@ "MPU" }; @@ -5904,7 +5792,7 @@ index 2714cf6..b8409ca 100644 config0 = sysreg_read(CONFIG0); config1 = sysreg_read(CONFIG1); -@@ -221,11 +253,14 @@ void __init setup_processor(void) +@@ -221,11 +253,14 @@ arch_rev = SYSREG_BFEXT(AR, config0); mmu_type = SYSREG_BFEXT(MMUT, config0); @@ -5919,7 +5807,7 @@ index 2714cf6..b8409ca 100644 tmp = SYSREG_BFEXT(ILSZ, config1); if (tmp) { -@@ -247,41 +282,34 @@ void __init setup_processor(void) +@@ -247,41 +282,34 @@ return; } @@ -5976,7 +5864,7 @@ index 2714cf6..b8409ca 100644 printk("\n"); boot_cpu_data.features = features; } -@@ -291,6 +319,8 @@ static int c_show(struct seq_file *m, void *v) +@@ -291,6 +319,8 @@ { unsigned int icache_size, dcache_size; unsigned int cpu = smp_processor_id(); @@ -5985,7 +5873,7 @@ index 2714cf6..b8409ca 100644 icache_size = boot_cpu_data.icache.ways * boot_cpu_data.icache.sets * -@@ -301,15 +331,21 @@ static int c_show(struct seq_file *m, void *v) +@@ -301,15 +331,21 @@ seq_printf(m, "processor\t: %d\n", cpu); @@ -6009,7 +5897,7 @@ index 2714cf6..b8409ca 100644 seq_printf(m, "i-cache\t\t: %dK (%u ways x %u sets x %u)\n", icache_size >> 10, boot_cpu_data.icache.ways, -@@ -320,7 +356,13 @@ static int c_show(struct seq_file *m, void *v) +@@ -320,7 +356,13 @@ boot_cpu_data.dcache.ways, boot_cpu_data.dcache.sets, boot_cpu_data.dcache.linesz); @@ -6024,7 +5912,7 @@ index 2714cf6..b8409ca 100644 boot_cpu_data.loops_per_jiffy / (500000/HZ), (boot_cpu_data.loops_per_jiffy / (5000/HZ)) % 100); -@@ -343,7 +385,7 @@ static void c_stop(struct seq_file *m, void *v) +@@ -343,7 +385,7 @@ } @@ -6033,11 +5921,9 @@ index 2714cf6..b8409ca 100644 .start = c_start, .next = c_next, .stop = c_stop, -diff --git a/arch/avr32/kernel/dma-controller.c b/arch/avr32/kernel/dma-controller.c -new file mode 100644 -index 0000000..fb654b3 ---- /dev/null -+++ b/arch/avr32/kernel/dma-controller.c +diff -urN linux-2.6.24.3/arch/avr32/kernel/dma-controller.c avr32-2.6/arch/avr32/kernel/dma-controller.c +--- linux-2.6.24.3/arch/avr32/kernel/dma-controller.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/dma-controller.c 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,34 @@ +/* + * Preliminary DMA controller framework for AVR32 @@ -6073,11 +5959,40 @@ index 0000000..fb654b3 + return NULL; +} +EXPORT_SYMBOL(find_dma_controller); -diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c -index 61f2de2..a8e767d 100644 ---- a/arch/avr32/kernel/irq.c -+++ b/arch/avr32/kernel/irq.c -@@ -25,6 +25,17 @@ void ack_bad_irq(unsigned int irq) +diff -urN linux-2.6.24.3/arch/avr32/kernel/entry-avr32b.S avr32-2.6/arch/avr32/kernel/entry-avr32b.S +--- linux-2.6.24.3/arch/avr32/kernel/entry-avr32b.S 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/entry-avr32b.S 2008-04-23 20:12:35.000000000 +0200 +@@ -741,26 +741,6 @@ + + .section .irq.text,"ax",@progbits + +-.global cpu_idle_sleep +-cpu_idle_sleep: +- mask_interrupts +- get_thread_info r8 +- ld.w r9, r8[TI_flags] +- bld r9, TIF_NEED_RESCHED +- brcs cpu_idle_enable_int_and_exit +- sbr r9, TIF_CPU_GOING_TO_SLEEP +- st.w r8[TI_flags], r9 +- unmask_interrupts +- sleep 0 +-cpu_idle_skip_sleep: +- mask_interrupts +- ld.w r9, r8[TI_flags] +- cbr r9, TIF_CPU_GOING_TO_SLEEP +- st.w r8[TI_flags], r9 +-cpu_idle_enable_int_and_exit: +- unmask_interrupts +- retal r12 +- + .global irq_level0 + .global irq_level1 + .global irq_level2 +diff -urN linux-2.6.24.3/arch/avr32/kernel/irq.c avr32-2.6/arch/avr32/kernel/irq.c +--- linux-2.6.24.3/arch/avr32/kernel/irq.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/irq.c 2008-04-23 19:33:28.000000000 +0200 +@@ -25,6 +25,17 @@ printk("unexpected IRQ %u\n", irq); } @@ -6095,11 +6010,10 @@ index 61f2de2..a8e767d 100644 #ifdef CONFIG_PROC_FS int show_interrupts(struct seq_file *p, void *v) { -diff --git a/arch/avr32/kernel/kprobes.c b/arch/avr32/kernel/kprobes.c -index 799ba89..f820e9f 100644 ---- a/arch/avr32/kernel/kprobes.c -+++ b/arch/avr32/kernel/kprobes.c -@@ -48,6 +48,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) +diff -urN linux-2.6.24.3/arch/avr32/kernel/kprobes.c avr32-2.6/arch/avr32/kernel/kprobes.c +--- linux-2.6.24.3/arch/avr32/kernel/kprobes.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/kprobes.c 2008-04-23 19:33:28.000000000 +0200 +@@ -48,6 +48,7 @@ void __kprobes arch_arm_kprobe(struct kprobe *p) { pr_debug("arming kprobe at %p\n", p->addr); @@ -6107,7 +6021,7 @@ index 799ba89..f820e9f 100644 *p->addr = BREAKPOINT_INSTRUCTION; flush_icache_range((unsigned long)p->addr, (unsigned long)p->addr + sizeof(kprobe_opcode_t)); -@@ -56,6 +57,7 @@ void __kprobes arch_arm_kprobe(struct kprobe *p) +@@ -56,6 +57,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) { pr_debug("disarming kprobe at %p\n", p->addr); @@ -6115,7 +6029,7 @@ index 799ba89..f820e9f 100644 *p->addr = p->opcode; flush_icache_range((unsigned long)p->addr, (unsigned long)p->addr + sizeof(kprobe_opcode_t)); -@@ -260,9 +262,6 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) +@@ -260,9 +262,6 @@ int __init arch_init_kprobes(void) { @@ -6125,11 +6039,25 @@ index 799ba89..f820e9f 100644 /* TODO: Register kretprobe trampoline */ return 0; } -diff --git a/arch/avr32/kernel/nmi_debug.c b/arch/avr32/kernel/nmi_debug.c -new file mode 100644 -index 0000000..3414b85 ---- /dev/null -+++ b/arch/avr32/kernel/nmi_debug.c +diff -urN linux-2.6.24.3/arch/avr32/kernel/Makefile avr32-2.6/arch/avr32/kernel/Makefile +--- linux-2.6.24.3/arch/avr32/kernel/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/Makefile 2008-04-23 19:33:28.000000000 +0200 +@@ -6,9 +6,11 @@ + + obj-$(CONFIG_SUBARCH_AVR32B) += entry-avr32b.o + obj-y += syscall_table.o syscall-stubs.o irq.o +-obj-y += setup.o traps.o semaphore.o ptrace.o ++obj-y += setup.o traps.o semaphore.o ocd.o ptrace.o + obj-y += signal.o sys_avr32.o process.o time.o + obj-y += init_task.o switch_to.o cpu.o ++obj-y += dma-controller.o + obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o + obj-$(CONFIG_KPROBES) += kprobes.o + obj-$(CONFIG_STACKTRACE) += stacktrace.o ++obj-$(CONFIG_NMI_DEBUGGING) += nmi_debug.o +diff -urN linux-2.6.24.3/arch/avr32/kernel/nmi_debug.c avr32-2.6/arch/avr32/kernel/nmi_debug.c +--- linux-2.6.24.3/arch/avr32/kernel/nmi_debug.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/nmi_debug.c 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007 Atmel Corporation @@ -6213,11 +6141,9 @@ index 0000000..3414b85 + return 0; +} +__setup("nmi_debug", nmi_debug_setup); -diff --git a/arch/avr32/kernel/ocd.c b/arch/avr32/kernel/ocd.c -new file mode 100644 -index 0000000..c4f0232 ---- /dev/null -+++ b/arch/avr32/kernel/ocd.c +diff -urN linux-2.6.24.3/arch/avr32/kernel/ocd.c avr32-2.6/arch/avr32/kernel/ocd.c +--- linux-2.6.24.3/arch/avr32/kernel/ocd.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/ocd.c 2008-04-23 19:33:28.000000000 +0200 @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2007 Atmel Corporation @@ -6382,11 +6308,42 @@ index 0000000..c4f0232 + return 0; +} +arch_initcall(ocd_init); -diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c -index 9d6dac8..eaaa69b 100644 ---- a/arch/avr32/kernel/process.c -+++ b/arch/avr32/kernel/process.c -@@ -103,7 +103,7 @@ EXPORT_SYMBOL(kernel_thread); +diff -urN linux-2.6.24.3/arch/avr32/kernel/process.c avr32-2.6/arch/avr32/kernel/process.c +--- linux-2.6.24.3/arch/avr32/kernel/process.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/process.c 2008-04-23 20:12:35.000000000 +0200 +@@ -11,17 +11,18 @@ + #include <linux/fs.h> + #include <linux/ptrace.h> + #include <linux/reboot.h> ++#include <linux/tick.h> + #include <linux/uaccess.h> + #include <linux/unistd.h> + + #include <asm/sysreg.h> + #include <asm/ocd.h> + ++#include <asm/arch/pm.h> ++ + void (*pm_power_off)(void) = NULL; + EXPORT_SYMBOL(pm_power_off); + +-extern void cpu_idle_sleep(void); +- + /* + * This file handles the architecture-dependent parts of process handling.. + */ +@@ -30,8 +31,10 @@ + { + /* endless idle loop with no priority at all */ + while (1) { ++ tick_nohz_stop_sched_tick(); + while (!need_resched()) + cpu_idle_sleep(); ++ tick_nohz_restart_sched_tick(); + preempt_enable_no_resched(); + schedule(); + preempt_disable(); +@@ -103,7 +106,7 @@ */ void exit_thread(void) { @@ -6395,21 +6352,21 @@ index 9d6dac8..eaaa69b 100644 } void flush_thread(void) -@@ -345,6 +345,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, +@@ -345,6 +348,10 @@ p->thread.cpu_context.ksp = (unsigned long)childregs; p->thread.cpu_context.pc = (unsigned long)ret_from_fork; ++ clear_tsk_thread_flag(p, TIF_DEBUG); + if ((clone_flags & CLONE_PTRACE) && test_thread_flag(TIF_DEBUG)) + ocd_enable(p); + return 0; } -diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c -index 002369e..1fed38f 100644 ---- a/arch/avr32/kernel/ptrace.c -+++ b/arch/avr32/kernel/ptrace.c -@@ -58,6 +58,7 @@ void ptrace_disable(struct task_struct *child) +diff -urN linux-2.6.24.3/arch/avr32/kernel/ptrace.c avr32-2.6/arch/avr32/kernel/ptrace.c +--- linux-2.6.24.3/arch/avr32/kernel/ptrace.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/ptrace.c 2008-04-23 19:33:28.000000000 +0200 +@@ -58,6 +58,7 @@ { clear_tsk_thread_flag(child, TIF_SINGLE_STEP); clear_tsk_thread_flag(child, TIF_BREAKPOINT); @@ -6417,7 +6374,7 @@ index 002369e..1fed38f 100644 } /* -@@ -144,10 +145,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) +@@ -144,10 +145,6 @@ { int ret; @@ -6428,11 +6385,10 @@ index 002369e..1fed38f 100644 switch (request) { /* Read the word at location addr in the child process */ case PTRACE_PEEKTEXT: -diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c -index 4b4c188..488078d 100644 ---- a/arch/avr32/kernel/setup.c -+++ b/arch/avr32/kernel/setup.c -@@ -273,6 +273,8 @@ static int __init early_parse_fbmem(char *p) +diff -urN linux-2.6.24.3/arch/avr32/kernel/setup.c avr32-2.6/arch/avr32/kernel/setup.c +--- linux-2.6.24.3/arch/avr32/kernel/setup.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/setup.c 2008-04-23 20:12:35.000000000 +0200 +@@ -273,6 +273,8 @@ printk(KERN_WARNING "Failed to allocate framebuffer memory\n"); fbmem_size = 0; @@ -6441,11 +6397,10 @@ index 4b4c188..488078d 100644 } } -diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c -index 0ec1485..5616a00 100644 ---- a/arch/avr32/kernel/signal.c -+++ b/arch/avr32/kernel/signal.c -@@ -270,19 +270,12 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int syscall) +diff -urN linux-2.6.24.3/arch/avr32/kernel/signal.c avr32-2.6/arch/avr32/kernel/signal.c +--- linux-2.6.24.3/arch/avr32/kernel/signal.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/signal.c 2008-04-23 19:33:28.000000000 +0200 +@@ -270,19 +270,12 @@ if (!user_mode(regs)) return 0; @@ -6465,10 +6420,322 @@ index 0ec1485..5616a00 100644 if (syscall) { switch (regs->r12) { case -ERESTART_RESTARTBLOCK: -diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c -index 870c075..cf6f686 100644 ---- a/arch/avr32/kernel/traps.c -+++ b/arch/avr32/kernel/traps.c +diff -urN linux-2.6.24.3/arch/avr32/kernel/time.c avr32-2.6/arch/avr32/kernel/time.c +--- linux-2.6.24.3/arch/avr32/kernel/time.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/time.c 2008-04-23 20:12:35.000000000 +0200 +@@ -1,16 +1,12 @@ + /* + * Copyright (C) 2004-2007 Atmel Corporation + * +- * Based on MIPS implementation arch/mips/kernel/time.c +- * Copyright 2001 MontaVista Software Inc. +- * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +- + #include <linux/clk.h> +-#include <linux/clocksource.h> ++#include <linux/clockchips.h> + #include <linux/time.h> + #include <linux/module.h> + #include <linux/interrupt.h> +@@ -27,207 +23,133 @@ + #include <asm/io.h> + #include <asm/sections.h> + +-/* how many counter cycles in a jiffy? */ +-static u32 cycles_per_jiffy; ++#include <asm/arch/pm.h> + +-/* the count value for the next timer interrupt */ +-static u32 expirelo; + +-cycle_t __weak read_cycle_count(void) ++static cycle_t read_cycle_count(void) + { + return (cycle_t)sysreg_read(COUNT); + } + +-struct clocksource __weak clocksource_avr32 = { +- .name = "avr32", +- .rating = 350, ++/* ++ * The architectural cycle count registers are a fine clocksource unless ++ * the system idle loop use sleep states like "idle": the CPU cycles ++ * measured by COUNT (and COMPARE) don't happen during sleep states. ++ * Their duration also changes if cpufreq changes the CPU clock rate. ++ * So we rate the clocksource using COUNT as very low quality. ++ */ ++static struct clocksource counter = { ++ .name = "avr32_counter", ++ .rating = 50, + .read = read_cycle_count, + .mask = CLOCKSOURCE_MASK(32), + .shift = 16, + .flags = CLOCK_SOURCE_IS_CONTINUOUS, + }; + +-irqreturn_t __weak timer_interrupt(int irq, void *dev_id); +- +-struct irqaction timer_irqaction = { +- .handler = timer_interrupt, +- .flags = IRQF_DISABLED, +- .name = "timer", +-}; +- +-/* +- * By default we provide the null RTC ops +- */ +-static unsigned long null_rtc_get_time(void) ++static irqreturn_t timer_interrupt(int irq, void *dev_id) + { +- return mktime(2007, 1, 1, 0, 0, 0); +-} +- +-static int null_rtc_set_time(unsigned long sec) +-{ +- return 0; +-} ++ struct clock_event_device *evdev = dev_id; + +-static unsigned long (*rtc_get_time)(void) = null_rtc_get_time; +-static int (*rtc_set_time)(unsigned long) = null_rtc_set_time; +- +-static void avr32_timer_ack(void) +-{ +- u32 count; +- +- /* Ack this timer interrupt and set the next one */ +- expirelo += cycles_per_jiffy; +- /* setting COMPARE to 0 stops the COUNT-COMPARE */ +- if (expirelo == 0) { +- sysreg_write(COMPARE, expirelo + 1); +- } else { +- sysreg_write(COMPARE, expirelo); +- } ++ /* ++ * Disable the interrupt until the clockevent subsystem ++ * reprograms it. ++ */ ++ sysreg_write(COMPARE, 0); + +- /* Check to see if we have missed any timer interrupts */ +- count = sysreg_read(COUNT); +- if ((count - expirelo) < 0x7fffffff) { +- expirelo = count + cycles_per_jiffy; +- sysreg_write(COMPARE, expirelo); +- } ++ evdev->event_handler(evdev); ++ return IRQ_HANDLED; + } + +-int __weak avr32_hpt_init(void) +-{ +- int ret; +- unsigned long mult, shift, count_hz; +- +- count_hz = clk_get_rate(boot_cpu_data.clk); +- shift = clocksource_avr32.shift; +- mult = clocksource_hz2mult(count_hz, shift); +- clocksource_avr32.mult = mult; +- +- { +- u64 tmp; +- +- tmp = TICK_NSEC; +- tmp <<= shift; +- tmp += mult / 2; +- do_div(tmp, mult); +- +- cycles_per_jiffy = tmp; +- } ++static struct irqaction timer_irqaction = { ++ .handler = timer_interrupt, ++ .flags = IRQF_TIMER | IRQF_DISABLED, ++ .name = "avr32_comparator", ++}; + +- ret = setup_irq(0, &timer_irqaction); +- if (ret) { +- pr_debug("timer: could not request IRQ 0: %d\n", ret); +- return -ENODEV; +- } ++static int comparator_next_event(unsigned long delta, ++ struct clock_event_device *evdev) ++{ ++ unsigned long flags; + +- printk(KERN_INFO "timer: AT32AP COUNT-COMPARE at irq 0, " +- "%lu.%03lu MHz\n", +- ((count_hz + 500) / 1000) / 1000, +- ((count_hz + 500) / 1000) % 1000); ++ raw_local_irq_save(flags); + +- return 0; +-} ++ /* The time to read COUNT then update COMPARE must be less ++ * than the min_delta_ns value for this clockevent source. ++ */ ++ sysreg_write(COMPARE, (sysreg_read(COUNT) + delta) ? : 1); + +-/* +- * Taken from MIPS c0_hpt_timer_init(). +- * +- * The reason COUNT is written twice is probably to make sure we don't get any +- * timer interrupts while we are messing with the counter. +- */ +-int __weak avr32_hpt_start(void) +-{ +- u32 count = sysreg_read(COUNT); +- expirelo = (count / cycles_per_jiffy + 1) * cycles_per_jiffy; +- sysreg_write(COUNT, expirelo - cycles_per_jiffy); +- sysreg_write(COMPARE, expirelo); +- sysreg_write(COUNT, count); ++ raw_local_irq_restore(flags); + + return 0; + } + +-/* +- * local_timer_interrupt() does profiling and process accounting on a +- * per-CPU basis. +- * +- * In UP mode, it is invoked from the (global) timer_interrupt. +- */ +-void local_timer_interrupt(int irq, void *dev_id) ++static void comparator_mode(enum clock_event_mode mode, ++ struct clock_event_device *evdev) + { +- if (current->pid) +- profile_tick(CPU_PROFILING); +- update_process_times(user_mode(get_irq_regs())); ++ switch (mode) { ++ case CLOCK_EVT_MODE_ONESHOT: ++ pr_debug("%s: start\n", evdev->name); ++ /* FALLTHROUGH */ ++ case CLOCK_EVT_MODE_RESUME: ++ cpu_disable_idle_sleep(); ++ break; ++ case CLOCK_EVT_MODE_UNUSED: ++ case CLOCK_EVT_MODE_SHUTDOWN: ++ sysreg_write(COMPARE, 0); ++ pr_debug("%s: stop\n", evdev->name); ++ cpu_enable_idle_sleep(); ++ break; ++ default: ++ BUG(); ++ } + } + +-irqreturn_t __weak timer_interrupt(int irq, void *dev_id) +-{ +- /* ack timer interrupt and try to set next interrupt */ +- avr32_timer_ack(); +- +- /* +- * Call the generic timer interrupt handler +- */ +- write_seqlock(&xtime_lock); +- do_timer(1); +- write_sequnlock(&xtime_lock); +- +- /* +- * In UP mode, we call local_timer_interrupt() to do profiling +- * and process accounting. +- * +- * SMP is not supported yet. +- */ +- local_timer_interrupt(irq, dev_id); +- +- return IRQ_HANDLED; +-} ++static struct clock_event_device comparator = { ++ .name = "avr32_comparator", ++ .features = CLOCK_EVT_FEAT_ONESHOT, ++ .shift = 16, ++ .rating = 50, ++ .cpumask = CPU_MASK_CPU0, ++ .set_next_event = comparator_next_event, ++ .set_mode = comparator_mode, ++}; + + void __init time_init(void) + { ++ unsigned long counter_hz; + int ret; + +- /* +- * Make sure we don't get any COMPARE interrupts before we can +- * handle them. +- */ +- sysreg_write(COMPARE, 0); +- +- xtime.tv_sec = rtc_get_time(); ++ xtime.tv_sec = mktime(2007, 1, 1, 0, 0, 0); + xtime.tv_nsec = 0; + + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); + +- ret = avr32_hpt_init(); +- if (ret) { +- pr_debug("timer: failed setup: %d\n", ret); +- return; +- } ++ /* figure rate for counter */ ++ counter_hz = clk_get_rate(boot_cpu_data.clk); ++ counter.mult = clocksource_hz2mult(counter_hz, counter.shift); + +- ret = clocksource_register(&clocksource_avr32); ++ ret = clocksource_register(&counter); + if (ret) + pr_debug("timer: could not register clocksource: %d\n", ret); + +- ret = avr32_hpt_start(); +- if (ret) { +- pr_debug("timer: failed starting: %d\n", ret); +- return; +- } +-} ++ /* setup COMPARE clockevent */ ++ comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift); ++ comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator); ++ comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1; + +-static struct sysdev_class timer_class = { +- set_kset_name("timer"), +-}; ++ sysreg_write(COMPARE, 0); ++ timer_irqaction.dev_id = &comparator; + +-static struct sys_device timer_device = { +- .id = 0, +- .cls = &timer_class, +-}; ++ ret = setup_irq(0, &timer_irqaction); ++ if (ret) ++ pr_debug("timer: could not request IRQ 0: %d\n", ret); ++ else { ++ clockevents_register_device(&comparator); + +-static int __init init_timer_sysfs(void) +-{ +- int err = sysdev_class_register(&timer_class); +- if (!err) +- err = sysdev_register(&timer_device); +- return err; ++ pr_info("%s: irq 0, %lu.%03lu MHz\n", comparator.name, ++ ((counter_hz + 500) / 1000) / 1000, ++ ((counter_hz + 500) / 1000) % 1000); ++ } + } +- +-device_initcall(init_timer_sysfs); +diff -urN linux-2.6.24.3/arch/avr32/kernel/traps.c avr32-2.6/arch/avr32/kernel/traps.c +--- linux-2.6.24.3/arch/avr32/kernel/traps.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/kernel/traps.c 2008-04-23 19:33:28.000000000 +0200 @@ -9,6 +9,7 @@ #include <linux/bug.h> #include <linux/init.h> @@ -6477,7 +6744,7 @@ index 870c075..cf6f686 100644 #include <linux/module.h> #include <linux/notifier.h> #include <linux/sched.h> -@@ -107,9 +108,23 @@ void _exception(long signr, struct pt_regs *regs, int code, +@@ -107,9 +108,23 @@ asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) { @@ -6504,68 +6771,9 @@ index 870c075..cf6f686 100644 } asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) -diff --git a/arch/avr32/mach-at32ap/Kconfig b/arch/avr32/mach-at32ap/Kconfig -index eb30783..0eb590a 100644 ---- a/arch/avr32/mach-at32ap/Kconfig -+++ b/arch/avr32/mach-at32ap/Kconfig -@@ -3,9 +3,9 @@ if PLATFORM_AT32AP - menu "Atmel AVR32 AP options" - - choice -- prompt "AT32AP7000 static memory bus width" -- depends on CPU_AT32AP7000 -- default AP7000_16_BIT_SMC -+ prompt "AT32AP700x static memory bus width" -+ depends on CPU_AT32AP700X -+ default AP700X_16_BIT_SMC - help - Define the width of the AP7000 external static memory interface. - This is used to determine how to mangle the address and/or data -@@ -15,17 +15,24 @@ choice - width for all chip selects, excluding the flash (which is using - raw access and is thus not affected by any of this.) - --config AP7000_32_BIT_SMC -+config AP700X_32_BIT_SMC - bool "32 bit" - --config AP7000_16_BIT_SMC -+config AP700X_16_BIT_SMC - bool "16 bit" - --config AP7000_8_BIT_SMC -+config AP700X_8_BIT_SMC - bool "8 bit" - - endchoice - -+config GPIO_DEV -+ bool "GPIO /dev interface" -+ select CONFIGFS_FS -+ default n -+ help -+ Say `Y' to enable a /dev interface to the GPIO pins. -+ - endmenu - - endif # PLATFORM_AT32AP -diff --git a/arch/avr32/mach-at32ap/Makefile b/arch/avr32/mach-at32ap/Makefile -index a8b4450..0f6162e 100644 ---- a/arch/avr32/mach-at32ap/Makefile -+++ b/arch/avr32/mach-at32ap/Makefile -@@ -1,4 +1,5 @@ - obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o --obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o --obj-$(CONFIG_CPU_AT32AP7000) += time-tc.o -+obj-$(CONFIG_CPU_AT32AP700X) += at32ap700x.o -+obj-$(CONFIG_CPU_AT32AP700X) += time-tc.o - obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o -+obj-$(CONFIG_GPIO_DEV) += gpio-dev.o -diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c -deleted file mode 100644 -index 7c4388f..0000000 ---- a/arch/avr32/mach-at32ap/at32ap7000.c -+++ /dev/null +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/at32ap7000.c avr32-2.6/arch/avr32/mach-at32ap/at32ap7000.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/at32ap7000.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/at32ap7000.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1730 +0,0 @@ -/* - * Copyright (C) 2005-2006 Atmel Corporation @@ -8297,12 +8505,10 @@ index 7c4388f..0000000 - pm_writel(PBA_MASK, pba_mask); - pm_writel(PBB_MASK, pbb_mask); -} -diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c -new file mode 100644 -index 0000000..06795d0 ---- /dev/null -+++ b/arch/avr32/mach-at32ap/at32ap700x.c -@@ -0,0 +1,1809 @@ +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/at32ap700x.c avr32-2.6/arch/avr32/mach-at32ap/at32ap700x.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/at32ap700x.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/at32ap700x.c 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,1944 @@ +/* + * Copyright (C) 2005-2006 Atmel Corporation + * @@ -8316,6 +8522,7 @@ index 0000000..06795d0 +#include <linux/platform_device.h> +#include <linux/dma-mapping.h> +#include <linux/spi/spi.h> ++#include <linux/usb/atmel_usba_udc.h> + +#include <asm/io.h> +#include <asm/irq.h> @@ -8910,19 +9117,32 @@ index 0000000..06795d0 +} + +/* -------------------------------------------------------------------- -+ * System Timer/Counter (TC) ++ * Timer/Counter (TC) + * -------------------------------------------------------------------- */ -+static struct resource at32_systc0_resource[] = { ++ ++static struct resource at32_tcb0_resource[] = { + PBMEM(0xfff00c00), + IRQ(22), +}; -+struct platform_device at32_systc0_device = { -+ .name = "systc", ++static struct platform_device at32_tcb0_device = { ++ .name = "atmel_tcb", + .id = 0, -+ .resource = at32_systc0_resource, -+ .num_resources = ARRAY_SIZE(at32_systc0_resource), ++ .resource = at32_tcb0_resource, ++ .num_resources = ARRAY_SIZE(at32_tcb0_resource), ++}; ++DEV_CLK(t0_clk, at32_tcb0, pbb, 3); ++ ++static struct resource at32_tcb1_resource[] = { ++ PBMEM(0xfff01000), ++ IRQ(23), ++}; ++static struct platform_device at32_tcb1_device = { ++ .name = "atmel_tcb", ++ .id = 1, ++ .resource = at32_tcb1_resource, ++ .num_resources = ARRAY_SIZE(at32_tcb1_resource), +}; -+DEV_CLK(pclk, at32_systc0, pbb, 3); ++DEV_CLK(t0_clk, at32_tcb1, pbb, 4); + +/* -------------------------------------------------------------------- + * PIO @@ -8974,7 +9194,8 @@ index 0000000..06795d0 + platform_device_register(&pdc_device); + platform_device_register(&dmaca0_device); + -+ platform_device_register(&at32_systc0_device); ++ platform_device_register(&at32_tcb0_device); ++ platform_device_register(&at32_tcb1_device); + + platform_device_register(&pio0_device); + platform_device_register(&pio1_device); @@ -8984,6 +9205,81 @@ index 0000000..06795d0 +} + +/* -------------------------------------------------------------------- ++ * PSIF ++ * -------------------------------------------------------------------- */ ++static struct resource atmel_psif0_resource[] __initdata = { ++ { ++ .start = 0xffe03c00, ++ .end = 0xffe03cff, ++ .flags = IORESOURCE_MEM, ++ }, ++ IRQ(18), ++}; ++static struct clk atmel_psif0_pclk = { ++ .name = "pclk", ++ .parent = &pba_clk, ++ .mode = pba_clk_mode, ++ .get_rate = pba_clk_get_rate, ++ .index = 15, ++}; ++ ++static struct resource atmel_psif1_resource[] __initdata = { ++ { ++ .start = 0xffe03d00, ++ .end = 0xffe03dff, ++ .flags = IORESOURCE_MEM, ++ }, ++ IRQ(18), ++}; ++static struct clk atmel_psif1_pclk = { ++ .name = "pclk", ++ .parent = &pba_clk, ++ .mode = pba_clk_mode, ++ .get_rate = pba_clk_get_rate, ++ .index = 15, ++}; ++ ++struct platform_device *__init at32_add_device_psif(unsigned int id) ++{ ++ struct platform_device *pdev; ++ ++ if (!(id == 0 || id == 1)) ++ return NULL; ++ ++ pdev = platform_device_alloc("atmel_psif", id); ++ if (!pdev) ++ return NULL; ++ ++ switch (id) { ++ case 0: ++ if (platform_device_add_resources(pdev, atmel_psif0_resource, ++ ARRAY_SIZE(atmel_psif0_resource))) ++ goto err_add_resources; ++ atmel_psif0_pclk.dev = &pdev->dev; ++ select_peripheral(PA(8), PERIPH_A, 0); /* CLOCK */ ++ select_peripheral(PA(9), PERIPH_A, 0); /* DATA */ ++ break; ++ case 1: ++ if (platform_device_add_resources(pdev, atmel_psif1_resource, ++ ARRAY_SIZE(atmel_psif1_resource))) ++ goto err_add_resources; ++ atmel_psif1_pclk.dev = &pdev->dev; ++ select_peripheral(PB(11), PERIPH_A, 0); /* CLOCK */ ++ select_peripheral(PB(12), PERIPH_A, 0); /* DATA */ ++ break; ++ default: ++ return NULL; ++ } ++ ++ platform_device_add(pdev); ++ return pdev; ++ ++err_add_resources: ++ platform_device_put(pdev); ++ return NULL; ++} ++ ++/* -------------------------------------------------------------------- + * USART + * -------------------------------------------------------------------- */ + @@ -9294,7 +9590,9 @@ index 0000000..06795d0 + .index = 2, +}; + -+struct platform_device *__init at32_add_device_twi(unsigned int id) ++struct platform_device *__init at32_add_device_twi(unsigned int id, ++ struct i2c_board_info *b, ++ unsigned int n) +{ + struct platform_device *pdev; + @@ -9314,6 +9612,9 @@ index 0000000..06795d0 + + atmel_twi0_pclk.dev = &pdev->dev; + ++ if (b) ++ i2c_register_board_info(id, b, n); ++ + platform_device_add(pdev); + return pdev; + @@ -9668,9 +9969,39 @@ index 0000000..06795d0 + .index = 6, +}; + ++#define EP(nam, idx, maxpkt, maxbk, dma, isoc) \ ++ [idx] = { \ ++ .name = nam, \ ++ .index = idx, \ ++ .fifo_size = maxpkt, \ ++ .nr_banks = maxbk, \ ++ .can_dma = dma, \ ++ .can_isoc = isoc, \ ++ } ++ ++static struct usba_ep_data at32_usba_ep[] __initdata = { ++ EP("ep0", 0, 64, 1, 0, 0), ++ EP("ep1", 1, 512, 2, 1, 1), ++ EP("ep2", 2, 512, 2, 1, 1), ++ EP("ep3-int", 3, 64, 3, 1, 0), ++ EP("ep4-int", 4, 64, 3, 1, 0), ++ EP("ep5", 5, 1024, 3, 1, 1), ++ EP("ep6", 6, 1024, 3, 1, 1), ++}; ++ ++#undef EP ++ +struct platform_device *__init +at32_add_device_usba(unsigned int id, struct usba_platform_data *data) +{ ++ /* ++ * pdata doesn't have room for any endpoints, so we need to ++ * append room for the ones we need right after it. ++ */ ++ struct { ++ struct usba_platform_data pdata; ++ struct usba_ep_data ep[7]; ++ } usba_data; + struct platform_device *pdev; + + if (id != 0) @@ -9684,13 +10015,20 @@ index 0000000..06795d0 + ARRAY_SIZE(usba0_resource))) + goto out_free_pdev; + -+ if (data) { -+ if (platform_device_add_data(pdev, data, sizeof(*data))) -+ goto out_free_pdev; ++ if (data) ++ usba_data.pdata.vbus_pin = data->vbus_pin; ++ else ++ usba_data.pdata.vbus_pin = -EINVAL; + -+ if (data->vbus_pin != GPIO_PIN_NONE) -+ at32_select_gpio(data->vbus_pin, 0); -+ } ++ data = &usba_data.pdata; ++ data->num_ep = ARRAY_SIZE(at32_usba_ep); ++ memcpy(data->ep, at32_usba_ep, sizeof(at32_usba_ep)); ++ ++ if (platform_device_add_data(pdev, data, sizeof(usba_data))) ++ goto out_free_pdev; ++ ++ if (data->vbus_pin >= 0) ++ at32_select_gpio(data->vbus_pin, 0); + + usba0_pclk.dev = &pdev->dev; + usba0_hclk.dev = &pdev->dev; @@ -10011,7 +10349,10 @@ index 0000000..06795d0 + &pio2_mck, + &pio3_mck, + &pio4_mck, -+ &at32_systc0_pclk, ++ &at32_tcb0_t0_clk, ++ &at32_tcb1_t0_clk, ++ &atmel_psif0_pclk, ++ &atmel_psif1_pclk, + &atmel_usart0_usart, + &atmel_usart1_usart, + &atmel_usart2_usart, @@ -10112,10 +10453,9 @@ index 0000000..06795d0 + pm_writel(PBA_MASK, pba_mask); + pm_writel(PBB_MASK, pbb_mask); +} -diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c -index f5bfd4c..c36a6d5 100644 ---- a/arch/avr32/mach-at32ap/extint.c -+++ b/arch/avr32/mach-at32ap/extint.c +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/extint.c avr32-2.6/arch/avr32/mach-at32ap/extint.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/extint.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/extint.c 2008-04-23 19:33:29.000000000 +0200 @@ -26,16 +26,10 @@ #define EIC_MODE 0x0014 #define EIC_EDGE 0x0018 @@ -10134,7 +10474,7 @@ index f5bfd4c..c36a6d5 100644 /* Bit manipulation macros */ #define EIC_BIT(name) \ -@@ -63,6 +57,9 @@ struct eic { +@@ -63,6 +57,9 @@ unsigned int first_irq; }; @@ -10144,7 +10484,7 @@ index f5bfd4c..c36a6d5 100644 static void eic_ack_irq(unsigned int irq) { struct eic *eic = get_irq_chip_data(irq); -@@ -133,8 +130,11 @@ static int eic_set_irq_type(unsigned int irq, unsigned int flow_type) +@@ -133,8 +130,11 @@ eic_writel(eic, EDGE, edge); eic_writel(eic, LEVEL, level); @@ -10157,7 +10497,7 @@ index f5bfd4c..c36a6d5 100644 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); desc->status |= flow_type; } -@@ -154,9 +154,8 @@ static struct irq_chip eic_chip = { +@@ -154,9 +154,8 @@ static void demux_eic_irq(unsigned int irq, struct irq_desc *desc) { struct eic *eic = desc->handler_data; @@ -10168,7 +10508,7 @@ index f5bfd4c..c36a6d5 100644 status = eic_readl(eic, ISR); pending = status & eic_readl(eic, IMR); -@@ -165,15 +164,28 @@ static void demux_eic_irq(unsigned int irq, struct irq_desc *desc) +@@ -165,15 +164,28 @@ i = fls(pending) - 1; pending &= ~(1 << i); @@ -10203,7 +10543,7 @@ index f5bfd4c..c36a6d5 100644 static int __init eic_probe(struct platform_device *pdev) { struct eic *eic; -@@ -214,14 +226,13 @@ static int __init eic_probe(struct platform_device *pdev) +@@ -214,14 +226,13 @@ pattern = eic_readl(eic, MODE); nr_irqs = fls(pattern); @@ -10220,7 +10560,7 @@ index f5bfd4c..c36a6d5 100644 set_irq_chip_and_handler(eic->first_irq + i, &eic_chip, handle_level_irq); set_irq_chip_data(eic->first_irq + i, eic); -@@ -230,6 +241,16 @@ static int __init eic_probe(struct platform_device *pdev) +@@ -230,6 +241,16 @@ set_irq_chained_handler(int_irq, demux_eic_irq); set_irq_data(int_irq, eic); @@ -10237,11 +10577,9 @@ index f5bfd4c..c36a6d5 100644 dev_info(&pdev->dev, "External Interrupt Controller at 0x%p, IRQ %u\n", eic->regs, int_irq); -diff --git a/arch/avr32/mach-at32ap/gpio-dev.c b/arch/avr32/mach-at32ap/gpio-dev.c -new file mode 100644 -index 0000000..8cf6d11 ---- /dev/null -+++ b/arch/avr32/mach-at32ap/gpio-dev.c +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/gpio-dev.c avr32-2.6/arch/avr32/mach-at32ap/gpio-dev.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/gpio-dev.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/gpio-dev.c 2008-04-23 19:33:29.000000000 +0200 @@ -0,0 +1,573 @@ +/* + * GPIO /dev and configfs interface @@ -10816,11 +11154,75 @@ index 0000000..8cf6d11 + return err; +} +late_initcall(gpio_dev_init); -diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c -index d61a02d..c978c36 100644 ---- a/arch/avr32/mach-at32ap/pio.c -+++ b/arch/avr32/mach-at32ap/pio.c -@@ -162,6 +162,82 @@ fail: +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/intc.c avr32-2.6/arch/avr32/mach-at32ap/intc.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/intc.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/intc.c 2008-04-23 20:12:35.000000000 +0200 +@@ -13,7 +13,6 @@ + #include <linux/irq.h> + #include <linux/platform_device.h> + +-#include <asm/intc.h> + #include <asm/io.h> + + #include "intc.h" +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/Kconfig avr32-2.6/arch/avr32/mach-at32ap/Kconfig +--- linux-2.6.24.3/arch/avr32/mach-at32ap/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/Kconfig 2008-04-23 19:33:29.000000000 +0200 +@@ -3,9 +3,9 @@ + menu "Atmel AVR32 AP options" + + choice +- prompt "AT32AP7000 static memory bus width" +- depends on CPU_AT32AP7000 +- default AP7000_16_BIT_SMC ++ prompt "AT32AP700x static memory bus width" ++ depends on CPU_AT32AP700X ++ default AP700X_16_BIT_SMC + help + Define the width of the AP7000 external static memory interface. + This is used to determine how to mangle the address and/or data +@@ -15,17 +15,24 @@ + width for all chip selects, excluding the flash (which is using + raw access and is thus not affected by any of this.) + +-config AP7000_32_BIT_SMC ++config AP700X_32_BIT_SMC + bool "32 bit" + +-config AP7000_16_BIT_SMC ++config AP700X_16_BIT_SMC + bool "16 bit" + +-config AP7000_8_BIT_SMC ++config AP700X_8_BIT_SMC + bool "8 bit" + + endchoice + ++config GPIO_DEV ++ bool "GPIO /dev interface" ++ select CONFIGFS_FS ++ default n ++ help ++ Say `Y' to enable a /dev interface to the GPIO pins. ++ + endmenu + + endif # PLATFORM_AT32AP +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/Makefile avr32-2.6/arch/avr32/mach-at32ap/Makefile +--- linux-2.6.24.3/arch/avr32/mach-at32ap/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/Makefile 2008-04-23 20:12:35.000000000 +0200 +@@ -1,4 +1,4 @@ + obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o +-obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o +-obj-$(CONFIG_CPU_AT32AP7000) += time-tc.o ++obj-$(CONFIG_CPU_AT32AP700X) += at32ap700x.o pm-at32ap700x.o + obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o ++obj-$(CONFIG_GPIO_DEV) += gpio-dev.o +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/pio.c avr32-2.6/arch/avr32/mach-at32ap/pio.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/pio.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/pio.c 2008-04-23 20:12:35.000000000 +0200 +@@ -162,6 +162,82 @@ dump_stack(); } @@ -10903,11 +11305,323 @@ index d61a02d..c978c36 100644 /*--------------------------------------------------------------------------*/ /* GPIO API */ -diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c -index 177fea8..6d8c794 100644 ---- a/arch/avr32/mm/dma-coherent.c -+++ b/arch/avr32/mm/dma-coherent.c -@@ -41,6 +41,13 @@ static struct page *__dma_alloc(struct device *dev, size_t size, +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/pm-at32ap700x.S avr32-2.6/arch/avr32/mach-at32ap/pm-at32ap700x.S +--- linux-2.6.24.3/arch/avr32/mach-at32ap/pm-at32ap700x.S 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/pm-at32ap700x.S 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,66 @@ ++/* ++ * Low-level Power Management code. ++ * ++ * Copyright (C) 2008 Atmel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++#include <asm/asm.h> ++#include <asm/asm-offsets.h> ++#include <asm/thread_info.h> ++#include <asm/arch/pm.h> ++ ++ .section .bss, "wa", @nobits ++ .global disable_idle_sleep ++ .type disable_idle_sleep, @object ++disable_idle_sleep: ++ .int 4 ++ .size disable_idle_sleep, . - disable_idle_sleep ++ ++ /* Keep this close to the irq handlers */ ++ .section .irq.text, "ax", @progbits ++ ++ /* ++ * void cpu_enter_idle(void) ++ * ++ * Put the CPU into "idle" mode, in which it will consume ++ * significantly less power. ++ * ++ * If an interrupt comes along in the window between ++ * unmask_interrupts and the sleep instruction below, the ++ * interrupt code will adjust the return address so that we ++ * never execute the sleep instruction. This is required ++ * because the AP7000 doesn't unmask interrupts when entering ++ * sleep modes; later CPUs may not need this workaround. ++ */ ++ .global cpu_enter_idle ++ .type cpu_enter_idle, @function ++cpu_enter_idle: ++ mask_interrupts ++ get_thread_info r8 ++ ld.w r9, r8[TI_flags] ++ bld r9, TIF_NEED_RESCHED ++ brcs .Lret_from_sleep ++ sbr r9, TIF_CPU_GOING_TO_SLEEP ++ st.w r8[TI_flags], r9 ++ unmask_interrupts ++ sleep CPU_SLEEP_IDLE ++ .size cpu_idle_sleep, . - cpu_idle_sleep ++ ++ /* ++ * Common return path for PM functions that don't run from ++ * SRAM. ++ */ ++ .global cpu_idle_skip_sleep ++ .type cpu_idle_skip_sleep, @function ++cpu_idle_skip_sleep: ++ mask_interrupts ++ ld.w r9, r8[TI_flags] ++ cbr r9, TIF_CPU_GOING_TO_SLEEP ++ st.w r8[TI_flags], r9 ++.Lret_from_sleep: ++ unmask_interrupts ++ retal r12 ++ .size cpu_idle_skip_sleep, . - cpu_idle_skip_sleep +diff -urN linux-2.6.24.3/arch/avr32/mach-at32ap/time-tc.c avr32-2.6/arch/avr32/mach-at32ap/time-tc.c +--- linux-2.6.24.3/arch/avr32/mach-at32ap/time-tc.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mach-at32ap/time-tc.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,218 +0,0 @@ +-/* +- * Copyright (C) 2004-2007 Atmel Corporation +- * +- * Based on MIPS implementation arch/mips/kernel/time.c +- * Copyright 2001 MontaVista Software Inc. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- */ +- +-#include <linux/clk.h> +-#include <linux/clocksource.h> +-#include <linux/time.h> +-#include <linux/module.h> +-#include <linux/interrupt.h> +-#include <linux/irq.h> +-#include <linux/kernel_stat.h> +-#include <linux/errno.h> +-#include <linux/init.h> +-#include <linux/profile.h> +-#include <linux/sysdev.h> +-#include <linux/err.h> +- +-#include <asm/div64.h> +-#include <asm/sysreg.h> +-#include <asm/io.h> +-#include <asm/sections.h> +- +-#include <asm/arch/time.h> +- +-/* how many counter cycles in a jiffy? */ +-static u32 cycles_per_jiffy; +- +-/* the count value for the next timer interrupt */ +-static u32 expirelo; +- +-/* the I/O registers of the TC module */ +-static void __iomem *ioregs; +- +-cycle_t read_cycle_count(void) +-{ +- return (cycle_t)timer_read(ioregs, 0, CV); +-} +- +-struct clocksource clocksource_avr32 = { +- .name = "avr32", +- .rating = 342, +- .read = read_cycle_count, +- .mask = CLOCKSOURCE_MASK(16), +- .shift = 16, +- .flags = CLOCK_SOURCE_IS_CONTINUOUS, +-}; +- +-static void avr32_timer_ack(void) +-{ +- u16 count = expirelo; +- +- /* Ack this timer interrupt and set the next one, use a u16 +- * variable so it will wrap around correctly */ +- count += cycles_per_jiffy; +- expirelo = count; +- timer_write(ioregs, 0, RC, expirelo); +- +- /* Check to see if we have missed any timer interrupts */ +- count = timer_read(ioregs, 0, CV); +- if ((count - expirelo) < 0x7fff) { +- expirelo = count + cycles_per_jiffy; +- timer_write(ioregs, 0, RC, expirelo); +- } +-} +- +-u32 avr32_hpt_read(void) +-{ +- return timer_read(ioregs, 0, CV); +-} +- +-static int avr32_timer_calc_div_and_set_jiffies(struct clk *pclk) +-{ +- unsigned int cycles_max = (clocksource_avr32.mask + 1) / 2; +- unsigned int divs[] = { 4, 8, 16, 32 }; +- int divs_size = ARRAY_SIZE(divs); +- int i = 0; +- unsigned long count_hz; +- unsigned long shift; +- unsigned long mult; +- int clock_div = -1; +- u64 tmp; +- +- shift = clocksource_avr32.shift; +- +- do { +- count_hz = clk_get_rate(pclk) / divs[i]; +- mult = clocksource_hz2mult(count_hz, shift); +- clocksource_avr32.mult = mult; +- +- tmp = TICK_NSEC; +- tmp <<= shift; +- tmp += mult / 2; +- do_div(tmp, mult); +- +- cycles_per_jiffy = tmp; +- } while (cycles_per_jiffy > cycles_max && ++i < divs_size); +- +- clock_div = i + 1; +- +- if (clock_div > divs_size) { +- pr_debug("timer: could not calculate clock divider\n"); +- return -EFAULT; +- } +- +- /* Set the clock divider */ +- timer_write(ioregs, 0, CMR, TIMER_BF(CMR_TCCLKS, clock_div)); +- +- return 0; +-} +- +-int avr32_hpt_init(unsigned int count) +-{ +- struct resource *regs; +- struct clk *pclk; +- int irq = -1; +- int ret = 0; +- +- ret = -ENXIO; +- +- irq = platform_get_irq(&at32_systc0_device, 0); +- if (irq < 0) { +- pr_debug("timer: could not get irq\n"); +- goto out_error; +- } +- +- pclk = clk_get(&at32_systc0_device.dev, "pclk"); +- if (IS_ERR(pclk)) { +- pr_debug("timer: could not get clk: %ld\n", PTR_ERR(pclk)); +- goto out_error; +- } +- clk_enable(pclk); +- +- regs = platform_get_resource(&at32_systc0_device, IORESOURCE_MEM, 0); +- if (!regs) { +- pr_debug("timer: could not get resource\n"); +- goto out_error_clk; +- } +- +- ioregs = ioremap(regs->start, regs->end - regs->start + 1); +- if (!ioregs) { +- pr_debug("timer: could not get ioregs\n"); +- goto out_error_clk; +- } +- +- ret = avr32_timer_calc_div_and_set_jiffies(pclk); +- if (ret) +- goto out_error_io; +- +- ret = setup_irq(irq, &timer_irqaction); +- if (ret) { +- pr_debug("timer: could not request irq %d: %d\n", +- irq, ret); +- goto out_error_io; +- } +- +- expirelo = (timer_read(ioregs, 0, CV) / cycles_per_jiffy + 1) +- * cycles_per_jiffy; +- +- /* Enable clock and interrupts on RC compare */ +- timer_write(ioregs, 0, CCR, TIMER_BIT(CCR_CLKEN)); +- timer_write(ioregs, 0, IER, TIMER_BIT(IER_CPCS)); +- /* Set cycles to first interrupt */ +- timer_write(ioregs, 0, RC, expirelo); +- +- printk(KERN_INFO "timer: AT32AP system timer/counter at 0x%p irq %d\n", +- ioregs, irq); +- +- return 0; +- +-out_error_io: +- iounmap(ioregs); +-out_error_clk: +- clk_put(pclk); +-out_error: +- return ret; +-} +- +-int avr32_hpt_start(void) +-{ +- timer_write(ioregs, 0, CCR, TIMER_BIT(CCR_SWTRG)); +- return 0; +-} +- +-irqreturn_t timer_interrupt(int irq, void *dev_id) +-{ +- unsigned int sr = timer_read(ioregs, 0, SR); +- +- if (sr & TIMER_BIT(SR_CPCS)) { +- /* ack timer interrupt and try to set next interrupt */ +- avr32_timer_ack(); +- +- /* +- * Call the generic timer interrupt handler +- */ +- write_seqlock(&xtime_lock); +- do_timer(1); +- write_sequnlock(&xtime_lock); +- +- /* +- * In UP mode, we call local_timer_interrupt() to do profiling +- * and process accounting. +- * +- * SMP is not supported yet. +- */ +- local_timer_interrupt(irq, dev_id); +- +- return IRQ_HANDLED; +- } +- +- return IRQ_NONE; +-} +diff -urN linux-2.6.24.3/arch/avr32/Makefile avr32-2.6/arch/avr32/Makefile +--- linux-2.6.24.3/arch/avr32/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/Makefile 2008-04-23 19:33:28.000000000 +0200 +@@ -16,7 +16,7 @@ + CFLAGS_MODULE += -mno-relax + LDFLAGS_vmlinux += --relax + +-cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000 ++cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap + + KBUILD_CFLAGS += $(cpuflags-y) + KBUILD_AFLAGS += $(cpuflags-y) +@@ -31,6 +31,8 @@ + core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ + core-y += arch/avr32/kernel/ + core-y += arch/avr32/mm/ ++drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ ++drivers-y += arch/avr32/drivers/ + libs-y += arch/avr32/lib/ + + archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap +diff -urN linux-2.6.24.3/arch/avr32/mm/dma-coherent.c avr32-2.6/arch/avr32/mm/dma-coherent.c +--- linux-2.6.24.3/arch/avr32/mm/dma-coherent.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mm/dma-coherent.c 2008-04-23 19:33:29.000000000 +0200 +@@ -41,6 +41,13 @@ struct page *page, *free, *end; int order; @@ -10921,11 +11635,22 @@ index 177fea8..6d8c794 100644 size = PAGE_ALIGN(size); order = get_order(size); -diff --git a/arch/avr32/mm/tlb.c b/arch/avr32/mm/tlb.c -index 5667201..b835257 100644 ---- a/arch/avr32/mm/tlb.c -+++ b/arch/avr32/mm/tlb.c -@@ -348,7 +348,7 @@ static int tlb_show(struct seq_file *tlb, void *v) +diff -urN linux-2.6.24.3/arch/avr32/mm/fault.c avr32-2.6/arch/avr32/mm/fault.c +--- linux-2.6.24.3/arch/avr32/mm/fault.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mm/fault.c 2008-04-23 20:12:35.000000000 +0200 +@@ -189,6 +189,8 @@ + + page = sysreg_read(PTBR); + printk(KERN_ALERT "ptbr = %08lx", page); ++ if (address >= TASK_SIZE) ++ page = (unsigned long)swapper_pg_dir; + if (page) { + page = ((unsigned long *)page)[address >> 22]; + printk(" pgd = %08lx", page); +diff -urN linux-2.6.24.3/arch/avr32/mm/tlb.c avr32-2.6/arch/avr32/mm/tlb.c +--- linux-2.6.24.3/arch/avr32/mm/tlb.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/arch/avr32/mm/tlb.c 2008-04-23 19:33:29.000000000 +0200 +@@ -348,7 +348,7 @@ return 0; } @@ -10934,11 +11659,9 @@ index 5667201..b835257 100644 .start = tlb_start, .next = tlb_next, .stop = tlb_stop, -diff --git a/arch/avr32/oprofile/Makefile b/arch/avr32/oprofile/Makefile -new file mode 100644 -index 0000000..1fe81c3 ---- /dev/null -+++ b/arch/avr32/oprofile/Makefile +diff -urN linux-2.6.24.3/arch/avr32/oprofile/Makefile avr32-2.6/arch/avr32/oprofile/Makefile +--- linux-2.6.24.3/arch/avr32/oprofile/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/oprofile/Makefile 2008-04-23 19:33:29.000000000 +0200 @@ -0,0 +1,8 @@ +obj-$(CONFIG_OPROFILE) += oprofile.o + @@ -10948,12 +11671,10 @@ index 0000000..1fe81c3 + oprofilefs.o oprofile_stats.o \ + timer_int.o) +oprofile-y += op_model_avr32.o -diff --git a/arch/avr32/oprofile/op_model_avr32.c b/arch/avr32/oprofile/op_model_avr32.c -new file mode 100644 -index 0000000..e2f876b ---- /dev/null -+++ b/arch/avr32/oprofile/op_model_avr32.c -@@ -0,0 +1,235 @@ +diff -urN linux-2.6.24.3/arch/avr32/oprofile/op_model_avr32.c avr32-2.6/arch/avr32/oprofile/op_model_avr32.c +--- linux-2.6.24.3/arch/avr32/oprofile/op_model_avr32.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/oprofile/op_model_avr32.c 2008-04-23 20:12:35.000000000 +0200 +@@ -0,0 +1,234 @@ +/* + * AVR32 Performance Counter Driver + * @@ -10972,7 +11693,6 @@ index 0000000..e2f876b +#include <linux/sched.h> +#include <linux/types.h> + -+#include <asm/intc.h> +#include <asm/sysreg.h> +#include <asm/system.h> + @@ -11189,42 +11909,348 @@ index 0000000..e2f876b +{ + +} -diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index c466c6c..0bb2052 100644 ---- a/drivers/i2c/busses/Kconfig -+++ b/drivers/i2c/busses/Kconfig -@@ -88,6 +88,14 @@ config I2C_AT91 - to support combined I2C messages. Use the i2c-gpio driver - unless your system can cope with those limitations. +diff -urN linux-2.6.24.3/Documentation/kernel-parameters.txt avr32-2.6/Documentation/kernel-parameters.txt +--- linux-2.6.24.3/Documentation/kernel-parameters.txt 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/Documentation/kernel-parameters.txt 2008-04-23 20:12:35.000000000 +0200 +@@ -34,6 +34,7 @@ + ALSA ALSA sound support is enabled. + APIC APIC support is enabled. + APM Advanced Power Management support is enabled. ++ AVR32 AVR32 architecture is enabled. + AX25 Appropriate AX.25 support is enabled. + BLACKFIN Blackfin architecture is enabled. + DRM Direct Rendering Management support is enabled. +@@ -1123,6 +1124,10 @@ + of returning the full 64-bit number. + The default is to return 64-bit inode numbers. -+config I2C_ATMELTWI -+ tristate "Atmel Two-Wire Interface (TWI)" -+ depends on I2C && (ARCH_AT91 || PLATFORM_AT32AP) -+ help -+ Atmel on-chip TWI controller. Say Y if you have an AT32 or -+ AT91-based device and want to use its built-in TWI -+ functionality. ++ nmi_debug= [KNL,AVR32] Specify one or more actions to take ++ when a NMI is triggered. ++ Format: [state][,regs][,debounce][,die] + - config I2C_AU1550 - tristate "Au1550/Au1200 SMBus interface" - depends on SOC_AU1550 || SOC_AU1200 -diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile -index 81d43c2..af3f350 100644 ---- a/drivers/i2c/busses/Makefile -+++ b/drivers/i2c/busses/Makefile -@@ -53,6 +53,7 @@ obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o - obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o - obj-$(CONFIG_SCx200_ACB) += scx200_acb.o - obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o -+obj-$(CONFIG_I2C_ATMELTWI) += i2c-atmeltwi.o + nmi_watchdog= [KNL,BUGS=X86-32] Debugging features for SMP kernels - ifeq ($(CONFIG_I2C_DEBUG_BUS),y) - EXTRA_CFLAGS += -DDEBUG -diff --git a/drivers/i2c/busses/i2c-atmeltwi.c b/drivers/i2c/busses/i2c-atmeltwi.c -new file mode 100644 -index 0000000..70c719a ---- /dev/null -+++ b/drivers/i2c/busses/i2c-atmeltwi.c + no387 [BUGS=X86-32] Tells the kernel to use the 387 maths +diff -urN linux-2.6.24.3/drivers/clocksource/Makefile avr32-2.6/drivers/clocksource/Makefile +--- linux-2.6.24.3/drivers/clocksource/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/clocksource/Makefile 2008-04-23 20:12:39.000000000 +0200 +@@ -1,3 +1,4 @@ ++obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o + obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o + obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o + obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o +diff -urN linux-2.6.24.3/drivers/clocksource/tcb_clksrc.c avr32-2.6/drivers/clocksource/tcb_clksrc.c +--- linux-2.6.24.3/drivers/clocksource/tcb_clksrc.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/clocksource/tcb_clksrc.c 2008-04-23 20:12:39.000000000 +0200 +@@ -0,0 +1,305 @@ ++#include <linux/init.h> ++#include <linux/clocksource.h> ++#include <linux/clockchips.h> ++#include <linux/interrupt.h> ++#include <linux/irq.h> ++ ++#include <linux/clk.h> ++#include <linux/err.h> ++#include <linux/ioport.h> ++#include <linux/io.h> ++#include <linux/platform_device.h> ++#include <linux/atmel_tc.h> ++ ++ ++/* ++ * We're configured to use a specific TC block, one that's not hooked ++ * up to external hardware, to provide a time solution: ++ * ++ * - Two channels combine to create a free-running 32 bit counter ++ * with a base rate of 5+ MHz, packaged as a clocksource (with ++ * resolution better than 200 nsec). ++ * ++ * - The third channel may be used to provide a 16-bit clockevent ++ * source, used in either periodic or oneshot mode. This runs ++ * at 32 KiHZ, and can handle delays of up to two seconds. ++ * ++ * A boot clocksource and clockevent source are also currently needed, ++ * unless the relevant platforms (ARM/AT91, AVR32/AT32) are changed so ++ * this code can be used when init_timers() is called, well before most ++ * devices are set up. (Some low end AT91 parts, which can run uClinux, ++ * have only the timers in one TC block... they currently don't support ++ * the tclib code, because of that initialization issue.) ++ * ++ * REVISIT behavior during system suspend states... we should disable ++ * all clocks and save the power. Easily done for clockevent devices, ++ * but clocksources won't necessarily get the needed notifications. ++ * For deeper system sleep states, this will be mandatory... ++ */ ++ ++static void __iomem *tcaddr; ++ ++static cycle_t tc_get_cycles(void) ++{ ++ unsigned long flags; ++ u32 lower, upper; ++ ++ raw_local_irq_save(flags); ++ do { ++ upper = __raw_readl(tcaddr + ATMEL_TC_REG(1, CV)); ++ lower = __raw_readl(tcaddr + ATMEL_TC_REG(0, CV)); ++ } while (upper != __raw_readl(tcaddr + ATMEL_TC_REG(1, CV))); ++ ++ raw_local_irq_restore(flags); ++ return (upper << 16) | lower; ++} ++ ++static struct clocksource clksrc = { ++ .name = "tcb_clksrc", ++ .rating = 200, ++ .read = tc_get_cycles, ++ .mask = CLOCKSOURCE_MASK(32), ++ .shift = 18, ++ .flags = CLOCK_SOURCE_IS_CONTINUOUS, ++}; ++ ++#ifdef CONFIG_GENERIC_CLOCKEVENTS ++ ++struct tc_clkevt_device { ++ struct clock_event_device clkevt; ++ struct clk *clk; ++ void __iomem *regs; ++}; ++ ++static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) ++{ ++ return container_of(clkevt, struct tc_clkevt_device, clkevt); ++} ++ ++/* For now, we always use the 32K clock ... this optimizes for NO_HZ, ++ * because using one of the divided clocks would usually mean the ++ * tick rate can never be less than several dozen Hz (vs 0.5 Hz). ++ * ++ * A divided clock could be good for high resolution timers, since ++ * 30.5 usec resolution can seem "low". ++ */ ++static u32 timer_clock; ++ ++static void tc_mode(enum clock_event_mode m, struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ void __iomem *regs = tcd->regs; ++ ++ if (tcd->clkevt.mode == CLOCK_EVT_MODE_PERIODIC ++ || tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) { ++ __raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR)); ++ __raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); ++ clk_disable(tcd->clk); ++ } ++ ++ switch (m) { ++ ++ /* By not making the gentime core emulate periodic mode on top ++ * of oneshot, we get lower overhead and improved accuracy. ++ */ ++ case CLOCK_EVT_MODE_PERIODIC: ++ clk_enable(tcd->clk); ++ ++ /* slow clock, count up to RC, then irq and restart */ ++ __raw_writel(timer_clock ++ | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, ++ regs + ATMEL_TC_REG(2, CMR)); ++ __raw_writel((32768 + HZ/2) / HZ, tcaddr + ATMEL_TC_REG(2, RC)); ++ ++ /* Enable clock and interrupts on RC compare */ ++ __raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); ++ ++ /* go go gadget! */ ++ __raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, ++ regs + ATMEL_TC_REG(2, CCR)); ++ break; ++ ++ case CLOCK_EVT_MODE_ONESHOT: ++ clk_enable(tcd->clk); ++ ++ /* slow clock, count up to RC, then irq and stop */ ++ __raw_writel(timer_clock | ATMEL_TC_CPCSTOP ++ | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, ++ regs + ATMEL_TC_REG(2, CMR)); ++ __raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); ++ ++ /* set_next_event() configures and starts the timer */ ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++static int tc_next_event(unsigned long delta, struct clock_event_device *d) ++{ ++ __raw_writel(delta, tcaddr + ATMEL_TC_REG(2, RC)); ++ ++ /* go go gadget! */ ++ __raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, ++ tcaddr + ATMEL_TC_REG(2, CCR)); ++ return 0; ++} ++ ++static struct tc_clkevt_device clkevt = { ++ .clkevt = { ++ .name = "tc_clkevt", ++ .features = CLOCK_EVT_FEAT_PERIODIC ++ | CLOCK_EVT_FEAT_ONESHOT, ++ .shift = 32, ++ /* Should be lower than at91rm9200's system timer */ ++ .rating = 125, ++ .cpumask = CPU_MASK_CPU0, ++ .set_next_event = tc_next_event, ++ .set_mode = tc_mode, ++ }, ++}; ++ ++static irqreturn_t ch2_irq(int irq, void *handle) ++{ ++ struct tc_clkevt_device *dev = handle; ++ unsigned int sr; ++ ++ sr = __raw_readl(dev->regs + ATMEL_TC_REG(2, SR)); ++ if (sr & ATMEL_TC_CPCS) { ++ dev->clkevt.event_handler(&dev->clkevt); ++ return IRQ_HANDLED; ++ } ++ ++ return IRQ_NONE; ++} ++ ++static struct irqaction tc_irqaction = { ++ .name = "tc_clkevt", ++ .flags = IRQF_TIMER | IRQF_DISABLED, ++ .handler = ch2_irq, ++}; ++ ++static void __init setup_clkevents(struct atmel_tc *tc, ++ struct clk *t0_clk, int clk32k_divisor_idx) ++{ ++ struct platform_device *pdev = tc->pdev; ++ struct clk *t2_clk = tc->clk[2]; ++ int irq = tc->irq[2]; ++ ++ clkevt.regs = tc->regs; ++ clkevt.clk = t2_clk; ++ tc_irqaction.dev_id = &clkevt; ++ ++ timer_clock = clk32k_divisor_idx; ++ ++ clkevt.clkevt.mult = div_sc(32768, NSEC_PER_SEC, clkevt.clkevt.shift); ++ clkevt.clkevt.max_delta_ns ++ = clockevent_delta2ns(0xffff, &clkevt.clkevt); ++ clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1; ++ ++ setup_irq(irq, &tc_irqaction); ++ ++ clockevents_register_device(&clkevt.clkevt); ++} ++ ++#else /* !CONFIG_GENERIC_CLOCKEVENTS */ ++ ++static void __init setup_clkevents(struct atmel_tc *tc, ++ struct clk *t0_clk, int clk32k_divisor_idx) ++{ ++ /* NOTHING */ ++} ++ ++#endif ++ ++static int __init tcb_clksrc_init(void) ++{ ++ static char bootinfo[] __initdata ++ = KERN_DEBUG "%s: tc%d at %d.%03d MHz\n"; ++ ++ struct platform_device *pdev; ++ struct atmel_tc *tc; ++ struct clk *t0_clk, *t1_clk; ++ u32 rate, divided_rate = 0; ++ int best_divisor_idx = -1; ++ int clk32k_divisor_idx = -1; ++ int i; ++ ++ tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK, clksrc.name); ++ if (!tc) { ++ pr_debug("can't alloc TC for clocksource\n"); ++ return -ENODEV; ++ } ++ tcaddr = tc->regs; ++ pdev = tc->pdev; ++ ++ t0_clk = tc->clk[0]; ++ clk_enable(t0_clk); ++ ++ /* How fast will we be counting? Pick something over 5 MHz. */ ++ rate = (u32) clk_get_rate(t0_clk); ++ for (i = 0; i < 5; i++) { ++ unsigned divisor = atmel_tc_divisors[i]; ++ unsigned tmp; ++ ++ /* remember 32 KiHz clock for later */ ++ if (!divisor) { ++ clk32k_divisor_idx = i; ++ continue; ++ } ++ ++ tmp = rate / divisor; ++ pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); ++ if (best_divisor_idx > 0) { ++ if (tmp < 5 * 1000 * 1000) ++ continue; ++ } ++ divided_rate = tmp; ++ best_divisor_idx = i; ++ } ++ ++ clksrc.mult = clocksource_hz2mult(divided_rate, clksrc.shift); ++ ++ printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK, ++ divided_rate / 1000000, ++ ((divided_rate + 500000) % 1000000) / 1000); ++ ++ /* tclib will give us three clocks no matter what the ++ * underlying platform supports. ++ */ ++ clk_enable(tc->clk[1]); ++ ++ /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ ++ __raw_writel(best_divisor_idx /* likely divide-by-8 */ ++ | ATMEL_TC_WAVE ++ | ATMEL_TC_WAVESEL_UP /* free-run */ ++ | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ ++ | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ ++ tcaddr + ATMEL_TC_REG(0, CMR)); ++ __raw_writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); ++ __raw_writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); ++ __raw_writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ ++ __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); ++ ++ /* channel 1: waveform mode, input TIOA0 */ ++ __raw_writel(ATMEL_TC_XC1 /* input: TIOA0 */ ++ | ATMEL_TC_WAVE ++ | ATMEL_TC_WAVESEL_UP, /* free-run */ ++ tcaddr + ATMEL_TC_REG(1, CMR)); ++ __raw_writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ ++ __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); ++ ++ /* chain channel 0 to channel 1, then reset all the timers */ ++ __raw_writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); ++ __raw_writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); ++ ++ /* and away we go! */ ++ clocksource_register(&clksrc); ++ ++ /* channel 2: periodic and oneshot timer support */ ++ setup_clkevents(tc, t0_clk, clk32k_divisor_idx); ++ ++ return 0; ++} ++arch_initcall(tcb_clksrc_init); +diff -urN linux-2.6.24.3/drivers/i2c/busses/i2c-atmeltwi.c avr32-2.6/drivers/i2c/busses/i2c-atmeltwi.c +--- linux-2.6.24.3/drivers/i2c/busses/i2c-atmeltwi.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/i2c/busses/i2c-atmeltwi.c 2008-04-23 19:33:37.000000000 +0200 @@ -0,0 +1,436 @@ +/* + * i2c Support for Atmel's Two-Wire Interface (TWI) @@ -11466,9 +12492,9 @@ index 0000000..70c719a + + } else if (status & TWI_BIT(TXRDY)) { + if (twi->acks_left > 0) { -+ twi->acks_left--; + twi_writel(twi, THR, + twi->buf[twi->len - twi->acks_left]); ++ twi->acks_left--; + } else + twi_writel(twi, CR, TWI_BIT(STOP)); + } @@ -11662,11 +12688,9 @@ index 0000000..70c719a +MODULE_AUTHOR("Espen Krangnes"); +MODULE_DESCRIPTION("I2C driver for Atmel TWI"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/i2c/busses/i2c-atmeltwi.h b/drivers/i2c/busses/i2c-atmeltwi.h -new file mode 100644 -index 0000000..1aca065 ---- /dev/null -+++ b/drivers/i2c/busses/i2c-atmeltwi.h +diff -urN linux-2.6.24.3/drivers/i2c/busses/i2c-atmeltwi.h avr32-2.6/drivers/i2c/busses/i2c-atmeltwi.h +--- linux-2.6.24.3/drivers/i2c/busses/i2c-atmeltwi.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/i2c/busses/i2c-atmeltwi.h 2008-04-23 19:33:37.000000000 +0200 @@ -0,0 +1,117 @@ +/* + * Register definitions for the Atmel Two-Wire Interface @@ -11785,11 +12809,512 @@ index 0000000..1aca065 + __raw_writel((value), (port)->regs + TWI_##reg) + +#endif /* __ATMELTWI_H__ */ -diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig -index ec568fa..4e1db3b 100644 ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -18,6 +18,13 @@ config LEDS_CLASS +diff -urN linux-2.6.24.3/drivers/i2c/busses/Kconfig avr32-2.6/drivers/i2c/busses/Kconfig +--- linux-2.6.24.3/drivers/i2c/busses/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/i2c/busses/Kconfig 2008-04-23 20:12:40.000000000 +0200 +@@ -88,6 +88,14 @@ + to support combined I2C messages. Use the i2c-gpio driver + unless your system can cope with those limitations. + ++config I2C_ATMELTWI ++ tristate "Atmel Two-Wire Interface (TWI)" ++ depends on I2C && (ARCH_AT91 || PLATFORM_AT32AP) ++ help ++ Atmel on-chip TWI controller. Say Y if you have an AT32 or ++ AT91-based device and want to use its built-in TWI ++ functionality. ++ + config I2C_AU1550 + tristate "Au1550/Au1200 SMBus interface" + depends on SOC_AU1550 || SOC_AU1200 +diff -urN linux-2.6.24.3/drivers/i2c/busses/Makefile avr32-2.6/drivers/i2c/busses/Makefile +--- linux-2.6.24.3/drivers/i2c/busses/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/i2c/busses/Makefile 2008-04-23 20:12:40.000000000 +0200 +@@ -53,6 +53,7 @@ + obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o + obj-$(CONFIG_SCx200_ACB) += scx200_acb.o + obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o ++obj-$(CONFIG_I2C_ATMELTWI) += i2c-atmeltwi.o + + ifeq ($(CONFIG_I2C_DEBUG_BUS),y) + EXTRA_CFLAGS += -DDEBUG +diff -urN linux-2.6.24.3/drivers/input/serio/at32psif.c avr32-2.6/drivers/input/serio/at32psif.c +--- linux-2.6.24.3/drivers/input/serio/at32psif.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/input/serio/at32psif.c 2008-04-23 20:12:40.000000000 +0200 +@@ -0,0 +1,351 @@ ++/* ++ * Copyright (C) 2007 Atmel Corporation ++ * ++ * Driver for the AT32AP700X PS/2 controller (PSIF). ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/device.h> ++#include <linux/init.h> ++#include <linux/serio.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <linux/err.h> ++#include <linux/io.h> ++#include <linux/clk.h> ++#include <linux/platform_device.h> ++ ++#include "at32psif.h" ++ ++#define PSIF_BUF_SIZE 16 ++ ++#define ring_is_empty(_psif) (_psif->head == _psif->tail) ++#define ring_next_head(_psif) ((_psif->head + 1) & (PSIF_BUF_SIZE - 1)) ++#define ring_next_tail(_psif) ((_psif->tail + 1) & (PSIF_BUF_SIZE - 1)) ++ ++struct psif { ++ struct platform_device *pdev; ++ struct clk *pclk; ++ struct serio *io; ++ struct timer_list tx_timer; ++ void __iomem *regs; ++ unsigned int irq; ++ unsigned int open; ++ /* Prevent concurrent writes to circular buffer. */ ++ spinlock_t lock; ++ unsigned int head; ++ unsigned int tail; ++ unsigned char buffer[PSIF_BUF_SIZE]; ++}; ++ ++static irqreturn_t psif_interrupt(int irq, void *_ptr) ++{ ++ struct psif *psif = _ptr; ++ int retval = IRQ_NONE; ++ unsigned int io_flags = 0; ++ unsigned long status; ++ ++ status = psif_readl(psif, SR); ++ ++ if (status & PSIF_BIT(RXRDY)) { ++ unsigned char val = (unsigned char) psif_readl(psif, RHR); ++ ++ if (status & PSIF_BIT(PARITY)) ++ io_flags |= SERIO_PARITY; ++ if (status & PSIF_BIT(OVRUN)) ++ dev_err(&psif->pdev->dev, "overrun read error\n"); ++ ++ serio_interrupt(psif->io, val, io_flags); ++ ++ retval = IRQ_HANDLED; ++ } ++ ++ spin_lock(&psif->lock); ++ ++ if (status & PSIF_BIT(TXEMPTY)) { ++ if (status & PSIF_BIT(NACK)) ++ dev_err(&psif->pdev->dev, "NACK error\n"); ++ ++ psif_writel(psif, IDR, PSIF_BIT(TXEMPTY)); ++ ++ if (!ring_is_empty(psif)) ++ mod_timer(&psif->tx_timer, ++ jiffies + msecs_to_jiffies(1)); ++ ++ retval = IRQ_HANDLED; ++ } ++ ++ spin_unlock(&psif->lock); ++ ++ return retval; ++} ++ ++static void psif_transmit_data(unsigned long data) ++{ ++ struct psif *psif = (struct psif *)data; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&psif->lock, flags); ++ ++ psif_writel(psif, THR, psif->buffer[psif->tail]); ++ psif->tail = ring_next_tail(psif); ++ ++ if (!ring_is_empty(psif)) ++ psif_writel(psif, IER, PSIF_BIT(TXEMPTY)); ++ ++ spin_unlock_irqrestore(&psif->lock, flags); ++} ++ ++static int psif_write(struct serio *io, unsigned char val) ++{ ++ struct psif *psif = io->port_data; ++ unsigned long flags; ++ unsigned int head; ++ ++ spin_lock_irqsave(&psif->lock, flags); ++ ++ head = ring_next_head(psif); ++ ++ if (head != psif->tail) { ++ psif->buffer[psif->head] = val; ++ psif->head = head; ++ } else { ++ dev_err(&psif->pdev->dev, "underrun write error\n"); ++ } ++ ++ spin_unlock_irqrestore(&psif->lock, flags); ++ ++ /* Make sure TXEMPTY interrupt is enabled. */ ++ psif_writel(psif, IER, PSIF_BIT(TXEMPTY)); ++ ++ return 0; ++} ++ ++static int psif_open(struct serio *io) ++{ ++ struct psif *psif = io->port_data; ++ int retval; ++ ++ retval = clk_enable(psif->pclk); ++ if (retval) ++ goto out; ++ ++ psif_writel(psif, CR, PSIF_BIT(CR_TXEN) | PSIF_BIT(CR_RXEN)); ++ psif_writel(psif, IER, PSIF_BIT(RXRDY)); ++ ++ psif->open = 1; ++out: ++ return retval; ++} ++ ++static void psif_close(struct serio *io) ++{ ++ struct psif *psif = io->port_data; ++ ++ psif->open = 0; ++ ++ psif_writel(psif, IDR, ~0UL); ++ psif_writel(psif, CR, PSIF_BIT(CR_TXDIS) | PSIF_BIT(CR_RXDIS)); ++ ++ clk_disable(psif->pclk); ++} ++ ++static void psif_set_prescaler(struct psif *psif) ++{ ++ unsigned long prscv; ++ unsigned long rate = clk_get_rate(psif->pclk); ++ ++ /* PRSCV = Pulse length (100 us) * PSIF module frequency. */ ++ prscv = 100 * (rate / 1000000UL); ++ ++ if (prscv > ((1<<PSIF_PSR_PRSCV_SIZE) - 1)) { ++ prscv = (1<<PSIF_PSR_PRSCV_SIZE) - 1; ++ dev_dbg(&psif->pdev->dev, "pclk too fast, " ++ "prescaler set to max\n"); ++ } ++ ++ clk_enable(psif->pclk); ++ psif_writel(psif, PSR, prscv); ++ clk_disable(psif->pclk); ++} ++ ++static int __init psif_probe(struct platform_device *pdev) ++{ ++ struct resource *regs; ++ struct psif *psif; ++ struct serio *io; ++ struct clk *pclk; ++ int irq; ++ int ret; ++ ++ psif = kzalloc(sizeof(struct psif), GFP_KERNEL); ++ if (!psif) { ++ dev_dbg(&pdev->dev, "out of memory\n"); ++ ret = -ENOMEM; ++ goto out; ++ } ++ psif->pdev = pdev; ++ ++ io = kzalloc(sizeof(struct serio), GFP_KERNEL); ++ if (!io) { ++ dev_dbg(&pdev->dev, "out of memory\n"); ++ ret = -ENOMEM; ++ goto out_free_psif; ++ } ++ psif->io = io; ++ ++ regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!regs) { ++ dev_dbg(&pdev->dev, "no mmio resources defined\n"); ++ ret = -ENOMEM; ++ goto out_free_io; ++ } ++ ++ psif->regs = ioremap(regs->start, regs->end - regs->start + 1); ++ if (!psif->regs) { ++ ret = -ENOMEM; ++ dev_dbg(&pdev->dev, "could not map I/O memory\n"); ++ goto out_free_io; ++ } ++ ++ pclk = clk_get(&pdev->dev, "pclk"); ++ if (IS_ERR(pclk)) { ++ dev_dbg(&pdev->dev, "could not get peripheral clock\n"); ++ ret = PTR_ERR(pclk); ++ goto out_iounmap; ++ } ++ psif->pclk = pclk; ++ ++ /* Reset the PSIF to enter at a known state. */ ++ ret = clk_enable(pclk); ++ if (ret) { ++ dev_dbg(&pdev->dev, "could not enable pclk\n"); ++ goto out_put_clk; ++ } ++ psif_writel(psif, CR, PSIF_BIT(CR_SWRST)); ++ clk_disable(pclk); ++ ++ setup_timer(&psif->tx_timer, psif_transmit_data, (unsigned long)psif); ++ ++ irq = platform_get_irq(pdev, 0); ++ if (irq < 0) { ++ dev_dbg(&pdev->dev, "could not get irq\n"); ++ ret = -ENXIO; ++ goto out_put_clk; ++ } ++ ret = request_irq(irq, psif_interrupt, IRQF_SHARED, "at32psif", psif); ++ if (ret) { ++ dev_dbg(&pdev->dev, "could not request irq %d\n", irq); ++ goto out_put_clk; ++ } ++ psif->irq = irq; ++ ++ io->id.type = SERIO_8042; ++ io->write = psif_write; ++ io->open = psif_open; ++ io->close = psif_close; ++ strlcpy(io->name, pdev->dev.bus_id, sizeof(io->name)); ++ strlcpy(io->phys, pdev->dev.bus_id, sizeof(io->phys)); ++ io->port_data = psif; ++ io->dev.parent = &pdev->dev; ++ ++ psif_set_prescaler(psif); ++ ++ spin_lock_init(&psif->lock); ++ serio_register_port(psif->io); ++ platform_set_drvdata(pdev, psif); ++ ++ dev_info(&pdev->dev, "Atmel AVR32 PSIF PS/2 driver on 0x%08x irq %d\n", ++ (int)psif->regs, psif->irq); ++ ++ return 0; ++ ++out_put_clk: ++ clk_put(psif->pclk); ++out_iounmap: ++ iounmap(psif->regs); ++out_free_io: ++ kfree(io); ++out_free_psif: ++ kfree(psif); ++out: ++ return ret; ++} ++ ++static int __exit psif_remove(struct platform_device *pdev) ++{ ++ struct psif *psif = platform_get_drvdata(pdev); ++ ++ psif_writel(psif, IDR, ~0UL); ++ psif_writel(psif, CR, PSIF_BIT(CR_TXDIS) | PSIF_BIT(CR_RXDIS)); ++ ++ serio_unregister_port(psif->io); ++ iounmap(psif->regs); ++ free_irq(psif->irq, psif); ++ clk_put(psif->pclk); ++ kfree(psif); ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int psif_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ struct psif *psif = platform_get_drvdata(pdev); ++ ++ if (psif->open) { ++ psif_writel(psif, CR, PSIF_BIT(CR_RXDIS) | PSIF_BIT(CR_TXDIS)); ++ clk_disable(psif->pclk); ++ } ++ ++ return 0; ++} ++ ++static int psif_resume(struct platform_device *pdev) ++{ ++ struct psif *psif = platform_get_drvdata(pdev); ++ ++ if (psif->open) { ++ clk_enable(psif->pclk); ++ psif_set_prescaler(psif); ++ psif_writel(psif, CR, PSIF_BIT(CR_RXEN) | PSIF_BIT(CR_TXEN)); ++ } ++ ++ return 0; ++} ++#else ++#define psif_suspend NULL ++#define psif_resume NULL ++#endif ++ ++static struct platform_driver psif_driver = { ++ .remove = __exit_p(psif_remove), ++ .driver = { ++ .name = "atmel_psif", ++ }, ++ .suspend = psif_suspend, ++ .resume = psif_resume, ++}; ++ ++static int __init psif_init(void) ++{ ++ return platform_driver_probe(&psif_driver, psif_probe); ++} ++ ++static void __exit psif_exit(void) ++{ ++ platform_driver_unregister(&psif_driver); ++} ++ ++module_init(psif_init); ++module_exit(psif_exit); ++ ++MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); ++MODULE_DESCRIPTION("Atmel AVR32 PSIF PS/2 driver"); ++MODULE_LICENSE("GPL"); +diff -urN linux-2.6.24.3/drivers/input/serio/at32psif.h avr32-2.6/drivers/input/serio/at32psif.h +--- linux-2.6.24.3/drivers/input/serio/at32psif.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/input/serio/at32psif.h 2008-04-23 20:12:40.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * Copyright (C) 2007 Atmel Corporation ++ * ++ * Driver for the AT32AP700X PS/2 controller (PSIF). ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ ++ ++#ifndef _AT32PSIF_H ++#define _AT32PSIF_H ++ ++/* PSIF register offsets */ ++#define PSIF_CR 0x00 ++#define PSIF_RHR 0x04 ++#define PSIF_THR 0x08 ++#define PSIF_SR 0x10 ++#define PSIF_IER 0x14 ++#define PSIF_IDR 0x18 ++#define PSIF_IMR 0x1c ++#define PSIF_PSR 0x24 ++ ++/* Bitfields in control register. */ ++#define PSIF_CR_RXDIS_OFFSET 1 ++#define PSIF_CR_RXDIS_SIZE 1 ++#define PSIF_CR_RXEN_OFFSET 0 ++#define PSIF_CR_RXEN_SIZE 1 ++#define PSIF_CR_SWRST_OFFSET 15 ++#define PSIF_CR_SWRST_SIZE 1 ++#define PSIF_CR_TXDIS_OFFSET 9 ++#define PSIF_CR_TXDIS_SIZE 1 ++#define PSIF_CR_TXEN_OFFSET 8 ++#define PSIF_CR_TXEN_SIZE 1 ++ ++/* Bitfields in interrupt disable, enable, mask and status register. */ ++#define PSIF_NACK_OFFSET 8 ++#define PSIF_NACK_SIZE 1 ++#define PSIF_OVRUN_OFFSET 5 ++#define PSIF_OVRUN_SIZE 1 ++#define PSIF_PARITY_OFFSET 9 ++#define PSIF_PARITY_SIZE 1 ++#define PSIF_RXRDY_OFFSET 4 ++#define PSIF_RXRDY_SIZE 1 ++#define PSIF_TXEMPTY_OFFSET 1 ++#define PSIF_TXEMPTY_SIZE 1 ++#define PSIF_TXRDY_OFFSET 0 ++#define PSIF_TXRDY_SIZE 1 ++ ++/* Bitfields in prescale register. */ ++#define PSIF_PSR_PRSCV_OFFSET 0 ++#define PSIF_PSR_PRSCV_SIZE 12 ++ ++/* Bitfields in receive hold register. */ ++#define PSIF_RHR_RXDATA_OFFSET 0 ++#define PSIF_RHR_RXDATA_SIZE 8 ++ ++/* Bitfields in transmit hold register. */ ++#define PSIF_THR_TXDATA_OFFSET 0 ++#define PSIF_THR_TXDATA_SIZE 8 ++ ++/* Bit manipulation macros */ ++#define PSIF_BIT(name) \ ++ (1 << PSIF_##name##_OFFSET) ++#define PSIF_BF(name, value) \ ++ (((value) & ((1 << PSIF_##name##_SIZE) - 1)) \ ++ << PSIF_##name##_OFFSET) ++#define PSIF_BFEXT(name, value)\ ++ (((value) >> PSIF_##name##_OFFSET) \ ++ & ((1 << PSIF_##name##_SIZE) - 1)) ++#define PSIF_BFINS(name, value, old) \ ++ (((old) & ~(((1 << PSIF_##name##_SIZE) - 1) \ ++ << PSIF_##name##_OFFSET)) \ ++ | PSIF_BF(name, value)) ++ ++/* Register access macros */ ++#define psif_readl(port, reg) \ ++ __raw_readl((port)->regs + PSIF_##reg) ++#define psif_writel(port, reg, value) \ ++ __raw_writel((value), (port)->regs + PSIF_##reg) ++ ++#endif /* _AT32PSIF_H */ +diff -urN linux-2.6.24.3/drivers/input/serio/Kconfig avr32-2.6/drivers/input/serio/Kconfig +--- linux-2.6.24.3/drivers/input/serio/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/input/serio/Kconfig 2008-04-23 20:12:40.000000000 +0200 +@@ -88,6 +88,17 @@ + To compile this driver as a module, choose M here: the + module will be called rpckbd. + ++config SERIO_AT32PSIF ++ tristate "AVR32 PSIF PS/2 keyboard and mouse controller" ++ depends on AVR32 ++ default n ++ help ++ Say Y here if you want to use the PSIF peripheral on AVR32 devices ++ and connect a PS/2 keyboard and/or mouse to it. ++ ++ To compile this driver as a module, choose M here: the module will ++ be called at32psif. ++ + config SERIO_AMBAKMI + tristate "AMBA KMI keyboard controller" + depends on ARM_AMBA +diff -urN linux-2.6.24.3/drivers/input/serio/Makefile avr32-2.6/drivers/input/serio/Makefile +--- linux-2.6.24.3/drivers/input/serio/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/input/serio/Makefile 2008-04-23 20:12:40.000000000 +0200 +@@ -12,6 +12,7 @@ + obj-$(CONFIG_SERIO_RPCKBD) += rpckbd.o + obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o + obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o ++obj-$(CONFIG_SERIO_AT32PSIF) += at32psif.o + obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o + obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o + obj-$(CONFIG_HP_SDC) += hp_sdc.o +diff -urN linux-2.6.24.3/drivers/leds/Kconfig avr32-2.6/drivers/leds/Kconfig +--- linux-2.6.24.3/drivers/leds/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/leds/Kconfig 2008-04-23 20:12:41.000000000 +0200 +@@ -18,6 +18,13 @@ comment "LED drivers" @@ -11803,23 +13328,9 @@ index ec568fa..4e1db3b 100644 config LEDS_CORGI tristate "LED Support for the Sharp SL-C7x0 series" depends on LEDS_CLASS && PXA_SHARP_C7xx -diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile -index a60de1b..04bc850 100644 ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -5,6 +5,7 @@ obj-$(CONFIG_LEDS_CLASS) += led-class.o - obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o - - # LED Platform Drivers -+obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o - obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o - obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o - obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o -diff --git a/drivers/leds/leds-atmel-pwm.c b/drivers/leds/leds-atmel-pwm.c -new file mode 100644 -index 0000000..187031c ---- /dev/null -+++ b/drivers/leds/leds-atmel-pwm.c +diff -urN linux-2.6.24.3/drivers/leds/leds-atmel-pwm.c avr32-2.6/drivers/leds/leds-atmel-pwm.c +--- linux-2.6.24.3/drivers/leds/leds-atmel-pwm.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/leds/leds-atmel-pwm.c 2008-04-23 19:33:39.000000000 +0200 @@ -0,0 +1,155 @@ +#include <linux/kernel.h> +#include <linux/platform_device.h> @@ -11976,43 +13487,20 @@ index 0000000..187031c + +MODULE_DESCRIPTION("Driver for LEDs with PWM-controlled brightness"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index b5e67c0..23a9231 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -13,6 +13,15 @@ menuconfig MISC_DEVICES - - if MISC_DEVICES +diff -urN linux-2.6.24.3/drivers/leds/Makefile avr32-2.6/drivers/leds/Makefile +--- linux-2.6.24.3/drivers/leds/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/leds/Makefile 2008-04-23 20:12:41.000000000 +0200 +@@ -5,6 +5,7 @@ + obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o -+config ATMEL_PWM -+ tristate "Atmel AT32/AT91 PWM support" -+ depends on AVR32 || ARCH_AT91 -+ help -+ This option enables device driver support for the PWM channels -+ on certain Atmel prcoessors. Pulse Width Modulation is used for -+ purposes including software controlled power-efficent backlights -+ on LCD displays, motor control, and waveform generation. -+ - config IBM_ASM - tristate "Device driver for IBM RSA service processor" - depends on X86 && PCI && INPUT && EXPERIMENTAL -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index 87f2685..b4674c6 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -7,6 +7,7 @@ obj-$(CONFIG_IBM_ASM) += ibmasm/ - obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ - obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o - obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o -+obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o - obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o - obj-$(CONFIG_LKDTM) += lkdtm.o - obj-$(CONFIG_TIFM_CORE) += tifm_core.o -diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c -new file mode 100644 -index 0000000..f8d3b9a ---- /dev/null -+++ b/drivers/misc/atmel_pwm.c + # LED Platform Drivers ++obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o + obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o + obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o + obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o +diff -urN linux-2.6.24.3/drivers/misc/atmel_pwm.c avr32-2.6/drivers/misc/atmel_pwm.c +--- linux-2.6.24.3/drivers/misc/atmel_pwm.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/misc/atmel_pwm.c 2008-04-23 19:33:40.000000000 +0200 @@ -0,0 +1,409 @@ +#include <linux/module.h> +#include <linux/clk.h> @@ -12423,45 +13911,240 @@ index 0000000..f8d3b9a + +MODULE_DESCRIPTION("Driver for AT32/AT91 PWM module"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig -index 5fef678..4970b53 100644 ---- a/drivers/mmc/host/Kconfig -+++ b/drivers/mmc/host/Kconfig -@@ -91,6 +91,16 @@ config MMC_AT91 +diff -urN linux-2.6.24.3/drivers/misc/atmel_tclib.c avr32-2.6/drivers/misc/atmel_tclib.c +--- linux-2.6.24.3/drivers/misc/atmel_tclib.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/misc/atmel_tclib.c 2008-04-23 20:12:41.000000000 +0200 +@@ -0,0 +1,161 @@ ++#include <linux/atmel_tc.h> ++#include <linux/clk.h> ++#include <linux/err.h> ++#include <linux/init.h> ++#include <linux/io.h> ++#include <linux/ioport.h> ++#include <linux/kernel.h> ++#include <linux/platform_device.h> ++ ++/* Number of bytes to reserve for the iomem resource */ ++#define ATMEL_TC_IOMEM_SIZE 256 ++ ++ ++/* ++ * This is a thin library to solve the problem of how to portably allocate ++ * one of the TC blocks. For simplicity, it doesn't currently expect to ++ * share individual timers between different drivers. ++ */ ++ ++#if defined(CONFIG_AVR32) ++/* AVR32 has these divide PBB */ ++const u8 atmel_tc_divisors[5] = { 0, 4, 8, 16, 32, }; ++EXPORT_SYMBOL(atmel_tc_divisors); ++ ++#elif defined(CONFIG_ARCH_AT91) ++/* AT91 has these divide MCK */ ++const u8 atmel_tc_divisors[5] = { 2, 8, 32, 128, 0, }; ++EXPORT_SYMBOL(atmel_tc_divisors); ++ ++#endif ++ ++static DEFINE_SPINLOCK(tc_list_lock); ++static LIST_HEAD(tc_list); ++ ++/** ++ * atmel_tc_alloc - allocate a specified TC block ++ * @block: which block to allocate ++ * @name: name to be associated with the iomem resource ++ * ++ * Caller allocates a block. If it is available, a pointer to a ++ * pre-initialized struct atmel_tc is returned. The caller can access ++ * the registers directly through the "regs" field. ++ */ ++struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name) ++{ ++ struct atmel_tc *tc; ++ struct platform_device *pdev = NULL; ++ struct resource *r; ++ ++ spin_lock(&tc_list_lock); ++ list_for_each_entry(tc, &tc_list, node) { ++ if (tc->pdev->id == block) { ++ pdev = tc->pdev; ++ break; ++ } ++ } ++ ++ if (!pdev || tc->iomem) ++ goto fail; ++ ++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ r = request_mem_region(r->start, ATMEL_TC_IOMEM_SIZE, name); ++ if (!r) ++ goto fail; ++ ++ tc->regs = ioremap(r->start, ATMEL_TC_IOMEM_SIZE); ++ if (!tc->regs) ++ goto fail_ioremap; ++ ++ tc->iomem = r; ++ ++out: ++ spin_unlock(&tc_list_lock); ++ return tc; ++ ++fail_ioremap: ++ release_resource(r); ++fail: ++ tc = NULL; ++ goto out; ++} ++EXPORT_SYMBOL_GPL(atmel_tc_alloc); ++ ++/** ++ * atmel_tc_free - release a specified TC block ++ * @tc: Timer/counter block that was returned by atmel_tc_alloc() ++ * ++ * This reverses the effect of atmel_tc_alloc(), unmapping the I/O ++ * registers, invalidating the resource returned by that routine and ++ * making the TC available to other drivers. ++ */ ++void atmel_tc_free(struct atmel_tc *tc) ++{ ++ spin_lock(&tc_list_lock); ++ if (tc->regs) { ++ iounmap(tc->regs); ++ release_resource(tc->iomem); ++ tc->regs = NULL; ++ tc->iomem = NULL; ++ } ++ spin_unlock(&tc_list_lock); ++} ++EXPORT_SYMBOL_GPL(atmel_tc_free); ++ ++static int __init tc_probe(struct platform_device *pdev) ++{ ++ struct atmel_tc *tc; ++ struct clk *clk; ++ int irq; ++ ++ if (!platform_get_resource(pdev, IORESOURCE_MEM, 0)) ++ return -EINVAL; ++ ++ irq = platform_get_irq(pdev, 0); ++ if (irq < 0) ++ return -EINVAL; ++ ++ tc = kzalloc(sizeof(struct atmel_tc), GFP_KERNEL); ++ if (!tc) ++ return -ENOMEM; ++ ++ tc->pdev = pdev; ++ ++ clk = clk_get(&pdev->dev, "t0_clk"); ++ if (IS_ERR(clk)) { ++ kfree(tc); ++ return -EINVAL; ++ } ++ ++ tc->clk[0] = clk; ++ tc->clk[1] = clk_get(&pdev->dev, "t1_clk"); ++ if (IS_ERR(tc->clk[1])) ++ tc->clk[1] = clk; ++ tc->clk[2] = clk_get(&pdev->dev, "t2_clk"); ++ if (IS_ERR(tc->clk[2])) ++ tc->clk[2] = clk; ++ ++ tc->irq[0] = irq; ++ tc->irq[1] = platform_get_irq(pdev, 1); ++ if (tc->irq[1] < 0) ++ tc->irq[1] = irq; ++ tc->irq[2] = platform_get_irq(pdev, 2); ++ if (tc->irq[2] < 0) ++ tc->irq[2] = irq; ++ ++ spin_lock(&tc_list_lock); ++ list_add_tail(&tc->node, &tc_list); ++ spin_unlock(&tc_list_lock); ++ ++ return 0; ++} ++ ++static struct platform_driver tc_driver = { ++ .driver.name = "atmel_tcb", ++}; ++ ++static int __init tc_init(void) ++{ ++ return platform_driver_probe(&tc_driver, tc_probe); ++} ++arch_initcall(tc_init); +diff -urN linux-2.6.24.3/drivers/misc/Kconfig avr32-2.6/drivers/misc/Kconfig +--- linux-2.6.24.3/drivers/misc/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/misc/Kconfig 2008-04-23 20:12:41.000000000 +0200 +@@ -13,6 +13,48 @@ - If unsure, say N. + if MISC_DEVICES -+config MMC_ATMELMCI -+ tristate "Atmel Multimedia Card Interface support" -+ depends on AVR32 && MMC ++config ATMEL_PWM ++ tristate "Atmel AT32/AT91 PWM support" ++ depends on AVR32 || ARCH_AT91 + help -+ This selects the Atmel Multimedia Card Interface. If you have -+ a AT91 (ARM) or AT32 (AVR32) platform with a Multimedia Card -+ slot, say Y or M here. ++ This option enables device driver support for the PWM channels ++ on certain Atmel prcoessors. Pulse Width Modulation is used for ++ purposes including software controlled power-efficent backlights ++ on LCD displays, motor control, and waveform generation. + -+ If unsure, say N. ++config ATMEL_TCLIB ++ bool "Atmel AT32/AT91 Timer/Counter Library" ++ depends on (AVR32 || ARCH_AT91) ++ help ++ Select this if you want a library to allocate the Timer/Counter ++ blocks found on many Atmel processors. This facilitates using ++ these blocks by different drivers despite processor differences. + - config MMC_IMX - tristate "Motorola i.MX Multimedia Card Interface support" - depends on ARCH_IMX -diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile -index 3877c87..e80ea72 100644 ---- a/drivers/mmc/host/Makefile -+++ b/drivers/mmc/host/Makefile -@@ -15,6 +15,7 @@ obj-$(CONFIG_MMC_WBSD) += wbsd.o - obj-$(CONFIG_MMC_AU1X) += au1xmmc.o - obj-$(CONFIG_MMC_OMAP) += omap.o - obj-$(CONFIG_MMC_AT91) += at91_mci.o -+obj-$(CONFIG_MMC_ATMELMCI) += atmel-mci.o - obj-$(CONFIG_MMC_TIFM_SD) += tifm_sd.o - obj-$(CONFIG_MMC_SPI) += mmc_spi.o - -diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c -new file mode 100644 -index 0000000..0b5ec58 ---- /dev/null -+++ b/drivers/mmc/host/atmel-mci.c -@@ -0,0 +1,1176 @@ ++config ATMEL_TCB_CLKSRC ++ bool "TC Block Clocksource" ++ depends on ATMEL_TCLIB && GENERIC_TIME ++ default y ++ help ++ Select this to get a high precision clocksource based on a ++ TC block with a 5+ MHz base clock rate. Two timer channels ++ are combined to make a single 32-bit timer. ++ ++ When GENERIC_CLOCKEVENTS is defined, the third timer channel ++ may be used as a clock event device supporting oneshot mode ++ (delays of up to two seconds) based on the 32 KiHz clock. ++ ++config ATMEL_TCB_CLKSRC_BLOCK ++ int ++ depends on ATMEL_TCB_CLKSRC ++ prompt "TC Block" if ARCH_AT91RM9200 || ARCH_AT91SAM9260 || CPU_AT32AP700X ++ default 0 ++ range 0 1 ++ help ++ Some chips provide more than one TC block, so you have the ++ choice of which one to use for the clock framework. The other ++ TC can be used for other purposes, such as PWM generation and ++ interval timing. ++ + config IBM_ASM + tristate "Device driver for IBM RSA service processor" + depends on X86 && PCI && INPUT && EXPERIMENTAL +diff -urN linux-2.6.24.3/drivers/misc/Makefile avr32-2.6/drivers/misc/Makefile +--- linux-2.6.24.3/drivers/misc/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/misc/Makefile 2008-04-23 20:12:41.000000000 +0200 +@@ -7,7 +7,9 @@ + obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ + obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o + obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o ++obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o + obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o ++obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o + obj-$(CONFIG_LKDTM) += lkdtm.o + obj-$(CONFIG_TIFM_CORE) += tifm_core.o + obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o +diff -urN linux-2.6.24.3/drivers/mmc/host/atmel-mci.c avr32-2.6/drivers/mmc/host/atmel-mci.c +--- linux-2.6.24.3/drivers/mmc/host/atmel-mci.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/mmc/host/atmel-mci.c 2008-04-23 20:12:41.000000000 +0200 +@@ -0,0 +1,1220 @@ +/* + * Atmel MultiMedia Card Interface driver + * @@ -12503,7 +14186,6 @@ index 0000000..0b5ec58 + EVENT_STOP_COMPLETE, + EVENT_DMA_COMPLETE, + EVENT_DMA_ERROR, -+ EVENT_CARD_DETECT, +}; + +struct atmel_mci_dma { @@ -12534,6 +14216,9 @@ index 0000000..0b5ec58 + int detect_pin; + int wp_pin; + ++ /* For detect pin debouncing */ ++ struct timer_list detect_timer; ++ + unsigned long bus_hz; + unsigned long mapbase; + struct clk *mck; @@ -12572,8 +14257,6 @@ index 0000000..0b5ec58 + test_bit(EVENT_DMA_COMPLETE, &host->completed_events) +#define mci_dma_error_is_complete(host) \ + test_bit(EVENT_DMA_ERROR, &host->completed_events) -+#define mci_card_detect_is_complete(host) \ -+ test_bit(EVENT_CARD_DETECT, &host->completed_events) + +/* Test and clear bit macros for pending events */ +#define mci_clear_cmd_is_pending(host) \ @@ -12588,8 +14271,6 @@ index 0000000..0b5ec58 + test_and_clear_bit(EVENT_STOP_COMPLETE, &host->pending_events) +#define mci_clear_dma_error_is_pending(host) \ + test_and_clear_bit(EVENT_DMA_ERROR, &host->pending_events) -+#define mci_clear_card_detect_is_pending(host) \ -+ test_and_clear_bit(EVENT_CARD_DETECT, &host->pending_events) + +/* Test and set bit macros for completed events */ +#define mci_set_cmd_is_completed(host) \ @@ -12604,8 +14285,6 @@ index 0000000..0b5ec58 + test_and_set_bit(EVENT_STOP_COMPLETE, &host->completed_events) +#define mci_set_dma_error_is_completed(host) \ + test_and_set_bit(EVENT_DMA_ERROR, &host->completed_events) -+#define mci_set_card_detect_is_completed(host) \ -+ test_and_set_bit(EVENT_CARD_DETECT, &host->completed_events) + +/* Set bit macros for completed events */ +#define mci_set_cmd_complete(host) \ @@ -12622,8 +14301,6 @@ index 0000000..0b5ec58 + set_bit(EVENT_DMA_COMPLETE, &host->completed_events) +#define mci_set_dma_error_complete(host) \ + set_bit(EVENT_DMA_ERROR, &host->completed_events) -+#define mci_set_card_detect_complete(host) \ -+ set_bit(EVENT_CARD_DETECT, &host->completed_events) + +/* Set bit macros for pending events */ +#define mci_set_cmd_pending(host) \ @@ -12638,8 +14315,6 @@ index 0000000..0b5ec58 + set_bit(EVENT_STOP_COMPLETE, &host->pending_events) +#define mci_set_dma_error_pending(host) \ + set_bit(EVENT_DMA_ERROR, &host->pending_events) -+#define mci_set_card_detect_pending(host) \ -+ set_bit(EVENT_CARD_DETECT, &host->pending_events) + +/* Clear bit macros for pending events */ +#define mci_clear_cmd_pending(host) \ @@ -12654,8 +14329,6 @@ index 0000000..0b5ec58 + clear_bit(EVENT_STOP_COMPLETE, &host->pending_events) +#define mci_clear_dma_error_pending(host) \ + clear_bit(EVENT_DMA_ERROR, &host->pending_events) -+#define mci_clear_card_detect_pending(host) \ -+ clear_bit(EVENT_CARD_DETECT, &host->pending_events) + + +#ifdef CONFIG_DEBUG_FS @@ -13024,6 +14697,21 @@ index 0000000..0b5ec58 + mci_readl(host, IMR)); + + WARN_ON(host->mrq != NULL); ++ ++ /* ++ * We may "know" the card is gone even though there's still an ++ * electrical connection. If so, we really need to communicate ++ * this to the MMC core since there won't be any more ++ * interrupts as the card is completely removed. Otherwise, ++ * the MMC core might believe the card is still there even ++ * though the card was just removed very slowly. ++ */ ++ if (!host->present) { ++ mrq->cmd->error = -ENOMEDIUM; ++ mmc_request_done(mmc, mrq); ++ return; ++ } ++ + host->mrq = mrq; + host->pending_events = 0; + host->completed_events = 0; @@ -13061,7 +14749,7 @@ index 0000000..0b5ec58 + u32 clkdiv; + + /* Set clock rate */ -+ clkdiv = host->bus_hz / (2 * ios->clock) - 1; ++ clkdiv = DIV_ROUND_UP(host->bus_hz, 2 * ios->clock) - 1; + if (clkdiv > 255) { + dev_warn(&mmc->class_dev, + "clock %u too slow; using %lu\n", @@ -13193,6 +14881,61 @@ index 0000000..0b5ec58 + } +} + ++static void atmci_detect_change(unsigned long data) ++{ ++ struct atmel_mci *host = (struct atmel_mci *)data; ++ struct mmc_request *mrq = host->mrq; ++ int present; ++ ++ /* ++ * atmci_remove() sets detect_pin to -1 before freeing the ++ * interrupt. We must not re-enable the interrupt if it has ++ * been freed. ++ */ ++ smp_rmb(); ++ if (host->detect_pin < 0) ++ return; ++ ++ enable_irq(gpio_to_irq(host->detect_pin)); ++ present = !gpio_get_value(host->detect_pin); ++ ++ dev_vdbg(&host->pdev->dev, "detect change: %d (was %d)\n", ++ present, host->present); ++ ++ if (present != host->present) { ++ dev_dbg(&host->mmc->class_dev, "card %s\n", ++ present ? "inserted" : "removed"); ++ host->present = present; ++ ++ /* Reset controller if card is gone */ ++ if (!present) { ++ mci_writel(host, CR, MCI_BIT(SWRST)); ++ mci_writel(host, IDR, ~0UL); ++ mci_writel(host, CR, MCI_BIT(MCIEN)); ++ } ++ ++ /* Clean up queue if present */ ++ if (mrq) { ++ if (!mci_cmd_is_complete(host)) ++ mrq->cmd->error = -ENOMEDIUM; ++ if (mrq->data && !mci_data_is_complete(host) ++ && !mci_data_error_is_complete(host)) { ++ dma_stop_request(host->dma.req.req.dmac, ++ host->dma.req.req.channel); ++ host->data->error = -ENOMEDIUM; ++ atmci_data_complete(host, host->data); ++ } ++ if (mrq->stop && !mci_stop_is_complete(host)) ++ mrq->stop->error = -ENOMEDIUM; ++ ++ host->cmd = NULL; ++ atmci_request_end(host->mmc, mrq); ++ } ++ ++ mmc_detect_change(host->mmc, 0); ++ } ++} ++ +static void atmci_tasklet_func(unsigned long priv) +{ + struct mmc_host *mmc = (struct mmc_host *)priv; @@ -13270,33 +15013,6 @@ index 0000000..0b5ec58 + data->bytes_xfered = data->blocks * data->blksz; + atmci_data_complete(host, data); + } -+ if (mci_clear_card_detect_is_pending(host)) { -+ /* Reset controller if card is gone */ -+ if (!host->present) { -+ mci_writel(host, CR, MCI_BIT(SWRST)); -+ mci_writel(host, IDR, ~0UL); -+ mci_writel(host, CR, MCI_BIT(MCIEN)); -+ } -+ -+ /* Clean up queue if present */ -+ if (mrq) { -+ if (!mci_cmd_is_complete(host)) -+ mrq->cmd->error = -ETIMEDOUT; -+ if (mrq->data && !mci_data_is_complete(host) -+ && !mci_data_error_is_complete(host)) { -+ dma_stop_request(host->dma.req.req.dmac, -+ host->dma.req.req.channel); -+ host->data->error = -ETIMEDOUT; -+ atmci_data_complete(host, data); -+ } -+ if (mrq->stop && !mci_stop_is_complete(host)) -+ mrq->stop->error = -ETIMEDOUT; -+ -+ host->cmd = NULL; -+ atmci_request_end(mmc, mrq); -+ } -+ mmc_detect_change(host->mmc, msecs_to_jiffies(100)); -+ } +} + +static void atmci_cmd_interrupt(struct mmc_host *mmc, u32 status) @@ -13320,9 +15036,11 @@ index 0000000..0b5ec58 + host->stop_status = status; + mci_set_stop_pending(host); + } else { -+ if (host->mrq->stop && mci_dma_is_complete(host) ++ struct mmc_request *mrq = host->mrq; ++ ++ if (mrq->stop && mci_dma_is_complete(host) + && !mci_set_stop_sent_is_completed(host)) -+ send_stop_cmd(host->mmc, host->data, 0); ++ send_stop_cmd(host->mmc, mrq->data, 0); + host->cmd_status = status; + mci_set_cmd_pending(host); + } @@ -13419,20 +15137,19 @@ index 0000000..0b5ec58 + return IRQ_HANDLED; +} + -+static irqreturn_t atmci_detect_change(int irq, void *dev_id) ++static irqreturn_t atmci_detect_interrupt(int irq, void *dev_id) +{ + struct mmc_host *mmc = dev_id; + struct atmel_mci *host = mmc_priv(mmc); + -+ int present = !gpio_get_value(irq_to_gpio(irq)); ++ /* ++ * Disable interrupts until the pin has stabilized and check ++ * the state then. Use mod_timer() since we may be in the ++ * middle of the timer routine when this interrupt triggers. ++ */ ++ disable_irq_nosync(irq); ++ mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(20)); + -+ if (present != host->present) { -+ dev_dbg(&mmc->class_dev, "card %s\n", -+ present ? "inserted" : "removed"); -+ host->present = present; -+ mci_set_card_detect_pending(host); -+ tasklet_schedule(&host->tasklet); -+ } + return IRQ_HANDLED; +} + @@ -13466,7 +15183,7 @@ index 0000000..0b5ec58 + host->wp_pin = board->wp_pin; + } else { + host->detect_pin = -1; -+ host->detect_pin = -1; ++ host->wp_pin = -1; + } + + host->mck = clk_get(&pdev->dev, "mci_clk"); @@ -13541,8 +15258,11 @@ index 0000000..0b5ec58 + mmc_add_host(mmc); + + if (host->detect_pin >= 0) { ++ setup_timer(&host->detect_timer, atmci_detect_change, ++ (unsigned long)host); ++ + ret = request_irq(gpio_to_irq(host->detect_pin), -+ atmci_detect_change, ++ atmci_detect_interrupt, + IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + DRIVER_NAME, mmc); + if (ret) { @@ -13587,9 +15307,16 @@ index 0000000..0b5ec58 + atmci_cleanup_debugfs(host); + + if (host->detect_pin >= 0) { -+ free_irq(gpio_to_irq(host->detect_pin), host->mmc); ++ int pin = host->detect_pin; ++ ++ /* Make sure our timer doesn't enable the interrupt */ ++ host->detect_pin = -1; ++ smp_wmb(); ++ ++ free_irq(gpio_to_irq(pin), host->mmc); ++ del_timer_sync(&host->detect_timer); + cancel_delayed_work(&host->mmc->detect); -+ gpio_free(host->detect_pin); ++ gpio_free(pin); + } + + mmc_remove_host(host->mmc); @@ -13638,11 +15365,9 @@ index 0000000..0b5ec58 + +MODULE_DESCRIPTION("Atmel Multimedia Card Interface driver"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/mmc/host/atmel-mci.h b/drivers/mmc/host/atmel-mci.h -new file mode 100644 -index 0000000..60d15c4 ---- /dev/null -+++ b/drivers/mmc/host/atmel-mci.h +diff -urN linux-2.6.24.3/drivers/mmc/host/atmel-mci.h avr32-2.6/drivers/mmc/host/atmel-mci.h +--- linux-2.6.24.3/drivers/mmc/host/atmel-mci.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/mmc/host/atmel-mci.h 2008-04-23 19:33:40.000000000 +0200 @@ -0,0 +1,192 @@ +/* + * Atmel MultiMedia Card Interface driver @@ -13836,10 +15561,40 @@ index 0000000..60d15c4 + __raw_writel((value), (port)->regs + MCI_##reg) + +#endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ -diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c -index 1707f98..d2ec6eb 100644 ---- a/drivers/mtd/chips/cfi_cmdset_0001.c -+++ b/drivers/mtd/chips/cfi_cmdset_0001.c +diff -urN linux-2.6.24.3/drivers/mmc/host/Kconfig avr32-2.6/drivers/mmc/host/Kconfig +--- linux-2.6.24.3/drivers/mmc/host/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/mmc/host/Kconfig 2008-04-23 19:33:40.000000000 +0200 +@@ -91,6 +91,16 @@ + + If unsure, say N. + ++config MMC_ATMELMCI ++ tristate "Atmel Multimedia Card Interface support" ++ depends on AVR32 && MMC ++ help ++ This selects the Atmel Multimedia Card Interface. If you have ++ a AT91 (ARM) or AT32 (AVR32) platform with a Multimedia Card ++ slot, say Y or M here. ++ ++ If unsure, say N. ++ + config MMC_IMX + tristate "Motorola i.MX Multimedia Card Interface support" + depends on ARCH_IMX +diff -urN linux-2.6.24.3/drivers/mmc/host/Makefile avr32-2.6/drivers/mmc/host/Makefile +--- linux-2.6.24.3/drivers/mmc/host/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/mmc/host/Makefile 2008-04-23 19:33:40.000000000 +0200 +@@ -15,6 +15,7 @@ + obj-$(CONFIG_MMC_AU1X) += au1xmmc.o + obj-$(CONFIG_MMC_OMAP) += omap.o + obj-$(CONFIG_MMC_AT91) += at91_mci.o ++obj-$(CONFIG_MMC_ATMELMCI) += atmel-mci.o + obj-$(CONFIG_MMC_TIFM_SD) += tifm_sd.o + obj-$(CONFIG_MMC_SPI) += mmc_spi.o + +diff -urN linux-2.6.24.3/drivers/mtd/chips/cfi_cmdset_0001.c avr32-2.6/drivers/mtd/chips/cfi_cmdset_0001.c +--- linux-2.6.24.3/drivers/mtd/chips/cfi_cmdset_0001.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/mtd/chips/cfi_cmdset_0001.c 2008-04-23 20:12:41.000000000 +0200 @@ -50,6 +50,7 @@ #define I82802AC 0x00ac #define MANUFACTURER_ST 0x0020 @@ -13848,7 +15603,7 @@ index 1707f98..d2ec6eb 100644 static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -@@ -157,6 +158,47 @@ static void cfi_tell_features(struct cfi_pri_intelext *extp) +@@ -157,6 +158,47 @@ } #endif @@ -13896,7 +15651,7 @@ index 1707f98..d2ec6eb 100644 #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE /* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) -@@ -234,6 +276,7 @@ static void fixup_use_powerup_lock(struct mtd_info *mtd, void *param) +@@ -234,6 +276,7 @@ } static struct cfi_fixup cfi_fixup_table[] = { @@ -13904,11 +15659,10 @@ index 1707f98..d2ec6eb 100644 #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, #endif -diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c -index 389acc6..571226e 100644 ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -185,6 +185,10 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) +diff -urN linux-2.6.24.3/drivers/mtd/chips/cfi_cmdset_0002.c avr32-2.6/drivers/mtd/chips/cfi_cmdset_0002.c +--- linux-2.6.24.3/drivers/mtd/chips/cfi_cmdset_0002.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/mtd/chips/cfi_cmdset_0002.c 2008-04-23 20:12:41.000000000 +0200 +@@ -185,6 +185,10 @@ extp->TopBottom = 2; else extp->TopBottom = 3; @@ -13919,7 +15673,7 @@ index 389acc6..571226e 100644 } static void fixup_use_secsi(struct mtd_info *mtd, void *param) -@@ -217,6 +221,7 @@ static void fixup_use_atmel_lock(struct mtd_info *mtd, void *param) +@@ -217,6 +221,7 @@ } static struct cfi_fixup cfi_fixup_table[] = { @@ -13927,7 +15681,7 @@ index 389acc6..571226e 100644 #ifdef AMD_BOOTLOC_BUG { CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock, NULL }, #endif -@@ -229,7 +234,6 @@ static struct cfi_fixup cfi_fixup_table[] = { +@@ -229,7 +234,6 @@ #if !FORCE_WORD_WRITE { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, #endif @@ -13935,41 +15689,21 @@ index 389acc6..571226e 100644 { 0, 0, NULL, NULL } }; static struct cfi_fixup jedec_fixup_table[] = { -diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig -index 519b4ff..847f983 100644 ---- a/drivers/pcmcia/Kconfig -+++ b/drivers/pcmcia/Kconfig -@@ -276,6 +276,13 @@ config ELECTRA_CF - Say Y here to support the CompactFlash controller on the - PA Semi Electra eval board. - -+config AT32_CF -+ tristate "AT32AP CompactFlash Controller" -+ depends on PCMCIA && AVR32 && PLATFORM_AT32AP -+ help -+ Say Y here to support the CompactFlash controller on AT32 chips. -+ Or choose M to compile the driver as a module named "at32_cf". -+ - config PCCARD_NONSTATIC - tristate - -diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile -index 6f6478b..3526fd8 100644 ---- a/drivers/pcmcia/Makefile -+++ b/drivers/pcmcia/Makefile -@@ -38,6 +38,7 @@ obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o - obj-$(CONFIG_OMAP_CF) += omap_cf.o - obj-$(CONFIG_AT91_CF) += at91_cf.o - obj-$(CONFIG_ELECTRA_CF) += electra_cf.o -+obj-$(CONFIG_AT32_CF) += at32_cf.o - - sa11xx_core-y += soc_common.o sa11xx_base.o - pxa2xx_core-y += soc_common.o pxa2xx_base.o -diff --git a/drivers/pcmcia/at32_cf.c b/drivers/pcmcia/at32_cf.c -new file mode 100644 -index 0000000..010bdfd ---- /dev/null -+++ b/drivers/pcmcia/at32_cf.c +diff -urN linux-2.6.24.3/drivers/net/macb.c avr32-2.6/drivers/net/macb.c +--- linux-2.6.24.3/drivers/net/macb.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/net/macb.c 2008-04-23 20:12:41.000000000 +0200 +@@ -148,7 +148,7 @@ + + if (phydev->duplex) + reg |= MACB_BIT(FD); +- if (phydev->speed) ++ if (phydev->speed == SPEED_100) + reg |= MACB_BIT(SPD); + + macb_writel(bp, NCFGR, reg); +diff -urN linux-2.6.24.3/drivers/pcmcia/at32_cf.c avr32-2.6/drivers/pcmcia/at32_cf.c +--- linux-2.6.24.3/drivers/pcmcia/at32_cf.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/drivers/pcmcia/at32_cf.c 2008-04-23 19:33:42.000000000 +0200 @@ -0,0 +1,533 @@ +/* + * Driver for AVR32 Static Memory Controller: CompactFlash support @@ -14504,36 +16238,37 @@ index 0000000..010bdfd +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Driver for SMC PCMCIA interface"); +MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); -diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig -index d7e1996..67bfbb0 100644 ---- a/drivers/serial/Kconfig -+++ b/drivers/serial/Kconfig -@@ -380,6 +380,21 @@ config SERIAL_ATMEL_CONSOLE - console is the device which receives all kernel messages and - warnings and which allows logins in single user mode). +diff -urN linux-2.6.24.3/drivers/pcmcia/Kconfig avr32-2.6/drivers/pcmcia/Kconfig +--- linux-2.6.24.3/drivers/pcmcia/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/pcmcia/Kconfig 2008-04-23 19:33:42.000000000 +0200 +@@ -276,6 +276,13 @@ + Say Y here to support the CompactFlash controller on the + PA Semi Electra eval board. -+config SERIAL_ATMEL_PDC -+ bool "Support DMA transfers on AT91 / AT32 serial port" -+ depends on SERIAL_ATMEL -+ default y ++config AT32_CF ++ tristate "AT32AP CompactFlash Controller" ++ depends on PCMCIA && AVR32 && PLATFORM_AT32AP + help -+ Say Y here if you wish to use the PDC to do DMA transfers to -+ and from the Atmel AT91 / AT32 serial port. In order to -+ actually use DMA transfers, make sure that the use_dma_tx -+ and use_dma_rx members in the atmel_uart_data struct is set -+ appropriately for each port. -+ -+ Note that break and error handling currently doesn't work -+ properly when DMA is enabled. Make sure that ports where -+ this matters don't use DMA. ++ Say Y here to support the CompactFlash controller on AT32 chips. ++ Or choose M to compile the driver as a module named "at32_cf". + - config SERIAL_ATMEL_TTYAT - bool "Install as device ttyATn instead of ttySn" - depends on SERIAL_ATMEL=y -diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c -index 111da57..477950f 100644 ---- a/drivers/serial/atmel_serial.c -+++ b/drivers/serial/atmel_serial.c + config PCCARD_NONSTATIC + tristate + +diff -urN linux-2.6.24.3/drivers/pcmcia/Makefile avr32-2.6/drivers/pcmcia/Makefile +--- linux-2.6.24.3/drivers/pcmcia/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/pcmcia/Makefile 2008-04-23 19:33:42.000000000 +0200 +@@ -38,6 +38,7 @@ + obj-$(CONFIG_OMAP_CF) += omap_cf.o + obj-$(CONFIG_AT91_CF) += at91_cf.o + obj-$(CONFIG_ELECTRA_CF) += electra_cf.o ++obj-$(CONFIG_AT32_CF) += at32_cf.o + + sa11xx_core-y += soc_common.o sa11xx_base.o + pxa2xx_core-y += soc_common.o pxa2xx_base.o +diff -urN linux-2.6.24.3/drivers/serial/atmel_serial.c avr32-2.6/drivers/serial/atmel_serial.c +--- linux-2.6.24.3/drivers/serial/atmel_serial.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/serial/atmel_serial.c 2008-04-23 20:12:44.000000000 +0200 @@ -7,6 +7,8 @@ * Based on drivers/char/serial_sa1100.c, by Deep Blue Solutions Ltd. * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. @@ -14543,26 +16278,28 @@ index 111da57..477950f 100644 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or -@@ -33,6 +35,7 @@ +@@ -33,7 +35,9 @@ #include <linux/sysrq.h> #include <linux/tty_flip.h> #include <linux/platform_device.h> +#include <linux/dma-mapping.h> #include <linux/atmel_pdc.h> ++#include <linux/atmel_serial.h> #include <asm/io.h> -@@ -47,6 +50,10 @@ - #include "atmel_serial.h" +@@ -45,7 +49,9 @@ + #include <asm/arch/gpio.h> + #endif +-#include "atmel_serial.h" +#define PDC_BUFFER_SIZE 512 +/* Revisit: We should calculate this based on the actual port settings */ +#define PDC_RX_TIMEOUT (3 * 10) /* 3 bytes */ -+ + #if defined(CONFIG_SERIAL_ATMEL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ - #endif -@@ -74,6 +81,7 @@ +@@ -74,6 +80,7 @@ #define ATMEL_ISR_PASS_LIMIT 256 @@ -14570,7 +16307,7 @@ index 111da57..477950f 100644 #define UART_PUT_CR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_CR) #define UART_GET_MR(port) __raw_readl((port)->membase + ATMEL_US_MR) #define UART_PUT_MR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_MR) -@@ -87,8 +95,6 @@ +@@ -87,8 +94,6 @@ #define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) #define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) @@ -14579,7 +16316,7 @@ index 111da57..477950f 100644 /* PDC registers */ #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) #define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR) -@@ -101,12 +107,24 @@ +@@ -101,12 +106,24 @@ #define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) #define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) @@ -14606,7 +16343,7 @@ index 111da57..477950f 100644 /* * We wrap our port structure around the generic uart_port. */ -@@ -115,6 +133,19 @@ struct atmel_uart_port { +@@ -115,6 +132,19 @@ struct clk *clk; /* uart clock */ unsigned short suspended; /* is port suspended? */ int break_active; /* break being received */ @@ -14626,7 +16363,7 @@ index 111da57..477950f 100644 }; static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; -@@ -123,6 +154,38 @@ static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; +@@ -123,6 +153,38 @@ static struct console atmel_console; #endif @@ -14665,7 +16402,7 @@ index 111da57..477950f 100644 /* * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty. */ -@@ -142,8 +205,8 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl) +@@ -142,8 +204,8 @@ #ifdef CONFIG_ARCH_AT91RM9200 if (cpu_is_at91rm9200()) { /* @@ -14676,7 +16413,7 @@ index 111da57..477950f 100644 */ if (port->mapbase == AT91RM9200_BASE_US0) { if (mctrl & TIOCM_RTS) -@@ -204,7 +267,12 @@ static u_int atmel_get_mctrl(struct uart_port *port) +@@ -204,7 +266,12 @@ */ static void atmel_stop_tx(struct uart_port *port) { @@ -14690,7 +16427,7 @@ index 111da57..477950f 100644 } /* -@@ -212,7 +280,17 @@ static void atmel_stop_tx(struct uart_port *port) +@@ -212,7 +279,17 @@ */ static void atmel_start_tx(struct uart_port *port) { @@ -14709,7 +16446,7 @@ index 111da57..477950f 100644 } /* -@@ -220,7 +298,12 @@ static void atmel_start_tx(struct uart_port *port) +@@ -220,7 +297,12 @@ */ static void atmel_stop_rx(struct uart_port *port) { @@ -14723,7 +16460,7 @@ index 111da57..477950f 100644 } /* -@@ -228,7 +311,8 @@ static void atmel_stop_rx(struct uart_port *port) +@@ -228,7 +310,8 @@ */ static void atmel_enable_ms(struct uart_port *port) { @@ -14733,7 +16470,7 @@ index 111da57..477950f 100644 } /* -@@ -243,22 +327,63 @@ static void atmel_break_ctl(struct uart_port *port, int break_state) +@@ -243,22 +326,63 @@ } /* @@ -14804,7 +16541,7 @@ index 111da57..477950f 100644 /* * note that the error handling code is * out of the main execution path -@@ -266,15 +391,14 @@ static void atmel_rx_chars(struct uart_port *port) +@@ -266,15 +390,14 @@ if (unlikely(status & (ATMEL_US_PARE | ATMEL_US_FRAME | ATMEL_US_OVRE | ATMEL_US_RXBRK) || atmel_port->break_active)) { @@ -14824,7 +16561,7 @@ index 111da57..477950f 100644 } else { /* * This is either the end-of-break -@@ -287,52 +411,30 @@ static void atmel_rx_chars(struct uart_port *port) +@@ -287,52 +410,30 @@ status &= ~ATMEL_US_RXBRK; atmel_port->break_active = 0; } @@ -14883,7 +16620,7 @@ index 111da57..477950f 100644 while (UART_GET_CSR(port) & ATMEL_US_TXRDY) { UART_PUT_CHAR(port, xmit->buf[xmit->tail]); -@@ -345,8 +447,88 @@ static void atmel_tx_chars(struct uart_port *port) +@@ -345,8 +446,88 @@ if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); @@ -14974,7 +16711,7 @@ index 111da57..477950f 100644 } /* -@@ -355,47 +537,255 @@ static void atmel_tx_chars(struct uart_port *port) +@@ -355,47 +536,255 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id) { struct uart_port *port = dev_id; @@ -15170,12 +16907,8 @@ index 111da57..477950f 100644 + + port->icount.rx += count; + pdc->ofs = head; - } - -- // TODO: All reads to CSR will clear these interrupts! -- if (pending & ATMEL_US_RIIC) port->icount.rng++; -- if (pending & ATMEL_US_DSRIC) port->icount.dsr++; -- if (pending & ATMEL_US_DCDIC) ++ } ++ + /* + * If the current buffer is full, we need to check if + * the next one contains any additional data. @@ -15187,7 +16920,7 @@ index 111da57..477950f 100644 + + rx_idx = !rx_idx; + atmel_port->pdc_rx_idx = rx_idx; -+ } + } + } while (head >= pdc->dma_size); + + /* @@ -15200,7 +16933,11 @@ index 111da57..477950f 100644 + + UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT); +} -+ + +- // TODO: All reads to CSR will clear these interrupts! +- if (pending & ATMEL_US_RIIC) port->icount.rng++; +- if (pending & ATMEL_US_DSRIC) port->icount.dsr++; +- if (pending & ATMEL_US_DCDIC) +/* + * tasklet handling tty stuff outside the interrupt handler. + */ @@ -15236,15 +16973,15 @@ index 111da57..477950f 100644 uart_handle_cts_change(port, !(status & ATMEL_US_CTS)); - if (pending & (ATMEL_US_RIIC | ATMEL_US_DSRIC | ATMEL_US_DCDIC | ATMEL_US_CTSIC)) - wake_up_interruptible(&port->info->delta_msr_wait); - +- - /* Interrupt transmit */ - if (pending & ATMEL_US_TXRDY) - atmel_tx_chars(port); -+ wake_up_interruptible(&port->info->delta_msr_wait); - if (pass_counter++ > ATMEL_ISR_PASS_LIMIT) - break; -- ++ wake_up_interruptible(&port->info->delta_msr_wait); + - status = UART_GET_CSR(port); - pending = status & UART_GET_IMR(port); + atmel_port->irq_status_prev = status; @@ -15260,7 +16997,7 @@ index 111da57..477950f 100644 } /* -@@ -403,6 +793,8 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id) +@@ -403,6 +792,8 @@ */ static int atmel_startup(struct uart_port *port) { @@ -15269,7 +17006,7 @@ index 111da57..477950f 100644 int retval; /* -@@ -415,13 +807,64 @@ static int atmel_startup(struct uart_port *port) +@@ -415,13 +806,64 @@ /* * Allocate the IRQ */ @@ -15335,7 +17072,7 @@ index 111da57..477950f 100644 * If there is a specific "open" function (to register * control line interrupts) */ -@@ -437,9 +880,21 @@ static int atmel_startup(struct uart_port *port) +@@ -437,9 +879,21 @@ * Finally, enable the serial port */ UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); @@ -15359,7 +17096,7 @@ index 111da57..477950f 100644 return 0; } -@@ -449,6 +904,38 @@ static int atmel_startup(struct uart_port *port) +@@ -449,6 +903,38 @@ */ static void atmel_shutdown(struct uart_port *port) { @@ -15398,7 +17135,7 @@ index 111da57..477950f 100644 /* * Disable all interrupts, port and break condition. */ -@@ -471,45 +958,48 @@ static void atmel_shutdown(struct uart_port *port) +@@ -471,45 +957,48 @@ /* * Power / Clock management. */ @@ -15469,7 +17206,7 @@ index 111da57..477950f 100644 quot /= 8; mode |= ATMEL_US_USCLKS_MCK_DIV8; } -@@ -536,18 +1026,17 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios * termios, +@@ -536,18 +1025,17 @@ /* parity */ if (termios->c_cflag & PARENB) { @@ -15492,7 +17229,7 @@ index 111da57..477950f 100644 mode |= ATMEL_US_PAR_NONE; spin_lock_irqsave(&port->lock, flags); -@@ -558,6 +1047,10 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios * termios, +@@ -558,6 +1046,10 @@ if (termios->c_iflag & (BRKINT | PARMRK)) port->read_status_mask |= ATMEL_US_RXBRK; @@ -15503,7 +17240,7 @@ index 111da57..477950f 100644 /* * Characters to ignore */ -@@ -573,16 +1066,16 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios * termios, +@@ -573,16 +1065,16 @@ if (termios->c_iflag & IGNPAR) port->ignore_status_mask |= ATMEL_US_OVRE; } @@ -15526,7 +17263,7 @@ index 111da57..477950f 100644 /* disable receiver and transmitter */ UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); -@@ -708,7 +1201,8 @@ static struct uart_ops atmel_pops = { +@@ -708,7 +1200,8 @@ /* * Configure the port from the platform device resource info. */ @@ -15536,7 +17273,7 @@ index 111da57..477950f 100644 { struct uart_port *port = &atmel_port->uart; struct atmel_uart_data *data = pdev->dev.platform_data; -@@ -723,6 +1217,11 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct +@@ -723,6 +1216,11 @@ port->mapbase = pdev->resource[0].start; port->irq = pdev->resource[1].start; @@ -15548,7 +17285,7 @@ index 111da57..477950f 100644 if (data->regs) /* Already mapped by setup code */ port->membase = data->regs; -@@ -731,11 +1230,17 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct +@@ -731,11 +1229,17 @@ port->membase = NULL; } @@ -15567,7 +17304,7 @@ index 111da57..477950f 100644 } /* -@@ -755,12 +1260,11 @@ void __init atmel_register_uart_fns(struct atmel_port_fns *fns) +@@ -755,12 +1259,11 @@ atmel_pops.set_wake = fns->set_wake; } @@ -15581,7 +17318,7 @@ index 111da57..477950f 100644 UART_PUT_CHAR(port, ch); } -@@ -773,38 +1277,40 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) +@@ -773,38 +1276,40 @@ unsigned int status, imr; /* @@ -15637,7 +17374,7 @@ index 111da57..477950f 100644 mr = UART_GET_MR(port) & ATMEL_US_CHRL; if (mr == ATMEL_US_CHRL_8) -@@ -824,7 +1330,6 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud, +@@ -824,7 +1329,6 @@ * lower than one of those, as it would make us fall through * to a much lower baud rate than we really want. */ @@ -15645,7 +17382,7 @@ index 111da57..477950f 100644 *baud = port->uartclk / (16 * (quot - 1)); } -@@ -836,10 +1341,12 @@ static int __init atmel_console_setup(struct console *co, char *options) +@@ -836,10 +1340,12 @@ int parity = 'n'; int flow = 'n'; @@ -15660,7 +17397,7 @@ index 111da57..477950f 100644 UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN); -@@ -871,13 +1378,16 @@ static struct console atmel_console = { +@@ -871,13 +1377,16 @@ static int __init atmel_console_init(void) { if (atmel_default_console_device) { @@ -15679,7 +17416,7 @@ index 111da57..477950f 100644 console_initcall(atmel_console_init); /* -@@ -885,34 +1395,48 @@ console_initcall(atmel_console_init); +@@ -885,34 +1394,48 @@ */ static int __init atmel_late_console_init(void) { @@ -15739,7 +17476,7 @@ index 111da57..477950f 100644 enable_irq_wake(port->irq); else { uart_suspend_port(&atmel_uart, port); -@@ -925,13 +1449,12 @@ static int atmel_serial_suspend(struct platform_device *pdev, pm_message_t state +@@ -925,13 +1448,12 @@ static int atmel_serial_resume(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); @@ -15755,7 +17492,7 @@ index 111da57..477950f 100644 disable_irq_wake(port->irq); return 0; -@@ -944,15 +1467,40 @@ static int atmel_serial_resume(struct platform_device *pdev) +@@ -944,15 +1466,40 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev) { struct atmel_uart_port *port; @@ -15799,7 +17536,7 @@ index 111da57..477950f 100644 } return ret; -@@ -961,19 +1509,21 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev) +@@ -961,19 +1508,21 @@ static int __devexit atmel_serial_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); @@ -15829,11 +17566,166 @@ index 111da57..477950f 100644 return ret; } -diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c -index ff10808..293b7ca 100644 ---- a/drivers/spi/atmel_spi.c -+++ b/drivers/spi/atmel_spi.c -@@ -51,7 +51,9 @@ struct atmel_spi { +diff -urN linux-2.6.24.3/drivers/serial/atmel_serial.h avr32-2.6/drivers/serial/atmel_serial.h +--- linux-2.6.24.3/drivers/serial/atmel_serial.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/serial/atmel_serial.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,127 +0,0 @@ +-/* +- * drivers/serial/atmel_serial.h +- * +- * Copyright (C) 2005 Ivan Kokshaysky +- * Copyright (C) SAN People +- * +- * USART registers. +- * Based on AT91RM9200 datasheet revision E. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- */ +- +-#ifndef ATMEL_SERIAL_H +-#define ATMEL_SERIAL_H +- +-#define ATMEL_US_CR 0x00 /* Control Register */ +-#define ATMEL_US_RSTRX (1 << 2) /* Reset Receiver */ +-#define ATMEL_US_RSTTX (1 << 3) /* Reset Transmitter */ +-#define ATMEL_US_RXEN (1 << 4) /* Receiver Enable */ +-#define ATMEL_US_RXDIS (1 << 5) /* Receiver Disable */ +-#define ATMEL_US_TXEN (1 << 6) /* Transmitter Enable */ +-#define ATMEL_US_TXDIS (1 << 7) /* Transmitter Disable */ +-#define ATMEL_US_RSTSTA (1 << 8) /* Reset Status Bits */ +-#define ATMEL_US_STTBRK (1 << 9) /* Start Break */ +-#define ATMEL_US_STPBRK (1 << 10) /* Stop Break */ +-#define ATMEL_US_STTTO (1 << 11) /* Start Time-out */ +-#define ATMEL_US_SENDA (1 << 12) /* Send Address */ +-#define ATMEL_US_RSTIT (1 << 13) /* Reset Iterations */ +-#define ATMEL_US_RSTNACK (1 << 14) /* Reset Non Acknowledge */ +-#define ATMEL_US_RETTO (1 << 15) /* Rearm Time-out */ +-#define ATMEL_US_DTREN (1 << 16) /* Data Terminal Ready Enable [AT91RM9200 only] */ +-#define ATMEL_US_DTRDIS (1 << 17) /* Data Terminal Ready Disable [AT91RM9200 only] */ +-#define ATMEL_US_RTSEN (1 << 18) /* Request To Send Enable */ +-#define ATMEL_US_RTSDIS (1 << 19) /* Request To Send Disable */ +- +-#define ATMEL_US_MR 0x04 /* Mode Register */ +-#define ATMEL_US_USMODE (0xf << 0) /* Mode of the USART */ +-#define ATMEL_US_USMODE_NORMAL 0 +-#define ATMEL_US_USMODE_RS485 1 +-#define ATMEL_US_USMODE_HWHS 2 +-#define ATMEL_US_USMODE_MODEM 3 +-#define ATMEL_US_USMODE_ISO7816_T0 4 +-#define ATMEL_US_USMODE_ISO7816_T1 6 +-#define ATMEL_US_USMODE_IRDA 8 +-#define ATMEL_US_USCLKS (3 << 4) /* Clock Selection */ +-#define ATMEL_US_USCLKS_MCK (0 << 4) +-#define ATMEL_US_USCLKS_MCK_DIV8 (1 << 4) +-#define ATMEL_US_USCLKS_SCK (3 << 4) +-#define ATMEL_US_CHRL (3 << 6) /* Character Length */ +-#define ATMEL_US_CHRL_5 (0 << 6) +-#define ATMEL_US_CHRL_6 (1 << 6) +-#define ATMEL_US_CHRL_7 (2 << 6) +-#define ATMEL_US_CHRL_8 (3 << 6) +-#define ATMEL_US_SYNC (1 << 8) /* Synchronous Mode Select */ +-#define ATMEL_US_PAR (7 << 9) /* Parity Type */ +-#define ATMEL_US_PAR_EVEN (0 << 9) +-#define ATMEL_US_PAR_ODD (1 << 9) +-#define ATMEL_US_PAR_SPACE (2 << 9) +-#define ATMEL_US_PAR_MARK (3 << 9) +-#define ATMEL_US_PAR_NONE (4 << 9) +-#define ATMEL_US_PAR_MULTI_DROP (6 << 9) +-#define ATMEL_US_NBSTOP (3 << 12) /* Number of Stop Bits */ +-#define ATMEL_US_NBSTOP_1 (0 << 12) +-#define ATMEL_US_NBSTOP_1_5 (1 << 12) +-#define ATMEL_US_NBSTOP_2 (2 << 12) +-#define ATMEL_US_CHMODE (3 << 14) /* Channel Mode */ +-#define ATMEL_US_CHMODE_NORMAL (0 << 14) +-#define ATMEL_US_CHMODE_ECHO (1 << 14) +-#define ATMEL_US_CHMODE_LOC_LOOP (2 << 14) +-#define ATMEL_US_CHMODE_REM_LOOP (3 << 14) +-#define ATMEL_US_MSBF (1 << 16) /* Bit Order */ +-#define ATMEL_US_MODE9 (1 << 17) /* 9-bit Character Length */ +-#define ATMEL_US_CLKO (1 << 18) /* Clock Output Select */ +-#define ATMEL_US_OVER (1 << 19) /* Oversampling Mode */ +-#define ATMEL_US_INACK (1 << 20) /* Inhibit Non Acknowledge */ +-#define ATMEL_US_DSNACK (1 << 21) /* Disable Successive NACK */ +-#define ATMEL_US_MAX_ITER (7 << 24) /* Max Iterations */ +-#define ATMEL_US_FILTER (1 << 28) /* Infrared Receive Line Filter */ +- +-#define ATMEL_US_IER 0x08 /* Interrupt Enable Register */ +-#define ATMEL_US_RXRDY (1 << 0) /* Receiver Ready */ +-#define ATMEL_US_TXRDY (1 << 1) /* Transmitter Ready */ +-#define ATMEL_US_RXBRK (1 << 2) /* Break Received / End of Break */ +-#define ATMEL_US_ENDRX (1 << 3) /* End of Receiver Transfer */ +-#define ATMEL_US_ENDTX (1 << 4) /* End of Transmitter Transfer */ +-#define ATMEL_US_OVRE (1 << 5) /* Overrun Error */ +-#define ATMEL_US_FRAME (1 << 6) /* Framing Error */ +-#define ATMEL_US_PARE (1 << 7) /* Parity Error */ +-#define ATMEL_US_TIMEOUT (1 << 8) /* Receiver Time-out */ +-#define ATMEL_US_TXEMPTY (1 << 9) /* Transmitter Empty */ +-#define ATMEL_US_ITERATION (1 << 10) /* Max number of Repetitions Reached */ +-#define ATMEL_US_TXBUFE (1 << 11) /* Transmission Buffer Empty */ +-#define ATMEL_US_RXBUFF (1 << 12) /* Reception Buffer Full */ +-#define ATMEL_US_NACK (1 << 13) /* Non Acknowledge */ +-#define ATMEL_US_RIIC (1 << 16) /* Ring Indicator Input Change [AT91RM9200 only] */ +-#define ATMEL_US_DSRIC (1 << 17) /* Data Set Ready Input Change [AT91RM9200 only] */ +-#define ATMEL_US_DCDIC (1 << 18) /* Data Carrier Detect Input Change [AT91RM9200 only] */ +-#define ATMEL_US_CTSIC (1 << 19) /* Clear to Send Input Change */ +-#define ATMEL_US_RI (1 << 20) /* RI */ +-#define ATMEL_US_DSR (1 << 21) /* DSR */ +-#define ATMEL_US_DCD (1 << 22) /* DCD */ +-#define ATMEL_US_CTS (1 << 23) /* CTS */ +- +-#define ATMEL_US_IDR 0x0c /* Interrupt Disable Register */ +-#define ATMEL_US_IMR 0x10 /* Interrupt Mask Register */ +-#define ATMEL_US_CSR 0x14 /* Channel Status Register */ +-#define ATMEL_US_RHR 0x18 /* Receiver Holding Register */ +-#define ATMEL_US_THR 0x1c /* Transmitter Holding Register */ +-#define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [AT91SAM9261 only] */ +- +-#define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */ +-#define ATMEL_US_CD (0xffff << 0) /* Clock Divider */ +- +-#define ATMEL_US_RTOR 0x24 /* Receiver Time-out Register */ +-#define ATMEL_US_TO (0xffff << 0) /* Time-out Value */ +- +-#define ATMEL_US_TTGR 0x28 /* Transmitter Timeguard Register */ +-#define ATMEL_US_TG (0xff << 0) /* Timeguard Value */ +- +-#define ATMEL_US_FIDI 0x40 /* FI DI Ratio Register */ +-#define ATMEL_US_NER 0x44 /* Number of Errors Register */ +-#define ATMEL_US_IF 0x4c /* IrDA Filter Register */ +- +-#endif +diff -urN linux-2.6.24.3/drivers/serial/Kconfig avr32-2.6/drivers/serial/Kconfig +--- linux-2.6.24.3/drivers/serial/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/serial/Kconfig 2008-04-23 20:12:44.000000000 +0200 +@@ -380,6 +380,21 @@ + console is the device which receives all kernel messages and + warnings and which allows logins in single user mode). + ++config SERIAL_ATMEL_PDC ++ bool "Support DMA transfers on AT91 / AT32 serial port" ++ depends on SERIAL_ATMEL ++ default y ++ help ++ Say Y here if you wish to use the PDC to do DMA transfers to ++ and from the Atmel AT91 / AT32 serial port. In order to ++ actually use DMA transfers, make sure that the use_dma_tx ++ and use_dma_rx members in the atmel_uart_data struct is set ++ appropriately for each port. ++ ++ Note that break and error handling currently doesn't work ++ properly when DMA is enabled. Make sure that ports where ++ this matters don't use DMA. ++ + config SERIAL_ATMEL_TTYAT + bool "Install as device ttyATn instead of ttySn" + depends on SERIAL_ATMEL=y +diff -urN linux-2.6.24.3/drivers/spi/atmel_spi.c avr32-2.6/drivers/spi/atmel_spi.c +--- linux-2.6.24.3/drivers/spi/atmel_spi.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/spi/atmel_spi.c 2008-04-23 20:12:44.000000000 +0200 +@@ -51,7 +51,9 @@ u8 stopping; struct list_head queue; struct spi_transfer *current_transfer; @@ -15844,7 +17736,24 @@ index ff10808..293b7ca 100644 void *buffer; dma_addr_t buffer_dma; -@@ -121,6 +123,48 @@ static void cs_deactivate(struct atmel_spi *as, struct spi_device *spi) +@@ -85,6 +87,16 @@ + unsigned gpio = (unsigned) spi->controller_data; + unsigned active = spi->mode & SPI_CS_HIGH; + u32 mr; ++ int i; ++ u32 csr; ++ u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0; ++ ++ /* Make sure clock polarity is correct */ ++ for (i = 0; i < spi->master->num_chipselect; i++) { ++ csr = spi_readl(as, CSR0 + 4 * i); ++ if ((csr ^ cpol) & SPI_BIT(CPOL)) ++ spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL)); ++ } + + mr = spi_readl(as, MR); + mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr); +@@ -121,6 +133,48 @@ gpio_set_value(gpio, !active); } @@ -15893,7 +17802,7 @@ index ff10808..293b7ca 100644 /* * Submit next transfer for DMA. * lock is held, spi irq is blocked -@@ -130,53 +174,78 @@ static void atmel_spi_next_xfer(struct spi_master *master, +@@ -130,53 +184,78 @@ { struct atmel_spi *as = spi_master_get_devdata(master); struct spi_transfer *xfer; @@ -15911,7 +17820,6 @@ index ff10808..293b7ca 100644 - struct spi_transfer, transfer_list); - as->remaining_bytes = xfer->len; - as->current_transfer = xfer; -- } + if (!as->current_transfer) + xfer = list_entry(msg->transfers.next, + struct spi_transfer, transfer_list); @@ -15920,31 +17828,15 @@ index ff10808..293b7ca 100644 + struct spi_transfer, transfer_list); + else + xfer = NULL; - -- len = as->remaining_bytes; ++ + if (xfer) { + len = xfer->len; + atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len); + remaining = xfer->len - len; - -- tx_dma = xfer->tx_dma + xfer->len - len; -- rx_dma = xfer->rx_dma + xfer->len - len; ++ + spi_writel(as, RPR, rx_dma); + spi_writel(as, TPR, tx_dma); - -- /* use scratch buffer only when rx or tx data is unspecified */ -- if (!xfer->rx_buf) { -- rx_dma = as->buffer_dma; -- if (len > BUFFER_SIZE) -- len = BUFFER_SIZE; -- } -- if (!xfer->tx_buf) { -- tx_dma = as->buffer_dma; -- if (len > BUFFER_SIZE) -- len = BUFFER_SIZE; -- memset(as->buffer, 0, len); -- dma_sync_single_for_device(&as->pdev->dev, -- as->buffer_dma, len, DMA_TO_DEVICE); ++ + if (msg->spi->bits_per_word > 8) + len >>= 1; + spi_writel(as, RCR, len); @@ -15959,14 +17851,12 @@ index ff10808..293b7ca 100644 + remaining = as->next_remaining_bytes; } -- spi_writel(as, RPR, rx_dma); -- spi_writel(as, TPR, tx_dma); +- len = as->remaining_bytes; + as->current_transfer = xfer; + as->current_remaining_bytes = remaining; -- as->remaining_bytes -= len; -- if (msg->spi->bits_per_word > 8) -- len >>= 1; +- tx_dma = xfer->tx_dma + xfer->len - len; +- rx_dma = xfer->rx_dma + xfer->len - len; + if (remaining > 0) + len = remaining; + else if (!atmel_spi_xfer_is_last(msg, xfer) @@ -15977,13 +17867,24 @@ index ff10808..293b7ca 100644 + } else + xfer = NULL; -- /* REVISIT: when xfer->delay_usecs == 0, the PDC "next transfer" -- * mechanism might help avoid the IRQ latency between transfers -- * (and improve the nCS0 errata handling on at91rm9200 chips) -- * -- * We're also waiting for ENDRX before we start the next +- /* use scratch buffer only when rx or tx data is unspecified */ +- if (!xfer->rx_buf) { +- rx_dma = as->buffer_dma; +- if (len > BUFFER_SIZE) +- len = BUFFER_SIZE; +- } +- if (!xfer->tx_buf) { +- tx_dma = as->buffer_dma; +- if (len > BUFFER_SIZE) +- len = BUFFER_SIZE; +- memset(as->buffer, 0, len); +- dma_sync_single_for_device(&as->pdev->dev, +- as->buffer_dma, len, DMA_TO_DEVICE); +- } + as->next_transfer = xfer; -+ + +- spi_writel(as, RPR, rx_dma); +- spi_writel(as, TPR, tx_dma); + if (xfer) { + total = len; + atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len); @@ -16005,12 +17906,21 @@ index ff10808..293b7ca 100644 + spi_writel(as, RNCR, 0); + spi_writel(as, TNCR, 0); + } -+ + +- as->remaining_bytes -= len; +- if (msg->spi->bits_per_word > 8) +- len >>= 1; +- +- /* REVISIT: when xfer->delay_usecs == 0, the PDC "next transfer" +- * mechanism might help avoid the IRQ latency between transfers +- * (and improve the nCS0 errata handling on at91rm9200 chips) +- * +- * We're also waiting for ENDRX before we start the next + /* REVISIT: We're waiting for ENDRX before we start the next * transfer because we need to handle some difficult timing * issues otherwise. If we wait for ENDTX in one transfer and * then starts waiting for ENDRX in the next, it's difficult -@@ -186,17 +255,7 @@ static void atmel_spi_next_xfer(struct spi_master *master, +@@ -186,17 +265,7 @@ * * It should be doable, though. Just not now... */ @@ -16028,7 +17938,7 @@ index ff10808..293b7ca 100644 spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN)); } -@@ -294,6 +353,7 @@ atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as, +@@ -294,6 +363,7 @@ spin_lock(&as->lock); as->current_transfer = NULL; @@ -16036,7 +17946,7 @@ index ff10808..293b7ca 100644 /* continue if needed */ if (list_empty(&as->queue) || as->stopping) -@@ -377,7 +437,7 @@ atmel_spi_interrupt(int irq, void *dev_id) +@@ -377,7 +447,7 @@ spi_writel(as, IDR, pending); @@ -16045,7 +17955,7 @@ index ff10808..293b7ca 100644 msg->actual_length += xfer->len; if (!msg->is_dma_mapped) -@@ -387,7 +447,7 @@ atmel_spi_interrupt(int irq, void *dev_id) +@@ -387,7 +457,7 @@ if (xfer->delay_usecs) udelay(xfer->delay_usecs); @@ -16054,7 +17964,7 @@ index ff10808..293b7ca 100644 /* report completed message */ atmel_spi_msg_done(master, as, msg, 0, xfer->cs_change); -@@ -490,9 +550,14 @@ static int atmel_spi_setup(struct spi_device *spi) +@@ -490,9 +560,14 @@ if (!(spi->mode & SPI_CPHA)) csr |= SPI_BIT(NCPHA); @@ -16072,10 +17982,255 @@ index ff10808..293b7ca 100644 /* chipselect must have been muxed as GPIO (e.g. in board setup) */ npcs_pin = (unsigned int)spi->controller_data; -diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c -index 7c30cc8..5e99671 100644 ---- a/drivers/video/atmel_lcdfb.c -+++ b/drivers/video/atmel_lcdfb.c +diff -urN linux-2.6.24.3/drivers/usb/gadget/atmel_usba_udc.c avr32-2.6/drivers/usb/gadget/atmel_usba_udc.c +--- linux-2.6.24.3/drivers/usb/gadget/atmel_usba_udc.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/usb/gadget/atmel_usba_udc.c 2008-04-23 20:12:45.000000000 +0200 +@@ -18,6 +18,7 @@ + #include <linux/platform_device.h> + #include <linux/usb/ch9.h> + #include <linux/usb/gadget.h> ++#include <linux/usb/atmel_usba_udc.h> + #include <linux/delay.h> + + #include <asm/gpio.h> +@@ -27,6 +28,7 @@ + + + static struct usba_udc the_udc; ++static struct usba_ep *usba_ep; + + #ifdef CONFIG_USB_GADGET_DEBUG_FS + #include <linux/debugfs.h> +@@ -324,53 +326,6 @@ + return 1; + } + +-static void copy_to_fifo(void __iomem *fifo, const void *buf, int len) +-{ +- unsigned long tmp; +- +- DBG(DBG_FIFO, "copy to FIFO (len %d):\n", len); +- for (; len > 0; len -= 4, buf += 4, fifo += 4) { +- tmp = *(unsigned long *)buf; +- if (len >= 4) { +- DBG(DBG_FIFO, " -> %08lx\n", tmp); +- __raw_writel(tmp, fifo); +- } else { +- do { +- DBG(DBG_FIFO, " -> %02lx\n", tmp >> 24); +- __raw_writeb(tmp >> 24, fifo); +- fifo++; +- tmp <<= 8; +- } while (--len); +- break; +- } +- } +-} +- +-static void copy_from_fifo(void *buf, void __iomem *fifo, int len) +-{ +- union { +- unsigned long *w; +- unsigned char *b; +- } p; +- unsigned long tmp; +- +- DBG(DBG_FIFO, "copy from FIFO (len %d):\n", len); +- for (p.w = buf; len > 0; len -= 4, p.w++, fifo += 4) { +- if (len >= 4) { +- tmp = __raw_readl(fifo); +- *p.w = tmp; +- DBG(DBG_FIFO, " -> %08lx\n", tmp); +- } else { +- do { +- tmp = __raw_readb(fifo); +- *p.b = tmp; +- DBG(DBG_FIFO, " -> %02lx\n", tmp); +- fifo++, p.b++; +- } while (--len); +- } +- } +-} +- + static void next_fifo_transaction(struct usba_ep *ep, struct usba_request *req) + { + unsigned int transaction_len; +@@ -387,7 +342,7 @@ + ep->ep.name, req, transaction_len, + req->last_transaction ? ", done" : ""); + +- copy_to_fifo(ep->fifo, req->req.buf + req->req.actual, transaction_len); ++ memcpy_toio(ep->fifo, req->req.buf + req->req.actual, transaction_len); + usba_ep_writel(ep, SET_STA, USBA_TX_PK_RDY); + req->req.actual += transaction_len; + } +@@ -476,7 +431,7 @@ + bytecount = req->req.length - req->req.actual; + } + +- copy_from_fifo(req->req.buf + req->req.actual, ++ memcpy_fromio(req->req.buf + req->req.actual, + ep->fifo, bytecount); + req->req.actual += bytecount; + +@@ -1029,33 +984,6 @@ + .set_selfpowered = usba_udc_set_selfpowered, + }; + +-#define EP(nam, idx, maxpkt, maxbk, dma, isoc) \ +-{ \ +- .ep = { \ +- .ops = &usba_ep_ops, \ +- .name = nam, \ +- .maxpacket = maxpkt, \ +- }, \ +- .udc = &the_udc, \ +- .queue = LIST_HEAD_INIT(usba_ep[idx].queue), \ +- .fifo_size = maxpkt, \ +- .nr_banks = maxbk, \ +- .index = idx, \ +- .can_dma = dma, \ +- .can_isoc = isoc, \ +-} +- +-static struct usba_ep usba_ep[] = { +- EP("ep0", 0, 64, 1, 0, 0), +- EP("ep1in-bulk", 1, 512, 2, 1, 1), +- EP("ep2out-bulk", 2, 512, 2, 1, 1), +- EP("ep3in-int", 3, 64, 3, 1, 0), +- EP("ep4out-int", 4, 64, 3, 1, 0), +- EP("ep5in-iso", 5, 1024, 3, 1, 1), +- EP("ep6out-iso", 6, 1024, 3, 1, 1), +-}; +-#undef EP +- + static struct usb_endpoint_descriptor usba_ep0_desc = { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, +@@ -1074,7 +1002,6 @@ + static struct usba_udc the_udc = { + .gadget = { + .ops = &usba_udc_ops, +- .ep0 = &usba_ep[0].ep, + .ep_list = LIST_HEAD_INIT(the_udc.gadget.ep_list), + .is_dualspeed = 1, + .name = "atmel_usba_udc", +@@ -1231,7 +1158,7 @@ + } else { + usba_ep_writel(ep, CTL_ENB, USBA_EPT_ENABLE); + usba_writel(udc, TST, USBA_TST_PKT_MODE); +- copy_to_fifo(ep->fifo, test_packet_buffer, ++ memcpy_toio(ep->fifo, test_packet_buffer, + sizeof(test_packet_buffer)); + usba_ep_writel(ep, SET_STA, USBA_TX_PK_RDY); + dev_info(dev, "Entering Test_Packet mode...\n"); +@@ -1539,7 +1466,7 @@ + } + + DBG(DBG_FIFO, "Copying ctrl request from 0x%p:\n", ep->fifo); +- copy_from_fifo(crq.data, ep->fifo, sizeof(crq)); ++ memcpy_fromio(crq.data, ep->fifo, sizeof(crq)); + + /* Free up one bank in the FIFO so that we can + * generate or receive a reply right away. */ +@@ -1911,7 +1838,7 @@ + + regs = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID); + fifo = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID); +- if (!regs || !fifo) ++ if (!regs || !fifo || !pdata) + return -ENXIO; + + irq = platform_get_irq(pdev, 0); +@@ -1959,16 +1886,44 @@ + usba_writel(udc, CTRL, 0); + clk_disable(pclk); + ++ usba_ep = kmalloc(sizeof(struct usba_ep) * pdata->num_ep, ++ GFP_KERNEL); ++ if (!usba_ep) ++ goto err_alloc_ep; ++ ++ the_udc.gadget.ep0 = &usba_ep[0].ep; ++ + INIT_LIST_HEAD(&usba_ep[0].ep.ep_list); + usba_ep[0].ep_regs = udc->regs + USBA_EPT_BASE(0); + usba_ep[0].dma_regs = udc->regs + USBA_DMA_BASE(0); + usba_ep[0].fifo = udc->fifo + USBA_FIFO_BASE(0); +- for (i = 1; i < ARRAY_SIZE(usba_ep); i++) { ++ usba_ep[0].ep.ops = &usba_ep_ops; ++ usba_ep[0].ep.name = pdata->ep[0].name; ++ usba_ep[0].ep.maxpacket = pdata->ep[0].fifo_size; ++ usba_ep[0].udc = &the_udc; ++ INIT_LIST_HEAD(&usba_ep[0].queue); ++ usba_ep[0].fifo_size = pdata->ep[0].fifo_size; ++ usba_ep[0].nr_banks = pdata->ep[0].nr_banks; ++ usba_ep[0].index = pdata->ep[0].index; ++ usba_ep[0].can_dma = pdata->ep[0].can_dma; ++ usba_ep[0].can_isoc = pdata->ep[0].can_isoc; ++ ++ for (i = 1; i < pdata->num_ep; i++) { + struct usba_ep *ep = &usba_ep[i]; + + ep->ep_regs = udc->regs + USBA_EPT_BASE(i); + ep->dma_regs = udc->regs + USBA_DMA_BASE(i); + ep->fifo = udc->fifo + USBA_FIFO_BASE(i); ++ ep->ep.ops = &usba_ep_ops; ++ ep->ep.name = pdata->ep[i].name; ++ ep->ep.maxpacket = pdata->ep[i].fifo_size; ++ ep->udc = &the_udc; ++ INIT_LIST_HEAD(&ep->queue); ++ ep->fifo_size = pdata->ep[i].fifo_size; ++ ep->nr_banks = pdata->ep[i].nr_banks; ++ ep->index = pdata->ep[i].index; ++ ep->can_dma = pdata->ep[i].can_dma; ++ ep->can_isoc = pdata->ep[i].can_isoc; + + list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); + } +@@ -1987,7 +1942,7 @@ + goto err_device_add; + } + +- if (pdata && pdata->vbus_pin != GPIO_PIN_NONE) { ++ if (pdata->vbus_pin >= 0) { + if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { + udc->vbus_pin = pdata->vbus_pin; + +@@ -2007,7 +1962,7 @@ + } + + usba_init_debugfs(udc); +- for (i = 1; i < ARRAY_SIZE(usba_ep); i++) ++ for (i = 1; i < pdata->num_ep; i++) + usba_ep_init_debugfs(udc, &usba_ep[i]); + + return 0; +@@ -2015,6 +1970,8 @@ + err_device_add: + free_irq(irq, udc); + err_request_irq: ++ kfree(usba_ep); ++err_alloc_ep: + iounmap(udc->fifo); + err_map_fifo: + iounmap(udc->regs); +@@ -2032,10 +1989,11 @@ + { + struct usba_udc *udc; + int i; ++ struct usba_platform_data *pdata = pdev->dev.platform_data; + + udc = platform_get_drvdata(pdev); + +- for (i = 1; i < ARRAY_SIZE(usba_ep); i++) ++ for (i = 1; i < pdata->num_ep; i++) + usba_ep_cleanup_debugfs(&usba_ep[i]); + usba_cleanup_debugfs(udc); + +diff -urN linux-2.6.24.3/drivers/video/atmel_lcdfb.c avr32-2.6/drivers/video/atmel_lcdfb.c +--- linux-2.6.24.3/drivers/video/atmel_lcdfb.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/video/atmel_lcdfb.c 2008-04-23 20:12:45.000000000 +0200 @@ -16,6 +16,7 @@ #include <linux/fb.h> #include <linux/init.h> @@ -16095,7 +18250,7 @@ index 7c30cc8..5e99671 100644 static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, struct fb_var_screeninfo *var) -@@ -69,12 +72,113 @@ static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, +@@ -69,12 +72,113 @@ } #endif @@ -16210,7 +18365,7 @@ index 7c30cc8..5e99671 100644 .ywrapstep = 0, .accel = FB_ACCEL_NONE, }; -@@ -148,6 +252,8 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) +@@ -148,6 +252,8 @@ return -ENOMEM; } @@ -16219,7 +18374,7 @@ index 7c30cc8..5e99671 100644 return 0; } -@@ -203,6 +309,26 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, +@@ -203,6 +309,26 @@ var->transp.offset = var->transp.length = 0; var->xoffset = var->yoffset = 0; @@ -16246,7 +18401,7 @@ index 7c30cc8..5e99671 100644 switch (var->bits_per_pixel) { case 1: case 2: -@@ -370,10 +496,6 @@ static int atmel_lcdfb_set_par(struct fb_info *info) +@@ -370,10 +496,6 @@ /* Disable all interrupts */ lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL); @@ -16257,7 +18412,7 @@ index 7c30cc8..5e99671 100644 /* ...wait for DMA engine to become idle... */ while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) msleep(10); -@@ -516,7 +638,6 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo) +@@ -516,7 +638,6 @@ struct fb_info *info = sinfo->info; int ret = 0; @@ -16265,7 +18420,7 @@ index 7c30cc8..5e99671 100644 info->var.activate |= FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW; dev_info(info->device, -@@ -577,6 +698,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) +@@ -577,6 +698,7 @@ sinfo->default_monspecs = pdata_sinfo->default_monspecs; sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; sinfo->guard_time = pdata_sinfo->guard_time; @@ -16273,7 +18428,7 @@ index 7c30cc8..5e99671 100644 } else { dev_err(dev, "cannot get default configuration\n"); goto free_info; -@@ -645,6 +767,11 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) +@@ -645,6 +767,11 @@ info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); if (!info->screen_base) goto release_intmem; @@ -16285,7 +18440,7 @@ index 7c30cc8..5e99671 100644 } else { /* alocate memory buffer */ ret = atmel_lcdfb_alloc_video_memory(sinfo); -@@ -670,6 +797,9 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) +@@ -670,6 +797,9 @@ goto release_mem; } @@ -16295,7 +18450,7 @@ index 7c30cc8..5e99671 100644 /* interrupt */ ret = request_irq(sinfo->irq_base, atmel_lcdfb_interrupt, 0, pdev->name, info); if (ret) { -@@ -721,6 +851,7 @@ free_cmap: +@@ -721,6 +851,7 @@ unregister_irqs: free_irq(sinfo->irq_base, info); unmap_mmio: @@ -16303,7 +18458,7 @@ index 7c30cc8..5e99671 100644 iounmap(sinfo->mmio); release_mem: release_mem_region(info->fix.mmio_start, info->fix.mmio_len); -@@ -755,6 +886,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev) +@@ -755,6 +886,7 @@ if (!sinfo) return 0; @@ -16311,7 +18466,7 @@ index 7c30cc8..5e99671 100644 if (sinfo->atmel_lcdfb_power_control) sinfo->atmel_lcdfb_power_control(0); unregister_framebuffer(info); -@@ -781,6 +913,9 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev) +@@ -781,6 +913,9 @@ static struct platform_driver atmel_lcdfb_driver = { .remove = __exit_p(atmel_lcdfb_remove), @@ -16321,11 +18476,10 @@ index 7c30cc8..5e99671 100644 .driver = { .name = "atmel_lcdfb", .owner = THIS_MODULE, -diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig -index 9609a6c..924e255 100644 ---- a/drivers/video/backlight/Kconfig -+++ b/drivers/video/backlight/Kconfig -@@ -50,6 +50,19 @@ config BACKLIGHT_CLASS_DEVICE +diff -urN linux-2.6.24.3/drivers/video/backlight/Kconfig avr32-2.6/drivers/video/backlight/Kconfig +--- linux-2.6.24.3/drivers/video/backlight/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/video/backlight/Kconfig 2008-04-23 20:12:45.000000000 +0200 +@@ -50,6 +50,19 @@ To have support for your specific LCD panel you will have to select the proper drivers which depend on this option. @@ -16345,11 +18499,10 @@ index 9609a6c..924e255 100644 config BACKLIGHT_CORGI tristate "Generic (aka Sharp Corgi) Backlight Driver" depends on BACKLIGHT_CLASS_DEVICE -diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig -index b87ed37..2b53d1f 100644 ---- a/drivers/video/console/Kconfig -+++ b/drivers/video/console/Kconfig -@@ -6,7 +6,7 @@ menu "Console display driver support" +diff -urN linux-2.6.24.3/drivers/video/console/Kconfig avr32-2.6/drivers/video/console/Kconfig +--- linux-2.6.24.3/drivers/video/console/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/video/console/Kconfig 2008-04-23 19:33:46.000000000 +0200 +@@ -6,7 +6,7 @@ config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 @@ -16358,11 +18511,10 @@ index b87ed37..2b53d1f 100644 default y help Saying Y here will allow you to use Linux in text mode through a -diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig -index 52dff40..fbd6112 100644 ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -223,7 +223,7 @@ config DAVINCI_WATCHDOG +diff -urN linux-2.6.24.3/drivers/watchdog/Kconfig avr32-2.6/drivers/watchdog/Kconfig +--- linux-2.6.24.3/drivers/watchdog/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/drivers/watchdog/Kconfig 2008-04-23 20:12:45.000000000 +0200 +@@ -223,7 +223,7 @@ config AT32AP700X_WDT tristate "AT32AP700x watchdog" @@ -16371,11 +18523,142 @@ index 52dff40..fbd6112 100644 help Watchdog timer embedded into AT32AP700x devices. This will reboot your system when the timeout is reached. -diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap7000.h -deleted file mode 100644 -index 3914d7b..0000000 ---- a/include/asm-avr32/arch-at32ap/at32ap7000.h -+++ /dev/null +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/at91rm9200.h avr32-2.6/include/asm-arm/arch-at91/at91rm9200.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/at91rm9200.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/at91rm9200.h 2008-04-23 19:33:48.000000000 +0200 +@@ -93,6 +93,11 @@ + #define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) /* Real-Time Clock */ + #define AT91_MC (0xffffff00 - AT91_BASE_SYS) /* Memory Controllers */ + ++#define AT91_USART0 AT91RM9200_BASE_US0 ++#define AT91_USART1 AT91RM9200_BASE_US1 ++#define AT91_USART2 AT91RM9200_BASE_US2 ++#define AT91_USART3 AT91RM9200_BASE_US3 ++ + #define AT91_MATRIX 0 /* not supported */ + + /* +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9260.h avr32-2.6/include/asm-arm/arch-at91/at91sam9260.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9260.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/at91sam9260.h 2008-04-23 19:33:48.000000000 +0200 +@@ -99,6 +99,13 @@ + #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) + #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) + ++#define AT91_USART0 AT91SAM9260_BASE_US0 ++#define AT91_USART1 AT91SAM9260_BASE_US1 ++#define AT91_USART2 AT91SAM9260_BASE_US2 ++#define AT91_USART3 AT91SAM9260_BASE_US3 ++#define AT91_USART4 AT91SAM9260_BASE_US4 ++#define AT91_USART5 AT91SAM9260_BASE_US5 ++ + + /* + * Internal Memory. +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9261.h avr32-2.6/include/asm-arm/arch-at91/at91sam9261.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9261.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/at91sam9261.h 2008-04-23 19:33:48.000000000 +0200 +@@ -84,6 +84,10 @@ + #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) + #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) + ++#define AT91_USART0 AT91SAM9261_BASE_US0 ++#define AT91_USART1 AT91SAM9261_BASE_US1 ++#define AT91_USART2 AT91SAM9261_BASE_US2 ++ + + /* + * Internal Memory. +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9263.h avr32-2.6/include/asm-arm/arch-at91/at91sam9263.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9263.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/at91sam9263.h 2008-04-23 19:33:48.000000000 +0200 +@@ -101,6 +101,10 @@ + #define AT91_RTT1 (0xfffffd50 - AT91_BASE_SYS) + #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) + ++#define AT91_USART0 AT91SAM9263_BASE_US0 ++#define AT91_USART1 AT91SAM9263_BASE_US1 ++#define AT91_USART2 AT91SAM9263_BASE_US2 ++ + #define AT91_SMC AT91_SMC0 + + /* +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9rl.h avr32-2.6/include/asm-arm/arch-at91/at91sam9rl.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/at91sam9rl.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/at91sam9rl.h 2008-04-23 19:33:48.000000000 +0200 +@@ -94,6 +94,11 @@ + #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) + #define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) + ++#define AT91_USART0 AT91SAM9RL_BASE_US0 ++#define AT91_USART1 AT91SAM9RL_BASE_US1 ++#define AT91_USART2 AT91SAM9RL_BASE_US2 ++#define AT91_USART3 AT91SAM9RL_BASE_US3 ++ + + /* + * Internal Memory. +diff -urN linux-2.6.24.3/include/asm-arm/arch-at91/uncompress.h avr32-2.6/include/asm-arm/arch-at91/uncompress.h +--- linux-2.6.24.3/include/asm-arm/arch-at91/uncompress.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-arm/arch-at91/uncompress.h 2008-04-23 19:33:48.000000000 +0200 +@@ -22,7 +22,23 @@ + #define __ASM_ARCH_UNCOMPRESS_H + + #include <asm/io.h> +-#include <asm/arch/at91_dbgu.h> ++#include <linux/atmel_serial.h> ++ ++#if defined(CONFIG_AT91_EARLY_DBGU) ++#define UART_OFFSET (AT91_DBGU + AT91_BASE_SYS) ++#elif defined(CONFIG_AT91_EARLY_USART0) ++#define UART_OFFSET AT91_USART0 ++#elif defined(CONFIG_AT91_EARLY_USART1) ++#define UART_OFFSET AT91_USART1 ++#elif defined(CONFIG_AT91_EARLY_USART2) ++#define UART_OFFSET AT91_USART2 ++#elif defined(CONFIG_AT91_EARLY_USART3) ++#define UART_OFFSET AT91_USART3 ++#elif defined(CONFIG_AT91_EARLY_USART4) ++#define UART_OFFSET AT91_USART4 ++#elif defined(CONFIG_AT91_EARLY_USART5) ++#define UART_OFFSET AT91_USART5 ++#endif + + /* + * The following code assumes the serial port has already been +@@ -33,22 +49,22 @@ + */ + static void putc(int c) + { +-#ifdef AT91_DBGU +- void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ ++#ifdef UART_OFFSET ++ void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */ + +- while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) ++ while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY)) + barrier(); +- __raw_writel(c, sys + AT91_DBGU_THR); ++ __raw_writel(c, sys + ATMEL_US_THR); + #endif + } + + static inline void flush(void) + { +-#ifdef AT91_DBGU +- void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ ++#ifdef UART_OFFSET ++ void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */ + + /* wait for transmission to complete */ +- while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY)) ++ while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY)) + barrier(); + #endif + } +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/at32ap7000.h avr32-2.6/include/asm-avr32/arch-at32ap/at32ap7000.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/at32ap7000.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/at32ap7000.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,35 +0,0 @@ -/* - * Pin definitions for AT32AP7000. @@ -16412,11 +18695,9 @@ index 3914d7b..0000000 -#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N)) - -#endif /* __ASM_ARCH_AT32AP7000_H__ */ -diff --git a/include/asm-avr32/arch-at32ap/at32ap700x.h b/include/asm-avr32/arch-at32ap/at32ap700x.h -new file mode 100644 -index 0000000..99684d6 ---- /dev/null -+++ b/include/asm-avr32/arch-at32ap/at32ap700x.h +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/at32ap700x.h avr32-2.6/include/asm-avr32/arch-at32ap/at32ap700x.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/at32ap700x.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/at32ap700x.h 2008-04-23 20:12:46.000000000 +0200 @@ -0,0 +1,35 @@ +/* + * Pin definitions for AT32AP7000. @@ -16453,11 +18734,21 @@ index 0000000..99684d6 +#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N)) + +#endif /* __ASM_ARCH_AT32AP700X_H__ */ -diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h -index d6993a6..8816b66 100644 ---- a/include/asm-avr32/arch-at32ap/board.h -+++ b/include/asm-avr32/arch-at32ap/board.h -@@ -51,6 +51,9 @@ struct platform_device * +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/board.h avr32-2.6/include/asm-avr32/arch-at32ap/board.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/board.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/board.h 2008-04-23 20:12:46.000000000 +0200 +@@ -38,9 +38,7 @@ + at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, + unsigned long fbmem_start, unsigned long fbmem_len); + +-struct usba_platform_data { +- int vbus_pin; +-}; ++struct usba_platform_data; + struct platform_device * + at32_add_device_usba(unsigned int id, struct usba_platform_data *data); + +@@ -51,6 +49,9 @@ at32_add_device_ide(unsigned int id, unsigned int extint, struct ide_platform_data *data); @@ -16467,11 +18758,16 @@ index d6993a6..8816b66 100644 /* depending on what's hooked up, not all SSC pins will be used */ #define ATMEL_SSC_TK 0x01 #define ATMEL_SSC_TF 0x02 -@@ -66,7 +69,13 @@ struct platform_device * +@@ -65,8 +66,17 @@ + struct platform_device * at32_add_device_ssc(unsigned int id, unsigned int flags); - struct platform_device *at32_add_device_twi(unsigned int id); +-struct platform_device *at32_add_device_twi(unsigned int id); -struct platform_device *at32_add_device_mci(unsigned int id); ++struct i2c_board_info; ++struct platform_device *at32_add_device_twi(unsigned int id, ++ struct i2c_board_info *b, ++ unsigned int n); + +struct mci_platform_data { + int detect_pin; @@ -16482,10 +18778,17 @@ index d6993a6..8816b66 100644 struct platform_device *at32_add_device_ac97c(unsigned int id); struct platform_device *at32_add_device_abdac(unsigned int id); -diff --git a/include/asm-avr32/arch-at32ap/cpu.h b/include/asm-avr32/arch-at32ap/cpu.h -index a762f42..0dc2026 100644 ---- a/include/asm-avr32/arch-at32ap/cpu.h -+++ b/include/asm-avr32/arch-at32ap/cpu.h +@@ -81,4 +91,7 @@ + at32_add_device_cf(unsigned int id, unsigned int extint, + struct cf_platform_data *data); + ++struct platform_device * ++at32_add_device_psif(unsigned int id); ++ + #endif /* __ASM_ARCH_BOARD_H */ +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/cpu.h avr32-2.6/include/asm-avr32/arch-at32ap/cpu.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/cpu.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/cpu.h 2008-04-23 20:12:46.000000000 +0200 @@ -14,7 +14,7 @@ * Only AT32AP7000 is defined for now. We can identify the specific * chip at runtime, but I'm not sure if it's really worth it. @@ -16495,10 +18798,9 @@ index a762f42..0dc2026 100644 # define cpu_is_at32ap7000() (1) #else # define cpu_is_at32ap7000() (0) -diff --git a/include/asm-avr32/arch-at32ap/io.h b/include/asm-avr32/arch-at32ap/io.h -index ee59e40..4ec6abc 100644 ---- a/include/asm-avr32/arch-at32ap/io.h -+++ b/include/asm-avr32/arch-at32ap/io.h +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/io.h avr32-2.6/include/asm-avr32/arch-at32ap/io.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/io.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/io.h 2008-04-23 19:33:48.000000000 +0200 @@ -4,7 +4,7 @@ /* For "bizarre" halfword swapping */ #include <linux/byteorder/swabb.h> @@ -16517,11 +18819,62 @@ index ee59e40..4ec6abc 100644 # define __swizzle_addr_b(addr) (addr ^ 1UL) # define __swizzle_addr_w(addr) (addr) # define __swizzle_addr_l(addr) (addr) -diff --git a/include/asm-avr32/arch-at32ap/portmux.h b/include/asm-avr32/arch-at32ap/portmux.h -index b1abe6b..135e034 100644 ---- a/include/asm-avr32/arch-at32ap/portmux.h -+++ b/include/asm-avr32/arch-at32ap/portmux.h -@@ -26,4 +26,16 @@ void at32_select_periph(unsigned int pin, unsigned int periph, +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/pm.h avr32-2.6/include/asm-avr32/arch-at32ap/pm.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/pm.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/pm.h 2008-04-23 20:12:46.000000000 +0200 +@@ -0,0 +1,48 @@ ++/* ++ * AVR32 AP Power Management. ++ * ++ * Copyright (C) 2008 Atmel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++#ifndef __ASM_AVR32_ARCH_PM_H ++#define __ASM_AVR32_ARCH_PM_H ++ ++/* Possible arguments to the "sleep" instruction */ ++#define CPU_SLEEP_IDLE 0 ++#define CPU_SLEEP_FROZEN 1 ++#define CPU_SLEEP_STANDBY 2 ++#define CPU_SLEEP_STOP 3 ++#define CPU_SLEEP_STATIC 5 ++ ++#ifndef __ASSEMBLY__ ++extern void cpu_enter_idle(void); ++ ++extern bool disable_idle_sleep; ++ ++static inline void cpu_disable_idle_sleep(void) ++{ ++ disable_idle_sleep = true; ++} ++ ++static inline void cpu_enable_idle_sleep(void) ++{ ++ disable_idle_sleep = false; ++} ++ ++static inline void cpu_idle_sleep(void) ++{ ++ /* ++ * If we're using the COUNT and COMPARE registers for ++ * timekeeping, we can't use the IDLE state. ++ */ ++ if (disable_idle_sleep) ++ cpu_relax(); ++ else ++ cpu_enter_idle(); ++} ++#endif ++ ++#endif /* __ASM_AVR32_ARCH_PM_H */ +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/portmux.h avr32-2.6/include/asm-avr32/arch-at32ap/portmux.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/portmux.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/portmux.h 2008-04-23 19:33:48.000000000 +0200 +@@ -26,4 +26,16 @@ void at32_select_gpio(unsigned int pin, unsigned long flags); void at32_reserve_pin(unsigned int pin); @@ -16538,11 +18891,157 @@ index b1abe6b..135e034 100644 +#endif /* CONFIG_GPIO_DEV */ + #endif /* __ASM_ARCH_PORTMUX_H__ */ -diff --git a/include/asm-avr32/dma-controller.h b/include/asm-avr32/dma-controller.h -new file mode 100644 -index 0000000..56a4965 ---- /dev/null -+++ b/include/asm-avr32/dma-controller.h +diff -urN linux-2.6.24.3/include/asm-avr32/arch-at32ap/time.h avr32-2.6/include/asm-avr32/arch-at32ap/time.h +--- linux-2.6.24.3/include/asm-avr32/arch-at32ap/time.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/arch-at32ap/time.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,112 +0,0 @@ +-/* +- * Copyright (C) 2007 Atmel Corporation +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- */ +- +-#ifndef _ASM_AVR32_ARCH_AT32AP_TIME_H +-#define _ASM_AVR32_ARCH_AT32AP_TIME_H +- +-#include <linux/platform_device.h> +- +-extern struct irqaction timer_irqaction; +-extern struct platform_device at32_systc0_device; +-extern void local_timer_interrupt(int irq, void *dev_id); +- +-#define TIMER_BCR 0x000000c0 +-#define TIMER_BCR_SYNC 0 +-#define TIMER_BMR 0x000000c4 +-#define TIMER_BMR_TC0XC0S 0 +-#define TIMER_BMR_TC1XC1S 2 +-#define TIMER_BMR_TC2XC2S 4 +-#define TIMER_CCR 0x00000000 +-#define TIMER_CCR_CLKDIS 1 +-#define TIMER_CCR_CLKEN 0 +-#define TIMER_CCR_SWTRG 2 +-#define TIMER_CMR 0x00000004 +-#define TIMER_CMR_ABETRG 10 +-#define TIMER_CMR_ACPA 16 +-#define TIMER_CMR_ACPC 18 +-#define TIMER_CMR_AEEVT 20 +-#define TIMER_CMR_ASWTRG 22 +-#define TIMER_CMR_BCPB 24 +-#define TIMER_CMR_BCPC 26 +-#define TIMER_CMR_BEEVT 28 +-#define TIMER_CMR_BSWTRG 30 +-#define TIMER_CMR_BURST 4 +-#define TIMER_CMR_CLKI 3 +-#define TIMER_CMR_CPCDIS 7 +-#define TIMER_CMR_CPCSTOP 6 +-#define TIMER_CMR_CPCTRG 14 +-#define TIMER_CMR_EEVT 10 +-#define TIMER_CMR_EEVTEDG 8 +-#define TIMER_CMR_ENETRG 12 +-#define TIMER_CMR_ETRGEDG 8 +-#define TIMER_CMR_LDBDIS 7 +-#define TIMER_CMR_LDBSTOP 6 +-#define TIMER_CMR_LDRA 16 +-#define TIMER_CMR_LDRB 18 +-#define TIMER_CMR_TCCLKS 0 +-#define TIMER_CMR_WAVE 15 +-#define TIMER_CMR_WAVSEL 13 +-#define TIMER_CV 0x00000010 +-#define TIMER_CV_CV 0 +-#define TIMER_IDR 0x00000028 +-#define TIMER_IDR_COVFS 0 +-#define TIMER_IDR_CPAS 2 +-#define TIMER_IDR_CPBS 3 +-#define TIMER_IDR_CPCS 4 +-#define TIMER_IDR_ETRGS 7 +-#define TIMER_IDR_LDRAS 5 +-#define TIMER_IDR_LDRBS 6 +-#define TIMER_IDR_LOVRS 1 +-#define TIMER_IER 0x00000024 +-#define TIMER_IER_COVFS 0 +-#define TIMER_IER_CPAS 2 +-#define TIMER_IER_CPBS 3 +-#define TIMER_IER_CPCS 4 +-#define TIMER_IER_ETRGS 7 +-#define TIMER_IER_LDRAS 5 +-#define TIMER_IER_LDRBS 6 +-#define TIMER_IER_LOVRS 1 +-#define TIMER_IMR 0x0000002c +-#define TIMER_IMR_COVFS 0 +-#define TIMER_IMR_CPAS 2 +-#define TIMER_IMR_CPBS 3 +-#define TIMER_IMR_CPCS 4 +-#define TIMER_IMR_ETRGS 7 +-#define TIMER_IMR_LDRAS 5 +-#define TIMER_IMR_LDRBS 6 +-#define TIMER_IMR_LOVRS 1 +-#define TIMER_RA 0x00000014 +-#define TIMER_RA_RA 0 +-#define TIMER_RB 0x00000018 +-#define TIMER_RB_RB 0 +-#define TIMER_RC 0x0000001c +-#define TIMER_RC_RC 0 +-#define TIMER_SR 0x00000020 +-#define TIMER_SR_CLKSTA 16 +-#define TIMER_SR_COVFS 0 +-#define TIMER_SR_CPAS 2 +-#define TIMER_SR_CPBS 3 +-#define TIMER_SR_CPCS 4 +-#define TIMER_SR_ETRGS 7 +-#define TIMER_SR_LDRAS 5 +-#define TIMER_SR_LDRBS 6 +-#define TIMER_SR_LOVRS 1 +-#define TIMER_SR_MTIOA 17 +-#define TIMER_SR_MTIOB 18 +- +-/* Bit manipulation macros */ +-#define TIMER_BIT(name) (1 << TIMER_##name) +-#define TIMER_BF(name,value) ((value) << TIMER_##name) +- +-/* Register access macros */ +-#define timer_read(port,instance,reg) \ +- __raw_readl(port + (0x40 * instance) + TIMER_##reg) +-#define timer_write(port,instance,reg,value) \ +- __raw_writel((value), port + (0x40 * instance) + TIMER_##reg) +- +-#endif /* _ASM_AVR32_ARCH_AT32AP_TIME_H */ +diff -urN linux-2.6.24.3/include/asm-avr32/asm.h avr32-2.6/include/asm-avr32/asm.h +--- linux-2.6.24.3/include/asm-avr32/asm.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/asm.h 2008-04-23 20:12:46.000000000 +0200 +@@ -12,10 +12,10 @@ + #include <asm/asm-offsets.h> + #include <asm/thread_info.h> + +-#define mask_interrupts ssrf SR_GM_BIT +-#define mask_exceptions ssrf SR_EM_BIT +-#define unmask_interrupts csrf SR_GM_BIT +-#define unmask_exceptions csrf SR_EM_BIT ++#define mask_interrupts ssrf SYSREG_GM_OFFSET ++#define mask_exceptions ssrf SYSREG_EM_OFFSET ++#define unmask_interrupts csrf SYSREG_GM_OFFSET ++#define unmask_exceptions csrf SYSREG_EM_OFFSET + + #ifdef CONFIG_FRAME_POINTER + .macro save_fp +diff -urN linux-2.6.24.3/include/asm-avr32/byteorder.h avr32-2.6/include/asm-avr32/byteorder.h +--- linux-2.6.24.3/include/asm-avr32/byteorder.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/byteorder.h 2008-04-23 20:12:46.000000000 +0200 +@@ -12,8 +12,10 @@ + extern unsigned short __builtin_bswap_16(unsigned short x); + #endif + ++#if 0 + #define __arch__swab32(x) __builtin_bswap_32(x) + #define __arch__swab16(x) __builtin_bswap_16(x) ++#endif + + #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) + # define __BYTEORDER_HAS_U64__ +diff -urN linux-2.6.24.3/include/asm-avr32/dma-controller.h avr32-2.6/include/asm-avr32/dma-controller.h +--- linux-2.6.24.3/include/asm-avr32/dma-controller.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/dma-controller.h 2008-04-23 19:33:48.000000000 +0200 @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2005-2006 Atmel Corporation @@ -16710,24 +19209,159 @@ index 0000000..56a4965 +extern struct dma_controller *find_dma_controller(int id); + +#endif /* __ASM_AVR32_DMA_CONTROLLER_H */ -diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h -index 83e6549..9315724 100644 ---- a/include/asm-avr32/irq.h -+++ b/include/asm-avr32/irq.h -@@ -11,4 +11,9 @@ +diff -urN linux-2.6.24.3/include/asm-avr32/intc.h avr32-2.6/include/asm-avr32/intc.h +--- linux-2.6.24.3/include/asm-avr32/intc.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/intc.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,128 +0,0 @@ +-#ifndef __ASM_AVR32_INTC_H +-#define __ASM_AVR32_INTC_H +- +-#include <linux/sysdev.h> +-#include <linux/interrupt.h> +- +-struct irq_controller; +-struct irqaction; +-struct pt_regs; +- +-struct platform_device; +- +-/* Information about the internal interrupt controller */ +-struct intc_device { +- /* ioremapped address of configuration block */ +- void __iomem *regs; +- +- /* the physical device */ +- struct platform_device *pdev; +- +- /* Number of interrupt lines per group. */ +- unsigned int irqs_per_group; +- +- /* The highest group ID + 1 */ +- unsigned int nr_groups; +- +- /* +- * Bitfield indicating which groups are actually in use. The +- * size of the array is +- * ceil(group_max / (8 * sizeof(unsigned int))). +- */ +- unsigned int group_mask[]; +-}; +- +-struct irq_controller_class { +- /* +- * A short name identifying this kind of controller. +- */ +- const char *typename; +- /* +- * Handle the IRQ. Must do any necessary acking and masking. +- */ +- irqreturn_t (*handle)(int irq, void *dev_id, struct pt_regs *regs); +- /* +- * Register a new IRQ handler. +- */ +- int (*setup)(struct irq_controller *ctrl, unsigned int irq, +- struct irqaction *action); +- /* +- * Unregister a IRQ handler. +- */ +- void (*free)(struct irq_controller *ctrl, unsigned int irq, +- void *dev_id); +- /* +- * Mask the IRQ in the interrupt controller. +- */ +- void (*mask)(struct irq_controller *ctrl, unsigned int irq); +- /* +- * Unmask the IRQ in the interrupt controller. +- */ +- void (*unmask)(struct irq_controller *ctrl, unsigned int irq); +- /* +- * Set the type of the IRQ. See below for possible types. +- * Return -EINVAL if a given type is not supported +- */ +- int (*set_type)(struct irq_controller *ctrl, unsigned int irq, +- unsigned int type); +- /* +- * Return the IRQ type currently set +- */ +- unsigned int (*get_type)(struct irq_controller *ctrl, unsigned int irq); +-}; +- +-struct irq_controller { +- struct irq_controller_class *class; +- unsigned int irq_group; +- unsigned int first_irq; +- unsigned int nr_irqs; +- struct list_head list; +-}; +- +-struct intc_group_desc { +- struct irq_controller *ctrl; +- irqreturn_t (*handle)(int, void *, struct pt_regs *); +- unsigned long flags; +- void *dev_id; +- const char *devname; +-}; +- +-/* +- * The internal interrupt controller. Defined in board/part-specific +- * devices.c. +- * TODO: Should probably be defined per-cpu. +- */ +-extern struct intc_device intc; +- +-extern int request_internal_irq(unsigned int irq, +- irqreturn_t (*handler)(int, void *, struct pt_regs *), +- unsigned long irqflags, +- const char *devname, void *dev_id); +-extern void free_internal_irq(unsigned int irq); +- +-/* Only used by time_init() */ +-extern int setup_internal_irq(unsigned int irq, struct intc_group_desc *desc); +- +-/* +- * Set interrupt priority for a given group. `group' can be found by +- * using irq_to_group(irq). Priority can be from 0 (lowest) to 3 +- * (highest). Higher-priority interrupts will preempt lower-priority +- * interrupts (unless interrupts are masked globally). +- * +- * This function does not check for conflicts within a group. +- */ +-extern int intc_set_priority(unsigned int group, +- unsigned int priority); +- +-/* +- * Returns a bitmask of pending interrupts in a group. +- */ +-extern unsigned long intc_get_pending(unsigned int group); +- +-/* +- * Register a new external interrupt controller. Returns the first +- * external IRQ number that is assigned to the new controller. +- */ +-extern int intc_register_controller(struct irq_controller *ctrl); +- +-#endif /* __ASM_AVR32_INTC_H */ +diff -urN linux-2.6.24.3/include/asm-avr32/irq.h avr32-2.6/include/asm-avr32/irq.h +--- linux-2.6.24.3/include/asm-avr32/irq.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/irq.h 2008-04-23 20:12:46.000000000 +0200 +@@ -11,4 +11,14 @@ #define irq_canonicalize(i) (i) +#ifndef __ASSEMBLER__ +int nmi_enable(void); +void nmi_disable(void); ++ ++/* ++ * Returns a bitmask of pending interrupts in a group. ++ */ ++extern unsigned long intc_get_pending(unsigned int group); +#endif + #endif /* __ASM_AVR32_IOCTLS_H */ -diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h -index fd7e990..ca4f954 100644 ---- a/include/asm-avr32/kdebug.h -+++ b/include/asm-avr32/kdebug.h +diff -urN linux-2.6.24.3/include/asm-avr32/kdebug.h avr32-2.6/include/asm-avr32/kdebug.h +--- linux-2.6.24.3/include/asm-avr32/kdebug.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/kdebug.h 2008-04-23 19:33:48.000000000 +0200 @@ -5,6 +5,7 @@ enum die_val { DIE_BREAKPOINT, @@ -16736,11 +19370,10 @@ index fd7e990..ca4f954 100644 }; #endif /* __ASM_AVR32_KDEBUG_H */ -diff --git a/include/asm-avr32/ocd.h b/include/asm-avr32/ocd.h -index 996405e..6bef094 100644 ---- a/include/asm-avr32/ocd.h -+++ b/include/asm-avr32/ocd.h -@@ -533,6 +533,11 @@ static inline void __ocd_write(unsigned int reg, unsigned long value) +diff -urN linux-2.6.24.3/include/asm-avr32/ocd.h avr32-2.6/include/asm-avr32/ocd.h +--- linux-2.6.24.3/include/asm-avr32/ocd.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/ocd.h 2008-04-23 19:33:48.000000000 +0200 +@@ -533,6 +533,11 @@ #define ocd_read(reg) __ocd_read(OCD_##reg) #define ocd_write(reg, value) __ocd_write(OCD_##reg, value) @@ -16752,11 +19385,21 @@ index 996405e..6bef094 100644 #endif /* !__ASSEMBLER__ */ #endif /* __ASM_AVR32_OCD_H */ -diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h -index a52576b..4212551 100644 ---- a/include/asm-avr32/processor.h -+++ b/include/asm-avr32/processor.h -@@ -57,11 +57,25 @@ struct avr32_cpuinfo { +diff -urN linux-2.6.24.3/include/asm-avr32/pgtable.h avr32-2.6/include/asm-avr32/pgtable.h +--- linux-2.6.24.3/include/asm-avr32/pgtable.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/pgtable.h 2008-04-23 20:12:46.000000000 +0200 +@@ -157,6 +157,7 @@ + #define _PAGE_S(x) _PAGE_NORMAL(x) + + #define PAGE_COPY _PAGE_P(PAGE_WRITE | PAGE_READ) ++#define PAGE_SHARED _PAGE_S(PAGE_WRITE | PAGE_READ) + + #ifndef __ASSEMBLY__ + /* +diff -urN linux-2.6.24.3/include/asm-avr32/processor.h avr32-2.6/include/asm-avr32/processor.h +--- linux-2.6.24.3/include/asm-avr32/processor.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/processor.h 2008-04-23 19:33:48.000000000 +0200 +@@ -57,11 +57,25 @@ unsigned short cpu_revision; enum tlb_config tlb_config; unsigned long features; @@ -16782,11 +19425,10 @@ index a52576b..4212551 100644 extern struct avr32_cpuinfo boot_cpu_data; #ifdef CONFIG_SMP -diff --git a/include/asm-avr32/ptrace.h b/include/asm-avr32/ptrace.h -index 8c5dba5..9e2d44f 100644 ---- a/include/asm-avr32/ptrace.h -+++ b/include/asm-avr32/ptrace.h -@@ -121,7 +121,15 @@ struct pt_regs { +diff -urN linux-2.6.24.3/include/asm-avr32/ptrace.h avr32-2.6/include/asm-avr32/ptrace.h +--- linux-2.6.24.3/include/asm-avr32/ptrace.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/ptrace.h 2008-04-23 19:33:48.000000000 +0200 +@@ -121,7 +121,15 @@ }; #ifdef __KERNEL__ @@ -16803,7 +19445,7 @@ index 8c5dba5..9e2d44f 100644 extern void show_regs (struct pt_regs *); static __inline__ int valid_user_regs(struct pt_regs *regs) -@@ -141,9 +149,6 @@ static __inline__ int valid_user_regs(struct pt_regs *regs) +@@ -141,9 +149,6 @@ return 0; } @@ -16813,11 +19455,10 @@ index 8c5dba5..9e2d44f 100644 #endif /* __KERNEL__ */ -diff --git a/include/asm-avr32/thread_info.h b/include/asm-avr32/thread_info.h -index 184b574..07049f6 100644 ---- a/include/asm-avr32/thread_info.h -+++ b/include/asm-avr32/thread_info.h -@@ -88,6 +88,7 @@ static inline struct thread_info *current_thread_info(void) +diff -urN linux-2.6.24.3/include/asm-avr32/thread_info.h avr32-2.6/include/asm-avr32/thread_info.h +--- linux-2.6.24.3/include/asm-avr32/thread_info.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/asm-avr32/thread_info.h 2008-04-23 19:33:48.000000000 +0200 +@@ -88,6 +88,7 @@ #define TIF_MEMDIE 6 #define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */ #define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */ @@ -16825,11 +19466,9 @@ index 184b574..07049f6 100644 #define TIF_USERSPACE 31 /* true if FS sets userspace */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) -diff --git a/include/linux/atmel_pwm.h b/include/linux/atmel_pwm.h -new file mode 100644 -index 0000000..ea04abb ---- /dev/null -+++ b/include/linux/atmel_pwm.h +diff -urN linux-2.6.24.3/include/linux/atmel_pwm.h avr32-2.6/include/linux/atmel_pwm.h +--- linux-2.6.24.3/include/linux/atmel_pwm.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/linux/atmel_pwm.h 2008-04-23 19:33:51.000000000 +0200 @@ -0,0 +1,70 @@ +#ifndef __LINUX_ATMEL_PWM_H +#define __LINUX_ATMEL_PWM_H @@ -16901,10 +19540,422 @@ index 0000000..ea04abb +} + +#endif /* __LINUX_ATMEL_PWM_H */ -diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h -index 4eea637..336c20d 100644 ---- a/include/video/atmel_lcdc.h -+++ b/include/video/atmel_lcdc.h +diff -urN linux-2.6.24.3/include/linux/atmel_serial.h avr32-2.6/include/linux/atmel_serial.h +--- linux-2.6.24.3/include/linux/atmel_serial.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/linux/atmel_serial.h 2008-04-23 19:33:51.000000000 +0200 +@@ -0,0 +1,127 @@ ++/* ++ * include/linux/atmel_serial.h ++ * ++ * Copyright (C) 2005 Ivan Kokshaysky ++ * Copyright (C) SAN People ++ * ++ * USART registers. ++ * Based on AT91RM9200 datasheet revision E. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#ifndef ATMEL_SERIAL_H ++#define ATMEL_SERIAL_H ++ ++#define ATMEL_US_CR 0x00 /* Control Register */ ++#define ATMEL_US_RSTRX (1 << 2) /* Reset Receiver */ ++#define ATMEL_US_RSTTX (1 << 3) /* Reset Transmitter */ ++#define ATMEL_US_RXEN (1 << 4) /* Receiver Enable */ ++#define ATMEL_US_RXDIS (1 << 5) /* Receiver Disable */ ++#define ATMEL_US_TXEN (1 << 6) /* Transmitter Enable */ ++#define ATMEL_US_TXDIS (1 << 7) /* Transmitter Disable */ ++#define ATMEL_US_RSTSTA (1 << 8) /* Reset Status Bits */ ++#define ATMEL_US_STTBRK (1 << 9) /* Start Break */ ++#define ATMEL_US_STPBRK (1 << 10) /* Stop Break */ ++#define ATMEL_US_STTTO (1 << 11) /* Start Time-out */ ++#define ATMEL_US_SENDA (1 << 12) /* Send Address */ ++#define ATMEL_US_RSTIT (1 << 13) /* Reset Iterations */ ++#define ATMEL_US_RSTNACK (1 << 14) /* Reset Non Acknowledge */ ++#define ATMEL_US_RETTO (1 << 15) /* Rearm Time-out */ ++#define ATMEL_US_DTREN (1 << 16) /* Data Terminal Ready Enable [AT91RM9200 only] */ ++#define ATMEL_US_DTRDIS (1 << 17) /* Data Terminal Ready Disable [AT91RM9200 only] */ ++#define ATMEL_US_RTSEN (1 << 18) /* Request To Send Enable */ ++#define ATMEL_US_RTSDIS (1 << 19) /* Request To Send Disable */ ++ ++#define ATMEL_US_MR 0x04 /* Mode Register */ ++#define ATMEL_US_USMODE (0xf << 0) /* Mode of the USART */ ++#define ATMEL_US_USMODE_NORMAL 0 ++#define ATMEL_US_USMODE_RS485 1 ++#define ATMEL_US_USMODE_HWHS 2 ++#define ATMEL_US_USMODE_MODEM 3 ++#define ATMEL_US_USMODE_ISO7816_T0 4 ++#define ATMEL_US_USMODE_ISO7816_T1 6 ++#define ATMEL_US_USMODE_IRDA 8 ++#define ATMEL_US_USCLKS (3 << 4) /* Clock Selection */ ++#define ATMEL_US_USCLKS_MCK (0 << 4) ++#define ATMEL_US_USCLKS_MCK_DIV8 (1 << 4) ++#define ATMEL_US_USCLKS_SCK (3 << 4) ++#define ATMEL_US_CHRL (3 << 6) /* Character Length */ ++#define ATMEL_US_CHRL_5 (0 << 6) ++#define ATMEL_US_CHRL_6 (1 << 6) ++#define ATMEL_US_CHRL_7 (2 << 6) ++#define ATMEL_US_CHRL_8 (3 << 6) ++#define ATMEL_US_SYNC (1 << 8) /* Synchronous Mode Select */ ++#define ATMEL_US_PAR (7 << 9) /* Parity Type */ ++#define ATMEL_US_PAR_EVEN (0 << 9) ++#define ATMEL_US_PAR_ODD (1 << 9) ++#define ATMEL_US_PAR_SPACE (2 << 9) ++#define ATMEL_US_PAR_MARK (3 << 9) ++#define ATMEL_US_PAR_NONE (4 << 9) ++#define ATMEL_US_PAR_MULTI_DROP (6 << 9) ++#define ATMEL_US_NBSTOP (3 << 12) /* Number of Stop Bits */ ++#define ATMEL_US_NBSTOP_1 (0 << 12) ++#define ATMEL_US_NBSTOP_1_5 (1 << 12) ++#define ATMEL_US_NBSTOP_2 (2 << 12) ++#define ATMEL_US_CHMODE (3 << 14) /* Channel Mode */ ++#define ATMEL_US_CHMODE_NORMAL (0 << 14) ++#define ATMEL_US_CHMODE_ECHO (1 << 14) ++#define ATMEL_US_CHMODE_LOC_LOOP (2 << 14) ++#define ATMEL_US_CHMODE_REM_LOOP (3 << 14) ++#define ATMEL_US_MSBF (1 << 16) /* Bit Order */ ++#define ATMEL_US_MODE9 (1 << 17) /* 9-bit Character Length */ ++#define ATMEL_US_CLKO (1 << 18) /* Clock Output Select */ ++#define ATMEL_US_OVER (1 << 19) /* Oversampling Mode */ ++#define ATMEL_US_INACK (1 << 20) /* Inhibit Non Acknowledge */ ++#define ATMEL_US_DSNACK (1 << 21) /* Disable Successive NACK */ ++#define ATMEL_US_MAX_ITER (7 << 24) /* Max Iterations */ ++#define ATMEL_US_FILTER (1 << 28) /* Infrared Receive Line Filter */ ++ ++#define ATMEL_US_IER 0x08 /* Interrupt Enable Register */ ++#define ATMEL_US_RXRDY (1 << 0) /* Receiver Ready */ ++#define ATMEL_US_TXRDY (1 << 1) /* Transmitter Ready */ ++#define ATMEL_US_RXBRK (1 << 2) /* Break Received / End of Break */ ++#define ATMEL_US_ENDRX (1 << 3) /* End of Receiver Transfer */ ++#define ATMEL_US_ENDTX (1 << 4) /* End of Transmitter Transfer */ ++#define ATMEL_US_OVRE (1 << 5) /* Overrun Error */ ++#define ATMEL_US_FRAME (1 << 6) /* Framing Error */ ++#define ATMEL_US_PARE (1 << 7) /* Parity Error */ ++#define ATMEL_US_TIMEOUT (1 << 8) /* Receiver Time-out */ ++#define ATMEL_US_TXEMPTY (1 << 9) /* Transmitter Empty */ ++#define ATMEL_US_ITERATION (1 << 10) /* Max number of Repetitions Reached */ ++#define ATMEL_US_TXBUFE (1 << 11) /* Transmission Buffer Empty */ ++#define ATMEL_US_RXBUFF (1 << 12) /* Reception Buffer Full */ ++#define ATMEL_US_NACK (1 << 13) /* Non Acknowledge */ ++#define ATMEL_US_RIIC (1 << 16) /* Ring Indicator Input Change [AT91RM9200 only] */ ++#define ATMEL_US_DSRIC (1 << 17) /* Data Set Ready Input Change [AT91RM9200 only] */ ++#define ATMEL_US_DCDIC (1 << 18) /* Data Carrier Detect Input Change [AT91RM9200 only] */ ++#define ATMEL_US_CTSIC (1 << 19) /* Clear to Send Input Change */ ++#define ATMEL_US_RI (1 << 20) /* RI */ ++#define ATMEL_US_DSR (1 << 21) /* DSR */ ++#define ATMEL_US_DCD (1 << 22) /* DCD */ ++#define ATMEL_US_CTS (1 << 23) /* CTS */ ++ ++#define ATMEL_US_IDR 0x0c /* Interrupt Disable Register */ ++#define ATMEL_US_IMR 0x10 /* Interrupt Mask Register */ ++#define ATMEL_US_CSR 0x14 /* Channel Status Register */ ++#define ATMEL_US_RHR 0x18 /* Receiver Holding Register */ ++#define ATMEL_US_THR 0x1c /* Transmitter Holding Register */ ++#define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [AT91SAM9261 only] */ ++ ++#define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */ ++#define ATMEL_US_CD (0xffff << 0) /* Clock Divider */ ++ ++#define ATMEL_US_RTOR 0x24 /* Receiver Time-out Register */ ++#define ATMEL_US_TO (0xffff << 0) /* Time-out Value */ ++ ++#define ATMEL_US_TTGR 0x28 /* Transmitter Timeguard Register */ ++#define ATMEL_US_TG (0xff << 0) /* Timeguard Value */ ++ ++#define ATMEL_US_FIDI 0x40 /* FI DI Ratio Register */ ++#define ATMEL_US_NER 0x44 /* Number of Errors Register */ ++#define ATMEL_US_IF 0x4c /* IrDA Filter Register */ ++ ++#endif +diff -urN linux-2.6.24.3/include/linux/atmel_tc.h avr32-2.6/include/linux/atmel_tc.h +--- linux-2.6.24.3/include/linux/atmel_tc.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/linux/atmel_tc.h 2008-04-23 20:12:46.000000000 +0200 +@@ -0,0 +1,252 @@ ++/* ++ * Timer/Counter Unit (TC) registers. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#ifndef ATMEL_TC_H ++#define ATMEL_TC_H ++ ++#include <linux/compiler.h> ++#include <linux/list.h> ++ ++/* ++ * Many 32-bit Atmel SOCs include one or more TC blocks, each of which holds ++ * three general-purpose 16-bit timers. These timers share one register bank. ++ * Depending on the SOC, each timer may have its own clock and IRQ, or those ++ * may be shared by the whole TC block. ++ * ++ * These TC blocks may have up to nine external pins: TCLK0..2 signals for ++ * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM ++ * or triggering. Those pins need to be set up for use with the TC block, ++ * else they will be used as GPIOs or for a different controller. ++ * ++ * Although we expect each TC block to have a platform_device node, those ++ * nodes are not what drivers bind to. Instead, they ask for a specific ++ * TC block, by number ... which is a common approach on systems with many ++ * timers. Then they use clk_get() and platform_get_irq() to get clock and ++ * IRQ resources. ++ */ ++ ++struct clk; ++ ++/** ++ * struct atmel_tc - information about a Timer/Counter Block ++ * @pdev: physical device ++ * @iomem: resource associated with the I/O register ++ * @regs: mapping through which the I/O registers can be accessed ++ * @irq: irq for each of the three channels ++ * @clk: internal clock source for each of the three channels ++ * @node: list node, for tclib internal use ++ * ++ * On some platforms, each TC channel has its own clocks and IRQs, ++ * while on others, all TC channels share the same clock and IRQ. ++ * Drivers should clk_enable() all the clocks they need even though ++ * all the entries in @clk may point to the same physical clock. ++ * Likewise, drivers should request irqs independently for each ++ * channel, but they must use IRQF_SHARED in case some of the entries ++ * in @irq are actually the same IRQ. ++ */ ++struct atmel_tc { ++ struct platform_device *pdev; ++ struct resource *iomem; ++ void __iomem *regs; ++ int irq[3]; ++ struct clk *clk[3]; ++ struct list_head node; ++}; ++ ++extern struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name); ++extern void atmel_tc_free(struct atmel_tc *tc); ++ ++/* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */ ++extern const u8 atmel_tc_divisors[5]; ++ ++ ++/* ++ * Two registers have block-wide controls. These are: configuring the three ++ * "external" clocks (or event sources) used by the timer channels; and ++ * synchronizing the timers by resetting them all at once. ++ * ++ * "External" can mean "external to chip" using the TCLK0, TCLK1, or TCLK2 ++ * signals. Or, it can mean "external to timer", using the TIOA output from ++ * one of the other two timers that's being run in waveform mode. ++ */ ++ ++#define ATMEL_TC_BCR 0xc0 /* TC Block Control Register */ ++#define ATMEL_TC_SYNC (1 << 0) /* synchronize timers */ ++ ++#define ATMEL_TC_BMR 0xc4 /* TC Block Mode Register */ ++#define ATMEL_TC_TC0XC0S (3 << 0) /* external clock 0 source */ ++#define ATMEL_TC_TC0XC0S_TCLK0 (0 << 0) ++#define ATMEL_TC_TC0XC0S_NONE (1 << 0) ++#define ATMEL_TC_TC0XC0S_TIOA1 (2 << 0) ++#define ATMEL_TC_TC0XC0S_TIOA2 (3 << 0) ++#define ATMEL_TC_TC1XC1S (3 << 2) /* external clock 1 source */ ++#define ATMEL_TC_TC1XC1S_TCLK1 (0 << 2) ++#define ATMEL_TC_TC1XC1S_NONE (1 << 2) ++#define ATMEL_TC_TC1XC1S_TIOA0 (2 << 2) ++#define ATMEL_TC_TC1XC1S_TIOA2 (3 << 2) ++#define ATMEL_TC_TC2XC2S (3 << 4) /* external clock 2 source */ ++#define ATMEL_TC_TC2XC2S_TCLK2 (0 << 4) ++#define ATMEL_TC_TC2XC2S_NONE (1 << 4) ++#define ATMEL_TC_TC2XC2S_TIOA0 (2 << 4) ++#define ATMEL_TC_TC2XC2S_TIOA1 (3 << 4) ++ ++ ++/* ++ * Each TC block has three "channels", each with one counter and controls. ++ * ++ * Note that the semantics of ATMEL_TC_TIMER_CLOCKx (input clock selection ++ * when it's not "external") is silicon-specific. AT91 platforms use one ++ * set of definitions; AVR32 platforms use a different set. Don't hard-wire ++ * such knowledge into your code, use the global "atmel_tc_divisors" ... ++ * where index N is the divisor for clock N+1, else zero to indicate it uses ++ * the 32 KiHz clock. ++ * ++ * The timers can be chained in various ways, and operated in "waveform" ++ * generation mode (including PWM) or "capture" mode (to time events). In ++ * both modes, behavior can be configured in many ways. ++ * ++ * Each timer has two I/O pins, TIOA and TIOB. Waveform mode uses TIOA as a ++ * PWM output, and TIOB as either another PWM or as a trigger. Capture mode ++ * uses them only as inputs. ++ */ ++#define ATMEL_TC_CHAN(idx) ((idx)*0x40) ++#define ATMEL_TC_REG(idx, reg) (ATMEL_TC_CHAN(idx) + ATMEL_TC_ ## reg) ++ ++#define ATMEL_TC_CCR 0x00 /* Channel Control Register */ ++#define ATMEL_TC_CLKEN (1 << 0) /* clock enable */ ++#define ATMEL_TC_CLKDIS (1 << 1) /* clock disable */ ++#define ATMEL_TC_SWTRG (1 << 2) /* software trigger */ ++ ++#define ATMEL_TC_CMR 0x04 /* Channel Mode Register */ ++ ++/* Both modes share some CMR bits */ ++#define ATMEL_TC_TCCLKS (7 << 0) /* clock source */ ++#define ATMEL_TC_TIMER_CLOCK1 (0 << 0) ++#define ATMEL_TC_TIMER_CLOCK2 (1 << 0) ++#define ATMEL_TC_TIMER_CLOCK3 (2 << 0) ++#define ATMEL_TC_TIMER_CLOCK4 (3 << 0) ++#define ATMEL_TC_TIMER_CLOCK5 (4 << 0) ++#define ATMEL_TC_XC0 (5 << 0) ++#define ATMEL_TC_XC1 (6 << 0) ++#define ATMEL_TC_XC2 (7 << 0) ++#define ATMEL_TC_CLKI (1 << 3) /* clock invert */ ++#define ATMEL_TC_BURST (3 << 4) /* clock gating */ ++#define ATMEL_TC_GATE_NONE (0 << 4) ++#define ATMEL_TC_GATE_XC0 (1 << 4) ++#define ATMEL_TC_GATE_XC1 (2 << 4) ++#define ATMEL_TC_GATE_XC2 (3 << 4) ++#define ATMEL_TC_WAVE (1 << 15) /* true = Waveform mode */ ++ ++/* CAPTURE mode CMR bits */ ++#define ATMEL_TC_LDBSTOP (1 << 6) /* counter stops on RB load */ ++#define ATMEL_TC_LDBDIS (1 << 7) /* counter disable on RB load */ ++#define ATMEL_TC_ETRGEDG (3 << 8) /* external trigger edge */ ++#define ATMEL_TC_ETRGEDG_NONE (0 << 8) ++#define ATMEL_TC_ETRGEDG_RISING (1 << 8) ++#define ATMEL_TC_ETRGEDG_FALLING (2 << 8) ++#define ATMEL_TC_ETRGEDG_BOTH (3 << 8) ++#define ATMEL_TC_ABETRG (1 << 10) /* external trigger is TIOA? */ ++#define ATMEL_TC_CPCTRG (1 << 14) /* RC compare trigger enable */ ++#define ATMEL_TC_LDRA (3 << 16) /* RA loading edge (of TIOA) */ ++#define ATMEL_TC_LDRA_NONE (0 << 16) ++#define ATMEL_TC_LDRA_RISING (1 << 16) ++#define ATMEL_TC_LDRA_FALLING (2 << 16) ++#define ATMEL_TC_LDRA_BOTH (3 << 16) ++#define ATMEL_TC_LDRB (3 << 18) /* RB loading edge (of TIOA) */ ++#define ATMEL_TC_LDRB_NONE (0 << 18) ++#define ATMEL_TC_LDRB_RISING (1 << 18) ++#define ATMEL_TC_LDRB_FALLING (2 << 18) ++#define ATMEL_TC_LDRB_BOTH (3 << 18) ++ ++/* WAVEFORM mode CMR bits */ ++#define ATMEL_TC_CPCSTOP (1 << 6) /* RC compare stops counter */ ++#define ATMEL_TC_CPCDIS (1 << 7) /* RC compare disables counter */ ++#define ATMEL_TC_EEVTEDG (3 << 8) /* external event edge */ ++#define ATMEL_TC_EEVTEDG_NONE (0 << 8) ++#define ATMEL_TC_EEVTEDG_RISING (1 << 8) ++#define ATMEL_TC_EEVTEDG_FALLING (2 << 8) ++#define ATMEL_TC_EEVTEDG_BOTH (3 << 8) ++#define ATMEL_TC_EEVT (3 << 10) /* external event source */ ++#define ATMEL_TC_EEVT_TIOB (0 << 10) ++#define ATMEL_TC_EEVT_XC0 (1 << 10) ++#define ATMEL_TC_EEVT_XC1 (2 << 10) ++#define ATMEL_TC_EEVT_XC2 (3 << 10) ++#define ATMEL_TC_ENETRG (1 << 12) /* external event is trigger */ ++#define ATMEL_TC_WAVESEL (3 << 13) /* waveform type */ ++#define ATMEL_TC_WAVESEL_UP (0 << 13) ++#define ATMEL_TC_WAVESEL_UPDOWN (1 << 13) ++#define ATMEL_TC_WAVESEL_UP_AUTO (2 << 13) ++#define ATMEL_TC_WAVESEL_UPDOWN_AUTO (3 << 13) ++#define ATMEL_TC_ACPA (3 << 16) /* RA compare changes TIOA */ ++#define ATMEL_TC_ACPA_NONE (0 << 16) ++#define ATMEL_TC_ACPA_SET (1 << 16) ++#define ATMEL_TC_ACPA_CLEAR (2 << 16) ++#define ATMEL_TC_ACPA_TOGGLE (3 << 16) ++#define ATMEL_TC_ACPC (3 << 18) /* RC compare changes TIOA */ ++#define ATMEL_TC_ACPC_NONE (0 << 18) ++#define ATMEL_TC_ACPC_SET (1 << 18) ++#define ATMEL_TC_ACPC_CLEAR (2 << 18) ++#define ATMEL_TC_ACPC_TOGGLE (3 << 18) ++#define ATMEL_TC_AEEVT (3 << 20) /* external event changes TIOA */ ++#define ATMEL_TC_AEEVT_NONE (0 << 20) ++#define ATMEL_TC_AEEVT_SET (1 << 20) ++#define ATMEL_TC_AEEVT_CLEAR (2 << 20) ++#define ATMEL_TC_AEEVT_TOGGLE (3 << 20) ++#define ATMEL_TC_ASWTRG (3 << 22) /* software trigger changes TIOA */ ++#define ATMEL_TC_ASWTRG_NONE (0 << 22) ++#define ATMEL_TC_ASWTRG_SET (1 << 22) ++#define ATMEL_TC_ASWTRG_CLEAR (2 << 22) ++#define ATMEL_TC_ASWTRG_TOGGLE (3 << 22) ++#define ATMEL_TC_BCPB (3 << 24) /* RB compare changes TIOB */ ++#define ATMEL_TC_BCPB_NONE (0 << 24) ++#define ATMEL_TC_BCPB_SET (1 << 24) ++#define ATMEL_TC_BCPB_CLEAR (2 << 24) ++#define ATMEL_TC_BCPB_TOGGLE (3 << 24) ++#define ATMEL_TC_BCPC (3 << 26) /* RC compare changes TIOB */ ++#define ATMEL_TC_BCPC_NONE (0 << 26) ++#define ATMEL_TC_BCPC_SET (1 << 26) ++#define ATMEL_TC_BCPC_CLEAR (2 << 26) ++#define ATMEL_TC_BCPC_TOGGLE (3 << 26) ++#define ATMEL_TC_BEEVT (3 << 28) /* external event changes TIOB */ ++#define ATMEL_TC_BEEVT_NONE (0 << 28) ++#define ATMEL_TC_BEEVT_SET (1 << 28) ++#define ATMEL_TC_BEEVT_CLEAR (2 << 28) ++#define ATMEL_TC_BEEVT_TOGGLE (3 << 28) ++#define ATMEL_TC_BSWTRG (3 << 30) /* software trigger changes TIOB */ ++#define ATMEL_TC_BSWTRG_NONE (0 << 30) ++#define ATMEL_TC_BSWTRG_SET (1 << 30) ++#define ATMEL_TC_BSWTRG_CLEAR (2 << 30) ++#define ATMEL_TC_BSWTRG_TOGGLE (3 << 30) ++ ++#define ATMEL_TC_CV 0x10 /* counter Value */ ++#define ATMEL_TC_RA 0x14 /* register A */ ++#define ATMEL_TC_RB 0x18 /* register B */ ++#define ATMEL_TC_RC 0x1c /* register C */ ++ ++#define ATMEL_TC_SR 0x20 /* status (read-only) */ ++/* Status-only flags */ ++#define ATMEL_TC_CLKSTA (1 << 16) /* clock enabled */ ++#define ATMEL_TC_MTIOA (1 << 17) /* TIOA mirror */ ++#define ATMEL_TC_MTIOB (1 << 18) /* TIOB mirror */ ++ ++#define ATMEL_TC_IER 0x24 /* interrupt enable (write-only) */ ++#define ATMEL_TC_IDR 0x28 /* interrupt disable (write-only) */ ++#define ATMEL_TC_IMR 0x2c /* interrupt mask (read-only) */ ++ ++/* Status and IRQ flags */ ++#define ATMEL_TC_COVFS (1 << 0) /* counter overflow */ ++#define ATMEL_TC_LOVRS (1 << 1) /* load overrun */ ++#define ATMEL_TC_CPAS (1 << 2) /* RA compare */ ++#define ATMEL_TC_CPBS (1 << 3) /* RB compare */ ++#define ATMEL_TC_CPCS (1 << 4) /* RC compare */ ++#define ATMEL_TC_LDRAS (1 << 5) /* RA loading */ ++#define ATMEL_TC_LDRBS (1 << 6) /* RB loading */ ++#define ATMEL_TC_ETRGS (1 << 7) /* external trigger */ ++ ++#endif +diff -urN linux-2.6.24.3/include/linux/usb/atmel_usba_udc.h avr32-2.6/include/linux/usb/atmel_usba_udc.h +--- linux-2.6.24.3/include/linux/usb/atmel_usba_udc.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/include/linux/usb/atmel_usba_udc.h 2008-04-23 20:12:47.000000000 +0200 +@@ -0,0 +1,22 @@ ++/* ++ * Platform data definitions for Atmel USBA gadget driver. ++ */ ++#ifndef __LINUX_USB_USBA_H ++#define __LINUX_USB_USBA_H ++ ++struct usba_ep_data { ++ char *name; ++ int index; ++ int fifo_size; ++ int nr_banks; ++ int can_dma; ++ int can_isoc; ++}; ++ ++struct usba_platform_data { ++ int vbus_pin; ++ int num_ep; ++ struct usba_ep_data ep[0]; ++}; ++ ++#endif /* __LINUX_USB_USBA_H */ +diff -urN linux-2.6.24.3/include/video/atmel_lcdc.h avr32-2.6/include/video/atmel_lcdc.h +--- linux-2.6.24.3/include/video/atmel_lcdc.h 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/include/video/atmel_lcdc.h 2008-04-23 19:33:52.000000000 +0200 @@ -22,7 +22,7 @@ #ifndef __ATMEL_LCDC_H__ #define __ATMEL_LCDC_H__ @@ -16914,7 +19965,7 @@ index 4eea637..336c20d 100644 struct atmel_lcdfb_info { spinlock_t lock; struct fb_info *info; -@@ -33,7 +33,14 @@ struct atmel_lcdfb_info { +@@ -33,7 +33,14 @@ struct platform_device *pdev; struct clk *bus_clk; struct clk *lcdc_clk; @@ -16930,7 +19981,7 @@ index 4eea637..336c20d 100644 unsigned int default_lcdcon2; unsigned int default_dmacon; void (*atmel_lcdfb_power_control)(int on); -@@ -115,20 +122,20 @@ struct atmel_lcdfb_info { +@@ -115,20 +122,20 @@ #define ATMEL_LCDC_MEMOR_LITTLE (1 << 31) #define ATMEL_LCDC_TIM1 0x0808 @@ -16958,11 +20009,29 @@ index 4eea637..336c20d 100644 #define ATMEL_LCDC_LCDFRMCFG 0x0810 #define ATMEL_LCDC_LINEVAL (0x7ff << 0) -diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index c25db86..c719bb9 100644 ---- a/kernel/ptrace.c -+++ b/kernel/ptrace.c -@@ -470,6 +470,8 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) +diff -urN linux-2.6.24.3/init/do_mounts.c avr32-2.6/init/do_mounts.c +--- linux-2.6.24.3/init/do_mounts.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/init/do_mounts.c 2008-04-23 20:12:47.000000000 +0200 +@@ -219,8 +219,14 @@ + + static int __init rootwait_setup(char *str) + { +- if (*str) ++ if (*str && *str != '=') + return 0; ++ ++ if (*str) ++ printk(KERN_WARNING ++ "WARNING: \"rootwait=1\" is deprecated, " ++ "use \"rootwait\" instead.\n"); ++ + root_wait = 1; + return 1; + } +diff -urN linux-2.6.24.3/kernel/ptrace.c avr32-2.6/kernel/ptrace.c +--- linux-2.6.24.3/kernel/ptrace.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/kernel/ptrace.c 2008-04-23 20:12:47.000000000 +0200 +@@ -470,6 +470,8 @@ lock_kernel(); if (request == PTRACE_TRACEME) { ret = ptrace_traceme(); @@ -16971,63 +20040,30 @@ index c25db86..c719bb9 100644 goto out; } -diff --git a/sound/Kconfig b/sound/Kconfig -index b2a2db4..29a9979 100644 ---- a/sound/Kconfig -+++ b/sound/Kconfig -@@ -63,6 +63,8 @@ source "sound/aoa/Kconfig" - - source "sound/arm/Kconfig" - -+source "sound/avr32/Kconfig" -+ - if SPI - source "sound/spi/Kconfig" - endif -diff --git a/sound/Makefile b/sound/Makefile -index c76d707..a52b236 100644 ---- a/sound/Makefile -+++ b/sound/Makefile -@@ -6,7 +6,7 @@ obj-$(CONFIG_SOUND_PRIME) += sound_firmware.o - obj-$(CONFIG_SOUND_PRIME) += oss/ - obj-$(CONFIG_DMASOUND) += oss/ - obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \ -- sparc/ spi/ parisc/ pcmcia/ mips/ soc/ -+ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ avr32/ - obj-$(CONFIG_SND_AOA) += aoa/ +diff -urN linux-2.6.24.3/localversion-atmel avr32-2.6/localversion-atmel +--- linux-2.6.24.3/localversion-atmel 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/localversion-atmel 2008-04-23 20:12:47.000000000 +0200 +@@ -0,0 +1 @@ ++.atmel.3 +diff -urN linux-2.6.24.3/MAINTAINERS avr32-2.6/MAINTAINERS +--- linux-2.6.24.3/MAINTAINERS 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/MAINTAINERS 2008-04-23 20:12:35.000000000 +0200 +@@ -671,6 +671,12 @@ + W: http://www.at91.com/ + S: Maintained - # This one must be compilable even if sound is configured out -diff --git a/sound/avr32/Kconfig b/sound/avr32/Kconfig -new file mode 100644 -index 0000000..17d1d91 ---- /dev/null -+++ b/sound/avr32/Kconfig -@@ -0,0 +1,11 @@ -+menu "AVR32 devices" -+ depends on SND != n && AVR32 -+ -+config SND_ATMEL_AC97 -+ tristate "Atmel AC97 Controller Driver" -+ select SND_PCM -+ select SND_AC97_CODEC -+ help -+ ALSA sound driver for the Atmel AC97 controller. -+ -+endmenu -diff --git a/sound/avr32/Makefile b/sound/avr32/Makefile -new file mode 100644 -index 0000000..5d87d0e ---- /dev/null -+++ b/sound/avr32/Makefile -@@ -0,0 +1,3 @@ -+snd-atmel-ac97-objs := ac97c.o ++ATMEL AT91 / AT32 SERIAL DRIVER ++P: Haavard Skinnemoen ++M: hskinnemoen@atmel.com ++L: linux-kernel@vger.kernel.org ++S: Supported + -+obj-$(CONFIG_SND_ATMEL_AC97) += snd-atmel-ac97.o -diff --git a/sound/avr32/ac97c.c b/sound/avr32/ac97c.c -new file mode 100644 -index 0000000..0ec0b1c ---- /dev/null -+++ b/sound/avr32/ac97c.c + ATMEL LCDFB DRIVER + P: Nicolas Ferre + M: nicolas.ferre@atmel.com +diff -urN linux-2.6.24.3/sound/avr32/ac97c.c avr32-2.6/sound/avr32/ac97c.c +--- linux-2.6.24.3/sound/avr32/ac97c.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/avr32/ac97c.c 2008-04-23 19:33:54.000000000 +0200 @@ -0,0 +1,914 @@ +/* + * Driver for the Atmel AC97 controller @@ -17943,11 +20979,9 @@ index 0000000..0ec0b1c +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Driver for Atmel AC97 Controller"); +MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>"); -diff --git a/sound/avr32/ac97c.h b/sound/avr32/ac97c.h -new file mode 100644 -index 0000000..96246e7 ---- /dev/null -+++ b/sound/avr32/ac97c.h +diff -urN linux-2.6.24.3/sound/avr32/ac97c.h avr32-2.6/sound/avr32/ac97c.h +--- linux-2.6.24.3/sound/avr32/ac97c.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/avr32/ac97c.h 2008-04-23 19:33:54.000000000 +0200 @@ -0,0 +1,71 @@ +/* + * Register definitions for the Atmel AC97 Controller. @@ -18020,35 +21054,55 @@ index 0000000..96246e7 +#define AC97C_CHANNEL_B 0x2 + +#endif /* __SOUND_AVR32_AC97C_H */ -diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig -index 857008b..db69a17 100644 ---- a/sound/oss/Kconfig -+++ b/sound/oss/Kconfig -@@ -654,3 +654,7 @@ config SOUND_SH_DAC_AUDIO_CHANNEL - int "DAC channel" - default "1" - depends on SOUND_SH_DAC_AUDIO +diff -urN linux-2.6.24.3/sound/avr32/Kconfig avr32-2.6/sound/avr32/Kconfig +--- linux-2.6.24.3/sound/avr32/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/avr32/Kconfig 2008-04-23 19:33:54.000000000 +0200 +@@ -0,0 +1,11 @@ ++menu "AVR32 devices" ++ depends on SND != n && AVR32 + -+config SOUND_AT32_ABDAC -+ tristate "Atmel AT32 Audio Bitstream DAC (ABDAC) support" -+ depends on SOUND_PRIME && AVR32 -diff --git a/sound/oss/Makefile b/sound/oss/Makefile -index f883c4b..a41853b 100644 ---- a/sound/oss/Makefile -+++ b/sound/oss/Makefile -@@ -10,6 +10,7 @@ obj-$(CONFIG_SOUND_CS4232) += cs4232.o ad1848.o ++config SND_ATMEL_AC97 ++ tristate "Atmel AC97 Controller Driver" ++ select SND_PCM ++ select SND_AC97_CODEC ++ help ++ ALSA sound driver for the Atmel AC97 controller. ++ ++endmenu +diff -urN linux-2.6.24.3/sound/avr32/Makefile avr32-2.6/sound/avr32/Makefile +--- linux-2.6.24.3/sound/avr32/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/avr32/Makefile 2008-04-23 19:33:54.000000000 +0200 +@@ -0,0 +1,3 @@ ++snd-atmel-ac97-objs := ac97c.o ++ ++obj-$(CONFIG_SND_ATMEL_AC97) += snd-atmel-ac97.o +diff -urN linux-2.6.24.3/sound/Kconfig avr32-2.6/sound/Kconfig +--- linux-2.6.24.3/sound/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/sound/Kconfig 2008-04-23 19:33:54.000000000 +0200 +@@ -63,6 +63,8 @@ - # Please leave it as is, cause the link order is significant ! + source "sound/arm/Kconfig" -+obj-$(CONFIG_SOUND_AT32_ABDAC) += at32_abdac.o - obj-$(CONFIG_SOUND_SH_DAC_AUDIO) += sh_dac_audio.o - obj-$(CONFIG_SOUND_HAL2) += hal2.o - obj-$(CONFIG_SOUND_AEDSP16) += aedsp16.o -diff --git a/sound/oss/at32_abdac.c b/sound/oss/at32_abdac.c -new file mode 100644 -index 0000000..cb997d7 ---- /dev/null -+++ b/sound/oss/at32_abdac.c ++source "sound/avr32/Kconfig" ++ + if SPI + source "sound/spi/Kconfig" + endif +diff -urN linux-2.6.24.3/sound/Makefile avr32-2.6/sound/Makefile +--- linux-2.6.24.3/sound/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/sound/Makefile 2008-04-23 19:33:54.000000000 +0200 +@@ -6,7 +6,7 @@ + obj-$(CONFIG_SOUND_PRIME) += oss/ + obj-$(CONFIG_DMASOUND) += oss/ + obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \ +- sparc/ spi/ parisc/ pcmcia/ mips/ soc/ ++ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ avr32/ + obj-$(CONFIG_SND_AOA) += aoa/ + + # This one must be compilable even if sound is configured out +diff -urN linux-2.6.24.3/sound/oss/at32_abdac.c avr32-2.6/sound/oss/at32_abdac.c +--- linux-2.6.24.3/sound/oss/at32_abdac.c 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/oss/at32_abdac.c 2008-04-23 19:33:54.000000000 +0200 @@ -0,0 +1,722 @@ +/* + * OSS Sound Driver for the Atmel AT32 on-chip DAC. @@ -18772,11 +21826,9 @@ index 0000000..cb997d7 +MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>"); +MODULE_DESCRIPTION("Sound Driver for the Atmel AT32 ABDAC"); +MODULE_LICENSE("GPL"); -diff --git a/sound/oss/at32_abdac.h b/sound/oss/at32_abdac.h -new file mode 100644 -index 0000000..3c88e25 ---- /dev/null -+++ b/sound/oss/at32_abdac.h +diff -urN linux-2.6.24.3/sound/oss/at32_abdac.h avr32-2.6/sound/oss/at32_abdac.h +--- linux-2.6.24.3/sound/oss/at32_abdac.h 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/sound/oss/at32_abdac.h 2008-04-23 19:33:54.000000000 +0200 @@ -0,0 +1,59 @@ +/* + * Register definitions for the Atmel AT32 on-chip DAC. @@ -18837,3 +21889,55 @@ index 0000000..3c88e25 + __raw_writel((value), (port)->regs + DAC_##reg) + +#endif /* __SOUND_OSS_AT32_ABDAC_H__ */ +diff -urN linux-2.6.24.3/sound/oss/Kconfig avr32-2.6/sound/oss/Kconfig +--- linux-2.6.24.3/sound/oss/Kconfig 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/sound/oss/Kconfig 2008-04-23 19:33:54.000000000 +0200 +@@ -654,3 +654,7 @@ + int "DAC channel" + default "1" + depends on SOUND_SH_DAC_AUDIO ++ ++config SOUND_AT32_ABDAC ++ tristate "Atmel AT32 Audio Bitstream DAC (ABDAC) support" ++ depends on SOUND_PRIME && AVR32 +diff -urN linux-2.6.24.3/sound/oss/Makefile avr32-2.6/sound/oss/Makefile +--- linux-2.6.24.3/sound/oss/Makefile 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/sound/oss/Makefile 2008-04-23 20:12:49.000000000 +0200 +@@ -10,6 +10,7 @@ + + # Please leave it as is, cause the link order is significant ! + ++obj-$(CONFIG_SOUND_AT32_ABDAC) += at32_abdac.o + obj-$(CONFIG_SOUND_SH_DAC_AUDIO) += sh_dac_audio.o + obj-$(CONFIG_SOUND_HAL2) += hal2.o + obj-$(CONFIG_SOUND_AEDSP16) += aedsp16.o +diff -urN linux-2.6.24.3/sound/spi/at73c213.c avr32-2.6/sound/spi/at73c213.c +--- linux-2.6.24.3/sound/spi/at73c213.c 2008-02-26 01:20:20.000000000 +0100 ++++ avr32-2.6/sound/spi/at73c213.c 2008-04-23 20:12:51.000000000 +0200 +@@ -744,7 +744,7 @@ + /* + * Device functions + */ +-static int snd_at73c213_ssc_init(struct snd_at73c213 *chip) ++static int __devinit snd_at73c213_ssc_init(struct snd_at73c213 *chip) + { + /* + * Continuous clock output. +@@ -774,7 +774,7 @@ + return 0; + } + +-static int snd_at73c213_chip_init(struct snd_at73c213 *chip) ++static int __devinit snd_at73c213_chip_init(struct snd_at73c213 *chip) + { + int retval; + unsigned char dac_ctrl = 0; +@@ -939,7 +939,7 @@ + return retval; + } + +-static int snd_at73c213_probe(struct spi_device *spi) ++static int __devinit snd_at73c213_probe(struct spi_device *spi) + { + struct snd_card *card; + struct snd_at73c213 *chip; |