OpenOCD JTAG question, adding new cable.

Hello all, I have continued my efforts in building my own JTAG cable and adding a driver to openOCD.

I am using this CFG file:

telnet_port 4444
gdb_port 3333

interface yajtag
jtag_speed 0

reset_config trst_and_srst separate

jtag_device 4 0x1 0xf 0x10900027
jtag_device 4 0x1 0xf 0x10940027

daemon_startup reset
target  arm9tdmi little run_and_init 1 arm940t
run_and_halt_time 0 30

IDcode reading goes okay now, but now I get the following error:

Debug:   jtag.c:302 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug:   jtag.c:1204 jtag_reset_callback(): -
Debug:   jtag.c:1204 jtag_reset_callback(): -
Info:    yajtag.c:273 yajtag_jtag_write_tms():  1b
Info:    yajtag.c:338 yajtag_jtag_write_and_read(): size 10
Info:    yajtag.c:363 yajtag_jtag_write_and_read(): TX: ff,
Info:    yajtag.c:363 yajtag_jtag_write_and_read(): TX: 3,
Info:    yajtag.c:371 yajtag_jtag_write_and_read(): RX: 3,
Info:    yajtag.c:371 yajtag_jtag_write_and_read(): RX: 0,
Info:    yajtag.c:273 yajtag_jtag_write_tms():  7f
Error:   jtag.c:1353 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0003
Error:   jtag.c:1455 jtag_init(): Could not validate JTAG chain, exit

I have added some writes and reads to my functions so i can see what is pushed to the cable.

My questions:

After IDcode is completed, this is done several times. But it does not work, what is it used for? What does it determine? What is the expected output? Is there documentation that describes this kind of JTAG behaviour?

Any help greatly appreciated.