Note to self. A working gdb script to boot Linux kernel on an atmel board over JTAG.
Unfortunately this is not completely automatic. u-boot needs to be interrupted for loading the uImage through gdb. U-boot can then be resumed and kernel booted with bootm 0x22000000.
Also, either the emulator needs to be configured to ignore data aborts or kernel futex support to be disabled.
target remote emulator:2001
monitor reset halt
j *0x200000 #bootstrap entry point in sram
j *0x23f00000 # u-boot entry point in sdram
restore /path/to/arch/arm/boot/uImage binary 0x22000000