static const iomux_v3_cfg_t const tx6_i2c_gpio_pads[] = {
/* internal I2C */
- MX6_PAD_SNVS_TAMPER1__GPIO5_IO01 | MUX_CFG_SION | MUX_PAD_CTRL(TX6_I2C_PAD_CTRL),
- MX6_PAD_SNVS_TAMPER0__GPIO5_IO00 | MUX_CFG_SION | MUX_PAD_CTRL(TX6_I2C_PAD_CTRL),
+ MX6_PAD_SNVS_TAMPER1__GPIO5_IO01 | MUX_CFG_SION |
+ MUX_PAD_CTRL(TX6_I2C_PAD_CTRL),
+ MX6_PAD_SNVS_TAMPER0__GPIO5_IO00 | MUX_CFG_SION |
+ MUX_PAD_CTRL(TX6_I2C_PAD_CTRL),
};
static const struct gpio const tx6ul_gpios[] = {
LED_STATE_INIT = -1,
LED_STATE_OFF,
LED_STATE_ON,
+ LED_STATE_ERR,
};
static inline int calc_blink_rate(void)
static int led_state = LED_STATE_INIT;
static int blink_rate;
static ulong last;
+ int ret;
+
+ switch (led_state) {
+ case LED_STATE_ERR:
+ return;
- if (led_state == LED_STATE_INIT) {
+ case LED_STATE_INIT:
last = get_timer(0);
- gpio_set_value(TX6UL_LED_GPIO, 1);
- led_state = LED_STATE_ON;
+ ret = gpio_set_value(TX6UL_LED_GPIO, 1);
+ if (ret)
+ led_state = LED_STATE_ERR;
+ else
+ led_state = LED_STATE_ON;
blink_rate = calc_blink_rate();
- } else {
+ break;
+
+ case LED_STATE_ON:
+ case LED_STATE_OFF:
if (get_timer(last) > blink_rate) {
blink_rate = calc_blink_rate();
last = get_timer_masked();
}
led_state = 1 - led_state;
}
+ break;
}
}
return;
}
imx_iomux_v3_setup_multiple_pads(stk5_pads, ARRAY_SIZE(stk5_pads));
-debug("%s@%d: \n", __func__, __LINE__);
+ debug("%s@%d: \n", __func__, __LINE__);
}
static void stk5v3_board_init(void)
{
-debug("%s@%d: \n", __func__, __LINE__);
+ debug("%s@%d: \n", __func__, __LINE__);
stk5_board_init();
-debug("%s@%d: \n", __func__, __LINE__);
+ debug("%s@%d: \n", __func__, __LINE__);
}
static void stk5v5_board_init(void)
}
exit:
-debug("%s@%d: \n", __func__, __LINE__);
+ debug("%s@%d: \n", __func__, __LINE__);
tx6_init_mac();
-debug("%s@%d: \n", __func__, __LINE__);
+ debug("%s@%d: \n", __func__, __LINE__);
clear_ctrlc();
return ret;