Changeset 743 for trunk/softs/giet_tsar/reset.S
- Timestamp:
- Jul 10, 2014, 11:23:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/giet_tsar/reset.S
r633 r743 1 1 /******************************************************************************** 2 * 3 * 4 * 2 * File : reset.S 3 * Author : Alain Greiner 4 * Date : 15/01/2014 5 5 ********************************************************************************* 6 6 * This is a boot code for a generic multi-clusters / multi-processors … … 34 34 * - Each processor initializes the stack pointer ($29) depending on proc_id. 35 35 * - Each processor initializes the CP0 EBASE register 36 * 36 * - Only processor 0 initializes the Interrupt vector. 37 37 * - Only processor 0 initializes the IOPIC component. 38 38 * - Each processor initializes its private XCU mask. 39 * 40 * 39 * - Each processor initializes the Status Register (SR) 40 * - Each processor jumps to the same main address in kernel mode... 41 41 ********************************************************************************/ 42 42 … … 44 44 #include "mips32_registers.h" 45 45 46 46 .section .reset,"ax",@progbits 47 47 48 .externseg_stack_base49 .externseg_xcu_base48 .extern seg_stack_base 49 .extern seg_xcu_base 50 50 .extern seg_pic_base 51 51 .extern seg_kcode_base 52 53 54 52 .extern _interrupt_vector 53 .extern _ioc_isr 54 .extern _mmc_isr 55 55 .extern _tty_isr 56 56 .extern main 57 57 58 .globl reset 59 .entreset60 .align258 .globl reset 59 .ent reset 60 .align 2 61 61 62 62 reset: 63 63 .set noreorder 64 64 65 65 /* each proc computes proc_id, lpid, cluster_xy */ 66 66 mfc0 $26, CP0_PROCID 67 andi $26, $26, 0x3FF 67 andi $26, $26, 0x3FF /* at most 1024 processors */ 68 68 move $10, $26 /* $10 <= proc_id */ 69 69 li $27, NB_PROCS_MAX … … 73 73 74 74 /* each proc initializes stack pointer (64K per processor) */ 75 srl $8, $12, Y_WIDTH /* $8 <= x */ 76 li $9, Y_SIZE 77 mul $8, $8, $9 /* $8 <= x * Y_SIZE */ 78 andi $13, $12, (1<<Y_WIDTH)-1 79 addu $8, $8, $13 /* $8 <= x * Y_SIZE + y */ 80 mul $8, $8, $27 /* $8 <= (x*Y_SIZE+y)*NB_PROCS_MAX */ 81 addu $10, $11, $8 /* $10 <= (x*Y_SIZE+y)*NB_PROCS_MAX + lpid */ 82 75 83 la $27, seg_stack_base 76 addi $26, $10, 1 84 addi $26, $10, 1 /* $26 <= (proc_id + 1) */ 77 85 sll $26, $26, 14 /* $26 <= (proc_id + 1) * 16K */ 78 addu $29, $27, $26 86 addu $29, $27, $26 /* $29 <= seg_stack_base(proc_id) */ 79 87 80 88 /* each proc initializes CP0 EBASE register */ … … 83 91 84 92 /* only proc (0,0,0) initializes interrupt vector for IOC, TTY, MMC */ 85 bne 93 bne $10, $0, reset_xcu 86 94 nop 87 95 … … 96 104 /* only proc (0,0,0) initializes IOPIC : IOPIC_ADDRESS[i] <= &XICU[0].WTI_REG[i] */ 97 105 98 li $26, USE_EXT_IO 99 beq $26, $0, reset_xcu /* IOPIC not initialised if not USE_EXT_IO */ 106 #if USE_IOPIC 100 107 101 108 li $20, X_SIZE … … 120 127 121 128 mtc2 $0, CP2_PADDR_EXT /* CP2_PADDR_EXT <= zero */ 129 130 #endif 122 131 123 132 reset_xcu: … … 140 149 141 150 /* initializes SR register */ 142 li $26, 0x0000FF01143 mtc0 $26, $12 151 li $26, 0x0000FF01 152 mtc0 $26, $12 /* SR <= kernel mode / IRQ enable */ 144 153 145 154 /* jumps to main in kernel mode */ 146 la 155 la $26, main 147 156 jr $26 148 157 nop 149 158 150 .end 159 .end reset 151 160 152 161 .set reorder
Note: See TracChangeset
for help on using the changeset viewer.