Changeset 45b26dad in mainline for boot/arch/sparc64/loader
- Timestamp:
- 2006-09-26T12:59:28Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b44939b
- Parents:
- 6ff1f1e
- Location:
- boot/arch/sparc64/loader
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/asm.S
r6ff1f1e r45b26dad 101 101 mov %o1, %o0 102 102 mov %o2, %o1 103 mov %o3, %o2 103 104 jmp %l1 ! jump to kernel 104 105 nop -
boot/arch/sparc64/loader/asm.h
r6ff1f1e r45b26dad 36 36 37 37 extern void halt(void); 38 extern void jump_to_kernel(void *entry, void *bootinfo, unsigned int bootinfo_size) __attribute__((noreturn));38 extern void jump_to_kernel(void *entry, int bsp, void *bootinfo, unsigned int bootinfo_size) __attribute__((noreturn)); 39 39 40 40 #endif -
boot/arch/sparc64/loader/main.c
r6ff1f1e r45b26dad 37 37 #include <align.h> 38 38 39 #define KERNEL_VIRTUAL_ADDRESS 0x40000040 41 39 bootinfo_t bootinfo; 42 40 … … 58 56 } 59 57 60 if (!ofw_cpu(&bootinfo.cpu)) 61 printf("Error: unable to get cpu properties\n"); 62 63 printf("\nDevice info\n"); 64 printf(" cpu: %dMHz\n", bootinfo.cpu.clock_frequency/1000000); 58 printf("\nSystem info\n"); 65 59 printf(" memory: %dM\n", bootinfo.memmap.total>>20); 66 60 … … 97 91 printf("done.\n"); 98 92 93 printf("\nChecking for secondary processors..."); 94 if (!ofw_cpu()) 95 printf("Error: unable to get cpu properties\n"); 96 printf("done.\n"); 97 99 98 printf("\nBooting the kernel...\n"); 100 jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo));99 jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 1, &bootinfo, sizeof(bootinfo)); 101 100 } -
boot/arch/sparc64/loader/main.h
r6ff1f1e r45b26dad 35 35 #include <types.h> 36 36 37 #define KERNEL_VIRTUAL_ADDRESS 0x400000 38 37 39 #define TASKMAP_MAX_RECORDS 32 38 40 … … 48 50 49 51 typedef struct { 50 uint32_t clock_frequency;51 } cpu_t;52 53 typedef struct {54 52 taskmap_t taskmap; 55 53 memmap_t memmap; 56 cpu_t cpu;57 54 ballocs_t ballocs; 58 55 ofw_tree_node_t *ofw_root; -
boot/arch/sparc64/loader/ofwarch.c
r6ff1f1e r45b26dad 54 54 } 55 55 56 int ofw_cpu(cpu_t *cpu) 56 57 #define ASI_UPA_CONFIG 0x4a 58 #define UPA_CONFIG_MID_SHIFT 17 59 #define UPA_CONFIG_MID_MASK 0x1f 60 61 int ofw_cpu(void) 57 62 { 58 63 char type_name[BUF_SIZE]; … … 62 67 if (node == 0 || node == -1) { 63 68 printf("Could not find any child nodes of the root node.\n"); 64 return ;69 return 0; 65 70 } 71 72 uint64_t current_mid; 73 74 __asm__ volatile ("ldxa [%1] %2, %0\n" : "=r" (current_mid) : "r" (0), "i" (ASI_UPA_CONFIG)); 75 current_mid >>= UPA_CONFIG_MID_SHIFT; 76 current_mid &= UPA_CONFIG_MID_MASK; 66 77 67 78 for (; node != 0 && node != -1; node = ofw_get_peer_node(node)) { 68 79 if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) { 69 80 if (strcmp(type_name, "cpu") == 0) { 70 uint32_t m hz;81 uint32_t mid; 71 82 72 if (ofw_get_property(node, " clock-frequency", &mhz, sizeof(mhz)) <= 0)83 if (ofw_get_property(node, "upa-portid", &mid, sizeof(mid)) <= 0) 73 84 continue; 74 85 75 cpu->clock_frequency = mhz; 76 return 1; 86 if (current_mid != mid) { 87 /* 88 * Start secondary processor. 89 */ 90 (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0); 91 } 77 92 } 78 93 } 79 } ;94 } 80 95 81 return 0;96 return 1; 82 97 } -
boot/arch/sparc64/loader/ofwarch.h
r6ff1f1e r45b26dad 35 35 #define OFW_SIZE_CELLS 2 36 36 37 extern int bpp2align[]; 38 39 extern int ofw_cpu(cpu_t *cpu); 37 extern int ofw_cpu(void); 40 38 41 39 #endif
Note:
See TracChangeset
for help on using the changeset viewer.