diff options
Diffstat (limited to 'io-module/machine/mtcdt.c')
-rw-r--r-- | io-module/machine/mtcdt.c | 290 |
1 files changed, 290 insertions, 0 deletions
diff --git a/io-module/machine/mtcdt.c b/io-module/machine/mtcdt.c index b753a9e..f8b5f0b 100644 --- a/io-module/machine/mtcdt.c +++ b/io-module/machine/mtcdt.c @@ -351,6 +351,235 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { { }, }; +// MTCDT-0.2, Schematic Rev L dated 8 Nov 2021. +static struct gpio_pin gpio_pins_mtcdt_0_2[] = { + { + .name = "RADIO_RESET", + .pin = { + .gpio = AT91_PIN_PC3, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "radio-reset", + }, + }, + { + .name = "RADIO_RESET", + .pin = { + .gpio = AT91_PIN_PC3, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "radio-power", + }, + }, + { + .name = "RADIO_STATUS", + .pin = { + .gpio = PCA9557_0_IO2, + .flags = GPIOF_IN, + .label = "radio-status", + }, + }, + { + .name = "DEVICE_RESET", + .pin = { + .gpio = AT91_PIN_PC2, + .flags = GPIOF_IN, + .label = "reset", + }, + .active_low = 1, + }, + { + .name = "LS_LED", /* LED7 */ + .pin = { + .gpio = AT91_PIN_PA14, +#if LED_LS_CONTROLLABLE + .flags = GPIOF_OUT_INIT_HIGH, +#else + .flags = GPIOF_IN, +#endif + .label = "led-ls", + }, + .active_low = 1, + }, + { + .name = "STATUS_LED", /* LED2 */ + .pin = { + .gpio = AT91_PIN_PA24, + .flags = GPIOF_OUT_INIT_LOW, + .label = "led-status", + }, + .active_low = 1, + }, + { + .name = "LED5", + .pin = { + .gpio = PCA9557_1_IO0, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-cd", + }, + .active_low = 1, + }, + { + .name = "LED5", + .pin = { + .gpio = PCA9557_1_IO0, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-a", + }, + .active_low = 1, + }, + { + .name = "LED1", + .pin = { + .gpio = PCA9557_1_IO1, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig1", + }, + .active_low = 1, + }, + { + .name = "LED1", + .pin = { + .gpio = PCA9557_1_IO1, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-b", + }, + .active_low = 1, + }, + { + .name = "LED4", + .pin = { + .gpio = PCA9557_1_IO2, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig2", + }, + .active_low = 1, + }, + { + .name = "LED4", + .pin = { + .gpio = PCA9557_1_IO2, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-c", + }, + .active_low = 1, + }, + { + .name = "LED3", + .pin = { + .gpio = PCA9557_0_IO0, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig3", + }, + .active_low = 1, + }, + { + .name = "LED3", + .pin = { + .gpio = PCA9557_0_IO0, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-d", + }, + .active_low = 1, + }, + { + .name = "ETH_RESET", + .pin = { + .gpio = AT91_PIN_PC4, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "eth-reset", + } + }, + { + .name = "WIFI_BT_ULPWKUP", + .pin = { + .gpio = AT91_PIN_PA0, + .flags = GPIOF_IN, + .label = "wifi-bt-ulpwkup", + }, + .capability = CAPA_WIFI, + }, + { + .name = "WIFI_BT_LPWKUP", + .pin = { + .gpio = PCA9557_0_IO1, + .flags = GPIOF_IN, + .label = "wifi-bt-lpwkup", + }, + .capability = CAPA_WIFI, + }, + { + .name = "WIFI_BT_INT", + .pin = { + .gpio = AT91_PIN_PB11, + .flags = GPIOF_IN, + .label = "wifi-bt-int", + }, + .capability = CAPA_WIFI, + }, + { + .name = "WIFI_BT_RESET", + .pin = { + .gpio = AT91_PIN_PD14, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "wifi-bt-reset", + }, + .capability = CAPA_WIFI, + }, + { + .name = "GNSS_RESET", + .pin = { + .gpio = AT91_PIN_PD15, + .flags = GPIOF_OUT_INIT_LOW, /* Keep GPS quiet during boot for EXAR */ + .label = "gnss-reset", + }, + .capability = CAPA_GPS, + }, + { + .name = "SECURE_RESET", + .pin = { + .gpio = AT91_PIN_PD16, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "secure-reset", + } + }, + { + .name = "MTQ_RESET", + .pin = { + .gpio = AT91_PIN_PD17, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "mtq-reset", + } + }, + { + .name = "USBHUB_RESET", + .pin = { + .gpio = AT91_PIN_PD18, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "usbhub-reset", + } + }, + { + .name = "GNSS_INT", + .pin = { + .gpio = AT91_PIN_PD19, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "gnss-int", + }, + .capability = CAPA_GPS, + }, + { + .name = "WIFI_BT_LPMODE", + .pin = { + .gpio = AT91_PIN_PD20, + .flags = GPIOF_IN, + .label = "wifi-bt-lpmode", + }, + .capability = CAPA_WIFI, + }, + { }, +}; + + + static DEVICE_ATTR_MTS(dev_attr_wifi_bt_lpwkup, "wifi-bt-lpwkup", mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); static DEVICE_ATTR_MTS(dev_attr_wifi_bt_ulpwkup, "wifi-bt-ulpwkup", @@ -373,6 +602,8 @@ static DEVICE_ATTR_RO_MTS(dev_attr_wifi_mac, "mac-wifi", mts_attr_show_product_info); static DEVICE_ATTR_RO_MTS(dev_attr_bluetooth_mac, "mac-bluetooth", mts_attr_show_product_info); +static DEVICE_ATTR_RO_MTS(dev_attr_radio_status, "radio-status", + mts_attr_show_gpio_pin); static struct attribute *mtcdt_platform_attributes[] = { &dev_attr_vendor_id.attr, @@ -456,6 +687,47 @@ static struct attribute *mtcdt_0_1_platform_attributes[] = { NULL, }; +static struct attribute *mtcdt_0_2_platform_attributes[] = { + &dev_attr_vendor_id.attr, + &dev_attr_product_id.attr, + &dev_attr_device_id.attr, + &dev_attr_uuid.attr, + &dev_attr_hw_version.attr, + &dev_attr_imei.attr, + &dev_attr_eth_mac.attr, + &dev_attr_has_radio.attr, + &dev_attr_reset.attr, + &dev_attr_reset_monitor.attr, + &dev_attr_reset_monitor_intervals.attr, + + &dev_attr_led_status.attr, + &dev_attr_led_cd_gpio.attr, + &dev_attr_led_sig1_gpio.attr, + &dev_attr_led_sig2_gpio.attr, + &dev_attr_led_sig3_gpio.attr, + + &dev_attr_led_a_gpio.attr, + &dev_attr_led_b_gpio.attr, + &dev_attr_led_c_gpio.attr, + &dev_attr_led_d_gpio.attr, + + &dev_attr_usbhub_reset.attr, + &dev_attr_eth_reset.attr, + + &dev_attr_radio_power.attr, /* Must be first radio attribute */ + &dev_attr_radio_reset.attr, + &dev_attr_radio_status.attr, + + &dev_attr_radio_reset_backoffs.attr, + &dev_attr_radio_reset_backoff_index.attr, + &dev_attr_radio_reset_backoff_seconds.attr, + + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, + NULL, +}; + static struct attribute *mtcdt_0_1_wifi_bt_attributes[] = { &dev_attr_wifi_bt_lpwkup.attr, &dev_attr_wifi_bt_ulpwkup.attr, @@ -466,11 +738,25 @@ static struct attribute *mtcdt_0_1_wifi_bt_attributes[] = { &dev_attr_wifi_mac.attr, }; +static struct attribute *mtcdt_0_2_wifi_bt_attributes[] = { + &dev_attr_wifi_bt_lpwkup.attr, + &dev_attr_wifi_bt_ulpwkup.attr, + &dev_attr_wifi_bt_reset.attr, + &dev_attr_wifi_bt_lpmode.attr, + &dev_attr_wifi_bt_int.attr, + &dev_attr_bluetooth_mac.attr, + &dev_attr_wifi_mac.attr, +}; + static struct attribute *mtcdt_0_1_gnss_attributes[] = { &dev_attr_gnss_reset.attr, &dev_attr_gnss_int.attr, }; +static struct attribute *mtcdt_0_2_gnss_attributes[] = { + &dev_attr_gnss_reset.attr, + &dev_attr_gnss_int.attr, +}; static struct attribute_group mtcdt_platform_attribute_group = { .attrs = mtcdt_platform_attributes @@ -480,6 +766,10 @@ static struct attribute_group mtcdt_0_1_platform_attribute_group = { }; +static struct attribute_group mtcdt_0_2_platform_attribute_group = { + .attrs = mtcdt_0_2_platform_attributes +}; + static int is_radio_power_attr_mtcdt(struct attribute *attr) { |