Changeset 9a5b556 in mainline for boot/arch/sparc64/loader
- Timestamp:
- 2006-09-12T13:03:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6eabb6e6
- Parents:
- 7bb6b06
- Location:
- boot/arch/sparc64/loader
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/Makefile
r7bb6b06 r9a5b556 52 52 main.c \ 53 53 ../../../generic/printf.c \ 54 ../../../generic/string.c \ 54 55 ../../../genarch/ofw.c \ 55 56 ofwarch.c \ -
boot/arch/sparc64/loader/main.c
r7bb6b06 r9a5b556 67 67 printf("Error: unable to get keyboard properties\n"); 68 68 69 if (!ofw_cpu(&bootinfo.cpu)) 70 printf("Error: unable to get cpu properties\n"); 71 69 72 printf("\nDevice statistics\n"); 73 printf(" cpu: %dMHz\n", bootinfo.cpu.clock_frequency/1000000); 70 74 printf(" memory: %dM\n", bootinfo.memmap.total>>20); 71 75 printf(" screen at %P, resolution %dx%d, %d bpp (scanline %d bytes)\n", (uintptr_t) bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); -
boot/arch/sparc64/loader/main.h
r7bb6b06 r9a5b556 46 46 47 47 typedef struct { 48 uint32_t clock_frequency; 49 } cpu_t; 50 51 typedef struct { 48 52 taskmap_t taskmap; 49 53 memmap_t memmap; 50 54 screen_t screen; 51 55 keyboard_t keyboard; 56 cpu_t cpu; 52 57 } bootinfo_t; 53 58 -
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 } -
boot/arch/sparc64/loader/ofwarch.h
r7bb6b06 r9a5b556 30 30 #define BOOT_sparc64_OFWARCH_H_ 31 31 32 #include "main.h" 33 32 34 #define OFW_ADDRESS_CELLS 2 33 35 #define OFW_SIZE_CELLS 2 … … 35 37 extern int bpp2align[]; 36 38 39 extern int ofw_cpu(cpu_t *cpu); 40 37 41 #endif
Note:
See TracChangeset
for help on using the changeset viewer.