patch_power: stmdb sp!,{r4,lr} add r4, r0, r2 // address of callout routine /* * Map reset control registers */ mov r0, #0x110 // size of reset control registers ldr r1, Lpaddr bl callout_io_map /* * Patch the callout routine */ CALLOUT_PATCH r4, r0, r1, r2, ip ldmia sp!,{r4,pc} Lpaddr: .word OMAP_CRPM_CTRL_BASE CALLOUT_START(power_omap, 0, patch_power) /* * Kernel passes value of 0 for idle */ mov ip, #0x000000ff orr ip, ip, #0x0000ff00 orr ip, ip, #0x00ff0000 orr ip, ip, #0xff000000 teq r1, #0 bne 0f mcr p15, 0, r1, c7, c0, 4 // wait-for-interrupt mov r1, #0 mov pc, lr 0: bic r1,r1,#0x80000000 cmp r1, #1 bne 1f // this is fine, ie when mode =1 mov r3, #0x00 add r5,ip,#0x100 strh r3, [r5, #0x0000] mov r3, #0x08 // SW_RST bit strh r3, [ip, #OMAP_ARM_RSTCT1] @ turn off clock domains @ get ARM_IDLECT2 into r2 */ // this is fine, ie when mode > 1 1: ldrh r2, [ip, #OMAP_ARM_IDLECT2 & 0xff] // always fails & dump shows instructions fo timer callout