cpuconf.h revision 1.14 1 1.14 matt /* $NetBSD: cpuconf.h,v 1.14 2011/06/14 06:49:31 matt 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 * clockintr - Clock Interrupt Handler
65 1.6 mjacob * mcheck_handler - Platform Specific Machine Check Handler
66 1.6 mjacob */
67 1.12 thorpej void (*cons_init)(void);
68 1.14 matt void (*device_register)(device_t, void *);
69 1.12 thorpej void (*clockintr)(struct clockframe *);
70 1.12 thorpej void (*mcheck_handler)(unsigned long, struct trapframe *,
71 1.12 thorpej unsigned long, unsigned long);
72 1.12 thorpej void (*powerdown)(void);
73 1.9 simonb };
74 1.1 cgd
75 1.6 mjacob /*
76 1.6 mjacob * There is an array of functions to initialize the platform structure.
77 1.6 mjacob *
78 1.6 mjacob * It's responsible for filling in the family, model_name and iobus
79 1.6 mjacob * tags. It may optionally fill in the cons_init, device_register and
80 1.6 mjacob * mcheck_handler tags.
81 1.6 mjacob *
82 1.6 mjacob * The iointr tag is filled in by set_iointr (in interrupt.c).
83 1.6 mjacob * The clockintr tag is filled in by cpu_initclocks (in clock.c).
84 1.6 mjacob *
85 1.6 mjacob * nocpu is function to call when you can't figure what platform you're on.
86 1.6 mjacob * There's no return from this function.
87 1.6 mjacob */
88 1.6 mjacob
89 1.7 thorpej struct cpuinit {
90 1.12 thorpej void (*init)(void);
91 1.10 thorpej u_int64_t systype;
92 1.7 thorpej const char *option;
93 1.7 thorpej };
94 1.7 thorpej
95 1.8 thorpej #ifdef _KERNEL
96 1.10 thorpej #define cpu_notsupp(st, str) { platform_not_supported, st, str }
97 1.10 thorpej
98 1.10 thorpej #define cpu_init(st, fn, opt) { fn, st, opt }
99 1.7 thorpej
100 1.8 thorpej extern struct platform platform;
101 1.12 thorpej extern const struct cpuinit *platform_lookup(int);
102 1.12 thorpej extern void platform_not_configured(void);
103 1.12 thorpej extern void platform_not_supported(void);
104 1.5 thorpej #endif /* _KERNEL */
105 1.8 thorpej #endif /* ! _ALPHA_CPUCONF_H_ */
106