OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [armnommu/] [kernel/] [setup-ebsa110.c] - Blame information for rev 1622

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1622 jcastillo
/*
2
 *  linux/arch/arm/kernel/setup-sa.c
3
 *
4
 *  Copyright (C) 1995, 1996 Russell King
5
 */
6
 
7
/*
8
 * This file obtains various parameters about the system that the kernel
9
 * is running on.
10
 */
11
 
12
#include <linux/config.h>
13
#include <linux/errno.h>
14
#include <linux/sched.h>
15
#include <linux/kernel.h>
16
#include <linux/mm.h>
17
#include <linux/stddef.h>
18
#include <linux/unistd.h>
19
#include <linux/ptrace.h>
20
#include <linux/malloc.h>
21
#include <linux/ldt.h>
22
#include <linux/user.h>
23
#include <linux/a.out.h>
24
#include <linux/tty.h>
25
#include <linux/ioport.h>
26
#include <linux/delay.h>
27
#include <linux/major.h>
28
#include <linux/utsname.h>
29
 
30
#include <asm/segment.h>
31
#include <asm/system.h>
32
#include <asm/hardware.h>
33
#include <asm/pgtable.h>
34
 
35
#define COMMAND_LINE_SIZE 256
36
 
37
unsigned long arm_id;
38
extern int root_mountflags;
39
extern int _etext, _edata, _end;
40
 
41
#ifdef CONFIG_BLK_DEV_RAM
42
extern int rd_doload;           /* 1 = load ramdisk, 0 = don't load */
43
extern int rd_prompt;           /* 1 = prompt for ramdisk, 0 = don't prompt */
44
extern int rd_image_start;      /* starting block # of image */
45
 
46
static inline void setup_ramdisk (void)
47
{
48
    rd_image_start      = 0;
49
    rd_prompt           = 1;
50
    rd_doload           = 1;
51
}
52
#else
53
#define setup_ramdisk() 
54
#endif
55
 
56
#ifndef CONFIG_CMDLINE
57
#define CONFIG_CMDLINE  "root=nfs rw"
58
#endif
59
 
60
static char default_command_line[] = CONFIG_CMDLINE;
61
static char command_line[COMMAND_LINE_SIZE] = { 0, };
62
       char saved_command_line[COMMAND_LINE_SIZE];
63
 
64
struct processor processor;
65
extern const struct processor sa110_processor_functions;
66
 
67
void setup_arch(char **cmdline_p,
68
        unsigned long * memory_start_p, unsigned long * memory_end_p)
69
{
70
        unsigned long memory_start, memory_end;
71
        char c = ' ', *to = command_line, *from;
72
        int len = 0;
73
 
74
        memory_start = (unsigned long)&_end;
75
        memory_end = 0xc1000000;
76
        from = default_command_line;
77
 
78
        processor = sa110_processor_functions;
79
        processor._proc_init ();
80
 
81
        ROOT_DEV                = 0x00ff;
82
        setup_ramdisk();
83
 
84
        init_task.mm->start_code = TASK_SIZE;
85
        init_task.mm->end_code   = TASK_SIZE + (unsigned long) &_etext;
86
        init_task.mm->end_data   = TASK_SIZE + (unsigned long) &_edata;
87
        init_task.mm->brk        = TASK_SIZE + (unsigned long) &_end;
88
 
89
        /* Save unparsed command line copy for /proc/cmdline */
90
        memcpy(saved_command_line, from, COMMAND_LINE_SIZE);
91
        saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
92
 
93
        for (;;) {
94
                if (c == ' ' &&
95
                    from[0] == 'm' &&
96
                    from[1] == 'e' &&
97
                    from[2] == 'm' &&
98
                    from[3] == '=') {
99
                        memory_end = simple_strtoul(from+4, &from, 0);
100
                        if ( *from == 'K' || *from == 'k' ) {
101
                                memory_end = memory_end << 10;
102
                                from++;
103
                        } else if ( *from == 'M' || *from == 'm' ) {
104
                                memory_end = memory_end << 20;
105
                                from++;
106
                        }
107
                        memory_end = memory_end + PAGE_OFFSET;
108
                }
109
                c = *from++;
110
                if (!c)
111
                        break;
112
                if (COMMAND_LINE_SIZE <= ++len)
113
                        break;
114
                *to++ = c;
115
        }
116
 
117
        *to = '\0';
118
        *cmdline_p = command_line;
119
        *memory_start_p = memory_start;
120
        *memory_end_p = memory_end;
121
        strcpy (system_utsname.machine, "sa110");
122
}
123
 
124
int get_cpuinfo(char * buffer)
125
{
126
        int len;
127
 
128
        len = sprintf (buffer,  "CPU:\n"
129
                                "Type\t\t: %s\n"
130
                                "Revision\t: %d\n"
131
                                "Manufacturer\t: %s\n"
132
                                "32bit modes\t: %s\n"
133
                                "BogoMips\t: %lu.%02lu\n",
134
                                "sa110",
135
                                (int)arm_id & 15,
136
                                "DEC",
137
                                "yes",
138
                                (loops_per_sec+2500) / 500000,
139
                                ((loops_per_sec+2500) / 5000) % 100);
140
        return len;
141
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.