How can I enable debugss for JTAG debugging with OpenOCD?

I am trying to get JTAG debugging working. OpenOCD connects fine as long as I am in uboot. But as soon as linux starts booting I loose connection with the dap.

From another thread, writing (with memtool) 0x52580002 to CM_WKUP_DEBUGSS_CLKCTRL makes the dap wake up again. How can I prevent linux from shutting down the debug port?

I am on debian linux version 6.1.46