Changeset 6 for trunk/tools/bootloader_tsar/boot_entry.S
- Timestamp:
- Apr 26, 2017, 2:14:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/bootloader_tsar/boot_entry.S
r1 r6 1 /* 2 * boot_entry.S - TSAR bootloader entry point. 3 * 4 * Authors : Alain Greiner / Vu Son (2016) 5 * 6 * Copyright (c) UPMC Sorbonne Universites 7 * 8 * This file is part of ALMOS-MKH. 9 * 10 * ALMOS-MKH is free software; you can redistribute it and/or modify it 11 * under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; version 2.0 of the License. 13 * 14 * ALMOS-MKH is distributed in the hope that it will be useful, but 15 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with ALMOS-MKH; if not, write to the Free Software Foundation, 21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 */ 23 1 24 /************************************************************************************************* 2 25 * This file contains the entry point of the ALMOS-MK boot-loader for TSAR architecture. * … … 61 84 mfc0 k0, CP0_PROCID 62 85 andi k0, k0, 0xFFF /* k0 <= gid */ 63 andi t1, k0, ((1 << P ADDR_WIDTH) - 1)/* t1 <= lid */64 srl t2, k0, P ADDR_WIDTH/* t2 <= cxy */86 andi t1, k0, ((1 << P_WIDTH) - 1) /* t1 <= lid */ 87 srl t2, k0, P_WIDTH /* t2 <= cxy */ 65 88 66 /* 67 * Initializing stack pointer from previously retrieved lid value. 68 */ 89 /* Initialize stack pointer from previously retrieved lid value */ 69 90 70 91 la t0, BOOT_STACK_BASE /* t0 <= BOOT_STACK_BASE */ 71 92 li k1, BOOT_STACK_SIZE /* k1 <= BOOT_STACK_SIZE */ 72 93 multu k1, t1 73 mflo k0 ,/* k0 <= BOOT_STACK_SIZE * lid */94 mflo k0 /* k0 <= BOOT_STACK_SIZE * lid */ 74 95 subu sp, t0, k0 /* P[cxy,lid] stack top initialized */ 75 96 76 /* 77 * Switching to local DSPACE by changing the value of the address extension registers. 78 */ 97 /* Switch to local DSPACE by changing the value of the address extension registers */ 79 98 80 99 mtc2 t2, CP2_DATA_PADDR_EXT 81 100 82 /* 83 * Jumping to boot_loader() function after passing 2 arguments in the registers. 84 */ 101 /* Jump to boot_loader() function after passing 2 arguments in the registers */ 85 102 86 103 or a0, zero, t1 /* a0 <= lid */ … … 96 113 *************/ 97 114 98 /* 99 * Testing if this is bscpu. 100 */ 115 /* Test if this is bscpu */ 101 116 102 117 mfc0 k0, CP0_PROCID … … 108 123 li t4, BOOT_CORE_CXY /* t4 <= bscpu cxy */ 109 124 110 /* 111 * Getting base address of the core descriptor table in 'arch_info.bin' file. 112 */ 125 /* Get base address of the core descriptor table in 'arch_info.bin' file */ 113 126 114 127 la t0, ARCHINFO_BASE /* t0 <= ARCHINFO_BASE */ … … 116 129 addu t2, t0, t1 /* t2 <= ARCHINFO_CORE_BASE */ 117 130 118 /* 119 * Scanning the core descriptor table if this is not bscpu. TODO If not found? 120 */ 131 /* scan the core descriptor table if this is not bscpu. TODO If not found? */ 121 132 122 133 li t3, 0x8 /* t3 <= ARCHINFO_CORE_SIZE */ … … 127 138 addu t2, t2, t3 /* t2 <= @ next archinfo_core */ 128 139 129 /* 130 * Getting (cxy, lid) values from the found core descriptor. 131 */ 140 /* Get (cxy, lid) values from the found core descriptor */ 132 141 133 142 lw t3, -8(t2) /* t3 <= lid */ 134 143 lw t4, -4(t2) /* t4 <= cxy */ 135 144 136 /* 137 * Initializing stack pointer from previously retrieved lid value. 138 */ 145 /* Initialize stack pointer from previously retrieved lid value */ 139 146 140 147 bscpu_exit: … … 145 152 subu sp, t0, k0 /* P[cxy,lid] stack top initialized */ 146 153 147 /* 148 * Switching to local DSPACE by changing the value of the address extension registers. 149 */ 154 /* Switch to local DSPACE by changing the value of the address extension registers */ 150 155 151 156 mtc2 t4, CP2_DATA_PADDR_EXT 152 157 153 /* 154 * Jumping to boot_loader() function after passing 2 arguments in the registers. 155 */ 158 /* Jumping to boot_loader() function after passing 2 arguments in registers */ 156 159 157 160 or a0, zero, t3 /* a0 <= lid */
Note: See TracChangeset
for help on using the changeset viewer.