Home | History | Annotate | Line # | Download | only in alpha
      1 /* $NetBSD: dec_alphabook1.c,v 1.31 2025/03/09 01:06:41 thorpej Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
      5  * All rights reserved.
      6  *
      7  * Author: Chris G. Demetriou
      8  *
      9  * Permission to use, copy, modify and distribute this software and
     10  * its documentation is hereby granted, provided that both the copyright
     11  * notice and this permission notice appear in all copies of the
     12  * software, derivative works or modified versions, and any portions
     13  * thereof, and that both notices appear in supporting documentation.
     14  *
     15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  *
     19  * Carnegie Mellon requests users of this software to return to
     20  *
     21  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  *  School of Computer Science
     23  *  Carnegie Mellon University
     24  *  Pittsburgh PA 15213-3890
     25  *
     26  * any improvements or extensions that they make and grant Carnegie the
     27  * rights to redistribute these changes.
     28  */
     29 /*
     30  * Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center
     31  */
     32 
     33 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
     34 
     35 __KERNEL_RCSID(0, "$NetBSD: dec_alphabook1.c,v 1.31 2025/03/09 01:06:41 thorpej Exp $");
     36 
     37 #include <sys/param.h>
     38 #include <sys/systm.h>
     39 #include <sys/device.h>
     40 
     41 #include <machine/rpb.h>
     42 #include <machine/autoconf.h>
     43 #include <machine/cpuconf.h>
     44 
     45 #include <dev/pci/pcivar.h>
     46 
     47 #include <alpha/pci/lcareg.h>
     48 #include <alpha/pci/lcavar.h>
     49 
     50 void dec_alphabook1_init(void);
     51 static void dec_alphabook1_cons_init(void);
     52 static void dec_alphabook1_device_register(device_t, void *);
     53 
     54 const struct alpha_variation_table dec_alphabook1_variations[] = {
     55 	{ 0, "AlphaBook" },
     56 	{ 0, NULL },
     57 };
     58 
     59 void
     60 dec_alphabook1_init(void)
     61 {
     62 	uint64_t variation;
     63 
     64 	platform.family = "AlphaBook";
     65 
     66 	if ((platform.model = alpha_dsr_sysname()) == NULL) {
     67 		variation = hwrpb->rpb_variation & SV_ST_MASK;
     68 		if ((platform.model = alpha_variation_name(variation,
     69 		    dec_alphabook1_variations)) == NULL)
     70 			platform.model = alpha_unknown_sysname();
     71 	}
     72 
     73 	platform.iobus = "lca";
     74 	platform.cons_init = dec_alphabook1_cons_init;
     75 	platform.device_register = dec_alphabook1_device_register;
     76 
     77 	lca_probe_bcache();
     78 }
     79 
     80 static void
     81 dec_alphabook1_cons_init(void)
     82 {
     83 	struct lca_config *lcp;
     84 	extern struct lca_config lca_configuration;
     85 
     86 	lcp = &lca_configuration;
     87 	lca_init(lcp);
     88 
     89 	pci_consinit(&lcp->lc_pc, &lcp->lc_iot, &lcp->lc_memt,
     90 	    &lcp->lc_iot, &lcp->lc_memt);
     91 }
     92 
     93 static void
     94 dec_alphabook1_device_register(device_t dev, void *aux)
     95 {
     96 	pci_find_bootdev(NULL, dev, aux);
     97 }
     98