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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [i960/] [kernel/] [setup.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1623 jcastillo
/*
2
 * linux/arch/i960/kernel/setup.c
3
 *
4
 * Copyright (C) 1999 Keith Adams <kma@cse.ogi.edu>,
5
 *                    Erik Walthinsen <omega@cse.ogi.edu>
6
 *
7
 * Copied/hacked from code by:
8
 *
9
 * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
10
 *                     Kenneth Albanowski <kjahds@kjahds.com>
11
 *                     The Silver Hammer Group, Ltd.
12
 *
13
 * linux/arch/m68k/kernel/setup.c
14
 *
15
 * Copyright (C) 1995  Hamish Macdonald
16
 */
17
 
18
/*
19
 * This file handles the architecture-dependent parts of system setup
20
 */
21
 
22
#include <linux/config.h>
23
#include <linux/kernel.h>
24
#include <linux/sched.h>
25
#include <linux/delay.h>
26
#include <linux/interrupt.h>
27
#include <linux/fs.h>
28
#include <linux/fb.h>
29
#include <linux/console.h>
30
#include <linux/genhd.h>
31
#include <linux/errno.h>
32
#include <linux/string.h>
33
#include <linux/major.h>
34
 
35
#include <asm/setup.h>
36
#include <asm/irq.h>
37
#include <asm/machdep.h>
38
 
39
#ifdef CONFIG_BLK_DEV_INITRD
40
#include <linux/blk.h>
41
#include <asm/pgtable.h>
42
#endif
43
 
44
 
45
extern int end;
46
/* FIXME this needs to be looked into */
47
unsigned long availmem = 1024*1024;
48
 
49
unsigned long rom_length;
50
unsigned long memory_start;
51
unsigned long memory_end;
52
char command_line[512];
53
char saved_command_line[512];
54
 
55
/* setup some dummy routines */
56
static void dummy_waitbut(void)
57
{
58
}
59
 
60
/* machine dependent keyboard functions */
61
int (*mach_keyb_init) (void);
62
int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
63
void (*mach_kbd_leds) (unsigned int) = NULL;
64
/* machine dependent irq functions */
65
void (*mach_init_IRQ) (void);
66
void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
67
int (*mach_request_irq) (unsigned int, void (*)(int, void *, struct pt_regs *),
68
                         unsigned long, const char *, void *);
69
int (*mach_free_irq) (unsigned int, void *);
70
void (*mach_enable_irq) (unsigned int) = NULL;
71
void (*mach_disable_irq) (unsigned int) = NULL;
72
int (*mach_get_irq_list) (char *) = NULL;
73
void (*mach_process_int) (int, struct pt_regs *) = NULL;
74
/* machine dependent timer functions */
75
unsigned long (*mach_gettimeoffset) (void);
76
void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
77
int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
78
int (*mach_set_clock_mmss) (unsigned long) = NULL;
79
void (*mach_mksound)( unsigned int count, unsigned int ticks );
80
void (*mach_reset)( void );
81
void (*waitbut)(void) = dummy_waitbut;
82
void (*mach_debug_init)(void);
83
 
84
extern void register_console(void (*proc)(const char *));
85
 
86
#define MASK_256K 0xfffc0000
87
 
88
#ifdef CONFIG_I960VH
89
#       define CPU "i960Vh"
90
#endif
91
#ifdef CONFIG_I960RX
92
#       define CPU "i960Rx"
93
#endif
94
#ifdef CONFIG_I960HX
95
#       define CPU "i960Hx"
96
#endif
97
#ifdef CONFIG_I960CX
98
#       define CPU "i960Cx"
99
#endif
100
#ifdef CONFIG_I960JX
101
#       define CPU "i960Jx"
102
#endif
103
 
104
 
105
 
106
/* set up for i960 */
107
void setup_arch(char **cmdline_p,
108
                unsigned long * memory_start_p, unsigned long * memory_end_p)
109
{
110
        extern  int stackbase, _etext, _edata, _end;
111
        extern void mon960_console_init(void);
112
 
113
#ifdef CONFIG_MON960_CONSOLE
114
        extern void console_print_mon960(const char* msg);
115
 
116
        register_console(console_print_mon960);
117
        mon960_console_init();
118
#endif
119
 
120
        printk("\r\n\nuClinux " CPU "\n");
121
        printk("i960 port (C) 1999 Keith Adams, Erik Walthinsen, Oregon Graduate Institute\n");
122
        printk("Flat model support (C) 1998 Kenneth Albanowski, D. Jeff Dionne, TSHG Ltd.\n");
123
 
124
        memory_start = PAGE_ALIGN(((unsigned long)&_end));
125
 
126
        init_task.mm->start_code = 0;
127
        init_task.mm->end_code = (unsigned long) &_etext;
128
        init_task.mm->end_data = (unsigned long) &_edata;
129
        init_task.mm->brk = (unsigned long) &_end;
130
 
131
        ROOT_DEV = MKDEV(BLKMEM_MAJOR,0);
132
 
133
        command_line[512-1] = '\0';
134
 
135
        if (memcmp(command_line, "Arg!", 4))
136
                command_line[4] = '\0';
137
 
138
        memset(command_line, 0, 4);
139
 
140
        strcpy(saved_command_line, command_line+4);
141
        *cmdline_p = command_line+4;
142
 
143
 
144
#ifdef DEBUG
145
        if (strlen(*cmdline_p))
146
                printk("Command line: '%s'\n", *cmdline_p);
147
#endif
148
 
149
        *memory_start_p = memory_start;
150
#ifdef CONFIG_CYVH
151
        *memory_end_p = (unsigned long)&stackbase;
152
#endif
153
}
154
 
155
/* set up for i960 */
156
int get_cpuinfo(char * buffer)
157
{
158
    char *cpu, *mmu, *fpu;
159
    u_long clockfreq, clockfactor;
160
 
161
    cpu = CPU;
162
    mmu = "none";
163
    fpu = "none";
164
    clockfactor = 16;
165
 
166
    clockfreq = loops_per_sec*clockfactor;
167
 
168
    return(sprintf(buffer, "CPU:\t\t%s\n"
169
                   "MMU:\t\t%s\n"
170
                   "FPU:\t\t%s\n"
171
                   "Clocking:\t%lu.%1luMHz\n"
172
                   "BogoMips:\t%lu.%02lu\n"
173
                   "Calibration:\t%lu loops\n",
174
                   cpu, mmu, fpu,
175
                   clockfreq/1000000,(clockfreq/100000)%10,
176
                   loops_per_sec/500000,(loops_per_sec/5000)%100,
177
                   loops_per_sec));
178
 
179
}
180
 
181
void arch_gettod(int *year, int *mon, int *day, int *hour,
182
                 int *min, int *sec)
183
{
184
        *year = *mon = *day = *hour = *min = *sec = 0;
185
}

powered by: WebSVN 2.1.0

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