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


Ignore:
Timestamp:
2012-09-23T16:19:26Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
21aab25
Parents:
47d2ca9 (diff), 40ad375 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge changes from the beagleboard-xm branch

File:
1 edited

Legend:

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

    r47d2ca9 rd085df10  
    9797}
    9898
    99 /** Does nothing on ARM. */
     99/** Enables unaligned access and caching for armv6+ */
    100100void cpu_arch_init(void)
    101101{
    102 #if defined(PROCESSOR_armv7_a)
     102#if defined(PROCESSOR_armv7_a) | defined(PROCESSOR_armv6)
    103103        uint32_t control_reg = 0;
    104104        asm volatile (
     
    107107        );
    108108       
    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;
     109        /* Turn off tex remap, RAZ ignores writes prior to armv7 */
     110        control_reg &= ~CP15_R1_TEX_REMAP_EN;
     111        /* Turn off accessed flag, RAZ ignores writes prior to armv7 */
     112        control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN);
     113        /* Enable unaligned access, RAZ ignores writes prior to armv6
     114         * switchable on armv6, RAO ignores writes on armv7,
     115         * see ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition
     116         * L.3.1 (p. 2456) */
     117        control_reg |= CP15_R1_UNALIGNED_EN;
     118        /* Disable alignment checks, this turns unaligned access to undefined,
     119         * unless U bit is set. */
     120        control_reg &= ~CP15_R1_ALIGN_CHECK_EN;
     121        /* Enable caching, On arm prior to armv7 there is only one level
     122         * of caches. Data cache is coherent.
     123         * "This means that the behavior of accesses from the same observer to
     124         * different VAs, that are translated to the same PA
     125         * with the same memory attributes, is fully coherent."
     126         *    ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition
     127         *    B3.11.1 (p. 1383)
     128         * ICache coherency is elaborate on in barrier.h.
     129         * We are safe to turn these on.
     130         */
     131        control_reg |= CP15_R1_CACHE_EN | CP15_R1_INST_CACHE_EN;
    115132       
    116133        asm volatile (
     
    122139
    123140/** Retrieves processor identification and stores it to #CPU.arch */
    124 void cpu_identify(void) 
     141void cpu_identify(void)
    125142{
    126143        arch_cpu_identify(&CPU->arch);
Note: See TracChangeset for help on using the changeset viewer.