Changeset 4bd3f45 in mainline


Ignore:
Timestamp:
2012-09-18T13:55:55Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1a1b05b
Parents:
f94b95b1
Message:

arm32: Consolidate control register values

Location:
kernel/arch/arm32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/regutils.h

    rf94b95b1 r4bd3f45  
    4141#define STATUS_REG_MODE_MASK         0x1f
    4242
    43 #define CP15_R1_MMU_ENABLE_BIT       (1 << 0)
    44 #define CP15_R1_ALIGNMENT_ENABLE_BIT (1 << 1)
    45 #define CP15_R1_CACHE_ENABLE_BIT     (1 << 2)
    46 #define CP15_R1_BRANCH_PREDICT_BIT   (1 << 11)
    47 #define CP15_R1_INST_CACHE_BIT       (1 << 12)
    48 #define CP15_R1_HIGH_VECTORS_BIT     (1 << 13)
    49 #define CP15_R1_ROUND_ROBIN_BIT      (1 << 14)
    50 #define CP15_R1_HA_ENABLE_BIT        (1 << 17)
    51 #define CP15_R1_WXN_BIT              (1 << 19) /* Only if virt. supported */
    52 #define CP15_R1_UWXN_BIT             (1 << 20) /* Only if virt. supported */
    53 #define CP15_R1_FI_BIT               (1 << 21)
    54 #define CP15_R1_VE_BIT               (1 << 24)
    55 #define CP15_R1_EE_BIT               (1 << 25)
    56 #define CP15_R1_NMFI_BIT             (1 << 27)
    57 #define CP15_R1_TRE_BIT              (1 << 28)
    58 #define CP15_R1_AFE_BIT              (1 << 29)
     43/* COntrol register bit values see ch. B4.1.130 of ARM Architecture Reference
     44 * Manual ARMv7-A and ARMv7-R edition, page 1687 */
     45#define CP15_R1_MMU_EN            (1 << 0)
     46#define CP15_R1_ALIGN_CHECK_EN    (1 << 1)  /* Allow alignemnt check */
     47#define CP15_R1_CACHE_EN          (1 << 2)
     48#define CP15_R1_CP15_BARRIER_EN   (1 << 5)
     49#define CP15_R1_B_EN              (1 << 7)  /* ARMv6- only big endian switch */
     50#define CP15_R1_SWAP_EN           (1 << 10)
     51#define CP15_R1_BRANCH_PREDICT_EN (1 << 11)
     52#define CP15_R1_INST_CACHE_EN     (1 << 12)
     53#define CP15_R1_HIGH_VECTORS_EN   (1 << 13)
     54#define CP15_R1_ROUND_ROBIN_EN    (1 << 14)
     55#define CP15_R1_HW_ACCESS_FLAG_EN (1 << 17)
     56#define CP15_R1_WRITE_XN_EN       (1 << 19) /* Only if virt. supported */
     57#define CP15_R1_USPCE_WRITE_XN_EN (1 << 20) /* Only if virt. supported */
     58#define CP15_R1_FAST_IRQ_EN       (1 << 21) /* Disbale impl.specific features */
     59#define CP15_R1_UNALIGNED_EN      (1 << 22) /* Must be 1 on armv7 */
     60#define CP15_R1_IRQ_VECTORS_EN    (1 << 24)
     61#define CP15_R1_BIG_ENDIAN_EXC    (1 << 25)
     62#define CP15_R1_NMFI_EN           (1 << 27)
     63#define CP15_R1_TEX_REMAP_EN      (1 << 28)
     64#define CP15_R1_ACCESS_FLAG_EN    (1 << 29)
     65#define CP15_r1_THUMB_EXC_EN      (1 << 30)
    5966
    6067/* ARM Processor Operation Modes */
  • kernel/arch/arm32/src/cpu/cpu.c

    rf94b95b1 r4bd3f45  
    108108       
    109109        /* Turn off tex remap */
    110         control_reg &= ~CP15_R1_TRE_BIT;
     110        control_reg &= ~CP15_R1_TEX_REMAP_EN;
    111111        /* Turn off accessed flag */
    112         control_reg &= ~(CP15_R1_AFE_BIT | CP15_R1_HA_ENABLE_BIT | CP15_R1_ALIGNMENT_ENABLE_BIT);
     112        control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN);
     113        /* Enable unaligned access (U bit is armv6 only) */
     114        control_reg |= CP15_R1_UNALIGNED_EN;
     115        /* Disable alignment checks */
     116        control_reg &= ~CP15_R1_ALIGN_CHECK_EN;
    113117        /* Enable caching */
    114         control_reg |= CP15_R1_CACHE_ENABLE_BIT;
     118        control_reg |= CP15_R1_CACHE_EN;
    115119       
    116120        asm volatile (
  • kernel/arch/arm32/src/exception.c

    rf94b95b1 r4bd3f45  
    143143       
    144144        /* switch on the high vectors bit */
    145         control_reg |= CP15_R1_HIGH_VECTORS_BIT;
     145        control_reg |= CP15_R1_HIGH_VECTORS_EN;
    146146       
    147147        asm volatile (
Note: See TracChangeset for help on using the changeset viewer.