jt_instr.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "dbg_msg.h"
#include "jt_tap.h"
#include "jt_instr.h"
#include "jt_arm.h"
#include "jt_flash.h"
#include "jedec_vendorID.h"

Data Structures

Functions

Variables


Detailed Description

Intructions send to the TAP Controller

Support functions to access the JTAG interface via parallel port


Function Documentation

int jtag_exchange_instr ( const char *  cmd_out,
char *  cmd_in 
)

Place a command into the JTAG instruction register (IR) of the active device.
Each bit value is held within a single char.
It must be either 0 or 1 (but not '0' nor '1').

Note this function is called in an more or less "human readable notation" with
MSB shiftet in first and MSB shifted out first
while Hardware makes in real live;
LSB shifted in first and LSB shifted out first

So the bit order of the send data is swapped

Parameters:
cmd_out pointer to string of bits sent to the IR.
cmd_in pointer to string of bits received from the IR.
Returns:
true = 1 on success else false = 0

References active_jtag_device, DBG_LEVEL_JTAG_INSTR, IF_DBG, chain_info::instr_len, chain_info::prev, tap_instr(), transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), and transaction::uplevel.

Referenced by jtag_identify_devices().

int jtag_exchange_data ( int  len,
char *  data_out,
char *  data_in 
)

Place a value into the JTAG data register (DR) of the active device.
Each bit value is held within a single char.
It must be either 0 or 1 (but not '0' nor '1').

Note this function is called in an more or less "human readable notation" with
MSB shiftet in first and MSB shifted out first
while Hardware makes in real live;
LSB shifted in first and LSB shifted out first

So the bit order of the send and received data is swapped

Parameters:
len number of data bit to send and receive
data_out pointer to string of bits send to the DR.
data_in pointer to string of bits received from the DR.
Returns:
true = 1 on success else false = 0

References active_jtag_device, DBG_LEVEL_JTAG_INSTR, IF_DBG, transaction::parameter, tap_data(), transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), and transaction::uplevel.

Referenced by jt_str91xflash_EraseSector(), jt_str91xflash_GetConfig(), jt_str91xflash_ReadSector(), jt_str91xflash_SectorBlankCheck(), jt_str91xflash_WriteSector(), jtag_arm720_CP15DataExchange(), jtag_arm720_CP15InstrReg(), jtag_arm7_mov_chain1_data(), jtag_arm920_CP15Interpret(), jtag_arm920_CP15PhysRegRead(), jtag_arm920_CP15PhysRegWrite(), jtag_arm926_CP15RegRead(), jtag_arm926_CP15RegWrite(), jtag_arm966_CP15RegRead(), jtag_arm966_CP15RegWrite(), jtag_arm9_mov_chain1_data(), jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_IceRT_RegWrite_getPrevData(), jtag_arm_set_chain(), jtag_cortex_apacc_RegRead(), jtag_cortex_apacc_RegWrite(), jtag_cortex_dpacc_RegRead(), jtag_cortex_dpacc_RegWrite(), and jtag_identify_devices().

static int jt_info_idcode ( int  val  )  [static]
int jtag_identify_devices ( void   ) 
void jtag_eos ( int  now  ) 

End Of Sequence
This Signal set TAP controller into run/idle state.
Step from RESET, Update-DR, Update-IR or Run/Idle state into Run/Idle state
e.g. this indicates an end of a debug communication and releases the CPU to work in non blocking normal mode.

Parameters:
now set 1 to enter TAP Run/Idle state now
Returns:
-

References tap_idle().

Referenced by gdb_restart(), jt_str91xflash_EraseSector(), jt_str91xflash_ReadSector(), jt_str91xflash_SectorBlankCheck(), jt_str91xflash_WriteSector(), jtag_arm720_CP15_FlushCache(), jtag_arm720_CP15_ReadFCSEpidReg(), jtag_arm720_CP15_ReadMMUcontrolReg(), jtag_arm720_CP15_ReadTTB(), jtag_arm720_CP15_WriteMMUcontrolReg(), jtag_arm720_CP15_WriteTTB(), jtag_arm7_mov_chain1_data(), jtag_arm7_ReadCP15Info(), jtag_arm7_ReadCpuRegs(), jtag_arm9_mov_chain1_data(), jtag_arm9_ReadCpuRegs(), jtag_arm_chain1_sysspeed_restart(), jtag_arm_FinalExitDebug(), jtag_arm_IceRT_PutAnyBreakPoint(), jtag_arm_iceRT_StopRunningProgram(), jtag_arm_Mointor2DebugMode(), jtag_arm_RunProgram(), jtag_arm_Step(), jtag_cortex_AHB_WriteByte(), jtag_cortex_AHB_WriteHalfword(), jtag_cortex_AHB_WriteMemoryBuf(), jtag_cortex_AHB_WriteWord(), jtag_cortex_apacc_RegRead(), jtag_cortex_apacc_RegWrite(), jtag_cortex_core_ApplicationInterruptResetControl_ReadRegister(), jtag_cortex_core_BusFaultAddress_ReadRegister(), jtag_cortex_core_ConfigurationControl_ReadRegister(), jtag_cortex_core_CPUID_ReadRegister(), jtag_cortex_core_debugExceptionMonitorControl_ReadRegister(), jtag_cortex_core_DebugFaultStatus_ReadRegister(), jtag_cortex_core_debugHaltingControlStatus_ReadRegister(), jtag_cortex_core_HardFaultStatus_ReadRegister(), jtag_cortex_core_MemManageAddress_ReadRegister(), jtag_cortex_core_PollDbgState(), jtag_cortex_core_ReadCpuRegs(), jtag_cortex_core_ReadDebugReg(), jtag_cortex_core_restart(), jtag_cortex_core_RunProgram(), jtag_cortex_core_StopRunningProgram(), jtag_cortex_core_WriteCpuRegs(), jtag_cortex_dwt_comp_RegRead(), jtag_cortex_dwt_ctrl_RegRead(), jtag_cortex_dwt_function_RegRead(), jtag_cortex_dwt_mask_RegRead(), jtag_cortex_fpb_comp_RegRead(), jtag_cortex_fpb_ctrl_RegRead(), and jtag_test().

