> While fileds manipulation is intuitive, I do not get : > > 1) Why do we have to call jtag_add_dr_scan() two times, first time > with fields[1].in_value = NULL, other time set to correct var to which > we want to capture CP15 register value. What are we doing first time, > and what the second ? For write CP15 functions we do > jtag_add_dr_scan() only once,
I think you need to read up in the datasheet. If you figure out why, then you could submit a patch with comments? > 2) Why do we put pointer to value variable in 6 bits address fields ? > Should not we put it to 32 bit value fields, i.e. fields[0].in_value ? If you read the datasheet, you'll find that JTAG is talking to a register that's 6 bits wide, I'd think. > 3) What is jtag_add_callback(arm_le_to_h_u32, > (jtag_callback_data_t)value) doing ? Why does it force little endian, > and how to change this since ARM946E-S is big endian. Look at how the bits inside this shift register is organized. This is correct, but a bit hackish. The code is passing in a pointer to uint32_t and using it as storage for an array of 4 uint8_t. After the JTAG queue has filled in *only* the first 8 bits, the callback will convert the array of 8 bit integers into a 32 bit uint32_t. > 4) What is jtag_execute_queue() ectually doing and why is is used only > for debug ? jtag_execute_queue() flushes the jtag command fifo. In debug it can be useful to do this immediately to be able to see the values read from the JTAG chain in the debugger. -- Øyvind Harboe US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
