OpenOCD
at91rm9200.c File Reference
Include dependency graph for at91rm9200.c:

Go to the source code of this file.

Data Structures

struct  device_t
 

Macros

#define AT91C_BASE_SYS   (0xfffff000)
 
#define NC   (0) /* not connected */
 
#define P0   (1 << 0)
 
#define P1   (1 << 1)
 
#define P10   (1 << 10)
 
#define P11   (1 << 11)
 
#define P12   (1 << 12)
 
#define P13   (1 << 13)
 
#define P14   (1 << 14)
 
#define P15   (1 << 15)
 
#define P16   (1 << 16)
 
#define P17   (1 << 17)
 
#define P18   (1 << 18)
 
#define P19   (1 << 19)
 
#define P2   (1 << 2)
 
#define P20   (1 << 20)
 
#define P21   (1 << 21)
 
#define P22   (1 << 22)
 
#define P23   (1 << 23)
 
#define P24   (1 << 24)
 
#define P25   (1 << 25)
 
#define P26   (1 << 26)
 
#define P27   (1 << 27)
 
#define P28   (1 << 28)
 
#define P29   (1 << 29)
 
#define P3   (1 << 3)
 
#define P30   (1 << 30)
 
#define P31   (1 << 31)
 
#define P4   (1 << 4)
 
#define P5   (1 << 5)
 
#define P6   (1 << 6)
 
#define P7   (1 << 7)
 
#define P8   (1 << 8)
 
#define P9   (1 << 9)
 
#define PIO_CODR   (13) /* clear output data */
 
#define PIO_ODR   (5) /* output disable */
 
#define PIO_OER   (4) /* output enable */
 
#define PIO_PDSR   (15) /* pin data status */
 
#define PIO_PER   (0) /* PIO enable */
 
#define PIO_PPUER   (25) /* pull-up enable */
 
#define PIO_SODR   (12) /* set output data */
 
#define PIOA   (0 << 7)
 
#define PIOB   (1 << 7)
 
#define PIOC   (2 << 7)
 
#define PIOD   (3 << 7)
 

Functions

static int at91rm9200_init (void)
 
static int at91rm9200_quit (void)
 
static bb_value_t at91rm9200_read (void)
 
static int at91rm9200_reset (int trst, int srst)
 
static int at91rm9200_write (int tck, int tms, int tdi)
 
 COMMAND_HANDLER (at91rm9200_handle_device_command)
 

Variables

struct adapter_driver at91rm9200_adapter_driver
 
static struct bitbang_interface at91rm9200_bitbang
 
static const struct command_registration at91rm9200_command_handlers []
 
static char * at91rm9200_device
 
static struct jtag_interface at91rm9200_interface
 
static int dev_mem_fd
 
static const struct device_tdevice
 
static const struct device_t devices []
 
static uint32_t * pio_base
 
static void * sys_controller
 

Macro Definition Documentation

◆ AT91C_BASE_SYS

#define AT91C_BASE_SYS   (0xfffff000)

Definition at line 18 of file at91rm9200.c.

◆ NC

#define NC   (0) /* not connected */

Definition at line 34 of file at91rm9200.c.

◆ P0

#define P0   (1 << 0)

Definition at line 35 of file at91rm9200.c.

◆ P1

#define P1   (1 << 1)

Definition at line 36 of file at91rm9200.c.

◆ P10

#define P10   (1 << 10)

Definition at line 45 of file at91rm9200.c.

◆ P11

#define P11   (1 << 11)

Definition at line 46 of file at91rm9200.c.

◆ P12

#define P12   (1 << 12)

Definition at line 47 of file at91rm9200.c.

◆ P13

#define P13   (1 << 13)

Definition at line 48 of file at91rm9200.c.

◆ P14

#define P14   (1 << 14)

Definition at line 49 of file at91rm9200.c.

◆ P15

#define P15   (1 << 15)

Definition at line 50 of file at91rm9200.c.

◆ P16

#define P16   (1 << 16)

Definition at line 51 of file at91rm9200.c.

◆ P17

