cpuconf.h revision 1.12 1 1.12 thorpej /* $NetBSD: cpuconf.h,v 1.12 2000/06/08 03:10:06 thorpej Exp $ */
2 1.8 thorpej
3 1.1 cgd /*
4 1.1 cgd * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 1.1 cgd *
6 1.1 cgd * Redistribution and use in source and binary forms, with or without
7 1.1 cgd * modification, are permitted provided that the following conditions
8 1.1 cgd * are met:
9 1.1 cgd * 1. Redistributions of source code must retain the above copyright
10 1.1 cgd * notice, this list of conditions and the following disclaimer.
11 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 cgd * notice, this list of conditions and the following disclaimer in the
13 1.1 cgd * documentation and/or other materials provided with the distribution.
14 1.1 cgd * 3. All advertising materials mentioning features or use of this software
15 1.1 cgd * must display the following acknowledgement:
16 1.1 cgd * This product includes software developed by Christopher G. Demetriou
17 1.1 cgd * for the NetBSD Project.
18 1.1 cgd * 4. The name of the author may not be used to endorse or promote products
19 1.1 cgd * derived from this software without specific prior written permission
20 1.1 cgd *
21 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 cgd * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 cgd * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 cgd * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 cgd * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 cgd * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 cgd * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 cgd * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 cgd * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 cgd * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 cgd */
32 1.6 mjacob /*
33 1.6 mjacob * Additional reworking by Matthew Jacob for NASA/Ames Research Center.
34 1.6 mjacob * Copyright (c) 1997
35 1.6 mjacob */
36 1.8 thorpej
37 1.8 thorpej #ifndef _ALPHA_CPUCONF_H_
38 1.8 thorpej #define _ALPHA_CPUCONF_H_
39 1.8 thorpej
40 1.6 mjacob /*
41 1.6 mjacob * Platform Specific Information and Function Hooks.
42 1.6 mjacob *
43 1.6 mjacob * The tags family and model information are strings describing the platform.
44 1.6 mjacob *
45 1.6 mjacob * The tag iobus describes the primary iobus for the platform- primarily
46 1.6 mjacob * to give a hint as to where to start configuring. The likely choices
47 1.6 mjacob * are one of tcasic, lca, apecs, cia, or tlsb.
48 1.6 mjacob */
49 1.1 cgd
50 1.11 thorpej struct clockframe;
51 1.11 thorpej
52 1.8 thorpej struct platform {
53 1.6 mjacob /*
54 1.6 mjacob * Platform Information.
55 1.6 mjacob */
56 1.6 mjacob const char *family; /* Family Name */
57 1.6 mjacob const char *model; /* Model (variant) Name */
58 1.6 mjacob const char *iobus; /* Primary iobus name */
59 1.6 mjacob
60 1.6 mjacob /*
61 1.6 mjacob * Platform Specific Function Hooks
62 1.6 mjacob * cons_init - console initialization
63 1.6 mjacob * device_register - boot configuration aid
64 1.6 mjacob * iointr - I/O interrupt handler
65 1.6 mjacob * clockintr - Clock Interrupt Handler
66 1.6 mjacob * mcheck_handler - Platform Specific Machine Check Handler
67 1.6 mjacob */
68 1.12 thorpej void (*cons_init)(void);
69 1.12 thorpej void (*device_register)(struct device *, void *);
70 1.12 thorpej void (*iointr)(void *, unsigned long);
71 1.12 thorpej void (*clockintr)(struct clockframe *);
72 1.12 thorpej void (*mcheck_handler)(unsigned long, struct trapframe *,
73 1.12 thorpej unsigned long, unsigned long);
74 1.12 thorpej void (*powerdown)(void);
75 1.9 simonb };
76 1.1 cgd
77 1.6 mjacob /*
78 1.6 mjacob * There is an array of functions to initialize the platform structure.
79 1.6 mjacob *
80 1.6 mjacob * It's responsible for filling in the family, model_name and iobus
81 1.6 mjacob * tags. It may optionally fill in the cons_init, device_register and
82 1.6 mjacob * mcheck_handler tags.
83 1.6 mjacob *
84 1.6 mjacob * The iointr tag is filled in by set_iointr (in interrupt.c).
85 1.6 mjacob * The clockintr tag is filled in by cpu_initclocks (in clock.c).
86 1.6 mjacob *
87 1.6 mjacob * nocpu is function to call when you can't figure what platform you're on.
88 1.6 mjacob * There's no return from this function.
89 1.6 mjacob */
90 1.6 mjacob
91 1.7 thorpej struct cpuinit {
92 1.12 thorpej void (*init)(void);
93 1.10 thorpej u_int64_t systype;
94 1.7 thorpej const char *option;
95 1.7 thorpej };
96 1.7 thorpej
97 1.8 thorpej #ifdef _KERNEL
98 1.10 thorpej #define cpu_notsupp(st, str) { platform_not_supported, st, str }
99 1.10 thorpej
100 1.10 thorpej #define cpu_init(st, fn, opt) { fn, st, opt }
101 1.7 thorpej
102 1.8 thorpej extern struct platform platform;
103 1.12 thorpej extern const struct cpuinit *platform_lookup(int);
104 1.12 thorpej extern void platform_not_configured(void);
105 1.12 thorpej extern void platform_not_supported(void);
106 1.5 thorpej #endif /* _KERNEL */
107 1.8 thorpej #endif /* ! _ALPHA_CPUCONF_H_ */
108