OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | imx_gpio_regs |
Macros | |
#define | IMX_GPIO_BASE 0x0209c000 |
#define | IMX_GPIO_REGS_COUNT 8 |
#define | IMX_GPIO_SIZE 0x00004000 |
Functions | |
struct imx_gpio_regs | __attribute__ ((aligned(IMX_GPIO_SIZE))) |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_srst) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_tck) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_tdi) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_tdo) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_tms) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionum_trst) | |
COMMAND_HANDLER (imx_gpio_handle_jtag_gpionums) | |
COMMAND_HANDLER (imx_gpio_handle_peripheral_base) | |
COMMAND_HANDLER (imx_gpio_handle_speed_coeffs) | |
COMMAND_HANDLER (imx_gpio_handle_swd_gpionum_swclk) | |
COMMAND_HANDLER (imx_gpio_handle_swd_gpionum_swdio) | |
COMMAND_HANDLER (imx_gpio_handle_swd_gpionums) | |
static void | gpio_clear (int g) |
static bool | gpio_level (int g) |
static bool | gpio_mode_get (int g) |
static void | gpio_mode_input_set (int g) |
static void | gpio_mode_output_set (int g) |
static void | gpio_mode_set (int g, int m) |
static void | gpio_set (int g) |
static int | imx_gpio_init (void) |
static bool | imx_gpio_jtag_mode_possible (void) |
static int | imx_gpio_khz (int khz, int *jtag_speed) |
static int | imx_gpio_quit (void) |
static bb_value_t | imx_gpio_read (void) |
static int | imx_gpio_reset (int trst, int srst) |
static int | imx_gpio_speed (int speed) |
static int | imx_gpio_speed_div (int speed, int *khz) |
static bool | imx_gpio_swd_mode_possible (void) |
static int | imx_gpio_swd_write (int swclk, int swdio) |
static void | imx_gpio_swdio_drive (bool is_output) |
static int | imx_gpio_swdio_read (void) |
static int | imx_gpio_write (int tck, int tms, int tdi) |
static int | is_gpio_valid (int gpio) |
Variables | |
static int | dev_mem_fd |
uint32_t | dr |
uint32_t | edge_sel |
uint32_t | gdir |
uint32_t | icr1 |
uint32_t | icr2 |
uint32_t | imr |
struct adapter_driver | imx_gpio_adapter_driver |
static struct bitbang_interface | imx_gpio_bitbang |
static const struct command_registration | imx_gpio_command_handlers [] |
static struct jtag_interface | imx_gpio_interface |
static uint32_t | imx_gpio_peri_base = IMX_GPIO_BASE |
static const char *const | imx_gpio_transports [] = { "jtag", "swd", NULL } |
uint32_t | isr |
static unsigned int | jtag_delay |
static volatile struct imx_gpio_regs * | pio_base |
uint32_t | psr |
static int | speed_coeff = 50000 |
static int | speed_offset = 100 |
static int | srst_gpio = -1 |
static int | srst_gpio_mode |
static int | swclk_gpio = -1 |
static int | swclk_gpio_mode |
static int | swdio_gpio = -1 |
static int | swdio_gpio_mode |
static int | tck_gpio = -1 |
static int | tck_gpio_mode |
static int | tdi_gpio = -1 |
static int | tdi_gpio_mode |
static int | tdo_gpio = -1 |
static int | tdo_gpio_mode |
static int | tms_gpio = -1 |
static int | tms_gpio_mode |
static int | trst_gpio = -1 |
static int | trst_gpio_mode |
#define IMX_GPIO_BASE 0x0209c000 |
Definition at line 19 of file imx_gpio.c.
#define IMX_GPIO_REGS_COUNT 8 |
Definition at line 21 of file imx_gpio.c.
#define IMX_GPIO_SIZE 0x00004000 |
Definition at line 20 of file imx_gpio.c.
struct imx_gpio_regs __attribute__ | ( | (aligned(IMX_GPIO_SIZE)) | ) |
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_srst | ) |
Definition at line 257 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and srst_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_tck | ) |
Definition at line 221 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and tck_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_tdi | ) |
Definition at line 248 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and tdi_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_tdo | ) |
Definition at line 239 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and tdo_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_tms | ) |
Definition at line 230 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and tms_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionum_trst | ) |
Definition at line 266 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and trst_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_jtag_gpionums | ) |
Definition at line 203 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, tck_gpio, tdi_gpio, tdo_gpio, and tms_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_peripheral_base | ) |
Definition at line 321 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and imx_gpio_peri_base.
COMMAND_HANDLER | ( | imx_gpio_handle_speed_coeffs | ) |
Definition at line 309 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, speed_coeff, and speed_offset.
COMMAND_HANDLER | ( | imx_gpio_handle_swd_gpionum_swclk | ) |
Definition at line 291 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and swclk_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_swd_gpionum_swdio | ) |
Definition at line 300 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and swdio_gpio.
COMMAND_HANDLER | ( | imx_gpio_handle_swd_gpionums | ) |
Definition at line 275 of file imx_gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, swclk_gpio, and swdio_gpio.
|
inlinestatic |
Definition at line 65 of file imx_gpio.c.
References imx_gpio_regs::dr, and pio_base.
Referenced by imx_gpio_init(), imx_gpio_reset(), imx_gpio_swd_write(), and imx_gpio_write().
|
inlinestatic |
Definition at line 70 of file imx_gpio.c.
References imx_gpio_regs::dr, and pio_base.
Referenced by imx_gpio_read(), and imx_gpio_swdio_read().
|
inlinestatic |
Definition at line 40 of file imx_gpio.c.
References imx_gpio_regs::gdir, and pio_base.
Referenced by imx_gpio_init().
|
inlinestatic |
Definition at line 45 of file imx_gpio.c.
References imx_gpio_regs::gdir, and pio_base.
Referenced by gpio_mode_set(), imx_gpio_init(), and imx_gpio_swdio_drive().
|
inlinestatic |
Definition at line 50 of file imx_gpio.c.
References imx_gpio_regs::gdir, and pio_base.
Referenced by gpio_mode_set(), imx_gpio_init(), and imx_gpio_swdio_drive().
|
inlinestatic |
Definition at line 55 of file imx_gpio.c.
References gpio_mode_input_set(), and gpio_mode_output_set().
Referenced by imx_gpio_quit().
|
inlinestatic |
Definition at line 60 of file imx_gpio.c.
References imx_gpio_regs::dr, and pio_base.
Referenced by imx_gpio_init(), imx_gpio_reset(), imx_gpio_swd_write(), and imx_gpio_write().
|
static |
Definition at line 465 of file imx_gpio.c.
References dev_mem_fd, ERROR_JTAG_INIT_FAILED, ERROR_OK, gpio_clear(), gpio_mode_get(), gpio_mode_input_set(), gpio_mode_output_set(), gpio_set(), imx_gpio_bitbang, imx_gpio_jtag_mode_possible(), imx_gpio_peri_base, IMX_GPIO_REGS_COUNT, IMX_GPIO_SIZE, imx_gpio_swd_mode_possible(), LOG_DEBUG, LOG_ERROR, LOG_INFO, NULL, pio_base, srst_gpio, srst_gpio_mode, swclk_gpio, swclk_gpio_mode, swdio_gpio, swdio_gpio_mode, tck_gpio, tck_gpio_mode, tdi_gpio, tdi_gpio_mode, tdo_gpio, tdo_gpio_mode, tms_gpio, tms_gpio_mode, transport_is_jtag(), transport_is_swd(), trst_gpio, and trst_gpio_mode.
|
static |
Definition at line 443 of file imx_gpio.c.
References is_gpio_valid(), tck_gpio, tdi_gpio, tdo_gpio, and tms_gpio.
Referenced by imx_gpio_init().
|
static |
Definition at line 174 of file imx_gpio.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, speed_coeff, and speed_offset.
|
static |
Definition at line 548 of file imx_gpio.c.
References ERROR_OK, gpio_mode_set(), srst_gpio, srst_gpio_mode, swclk_gpio, swclk_gpio_mode, swdio_gpio, swdio_gpio_mode, tck_gpio, tck_gpio_mode, tdi_gpio, tdi_gpio_mode, tdo_gpio, tdo_gpio_mode, tms_gpio, tms_gpio_mode, transport_is_jtag(), transport_is_swd(), trst_gpio, and trst_gpio_mode.
|
static |
Definition at line 121 of file imx_gpio.c.
References BB_HIGH, BB_LOW, gpio_level(), and tdo_gpio.
|
static |
Definition at line 150 of file imx_gpio.c.
References ERROR_OK, gpio_clear(), gpio_set(), srst_gpio, and trst_gpio.
|
static |
Definition at line 192 of file imx_gpio.c.
References ERROR_OK, and jtag_delay.
|
static |
Definition at line 186 of file imx_gpio.c.
References ERROR_OK, speed_coeff, and speed_offset.
|
static |
Definition at line 456 of file imx_gpio.c.
References is_gpio_valid(), swclk_gpio, and swdio_gpio.
Referenced by imx_gpio_init().
|
static |
Definition at line 138 of file imx_gpio.c.
References ERROR_OK, gpio_clear(), gpio_set(), jtag_delay, swclk_gpio, and swdio_gpio.
|
static |
Definition at line 161 of file imx_gpio.c.
References gpio_mode_input_set(), gpio_mode_output_set(), and swdio_gpio.
|
static |
Definition at line 169 of file imx_gpio.c.
References gpio_level(), and swdio_gpio.
|
static |
Definition at line 126 of file imx_gpio.c.
References ERROR_OK, gpio_clear(), gpio_set(), jtag_delay, tck_gpio, tdi_gpio, and tms_gpio.
|
static |
Definition at line 198 of file imx_gpio.c.
References IMX_GPIO_REGS_COUNT.
Referenced by imx_gpio_jtag_mode_possible(), and imx_gpio_swd_mode_possible().
|
static |
Definition at line 36 of file imx_gpio.c.
Referenced by imx_gpio_init().
uint32_t dr |
Definition at line 0 of file imx_gpio.c.
uint32_t edge_sel |
Definition at line 7 of file imx_gpio.c.
uint32_t gdir |
Definition at line 1 of file imx_gpio.c.
uint32_t icr1 |
Definition at line 3 of file imx_gpio.c.
uint32_t icr2 |
Definition at line 4 of file imx_gpio.c.
uint32_t imr |
Definition at line 5 of file imx_gpio.c.
struct adapter_driver imx_gpio_adapter_driver |
Definition at line 420 of file imx_gpio.c.
|
static |
Definition at line 83 of file imx_gpio.c.
Referenced by imx_gpio_init().
|
static |
Definition at line 321 of file imx_gpio.c.
|
static |
Definition at line 420 of file imx_gpio.c.
|
static |
Definition at line 23 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), and imx_gpio_init().
|
static |
Definition at line 420 of file imx_gpio.c.
uint32_t isr |
Definition at line 6 of file imx_gpio.c.
|
static |
Definition at line 119 of file imx_gpio.c.
Referenced by imx_gpio_speed(), imx_gpio_swd_write(), and imx_gpio_write().
|
static |
Definition at line 37 of file imx_gpio.c.
Referenced by gpio_clear(), gpio_level(), gpio_mode_get(), gpio_mode_input_set(), gpio_mode_output_set(), gpio_set(), and imx_gpio_init().
uint32_t psr |
Definition at line 2 of file imx_gpio.c.
|
static |
Definition at line 117 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_khz(), and imx_gpio_speed_div().
|
static |
Definition at line 118 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_khz(), and imx_gpio_speed_div().
|
static |
Definition at line 105 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_quit(), and imx_gpio_reset().
|
static |
Definition at line 106 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 107 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_quit(), imx_gpio_swd_mode_possible(), and imx_gpio_swd_write().
|
static |
Definition at line 108 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 109 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_quit(), imx_gpio_swd_mode_possible(), imx_gpio_swd_write(), imx_gpio_swdio_drive(), and imx_gpio_swdio_read().
|
static |
Definition at line 110 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 95 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_jtag_mode_possible(), imx_gpio_quit(), and imx_gpio_write().
|
static |
Definition at line 96 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 99 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_jtag_mode_possible(), imx_gpio_quit(), and imx_gpio_write().
|
static |
Definition at line 100 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 101 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_jtag_mode_possible(), imx_gpio_quit(), and imx_gpio_read().
|
static |
Definition at line 102 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 97 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_jtag_mode_possible(), imx_gpio_quit(), and imx_gpio_write().
|
static |
Definition at line 98 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().
|
static |
Definition at line 103 of file imx_gpio.c.
Referenced by COMMAND_HANDLER(), imx_gpio_init(), imx_gpio_quit(), and imx_gpio_reset().
|
static |
Definition at line 104 of file imx_gpio.c.
Referenced by imx_gpio_init(), and imx_gpio_quit().