Changeset 629 for trunk/softs/giet_tsar/reset.S
- Timestamp:
- Feb 12, 2014, 9:51:23 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/giet_tsar/reset.S
r622 r629 10 10 * 11 11 * As we don't want to use the virtual memory, the physical address is 12 * equal to the virtual address (identity mapping) and all processors use 13 * the physical memory bank in cluster 0. Both the reset base address and 14 * the kernel base address can be redefined to use a physical memory bank 15 * smaller than 4 Gbytes. 12 * equal to the virtual address (identity mapping) and all processors stacks 13 * and code segments are allocated in the physical memory bank in cluster 0. 14 * 15 * Both the reset base address and the kernel base address must be redefined 16 * to use a physical memory bank smaller than 2 Gbytes. 16 17 * 17 18 * There is one XCU iand one MMC per cluster. 18 * All other peripherals (including the boot ROM) are located in cluster 0. 19 * Only two HWI interrupts are supported: 20 * - IRQ_IN[0] IOC 21 * - IRQ_IN[12] MMC 19 * 20 * There is one IOPIC component in cluster_io. 21 * 22 * There is two sets of peripherals: 23 * 24 * 1) A block device and a single channel TTY controller are available 25 * in cluster(0,0). 26 * 27 * 2) Other peripherals (including another Blockdevice, a multi-channels TTY 28 * contrÃŽler, a Frame buffer) are located in cluster_io. 29 * For those externals peripherals, hardware interrupts (HWI) are translated 30 * to software interrupts (WTI) by and IOPIC component, that is programmed 31 * to route all SWI to to processor 0 in cluster (0,0). 22 32 * 23 33 * The boot sequence is the following: … … 25 35 * - Each processor initializes the CP0 EBASE register 26 36 * - Only processor 0 initializes the Interrupt vector. 37 * - Only processor 0 initializes the IOPIC component. 27 38 * - Each processor initializes its private XCU mask. 28 39 * - Each processor initializes the Status Register (SR) … … 37 48 .extern seg_stack_base 38 49 .extern seg_xcu_base 50 .extern seg_pic_base 39 51 .extern seg_kcode_base 40 52 .extern _interrupt_vector 41 53 .extern _ioc_isr 42 54 .extern _mmc_isr 55 .extern _tty_isr 43 56 .extern main 44 57 … … 62 75 la $27, seg_stack_base 63 76 addi $26, $10, 1 /* $26 <= (proc_id + 1) */ 64 sll $26, $26, 1 6 /* $26 <= (proc_id + 1) * 64K */77 sll $26, $26, 14 /* $26 <= (proc_id + 1) * 16K */ 65 78 addu $29, $27, $26 /* $29 <= seg_stack_base(proc_id) */ 66 79 … … 69 82 mtc0 $26, CP0_EBASE /* CP0_EBASE <= seg_kcode_base */ 70 83 71 /* only proc (0,0,0) initializes interrupt vector */84 /* only proc (0,0,0) initializes interrupt vector for IOC, TTY, MMC */ 72 85 bne $10, $0, reset_xcu 73 86 nop 74 87 75 la $26, _interrupt_vector /* interrupt vector address */ 88 la $26, _interrupt_vector /* interrupt vector address */ 89 la $27, _mmc_isr 90 sw $27, 32($26) /* interrupt_vector[8] <= _mmc_isr */ 76 91 la $27, _ioc_isr 77 sw $27, 0($26) /* interrupt_vector[0] <= _isr_ioc */ 78 la $27, _mmc_isr 79 sw $27, 48($26) /* interrupt_vector[12] <= _isr_mmc */ 80 92 sw $27, 36($26) /* interrupt_vector[9] <= _ioc_isr */ 93 la $27, _tty_isr 94 sw $27, 40($26) /* interrupt_vector[10] <= _tty_isr */ 95 96 /* only proc (0,0,0) initializes IOPIC : IOPIC_ADDRESS[i] <= &XICU[0].WTI_REG[i] */ 97 98 li $20, X_SIZE 99 addi $20, $20, -1 100 sll $20, $20, 4 101 li $21, Y_SIZE 102 add $22, $20, $21 /* $22 <= cluster(X_SIZE-1, Y_SIZE) */ 103 104 mtc2 $22, CP2_PADDR_EXT /* CP2_PADDR_EXT <= cluster_io */ 105 106 li $24, 16 /* $24 iteration (de)counter */ 107 la $27, seg_xcu_base /* $27 <= &(XICU[0].WTI_REG[0]) */ 108 la $26, seg_pic_base /* $26 <= &IOPIC_ADDRESS[0] */ 109 110 reset_loop: 111 sw $27, 0($26) /* IOPIC_ADDRESS[i] <= &XICU[0].WTI_REG[i] */ 112 addi $24, $24, -1 /* decrement iteration index */ 113 addi $27, $27, 4 /* $27 <= &(XICU[0].WTI_REG[i++] */ 114 addi $26, $26, 16 /* $26 <= &IOPIC_ADDRESS[i++] */ 115 bne $24, $0, reset_loop 116 nop 117 118 mtc2 $0, CP2_PADDR_EXT /* CP2_PADDR_EXT <= zero */ 119 81 120 reset_xcu: 82 121 83 /* only proc (x,y,0) receive IRQs and initialise its private XCU mask*/122 /* only proc (x,y,0) receive IRQs and initialise HWI and WTI XICU masks */ 84 123 bne $11, $0, reset_end 85 124 nop 86 125 la $26, seg_xcu_base 87 li $27, 0b010010000000 /* offset for MSK_HWI_ENABLE & lpid == 0 */ 88 addu $24, $26, $27 /* $24 <= &MASK */ 89 li $25, 0x00001001 /* IOC: IRQ[0] / MEMC: IRQ[12] */ 90 sw $25, 0($24) /* set MASK */ 126 li $27, 0b010010000000 /* offset for MSK_HWI_ENABLE[lpid == 0] */ 127 addu $24, $26, $27 /* $24 <= &HWI_MASK */ 128 li $25, 0x0700 /* TTY:HWI[10] IOC:HWI[9] MEMC:HWI[8] */ 129 sw $25, 0($24) /* set HWI mask */ 130 131 li $27, 0b011010000000 /* offset for MSK_WTI_ENABLE[lpid == 0] */ 132 addu $24, $26, $27 /* $24 <= $WTI_MASK */ 133 li $25, 0xFFFFFFFF /* all WTI enabled */ 134 sw $25, 0($24) /* set WTI mask */ 91 135 92 136 reset_end:
Note: See TracChangeset
for help on using the changeset viewer.