Changeset 1eb154f in mainline
- Timestamp:
- 2008-06-15T11:07:37Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3527a93
- Parents:
- c711efe
- Location:
- boot/arch/sparc64/loader
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/asm.S
rc711efe r1eb154f 100 100 jump_to_kernel: 101 101 /* 102 * Make sure that the code we have moved has drained to main memory.103 * We have a reason to assume that the I-cache does not include the104 * code to which we are going to pass control. Hence no I-cache105 * invalidation.102 * We have copied code and now we need to guarantee cache coherence. 103 * 1. Make sure that the code we have moved has drained to main memory. 104 * 2. Invalidate I-cache. 105 * 3. Flush instruction pipeline. 106 106 */ 107 membar #StoreStore 107 call icache_flush 108 membar #StoreStore 109 flush %i7 108 110 109 111 mov %o0, %l1 … … 112 114 mov %o3, %o2 113 115 jmp %l1 ! jump to kernel 116 nop 117 118 #define ICACHE_SIZE 8192 119 #define ICACHE_LINE_SIZE 32 120 #define ICACHE_SET_BIT (1 << 13) 121 #define ASI_ICACHE_TAG 0x67 122 123 # Flush I-cache 124 icache_flush: 125 set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1 126 stxa %g0, [%g1] ASI_ICACHE_TAG 127 0: membar #Sync 128 subcc %g1, ICACHE_LINE_SIZE, %g1 129 bnz,pt %xcc, 0b 130 stxa %g0, [%g1] ASI_ICACHE_TAG 131 membar #Sync 132 retl 133 ! SF Erratum #51 114 134 nop 115 135 -
boot/arch/sparc64/loader/ofwarch.c
rc711efe r1eb154f 70 70 uint64_t current_mid; 71 71 72 asm volatile ("ldxa [%1] %2, %0\n" : "=r" (current_mid) : "r" (0), "i" (ASI_UPA_CONFIG)); 72 asm volatile ("ldxa [%1] %2, %0\n" 73 : "=r" (current_mid) 74 : "r" (0), "i" (ASI_UPA_CONFIG)); 73 75 current_mid >>= UPA_CONFIG_MID_SHIFT; 74 76 current_mid &= UPA_CONFIG_MID_MASK; … … 76 78 int cpus; 77 79 78 for (cpus = 0; node != 0 && node != -1; node = ofw_get_peer_node(node), cpus++) { 79 if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) { 80 for (cpus = 0; node != 0 && node != -1; node = ofw_get_peer_node(node), 81 cpus++) { 82 if (ofw_get_property(node, "device_type", type_name, 83 sizeof(type_name)) > 0) { 80 84 if (strcmp(type_name, "cpu") == 0) { 81 85 uint32_t mid; 82 86 83 if (ofw_get_property(node, "upa-portid", &mid, sizeof(mid)) <= 0) 87 if (ofw_get_property(node, "upa-portid", &mid, 88 sizeof(mid)) <= 0) 84 89 continue; 85 90 … … 88 93 * Start secondary processor. 89 94 */ 90 (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, 91 KERNEL_VIRTUAL_ADDRESS, 92 bootinfo.physmem_start | AP_PROCESSOR); 95 (void) ofw_call("SUNW,start-cpu", 3, 1, 96 NULL, node, KERNEL_VIRTUAL_ADDRESS, 97 bootinfo.physmem_start | 98 AP_PROCESSOR); 93 99 } 94 100 }
Note:
See TracChangeset
for help on using the changeset viewer.