Rev 3343 | Rev 3479 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3343 | Rev 3467 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | int ofw_translate_failed(ofw_arg_t flag) |
54 | int ofw_translate_failed(ofw_arg_t flag) |
55 | { |
55 | { |
56 | return flag != -1; |
56 | return flag != -1; |
57 | } |
57 | } |
58 | 58 | ||
- | 59 | /* |
|
- | 60 | * Node among whose children the CPU nodes are located. |
|
- | 61 | */ |
|
- | 62 | #if defined (OPEN_BOOT) |
|
- | 63 | #define CPUS_PARENT_NODE ofw_root |
|
- | 64 | #elif defined (SMART_FIRMWARE) |
|
- | 65 | #define CPUS_PARENT_NODE ofw_find_device("/ssm@0,0") |
|
- | 66 | #endif |
|
- | 67 | ||
- | 68 | ||
59 | int ofw_cpu(void) |
69 | int ofw_cpu(void) |
60 | { |
70 | { |
61 | char type_name[BUF_SIZE]; |
71 | char type_name[BUF_SIZE]; |
62 | 72 | ||
63 | phandle node; |
73 | phandle node; |
64 | node = ofw_get_child_node(ofw_root); |
74 | node = ofw_get_child_node(CPUS_PARENT_NODE); |
- | 75 | ||
65 | if (node == 0 || node == -1) { |
76 | if (node == 0 || node == -1) { |
66 | printf("Could not find any child nodes of the root node.\n"); |
77 | printf("Could not find any child nodes of the root node.\n"); |
67 | return 0; |
78 | return 0; |
68 | } |
79 | } |
69 | 80 | ||
Line 82... | Line 93... | ||
82 | if (ofw_get_property(node, "device_type", type_name, |
93 | if (ofw_get_property(node, "device_type", type_name, |
83 | sizeof(type_name)) > 0) { |
94 | sizeof(type_name)) > 0) { |
84 | if (strcmp(type_name, "cpu") == 0) { |
95 | if (strcmp(type_name, "cpu") == 0) { |
85 | uint32_t mid; |
96 | uint32_t mid; |
86 | 97 | ||
- | 98 | /* "upa-portid" for US, "portid" for US-III */ |
|
- | 99 | if (ofw_get_property( |
|
- | 100 | node, "upa-portid", |
|
- | 101 | &mid, sizeof(mid)) <= 0 |
|
87 | if (ofw_get_property(node, "upa-portid", &mid, |
102 | && ofw_get_property(node, "portid", |
88 | sizeof(mid)) <= 0) |
103 | &mid, sizeof(mid)) <= 0) |
89 | continue; |
104 | continue; |
90 | 105 | ||
91 | if (current_mid != mid) { |
106 | if (current_mid != mid) { |
92 | /* |
107 | /* |
93 | * Start secondary processor. |
108 | * Start secondary processor. |