Flashing multi chips with JTAG using openocd
When you set a device's IR to BYPASS, it will map a one bit register with no CAPTURE and UPDATE actions to DR.

The IR has a fixed length, let's assume two bit:

00 BOUNDARY-SCAN
01 IDCODE
10 PROGRAM
11 BYPASS


Further, assume that the PROGRAM chain has 16 bits, then you could program the first device with programming data p by sending (x means the bit is ignored)

IR
11 11 11 11 11 10

DR
x x x x x pppppppppppppppp

DR
x x x x x pppppppppppppppp


The second device can be addressed by sending

IR
11 11 11 11 10 11

DR
x x x x pppppppppppppppp x


and so on. So, you just add a fixed prefix and suffix to each IR and DR shifted.

With advanced controllers, it may be possible to program multiple devices in one go:

IR
10 10 11 11 11 11

DR
pppppppppppppppp pppppppppppppppp x x x x


That might save a bit of time, but AFAIK this is not implemented for OpenOCD.

Edit:
Probably the easiest way to do this with OpenOCD is to describe the scan chain as it is:

for { set i 1 } { $i &lt;= 6 } { incr i } {
    jtag newtap [string cat $_CHIPNAME $i] cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
    target create [string cat $_TARGETNAME $i] cortex_m -chain-position [string cat $_CHIPNAME $i].cpu
    [string cat $_CHIPNAME $i].cpu configure -event examine-start { puts "START..." ; }
    [string cat $_CHIPNAME $i].cpu configure -event examine-end { puts "END..." ; }
}
for { set i 1 } { $i &lt;= 6 } { incr i } {
    flash bank pflash.$i kinetis 0x00000000 0x20000 0 4 [string cat $_CHIPNAME $i]
}


The jtag newtap command is the body of the swj_newdap function — your scan chain doesn't work with SWD, so you can inline that for clarity, and drop the source command at the top as that becomes unnecessary then.

The loop creates six targets, with numbers attached, and makes their flash available on separate banks. The flash bank setup is in a separate loop, so the scan chain configuration is correct already at this point (I believe no data is sent until the probe command, but better be safe). The flash banks command should show all of them.

You can then use another loop, or separate commands to write the individual flash files.