Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

JTAGpxa250 Class Reference

PXA250 specific JTAG basic controls. More...

#include <jtagpxa250.h>

Collaboration diagram for JTAGpxa250:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Cp15Reg
 list of registers of the coprocessor 15. See User's manual, section 10.2.


Public Methods

void registerTargetReadyCallback (void(*func)(void *), void *arg)
 Register a callback function, that will be called each time the target gets ready.

void unregisterTargetReadyCallback (void(*func)(void *))
 Unregister a callback function, so it won't be called each time the target gets ready.

bool targetReady ()
 Returns true if target is ready to accept new commands.

bool init (int argc, char **argv)
 initialize the JTAG connection.
Returns:
true on success.


bool loadDebugHandler ()
 stop CPU execution, load the debug handler and boot it.
Returns:
true on success, false on error.
More...


bool check ()
 prints some information on the connected device.
Returns:
true if a pxa250 is present.


void invalidateMiniIC ()
 invalidates the mini instruction cache.

void invalidateMainICLine (unsigned int address)
 invalidate a main cache line. More...

void loadICLine (bool mini, unsigned int address, unsigned int instructions[])
 load a line of 8 instructions of 32 bits each.

void getReadyForUpload ()
 reset the CPU, invalidate the cache and put the cpu in hold_rst mode.

void boot ()
 let the cpu boot by unsetting hold_rst.

bool loadIC (bool mini, unsigned int startAddr, unsigned int instructions[], unsigned int nbInst)
 Load arbitrary code in the instruction cache.

void putData (unsigned int startAddr, unsigned int words, unsigned int data[], bool halfword=false)
 Put any data into any memory address in the device's address space. More...

void putData (unsigned int addr, unsigned int data, bool halfWord=false)
 Put a single word of data into any memory address in the device's address space.

void getData (unsigned int startAddr, unsigned int words, unsigned int data[])
 Get any data from any memory address in the device's address space. More...

void execute (unsigned int startAddr, unsigned int spAddr)
 Execute from memory with a given stack pointer. Obsoleted by continueCmd().

void extBreak ()
 Cause an external break, enterring a debug exception.

void reboot ()
 reboot the CPU.

void pollForTX ()
void continueCmd ()
 send a 'c' command to the debug handler, telling it to resume execution.

bool setSavePlace (unsigned int place, unsigned int value)
unsigned int getSavePlace (unsigned int place)
bool setCp15DebugRegister (unsigned int value, Cp15Reg reg)
 write debug registers.


Static Public Methods

void intToCharArrayLE (unsigned int src, unsigned char dest[])
 Convert an int in host endianness format to little endian.

int charArrayLEToInt (unsigned char src[])
 Convert a little endian char array to a host endian coded int.


Private Methods

void fastWriteRX (unsigned int val, bool cont)
 write RX fast, do not wait for answer.

bool readTX (unsigned int *val, int max_retry=MAX_RETRY_COUNT)

Private Attributes

unsigned char currentIREG
 cache current instruction, to gain speed.

bool isTargetReady

Detailed Description

PXA250 specific JTAG basic controls.

Definition at line 95 of file jtagpxa250.h.


Member Function Documentation

void JTAGpxa250::getData unsigned int    startAddr,
unsigned int    words,
unsigned int    data[]
 

Get any data from any memory address in the device's address space.

This function save size 32 bits words data from any address.

Parameters:
startAddr  address where the transfer begins
words  size in 32 bit words of the transfer
data  data array

Definition at line 514 of file jtagpxa250.cpp.

References pollForTX(), and readTX().

unsigned int JTAGpxa250::getSavePlace unsigned int    place
 

Read a register. The result is only meaningfull if the target is ready.

Parameters:
place  the register to read. See target_to_host.h.
Returns:
the value of the register.

Definition at line 664 of file jtagpxa250.cpp.

References isTargetReady.

void JTAGpxa250::invalidateMainICLine unsigned int    address
 

invalidate a main cache line.

Invalidate a cache line. A cache line contains 8 instructions, thus addresses in the range [address, address + 31] will be invalidated.

Parameters:
address  the address to invalidate

Definition at line 179 of file jtagpxa250.cpp.

References JTAGControl::dreg().

bool JTAGpxa250::loadDebugHandler  
 

stop CPU execution, load the debug handler and boot it.

Returns:
true on success, false on error.

I'm not sure about this method. The work is also done in LoadICCmd::exec(). Anyway, it might still be usefull.

Definition at line 76 of file jtagpxa250.cpp.

References boot(), charArrayLEToInt(), check(), DEBUG_HANDLER_FILE, getReadyForUpload(), and loadIC().

void JTAGpxa250::pollForTX  
 

This function polls the TX jtag register. If it's empty, pollForTX returns immediatly. Otherwise, it reads what the debug handler wants to say, and do the required processing.

Definition at line 583 of file jtagpxa250.cpp.

References isTargetReady, and readTX().

Referenced by boot(), continueCmd(), extBreak(), getData(), putData(), reboot(), and setCp15DebugRegister().

void JTAGpxa250::putData unsigned int    startAddr,
unsigned int    words,
unsigned int    data[],
bool    halfword = false
 

Put any data into any memory address in the device's address space.

This function loads size 32 bits words data into any address.

Parameters:
startAddr  address where the transfer begins
words  number of 32 bit words of the transfer, size in byte is words*4
data  data array
halfword  if true, only 16 bits per word will be written, and the address counter will be incremented by 2 instead of 4.

Definition at line 475 of file jtagpxa250.cpp.

References fastWriteRX(), pollForTX(), and readTX().

Referenced by putData().

bool JTAGpxa250::readTX unsigned int *    val,
int    max_retry = MAX_RETRY_COUNT
[private]
 

read the TX JTAG register.

Parameters:
val  a pointer on a 32 bits area to store the result
max_retry  the number of retry allowed. If 0 is given, this function will poll
Returns:
true on a read success, false if there's nothing to read from TX

Definition at line 435 of file jtagpxa250.cpp.

References JTAGControl::dreg().

Referenced by getData(), pollForTX(), and putData().

bool JTAGpxa250::setSavePlace unsigned int    place,
unsigned int    value
 

used to write registers. Look in target_to_host.h to know what place contains which register.

Parameters:
place  the register to write to
value  the value to write
Returns:
true on sucess, false if the target is not ready.

Definition at line 653 of file jtagpxa250.cpp.


Member Data Documentation

bool JTAGpxa250::isTargetReady [private]
 

true if the target is currently running the debug handler, ready to receive commands.

Definition at line 104 of file jtagpxa250.h.

Referenced by execute(), getSavePlace(), pollForTX(), reboot(), and targetReady().


The documentation for this class was generated from the following files:
Generated on Fri May 16 13:01:50 2003 for Jelie by doxygen1.2.15