Subversion Repositories HelenOS

Rev

Rev 4130 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4130 Rev 4638
Line 38... Line 38...
38
#include <genarch/ofw/ofw_tree.h>
38
#include <genarch/ofw/ofw_tree.h>
39
#include <arch/drivers/tick.h>
39
#include <arch/drivers/tick.h>
40
#include <print.h>
40
#include <print.h>
41
#include <arch/sun4v/md.h>
41
#include <arch/sun4v/md.h>
42
#include <arch/sun4v/hypercall.h>
42
#include <arch/sun4v/hypercall.h>
-
 
43
#include <arch/trap/sun4v/interrupt.h>
43
 
44
 
44
/** Perform sparc64 specific initialization of the processor structure for the
45
/** Perform sparc64 specific initialization of the processor structure for the
45
 * current processor.
46
 * current processor.
46
 */
47
 */
47
void cpu_arch_init(void)
48
void cpu_arch_init(void)
Line 53... Line 54...
53
 
54
 
54
    md_node_t node = md_get_root();
55
    md_node_t node = md_get_root();
55
 
56
 
56
    /* walk through MD, find the current CPU node & its clock-frequency */
57
    /* walk through MD, find the current CPU node & its clock-frequency */
57
    while (true) {
58
    while (true) {
58
 
-
 
59
        if (!md_next_node(&node, "cpu")) {
59
        if (!md_next_node(&node, "cpu")) {
60
            panic("Could not determine CPU frequency.");
60
            panic("Could not determine CPU frequency.");
61
        }
61
        }
62
 
62
 
63
        uint64_t id = 0;
63
        uint64_t id = 0;
64
        md_get_integer_property(node, "id", &id);
64
        md_get_integer_property(node, "id", &id);
-
 
65
 
65
        if (id == myid) {
66
        if (id == myid) {
66
            uint64_t clock_frequency = 0;
67
            uint64_t clock_frequency = 0;
67
            md_get_integer_property(node, "clock-frequency",
68
            md_get_integer_property(node, "clock-frequency",
68
                &clock_frequency);
69
                &clock_frequency);
69
            CPU->arch.clock_frequency = clock_frequency;
70
            CPU->arch.clock_frequency = clock_frequency;
70
            break;
71
            break;
71
        }
72
        }
72
    }
73
    }
73
 
74
 
74
    tick_init();
75
    tick_init();
-
 
76
    sun4v_ipi_init();
75
}
77
}
76
 
78
 
77
/**
79
/**
78
 * Implemented as an empty function as accessing the VER register is
80
 * Implemented as an empty function as accessing the VER register is
79
 * a hyperprivileged operation on sun4v.
81
 * a hyperprivileged operation on sun4v.