From e8708f8f4425f07280a61ce61fadb0b81aa62763 Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Thu, 2 May 2013 09:41:27 -0500 Subject: add support for mtr rev-b --- io-module/mts_io.c | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++++ io-module/mts_io.h | 2 + 2 files changed, 211 insertions(+) diff --git a/io-module/mts_io.c b/io-module/mts_io.c index b20a5f8..ba55a1b 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -782,6 +782,206 @@ static struct gpio_pin gpio_pins_mtr_0_0[] = { { }, }; +static struct gpio_pin gpio_pins_mtr_0_1[] = { + { + .name = "NETH_RST", + .attr_name = "eth0-enabled", + .pin = AT91_PIN_PC6, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + }, + { + .name = "3G_RST", + .attr_name = "radio-reset", + .pin = AT91_PIN_PA22, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 1, + }, + { + .name = "3G_ONOFF", + .attr_name = "radio-enabled", + .pin = AT91_PIN_PA21, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 1, + }, + { + .name = "DEVICE_RESET", + .attr_name = "reset", + .pin = AT91_PIN_PC4, + .direction = GPIO_DIR_INPUT, + .output_value = 0, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LS_LED", + .attr_name = "led-ls", + .pin = AT91_PIN_PC16, +#if LED_LS_CONTROLLABLE + .direction = GPIO_DIR_OUTPUT, +#else + .direction = GPIO_DIR_INPUT, +#endif + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "STATUS_LED", + .attr_name = "led-status", + .pin = AT91_PIN_PC21, + .direction = GPIO_DIR_OUTPUT, + .output_value = 0, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED3", + .attr_name = "led-wifi", + .pin = AT91_PIN_PC15, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED3", + .attr_name = "led-b", + .pin = AT91_PIN_PC15, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED4", + .attr_name = "led-cd", + .pin = AT91_PIN_PC20, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED4", + .attr_name = "led-c", + .pin = AT91_PIN_PC20, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED6", + .attr_name = "led-sig1", + .pin = AT91_PIN_PC19, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED6", + .attr_name = "led-d", + .pin = AT91_PIN_PC19, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED7", + .attr_name = "led-sig2", + .pin = AT91_PIN_PC18, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED7", + .attr_name = "led-e", + .pin = AT91_PIN_PC18, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED8", + .attr_name = "led-sig3", + .pin = AT91_PIN_PC17, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "LED8", + .attr_name = "led-f", + .pin = AT91_PIN_PC17, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "RI_B", + .attr_name = "extserial-ri", + .pin = AT91_PIN_PC25, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "DTR_B", + .attr_name = "extserial-dtr", + .pin = AT91_PIN_PC26, + .direction = GPIO_DIR_INPUT, + .output_value = 0, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "DSR_B", + .attr_name = "extserial-dsr", + .pin = AT91_PIN_PC27, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "DCD_B", + .attr_name = "extserial-dcd", + .pin = AT91_PIN_PC28, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + .active_low = 1, + }, + { + .name = "BT_EN", + .attr_name = "bt-enabled", + .pin = AT91_PIN_PA28, + .direction = GPIO_DIR_OUTPUT, + .output_value = 0, + .use_pullup = 0, + }, + { + .name = "WLAN_EN", + .attr_name = "wlan-enabled", + .pin = AT91_PIN_PA27, + .direction = GPIO_DIR_OUTPUT, + .output_value = 0, + .use_pullup = 0, + }, + { }, +}; struct gpio_pin *gpio_pin_by_name(const char *name) { struct gpio_pin *pin; @@ -2381,6 +2581,15 @@ static int mts_id_eeprom_load(void) has_spi_dout = 0; has_spi_temp = 0; log_info("detected board %s", HW_VERSION_MTR_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_1, strlen(HW_VERSION_MTR_0_1)) == 0) { + attr_group = &mtr_platform_attribute_group; + gpio_pins = gpio_pins_mtr_0_1; + mts_product_id = MTR_0_1; + has_spi_sout = 0; + has_spi_din = 0; + has_spi_dout = 0; + has_spi_temp = 0; + log_info("detected board %s", HW_VERSION_MTR_0_1); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTOCGD3_0_0, strlen(HW_VERSION_MTOCGD3_0_0)) == 0) { attr_group = &mtr2_platform_attribute_group; gpio_pins = gpio_pins_mtr2_0_0; diff --git a/io-module/mts_io.h b/io-module/mts_io.h index 4d6a1bd..a8d302e 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -38,6 +38,7 @@ struct device_attribute _dev_name = { \ #define HW_VERSION_MT100EOCG_0_0 "MT100EOCG-0.0" #define HW_VERSION_MTR2_0_0 "MTR2-0.0" #define HW_VERSION_MTR_0_0 "MTR-0.0" +#define HW_VERSION_MTR_0_1 "MTR-0.1" #define HW_VERSION_MTOCGD3_0_0 "MTOCGD3-0.0" enum { @@ -46,6 +47,7 @@ enum { MT100EOCG_0_0, MTR2_0_0, MTR_0_0, + MTR_0_1, MTOCGD3_0_0, }; -- cgit v1.2.3 From 4908e1b27ff49c90a90a461dfe7bc8cf8c8f400d Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Thu, 2 May 2013 11:49:32 -0500 Subject: update comments in radio_reset_telit() --- io-module/mts_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io-module/mts_io.c b/io-module/mts_io.c index ba55a1b..11cdcf4 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -1190,7 +1190,7 @@ static int radio_reset_telit(void) msleep(500); - // set pin high (high Z) + // set pin high ret = at91_set_gpio_output_with_pullup(rst_pin->pin, 1, rst_pin->use_pullup); if (ret) { return ret; @@ -1207,7 +1207,7 @@ static int radio_reset_telit(void) msleep(6000); - // set on/off pin high (high Z) + // set on/off pin high ret = at91_set_gpio_output_with_pullup(onoff_pin->pin, 1, onoff_pin->use_pullup); if (ret) { return ret; -- cgit v1.2.3 From 6a0c178ac7de9488debdb2fcf0c66e11d5e2c3cf Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Thu, 2 May 2013 13:55:09 -0500 Subject: bump version to 0.6.3 --- io-module/mts_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 11cdcf4..b0b09e7 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -42,7 +42,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v0.6.2" +#define DRIVER_VERSION "v0.6.3" #define DRIVER_AUTHOR "James Maki " #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" -- cgit v1.2.3