1*32ffafadSjsg /* $OpenBSD: autoconf.h,v 1.25 2024/05/22 14:25:47 jsg Exp $ */ 2e55ab885Smickey 394f17381Smickey /* 4fef2e65fSmickey * Copyright (c) 1998-2004 Michael Shalayeff 594f17381Smickey * All rights reserved. 694f17381Smickey * 794f17381Smickey * Redistribution and use in source and binary forms, with or without 894f17381Smickey * modification, are permitted provided that the following conditions 994f17381Smickey * are met: 1094f17381Smickey * 1. Redistributions of source code must retain the above copyright 1194f17381Smickey * notice, this list of conditions and the following disclaimer. 1294f17381Smickey * 2. Redistributions in binary form must reproduce the above copyright 1394f17381Smickey * notice, this list of conditions and the following disclaimer in the 1494f17381Smickey * documentation and/or other materials provided with the distribution. 1594f17381Smickey * 1694f17381Smickey * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1794f17381Smickey * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1894f17381Smickey * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19fef2e65fSmickey * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 20fef2e65fSmickey * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21fef2e65fSmickey * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22fef2e65fSmickey * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23fef2e65fSmickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24fef2e65fSmickey * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 25fef2e65fSmickey * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26fef2e65fSmickey * THE POSSIBILITY OF SUCH DAMAGE. 2794f17381Smickey */ 28e55ab885Smickey 2994f17381Smickey #include <machine/bus.h> 302f14ddd3Smickey #include <machine/pdc.h> 3194f17381Smickey 3294f17381Smickey struct confargs { 3394f17381Smickey const char *ca_name; /* device name/description */ 3494f17381Smickey bus_space_tag_t ca_iot; /* io tag */ 35ffff5acbSmickey bus_dma_tag_t ca_dmatag; /* DMA tag */ 36c007052bSmickey struct device_path ca_dp; /* device_path as found by pdc_scan */ 37c007052bSmickey hppa_hpa_t ca_hpa; /* module HPA */ 38c007052bSmickey u_int ca_hpasz; /* module HPA size (if avail) */ 39c007052bSmickey hppa_hpa_t ca_hpamask; /* mask for modules on the bus */ 401a751fd1Smickey int ca_irq; /* module IRQ */ 4136fd90dcSjsg struct iodc_data ca_type; /* iodc-specific type description */ 4294f17381Smickey struct pdc_iodc_read *ca_pdc_iodc_read; 43c007052bSmickey int ca_naddrs; /* number of valid addr ents */ 44c007052bSmickey struct { 45c007052bSmickey hppa_hpa_t addr; 46c007052bSmickey u_int size; 47c007052bSmickey } ca_addrs[16]; /* 16 is ought to be enough */ 48c007052bSmickey 4994f17381Smickey }; 5094f17381Smickey 51ae3e77a0Smickey #define hppacf_off cf_loc[0] 52ae3e77a0Smickey #define hppacf_irq cf_loc[1] 531a751fd1Smickey 5494f17381Smickey /* this is used for hppa_knownmodules table 5551985b2aSmickey * describing known to this port modules, 5651985b2aSmickey * system boards, cpus, fpus and busses 5794f17381Smickey */ 5894f17381Smickey struct hppa_mod_info { 5994f17381Smickey int mi_type; 6094f17381Smickey int mi_sv; 6194f17381Smickey const char *mi_name; 6294f17381Smickey }; 6394f17381Smickey 64c4071fd1Smillert extern void (*cold_hook)(int); 65f75e072aSmickey #define HPPA_COLD_COLD 0 66f75e072aSmickey #define HPPA_COLD_HOT 1 67f75e072aSmickey #define HPPA_COLD_OFF 2 68f75e072aSmickey 6994f17381Smickey struct device; 7094f17381Smickey 71c4071fd1Smillert const char *hppa_mod_info(int, int); 72c7260238Sjsing void pdc_scanbus(struct device *, struct confargs *, int, hppa_hpa_t hpa, 73c7260238Sjsing int); 74c4071fd1Smillert int mbprint(void *, const char *); 75c4071fd1Smillert int mbsubmatch(struct device *, void *, void *); 7615fe2033Skettenis int cpu_intr_findirq(void); 7770016991Smickey void *cpu_intr_map(void *v, int pri, int irq, int (*handler)(void *), 7840f562c2Smickey void *arg, const char *name); 7970016991Smickey void *cpu_intr_establish(int pri, int irq, int (*handler)(void *), 8040f562c2Smickey void *arg, const char *name); 81e55ab885Smickey 82c4071fd1Smillert void dumpconf(void); 83