#define P17   (1 << 17)

Definition at line 52 of file at91rm9200.c.

◆ P18

#define P18   (1 << 18)

Definition at line 53 of file at91rm9200.c.

◆ P19

#define P19   (1 << 19)

Definition at line 54 of file at91rm9200.c.

◆ P2

#define P2   (1 << 2)

Definition at line 37 of file at91rm9200.c.

◆ P20

#define P20   (1 << 20)

Definition at line 55 of file at91rm9200.c.

◆ P21

#define P21   (1 << 21)

Definition at line 56 of file at91rm9200.c.

◆ P22

#define P22   (1 << 22)

Definition at line 57 of file at91rm9200.c.

◆ P23

#define P23   (1 << 23)

Definition at line 58 of file at91rm9200.c.

◆ P24

#define P24   (1 << 24)

Definition at line 59 of file at91rm9200.c.

◆ P25

#define P25   (1 << 25)

Definition at line 60 of file at91rm9200.c.

◆ P26

#define P26   (1 << 26)

Definition at line 61 of file at91rm9200.c.

◆ P27

#define P27   (1 << 27)

Definition at line 62 of file at91rm9200.c.

◆ P28

#define P28   (1 << 28)

Definition at line 63 of file at91rm9200.c.

◆ P29

#define P29   (1 << 29)

Definition at line 64 of file at91rm9200.c.

◆ P3

#define P3   (1 << 3)

Definition at line 38 of file at91rm9200.c.

◆ P30

#define P30   (1 << 30)

Definition at line 65 of file at91rm9200.c.

◆ P31

#define P31   (1 << 31)

Definition at line 66 of file at91rm9200.c.

◆ P4

#define P4   (1 << 4)

Definition at line 39 of file at91rm9200.c.

◆ P5

#define P5   (1 << 5)

Definition at line 40 of file at91rm9200.c.

◆ P6

#define P6   (1 << 6)

Definition at line 41 of file at91rm9200.c.

◆ P7

#define P7   (1 << 7)

Definition at line 42 of file at91rm9200.c.

◆ P8

#define P8   (1 << 8)

Definition at line 43 of file at91rm9200.c.

◆ P9

#define P9   (1 << 9)

Definition at line 44 of file at91rm9200.c.

◆ PIO_CODR

#define PIO_CODR   (13) /* clear output data */

Definition at line 30 of file at91rm9200.c.

◆ PIO_ODR

#define PIO_ODR   (5) /* output disable */

Definition at line 28 of file at91rm9200.c.

◆ PIO_OER

#define PIO_OER   (4) /* output enable */

Definition at line 27 of file at91rm9200.c.

◆ PIO_PDSR

#define PIO_PDSR   (15) /* pin data status */

Definition at line 31 of file at91rm9200.c.

◆ PIO_PER

#define PIO_PER   (0) /* PIO enable */

Definition at line 26 of file at91rm9200.c.

◆ PIO_PPUER

#define PIO_PPUER   (25) /* pull-up enable */

Definition at line 32 of file at91rm9200.c.

◆ PIO_SODR

#define PIO_SODR   (12) /* set output data */

Definition at line 29 of file at91rm9200.c.

◆ PIOA

#define PIOA   (0 << 7)

Definition at line 21 of file at91rm9200.c.

◆ PIOB

#define PIOB   (1 << 7)

Definition at line 22 of file at91rm9200.c.

◆ PIOC

#define PIOC   (2 << 7)

Definition at line 23 of file at91rm9200.c.

◆ PIOD

#define PIOD   (3 << 7)

Definition at line 24 of file at91rm9200.c.

Function Documentation

◆ at91rm9200_init()

◆ at91rm9200_quit()

static int at91rm9200_quit ( void  )
static

Definition at line 262 of file at91rm9200.c.

References ERROR_OK.

◆ at91rm9200_read()

static bb_value_t at91rm9200_read ( void  )
static

Definition at line 113 of file at91rm9200.c.

References BB_HIGH, BB_LOW, device, pio_base, PIO_PDSR, device_t::TDO_MASK, and device_t::TDO_PIO.

