1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <linux/init.h>
22#include <linux/bootmem.h>
23#include <linux/mmzone.h>
24#include <linux/mm.h>
25#include <linux/seq_file.h>
26#include <linux/console.h>
27#include <linux/of_fdt.h>
28#include <asm/io.h>
29#include <asm/sections.h>
30#include <asm/setup.h>
31#include <asm/processor.h>
32#include <asm/hexagon_vm.h>
33#include <asm/vm_mmu.h>
34#include <asm/time.h>
35#ifdef CONFIG_OF
36#include <asm/prom.h>
37#endif
38
39char cmd_line[COMMAND_LINE_SIZE];
40static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
41
42int on_simulator;
43
44void calibrate_delay(void)
45{
46 loops_per_jiffy = thread_freq_mhz * 1000000 / HZ;
47}
48
49
50
51
52
53
54void __init setup_arch(char **cmdline_p)
55{
56 char *p = &external_cmdline_buffer;
57
58
59
60
61
62 pcycle_freq_mhz = 600;
63 thread_freq_mhz = 100;
64 sleep_clk_freq = 32000;
65
66
67
68
69 __vmsetvec(_K_VM_event_vector);
70
71 printk(KERN_INFO "PHYS_OFFSET=0x%08x\n", PHYS_OFFSET);
72
73
74
75
76
77
78 if (*(int *)((unsigned long)_end + 8) == 0x1f1f1f1f)
79 on_simulator = 1;
80 else
81 on_simulator = 0;
82
83 if (p[0] != '\0')
84 strlcpy(boot_command_line, p, COMMAND_LINE_SIZE);
85 else
86 strlcpy(boot_command_line, default_command_line,
87 COMMAND_LINE_SIZE);
88
89
90
91
92
93
94 strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
95 *cmdline_p = cmd_line;
96
97 parse_early_param();
98
99 setup_arch_memory();
100
101#ifdef CONFIG_SMP
102 smp_start_cpus();
103#endif
104}
105
106
107
108
109
110static void *c_start(struct seq_file *m, loff_t *pos)
111{
112 return *pos < nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL;
113}
114
115static void *c_next(struct seq_file *m, void *v, loff_t *pos)
116{
117 ++*pos;
118 return c_start(m, pos);
119}
120
121static void c_stop(struct seq_file *m, void *v)
122{
123}
124
125
126
127
128
129static int show_cpuinfo(struct seq_file *m, void *v)
130{
131 int cpu = (unsigned long) v - 1;
132
133#ifdef CONFIG_SMP
134 if (!cpu_online(cpu))
135 return 0;
136#endif
137
138 seq_printf(m, "processor\t: %d\n", cpu);
139 seq_printf(m, "model name\t: Hexagon Virtual Machine\n");
140 seq_printf(m, "BogoMips\t: %lu.%02lu\n",
141 (loops_per_jiffy * HZ) / 500000,
142 ((loops_per_jiffy * HZ) / 5000) % 100);
143 seq_printf(m, "\n");
144 return 0;
145}
146
147const struct seq_operations cpuinfo_op = {
148 .start = &c_start,
149 .next = &c_next,
150 .stop = &c_stop,
151 .show = &show_cpuinfo,
152};
153