Changeset d5610b9 in mainline for kernel/arch/arm32/src/cpu/cpu.c


Ignore:
Timestamp:
2015-10-03T08:37:37Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
afe5e09
Parents:
8ca6f08
Message:

Cleanup some of the cache maintenance mess on ARM

  • Do not define ARMv7 cache maintenance registers for ARMv6-.
  • Define missing ARMv6- registers using analoguos naming convention.
  • In smc_coherence() and pt_coherence_m(), do not blindly use ARMv7 DCCVMAU but decide the proper type of cache maintenance operation in dcache_clean_mva_pou().
  • Also, do not use ARMv7 ICIALLU directly, but call icache_invalidate() instead, which does the right thing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/cpu/cpu.c

    r8ca6f08 rd5610b9  
    322322void icache_invalidate(void)
    323323{
     324#if defined(PROCESSOR_ARCH_armv7_a)
    324325        ICIALLU_write(0);
     326#else
     327        ICIALL_write(0);
     328#endif
     329}
     330
     331#if !defined(PROCESSOR_ARCH_armv7_a)
     332static bool cache_is_unified(void)
     333{
     334        if (MIDR_read() != CTR_read()) {
     335                /* We have the CTR register */
     336                return (CTR_read() & CTR_SEP_FLAG) != CTR_SEP_FLAG;
     337        } else {
     338                panic("Unknown cache type");
     339        }
     340}
     341#endif
     342
     343void dcache_clean_mva_pou(uintptr_t mva)
     344{
     345#if defined(PROCESSOR_ARCH_armv7_a)
     346        DCCMVAU_write(mva);
     347#else
     348        if (cache_is_unified())
     349                CCMVA_write(mva);
     350        else
     351                DCCMVA_write(mva);
     352#endif
    325353}
    326354
Note: See TracChangeset for help on using the changeset viewer.