/trunk/kernel/arch/sparc64/src/sparc64.c |
---|
37,7 → 37,6 |
#include <config.h> |
#include <arch/trap/trap.h> |
#include <arch/console.h> |
#include <arch/drivers/tick.h> |
#include <proc/thread.h> |
#include <console/console.h> |
#include <arch/boot/boot.h> |
72,7 → 71,6 |
void arch_pre_mm_init(void) |
{ |
trap_init(); |
tick_init(); |
} |
void arch_post_mm_init(void) |
/trunk/kernel/arch/sparc64/src/cpu/cpu.c |
---|
35,20 → 35,51 |
#include <arch/asm.h> |
#include <cpu.h> |
#include <arch.h> |
#include <print.h> |
#include <arch/register.h> |
#include <print.h> |
#include <arch/boot/boot.h> |
#include <genarch/ofw/ofw_tree.h> |
#include <arch/types.h> |
#include <arch/drivers/tick.h> |
/** Perform sparc64 specific initialization of the processor structure for the current processor. */ |
void cpu_arch_init(void) |
{ |
CPU->arch.clock_frequency = bootinfo.processor.clock_frequency; |
ofw_tree_node_t *node; |
uint32_t mid; |
uint32_t clock_frequency = 0; |
upa_config_t upa_config; |
upa_config.value = upa_config_read(); |
node = ofw_tree_find_child_by_device_type(ofw_tree_lookup("/"), "cpu"); |
while (node) { |
ofw_tree_property_t *prop; |
prop = ofw_tree_getprop(node, "upa-portid"); |
if (prop && prop->value) { |
mid = *((uint32_t *) prop->value); |
if (mid == upa_config.mid) { |
prop = ofw_tree_getprop(node, "clock-frequency"); |
if (prop && prop->value) |
clock_frequency = *((uint32_t *) prop->value); |
} |
} |
node = ofw_tree_find_peer_by_device_type(node, "cpu"); |
} |
CPU->arch.clock_frequency = clock_frequency; |
tick_init(); |
} |
/** Read version information from the current processor. */ |
void cpu_identify(void) |
{ |
CPU->arch.ver.value = ver_read(); |
} |
/** Print version information for a processor. |
* |
* @param m Processor structure of the CPU for which version information is to be printed. |
*/ |
void cpu_print_report(cpu_t *m) |
{ |
char *manuf, *impl; |
/trunk/kernel/arch/sparc64/src/drivers/tick.c |
---|
52,7 → 52,7 |
interrupt_register(14, "tick_int", tick_interrupt); |
compare.int_dis = false; |
compare.tick_cmpr = bootinfo.processor.clock_frequency/HZ; |
compare.tick_cmpr = CPU->arch.clock_frequency/HZ; |
tick_compare_write(compare.value); |
tick_write(0); |
} |
/trunk/kernel/arch/sparc64/src/start.S |
---|
43,8 → 43,9 |
* from the boot loader. |
* |
* The registers are expected to be in this state: |
* - %o0 bootinfo structure address |
* - %o1 bootinfo structure size |
* - %o0 non-zero for the bootstrup processor, zero for application/secondary processors |
* - %o1 bootinfo structure address |
* - %o2 bootinfo structure size |
* |
* Moreover, we depend on boot having established the |
* following environment: |
55,6 → 56,8 |
.global kernel_image_start |
kernel_image_start: |
brz %o0, kernel_image_start ! block secondary processors |
nop |
/* |
* Setup basic runtime environment. |
72,8 → 75,6 |
* Copy the bootinfo structure passed from the boot loader |
* to the kernel bootinfo structure. |
*/ |
mov %o1, %o2 |
mov %o0, %o1 |
sethi %hi(bootinfo), %o0 |
call memcpy |
or %o0, %lo(bootinfo), %o0 |