Subversion Repositories HelenOS

Rev

Rev 3502 | Rev 3664 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3502 Rev 3582
Line 37... Line 37...
37
#include "ofwarch.h"
37
#include "ofwarch.h"
38
#include <align.h>
38
#include <align.h>
39
#include <string.h>
39
#include <string.h>
40
 
40
 
41
bootinfo_t bootinfo;
41
bootinfo_t bootinfo;
-
 
42
 
-
 
43
/** UltraSPARC subarchitecture - 1 for US, 3 for US3 */
-
 
44
uint8_t subarchitecture;
-
 
45
 
42
component_t components[COMPONENTS];
46
component_t components[COMPONENTS];
43
 
47
 
44
char *release = RELEASE;
48
char *release = RELEASE;
45
 
49
 
46
#ifdef REVISION
50
#ifdef REVISION
Line 61... Line 65...
61
    printf("HelenOS SPARC64 Bootloader\nRelease %s%s%s\n"
65
    printf("HelenOS SPARC64 Bootloader\nRelease %s%s%s\n"
62
        "Copyright (c) 2006 HelenOS project\n",
66
        "Copyright (c) 2006 HelenOS project\n",
63
        release, revision, timestamp);
67
        release, revision, timestamp);
64
}
68
}
65
 
69
 
-
 
70
#define FIRST_US3_CPU 0x14
-
 
71
#define LAST_US3_CPU 0x19
-
 
72
static void detect_subarchitecture(void)
-
 
73
{
-
 
74
    uint64_t v;
-
 
75
    asm volatile ("rdpr %%ver, %0\n" : "=r" (v));
-
 
76
   
-
 
77
    v = (v << 16) >> 48;
-
 
78
    if ((v >= FIRST_US3_CPU) && (v <= LAST_US3_CPU)) {
-
 
79
        subarchitecture = SUBARCH_US3;
-
 
80
    } else if (v < FIRST_US3_CPU) {
-
 
81
        subarchitecture = SUBARCH_US;
-
 
82
    }
-
 
83
}
-
 
84
 
66
void bootstrap(void)
85
void bootstrap(void)
67
{
86
{
68
    void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
87
    void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
69
    void *balloc_base;
88
    void *balloc_base;
70
    unsigned int top = 0;
89
    unsigned int top = 0;
71
    int i, j;
90
    int i, j;
72
 
91
 
73
    version_print();
92
    version_print();
74
   
93
   
-
 
94
    detect_subarchitecture();
75
    init_components(components);
95
    init_components(components);
76
 
96
 
77
    if (!ofw_get_physmem_start(&bootinfo.physmem_start)) {
97
    if (!ofw_get_physmem_start(&bootinfo.physmem_start)) {
78
        printf("Error: unable to get start of physical memory.\n");
98
        printf("Error: unable to get start of physical memory.\n");
79
        halt();
99
        halt();