- Timestamp:
- 2013-03-16T21:48:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6b0cfa1
- Parents:
- 71fe7e9d (diff), f597bc4 (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. - Location:
- boot
- Files:
-
- 7 edited
-
Makefile (modified) (1 diff)
-
arch/arm32/Makefile.inc (modified) (1 diff)
-
arch/arm32/include/arch.h (modified) (2 diffs)
-
arch/arm32/include/main.h (modified) (1 diff)
-
arch/arm32/include/mm.h (modified) (2 diffs)
-
arch/arm32/src/mm.c (modified) (7 diffs)
-
arch/arm32/src/putchar.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile
r71fe7e9d r5c1b3cd 61 61 mkdir "$(DIST_PATH)/inc/c/" 62 62 cp -r -L "$(USPACE_PATH)/lib/c/include/." "$(DIST_PATH)/inc/c/" 63 cp -r -L "$(ROOT_PATH)/abi/include/." "$(DIST_PATH)/inc/c/" 64 cp -r -L "$(USPACE_PATH)/lib/c/arch/$(UARCH)/include/." "$(DIST_PATH)/inc/c/" 63 65 cat "$(USPACE_PATH)/lib/c/arch/$(UARCH)/_link.ld" | sed 's/^STARTUP(.*)$$//g' > "$(DIST_PATH)/inc/_link.ld" 64 66 endif -
boot/arch/arm32/Makefile.inc
r71fe7e9d r5c1b3cd 35 35 endif 36 36 37 ifeq ($(MACHINE), beagleboardxm)37 ifeq ($(MACHINE), $(filter $(MACHINE),beagleboardxm beaglebone)) 38 38 BOOT_OUTPUT = image.boot 39 39 POST_OUTPUT = $(ROOT_PATH)/uImage.bin -
boot/arch/arm32/include/arch.h
r71fe7e9d r5c1b3cd 44 44 #elif defined MACHINE_beagleboardxm 45 45 #define BOOT_BASE 0x80000000 46 #elif defined MACHINE_beaglebone 47 #define BOOT_BASE 0x80000000 46 48 #else 47 49 #define BOOT_BASE 0x00000000 … … 51 53 52 54 #ifdef MACHINE_beagleboardxm 55 #define PA_OFFSET 0 56 #elif defined MACHINE_beaglebone 53 57 #define PA_OFFSET 0 54 58 #else -
boot/arch/arm32/include/main.h
r71fe7e9d r5c1b3cd 51 51 #define BBXM_THR_FULL 0x00000001 52 52 53 /** Beaglebone UART register addresses 54 * 55 * This is UART0 of AM335x CPU 56 */ 57 #define BBONE_SCONS_THR 0x44E09000 58 #define BBONE_SCONS_SSR 0x44E09044 59 60 /** Check this bit before writing (tx fifo full) */ 61 #define BBONE_TXFIFO_FULL 0x00000001 53 62 54 63 /** GTA02 serial console UART register addresses. -
boot/arch/arm32/include/mm.h
r71fe7e9d r5c1b3cd 63 63 #define BBXM_RAM_END 0xc0000000 64 64 65 /** Start of ram memory on AM335x */ 66 #define AM335x_RAM_START 0x80000000 67 /** End of ram memory on AM335x */ 68 #define AM335x_RAM_END 0xC0000000 69 65 70 66 71 /* Page table level 0 entry - "section" format is used … … 76 81 unsigned int access_permission_0 : 2; 77 82 unsigned int tex : 3; 78 unsigned int access_permission_1 : 2; 83 unsigned int access_permission_1 : 1; 84 unsigned int shareable : 1; 79 85 unsigned int non_global : 1; 80 86 unsigned int should_be_zero_2 : 1; -
boot/arch/arm32/src/mm.c
r71fe7e9d r5c1b3cd 38 38 #include <arch/mm.h> 39 39 40 /** Disable the MMU */ 41 static void disable_paging(void) 42 { 43 asm volatile ( 44 "mrc p15, 0, r0, c1, c0, 0\n" 45 "bic r0, r0, #1\n" 46 "mcr p15, 0, r0, c1, c0, 0\n" 47 ::: "r0" 48 ); 49 } 50 40 51 /** Check if caching can be enabled for a given memory section. 41 52 * … … 59 70 const unsigned long address = section << PTE_SECTION_SHIFT; 60 71 if (address >= BBXM_RAM_START && address < BBXM_RAM_END) 72 return 1; 73 #elif defined MACHINE_beaglebone 74 const unsigned long address = section << PTE_SECTION_SHIFT; 75 if (address >= AM335x_RAM_START && address < AM335x_RAM_END) 61 76 return 1; 62 77 #endif … … 88 103 pte->tex = 0; 89 104 pte->access_permission_1 = 0; 105 pte->shareable = 0; 90 106 pte->non_global = 0; 91 107 pte->should_be_zero_2 = 0; … … 102 118 for (page = 0; page < split_page; page++) 103 119 init_ptl0_section(&boot_pt[page], page); 104 105 /*106 * Create 1:1 virtual-physical mapping in kernel space107 * (upper 2 GB), physical addresses start from 0.108 */109 /* BeagleBoard-xM (DM37x) memory starts at 2GB border,110 * thus mapping only lower 2GB is not not enough.111 * Map entire AS 1:1 instead and hope it works. */112 for (page = split_page; page < PTL0_ENTRIES; page++)113 #ifndef MACHINE_beagleboardxm114 init_ptl0_section(&boot_pt[page], page - split_page);115 #else116 init_ptl0_section(&boot_pt[page], page);117 #endif118 120 119 121 asm volatile ( … … 132 134 "ldr r0, =0x55555555\n" 133 135 "mcr p15, 0, r0, c3, c0, 0\n" 134 136 135 137 /* Current settings */ 136 138 "mrc p15, 0, r0, c1, c0, 0\n" … … 143 145 144 146 "orr r0, r0, r1\n" 147 148 /* Invalidate the TLB content before turning on the MMU. 149 * ARMv7-A Reference manual, B3.10.3 150 */ 151 "mcr p15, 0, r0, c8, c7, 0\n" 145 152 146 /* Store settings */153 /* Store settings, enable the MMU */ 147 154 "mcr p15, 0, r0, c1, c0, 0\n" 148 155 ::: "r0", "r1" … … 152 159 /** Start the MMU - initialize page table and enable paging. */ 153 160 void mmu_start() { 161 disable_paging(); 154 162 init_boot_pt(); 155 163 enable_paging(); -
boot/arch/arm32/src/putchar.c
r71fe7e9d r5c1b3cd 40 40 #include <putchar.h> 41 41 #include <str.h> 42 43 #ifdef MACHINE_beaglebone 44 45 /** Send a byte to the am335x serial console. 46 * 47 * @param byte Byte to send. 48 */ 49 static void scons_sendb_bbone(uint8_t byte) 50 { 51 volatile uint32_t *thr = 52 (volatile uint32_t *) BBONE_SCONS_THR; 53 volatile uint32_t *ssr = 54 (volatile uint32_t *) BBONE_SCONS_SSR; 55 56 /* Wait until transmitter is empty */ 57 while (*ssr & BBONE_TXFIFO_FULL); 58 59 /* Transmit byte */ 60 *thr = (uint32_t) byte; 61 } 62 63 #endif 42 64 43 65 #ifdef MACHINE_beagleboardxm … … 106 128 static void scons_sendb(uint8_t byte) 107 129 { 130 #ifdef MACHINE_beaglebone 131 scons_sendb_bbone(byte); 132 #endif 108 133 #ifdef MACHINE_beagleboardxm 109 134 scons_sendb_bbxm(byte);
Note:
See TracChangeset
for help on using the changeset viewer.
