PortaPack: Conditionally claim JTAG pins in SCU #defines
This commit is contained in:
@ -34,11 +34,19 @@ void cpld_jtag_setup(jtag_t* const jtag) {
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
scu_pinmux(SCU_PINMUX_PP_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_PP_TDO, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
#endif
|
||||
|
||||
gpio_input(jtag->gpio->gpio_tdo);
|
||||
gpio_output(jtag->gpio->gpio_tck);
|
||||
gpio_output(jtag->gpio->gpio_tms);
|
||||
gpio_output(jtag->gpio->gpio_tdi);
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
gpio_output(jtag->gpio->gpio_pp_tms);
|
||||
gpio_input(jtag->gpio->gpio_pp_tdo);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* set pins as inputs so we don't interfere with an external JTAG device */
|
||||
@ -47,11 +55,19 @@ void cpld_jtag_release(jtag_t* const jtag) {
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
scu_pinmux(SCU_PINMUX_PP_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
scu_pinmux(SCU_PINMUX_PP_TDO, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
|
||||
#endif
|
||||
|
||||
gpio_input(jtag->gpio->gpio_tdo);
|
||||
gpio_input(jtag->gpio->gpio_tck);
|
||||
gpio_input(jtag->gpio->gpio_tms);
|
||||
gpio_input(jtag->gpio->gpio_tdi);
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
gpio_input(jtag->gpio->gpio_pp_tms);
|
||||
gpio_input(jtag->gpio->gpio_pp_tdo);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* return 0 if success else return error code see xsvfExecute() */
|
||||
|
@ -31,6 +31,10 @@ typedef struct jtag_gpio_t {
|
||||
gpio_t gpio_tck;
|
||||
gpio_t gpio_tdi;
|
||||
gpio_t gpio_tdo;
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
gpio_t gpio_pp_tms;
|
||||
gpio_t gpio_pp_tdo;
|
||||
#endif
|
||||
} jtag_gpio_t;
|
||||
|
||||
typedef struct jtag_t {
|
||||
|
@ -123,6 +123,11 @@ static struct gpio_t gpio_cpld_tms = GPIO(3, 1);
|
||||
static struct gpio_t gpio_cpld_tdi = GPIO(3, 4);
|
||||
#endif
|
||||
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
static struct gpio_t gpio_cpld_pp_tms = GPIO(1, 1);
|
||||
static struct gpio_t gpio_cpld_pp_tdo = GPIO(1, 8);
|
||||
#endif
|
||||
|
||||
static struct gpio_t gpio_hw_sync_enable = GPIO(5,12);
|
||||
static struct gpio_t gpio_rx_q_invert = GPIO(0, 13);
|
||||
|
||||
@ -270,6 +275,10 @@ jtag_gpio_t jtag_gpio_cpld = {
|
||||
.gpio_tck = &gpio_cpld_tck,
|
||||
.gpio_tdi = &gpio_cpld_tdi,
|
||||
.gpio_tdo = &gpio_cpld_tdo,
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
.gpio_pp_tms = &gpio_cpld_pp_tms,
|
||||
.gpio_pp_tdo = &gpio_cpld_pp_tdo,
|
||||
#endif
|
||||
};
|
||||
|
||||
jtag_t jtag_cpld = {
|
||||
|
@ -235,9 +235,17 @@ extern "C"
|
||||
#define SCU_PINMUX_GPIO3_15 (P7_7) /* GPIO3[15] */
|
||||
#endif
|
||||
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
#define SCU_PINMUX_PP_TDO (P1_5) /* GPIO1[8] */
|
||||
#else
|
||||
#define SCU_PINMUX_SD_POW (P1_5) /* GPIO1[8] */
|
||||
#endif
|
||||
#define SCU_PINMUX_SD_CMD (P1_6) /* GPIO1[9] */
|
||||
#ifdef USER_INTERFACE_PORTAPACK
|
||||
#define SCU_PINMUX_PP_TMS (P1_8) /* GPIO1[1] */
|
||||
#else
|
||||
#define SCU_PINMUX_SD_VOLT0 (P1_8) /* GPIO1[1] */
|
||||
#endif
|
||||
#define SCU_PINMUX_SD_DAT0 (P1_9) /* GPIO1[2] */
|
||||
#define SCU_PINMUX_SD_DAT1 (P1_10) /* GPIO1[3] */
|
||||
#define SCU_PINMUX_SD_DAT2 (P1_11) /* GPIO1[4] */
|
||||
|
Reference in New Issue
Block a user