xref: /openbsd/sys/arch/hppa/include/autoconf.h (revision 32ffafad)
1 /*	$OpenBSD: autoconf.h,v 1.25 2024/05/22 14:25:47 jsg 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 <machine/bus.h>
30 #include <machine/pdc.h>
31 
32 struct confargs {
33 	const char	*ca_name;	/* device name/description */
34 	bus_space_tag_t	ca_iot;		/* io tag */
35 	bus_dma_tag_t	ca_dmatag;	/* DMA tag */
36 	struct device_path ca_dp;	/* device_path as found by pdc_scan */
37 	hppa_hpa_t	ca_hpa;		/* module HPA */
38 	u_int		ca_hpasz;	/* module HPA size (if avail) */
39 	hppa_hpa_t	ca_hpamask;	/* mask for modules on the bus */
40 	int		ca_irq;		/* module IRQ */
41 	struct iodc_data ca_type;	/* iodc-specific type description */
42 	struct pdc_iodc_read *ca_pdc_iodc_read;
43 	int		ca_naddrs;	/* number of valid addr ents */
44 	struct {
45 		hppa_hpa_t addr;
46 		u_int	size;
47 	}		ca_addrs[16];	/* 16 is ought to be enough */
48 
49 };
50 
51 #define	hppacf_off	cf_loc[0]
52 #define	hppacf_irq	cf_loc[1]
53 
54 /* this is used for hppa_knownmodules table
55  * describing known to this port modules,
56  * system boards, cpus, fpus and busses
57  */
58 struct hppa_mod_info {
59 	int	mi_type;
60 	int	mi_sv;
61 	const char *mi_name;
62 };
63 
64 extern void (*cold_hook)(int);
65 #define	HPPA_COLD_COLD	0
66 #define	HPPA_COLD_HOT	1
67 #define	HPPA_COLD_OFF	2
68 
69 struct device;
70 
71 const char *hppa_mod_info(int, int);
72 void	pdc_scanbus(struct device *, struct confargs *, int, hppa_hpa_t hpa,
73 	    int);
74 int	mbprint(void *, const char *);
75 int	mbsubmatch(struct device *, void *, void *);
76 int	cpu_intr_findirq(void);
77 void	*cpu_intr_map(void *v, int pri, int irq, int (*handler)(void *),
78 	    void *arg, const char *name);
79 void	*cpu_intr_establish(int pri, int irq, int (*handler)(void *),
80 	    void *arg, const char *name);
81 
82 void	dumpconf(void);
83