jtag: bitbang: drop useless typedef bb_value_t
No need to use a typedef for an enum. Drop it. Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8707 Tested-by: jenkins
This commit is contained in:
parent
8a5c331831
commit
54d07de86e
|
@ -206,7 +206,7 @@ static void restore_gpio(enum adapter_gpio_config_index idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bb_value_t am335xgpio_read(void)
|
static enum bb_value am335xgpio_read(void)
|
||||||
{
|
{
|
||||||
return get_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_TDO]) ? BB_HIGH : BB_LOW;
|
return get_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_TDO]) ? BB_HIGH : BB_LOW;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ static uint32_t *pio_base;
|
||||||
|
|
||||||
/* low level command set
|
/* low level command set
|
||||||
*/
|
*/
|
||||||
static bb_value_t at91rm9200_read(void);
|
static enum bb_value at91rm9200_read(void);
|
||||||
static int at91rm9200_write(int tck, int tms, int tdi);
|
static int at91rm9200_write(int tck, int tms, int tdi);
|
||||||
|
|
||||||
static int at91rm9200_init(void);
|
static int at91rm9200_init(void);
|
||||||
|
@ -110,7 +110,7 @@ static const struct bitbang_interface at91rm9200_bitbang = {
|
||||||
.blink = NULL,
|
.blink = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bb_value_t at91rm9200_read(void)
|
static enum bb_value at91rm9200_read(void)
|
||||||
{
|
{
|
||||||
return (pio_base[device->TDO_PIO + PIO_PDSR] & device->TDO_MASK) ? BB_HIGH : BB_LOW;
|
return (pio_base[device->TDO_PIO + PIO_PDSR] & device->TDO_MASK) ? BB_HIGH : BB_LOW;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ static void initialize_gpio(enum adapter_gpio_config_index idx)
|
||||||
bcm2835_gpio_synchronize();
|
bcm2835_gpio_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bb_value_t bcm2835gpio_read(void)
|
static enum bb_value bcm2835gpio_read(void)
|
||||||
{
|
{
|
||||||
unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].gpio_num;
|
unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].gpio_num;
|
||||||
uint32_t value = (GPIO_LEV >> shift) & 1;
|
uint32_t value = (GPIO_LEV >> shift) & 1;
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
#include <jtag/swd.h>
|
#include <jtag/swd.h>
|
||||||
#include <jtag/commands.h>
|
#include <jtag/commands.h>
|
||||||
|
|
||||||
typedef enum {
|
enum bb_value {
|
||||||
BB_LOW,
|
BB_LOW,
|
||||||
BB_HIGH,
|
BB_HIGH,
|
||||||
BB_ERROR
|
BB_ERROR
|
||||||
} bb_value_t;
|
};
|
||||||
|
|
||||||
/** Low level callbacks (for bitbang).
|
/** Low level callbacks (for bitbang).
|
||||||
*
|
*
|
||||||
|
@ -29,7 +29,7 @@ typedef enum {
|
||||||
* increase throughput. */
|
* increase throughput. */
|
||||||
struct bitbang_interface {
|
struct bitbang_interface {
|
||||||
/** Sample TDO and return the value. */
|
/** Sample TDO and return the value. */
|
||||||
bb_value_t (*read)(void);
|
enum bb_value (*read)(void);
|
||||||
|
|
||||||
/** The number of TDO samples that can be buffered up before the caller has
|
/** The number of TDO samples that can be buffered up before the caller has
|
||||||
* to call read_sample. */
|
* to call read_sample. */
|
||||||
|
@ -39,7 +39,7 @@ struct bitbang_interface {
|
||||||
int (*sample)(void);
|
int (*sample)(void);
|
||||||
|
|
||||||
/** Return the next unread value from the buffer. */
|
/** Return the next unread value from the buffer. */
|
||||||
bb_value_t (*read_sample)(void);
|
enum bb_value (*read_sample)(void);
|
||||||
|
|
||||||
/** Set TCK, TMS, and TDI to the given values. */
|
/** Set TCK, TMS, and TDI to the given values. */
|
||||||
int (*write)(int tck, int tms, int tdi);
|
int (*write)(int tck, int tms, int tdi);
|
||||||
|
|
|
@ -22,7 +22,7 @@ static int clock_count; /* count clocks in any stable state, only stable states
|
||||||
|
|
||||||
static uint32_t dummy_data;
|
static uint32_t dummy_data;
|
||||||
|
|
||||||
static bb_value_t dummy_read(void)
|
static enum bb_value dummy_read(void)
|
||||||
{
|
{
|
||||||
int data = 1 & dummy_data;
|
int data = 1 & dummy_data;
|
||||||
dummy_data = (dummy_data >> 1) | (1 << 31);
|
dummy_data = (dummy_data >> 1) | (1 << 31);
|
||||||
|
|
|
@ -30,7 +30,7 @@ static volatile uint8_t *gpio_data_direction_register;
|
||||||
|
|
||||||
/* low level command set
|
/* low level command set
|
||||||
*/
|
*/
|
||||||
static bb_value_t ep93xx_read(void);
|
static enum bb_value ep93xx_read(void);
|
||||||
static int ep93xx_write(int tck, int tms, int tdi);
|
static int ep93xx_write(int tck, int tms, int tdi);
|
||||||
static int ep93xx_reset(int trst, int srst);
|
static int ep93xx_reset(int trst, int srst);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static const struct bitbang_interface ep93xx_bitbang = {
|
||||||
.blink = NULL,
|
.blink = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bb_value_t ep93xx_read(void)
|
static enum bb_value ep93xx_read(void)
|
||||||
{
|
{
|
||||||
return (*gpio_data_register & TDO_BIT) ? BB_HIGH : BB_LOW;
|
return (*gpio_data_register & TDO_BIT) ? BB_HIGH : BB_LOW;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ static inline bool gpio_level(int g)
|
||||||
return pio_base[g / 32].dr >> (g & 0x1F) & 1;
|
return pio_base[g / 32].dr >> (g & 0x1F) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bb_value_t imx_gpio_read(void);
|
static enum bb_value imx_gpio_read(void);
|
||||||
static int imx_gpio_write(int tck, int tms, int tdi);
|
static int imx_gpio_write(int tck, int tms, int tdi);
|
||||||
|
|
||||||
static int imx_gpio_swdio_read(void);
|
static int imx_gpio_swdio_read(void);
|
||||||
|
@ -118,7 +118,7 @@ static int speed_coeff = 50000;
|
||||||
static int speed_offset = 100;
|
static int speed_offset = 100;
|
||||||
static unsigned int jtag_delay;
|
static unsigned int jtag_delay;
|
||||||
|
|
||||||
static bb_value_t imx_gpio_read(void)
|
static enum bb_value imx_gpio_read(void)
|
||||||
{
|
{
|
||||||
return gpio_level(tdo_gpio) ? BB_HIGH : BB_LOW;
|
return gpio_level(tdo_gpio) ? BB_HIGH : BB_LOW;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ static bool is_gpio_config_valid(enum adapter_gpio_config_index idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bitbang interface read of TDO */
|
/* Bitbang interface read of TDO */
|
||||||
static bb_value_t linuxgpiod_read(void)
|
static enum bb_value linuxgpiod_read(void)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ static unsigned long dataport;
|
||||||
static unsigned long statusport;
|
static unsigned long statusport;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bb_value_t parport_read(void)
|
static enum bb_value parport_read(void)
|
||||||
{
|
{
|
||||||
int data = 0;
|
int data = 0;
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ static int remote_bitbang_quit(void)
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bb_value_t char_to_int(int c)
|
static enum bb_value char_to_int(int c)
|
||||||
{
|
{
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '0':
|
case '0':
|
||||||
|
@ -198,7 +198,7 @@ static int remote_bitbang_sample(void)
|
||||||
return remote_bitbang_queue('R', NO_FLUSH);
|
return remote_bitbang_queue('R', NO_FLUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bb_value_t remote_bitbang_read_sample(void)
|
static enum bb_value remote_bitbang_read_sample(void)
|
||||||
{
|
{
|
||||||
if (remote_bitbang_recv_buf_empty()) {
|
if (remote_bitbang_recv_buf_empty()) {
|
||||||
if (remote_bitbang_fill_buf(BLOCK) != ERROR_OK)
|
if (remote_bitbang_fill_buf(BLOCK) != ERROR_OK)
|
||||||
|
|
|
@ -255,7 +255,7 @@ static int sysfsgpio_swd_write(int swclk, int swdio)
|
||||||
* The sysfs value will read back either '0' or '1'. The trick here is to call
|
* The sysfs value will read back either '0' or '1'. The trick here is to call
|
||||||
* lseek to bypass buffering in the sysfs kernel driver.
|
* lseek to bypass buffering in the sysfs kernel driver.
|
||||||
*/
|
*/
|
||||||
static bb_value_t sysfsgpio_read(void)
|
static enum bb_value sysfsgpio_read(void)
|
||||||
{
|
{
|
||||||
char buf[1];
|
char buf[1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue