From 37fa7696793110153cb75182554d0fd2313ada00 Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Thu, 30 Jan 2014 12:34:47 -0600 Subject: MTR2 hardware detects daughter card, tries to read EEPROM, and logs contents --- io-module/mts_io.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'io-module/mts_io.h') diff --git a/io-module/mts_io.h b/io-module/mts_io.h index f2ff2b4..86ab32e 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -81,6 +81,9 @@ do { \ #define CAPA_BLUETOOTH DEVICE_CAPA_VALUE(1, 7) #define CAPA_WIFI DEVICE_CAPA_VALUE(1, 6) +#define DAUGHTER_CARD_GPIO "MTDC-GPIOB" + +/* on-board EEPROM */ struct mts_id_eeprom_layout { char vendor_id[32]; char product_id[32]; @@ -94,6 +97,15 @@ struct mts_id_eeprom_layout { uint8_t reserved[302]; }; +/* daughter card EEPROM */ +struct mts_dc_eeprom_layout { + char serial[32]; + char hw_rev[32]; + char product_id[32]; + uint8_t mac_addr[6]; + uint8_t reserved[410]; +}; + // GPIO pin types:input, output, open drain (1 = high Z, 0 = output low) enum { GPIO_DIR_INPUT, -- cgit v1.2.3 From 8e600fd2726f303694fdb87f2eb08ddc78f5c3ee Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Thu, 30 Jan 2014 15:32:02 -0600 Subject: update daughter card eeprom layout --- io-module/mts_io.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'io-module/mts_io.h') diff --git a/io-module/mts_io.h b/io-module/mts_io.h index 86ab32e..b7b53e0 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -99,11 +99,12 @@ struct mts_id_eeprom_layout { /* daughter card EEPROM */ struct mts_dc_eeprom_layout { - char serial[32]; - char hw_rev[32]; + char vendor_id[32]; char product_id[32]; + char device_id[32]; + char hw_version[32]; uint8_t mac_addr[6]; - uint8_t reserved[410]; + uint8_t reserved[378]; }; // GPIO pin types:input, output, open drain (1 = high Z, 0 = output low) -- cgit v1.2.3 From 935ba9982e7afb39489f5a52e4a671ebbfed6fe7 Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Fri, 31 Jan 2014 14:59:20 -0600 Subject: set up handling of different daughter card types add GPIO daughter card attributes to sysfs if card is installed --- io-module/mts_io.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'io-module/mts_io.h') diff --git a/io-module/mts_io.h b/io-module/mts_io.h index b7b53e0..efbd8f8 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -28,18 +28,21 @@ struct device_attribute _dev_name = { \ #define VENDOR_ID_MULTITECH "Multi-Tech Systems" #define PRODUCT_ID_MTCDP_E1_DK "MTCDP-E1-DK" #define PRODUCT_ID_MT100EOCG "MT100EOCG" -#define PRODUCT_ID_MTR2 "MTR2" -#define PRODUCT_ID_MTR "MTR" -#define PRODUCT_ID_MTOCGD3 "MTOCGD3" -#define PRODUCT_ID_MTOCGD "MTOCGD" +#define PRODUCT_ID_MTR2 "MTR2" +#define PRODUCT_ID_MTR "MTR" +#define PRODUCT_ID_MTOCGD3 "MTOCGD3" +#define PRODUCT_ID_MTOCGD "MTOCGD" + +#define PRODUCT_ID_MTDC_GPIOB "MTDC-GPIOB" + #define HW_VERSION_MTCBA2_2_0 "MTCBA2-2.0" #define HW_VERSION_MTCDP_0_0 "MTCDP-0.0" #define HW_VERSION_MTCDP_1_0 "MTCDP-1.0" #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_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" #define HW_VERSION_MTOCGD_0_0 "MTOCGD-0.0" #define HW_VERSION_MTOCGD_0_1 "MTOCGD-0.1" @@ -56,6 +59,11 @@ enum { MTOCGD_0_1, }; +enum { + MTDC_NONE, + MTDC_GPIOB_0_0, +}; + #define DEVICE_CAPA_INDEX(c) (((c) & 0xFF) >> 3) #define DEVICE_CAPA_MASK(c) BIT((c) & 0x07) @@ -81,8 +89,6 @@ do { \ #define CAPA_BLUETOOTH DEVICE_CAPA_VALUE(1, 7) #define CAPA_WIFI DEVICE_CAPA_VALUE(1, 6) -#define DAUGHTER_CARD_GPIO "MTDC-GPIOB" - /* on-board EEPROM */ struct mts_id_eeprom_layout { char vendor_id[32]; -- cgit v1.2.3