From: David B. <dbr...@us...> - 2010-02-28 07:55:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 63763345d94b11f106c832c23e8ad730a4485723 (commit) via e4a40d257d6c8fa393929cda50c0a1d777787da2 (commit) from e70d42a727bebc5ae0ce0b1386620d30ea00b05b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 63763345d94b11f106c832c23e8ad730a4485723 Author: Mariano Alvira <ma...@de...> Date: Sat Feb 27 22:52:34 2010 -0800 add board/redbee-econotag.cfg and JTAG support The Redbee Econotag is an open hardware development kit from Redwire, LLC (www.redwirellc.com/store), for the Freescale MC13224V ARM7TDMI + 802.15.4 radio. It includes both an MC13224V and an FT2232H (for JTAG and UART support). It has flexible power supply options. Additional features are: - inverted-F pcb antenna - 36 GPIO brought out to 0.1" pin header (includes all peripheral pins) - Reset button - Two push buttons (on kbi1-5 and kbi0-4) - USB-A connector, powered from USB - up to 16V external input - pads for optional buck inductor - pads for optional 32.768kHz crystal - 2x LEDS on TX_ON and RX_ON [ dbr...@us...: shrink lines; texi ] Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index aa8bed1..c6113ab 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2130,6 +2130,7 @@ to debug some other target. It can support the SWO trace mechanism. @item @b{olimex-jtag} Olimex ARM-USB-OCD and ARM-USB-Tiny @item @b{oocdlink} OOCDLink @c oocdlink ~= jtagkey_prototype_v1 +@item @b{redbee-econotag} Integrated with a Redbee development board. @item @b{sheevaplug} Marvell Sheevaplug development kit @item @b{signalyzer} Xverve Signalyzer @item @b{stm32stick} Hitex STM32 Performance Stick diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 5c6b655..d2e96d0 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -162,6 +162,7 @@ static int icebear_jtag_init(void); static int cortino_jtag_init(void); static int signalyzer_h_init(void); static int ktlink_init(void); +static int redbee_init(void); /* reset procedures for supported layouts */ static void usbjtag_reset(int trst, int srst); @@ -176,6 +177,7 @@ static void sheevaplug_reset(int trst, int srst); static void icebear_jtag_reset(int trst, int srst); static void signalyzer_h_reset(int trst, int srst); static void ktlink_reset(int trst, int srst); +static void redbee_reset(int trst, int srst); /* blink procedures for layouts that support a blinking led */ static void olimex_jtag_blink(void); @@ -263,6 +265,10 @@ static const struct ft2232_layout ft2232_layouts[] = .reset = ktlink_reset, .blink = ktlink_blink }, + { .name = "redbee-econotag", + .init = redbee_init, + .reset = redbee_reset, + }, { .name = NULL, /* END OF TABLE */ }, }; @@ -1577,6 +1583,36 @@ static void sheevaplug_reset(int trst, int srst) LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } +static void redbee_reset(int trst, int srst) +{ + if (trst == 1) + { + tap_set_state(TAP_RESET); + high_output &= ~nTRST; + } + else if (trst == 0) + { + high_output |= nTRST; + } + + if (srst == 1) + { + high_output &= ~nSRST; + } + else if (srst == 0) + { + high_output |= nSRST; + } + + /* command "set data bits low byte" */ + buffer_write(0x82); + buffer_write(high_output); + buffer_write(high_direction); + LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, " + "high_direction: 0x%2.2x", trst, srst, high_output, + high_direction); +} + static int ft2232_execute_runtest(struct jtag_command *cmd) { int retval; @@ -2478,6 +2514,73 @@ static int axm0432_jtag_init(void) return ERROR_OK; } +static int redbee_init(void) +{ + uint8_t buf[3]; + uint32_t bytes_written; + + low_output = 0x08; + low_direction = 0x2b; + + /* initialize low byte for jtag */ + /* command "set data bits low byte" */ + buf[0] = 0x80; + /* value (TMS = 1,TCK = 0, TDI = 0, nOE = 0) */ + buf[2] = low_direction; + /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ + buf[1] = low_output; + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) + || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'redbee' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + nTRST = 0x08; + nTRSTnOE = 0x0; /* No output enable for TRST*/ + nSRST = 0x04; + nSRSTnOE = 0x0; /* No output enable for SRST*/ + + high_output = 0x0; + high_direction = 0x0c; + + enum reset_types jtag_reset_config = jtag_get_reset_config(); + if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) + { + LOG_ERROR("can't set nTRSTOE to push-pull on redbee"); + } + else + { + high_output |= nTRST; + } + + if (jtag_reset_config & RESET_SRST_PUSH_PULL) + { + LOG_ERROR("can't set nSRST to push-pull on redbee"); + } + else + { + high_output |= nSRST; + } + + /* initialize high port */ + buf[0] = 0x82; /* command "set data bits high byte" */ + buf[1] = high_output; /* value */ + buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) + || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'redbee' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + return ERROR_OK; +} + static int jtagkey_init(void) { uint8_t buf[3]; diff --git a/tcl/board/redbee-econotag.cfg b/tcl/board/redbee-econotag.cfg new file mode 100644 index 0000000..7a02ce0 --- /dev/null +++ b/tcl/board/redbee-econotag.cfg @@ -0,0 +1,8 @@ +source [find target/mc13224v.cfg] + +# The redbee-econotag has an onboard ft2232h with channel A wired +# to the JTAG pins on the mc13224v +# channel B is wired to UART1 +interface ft2232 +ft2232_layout redbee-econotag +ft2232_vid_pid 0x0403 0x6010 commit e4a40d257d6c8fa393929cda50c0a1d777787da2 Author: Mariano Alvira <ma...@de...> Date: Sat Feb 27 22:51:41 2010 -0800 Add target/mc13224v.cfg The MC13224V is a FreeScale ARM7TDMI based IEEE802.15.4 platform for Zigbee and similar low-power wireless applications. Using PIP (Platform In Package) technology, it integrates: an RF balun and matching network; a buck converter (only an external inductor is necessary); 96KB of SRAM; and 128KB of non-volatile memory. It has an integrated bootloader and can boot from a variety of sources: external SPI or I2C non-volatile memory, an image loaded over UART1, or the internal non-volatile memory. The image loaded from one of these sources is executed directly from SRAM starting at location 0x00400000. Open source development code at http://mc1322x.devl.org Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/target/mc13224v.cfg b/tcl/target/mc13224v.cfg new file mode 100644 index 0000000..497e376 --- /dev/null +++ b/tcl/target/mc13224v.cfg @@ -0,0 +1,54 @@ +source [find bitsbytes.tcl] +source [find cpu/arm/arm7tdmi.tcl] +source [find memory.tcl] +source [find mmr_helpers.tcl] + +set CHIP_MAKER freescale +set CHIP_FAMILY mc1322x +set CHIP_NAME mc13224 +set N_RAM 1 +set RAM(0,BASE) 0x00400000 +set RAM(0,LEN) 0x18000 +set RAM(0,HUMAN) "internal SRAM" +set RAM(0,TYPE) "ram" +set RAM(0,RWX) $RWX_RWX +set RAM(0,ACCESS_WIDTH) $ACCESS_WIDTH_ANY + +# I AM LAZY... I create 1 region for all MMRs. +set N_MMREGS 1 +set MMREGS(0,CHIPSELECT) -1 +set MMREGS(0,BASE) 0x80000000 +set MMREGS(0,LEN) 0x00030000 +set MMREGS(0,HUMAN) "mm-regs" +set MMREGS(0,TYPE) "mmr" +set MMREGS(0,RWX) $RWX_RW +set MMREGS(0,ACCESS_WIDTH) $ACCESS_WIDTH_ANY + +set N_XMEM 0 + +set _CHIPNAME mc13224v +set _CPUTAPID 0x1f1f001d + +jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +reset_config srst_only +jtag_ntrst_delay 200 + +# rclk hasn't been working well. This maybe the mc13224v or something else. +#jtag_rclk 2000 +jtag_khz 2000 + +###################### +# Target configuration +###################### + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME arm7tdmi -chain-position $_TARGETNAME + +# Internal sram memory +$_TARGETNAME configure -work-area-phys 0x00408000 \ + -work-area-size 0x1000 \ + -work-area-backup 1 + +# flash support is pending (should be straightforward to implement) +#flash bank mc1322x 0 0 0 0 $_TARGETNAME ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 1 + src/jtag/drivers/ft2232.c | 103 +++++++++++++++++++++++++++++++++++++++++ tcl/board/redbee-econotag.cfg | 8 +++ tcl/target/mc13224v.cfg | 54 +++++++++++++++++++++ 4 files changed, 166 insertions(+), 0 deletions(-) create mode 100644 tcl/board/redbee-econotag.cfg create mode 100644 tcl/target/mc13224v.cfg hooks/post-receive -- Main OpenOCD repository |