bcm2835gpio: Make buffer an output before the GPIO connected to it
The correct ordering is required to prevent two outputs connected together. Change-Id: I634a9ca7e0ccf337d1723011b8aee1f2d81efbcf Signed-off-by: Steve Marple <stevemarple@googlemail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6937 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
20adf85f34
commit
9eddc21a58
|
@ -565,6 +565,13 @@ static int bcm2835gpio_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transport_is_swd()) {
|
if (transport_is_swd()) {
|
||||||
|
/* Make buffer an output before the GPIO connected to it */
|
||||||
|
if (swdio_dir_gpio != -1) {
|
||||||
|
swdio_dir_gpio_mode = MODE_GPIO(swdio_dir_gpio);
|
||||||
|
GPIO_SET = 1 << swdio_dir_gpio;
|
||||||
|
OUT_GPIO(swdio_dir_gpio);
|
||||||
|
}
|
||||||
|
|
||||||
swclk_gpio_mode = MODE_GPIO(swclk_gpio);
|
swclk_gpio_mode = MODE_GPIO(swclk_gpio);
|
||||||
swdio_gpio_mode = MODE_GPIO(swdio_gpio);
|
swdio_gpio_mode = MODE_GPIO(swdio_gpio);
|
||||||
|
|
||||||
|
@ -580,12 +587,6 @@ static int bcm2835gpio_init(void)
|
||||||
OUT_GPIO(srst_gpio);
|
OUT_GPIO(srst_gpio);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swdio_dir_gpio != -1) {
|
|
||||||
swdio_dir_gpio_mode = MODE_GPIO(swdio_dir_gpio);
|
|
||||||
GPIO_SET = 1 << swdio_dir_gpio;
|
|
||||||
OUT_GPIO(swdio_dir_gpio);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_DEBUG("saved pinmux settings: tck %d tms %d tdi %d "
|
LOG_DEBUG("saved pinmux settings: tck %d tms %d tdi %d "
|
||||||
"tdo %d trst %d srst %d", tck_gpio_mode, tms_gpio_mode,
|
"tdo %d trst %d srst %d", tck_gpio_mode, tms_gpio_mode,
|
||||||
tdi_gpio_mode, tdo_gpio_mode, trst_gpio_mode, srst_gpio_mode);
|
tdi_gpio_mode, tdo_gpio_mode, trst_gpio_mode, srst_gpio_mode);
|
||||||
|
|
Loading…
Reference in New Issue