- Timestamp:
- 2006-11-17T20:21:25Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f18cc64
- Parents:
- 282f2c9c
- Location:
- boot/arch/sparc64/loader
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/asm.S
r282f2c9c rf2ea5d8 1 1 # 2 2 # Copyright (C) 2006 Martin Decky 3 # Copyright (C) 2006 Jakub Jermar 3 4 # All rights reserved. 4 5 # -
boot/arch/sparc64/loader/asm.h
r282f2c9c rf2ea5d8 1 1 /* 2 2 * Copyright (C) 2006 Martin Decky 3 * Copyright (C) 2006 Jakub Jermar 3 4 * All rights reserved. 4 5 * … … 30 31 #define BOOT_sparc64_ASM_H_ 31 32 32 #define PAGE_SIZE 8192 33 #define PAGE_WIDTH 13 33 #include "types.h" 34 #include "main.h" 35 36 #define PAGE_SIZE 8192 37 #define PAGE_WIDTH 13 34 38 35 39 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 36 40 37 41 extern void halt(void); 38 extern void jump_to_kernel(void *entry, int bsp, void *bootinfo, unsigned int bootinfo_size) __attribute__((noreturn)); 42 extern void jump_to_kernel(void *entry, uint64_t cfg, bootinfo_t *bootinfo, 43 unsigned int bootinfo_size) __attribute__((noreturn)); 39 44 40 45 #endif -
boot/arch/sparc64/loader/main.c
r282f2c9c rf2ea5d8 47 47 init_components(components); 48 48 49 if (!ofw_get_physmem_start(&bootinfo.physmem_start)) { 50 printf("Error: unable to get start of physical memory.\n"); 51 halt(); 52 } 53 49 54 if (!ofw_memmap(&bootinfo.memmap)) { 50 55 printf("Error: unable to get memory map, halting.\n"); … … 58 63 59 64 printf("\nSystem info\n"); 60 printf(" memory: %dM\n", bootinfo.memmap.total>>20); 65 printf(" memory: %dM starting at %P\n", 66 bootinfo.memmap.total >> 20, bootinfo.physmem_start); 61 67 62 68 printf("\nMemory statistics\n"); … … 66 72 unsigned int i; 67 73 for (i = 0; i < COMPONENTS; i++) 68 printf(" %P: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size); 74 printf(" %P: %s image (size %d bytes)\n", components[i].start, 75 components[i].name, components[i].size); 69 76 70 77 void * base = (void *) KERNEL_VIRTUAL_ADDRESS; … … 94 101 printf("\nChecking for secondary processors..."); 95 102 if (!ofw_cpu()) 96 printf("Error: unable to get cpuproperties\n");103 printf("Error: unable to get CPU properties\n"); 97 104 printf("done.\n"); 98 105 99 106 printf("\nBooting the kernel...\n"); 100 jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 1, &bootinfo, sizeof(bootinfo)); 107 jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 108 bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, sizeof(bootinfo)); 101 109 } -
boot/arch/sparc64/loader/main.h
r282f2c9c rf2ea5d8 39 39 #define TASKMAP_MAX_RECORDS 32 40 40 41 #define BSP_PROCESSOR 1 42 #define AP_PROCESSOR 0 43 41 44 typedef struct { 42 45 void *addr; … … 50 53 51 54 typedef struct { 55 uintptr_t physmem_start; 52 56 taskmap_t taskmap; 53 57 memmap_t memmap; … … 56 60 } bootinfo_t; 57 61 62 extern bootinfo_t bootinfo; 63 58 64 extern void start(void); 59 65 extern void bootstrap(void); -
boot/arch/sparc64/loader/ofwarch.c
r282f2c9c rf2ea5d8 1 1 /* 2 2 * Copyright (C) 2005 Martin Decky 3 * Copyright (C) 2006 Jakub Jermar 3 4 * All rights reserved. 4 5 * … … 38 39 #include <register.h> 39 40 #include "main.h" 41 #include "asm.h" 40 42 41 43 void write(const char *str, const int len) … … 86 88 * Start secondary processor. 87 89 */ 88 (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0); 90 (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, 91 KERNEL_VIRTUAL_ADDRESS, 92 bootinfo.physmem_start | AP_PROCESSOR); 89 93 } 90 94 } … … 94 98 return cpus; 95 99 } 100 101 /** Get physical memory starting address. 102 * 103 * @param start Pointer to variable where the physical memory starting 104 * address will be stored. 105 * 106 * @return Non-zero on succes, zero on failure. 107 */ 108 int ofw_get_physmem_start(uintptr_t *start) 109 { 110 uint32_t memreg[4]; 111 112 if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0) 113 return 0; 114 115 *start = (((uint64_t) memreg[0]) << 32) | memreg[1]; 116 return 1; 117 } 118 -
boot/arch/sparc64/loader/ofwarch.h
r282f2c9c rf2ea5d8 31 31 32 32 #include "main.h" 33 #include "types.h" 33 34 34 35 #define OFW_ADDRESS_CELLS 2 … … 36 37 37 38 extern int ofw_cpu(void); 39 extern int ofw_get_physmem_start(uintptr_t *start); 38 40 39 41 #endif
Note:
See TracChangeset
for help on using the changeset viewer.