Changes in boot/arch/sparc64/src/ofw.c [7a99507:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/src/ofw.c
r7a99507 ra35b458 47 47 if (ch == '\n') 48 48 ofw_putchar('\r'); 49 49 50 50 if (ascii_check(ch)) 51 51 ofw_putchar(ch); … … 72 72 { 73 73 size_t cpus; 74 74 75 75 for (cpus = 0; (child != 0) && (child != (phandle) -1); 76 76 child = ofw_get_peer_node(child), cpus++) { 77 77 char type_name[OFW_TREE_PROPERTY_MAX_VALUELEN]; 78 78 79 79 if (ofw_get_property(child, "device_type", type_name, 80 80 OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) { 81 81 type_name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0; 82 82 83 83 if (str_cmp(type_name, "cpu") == 0) { 84 84 uint32_t mid; 85 85 86 86 /* 87 87 * "upa-portid" for US, "portid" for US-III, … … 92 92 && (ofw_get_property(child, "cpuid", &mid, sizeof(mid)) <= 0)) 93 93 continue; 94 94 95 95 if (current_mid != mid) { 96 96 /* … … 104 104 } 105 105 } 106 106 107 107 return cpus; 108 108 } … … 115 115 /* Get the current CPU MID */ 116 116 uint64_t current_mid; 117 117 118 118 asm volatile ( 119 119 "ldxa [%[zero]] %[asi], %[current_mid]\n" … … 122 122 [asi] "i" (ASI_ICBUS_CONFIG) 123 123 ); 124 124 125 125 current_mid >>= ICBUS_CONFIG_MID_SHIFT; 126 126 current_mid &= mid_mask; 127 127 128 128 /* Wake up the CPUs */ 129 129 130 130 phandle cpus_parent = ofw_find_device("/ssm@0,0"); 131 131 if ((cpus_parent == 0) || (cpus_parent == (phandle) -1)) 132 132 cpus_parent = ofw_find_device("/"); 133 133 134 134 phandle node = ofw_get_child_node(cpus_parent); 135 135 size_t cpus = wake_cpus_in_node(node, current_mid, physmem_start); 136 136 137 137 while ((node != 0) && (node != (phandle) -1)) { 138 138 char name[OFW_TREE_PROPERTY_MAX_VALUELEN]; 139 139 140 140 if (ofw_get_property(node, "name", name, 141 141 OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) { 142 142 name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0; 143 143 144 144 if (str_cmp(name, "cmp") == 0) { 145 145 phandle subnode = ofw_get_child_node(node); … … 148 148 } 149 149 } 150 150 151 151 node = ofw_get_peer_node(node); 152 152 } 153 153 154 154 if (cpus == 0) 155 155 printf("Warning: Unable to get CPU properties.\n"); … … 169 169 halt(); 170 170 } 171 171 172 172 return ((((uintptr_t) memreg[0]) << 32) | memreg[1]); 173 173 }
Note:
See TracChangeset
for help on using the changeset viewer.