Changeset 623 for trunk/boot/tsar_mips32/boot_entry.S
- Timestamp:
- Mar 6, 2019, 4:37:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/boot/tsar_mips32/boot_entry.S
r439 r623 23 23 24 24 /********************************************************************************************** 25 * This file contains the entry point of the ALMOS-MK boot-loader for TSAR architecture .*26 * It supports a generic multi-clusters / multi-processors architecture*25 * This file contains the entry point of the ALMOS-MK boot-loader for TSAR architecture, * 26 * that is a generic multi-clusters / multi-processors architecture. * 27 27 * * 28 28 * - The number of clusters is defined by the (X_SIZE, Y_SIZE) parameters in the * … … 31 31 * hard_config.h file (up to 4 processors per cluster). * 32 32 * * 33 * This assembly code is executed by all cores. It has 2 versions (in order to see if the * 34 * contention created by the ARCHINFO core descriptor table scanning loops is acceptable): * 35 * with or without the assumption that the core hardware identifier gid has a fixed format: * 33 * This assembly code is executed by all cores, but at the same time, because all cores * 34 * are not simultaneously activated. It makes the assuption that the CPO register containing * 35 * the core gid (global hardware identifier) has a fixed format: * 36 * gid == (((x << Y_WIDTH) + y) << P_WIDTH) + lid * 36 37 * * 37 * - Version with fixed format: gid == (((x << Y_WIDTH) + y) << PADDR_WIDTH) + lid * 38 * It does 3 things: * 39 * + It initializes the stack pointer depending on the lid extracted from the gid, * 40 * using the BOOT_STACK_BASE and BOOT_STACK_SIZE parameters defined in the * 41 * 'boot_config.h' file, * 42 * + It changes the value of the address extension registers using the cxy extracted * 43 * from the gid, * 44 * + It jumps to the boot_loader() function defined in the 'boot.c' file and passes 2 * 45 * arguments which are the cxy and lid of each core to this function. * 46 * * 47 * - Version without fixed format * 48 * It has to perform an additional step in order to extract the (cxy,lid) values from the * 49 * arch_info.bin structure that has been loaded in the cluster (0,0) memory by the bscpu. * 50 * + Each core other than the bscpu scans the core descriptor table in the arch_info.bin * 51 * structure to make an associative search on the (gid), and get the (cxy,lid). * 52 * + It initializes the stack pointer depending on the lid, using the BOOT_STACK_BASE * 53 * and BOOT_STACK_SIZE parameters defined in the 'boot_config.h' file, * 54 * + It changes the value of the address extension registers using cxy obtained * 55 * previously, * 56 * + It jumps to the boot_loader() function defined in the 'boot.c' file and passes 2 * 57 * arguments which are the cxy and lid of each core to this function. * 38 * It does 3 things: * 39 * - It initializes the stack pointer depending on the lid extracted from the gid, * 40 * using the BOOT_STACK_BASE and BOOT_STACK_SIZE parameters defined in the * 41 * 'boot_config.h' file, * 42 * - It changes the value of the DATA address extension register using the cxy extracted * 43 * from the gid, * 44 * - It jumps to the boot_loader() function defined in the 'boot.c' file, passing the two * 45 * arguments (cxy and lid). * 58 46 *********************************************************************************************/ 59 47 … … 72 60 boot_entry: 73 61 74 #if USE_FIXED_FORMAT 75 76 /************* 77 * VERSION 1 * 78 *************/ 79 80 /* 81 * Get (cxy, lid) values from gid contained in coprocessor0 register. 82 */ 62 /* Get (cxy, lid) values from gid contained in CP0 register */ 83 63 84 64 mfc0 k0, CP0_PROCID … … 87 67 srl t2, k0, P_WIDTH /* t2 <= cxy */ 88 68 89 /* Initialize stack pointer from previously retrievedlid value */69 /* Initialize stack pointer from lid value */ 90 70 91 71 la t0, BOOT_STACK_BASE /* t0 <= BOOT_STACK_BASE */ … … 93 73 multu k1, t1 94 74 mflo k0 /* k0 <= BOOT_STACK_SIZE * lid */ 95 subu sp, t0, k0 /* P[cxy,lid] s tack top initialized*/75 subu sp, t0, k0 /* P[cxy,lid] sp initialized */ 96 76 97 /* Switch to local DSPACE by changing the value of the address extension register s*/77 /* Switch to local DSPACE by changing the value of the address extension register */ 98 78 99 79 mtc2 t2, CP2_DATA_PADDR_EXT 100 80 101 /* Jump to boot_loader() function after passing 2 arguments in the registers*/81 /* Jump to boot_loader() function after passing (cxy,lid) arguments in the registers */ 102 82 103 83 or a0, zero, t1 /* a0 <= lid */ … … 107 87 nop 108 88 109 #else110 111 /*************112 * VERSION 2 *113 *************/114 115 /* Test if this is bscpu */116 117 mfc0 k0, CP0_PROCID118 andi k0, k0, 0xFFF /* k0 <= gid */119 120 li t1, BOOT_CORE_GID /* t1 <= bscpu gid */121 or t3, zero, zero /* t3 <= bscpu lid = 0 */122 beq k0, t1, bscpu_exit /* if bscpu, skip scanning core tbl */123 li t4, BOOT_CORE_CXY /* t4 <= bscpu cxy */124 125 /* Get base address of the core descriptor table in 'arch_info.bin' file */126 127 la t0, ARCHINFO_BASE /* t0 <= ARCHINFO_BASE */128 li t1, 0x80 /* t1 <= ARCHINFO_HEADER_SIZE */129 addu t2, t0, t1 /* t2 <= ARCHINFO_CORE_BASE */130 131 /* scan the core descriptor table if this is not bscpu. TODO If not found? */132 133 li t3, 0x8 /* t3 <= ARCHINFO_CORE_SIZE */134 135 scanning_core_table:136 lw t1, 0(t2) /* t1 <= archinfo_core.gid */137 bne t1, k0, scanning_core_table /* if (t1 != k0) => loop */138 addu t2, t2, t3 /* t2 <= @ next archinfo_core */139 140 /* Get (cxy, lid) values from the found core descriptor */141 142 lw t3, -8(t2) /* t3 <= lid */143 lw t4, -4(t2) /* t4 <= cxy */144 145 /* Initialize stack pointer from previously retrieved lid value */146 147 bscpu_exit:148 la t0, BOOT_STACK_BASE /* t0 <= BOOT_STACK_BASE */149 li k1, BOOT_STACK_SIZE /* k1 <= BOOT_STACK_SIZE */150 multu k1, t3151 mflo k0 /* k0 <= BOOT_STACK_SIZE * lid */152 subu sp, t0, k0 /* P[cxy,lid] stack top initialized */153 154 /* Switch to local DSPACE by changing the value of the address extension registers */155 156 mtc2 t4, CP2_DATA_PADDR_EXT157 158 /* Jumping to boot_loader() function after passing 2 arguments in registers */159 160 or a0, zero, t3 /* a0 <= lid */161 or a1, zero, t4 /* a1 <= cxy */162 la ra, boot_loader163 jr ra164 nop165 166 #endif167 168 89 .end boot_entry 169 90
Note: See TracChangeset
for help on using the changeset viewer.