Changeset 8316547f in mainline


Ignore:
Timestamp:
2012-09-19T11:21:26Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3896974
Parents:
a57b751
Message:

arm32: Add comments on control bits

File:
1 edited

Legend:

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

    ra57b751 r8316547f  
    9797}
    9898
    99 /** Does nothing on ARM. */
     99/** Enables unaligned access and caching for armv6+ */
    100100void cpu_arch_init(void)
    101101{
     
    107107        );
    108108       
    109         /* Turn off tex remap */
     109        /* Turn off tex remap, RAZ ignores writes prior to armv7 */
    110110        control_reg &= ~CP15_R1_TEX_REMAP_EN;
    111         /* Turn off accessed flag */
     111        /* Turn off accessed flag, RAZ ignores writes prior to armv7 */
    112112        control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN);
    113         /* Enable unaligned access (U bit is armv6 only) */
     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) */
    114117        control_reg |= CP15_R1_UNALIGNED_EN;
    115         /* Disable alignment checks */
     118        /* Disable alignment checks, this turns unaligned access to undefined,
     119         * unless U bit is set. */
    116120        control_reg &= ~CP15_R1_ALIGN_CHECK_EN;
    117         /* Enable caching */
     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         */
    118131        control_reg |= CP15_R1_CACHE_EN | CP15_R1_INST_CACHE_EN;
    119132       
Note: See TracChangeset for help on using the changeset viewer.