Changeset 9a5b556 in mainline for boot/arch/sparc64/loader/ofwarch.c
- Timestamp:
- 2006-09-12T13:03:55Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6eabb6e6
- Parents:
- 7bb6b06
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/ofwarch.c
r7bb6b06 r9a5b556 35 35 #include <ofw.h> 36 36 #include <printf.h> 37 #include <string.h> 38 #include "main.h" 37 39 38 40 int bpp2align[] = { … … 80 82 return true; 81 83 } 84 85 int ofw_cpu(cpu_t *cpu) 86 { 87 char type_name[BUF_SIZE]; 88 89 phandle node; 90 node = ofw_get_child_node(ofw_root); 91 if (node == 0 || node == -1) { 92 printf("Could not find any child nodes of the root node.\n"); 93 return; 94 } 95 96 for (; node != 0 && node != -1; node = ofw_get_peer_node(node)) { 97 if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) { 98 if (strncmp(type_name, "cpu", 3) == 0) { 99 uint32_t mhz; 100 101 if (ofw_get_property(node, "clock-frequency", &mhz, sizeof(mhz)) <= 0) 102 continue; 103 104 cpu->clock_frequency = mhz; 105 return 1; 106 } 107 } 108 }; 109 110 return 0; 111 }
Note:
See TracChangeset
for help on using the changeset viewer.