Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Peng Fan's avatar
    fea7452c
    armv7: psci: cpu_off: flush D-Cache before disable D-Cache · fea7452c
    Peng Fan authored
    
    Before disable cache, need to first flush cache.
    
    There maybe dirty data in D-Cache before disable D-Cache.
    After disable D-Cache, the first store instructions in
    psci_v7_flush_dcache_all will directly store registers
    {r4-r5, r7, r9-r11, lr} to memory.
    If there is dirty data before disable D-Cache,
    psci_v7_flush_dcache_all will flush data to memory,
    and may overwrite the memory that hold the registers
    {r4-r5, r7, r9-r11, lr}.
    
    So before disable cache, first flush D-Cache.
    
    Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
    Cc: Albert Aribaud <albert.u.boot@aribaud.net>
    Cc: Chen-Yu Tsai <wens@csie.org>
    Cc: Hans de Goede <hdegoede@redhat.com>
    Cc: Hongbo Zhang <hongbo.zhang@nxp.com>
    Cc: York Sun <york.sun@nxp.com>
    Cc: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Tom Rini <trini@konsulko.com>
    fea7452c
    History
    armv7: psci: cpu_off: flush D-Cache before disable D-Cache
    Peng Fan authored
    
    Before disable cache, need to first flush cache.
    
    There maybe dirty data in D-Cache before disable D-Cache.
    After disable D-Cache, the first store instructions in
    psci_v7_flush_dcache_all will directly store registers
    {r4-r5, r7, r9-r11, lr} to memory.
    If there is dirty data before disable D-Cache,
    psci_v7_flush_dcache_all will flush data to memory,
    and may overwrite the memory that hold the registers
    {r4-r5, r7, r9-r11, lr}.
    
    So before disable cache, first flush D-Cache.
    
    Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
    Cc: Albert Aribaud <albert.u.boot@aribaud.net>
    Cc: Chen-Yu Tsai <wens@csie.org>
    Cc: Hans de Goede <hdegoede@redhat.com>
    Cc: Hongbo Zhang <hongbo.zhang@nxp.com>
    Cc: York Sun <york.sun@nxp.com>
    Cc: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Tom Rini <trini@konsulko.com>