Go to the source code of this file.
|
#define | AM335XGPIO_CLEAR_REG_BITS(chip_num, offset, bit_mask) (*(am335xgpio_gpio_chip_mmap_addr[(chip_num)] + (offset)) &= ~(bit_mask)) |
|
#define | AM335XGPIO_GPIO0_HW_ADDR 0x44E07000 |
|
#define | AM335XGPIO_GPIO1_HW_ADDR 0x4804C000 |
|
#define | AM335XGPIO_GPIO2_HW_ADDR 0x481AC000 |
|
#define | AM335XGPIO_GPIO3_HW_ADDR 0x481AE000 |
|
#define | AM335XGPIO_GPIO_CLEARDATAOUT_OFFSET (0x190 / 4) |
|
#define | AM335XGPIO_GPIO_DATAIN_OFFSET (0x138 / 4) |
|
#define | AM335XGPIO_GPIO_DATAOUT_OFFSET (0x13C / 4) /* DATAOUT register uses 0 for output, 1 for input */ |
|
#define | AM335XGPIO_GPIO_OE_OFFSET (0x134 / 4) |
|
#define | AM335XGPIO_GPIO_SETDATAOUT_OFFSET (0x194 / 4) |
|
#define | AM335XGPIO_NUM_GPIO_CHIPS 4 |
|
#define | AM335XGPIO_NUM_GPIO_PER_CHIP 32 |
|
#define | AM335XGPIO_READ_REG(chip_num, offset) (*(am335xgpio_gpio_chip_mmap_addr[(chip_num)] + (offset))) |
|
#define | AM335XGPIO_SET_HIGH(gpio_config) AM335XGPIO_WRITE_REG((gpio_config)->chip_num, AM335XGPIO_GPIO_SETDATAOUT_OFFSET, BIT((gpio_config)->gpio_num)) |
|
#define | AM335XGPIO_SET_INPUT(gpio_config) AM335XGPIO_SET_REG_BITS((gpio_config)->chip_num, AM335XGPIO_GPIO_OE_OFFSET, BIT((gpio_config)->gpio_num)) |
|
#define | AM335XGPIO_SET_LOW(gpio_config) AM335XGPIO_WRITE_REG((gpio_config)->chip_num, AM335XGPIO_GPIO_CLEARDATAOUT_OFFSET, BIT((gpio_config)->gpio_num)) |
|
#define | AM335XGPIO_SET_OUTPUT(gpio_config) AM335XGPIO_CLEAR_REG_BITS((gpio_config)->chip_num, AM335XGPIO_GPIO_OE_OFFSET, BIT((gpio_config)->gpio_num)) |
|
#define | AM335XGPIO_SET_REG_BITS(chip_num, offset, bit_mask) (*(am335xgpio_gpio_chip_mmap_addr[(chip_num)] + (offset)) |= (bit_mask)) |
|
#define | AM335XGPIO_WRITE_REG(chip_num, offset, value) (*(am335xgpio_gpio_chip_mmap_addr[(chip_num)] + (offset)) = (value)) |
|
◆ AM335XGPIO_CLEAR_REG_BITS
◆ AM335XGPIO_GPIO0_HW_ADDR
#define AM335XGPIO_GPIO0_HW_ADDR 0x44E07000 |
◆ AM335XGPIO_GPIO1_HW_ADDR
#define AM335XGPIO_GPIO1_HW_ADDR 0x4804C000 |
◆ AM335XGPIO_GPIO2_HW_ADDR
#define AM335XGPIO_GPIO2_HW_ADDR 0x481AC000 |
◆ AM335XGPIO_GPIO3_HW_ADDR
#define AM335XGPIO_GPIO3_HW_ADDR 0x481AE000 |
◆ AM335XGPIO_GPIO_CLEARDATAOUT_OFFSET
#define AM335XGPIO_GPIO_CLEARDATAOUT_OFFSET (0x190 / 4) |
◆ AM335XGPIO_GPIO_DATAIN_OFFSET
#define AM335XGPIO_GPIO_DATAIN_OFFSET (0x138 / 4) |
◆ AM335XGPIO_GPIO_DATAOUT_OFFSET
#define AM335XGPIO_GPIO_DATAOUT_OFFSET (0x13C / 4) /* DATAOUT register uses 0 for output, 1 for input */ |
◆ AM335XGPIO_GPIO_OE_OFFSET
#define AM335XGPIO_GPIO_OE_OFFSET (0x134 / 4) |
◆ AM335XGPIO_GPIO_SETDATAOUT_OFFSET
#define AM335XGPIO_GPIO_SETDATAOUT_OFFSET (0x194 / 4) |
◆ AM335XGPIO_NUM_GPIO_CHIPS
#define AM335XGPIO_NUM_GPIO_CHIPS 4 |
◆ AM335XGPIO_NUM_GPIO_PER_CHIP
#define AM335XGPIO_NUM_GPIO_PER_CHIP 32 |
◆ AM335XGPIO_READ_REG
◆ AM335XGPIO_SET_HIGH
◆ AM335XGPIO_SET_INPUT
◆ AM335XGPIO_SET_LOW
◆ AM335XGPIO_SET_OUTPUT
◆ AM335XGPIO_SET_REG_BITS
◆ AM335XGPIO_WRITE_REG
◆ amx335gpio_initial_gpio_mode
Enumerator |
---|
AM335XGPIO_GPIO_MODE_INPUT | |
AM335XGPIO_GPIO_MODE_OUTPUT_LOW | |
AM335XGPIO_GPIO_MODE_OUTPUT_HIGH | |
Definition at line 61 of file am335xgpio.c.
◆ am335xgpio_blink()
static int am335xgpio_blink |
( |
int |
on | ) |
|
|
static |
◆ am335xgpio_init()
static int am335xgpio_init |
( |
void |
| ) |
|
|
static |
Definition at line 387 of file am335xgpio.c.
References adapter_gpio_get_config(), ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_SWCLK, ADAPTER_GPIO_IDX_SWDIO, ADAPTER_GPIO_IDX_SWDIO_DIR, ADAPTER_GPIO_IDX_TCK, ADAPTER_GPIO_IDX_TDI, ADAPTER_GPIO_IDX_TDO, ADAPTER_GPIO_IDX_TMS, ADAPTER_GPIO_IDX_TRST, ADAPTER_GPIO_INIT_STATE_INPUT, am335xgpio_bitbang, am335xgpio_gpio_chip_hw_addr, am335xgpio_gpio_chip_mmap_addr, am335xgpio_jtag_mode_possible(), am335xgpio_munmap(), AM335XGPIO_NUM_GPIO_CHIPS, am335xgpio_swd_mode_possible(), dev_mem_fd, ERROR_JTAG_INIT_FAILED, ERROR_OK, initialize_gpio(), LOG_DEBUG, LOG_ERROR, LOG_INFO, NULL, transport_is_jtag(), and transport_is_swd().
◆ am335xgpio_jtag_mode_possible()
static bool am335xgpio_jtag_mode_possible |
( |
void |
| ) |
|
|
static |
◆ am335xgpio_khz()
static int am335xgpio_khz |
( |
int |
khz, |
|
|
int * |
jtag_speed |
|
) |
| |
|
static |
◆ am335xgpio_munmap()
static void am335xgpio_munmap |
( |
void |
| ) |
|
|
static |
◆ am335xgpio_quit()
static int am335xgpio_quit |
( |
void |
| ) |
|
|
static |
◆ am335xgpio_read()
◆ am335xgpio_reset()
static int am335xgpio_reset |
( |
int |
trst, |
|
|
int |
srst |
|
) |
| |
|
static |
◆ am335xgpio_speed()
static int am335xgpio_speed |
( |
int |
speed | ) |
|
|
static |
◆ am335xgpio_speed_div()
static int am335xgpio_speed_div |
( |
int |
speed, |
|
|
int * |
khz |
|
) |
| |
|
static |
◆ am335xgpio_swd_mode_possible()
static bool am335xgpio_swd_mode_possible |
( |
void |
| ) |
|
|
static |
◆ am335xgpio_swd_write()
static int am335xgpio_swd_write |
( |
int |
swclk, |
|
|
int |
swdio |
|
) |
| |
|
static |
◆ am335xgpio_swdio_drive()
static void am335xgpio_swdio_drive |
( |
bool |
is_output | ) |
|
|
static |
◆ am335xgpio_swdio_read()
static int am335xgpio_swdio_read |
( |
void |
| ) |
|
|
static |
◆ am335xgpio_write()
static int am335xgpio_write |
( |
int |
tck, |
|
|
int |
tms, |
|
|
int |
tdi |
|
) |
| |
|
static |
◆ COMMAND_HANDLER()
COMMAND_HANDLER |
( |
am335xgpio_handle_speed_coeffs |
| ) |
|
◆ get_gpio_mode()
◆ get_gpio_mode_name()
◆ get_gpio_value()
◆ initialize_gpio()
Definition at line 159 of file am335xgpio.c.
References ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, adapter_gpio_get_name(), ADAPTER_GPIO_INIT_STATE_ACTIVE, ADAPTER_GPIO_INIT_STATE_INACTIVE, ADAPTER_GPIO_INIT_STATE_INPUT, ADAPTER_GPIO_PULL_NONE, AM335XGPIO_SET_INPUT, AM335XGPIO_SET_OUTPUT, adapter_gpio_config::chip_num, adapter_gpio_config::drive, get_gpio_mode(), get_gpio_mode_name(), adapter_gpio_config::gpio_num, adapter_gpio_config::init_state, initial_gpio_mode, is_gpio_config_valid(), LOG_DEBUG, LOG_WARNING, adapter_gpio_config::pull, and set_gpio_value().
Referenced by am335xgpio_init().
◆ is_gpio_config_valid()
◆ restore_gpio()
◆ set_gpio_value()
◆ adapter_gpio_config
◆ am335xgpio_adapter_driver
Initial value:= {
.name = "am335xgpio",
}
static int am335xgpio_quit(void)
static const struct command_registration am335xgpio_command_handlers[]
static int am335xgpio_speed_div(int speed, int *khz)
static int am335xgpio_init(void)
static int am335xgpio_speed(int speed)
static int am335xgpio_khz(int khz, int *jtag_speed)
static struct jtag_interface am335xgpio_interface
static const char *const am335xgpio_transports[]
static int am335xgpio_reset(int trst, int srst)
const struct swd_driver bitbang_swd
Definition at line 462 of file am335xgpio.c.
◆ am335xgpio_bitbang
Initial value:= {
}
static int am335xgpio_swdio_read(void)
static int am335xgpio_write(int tck, int tms, int tdi)
static int am335xgpio_swd_write(int swclk, int swdio)
static int am335xgpio_blink(int on)
static void am335xgpio_swdio_drive(bool is_output)
static bb_value_t am335xgpio_read(void)
Definition at line 276 of file am335xgpio.c.
Referenced by am335xgpio_init().
◆ am335xgpio_command_handlers
Initial value:= {
{
.name = "am335xgpio",
.help = "perform am335xgpio management",
},
}
static const struct command_registration am335xgpio_subcommand_handlers[]
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
const char * usage
a string listing the options and arguments, required or optional
Definition at line 317 of file am335xgpio.c.
◆ am335xgpio_gpio_chip_hw_addr
Initial value:= {
}
#define AM335XGPIO_GPIO3_HW_ADDR
#define AM335XGPIO_GPIO2_HW_ADDR
#define AM335XGPIO_GPIO0_HW_ADDR
#define AM335XGPIO_GPIO1_HW_ADDR
Definition at line 67 of file am335xgpio.c.
Referenced by am335xgpio_init().
◆ am335xgpio_gpio_chip_mmap_addr
◆ am335xgpio_interface
Initial value:= {
}
int bitbang_execute_queue(void)
#define DEBUG_CAP_TMS_SEQ
Definition at line 351 of file am335xgpio.c.
◆ am335xgpio_subcommand_handlers
Initial value:= {
{
.name = "speed_coeffs",
.handler = am335xgpio_handle_speed_coeffs,
.help = "SPEED_COEFF and SPEED_OFFSET for delay calculations.",
.usage = "[SPEED_COEFF SPEED_OFFSET]",
},
}
Definition at line 317 of file am335xgpio.c.
◆ am335xgpio_transports
const char* const am335xgpio_transports[] = { "jtag", "swd", NULL } |
|
static |
◆ dev_mem_fd
◆ initial_gpio_mode
◆ jtag_delay
◆ speed_coeff
◆ speed_offset