summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch')
-rw-r--r--recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch276
1 files changed, 276 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch b/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch
new file mode 100644
index 0000000000..0a6d8077d8
--- /dev/null
+++ b/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-mach-at91.patch
@@ -0,0 +1,276 @@
+diff -uprN -X linux-2.6.32.3/Documentation/dontdiff linux-2.6.32.3-vanilla/arch/arm/mach-at91/at91sam9260_devices.c linux-2.6.32.3/arch/arm/mach-at91/at91sam9260_devices.c
+--- linux-2.6.32.3-vanilla/arch/arm/mach-at91/at91sam9260_devices.c 2010-01-06 17:07:45.000000000 -0600
++++ linux-2.6.32.3/arch/arm/mach-at91/at91sam9260_devices.c 2010-09-09 10:24:26.000000000 -0500
+@@ -183,9 +183,9 @@ void __init at91_add_device_eth(struct a
+ at91_set_B_periph(AT91_PIN_PA25, 0); /* ERX2 */
+ at91_set_B_periph(AT91_PIN_PA26, 0); /* ERX3 */
+ at91_set_B_periph(AT91_PIN_PA27, 0); /* ERXCK */
+- at91_set_B_periph(AT91_PIN_PA23, 0); /* ETX2 */
+- at91_set_B_periph(AT91_PIN_PA24, 0); /* ETX3 */
+- at91_set_B_periph(AT91_PIN_PA22, 0); /* ETXER */
++ at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
++ at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
++ /*at91_set_B_periph(AT91_PIN_PA22, 0);*/ /* ETXER */
+ }
+
+ eth_data = *data;
+@@ -571,7 +571,15 @@ static struct platform_device at91sam926
+ .num_resources = ARRAY_SIZE(spi1_resources),
+ };
+
+-static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
++static const unsigned spi1_standard_cs[7] = {
++ AT91_PIN_PB3,
++ AT91_PIN_PC5,
++ AT91_PIN_PC4,
++ AT91_PIN_PC6,
++ AT91_PIN_PB12,
++ AT91_PIN_PB13,
++ AT91_PIN_PB16
++};
+
+ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
+ {
+diff -uprN -X linux-2.6.32.3/Documentation/dontdiff linux-2.6.32.3-vanilla/arch/arm/mach-at91/board-sam9g20ek.c linux-2.6.32.3/arch/arm/mach-at91/board-sam9g20ek.c
+--- linux-2.6.32.3-vanilla/arch/arm/mach-at91/board-sam9g20ek.c 2010-01-06 17:07:45.000000000 -0600
++++ linux-2.6.32.3/arch/arm/mach-at91/board-sam9g20ek.c 2010-09-09 10:24:26.000000000 -0500
+@@ -27,6 +27,8 @@
+ #include <linux/gpio_keys.h>
+ #include <linux/input.h>
+ #include <linux/clk.h>
++#include <linux/i2c/at24.h>
++#include <linux/delay.h>
+
+ #include <mach/hardware.h>
+ #include <asm/setup.h>
+@@ -44,6 +46,7 @@
+ #include "sam9_smc.h"
+ #include "generic.h"
+
++static int i2c_present;
+
+ static void __init ek_map_io(void)
+ {
+@@ -61,6 +64,43 @@ static void __init ek_map_io(void)
+ /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
+ at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
+
++ int tmp;
++
++ /*
++ * Reset any initiated i2c data transfers?
++ */
++ at91_set_gpio_input(AT91_PIN_PA23, 0);
++ at91_set_gpio_output(AT91_PIN_PA24, 0);
++ for (tmp = 0; tmp < 11; tmp++) {
++ at91_set_gpio_value(AT91_PIN_PA24, 0);
++ udelay(20);
++ at91_set_gpio_value(AT91_PIN_PA24, 1);
++ udelay(20);
++ }
++ at91_set_gpio_input(AT91_PIN_PA24, 0);
++
++ /*
++ * PA24 and PA23 are used as ID pins on MTCBA and I2C pins on MTCDP.
++ *
++ * MTCBA Rev. B: 0x01, C: 0x02, D: 0x03
++ * MTCDP Rev. A reads as 0x00 with TWCK and TWD pulled high
++ *
++ */
++ tmp = !at91_get_gpio_value(AT91_PIN_PA24) << 1 | !at91_get_gpio_value(AT91_PIN_PA23);
++
++ i2c_present = !tmp;
++
++ /*
++ * The GPS receiver is either at US2 on MTCBA and US3 on MTCDP.
++ */
++ if (i2c_present) {
++ at91_register_uart(AT91SAM9260_ID_US3, 3, ATMEL_UART_CTS | ATMEL_UART_RTS);
++ printk(KERN_INFO "sam9g20: i2c available\n");
++ } else {
++ at91_register_uart(AT91SAM9260_ID_US2, 3, 0);
++ printk(KERN_INFO "sam9g20: i2c not available\n");
++ }
++
+ /* set serial console to ttyS0 (ie, DBGU) */
+ at91_set_serial_console(0);
+ }
+@@ -82,8 +122,8 @@ static struct at91_usbh_data __initdata
+ * USB Device port
+ */
+ static struct at91_udc_data __initdata ek_udc_data = {
+- .vbus_pin = AT91_PIN_PC5,
+- .pullup_pin = 0, /* pull-up driven by UDC */
++ .vbus_pin = AT91_PIN_PC12,
++ .pullup_pin = 0, /* pull-up driven by UDC */
+ };
+
+
+@@ -107,6 +147,26 @@ static struct spi_board_info ek_spi_devi
+ },
+ #endif
+ #endif
++ {
++ .modalias = "mts-io-sout",
++ .chip_select = 0,
++ .bus_num = 1,
++ },
++ {
++ .modalias = "mts-io-board-temp",
++ .chip_select = 2,
++ .bus_num = 1,
++ },
++ {
++ .modalias = "mts-io-dout",
++ .chip_select = 1,
++ .bus_num = 1,
++ },
++ {
++ .modalias = "mts-io-din",
++ .chip_select = 4,
++ .bus_num = 1,
++ },
+ };
+
+
+@@ -115,7 +175,7 @@ static struct spi_board_info ek_spi_devi
+ */
+ static struct at91_eth_data __initdata ek_macb_data = {
+ .phy_irq_pin = AT91_PIN_PA7,
+- .is_rmii = 1,
++ .is_rmii = 0,
+ };
+
+
+@@ -124,18 +184,48 @@ static struct at91_eth_data __initdata e
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Bootstrap",
+- .offset = 0,
+- .size = 4 * SZ_1M,
++ .name = "MTNCG-NANDFlash",
++ .offset = 0,
++ .size = 256*1024*1024,
++ },
++ {
++ .name = "AT91Bootstrap",
++ .offset = 0,
++ .size = 128*1024,
++ },
++ {
++ .name = "UBoot",
++ .offset = 128*1024,
++ .size = 256*1024,
+ },
+ {
+- .name = "Partition 1",
+- .offset = MTDPART_OFS_NXTBLK,
+- .size = 60 * SZ_1M,
++ .name = "UBoot Config",
++ .offset = 384*1024,
++ .size = 128*1024,
+ },
+ {
+- .name = "Partition 2",
+- .offset = MTDPART_OFS_NXTBLK,
++ .name = "UBoot Redundant Config",
++ .offset = 512*1024,
++ .size = 128*1024,
++ },
++ {
++ .name = "uImage",
++ .offset = 640*1024,
++ .size = 59*128*1024,
++ },
++ {
++ .name = "Config",
++ .offset = 64*128*1024,
++ .size = 64*128*1024,
++ },
++ {
++ .name = "Oem Config",
++ .offset = 128*128*1024,
++ .size = 64*128*1024,
++ },
++ {
++ .name = "Rootfs",
++ .offset = 192*128*1024,
+ .size = MTDPART_SIZ_FULL,
+ },
+ };
+@@ -195,11 +285,13 @@ static void __init ek_add_device_nand(vo
+
+ /*
+ * MCI (SD/MMC)
+- * det_pin, wp_pin and vcc_pin are not connected
++ * vcc_pin is not connected
+ */
+ static struct at91_mmc_data __initdata ek_mmc_data = {
+ .slot_b = 1,
+ .wire4 = 1,
++ .det_pin = AT91_PIN_PA6,
++ .wp_pin = AT91_PIN_PA9,
+ };
+
+
+@@ -207,15 +299,10 @@ static struct at91_mmc_data __initdata e
+ * LEDs
+ */
+ static struct gpio_led ek_leds[] = {
+- { /* "bottom" led, green, userled1 to be defined */
+- .name = "ds5",
+- .gpio = AT91_PIN_PA6,
++ { /* "status" led, green */
++ .name = "status",
++ .gpio = AT91_PIN_PA30, /* DJS -- was AT91_PIN_PA9, */
+ .active_low = 1,
+- .default_trigger = "none",
+- },
+- { /* "power" led, yellow */
+- .name = "ds1",
+- .gpio = AT91_PIN_PA9,
+ .default_trigger = "heartbeat",
+ }
+ };
+@@ -269,15 +356,37 @@ static void __init ek_add_device_buttons
+ static void __init ek_add_device_buttons(void) {}
+ #endif
+
++uint8_t mts_id_eeprom[512];
++
++EXPORT_SYMBOL(mts_id_eeprom);
++
++static void mts_id_eeprom_load(struct memory_accessor *macc, void *context)
++{
++ int tmp;
++
++ memset(mts_id_eeprom, 0, sizeof(mts_id_eeprom));
++
++ tmp = macc->read(macc, mts_id_eeprom, 0, sizeof(mts_id_eeprom));
++ if (tmp != sizeof(mts_id_eeprom)) {
++ printk(KERN_ERR "sam9g20: id eeprom read failed: %d\n", tmp);
++ } else {
++ printk(KERN_INFO "sam9g20: read %d bytes from id eeprom\n", tmp);
++ }
++}
++
++static struct at24_platform_data at24c04_data = {
++ .byte_len = SZ_4K / 8,
++ .page_size = 16,
++ .setup = mts_id_eeprom_load,
++};
+
+ static struct i2c_board_info __initdata ek_i2c_devices[] = {
+ {
+- I2C_BOARD_INFO("24c512", 0x50),
+- I2C_BOARD_INFO("wm8731", 0x1b),
++ I2C_BOARD_INFO("24c04", 0x56),
++ .platform_data = &at24c04_data,
+ },
+ };
+
+-
+ static void __init ek_board_init(void)
+ {
+ /* Serial */