xref: /openbsd/sys/arch/hppa/stand/libsa/machdep.c (revision fc61954a)
1 /*	$OpenBSD: machdep.c,v 1.9 2004/04/07 18:24:20 mickey Exp $	*/
2 
3 /*
4  * Copyright (c) 1998-2004 Michael Shalayeff
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26  * THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #include <sys/param.h>
30 #include <sys/disklabel.h>
31 #include <sys/reboot.h>
32 #include "libsa.h"
33 #include <machine/iomod.h>
34 #include <machine/pdc.h>
35 
36 #include "dev_hppa.h"
37 
38 extern struct	stable_storage sstor;	/* contents of Stable Storage */
39 int howto;
40 dev_t bootdev;
41 
42 void
43 machdep()
44 {
45 	pdc_init();
46 #ifdef notyet
47 	debug_init();
48 #endif
49 	cninit();
50 
51 #ifdef PDCDEBUG
52 	if (debug) {
53 		int i;
54 
55 		printf("SSTOR:\n");
56 		printf("pri_boot=");	DEVPATH_PRINT(&sstor.ss_pri_boot);
57 		printf("alt_boot=");	DEVPATH_PRINT(&sstor.ss_alt_boot);
58 		printf("console =");	DEVPATH_PRINT(&sstor.ss_console);
59 		printf("keyboard=");	DEVPATH_PRINT(&sstor.ss_keyboard);
60 		printf("mem=%d, fn=%s, osver=%d\nos={",
61 		       sstor.ss_fast_size, sstor.ss_filenames,
62 		       sstor.ss_os_version);
63 		for (i = 0; i < sizeof(sstor.ss_os); i++)
64 			printf ("%x%c", sstor.ss_os[i], (i%8)? ',' : '\n');
65 
66 		printf("}\nPAGE0:\n");
67 		printf("ivec=%x, pf=%p[%u], toc=%p[%u], rndz=%p, clk/10ms=%u\n",
68 		       PAGE0->ivec_special, PAGE0->ivec_mempf,
69 		       PAGE0->ivec_mempflen, PAGE0->ivec_toc,
70 		       PAGE0->ivec_toclen, PAGE0->ivec_rendz,
71 		       PAGE0->mem_10msec);
72 		printf ("mem: cont=%u, phys=%u, pdc_spa=%u, resv=%u, free=%x\n"
73 			"cpu_hpa=%x, pdc=%p, imm_hpa=%p[%u,%u], soft=%u\n",
74 		       PAGE0->memc_cont, PAGE0->memc_phsize, PAGE0->memc_adsize,
75 		       PAGE0->memc_resv, PAGE0->mem_free, PAGE0->mem_hpa,
76 		       PAGE0->mem_pdc, PAGE0->imm_hpa, PAGE0->imm_spa_size,
77 		       PAGE0->imm_max_mem, PAGE0->imm_soft_boot);
78 
79 		printf("console:  ");	PZDEV_PRINT(&PAGE0->mem_cons);
80 		printf("boot:     ");	PZDEV_PRINT(&PAGE0->mem_boot);
81 		printf("keyboard: ");	PZDEV_PRINT(&PAGE0->mem_kbd);
82 	}
83 #endif
84 }
85