56,12 → 56,23 |
return flag != -1; |
} |
|
/* |
* Node among whose children the CPU nodes are located. |
*/ |
#if defined (OPEN_BOOT) |
#define CPUS_PARENT_NODE ofw_root |
#elif defined (SMART_FIRMWARE) |
#define CPUS_PARENT_NODE ofw_find_device("/ssm@0,0") |
#endif |
|
|
int ofw_cpu(void) |
{ |
char type_name[BUF_SIZE]; |
|
phandle node; |
node = ofw_get_child_node(ofw_root); |
node = ofw_get_child_node(CPUS_PARENT_NODE); |
|
if (node == 0 || node == -1) { |
printf("Could not find any child nodes of the root node.\n"); |
return 0; |
84,8 → 95,12 |
if (strcmp(type_name, "cpu") == 0) { |
uint32_t mid; |
|
if (ofw_get_property(node, "upa-portid", &mid, |
sizeof(mid)) <= 0) |
/* "upa-portid" for US, "portid" for US-III */ |
if (ofw_get_property( |
node, "upa-portid", |
&mid, sizeof(mid)) <= 0 |
&& ofw_get_property(node, "portid", |
&mid, sizeof(mid)) <= 0) |
continue; |
|
if (current_mid != mid) { |