1*90e56582Sjdolecek /* $NetBSD: autoconf.h,v 1.2 2017/06/16 18:17:41 jdolecek Exp $ */ 26d3ceb1dSskrll 36d3ceb1dSskrll /* $OpenBSD: autoconf.h,v 1.10 2001/05/05 22:33:42 art Exp $ */ 46d3ceb1dSskrll 56d3ceb1dSskrll /* 66d3ceb1dSskrll * Copyright (c) 1998-2004 Michael Shalayeff 76d3ceb1dSskrll * All rights reserved. 86d3ceb1dSskrll * 96d3ceb1dSskrll * Redistribution and use in source and binary forms, with or without 106d3ceb1dSskrll * modification, are permitted provided that the following conditions 116d3ceb1dSskrll * are met: 126d3ceb1dSskrll * 1. Redistributions of source code must retain the above copyright 136d3ceb1dSskrll * notice, this list of conditions and the following disclaimer. 146d3ceb1dSskrll * 2. Redistributions in binary form must reproduce the above copyright 156d3ceb1dSskrll * notice, this list of conditions and the following disclaimer in the 166d3ceb1dSskrll * documentation and/or other materials provided with the distribution. 176d3ceb1dSskrll * 186d3ceb1dSskrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 196d3ceb1dSskrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 206d3ceb1dSskrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 216d3ceb1dSskrll * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 226d3ceb1dSskrll * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 236d3ceb1dSskrll * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 246d3ceb1dSskrll * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 256d3ceb1dSskrll * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 266d3ceb1dSskrll * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 276d3ceb1dSskrll * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 286d3ceb1dSskrll * THE POSSIBILITY OF SUCH DAMAGE. 296d3ceb1dSskrll */ 306d3ceb1dSskrll 316d3ceb1dSskrll #include <sys/device.h> 326d3ceb1dSskrll 336d3ceb1dSskrll #include <sys/bus.h> 346d3ceb1dSskrll #include <machine/pdc.h> 356d3ceb1dSskrll 366d3ceb1dSskrll /* 16 should be enough for anyone */ 376d3ceb1dSskrll #define HPPA_MAXIOADDRS 16 386d3ceb1dSskrll 396d3ceb1dSskrll struct confargs { 406d3ceb1dSskrll struct iodc_data ca_type; /* iodc-specific type descrition */ 416d3ceb1dSskrll struct device_path ca_dp; /* device_path as found by pdc_scan */ 426d3ceb1dSskrll union { 436d3ceb1dSskrll struct pdc_iodc_read uca_pir; 446d3ceb1dSskrll struct pdc_chassis_lcd uca_pcl; 456d3ceb1dSskrll } ca_u; 466d3ceb1dSskrll #define ca_pir ca_u.uca_pir 476d3ceb1dSskrll #define ca_pcl ca_u.uca_pcl 486d3ceb1dSskrll 496d3ceb1dSskrll struct { 506d3ceb1dSskrll hppa_hpa_t addr; 516d3ceb1dSskrll u_int size; 526d3ceb1dSskrll } ca_addrs[HPPA_MAXIOADDRS]; 536d3ceb1dSskrll const char *ca_name; /* device name/description */ 546d3ceb1dSskrll bus_space_tag_t ca_iot; /* io tag */ 556d3ceb1dSskrll int ca_mod; /* module number on the bus */ 566d3ceb1dSskrll hppa_hpa_t ca_hpa; /* module HPA */ 576d3ceb1dSskrll u_int ca_hpasz; /* module HPA size (if avail) */ 586d3ceb1dSskrll bus_dma_tag_t ca_dmatag; /* DMA tag */ 596d3ceb1dSskrll int ca_irq; /* module IRQ */ 606d3ceb1dSskrll int ca_naddrs; /* number of valid addr ents */ 616d3ceb1dSskrll hppa_hpa_t ca_hpabase; /* HPA base to use */ 626d3ceb1dSskrll int ca_nmodules; /* check for modules 0 to nmodules - 1 */ 636d3ceb1dSskrll }; 646d3ceb1dSskrll 656d3ceb1dSskrll #define HPPACF_IRQ_UNDEF (-1) 666d3ceb1dSskrll #define hppacf_irq cf_loc[GEDOENSCF_IRQ] 676d3ceb1dSskrll 686d3ceb1dSskrll /* 696d3ceb1dSskrll * This is used for hppa_knownmodules table describing known to this port 706d3ceb1dSskrll * modules, system boards, cpus, fpus and busses. 716d3ceb1dSskrll */ 726d3ceb1dSskrll struct hppa_mod_info { 736d3ceb1dSskrll int mi_type; 746d3ceb1dSskrll int mi_sv; 756d3ceb1dSskrll const char *mi_name; 766d3ceb1dSskrll }; 776d3ceb1dSskrll 786d3ceb1dSskrll extern void (*cold_hook)(int); 796d3ceb1dSskrll #define HPPA_COLD_COLD 0 806d3ceb1dSskrll #define HPPA_COLD_HOT 1 816d3ceb1dSskrll #define HPPA_COLD_OFF 2 826d3ceb1dSskrll 836d3ceb1dSskrll const char *hppa_mod_info(int, int); 846d3ceb1dSskrll 856d3ceb1dSskrll void hppa_modules_scan(void); 866d3ceb1dSskrll void hppa_modules_done(void); 876d3ceb1dSskrll 886d3ceb1dSskrll void pdc_scanbus(device_t, struct confargs *, 896d3ceb1dSskrll device_t (*)(device_t, struct confargs *)); 906d3ceb1dSskrll 916d3ceb1dSskrll int mbprint(void *, const char *); 926d3ceb1dSskrll int mbsubmatch(device_t, struct cfdata *, const int *, void *); 93