/trunk/boot/arch/sparc64/loader/main.c |
---|
46,11 → 46,6 |
init_components(components); |
if (!ofw_get_physmem_start(&bootinfo.physmem_start)) { |
printf("Error: unable to get start of physical memory.\n"); |
halt(); |
} |
if (!ofw_memmap(&bootinfo.memmap)) { |
printf("Error: unable to get memory map, halting.\n"); |
halt(); |
62,8 → 57,7 |
} |
printf("\nSystem info\n"); |
printf(" memory: %dM starting at %P\n", |
bootinfo.memmap.total >> 20, bootinfo.physmem_start); |
printf(" memory: %dM\n", bootinfo.memmap.total>>20); |
printf("\nMemory statistics\n"); |
printf(" kernel entry point at %P\n", KERNEL_VIRTUAL_ADDRESS); |
71,8 → 65,7 |
unsigned int i; |
for (i = 0; i < COMPONENTS; i++) |
printf(" %P: %s image (size %d bytes)\n", components[i].start, |
components[i].name, components[i].size); |
printf(" %P: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size); |
void * base = (void *) KERNEL_VIRTUAL_ADDRESS; |
unsigned int top = 0; |
100,10 → 93,9 |
printf("\nChecking for secondary processors..."); |
if (!ofw_cpu()) |
printf("Error: unable to get CPU properties\n"); |
printf("Error: unable to get cpu properties\n"); |
printf("done.\n"); |
printf("\nBooting the kernel...\n"); |
jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, |
bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, sizeof(bootinfo)); |
jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 1, &bootinfo, sizeof(bootinfo)); |
} |
/trunk/boot/arch/sparc64/loader/ofwarch.c |
---|
1,6 → 1,5 |
/* |
* Copyright (C) 2005 Martin Decky |
* Copyright (C) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
38,7 → 37,6 |
#include <string.h> |
#include <register.h> |
#include "main.h" |
#include "asm.h" |
void write(const char *str, const int len) |
{ |
87,9 → 85,7 |
/* |
* Start secondary processor. |
*/ |
(void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, |
KERNEL_VIRTUAL_ADDRESS, |
bootinfo.physmem_start | AP_PROCESSOR); |
(void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0); |
} |
} |
} |
97,22 → 93,3 |
return cpus; |
} |
/** Get physical memory starting address. |
* |
* @param start Pointer to variable where the physical memory starting |
* address will be stored. |
* |
* @return Non-zero on succes, zero on failure. |
*/ |
int ofw_get_physmem_start(uintptr_t *start) |
{ |
uint32_t memreg[4]; |
if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0) |
return 0; |
*start = (((uint64_t) memreg[0]) << 32) | memreg[1]; |
return 1; |
} |
/trunk/boot/arch/sparc64/loader/ofwarch.h |
---|
30,12 → 30,10 |
#define BOOT_sparc64_OFWARCH_H_ |
#include "main.h" |
#include "types.h" |
#define OFW_ADDRESS_CELLS 2 |
#define OFW_SIZE_CELLS 2 |
extern int ofw_cpu(void); |
extern int ofw_get_physmem_start(uintptr_t *start); |
#endif |
/trunk/boot/arch/sparc64/loader/asm.S |
---|
1,6 → 1,5 |
# |
# Copyright (C) 2006 Martin Decky |
# Copyright (C) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
/trunk/boot/arch/sparc64/loader/asm.h |
---|
1,6 → 1,5 |
/* |
* Copyright (C) 2006 Martin Decky |
* Copyright (C) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
30,16 → 29,12 |
#ifndef BOOT_sparc64_ASM_H_ |
#define BOOT_sparc64_ASM_H_ |
#include "types.h" |
#include "main.h" |
#define PAGE_SIZE 8192 |
#define PAGE_WIDTH 13 |
#define PAGE_SIZE 8192 |
#define PAGE_WIDTH 13 |
#define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) |
extern void halt(void); |
extern void jump_to_kernel(void *entry, uint64_t cfg, bootinfo_t *bootinfo, |
unsigned int bootinfo_size) __attribute__((noreturn)); |
extern void jump_to_kernel(void *entry, int bsp, void *bootinfo, unsigned int bootinfo_size) __attribute__((noreturn)); |
#endif |
/trunk/boot/arch/sparc64/loader/main.h |
---|
38,9 → 38,6 |
#define TASKMAP_MAX_RECORDS 32 |
#define BSP_PROCESSOR 1 |
#define AP_PROCESSOR 0 |
typedef struct { |
void *addr; |
uint32_t size; |
52,7 → 49,6 |
} taskmap_t; |
typedef struct { |
uintptr_t physmem_start; |
taskmap_t taskmap; |
memmap_t memmap; |
ballocs_t ballocs; |
59,8 → 55,6 |
ofw_tree_node_t *ofw_root; |
} bootinfo_t; |
extern bootinfo_t bootinfo; |
extern void start(void); |
extern void bootstrap(void); |