void jtag_start ( void   ) 

Power on to adapter at LPT-driver cable.
Issue TAP - Reset.
Enter Run/idle state

Parameters:
- 
Returns:
-

References tap_start().

Referenced by gdb_restart().

void jtag_reset ( void   ) 

run trough tap states until reaching RESET state

Parameters:
- 
Returns:
-

References tap_reset().

Referenced by gdb_restart(), and jtag_test().

void jtag_hard_reset ( void   ) 

grant TRESET and SRESET lines (if exists)
grant Sytem reset for timeline of tap_grant_sreset_timout
continue after tap_settle_system_timeout

Parameters:
- 
Returns:
-

References tap_hard_reset().

Referenced by gdb_restart(), and jtag_test().

void jtag_linger ( int  delay  ) 

Call tap_delay a number of times.
Delay by reading value from LPT status port (using inb())

Parameters:
delay number
Returns:
-

References tap_delay().

Referenced by jtag_arm_chain1_sysspeed_restart().


Variable Documentation

char jedec_unknown[] = "vendor unknown" [static]

Referenced by jt_info_idcode().

const char instr_extest[] = {0,0,0,0,'$'}
const char instr_scan_n[] = {0,0,1,0,'$'}

Referenced by jtag_arm_set_chain().

const char instr_sample[] = {0,0,1,1,'$'}
const char instr_restart[] = {0,1,0,0,'$'}
const char instr_clamp[] = {0,1,0,1,'$'}
const char instr_highz[] = {0,1,1,1,'$'}
const char instr_dapabort[] = {1,0,0,0,'$'}
const char instr_clampz[] = {1,0,0,1,'$'}
const char instr_dpacc[] = {1,0,1,0,'$'}
const char instr_apacc[] = {1,0,1,1,'$'}
const char instr_intest[] = {1,1,0,0,'$'}
const char instr_idcode[] = {1,1,1,0,'$'}

Referenced by jtag_identify_devices().

const char instr_bypass[] = {1,1,1,1,'$'}
const int instr_length = 4

Referenced by jtag_identify_devices().

char jtag_data_IDcode[32] [static]

Referenced by jtag_identify_devices().

const int data_length_of_IDCODE = 32 [static]

Referenced by jtag_identify_devices().

const char instr_str91xFlash_bypass[] = {1,1,1,1, 1,1,1,1, '$'}

0xFF Bypass 1 bit len

const char instr_str91xFlash_idcode[] = {1,1,1,1, 1,1,1,0, '$'}

0xFE Idcode 32 bit len

Referenced by jtag_identify_devices().

const char instr_str91xFlash_usercode[] = {0,0,0,0, 0,1,1,0, '$'}

0x06 Usercode 32 bit len

const char instr_str91xFlash_isc_configuration[] = {0,0,0,0, 0,1,1,1, '$'}

0x07 Sector-Protect 64 bit len

Referenced by jt_str91xflash_GetConfig().

const char instr_str91xFlash_isc_enable[] = {0,0,0,0, 1,1,0,0, '$'}
const char instr_str91xFlash_isc_disable[] = {0,0,0,0, 1,1,1,1, '$'}
const char instr_str91xFlash_isc_noop[] = {0,0,0,1, 0,0,0,0, '$'}
const char instr_str91xFlash_isc_address_shift[] = {0,0,0,1, 0,0,0,1, '$'}

0x11 ISC_Address 8 bit len

Referenced by jt_str91xflash_ReadSector(), and jt_str91xflash_WriteSector().

const char instr_str91xFlash_isc_clr_status[] = {0,0,0,1, 0,0,1,1, '$'}
const char instr_str91xFlash_isc_program[] = {0,0,1,0, 0,0,0,0, '$'}

0x20 ISC_Data 64 bit len

Referenced by jt_str91xflash_WriteSector().

const char instr_str91xFlash_isc_program_security[] = {0,0,1,0, 0,0,1,0, '$'}

0x22 ISC_Default 8 bit len

const char instr_str91xFlash_isc_program_uc[] = {0,0,1,0, 0,0,1,1, '$'}

0x23 Usercode 32 bit len

const char instr_str91xFlash_isc_erase[] = {0,0,1,1, 0,0,0,0, '$'}

0x30 ISC_Sector 64 bit len

Referenced by jt_str91xflash_EraseSector().

const char instr_str91xFlash_isc_read[] = {0,1,0,1, 0,0,0,0, '$'}

0x50 ISC_Data 64 bit len

Referenced by jt_str91xflash_ReadSector().

const char instr_str91xFlash_isc_blank_check[] = {0,1,1,0, 0,0,0,0, '$'}

0x60 ISC_Sector 64 bit len

Referenced by jt_str91xflash_EraseSector(), and jt_str91xflash_SectorBlankCheck().

const int instr_str91xFlash_length = 8

Referenced by jtag_identify_devices().

Referenced by jtag_identify_devices().

char unknown_description[] = "unknown" [static]

Referenced by jt_info_idcode().

struct translateID translateID[] [static]

This file is part of the documentation for JTAG-GDB Server for ARM .

Generated on Mon Feb 15 21:23:21 2010 by doxygen 1.6.2.