Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1bd99214 in mainline


Ignore:
Timestamp:
2012-04-02T22:44:00Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
4d02595
Parents:
a5f007f
Message:

arm32: Initialize flags on armv7 CPUs.

No fancy memory settings.
Turn on caching.

File:
1 edited

Legend:

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

    ra5f007f r1bd99214  
    100100void cpu_arch_init(void)
    101101{
     102#if defined(PROCESSOR_armv7)
     103        uint32_t control_reg = 0;
     104        asm volatile (
     105                "mrc p15, 0, %[control_reg], c1, c0"
     106                : [control_reg] "=r" (control_reg)
     107        );
     108       
     109        /* Turn off tex remap */
     110        control_reg &= ~CP15_R1_TRE_BIT;
     111        /* Turn off accessed flag */
     112        control_reg &= ~(CP15_R1_AFE_BIT | CP15_R1_HA_ENABLE_BIT);
     113        /* Enable caching */
     114        control_reg |= CP15_R1_CACHE_ENABLE_BIT;
     115       
     116        asm volatile (
     117                "mcr p15, 0, %[control_reg], c1, c0"
     118                :: [control_reg] "r" (control_reg)
     119        );
     120#endif
    102121}
    103122
Note: See TracChangeset for help on using the changeset viewer.