|
OpenOCD
|

Go to the source code of this file.
Data Structures | |
| struct | initial_gpio_state |
Macros | |
| #define | BCM2835_GPIO_BASE (bcm2835_peri_base + 0x200000) /* GPIO controller */ |
| #define | BCM2835_GPIO_CLEAR_REG_BITS(offset, bit_mask) (*(pio_base + (offset)) &= ~(bit_mask)) |
| #define | BCM2835_GPIO_CLR_ADDR(gpio_pin_num) (pio_base + 10 + ((gpio_pin_num) / 32)) |
| #define | BCM2835_GPIO_LEVEL_ADDR(gpio_pin_num) (pio_base + 13 + ((gpio_pin_num) / 32)) |
| #define | BCM2835_GPIO_MODE_ADDR(gpio_pin_num) (pio_base + ((gpio_pin_num) / 10)) |
| #define | BCM2835_GPIO_MODE_INPUT 0 |
| #define | BCM2835_GPIO_MODE_OUTPUT 1 |
| #define | BCM2835_GPIO_REG_READ(offset) (*(pio_base + (offset))) |
| #define | BCM2835_GPIO_REG_WRITE(offset, value) (*(pio_base + (offset)) = (value)) |
| #define | BCM2835_GPIO_SET_ADDR(gpio_pin_num) (pio_base + 7 + ((gpio_pin_num) / 32)) |
| #define | BCM2835_GPIO_SET_REG_BITS(offset, bit_mask) (*(pio_base + (offset)) |= (bit_mask)) |
| #define | BCM2835_PADS_GPIO_0_27 (bcm2835_peri_base + 0x100000) |
| #define | BCM2835_PADS_GPIO_0_27_OFFSET (0x2c / 4) |
Functions | |
| static void | bcm2835_delay (void) |
| static bool | bcm2835_get_level (unsigned int gpio_pin_num) |
| static const char * | bcm2835_get_mem_dev (void) |
| static unsigned int | bcm2835_get_mode (unsigned int gpio_pin_num) |
| static void | bcm2835_gpio_clear (unsigned int gpio_pin_num) |
| static void | bcm2835_gpio_set (unsigned int gpio_pin_num) |
| static void | bcm2835_gpio_synchronize (void) |
| static void | bcm2835_set_input (unsigned int gpio_pin_num) |
| static void | bcm2835_set_mode (unsigned int gpio_pin_num, unsigned char mode) |
| static void | bcm2835_set_output (unsigned int gpio_pin_num) |
| static void | bcm2835_swdio_drive (bool is_output) |
| static int | bcm2835_swdio_read (void) |
| static int | bcm2835gpio_blink (bool on) |
| static int | bcm2835gpio_init (void) |
| static bool | bcm2835gpio_jtag_mode_possible (void) |
| static int | bcm2835gpio_khz (int khz, int *jtag_speed) |
| static void | bcm2835gpio_munmap (void) |
| static int | bcm2835gpio_quit (void) |
| static enum bb_value | bcm2835gpio_read (void) |
| static int | bcm2835gpio_reset (int trst, int srst) |
| static int | bcm2835gpio_speed (int speed) |
| static int | bcm2835gpio_speed_div (int speed, int *khz) |
| static bool | bcm2835gpio_swd_mode_possible (void) |
| static int | bcm2835gpio_swd_write_fast (int swclk, int swdio) |
| static int | bcm2835gpio_swd_write_generic (int swclk, int swdio) |
| static int | bcm2835gpio_write (int tck, int tms, int tdi) |
| COMMAND_HANDLER (bcm2835gpio_handle_peripheral_base) | |
| COMMAND_HANDLER (bcm2835gpio_handle_peripheral_mem_dev) | |
| COMMAND_HANDLER (bcm2835gpio_handle_speed_coeffs) | |
| static void | initialize_gpio (enum adapter_gpio_config_index idx) |
| static bool | is_gpio_config_valid (enum adapter_gpio_config_index idx) |
| static void | restore_gpio (enum adapter_gpio_config_index idx) |
| static void | set_gpio_value (const struct adapter_gpio_config *gpio_config, int value) |
| #define BCM2835_GPIO_BASE (bcm2835_peri_base + 0x200000) /* GPIO controller */ |
Definition at line 24 of file bcm2835gpio.c.
Definition at line 43 of file bcm2835gpio.c.
| #define BCM2835_GPIO_CLR_ADDR | ( | gpio_pin_num | ) | (pio_base + 10 + ((gpio_pin_num) / 32)) |
Definition at line 48 of file bcm2835gpio.c.
| #define BCM2835_GPIO_LEVEL_ADDR | ( | gpio_pin_num | ) | (pio_base + 13 + ((gpio_pin_num) / 32)) |
Definition at line 49 of file bcm2835gpio.c.
| #define BCM2835_GPIO_MODE_ADDR | ( | gpio_pin_num | ) | (pio_base + ((gpio_pin_num) / 10)) |
Definition at line 46 of file bcm2835gpio.c.
| #define BCM2835_GPIO_MODE_INPUT 0 |
Definition at line 30 of file bcm2835gpio.c.
| #define BCM2835_GPIO_MODE_OUTPUT 1 |
Definition at line 31 of file bcm2835gpio.c.
Definition at line 34 of file bcm2835gpio.c.
Definition at line 37 of file bcm2835gpio.c.
| #define BCM2835_GPIO_SET_ADDR | ( | gpio_pin_num | ) | (pio_base + 7 + ((gpio_pin_num) / 32)) |
Definition at line 47 of file bcm2835gpio.c.
Definition at line 40 of file bcm2835gpio.c.
| #define BCM2835_PADS_GPIO_0_27 (bcm2835_peri_base + 0x100000) |
Definition at line 26 of file bcm2835gpio.c.
| #define BCM2835_PADS_GPIO_0_27_OFFSET (0x2c / 4) |
Definition at line 27 of file bcm2835gpio.c.
|
inlinestatic |
Definition at line 149 of file bcm2835gpio.c.
References jtag_delay.
Referenced by bcm2835gpio_swd_write_fast(), bcm2835gpio_swd_write_generic(), and bcm2835gpio_write().
|
inlinestatic |
Definition at line 96 of file bcm2835gpio.c.
References BCM2835_GPIO_REG_READ.
Referenced by bcm2835gpio_read().
|
inlinestatic |
Definition at line 132 of file bcm2835gpio.c.
References bcm2835_peri_mem_dev.
Referenced by bcm2835gpio_init(), and COMMAND_HANDLER().
|
inlinestatic |
Definition at line 90 of file bcm2835gpio.c.
References BCM2835_GPIO_REG_READ.
Referenced by bcm2835gpio_read().
|
inlinestatic |
Definition at line 127 of file bcm2835gpio.c.
References BCM2835_GPIO_REG_WRITE.
Referenced by restore_gpio(), and set_gpio_value().
|
inlinestatic |
Definition at line 121 of file bcm2835gpio.c.
References BCM2835_GPIO_REG_WRITE.
Referenced by restore_gpio(), and set_gpio_value().
|
inlinestatic |
Definition at line 140 of file bcm2835gpio.c.
Referenced by bcm2835_swdio_drive(), bcm2835gpio_read(), bcm2835gpio_swd_write_fast(), bcm2835gpio_write(), restore_gpio(), and set_gpio_value().
|
inlinestatic |
Definition at line 102 of file bcm2835gpio.c.
References BCM2835_GPIO_CLEAR_REG_BITS.
Referenced by bcm2835_set_mode(), bcm2835gpio_read(), and set_gpio_value().
|
inlinestatic |
Definition at line 108 of file bcm2835gpio.c.
References BCM2835_GPIO_SET_REG_BITS, bcm2835_set_input(), and mode.
Referenced by bcm2835_set_output(), and restore_gpio().
|
inlinestatic |
Definition at line 115 of file bcm2835gpio.c.
References BCM2835_GPIO_MODE_OUTPUT, and bcm2835_set_mode().
Referenced by bcm2835gpio_read(), and set_gpio_value().
|
static |
Definition at line 309 of file bcm2835gpio.c.
References ADAPTER_GPIO_IDX_SWDIO_DIR, bcm2835_gpio_synchronize(), gpio_control, is_gpio_config_valid(), and set_gpio_value().
|
static |
Definition at line 325 of file bcm2835gpio.c.
References gpio_control.
|
static |
Definition at line 468 of file bcm2835gpio.c.
|
static |
Definition at line 494 of file bcm2835gpio.c.
References adapter_gpio_config::active_low, ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, 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, bcm2835_get_mem_dev(), BCM2835_GPIO_BASE, BCM2835_GPIO_CLR_ADDR, BCM2835_GPIO_LEVEL_ADDR, BCM2835_GPIO_MODE_ADDR, BCM2835_GPIO_SET_ADDR, BCM2835_PADS_GPIO_0_27, BCM2835_PADS_GPIO_0_27_OFFSET, bcm2835gpio_bitbang_swd_write_fast, bcm2835gpio_bitbang_swd_write_generic, bcm2835gpio_jtag_mode_possible(), bcm2835gpio_swd_mode_possible(), dev_mem_fd, ERROR_JTAG_INIT_FAILED, ERROR_OK, gpio_control, adapter_gpio_config::gpio_num, initial_drive_strength_etc, initialize_gpio(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, pads_base, pio_base, transport_is_jtag(), and transport_is_swd().
|
static |
Definition at line 433 of file bcm2835gpio.c.
References ADAPTER_GPIO_IDX_TCK, ADAPTER_GPIO_IDX_TDI, ADAPTER_GPIO_IDX_TDO, ADAPTER_GPIO_IDX_TMS, and is_gpio_config_valid().
Referenced by bcm2835gpio_init().
|
static |
Definition at line 331 of file bcm2835gpio.c.
References DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, LOG_DEBUG, speed_coeff, and speed_offset.
|
static |
Definition at line 455 of file bcm2835gpio.c.
|
static |
Definition at line 647 of file bcm2835gpio.c.
|
static |
Definition at line 208 of file bcm2835gpio.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, bcm2835_get_level(), bcm2835_get_mode(), bcm2835_gpio_synchronize(), bcm2835_set_input(), bcm2835_set_output(), is_gpio_config_valid(), LOG_DEBUG, LOG_WARNING, initial_gpio_state::mode, mode, initial_gpio_state::output_level, and set_gpio_value().
|
static |
Definition at line 287 of file bcm2835gpio.c.
References ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_TRST, ERROR_OK, is_gpio_config_valid(), LOG_DEBUG, and set_gpio_value().
|
static |
Definition at line 352 of file bcm2835gpio.c.
References ERROR_OK, and jtag_delay.
|
static |
Definition at line 344 of file bcm2835gpio.c.
References ERROR_OK, speed_coeff, and speed_offset.
|
static |
Definition at line 446 of file bcm2835gpio.c.
References ADAPTER_GPIO_IDX_SWCLK, ADAPTER_GPIO_IDX_SWDIO, and is_gpio_config_valid().
Referenced by bcm2835gpio_init().
|
static |
Definition at line 263 of file bcm2835gpio.c.
References bcm2835_delay(), bcm2835_gpio_synchronize(), ERROR_OK, and gpio_control.
|
static |
Definition at line 276 of file bcm2835gpio.c.
References ADAPTER_GPIO_IDX_SWCLK, ADAPTER_GPIO_IDX_SWDIO, bcm2835_delay(), ERROR_OK, and set_gpio_value().
|
static |
Definition at line 249 of file bcm2835gpio.c.
References bcm2835_delay(), bcm2835_gpio_synchronize(), ERROR_OK, and gpio_control.
| COMMAND_HANDLER | ( | bcm2835gpio_handle_peripheral_base | ) |
Definition at line 382 of file bcm2835gpio.c.
| COMMAND_HANDLER | ( | bcm2835gpio_handle_peripheral_mem_dev | ) |
Definition at line 370 of file bcm2835gpio.c.
References bcm2835_get_mem_dev(), bcm2835_peri_mem_dev, CMD, CMD_ARGC, CMD_ARGV, command_print(), and ERROR_OK.
| COMMAND_HANDLER | ( | bcm2835gpio_handle_speed_coeffs | ) |
Definition at line 358 of file bcm2835gpio.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, speed_coeff, and speed_offset.
|
static |
Definition at line 208 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init().
|
static |
Definition at line 155 of file bcm2835gpio.c.
References adapter_gpio_config::gpio_num.
Referenced by bcm2835_swdio_drive(), bcm2835gpio_jtag_mode_possible(), bcm2835gpio_read(), bcm2835gpio_reset(), bcm2835gpio_swd_mode_possible(), and restore_gpio().
|
static |
Definition at line 194 of file bcm2835gpio.c.
References bcm2835_gpio_clear(), BCM2835_GPIO_MODE_OUTPUT, bcm2835_gpio_set(), bcm2835_gpio_synchronize(), bcm2835_set_mode(), is_gpio_config_valid(), and mode.
|
static |
Definition at line 161 of file bcm2835gpio.c.
References adapter_gpio_config::active_low, ADAPTER_GPIO_DRIVE_MODE_OPEN_DRAIN, ADAPTER_GPIO_DRIVE_MODE_OPEN_SOURCE, ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, bcm2835_gpio_clear(), bcm2835_gpio_set(), bcm2835_gpio_synchronize(), bcm2835_set_input(), bcm2835_set_output(), adapter_gpio_config::drive, and adapter_gpio_config::gpio_num.
Referenced by bcm2835_swdio_drive(), bcm2835gpio_read(), bcm2835gpio_reset(), and bcm2835gpio_swd_write_generic().
|
static |
Definition at line 60 of file bcm2835gpio.c.
|
static |
Definition at line 23 of file bcm2835gpio.c.
|
static |
Definition at line 22 of file bcm2835gpio.c.
Referenced by bcm2835_get_mem_dev(), and COMMAND_HANDLER().
| struct adapter_driver bcm2835gpio_adapter_driver |
Definition at line 647 of file bcm2835gpio.c.
|
static |
Definition at line 468 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init().
|
static |
Definition at line 468 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init().
|
static |
Definition at line 382 of file bcm2835gpio.c.
|
static |
Definition at line 647 of file bcm2835gpio.c.
|
static |
Definition at line 382 of file bcm2835gpio.c.
|
static |
Definition at line 51 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init().
| struct { ... } gpio_control |
Referenced by bcm2835_swdio_drive(), bcm2835_swdio_read(), bcm2835gpio_init(), bcm2835gpio_swd_write_fast(), and bcm2835gpio_write().
|
static |
Definition at line 65 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init().
|
static |
|
static |
Definition at line 58 of file bcm2835gpio.c.
Referenced by bcm2835_delay(), and bcm2835gpio_speed().
|
static |
Definition at line 53 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init(), and bcm2835gpio_munmap().
|
static |
Definition at line 52 of file bcm2835gpio.c.
Referenced by bcm2835gpio_init(), and bcm2835gpio_munmap().
|
static |
Definition at line 56 of file bcm2835gpio.c.
Referenced by bcm2835gpio_khz(), bcm2835gpio_speed_div(), and COMMAND_HANDLER().
|
static |
Definition at line 57 of file bcm2835gpio.c.
Referenced by bcm2835gpio_khz(), bcm2835gpio_speed_div(), and COMMAND_HANDLER().
| volatile uint32_t* swclk_clr_set_addr[2] |
Definition at line 76 of file bcm2835gpio.c.
| uint32_t swclk_mask |
Definition at line 77 of file bcm2835gpio.c.
| bool swdio_active_low |
Definition at line 72 of file bcm2835gpio.c.
| volatile uint32_t* swdio_clr_set_addr[2] |
Definition at line 68 of file bcm2835gpio.c.
| uint32_t swdio_level_shift_bits |
Definition at line 71 of file bcm2835gpio.c.
| uint32_t swdio_mask |
Definition at line 69 of file bcm2835gpio.c.
| volatile uint32_t* swdio_mode_addr |
Definition at line 73 of file bcm2835gpio.c.
| uint32_t swdio_mode_input_mask |
Definition at line 74 of file bcm2835gpio.c.
| uint32_t swdio_mode_output_mask |
Definition at line 75 of file bcm2835gpio.c.
| volatile uint32_t* swdio_read_level_addr |
Definition at line 70 of file bcm2835gpio.c.
| volatile uint32_t* tck_clr_set_addr[2] |
Definition at line 82 of file bcm2835gpio.c.
| uint32_t tck_mask |
Definition at line 83 of file bcm2835gpio.c.
| volatile uint32_t* tdi_clr_set_addr[2] |
Definition at line 78 of file bcm2835gpio.c.
| uint32_t tdi_mask |
Definition at line 79 of file bcm2835gpio.c.
Referenced by rlink_scan().
| bool tdo_active_low |
Definition at line 86 of file bcm2835gpio.c.
| uint32_t tdo_level_shift_bits |
Definition at line 85 of file bcm2835gpio.c.
| volatile uint32_t* tdo_read_level_addr |
Definition at line 84 of file bcm2835gpio.c.
| volatile uint32_t* tms_clr_set_addr[2] |
Definition at line 80 of file bcm2835gpio.c.
| uint32_t tms_mask |
Definition at line 81 of file bcm2835gpio.c.