Changes in / [5fcd537:660e8fa] in mainline
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r5fcd537 r660e8fa 87 87 88 88 % CPU type 89 @ "cortex_a8" ARM Cortex A-8 89 @ "armv4" ARMv4 90 ! [PLATFORM=arm32&(MACHINE=gta02)] PROCESSOR (choice) 91 92 % CPU type 93 @ "armv5" ARMv5 94 ! [PLATFORM=arm32&MACHINE=integratorcp] PROCESSOR (choice) 95 96 % CPU type 97 @ "armv7_a" ARMv7-A 90 98 ! [PLATFORM=arm32&MACHINE=beagleboardxm] PROCESSOR (choice) 91 92 % CPU type93 @ "arm920t" ARM920T94 ! [PLATFORM=arm32&MACHINE=gta02] PROCESSOR (choice)95 96 % CPU type97 @ "arm926ej_s" ARM926EJ-S98 ! [PLATFORM=arm32&MACHINE=integratorcp] PROCESSOR (choice)99 100 101 # Add more ARMv4 CPUs102 % CPU arch103 @ "armv4" ARMv4104 ! [PLATFORM=arm32&(PROCESSOR=arm920t)] PROCESSOR_ARCH (choice)105 106 # Add more ARMv5 CPUs107 % CPU arch108 @ "armv5" ARMv5109 ! [PLATFORM=arm32&(PROCESSOR=arm926ej_s)] PROCESSOR_ARCH (choice)110 111 # Add more ARMv7-A CPUs112 % CPU arch113 @ "armv7_a" ARMv7-A114 ! [PLATFORM=arm32&(PROCESSOR=cortex_a8)] PROCESSOR_ARCH (choice)115 99 116 100 % RAM disk format … … 364 348 ## armv7 made fpu hardware compulsory 365 349 % FPU support 366 ! [PLATFORM=arm32&PROCESSOR _ARCH=armv7_a] CONFIG_FPU (y)350 ! [PLATFORM=arm32&PROCESSOR=armv7_a] CONFIG_FPU (y) 367 351 368 352 % FPU support -
boot/arch/arm32/Makefile.inc
r5fcd537 r660e8fa 49 49 BITS = 32 50 50 ENDIANESS = LE 51 EXTRA_CFLAGS = -march=$(subst _,-,$(PROCESSOR _ARCH)) -mno-unaligned-access51 EXTRA_CFLAGS = -march=$(subst _,-,$(PROCESSOR)) -mno-unaligned-access 52 52 53 53 ifeq ($(MACHINE), gta02) -
boot/arch/arm32/include/mm.h
r5fcd537 r660e8fa 58 58 #define GTA02_IOMEM_END 0x60000000 59 59 60 /** Start of ram memory on BBxM */61 #define BBXM_RAM_START 0x8000000062 /** Start of ram memory on BBxM */63 #define BBXM_RAM_END 0xc000000064 65 66 60 /* Page table level 0 entry - "section" format is used 67 61 * (one-level paging, 1 MB sized pages). Used only while booting the kernel. -
boot/arch/arm32/src/mm.c
r5fcd537 r660e8fa 56 56 else 57 57 return 1; 58 #elif defined MACHINE_beagleboardxm 59 const unsigned long address = section << PTE_SECTION_SHIFT; 60 if (address >= BBXM_RAM_START && address < BBXM_RAM_END) 61 return 1; 58 #else 59 return 0; 62 60 #endif 63 return 0;64 61 } 65 62 … … 133 130 "mcr p15, 0, r0, c3, c0, 0\n" 134 131 135 #ifdef PROCESSOR_ARCH_armv7_a 136 /* armv7 no longer requires cache entries to be invalid 137 * upon reset, do this manually */ 138 /* Invalidate ICache */ 139 "mcr p15, 0, r0, c7, c5, 6\n" 140 //TODO: Invalidate data cache 132 #ifdef PROCESSOR_armv7_a 133 /* Read Auxiliary control register */ 134 "mrc p15, 0, r0, c1, c0, 1\n" 135 /* Mask to enable L2 cache */ 136 "ldr r1, =0x00000002\n" 137 "orr r0, r0, r1\n" 138 /* Store Auxiliary control register */ 139 "mrc p15, 0, r0, c1, c0, 1\n" 141 140 #endif 142 143 141 /* Current settings */ 144 142 "mrc p15, 0, r0, c1, c0, 0\n" 145 143 146 #if defined(PROCESSOR_cortex_a8) | defined(MACHINE_gta02) 147 /* Mask to enable paging, I-cache D-cache and branch predict 148 * See kernel/arch/arm32/include/regutils.h for bit values. 149 * It's safe because Cortex-A8 implements IVIPT extension 150 * See Cortex-A8 TRM ch. 7.2.6 p. 7-4 (PDF 245). 151 * It's safe for gta02 too because we turn the caches off 152 * before switching to kernel. */ 153 "ldr r1, =0x00001805\n" 154 #elif defined(PROCESSOR_ARCH_armv7_a) | defined(PROCESSOR_ARCH_armv6) 155 /* Enable paging, data cache and branch prediction 156 * see arch/arm32/src/cpu/cpu.c for reasoning */ 157 "ldr r1, =0x00000805\n" 144 #ifdef PROCESSOR_armv7_a 145 /* Mask to enable paging, caching */ 146 "ldr r1, =0x00000005\n" 147 #else 148 #ifdef MACHINE_gta02 149 /* Mask to enable paging (bit 0), 150 D-cache (bit 2), I-cache (bit 12) */ 151 "ldr r1, =0x00001005\n" 158 152 #else 159 153 /* Mask to enable paging */ 160 154 "ldr r1, =0x00000001\n" 155 #endif 161 156 #endif 162 157 "orr r0, r0, r1\n" -
kernel/arch/arm32/Makefile.inc
r5fcd537 r660e8fa 33 33 ATSIGN = % 34 34 35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR _ARCH)) -mno-unaligned-access35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR)) -mno-unaligned-access 36 36 37 37 ifeq ($(MACHINE),beagleboardxm) -
kernel/arch/arm32/include/asm.h
r5fcd537 r660e8fa 48 48 * ARM920T has custom coprocessor action to do the same. See ARM920T Technical 49 49 * Reference Manual ch 4.9 p. 4-23 (103 in the PDF) 50 * ARM926EJ-S uses the same coprocessor instruction as ARM920T. See ARM926EJ-S51 * chapter 2.3.8 p.2-22 (52 in the PDF)52 *53 * @note Although mcr p15, 0, R0, c7, c0, 4 is defined in ARM Architecture54 * reference manual for armv4/5 CP15 implementation is mandatory only for55 * armv6+.56 50 */ 57 51 NO_TRACE static inline void cpu_sleep(void) 58 52 { 59 #ifdef PROCESSOR_ ARCH_armv7_a60 asm volatile ( "wfe" );61 #elif defined( PROCESSOR_ARCH_armv6) | defined(PROCESSOR_arm926ej_s) | defined(PROCESSOR_arm920t)62 asm volatile ( "mcr p15, 0, R0, c7, c0, 4");53 #ifdef PROCESSOR_armv7_a 54 asm volatile ( "wfe" :: ); 55 #elif defined(MACHINE_gta02) 56 asm volatile ( "mcr p15,0,R0,c7,c0,4" :: ); 63 57 #endif 64 58 } -
kernel/arch/arm32/include/barrier.h
r5fcd537 r660e8fa 60 60 #define read_barrier() asm volatile ("dsb" ::: "memory") 61 61 #define write_barrier() asm volatile ("dsb st" ::: "memory") 62 #elif defined PROCESSOR_ARCH_armv663 /* ARMv6- use system control coprocessor (CP15) for memory barrier instructions.64 * Although at least mcr p15, 0, r0, c7, c10, 4 is mentioned in earlier archs,65 * CP15 implementation is mandatory only for armv6+.66 */67 #define memory_barrier() asm volatile ("ldr r0, =0\nmcr p15, 0, r0, c7, c10, 5" ::: "r0", "memory")68 #define read_barrier() asm volatile ("ldr r0, =0\nmcr p15, 0, r0, c7, c10, 4" ::: "r0", "memory")69 #define write_barrier() read_barrier()70 62 #else 71 /* Older manuals mention syscalls as a way to implement cache coherency and72 * barriers. See for example ARM Architecture Reference Manual Version D73 * chapter 2.7.4 Prefetching and self-modifying code (p. A2-28)74 */75 // TODO implement on per PROCESSOR basis76 63 #define memory_barrier() asm volatile ("" ::: "memory") 77 64 #define read_barrier() asm volatile ("" ::: "memory") 78 65 #define write_barrier() asm volatile ("" ::: "memory") 79 66 #endif 80 81 67 /* 82 68 * There are multiple ways ICache can be implemented on ARM machines. Namely -
kernel/arch/arm32/include/mm/frame.h
r5fcd537 r660e8fa 47 47 48 48 #ifdef MACHINE_gta02 49 50 #define PHYSMEM_START_ADDR 0x3000800051 49 #define BOOT_PAGE_TABLE_ADDRESS 0x30010000 52 53 50 #elif defined MACHINE_beagleboardxm 54 55 #define PHYSMEM_START_ADDR 0x8000000056 51 #define BOOT_PAGE_TABLE_ADDRESS 0x80008000 57 58 52 #else 59 60 #define PHYSMEM_START_ADDR 0x0000000061 53 #define BOOT_PAGE_TABLE_ADDRESS 0x00008000 62 63 54 #endif 64 55 … … 66 57 #define BOOT_PAGE_TABLE_SIZE_IN_FRAMES (BOOT_PAGE_TABLE_SIZE >> FRAME_WIDTH) 67 58 59 #ifdef MACHINE_gta02 60 #define PHYSMEM_START_ADDR 0x30008000 61 #elif defined MACHINE_beagleboardxm 62 #define PHYSMEM_START_ADDR 0x80000000 63 #else 64 #define PHYSMEM_START_ADDR 0x00000000 65 #endif 68 66 69 67 extern void frame_low_arch_init(void); -
kernel/arch/arm32/include/mm/page.h
r5fcd537 r660e8fa 129 129 set_pt_level1_present((pte_t *) (ptl3), (size_t) (i)) 130 130 131 #if defined(PROCESSOR_ ARCH_armv6) | defined(PROCESSOR_ARCH_armv7_a)131 #if defined(PROCESSOR_armv6) | defined(PROCESSOR_armv7_a) 132 132 #include "page_armv6.h" 133 #elif defined(PROCESSOR_ ARCH_armv4) | defined(PROCESSOR_ARCH_armv5)133 #elif defined(PROCESSOR_armv4) | defined(PROCESSOR_armv5) 134 134 #include "page_armv4.h" 135 135 #else -
kernel/arch/arm32/include/regutils.h
r5fcd537 r660e8fa 47 47 #define CP15_R1_CACHE_EN (1 << 2) 48 48 #define CP15_R1_CP15_BARRIER_EN (1 << 5) 49 #define CP15_R1_B_EN (1 << 7) /* ARMv6- only ,big endian switch */49 #define CP15_R1_B_EN (1 << 7) /* ARMv6- only big endian switch */ 50 50 #define CP15_R1_SWAP_EN (1 << 10) 51 51 #define CP15_R1_BRANCH_PREDICT_EN (1 << 11) -
kernel/arch/arm32/src/cpu/cpu.c
r5fcd537 r660e8fa 98 98 void cpu_arch_init(void) 99 99 { 100 /* Get rid of any boot code hiding in ICache 101 * This is safe without regards to ICache state. */ 102 memory_barrier(); 103 smc_coherence(); 104 100 #if defined(PROCESSOR_armv7_a) | defined(PROCESSOR_armv6) 105 101 uint32_t control_reg = 0; 106 102 asm volatile ( … … 109 105 ); 110 106 111 /* Turn off tex remap, RAZ /WIprior to armv7 */107 /* Turn off tex remap, RAZ ignores writes prior to armv7 */ 112 108 control_reg &= ~CP15_R1_TEX_REMAP_EN; 113 /* Turn off accessed flag, RAZ /WIprior to armv7 */109 /* Turn off accessed flag, RAZ ignores writes prior to armv7 */ 114 110 control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN); 115 /* Disable branch prediction RAZ/WI if not supported */ 116 control_reg &= ~CP15_R1_BRANCH_PREDICT_EN; 117 118 /* Unaligned access is supported on armv6+ */ 119 #if defined(PROCESSOR_ARCH_armv7_a) | defined(PROCESSOR_ARCH_armv6) 120 /* Enable unaligned access, RAZ/WI prior to armv6 121 * switchable on armv6, RAO/WI writes on armv7, 111 /* Enable unaligned access, RAZ ignores writes prior to armv6 112 * switchable on armv6, RAO ignores writes on armv7, 122 113 * see ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition 123 114 * L.3.1 (p. 2456) */ … … 133 124 * ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition 134 125 * B3.11.1 (p. 1383) 135 * We are safe to turn this on. For arm v6 see ch L.6.2 (p. 2469)136 * L2 Cache for armv7 was enabled in boot code.126 * ICache coherency is elaborate on in barrier.h. 127 * We are safe to turn these on. 137 128 */ 138 control_reg |= CP15_R1_CACHE_EN; 139 #endif 140 #ifdef PROCESSOR_cortex_a8 141 /* ICache coherency is elaborate on in barrier.h. 142 * Cortex-A8 implements IVIPT extension. 143 * Cortex-A8 TRM ch. 7.2.6 p. 7-4 (PDF 245) */ 144 control_reg |= CP15_R1_INST_CACHE_EN; 145 #endif 129 control_reg |= CP15_R1_CACHE_EN | CP15_R1_INST_CACHE_EN; 146 130 147 131 asm volatile ( … … 149 133 :: [control_reg] "r" (control_reg) 150 134 ); 135 #endif 151 136 #ifdef CONFIG_FPU 152 137 fpu_setup(); -
kernel/arch/arm32/src/fpu_context.c
r5fcd537 r660e8fa 119 119 * rely on user decision to use CONFIG_FPU. 120 120 */ 121 #ifdef PROCESSOR_ ARC_armv7_a121 #ifdef PROCESSOR_armv7_a 122 122 const uint32_t cpacr = CPACR_read(); 123 123 /* FPU needs access to coprocessor 10 and 11. … … 148 148 * rely on user decision to use CONFIG_FPU. 149 149 */ 150 #ifndef PROCESSOR_ ARCH_armv7_a150 #ifndef PROCESSOR_armv7_a 151 151 return; 152 152 #endif -
kernel/arch/arm32/src/mm/page_fault.c
r5fcd537 r660e8fa 174 174 } 175 175 176 #if defined(PROCESSOR_ ARCH_armv4) | defined(PROCESSOR_ARCH_armv5)176 #if defined(PROCESSOR_armv4) | defined(PROCESSOR_armv5) 177 177 /** Decides whether read or write into memory is requested. 178 178 * … … 281 281 } 282 282 283 #if defined(PROCESSOR_ ARCH_armv6) | defined(PROCESSOR_ARCH_armv7_a)283 #if defined(PROCESSOR_armv6) | defined(PROCESSOR_armv7_a) 284 284 const pf_access_t access = 285 285 fsr.data.wr ? PF_ACCESS_WRITE : PF_ACCESS_READ; 286 #elif defined(PROCESSOR_ ARCH_armv4) | defined(PROCESSOR_ARCH_armv5)286 #elif defined(PROCESSOR_armv4) | defined(PROCESSOR_armv5) 287 287 const pf_access_t access = get_memory_access_type(istate->pc, badvaddr); 288 288 #else -
uspace/lib/c/arch/arm32/Makefile.common
r5fcd537 r660e8fa 28 28 # 29 29 30 GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR _ARCH))30 GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR)) 31 31 32 32 ifeq ($(CONFIG_FPU),y)
Note:
See TracChangeset
for help on using the changeset viewer.