From b0fa59bef29879470e79d426e52882a598c154a4 Mon Sep 17 00:00:00 2001 From: Matteo Croce Date: Thu, 12 Jun 2008 21:13:40 +0000 Subject: avr32: upgrade to 2.6.25.6 SVN-Revision: 11450 --- target/linux/avr32/patches/100-git_sync.patch | 58992 ++++++++++++++++++------ 1 file changed, 44035 insertions(+), 14957 deletions(-) (limited to 'target/linux/avr32/patches/100-git_sync.patch') diff --git a/target/linux/avr32/patches/100-git_sync.patch b/target/linux/avr32/patches/100-git_sync.patch index 9c2d5ddf42..a840e45f38 100644 --- a/target/linux/avr32/patches/100-git_sync.patch +++ b/target/linux/avr32/patches/100-git_sync.patch @@ -1,5 +1,423 @@ ---- /dev/null -+++ b/arch/avr32/boards/atngw100/Kconfig +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91cap9_devices.c avr32-2.6/arch/arm/mach-at91/at91cap9_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91cap9_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91cap9_devices.c 2008-06-12 15:09:38.603815938 +0200 +@@ -278,20 +278,25 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + + static struct resource nand_resources[] = { +- { ++ [0] = { + .start = NAND_BASE, + .end = NAND_BASE + SZ_256M - 1, + .flags = IORESOURCE_MEM, ++ }, ++ [1] = { ++ .start = AT91_BASE_SYS + AT91_ECC, ++ .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, ++ .flags = IORESOURCE_MEM, + } + }; + + static struct platform_device at91cap9_nand_device = { +- .name = "at91_nand", ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -300,7 +305,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned long csa, mode; + +@@ -341,7 +346,7 @@ + platform_device_register(&at91cap9_nand_device); + } + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + /* -------------------------------------------------------------------- +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91rm9200_devices.c avr32-2.6/arch/arm/mach-at91/at91rm9200_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91rm9200_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91rm9200_devices.c 2008-06-12 15:09:38.603815938 +0200 +@@ -369,7 +369,7 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + +@@ -382,7 +382,7 @@ + }; + + static struct platform_device at91rm9200_nand_device = { +- .name = "at91_nand", ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -391,7 +391,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned int csa; + +@@ -429,7 +429,7 @@ + platform_device_register(&at91rm9200_nand_device); + } + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91sam9260_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9260_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91sam9260_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9260_devices.c 2008-06-12 15:09:38.603815938 +0200 +@@ -283,20 +283,25 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + + static struct resource nand_resources[] = { +- { ++ [0] = { + .start = NAND_BASE, + .end = NAND_BASE + SZ_256M - 1, + .flags = IORESOURCE_MEM, ++ }, ++ [1] = { ++ .start = AT91_BASE_SYS + AT91_ECC, ++ .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, ++ .flags = IORESOURCE_MEM, + } + }; + + static struct platform_device at91sam9260_nand_device = { +- .name = "at91_nand", ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -305,7 +310,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned long csa, mode; + +@@ -346,7 +351,7 @@ + platform_device_register(&at91sam9260_nand_device); + } + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91sam9261_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9261_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91sam9261_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9261_devices.c 2008-06-12 15:09:38.607815889 +0200 +@@ -199,7 +199,7 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + +@@ -211,8 +211,8 @@ + } + }; + +-static struct platform_device at91_nand_device = { +- .name = "at91_nand", ++static struct platform_device atmel_nand_device = { ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -221,7 +221,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned long csa, mode; + +@@ -262,11 +262,11 @@ + at91_set_A_periph(AT91_PIN_PC1, 0); /* NANDWE */ + + nand_data = *data; +- platform_device_register(&at91_nand_device); ++ platform_device_register(&atmel_nand_device); + } + + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + +@@ -539,6 +539,20 @@ + at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */ + #endif + ++#ifdef CONFIG_FB_INTSRAM ++ { ++ void __iomem *fb; ++ struct resource *fb_res = &lcdc_resources[2]; ++ size_t fb_len = fb_res->end - fb_res->start + 1; ++ ++ fb = ioremap_writecombine(fb_res->start, fb_len); ++ if (fb) { ++ memset(fb, 0, fb_len); ++ iounmap(fb, fb_len); ++ } ++ } ++#endif ++ + lcdc_data = *data; + platform_device_register(&at91_lcdc_device); + } +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91sam9263_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9263_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91sam9263_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9263_devices.c 2008-06-12 15:09:38.607815889 +0200 +@@ -353,20 +353,25 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + + static struct resource nand_resources[] = { +- { ++ [0] = { + .start = NAND_BASE, + .end = NAND_BASE + SZ_256M - 1, + .flags = IORESOURCE_MEM, ++ }, ++ [1] = { ++ .start = AT91_BASE_SYS + AT91_ECC0, ++ .end = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1, ++ .flags = IORESOURCE_MEM, + } + }; + + static struct platform_device at91sam9263_nand_device = { +- .name = "at91_nand", ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -375,7 +380,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned long csa, mode; + +@@ -416,7 +421,7 @@ + platform_device_register(&at91sam9263_nand_device); + } + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/at91sam9rl_devices.c avr32-2.6/arch/arm/mach-at91/at91sam9rl_devices.c +--- linux-2.6.25.6/arch/arm/mach-at91/at91sam9rl_devices.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/at91sam9rl_devices.c 2008-06-12 15:09:38.607815889 +0200 +@@ -100,20 +100,25 @@ + * -------------------------------------------------------------------- */ + + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) +-static struct at91_nand_data nand_data; ++static struct atmel_nand_data nand_data; + + #define NAND_BASE AT91_CHIPSELECT_3 + + static struct resource nand_resources[] = { +- { ++ [0] = { + .start = NAND_BASE, + .end = NAND_BASE + SZ_256M - 1, + .flags = IORESOURCE_MEM, ++ }, ++ [1] = { ++ .start = AT91_BASE_SYS + AT91_ECC, ++ .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, ++ .flags = IORESOURCE_MEM, + } + }; + +-static struct platform_device at91_nand_device = { +- .name = "at91_nand", ++static struct platform_device atmel_nand_device = { ++ .name = "atmel_nand", + .id = -1, + .dev = { + .platform_data = &nand_data, +@@ -122,7 +127,7 @@ + .num_resources = ARRAY_SIZE(nand_resources), + }; + +-void __init at91_add_device_nand(struct at91_nand_data *data) ++void __init at91_add_device_nand(struct atmel_nand_data *data) + { + unsigned long csa; + +@@ -159,11 +164,11 @@ + at91_set_A_periph(AT91_PIN_PB5, 0); /* NANDWE */ + + nand_data = *data; +- platform_device_register(&at91_nand_device); ++ platform_device_register(&atmel_nand_device); + } + + #else +-void __init at91_add_device_nand(struct at91_nand_data *data) {} ++void __init at91_add_device_nand(struct atmel_nand_data *data) {} + #endif + + +@@ -376,6 +381,20 @@ + at91_set_B_periph(AT91_PIN_PC24, 0); /* LCDD22 */ + at91_set_B_periph(AT91_PIN_PC25, 0); /* LCDD23 */ + ++#ifdef CONFIG_FB_INTSRAM ++ { ++ void __iomem *fb; ++ struct resource *fb_res = &lcdc_resources[2]; ++ size_t fb_len = fb_res->end - fb_res->start + 1; ++ ++ fb = ioremap_writecombine(fb_res->start, fb_len); ++ if (fb) { ++ memset(fb, 0, fb_len); ++ iounmap(fb, fb_len); ++ } ++ } ++#endif ++ + lcdc_data = *data; + platform_device_register(&at91_lcdc_device); + } +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-cap9adk.c avr32-2.6/arch/arm/mach-at91/board-cap9adk.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-cap9adk.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-cap9adk.c 2008-06-12 15:09:38.607815889 +0200 +@@ -175,7 +175,7 @@ + return cap9adk_nand_partitions; + } + +-static struct at91_nand_data __initdata cap9adk_nand_data = { ++static struct atmel_nand_data __initdata cap9adk_nand_data = { + .ale = 21, + .cle = 22, + // .det_pin = ... not connected +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-dk.c avr32-2.6/arch/arm/mach-at91/board-dk.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-dk.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-dk.c 2008-06-12 15:09:38.611815840 +0200 +@@ -151,7 +151,7 @@ + return dk_nand_partition; + } + +-static struct at91_nand_data __initdata dk_nand_data = { ++static struct atmel_nand_data __initdata dk_nand_data = { + .ale = 22, + .cle = 21, + .det_pin = AT91_PIN_PB1, +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-kb9202.c avr32-2.6/arch/arm/mach-at91/board-kb9202.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-kb9202.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-kb9202.c 2008-06-12 15:09:38.611815840 +0200 +@@ -102,7 +102,7 @@ + return kb9202_nand_partition; + } + +-static struct at91_nand_data __initdata kb9202_nand_data = { ++static struct atmel_nand_data __initdata kb9202_nand_data = { + .ale = 22, + .cle = 21, + // .det_pin = ... not there +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-sam9260ek.c avr32-2.6/arch/arm/mach-at91/board-sam9260ek.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-sam9260ek.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9260ek.c 2008-06-12 15:09:38.611815840 +0200 +@@ -146,7 +146,7 @@ + return ek_nand_partition; + } + +-static struct at91_nand_data __initdata ek_nand_data = { ++static struct atmel_nand_data __initdata ek_nand_data = { + .ale = 21, + .cle = 22, + // .det_pin = ... not connected +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-sam9261ek.c avr32-2.6/arch/arm/mach-at91/board-sam9261ek.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-sam9261ek.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9261ek.c 2008-06-12 15:09:38.611815840 +0200 +@@ -189,7 +189,7 @@ + return ek_nand_partition; + } + +-static struct at91_nand_data __initdata ek_nand_data = { ++static struct atmel_nand_data __initdata ek_nand_data = { + .ale = 22, + .cle = 21, + // .det_pin = ... not connected +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-sam9263ek.c avr32-2.6/arch/arm/mach-at91/board-sam9263ek.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-sam9263ek.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9263ek.c 2008-06-12 15:09:38.611815840 +0200 +@@ -192,7 +192,7 @@ + return ek_nand_partition; + } + +-static struct at91_nand_data __initdata ek_nand_data = { ++static struct atmel_nand_data __initdata ek_nand_data = { + .ale = 21, + .cle = 22, + // .det_pin = ... not connected +diff --exclude=.git -urN linux-2.6.25.6/arch/arm/mach-at91/board-sam9rlek.c avr32-2.6/arch/arm/mach-at91/board-sam9rlek.c +--- linux-2.6.25.6/arch/arm/mach-at91/board-sam9rlek.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/arm/mach-at91/board-sam9rlek.c 2008-06-12 15:09:38.611815840 +0200 +@@ -93,7 +93,7 @@ + return ek_nand_partition; + } + +-static struct at91_nand_data __initdata ek_nand_data = { ++static struct atmel_nand_data __initdata ek_nand_data = { + .ale = 21, + .cle = 22, + // .det_pin = ... not connected +diff --exclude=.git -urN linux-2.6.25.6/arch/avr32/boards/atngw100/Kconfig avr32-2.6/arch/avr32/boards/atngw100/Kconfig +--- linux-2.6.25.6/arch/avr32/boards/atngw100/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ avr32-2.6/arch/avr32/boards/atngw100/Kconfig 2008-06-12 15:09:38.711815728 +0200 @@ -0,0 +1,12 @@ +# NGW100 customization + @@ -13,18 +431,24 @@ + + Choose 'Y' here if you're having i2c-related problems and + want to rule out the i2c bus driver. ---- a/arch/avr32/boards/atngw100/setup.c -+++ b/arch/avr32/boards/atngw100/setup.c -@@ -20,7 +20,7 @@ - #include - #include - --#include -+#include - #include +diff --exclude=.git -urN linux-2.6.25.6/arch/avr32/boards/atngw100/setup.c avr32-2.6/arch/avr32/boards/atngw100/setup.c +--- linux-2.6.25.6/arch/avr32/boards/atngw100/setup.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/avr32/boards/atngw100/setup.c 2008-06-12 15:09:38.711815728 +0200 +@@ -25,6 +25,13 @@ #include #include -@@ -37,11 +37,16 @@ + ++/* Oscillator frequencies. These are board-specific */ ++unsigned long at32_board_osc_rates[3] = { ++ [0] = 32768, /* 32.768 kHz on RTC osc */ ++ [1] = 20000000, /* 20 MHz on osc0 */ ++ [2] = 12000000, /* 12 MHz on osc1 */ ++}; ++ + /* Initialized by bootloader-specific startup code. */ + struct tag *bootloader_tags __initdata; + +@@ -37,11 +44,16 @@ static struct spi_board_info spi0_board_info[] __initdata = { { .modalias = "mtd_dataflash", @@ -42,7 +466,7 @@ /* * 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 @@ +@@ -124,6 +136,7 @@ } }; @@ -50,7 +474,7 @@ 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 @@ +@@ -139,6 +152,7 @@ .platform_data = &i2c_gpio_data, }, }; @@ -58,7 +482,7 @@ static int __init atngw100_init(void) { -@@ -157,6 +164,7 @@ +@@ -157,6 +171,7 @@ set_hw_addr(at32_add_device_eth(1, ð_data[1])); at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); @@ -66,7 +490,7 @@ at32_add_device_usba(0, NULL); for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { -@@ -165,11 +173,15 @@ +@@ -165,11 +180,15 @@ } platform_device_register(&ngw_gpio_leds); @@ -82,64 +506,101 @@ return 0; } ---- a/arch/avr32/boards/atstk1000/atstk1000.h -+++ b/arch/avr32/boards/atstk1000/atstk1000.h -@@ -12,4 +12,6 @@ +diff --exclude=.git -urN linux-2.6.25.6/arch/avr32/boards/atstk1000/atstk1002.c avr32-2.6/arch/avr32/boards/atstk1000/atstk1002.c +--- linux-2.6.25.6/arch/avr32/boards/atstk1000/atstk1002.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1002.c 2008-06-12 15:09:38.711815728 +0200 +@@ -1,7 +1,7 @@ + /* +- * ATSTK1002 daughterboard-specific init code ++ * ATSTK1002/ATSTK1006 daughterboard-specific init code + * +- * Copyright (C) 2005-2006 Atmel Corporation ++ * Copyright (C) 2005-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 +@@ -28,6 +28,80 @@ - extern struct atmel_lcdfb_info atstk1000_lcdc_data; + #include "atstk1000.h" -+void atstk1000_setup_j2_leds(void); ++/* Oscillator frequencies. These are board specific */ ++unsigned long at32_board_osc_rates[3] = { ++ [0] = 32768, /* 32.768 kHz on RTC osc */ ++ [1] = 20000000, /* 20 MHz on osc0 */ ++ [2] = 12000000, /* 12 MHz on osc1 */ ++}; + - #endif /* __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H */ ---- a/arch/avr32/boards/atstk1000/atstk1002.c -+++ b/arch/avr32/boards/atstk1000/atstk1002.c -@@ -11,7 +11,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -22,7 +21,7 @@ - - #include - #include --#include -+#include - #include - #include - #include -@@ -49,18 +48,16 @@ - }, - }; - --#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM --#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC - static struct at73c213_board_info at73c213_data = { - .ssc_id = 0, - .shortname = "AVR32 STK1000 external DAC", - }; - #endif --#endif - --#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM -+#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM - static struct spi_board_info spi0_board_info[] __initdata = { --#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC - { - /* AT73C213 */ - .modalias = "at73c213", -@@ -80,12 +77,25 @@ - }; - #endif ++/* ++ * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both ++ * have the AT32AP7000 chip on board; the difference is that the ++ * STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on ++ * the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has ++ * none.) ++ * ++ * The RAM difference is handled by the boot loader, so the only ++ * difference we end up handling here is the NAND flash. ++ */ ++#ifdef CONFIG_BOARD_ATSTK1006 ++#include ++#include ++ ++static struct smc_timing nand_timing __initdata = { ++ .ncs_read_setup = 0, ++ .nrd_setup = 10, ++ .ncs_write_setup = 0, ++ .nwe_setup = 10, ++ ++ .ncs_read_pulse = 30, ++ .nrd_pulse = 15, ++ .ncs_write_pulse = 30, ++ .nwe_pulse = 15, ++ ++ .read_cycle = 30, ++ .write_cycle = 30, ++ ++ .ncs_read_recover = 0, ++ .nrd_recover = 15, ++ .ncs_write_recover = 0, ++ /* WE# high -> RE# low min 60 ns */ ++ .nwe_recover = 50, ++}; ++ ++static struct smc_config nand_config __initdata = { ++ .bus_width = 1, ++ .nrd_controlled = 1, ++ .nwe_controlled = 1, ++ .nwait_mode = 0, ++ .byte_write = 0, ++ .tdf_cycles = 2, ++ .tdf_mode = 0, ++}; ++ ++static struct mtd_partition nand_partitions[] = { ++ { ++ .name = "main", ++ .offset = 0x00000000, ++ .size = MTDPART_SIZ_FULL, ++ }, ++}; ++ ++static struct mtd_partition *nand_part_info(int size, int *num_partitions) ++{ ++ *num_partitions = ARRAY_SIZE(nand_partitions); ++ return nand_partitions; ++} ++ ++static struct atmel_nand_data atstk1006_nand_data __initdata = { ++ .cle = 21, ++ .ale = 22, ++ .rdy_pin = GPIO_PIN_PB(30), ++ .enable_pin = GPIO_PIN_PB(29), ++ .partition_info = nand_part_info, ++}; ++#endif --#ifdef CONFIG_BOARD_ATSTK1002_SPI1 -+#ifdef CONFIG_BOARD_ATSTK100X_SPI1 - static struct spi_board_info spi1_board_info[] __initdata = { { - /* patch in custom entries here */ + struct eth_addr { + u8 addr[6]; +@@ -83,6 +157,19 @@ } }; #endif @@ -159,125 +620,21 @@ /* * 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 @@ - clk_put(pclk); - } - --#ifdef CONFIG_BOARD_ATSTK1002_J2_LED -- --static struct gpio_led stk_j2_led[] = { --#ifdef CONFIG_BOARD_ATSTK1002_J2_LED8 --#define LEDSTRING "J2 jumpered to LED8" -- { .name = "led0:amber", .gpio = GPIO_PIN_PB( 8), }, -- { .name = "led1:amber", .gpio = GPIO_PIN_PB( 9), }, -- { .name = "led2:amber", .gpio = GPIO_PIN_PB(10), }, -- { .name = "led3:amber", .gpio = GPIO_PIN_PB(13), }, -- { .name = "led4:amber", .gpio = GPIO_PIN_PB(14), }, -- { .name = "led5:amber", .gpio = GPIO_PIN_PB(15), }, -- { .name = "led6:amber", .gpio = GPIO_PIN_PB(16), }, -- { .name = "led7:amber", .gpio = GPIO_PIN_PB(30), -- .default_trigger = "heartbeat", }, --#else /* RGB */ --#define LEDSTRING "J2 jumpered to RGB LEDs" -- { .name = "r1:red", .gpio = GPIO_PIN_PB( 8), }, -- { .name = "g1:green", .gpio = GPIO_PIN_PB(10), }, -- { .name = "b1:blue", .gpio = GPIO_PIN_PB(14), }, -- -- { .name = "r2:red", .gpio = GPIO_PIN_PB( 9), -- .default_trigger = "heartbeat", }, -- { .name = "g2:green", .gpio = GPIO_PIN_PB(13), }, -- { .name = "b2:blue", .gpio = GPIO_PIN_PB(15), -- .default_trigger = "heartbeat", }, -- /* PB16, PB30 unused */ --#endif --}; -- --static struct gpio_led_platform_data stk_j2_led_data = { -- .num_leds = ARRAY_SIZE(stk_j2_led), -- .leds = stk_j2_led, --}; -- --static struct platform_device stk_j2_led_dev = { -- .name = "leds-gpio", -- .id = 2, /* gpio block J2 */ -- .dev = { -- .platform_data = &stk_j2_led_data, -- }, --}; -- --static void setup_j2_leds(void) --{ -- unsigned i; -- -- for (i = 0; i < ARRAY_SIZE(stk_j2_led); i++) -- at32_select_gpio(stk_j2_led[i].gpio, AT32_GPIOF_OUTPUT); -- -- printk("STK1002: " LEDSTRING "\n"); -- platform_device_register(&stk_j2_led_dev); --} -- --#else --static void setup_j2_leds(void) --{ --} --#endif -- --#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM --#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM --static void __init at73c213_set_clk(struct at73c213_board_info *info) -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC -+static void __init atstk1002_setup_extdac(void) - { - struct clk *gclk; - struct clk *pll; -@@ -220,7 +170,7 @@ - } - - at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); -- info->dac_clk = gclk; -+ at73c213_data.dac_clk = gclk; - - err_set_clk: - clk_put(pll); -@@ -229,12 +179,16 @@ - err_gclk: - return; - } --#endif --#endif -+#else -+static void __init atstk1002_setup_extdac(void) -+{ -+ -+} -+#endif /* CONFIG_BOARD_ATSTK1000_EXTDAC */ - - void __init setup_board(void) - { --#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM -+#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM - 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 @@ +@@ -212,6 +299,12 @@ at32_add_system_devices(); --#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM -+#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM ++#ifdef CONFIG_BOARD_ATSTK1006 ++ smc_set_timing(&nand_config, &nand_timing); ++ smc_set_configuration(3, &nand_config); ++ at32_add_device_nand(0, &atstk1006_nand_data); ++#endif ++ + #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM at32_add_device_usart(1); #else - at32_add_device_usart(0); -@@ -281,12 +235,16 @@ - #ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM - set_hw_addr(at32_add_device_eth(0, ð_data[0])); - #endif --#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM -+#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM - at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); - #endif --#ifdef CONFIG_BOARD_ATSTK1002_SPI1 -+#ifdef CONFIG_BOARD_ATSTK100X_SPI1 +@@ -228,16 +321,30 @@ + #ifdef CONFIG_BOARD_ATSTK100X_SPI1 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); #endif + at32_add_device_twi(0, NULL, 0); @@ -287,508 +644,149 @@ #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM set_hw_addr(at32_add_device_eth(1, ð_data[1])); #else -@@ -294,18 +252,23 @@ - fbmem_start, fbmem_size); + at32_add_device_lcdc(0, &atstk1000_lcdc_data, +- fbmem_start, fbmem_size); ++ fbmem_start, fbmem_size, 0); #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 -- -- setup_j2_leds(); -- --#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM --#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM -- at73c213_set_clk(&at73c213_data); -+#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM -+ at32_add_device_ssc(0, ATMEL_SSC_TX); ++#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(); +diff --exclude=.git -urN linux-2.6.25.6/arch/avr32/boards/atstk1000/atstk1003.c avr32-2.6/arch/avr32/boards/atstk1000/atstk1003.c +--- linux-2.6.25.6/arch/avr32/boards/atstk1000/atstk1003.c 2008-06-09 20:27:19.000000000 +0200 ++++ avr32-2.6/arch/avr32/boards/atstk1000/atstk1003.c 2008-06-12 15:09:38.711815728 +0200 +@@ -27,6 +27,13 @@ + + #include "atstk1000.h" + ++/* Oscillator frequencies. These are board specific */ ++unsigned long at32_board_osc_rates[3] = { ++ [0] = 32768, /* 32.768 kHz on RTC osc */ ++ [1] = 20000000, /* 20 MHz on osc0 */ ++ [2] = 12000000, /* 12 MHz on osc1 */ ++}; ++ + #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC + static struct at73c213_board_info at73c213_data = { + .ssc_id = 0, +@@ -59,6 +66,19 @@ + } }; #endif -+ atstk1000_setup_j2_leds(); -+ atstk1002_setup_extdac(); ++static struct cf_platform_data __initdata cf0_data = { ++#ifdef CONFIG_BOARD_ATSTK1000_CF_HACKS ++ .detect_pin = CONFIG_BOARD_ATSTK1000_CF_DETECT_PIN, ++ .reset_pin = CONFIG_BOARD_ATSTK1000_CF_RESET_PIN, ++#else ++ .detect_pin = GPIO_PIN_NONE, ++ .reset_pin = GPIO_PIN_NONE, ++#endif ++ .vcc_pin = GPIO_PIN_NONE, ++ .ready_pin = GPIO_PIN_PB(27), ++ .cs = 4, ++}; + - return 0; - } - postcore_initcall(atstk1002_init); ---- /dev/null -+++ b/arch/avr32/boards/atstk1000/atstk1003.c -@@ -0,0 +1,185 @@ -+/* -+ * ATSTK1003 daughterboard-specific init code -+ * -+ * 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. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "atstk1000.h" -+ -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC -+static struct at73c213_board_info at73c213_data = { -+ .ssc_id = 0, -+ .shortname = "AVR32 STK1000 external DAC", -+}; -+#endif -+ -+#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM -+static struct spi_board_info spi0_board_info[] __initdata = { -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC -+ { -+ /* AT73C213 */ -+ .modalias = "at73c213", -+ .max_speed_hz = 200000, -+ .chip_select = 0, -+ .mode = SPI_MODE_1, -+ .platform_data = &at73c213_data, -+ }, -+#endif -+ /* -+ * We can control the LTV350QV LCD panel, but it isn't much -+ * point since we don't have an LCD controller... -+ */ -+}; -+#endif -+ -+#ifdef CONFIG_BOARD_ATSTK100X_SPI1 -+static struct spi_board_info spi1_board_info[] __initdata = { { -+ /* patch in custom entries here */ -+} }; -+#endif -+ -+static struct cf_platform_data __initdata cf0_data = { -+#ifdef CONFIG_BOARD_ATSTK1000_CF_HACKS -+ .detect_pin = CONFIG_BOARD_ATSTK1000_CF_DETECT_PIN, -+ .reset_pin = CONFIG_BOARD_ATSTK1000_CF_RESET_PIN, -+#else -+ .detect_pin = GPIO_PIN_NONE, -+ .reset_pin = GPIO_PIN_NONE, -+#endif -+ .vcc_pin = GPIO_PIN_NONE, -+ .ready_pin = GPIO_PIN_PB(27), -+ .cs = 4, -+}; -+ -+#ifdef CONFIG_BOARD_ATSTK1000_EXTDAC -+static void __init atstk1003_setup_extdac(void) -+{ -+ struct clk *gclk; -+ struct clk *pll; -+ -+ gclk = clk_get(NULL, "gclk0"); -+ if (IS_ERR(gclk)) -+ goto err_gclk; -+ pll = clk_get(NULL, "pll0"); -+ if (IS_ERR(pll)) -+ goto err_pll; -+ -+ if (clk_set_parent(gclk, pll)) { -+ pr_debug("STK1000: failed to set pll0 as parent for DAC clock\n"); -+ goto err_set_clk; -+ } -+ -+ at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); -+ at73c213_data.dac_clk = gclk; -+ -+err_set_clk: -+ clk_put(pll); -+err_pll: -+ clk_put(gclk); -+err_gclk: -+ return; -+} -+#else -+static void __init atstk1003_setup_extdac(void) -+{ -+ -+} -+#endif /* CONFIG_BOARD_ATSTK1000_EXTDAC */ -+ -+void __init setup_board(void) -+{ -+#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM -+ at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ -+#else -+ at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ -+#endif -+ /* USART 2/unused: expansion connector */ -+ at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ -+ -+ at32_setup_serial_console(0); -+} -+ -+static int __init atstk1003_init(void) -+{ -+ /* -+ * ATSTK1000 uses 32-bit SDRAM interface. Reserve the -+ * SDRAM-specific pins so that nobody messes with them. -+ */ -+ at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */ -+ at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */ -+ at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */ -+ at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */ -+ at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */ -+ at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */ -+ at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */ -+ at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */ -+ at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */ -+ at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */ -+ at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */ -+ at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */ -+ at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */ -+ at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */ -+ at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */ -+ at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */ -+ at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */ -+ -+ at32_add_system_devices(); -+ -+#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM -+ at32_add_device_usart(1); -+#else -+ at32_add_device_usart(0); -+#endif -+ at32_add_device_usart(2); -+ -+#ifndef CONFIG_BOARD_ATSTK100X_SW1_CUSTOM -+ at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); -+#endif -+#ifdef CONFIG_BOARD_ATSTK100X_SPI1 -+ at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); -+#endif -+#ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM + #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC + static void __init atstk1003_setup_extdac(void) + { +@@ -147,12 +167,22 @@ + at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); + #endif + #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM +- at32_add_device_mci(0); + at32_add_device_mci(0, NULL); -+#endif -+ at32_add_device_usba(0, NULL); + #endif + at32_add_device_usba(0, NULL); +#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 + #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(); -+ atstk1003_setup_extdac(); -+ -+ return 0; -+} -+postcore_initcall(atstk1003_init); ---- /dev/null -+++ b/arch/avr32/boards/atstk1000/atstk1004.c -@@ -0,0 +1,156 @@ -+/* -+ * ATSTK1003 daughterboard-specific init code -+ * -+ * 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. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include