1 /* $Id: setup.c,v 1.8 2000/02/02 04:42:38 prumpf Exp $
3 * Initial setup-routines for HP 9000 based hardware.
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
6 * Modifications for PA-RISC (C) 1999 Helge Deller <deller@gmx.de>
7 * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf)
8 * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net>
9 * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org>
10 * Modifications copyright 2001 Ryan Bradetich <rbradetich@uswest.net>
12 * Initial PA-RISC Version: 04-23-1999 by Helge Deller
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <linux/config.h>
31 #include <linux/kernel.h>
32 #include <linux/initrd.h>
33 #include <linux/init.h>
34 #include <linux/console.h>
35 #include <linux/seq_file.h>
37 #include <linux/pci.h>
39 #include <linux/proc_fs.h>
41 #include <asm/processor.h>
44 #include <asm/machdep.h> /* for pa7300lc_init() proto */
45 #include <asm/pdc_chassis.h>
48 #define COMMAND_LINE_SIZE 1024
49 char saved_command_line[COMMAND_LINE_SIZE];
50 char command_line[COMMAND_LINE_SIZE];
52 /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
53 struct proc_dir_entry * proc_runway_root = NULL;
54 struct proc_dir_entry * proc_gsc_root = NULL;
56 void __init setup_cmdline(char **cmdline_p)
58 extern unsigned int boot_args[];
60 /* Collect stuff passed in from the boot loader */
62 /* boot_args[0] is free-mem start, boot_args[1] is ptr to command line */
63 if (boot_args[0] < 64) {
64 /* called from hpux boot loader */
65 saved_command_line[0] = '\0';
67 strcpy(saved_command_line, (char *)__va(boot_args[1]));
69 #ifdef CONFIG_BLK_DEV_INITRD
70 if (boot_args[2] != 0) /* did palo pass us a ramdisk? */
72 initrd_start = (unsigned long)__va(boot_args[2]);
73 initrd_end = (unsigned long)__va(boot_args[3]);
78 strcpy(command_line, saved_command_line);
79 *cmdline_p = command_line;
83 void __init dma_ops_init(void)
85 switch (boot_cpu_data.cpu_type) {
88 * We've got way too many dependencies on 1.1 semantics
89 * to support 1.0 boxes at this point.
91 panic( "PA-RISC Linux currently only supports machines that conform to\n"
92 "the PA-RISC 1.1 or 2.0 architecture specification.\n");
96 hppa_dma_ops = &pcx_dma_ops;
100 case pcxl: /* falls through */
101 hppa_dma_ops = &pcxl_dma_ops;
109 extern int init_per_cpu(int cpuid);
110 extern void collect_boot_cpu_data(void);
112 void __init setup_arch(char **cmdline_p)
114 init_per_cpu(smp_processor_id()); /* Set Modes & Enable FP */
117 printk(KERN_INFO "The 64-bit Kernel has started...\n");
119 printk(KERN_INFO "The 32-bit Kernel has started...\n");
124 #ifdef CONFIG_PDC_NARROW
125 printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
128 setup_cmdline(cmdline_p);
129 collect_boot_cpu_data();
130 do_memory_inventory(); /* probe for physical memory */
134 #ifdef CONFIG_CHASSIS_LCD_LED
135 /* initialize the LCD/LED after boot_cpu_data is available ! */
136 led_init(); /* LCD/LED initialization */
143 #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
144 conswitchp = &dummy_con; /* we use take_over_console() later ! */
150 * Display cpu info for all cpu's.
151 * for parisc this is in processor.c
153 extern int show_cpuinfo (struct seq_file *m, void *v);
156 c_start (struct seq_file *m, loff_t *pos)
158 /* Looks like the caller will call repeatedly until we return
159 * 0, signaling EOF perhaps. This could be used to sequence
160 * through CPUs for example. Since we print all cpu info in our
161 * show_cpuinfo() disregarding 'pos' (which I assume is 'v' above)
162 * we only allow for one "position". */
163 return ((long)*pos < 1) ? (void *)1 : NULL;
167 c_next (struct seq_file *m, void *v, loff_t *pos)
170 return c_start(m, pos);
174 c_stop (struct seq_file *m, void *v)
178 struct seq_operations cpuinfo_op = {
185 static void __init parisc_proc_mkdir(void)
188 ** Can't call proc_mkdir() until after proc_root_init() has been
189 ** called by start_kernel(). In other words, this code can't
190 ** live in arch/.../setup.c because start_parisc() calls
193 switch (boot_cpu_data.cpu_type) {
196 if (NULL == proc_gsc_root)
198 proc_gsc_root = proc_mkdir("bus/gsc", 0);
207 if (NULL == proc_runway_root)
209 proc_runway_root = proc_mkdir("bus/runway", 0);
213 /* FIXME: this was added to prevent the compiler
214 * complaining about missing pcx, pcxs and pcxt
215 * I'm assuming they have neither gsc nor runway */
220 static struct resource central_bus = {
221 .name = "Central Bus",
222 .start = F_EXTEND(0xfff80000),
223 .end = F_EXTEND(0xfffaffff),
224 .flags = IORESOURCE_MEM,
227 static struct resource local_broadcast = {
228 .name = "Local Broadcast",
229 .start = F_EXTEND(0xfffb0000),
230 .end = F_EXTEND(0xfffdffff),
231 .flags = IORESOURCE_MEM,
234 static struct resource global_broadcast = {
235 .name = "Global Broadcast",
236 .start = F_EXTEND(0xfffe0000),
237 .end = F_EXTEND(0xffffffff),
238 .flags = IORESOURCE_MEM,
241 static int __init parisc_init_resources(void)
245 result = request_resource(&iomem_resource, ¢ral_bus);
248 "%s: failed to claim %s address space!\n",
249 __FILE__, central_bus.name);
253 result = request_resource(&iomem_resource, &local_broadcast);
256 "%s: failed to claim %saddress space!\n",
257 __FILE__, local_broadcast.name);
261 result = request_resource(&iomem_resource, &global_broadcast);
264 "%s: failed to claim %s address space!\n",
265 __FILE__, global_broadcast.name);
272 extern void gsc_init(void);
273 extern void processor_init(void);
274 extern void ccio_init(void);
275 extern void hppb_init(void);
276 extern void dino_init(void);
277 extern void iosapic_init(void);
278 extern void lba_init(void);
279 extern void sba_init(void);
280 extern void eisa_init(void);
282 static int __init parisc_init(void)
285 parisc_init_resources();
286 do_device_inventory(); /* probe for hardware */
288 parisc_pdc_chassis_init();
290 /* set up a new led state on systems shipped LED State panel */
291 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BSTART);
294 printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n",
295 boot_cpu_data.cpu_count,
296 boot_cpu_data.cpu_name,
297 boot_cpu_data.cpu_hz / 1000000,
298 boot_cpu_data.cpu_hz % 1000000 );
300 /* These are in a non-obvious order, will fix when we have an iotree */
301 #if defined(CONFIG_IOSAPIC)
304 #if defined(CONFIG_IOMMU_SBA)
307 #if defined(CONFIG_PCI_LBA)
311 /* CCIO before any potential subdevices */
312 #if defined(CONFIG_IOMMU_CCIO)
317 * Need to register Asp & Wax before the EISA adapters for the IRQ
318 * regions. EISA must come before PCI to be sure it gets IRQ region
321 #if defined(CONFIG_GSC_LASI) || defined(CONFIG_GSC_WAX)
328 #if defined(CONFIG_HPPB)
332 #if defined(CONFIG_GSC_DINO)
336 #ifdef CONFIG_CHASSIS_LCD_LED
337 register_led_regions(); /* register LED port info in procfs */
343 arch_initcall(parisc_init);