This source file includes following definitions.
- init_pit
- find_end_memory
- setup_arch
- sys_ioperm
- get_cpuinfo
1
2
3
4
5
6
7
8
9
10
11 #include <linux/errno.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/mm.h>
15 #include <linux/stddef.h>
16 #include <linux/unistd.h>
17 #include <linux/ptrace.h>
18 #include <linux/malloc.h>
19 #include <linux/ldt.h>
20 #include <linux/user.h>
21 #include <linux/a.out.h>
22 #include <linux/tty.h>
23 #include <linux/delay.h>
24
25 #include <asm/segment.h>
26 #include <asm/system.h>
27 #include <asm/hwrpb.h>
28 #include <asm/dma.h>
29 #include <asm/io.h>
30
31 struct hae hae = {
32 0,
33 (unsigned long*) HAE_ADDRESS
34 };
35
36 struct hwrpb_struct *hwrpb;
37
38 unsigned char aux_device_present = 0xaa;
39
40
41
42
43
44
45
46 #define PARAM ZERO_PGE
47 #define COMMAND_LINE ((char*)(PARAM + 0x0000))
48 #define COMMAND_LINE_SIZE 256
49
50 static char command_line[COMMAND_LINE_SIZE] = { 0, };
51
52
53
54
55
56
57 struct screen_info screen_info = {
58 0, 25,
59 { 0, 0 },
60 0,
61 0,
62 80,
63 0,0,0,
64 25,
65 1,
66 16
67 };
68
69
70
71
72
73 static void init_pit (void)
74 {
75 outb(0x54, 0x43);
76 outb(0x18, 0x41);
77
78 outb(0x36, 0x43);
79 outb(0x00, 0x40);
80 outb(0x00, 0x40);
81
82 outb(0xb6, 0x43);
83 outb(0x31, 0x42);
84 outb(0x13, 0x42);
85 }
86
87 static unsigned long find_end_memory(void)
88 {
89 int i;
90 unsigned long high = 0;
91 struct memclust_struct * cluster;
92 struct memdesc_struct * memdesc;
93
94 memdesc = (struct memdesc_struct *)
95 (INIT_HWRPB->mddt_offset + (unsigned long) INIT_HWRPB);
96 cluster = memdesc->cluster;
97 for (i = memdesc->numclusters ; i > 0; i--, cluster++) {
98 unsigned long tmp;
99 tmp = (cluster->start_pfn + cluster->numpages) << PAGE_SHIFT;
100 if (tmp > high)
101 high = tmp;
102 }
103
104 high = (high + PAGE_SIZE) & (PAGE_MASK*2);
105 return PAGE_OFFSET + high;
106 }
107
108 void setup_arch(char **cmdline_p,
109 unsigned long * memory_start_p, unsigned long * memory_end_p)
110 {
111 extern int _end;
112
113 init_pit();
114
115 hwrpb = (struct hwrpb_struct*)(IDENT_ADDR + INIT_HWRPB->phys_addr);
116
117 set_hae(hae.cache);
118 wrmces(0x7);
119
120 ROOT_DEV = to_kdev_t(0x0802);
121 command_line[COMMAND_LINE_SIZE - 1] = '\0';
122 strcpy(command_line, COMMAND_LINE);
123
124 *cmdline_p = command_line;
125 *memory_start_p = (unsigned long) &_end;
126 *memory_end_p = find_end_memory();
127
128 #if defined(CONFIG_ALPHA_LCA)
129 *memory_start_p = lca_init(*memory_start_p, *memory_end_p);
130 #elif defined(CONFIG_ALPHA_APECS)
131 *memory_start_p = apecs_init(*memory_start_p, *memory_end_p);
132 #endif
133 }
134
135 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
136 {
137 return -EIO;
138 }
139
140
141
142
143
144 int get_cpuinfo(char *buffer)
145 {
146 const char *cpu_name[] = {
147 "EV3", "EV4", "Unknown 1", "LCA4", "EV5", "EV45"
148 };
149 # define SYSTYPE_NAME_BIAS 20
150 const char *systype_name[] = {
151 "Cabriolet", "EB66P", "-18", "-17", "-16", "-15",
152 "-14", "-13", "-12", "-11", "-10", "-9", "-8",
153 "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0",
154 "ADU", "Cobra", "Ruby", "Flamingo", "5", "Jensen",
155 "Pelican", "8", "Sable", "AXPvme", "Noname",
156 "Turbolaser", "Avanti", "Mustang", "Alcor", "16",
157 "Mikasa", "18", "EB66", "EB64+"
158 };
159 struct percpu_struct *cpu;
160 unsigned int cpu_index;
161 long sysname_index;
162 extern struct unaligned_stat {
163 unsigned long count, va, pc;
164 } unaligned[2];
165 # define N(a) (sizeof(a)/sizeof(a[0]))
166
167 cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);
168 cpu_index = (unsigned) (cpu->type - 1);
169 sysname_index = hwrpb->sys_type + SYSTYPE_NAME_BIAS;
170
171 return sprintf(buffer,
172 "cpu\t\t\t: Alpha\n"
173 "cpu model\t\t: %s\n"
174 "cpu variation\t\t: %ld\n"
175 "cpu revision\t\t: %ld\n"
176 "cpu serial number\t: %s\n"
177 "system type\t\t: %s\n"
178 "system variation\t: %ld\n"
179 "system revision\t\t: %ld\n"
180 "system serial number\t: %s\n"
181 "cycle frequency [Hz]\t: %lu\n"
182 "timer frequency [Hz]\t: %lu.%02lu\n"
183 "page size [bytes]\t: %ld\n"
184 "phys. address bits\t: %ld\n"
185 "max. addr. space #\t: %ld\n"
186 "BogoMIPS\t\t: %lu.%02lu\n"
187 "kernel unaligned acc\t: %ld (pc=%lx,va=%lx)\n"
188 "user unaligned acc\t: %ld (pc=%lx,va=%lx)\n",
189
190 (cpu_index < N(cpu_name)
191 ? cpu_name[cpu_index] : "Unknown"),
192 cpu->variation, cpu->revision, (char*)cpu->serial_no,
193 (sysname_index < N(systype_name)
194 ? systype_name[sysname_index] : "Unknown"),
195 hwrpb->sys_variation, hwrpb->sys_revision,
196 (char*)hwrpb->ssn,
197 hwrpb->cycle_freq,
198 hwrpb->intr_freq / 4096,
199 (100 * hwrpb->intr_freq / 4096) % 100,
200 hwrpb->pagesize,
201 hwrpb->pa_bits,
202 hwrpb->max_asn,
203 loops_per_sec / 500000, (loops_per_sec / 5000) % 100,
204 unaligned[0].count, unaligned[0].pc, unaligned[0].va,
205 unaligned[1].count, unaligned[1].pc, unaligned[1].va);
206 # undef N
207 }