MLK-12203-2 ARM: imx: adjust loop number to delay ~20us for i.MX7D low power idle
authorAnson Huang <Anson.Huang@nxp.com>
Sat, 9 Jan 2016 16:38:37 +0000 (00:38 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:45 +0000 (14:49 -0500)
ARM does NOT execute one instruction every cycle, the bus bandwidth,
cache status etc. would impacts the instruction execution time, so we
can NOT just calculate the delay time by ARM frequency, this patch
adjusts loop number to get a ~20us delay, measured via GPIO pin.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
arch/arm/mach-imx/imx7d_low_power_idle.S

index 2cc088d..07460dd 100644 (file)
        ldr     r7, =0xf0000
        str     r7, [r10]
 
-       /* assume ARM @ 1GHz, about delay 20us */
-       ldr     r7, =10000
+       /* delay 20us, measured by gpio */
+       ldr     r7, =20
 12:
        subs    r7, r7, #0x1
        bne     12b
        ldr     r7, =0x0
        str     r7, [r10]
 
-       ldr     r7, =10000
+       ldr     r7, =20
 13:
        subs    r7, r7, #0x1
        bne     13b