◆ at91rm9200_reset()

static int at91rm9200_reset ( int  trst,
int  srst 
)
static

◆ at91rm9200_write()

static int at91rm9200_write ( int  tck,
int  tms,
int  tdi 
)
static

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( at91rm9200_handle_device_command  )

Definition at line 154 of file at91rm9200.c.

Variable Documentation

◆ at91rm9200_adapter_driver

struct adapter_driver at91rm9200_adapter_driver
Initial value:
= {
.name = "at91rm9200",
.transports = jtag_only,
.init = at91rm9200_init,
.quit = at91rm9200_quit,
.reset = at91rm9200_reset,
.jtag_ops = &at91rm9200_interface,
}
const char *const jtag_only[]
Definition: adapter.c:31
static const struct command_registration at91rm9200_command_handlers[]
Definition: at91rm9200.c:168
static int at91rm9200_quit(void)
Definition: at91rm9200.c:262
static int at91rm9200_init(void)
Definition: at91rm9200.c:195
static int at91rm9200_reset(int trst, int srst)
Definition: at91rm9200.c:139
static struct jtag_interface at91rm9200_interface
Definition: at91rm9200.c:179

Definition at line 154 of file at91rm9200.c.

◆ at91rm9200_bitbang

struct bitbang_interface at91rm9200_bitbang
static
Initial value:
= {
.read = at91rm9200_read,
.write = at91rm9200_write,
.blink = 0
}
static int at91rm9200_write(int tck, int tms, int tdi)
Definition: at91rm9200.c:118
static bb_value_t at91rm9200_read(void)
Definition: at91rm9200.c:113

Definition at line 105 of file at91rm9200.c.

Referenced by at91rm9200_init().

◆ at91rm9200_command_handlers

const struct command_registration at91rm9200_command_handlers[]
static
Initial value:
= {
{
.name = "at91rm9200_device",
.handler = &at91rm9200_handle_device_command,
.mode = COMMAND_CONFIG,
.help = "Set at91rm9200 device [default \"rea_ecr\"]",
.usage = "<device>",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_CONFIG
Definition: command.h:41

Definition at line 154 of file at91rm9200.c.

◆ at91rm9200_device

char* at91rm9200_device
static

Definition at line 90 of file at91rm9200.c.

Referenced by at91rm9200_init().

◆ at91rm9200_interface

struct jtag_interface at91rm9200_interface
static
Initial value:
= {
.execute_queue = bitbang_execute_queue,
}
int bitbang_execute_queue(void)
Definition: bitbang.c:281

Definition at line 154 of file at91rm9200.c.

◆ dev_mem_fd

int dev_mem_fd
static

Definition at line 95 of file at91rm9200.c.

Referenced by at91rm9200_init().

◆ device

◆ devices

const struct device_t devices[]
static
Initial value:
= {
{ "rea_ecr", PIOD, P27, PIOA, NC, PIOD, P23, PIOD, P24, PIOD, P26, PIOC, P5 },
{ .name = NULL },
}
#define PIOA
Definition: at91rm9200.c:21
#define NC
Definition: at91rm9200.c:34
#define P5
Definition: at91rm9200.c:40
#define P26
Definition: at91rm9200.c:61
#define P23
Definition: at91rm9200.c:58
#define P24
Definition: at91rm9200.c:59
#define P27
Definition: at91rm9200.c:62
#define PIOC
Definition: at91rm9200.c:23
#define PIOD
Definition: at91rm9200.c:24
#define NULL
Definition: usb.h:16

Definition at line 1 of file at91rm9200.c.

Referenced by at91rm9200_init(), and kitprog_generic_acquire().

◆ pio_base

uint32_t* pio_base
static

Definition at line 97 of file at91rm9200.c.

Referenced by at91rm9200_init(), at91rm9200_read(), at91rm9200_reset(), and at91rm9200_write().

◆ sys_controller

void* sys_controller
static

Definition at line 96 of file at91rm9200.c.

Referenced by at91rm9200_init().