add Alpha 4100 support
This commit is contained in:
parent
17ec1fbf11
commit
4fa71d82a5
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.30 1998/03/30 17:52:03 cgd Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.31 1998/04/15 00:46:57 mjacob Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -161,7 +161,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 1998/03/30 17:52:03 cgd Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.31 1998/04/15 00:46:57 mjacob Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -821,11 +821,12 @@ pmap_uses_prom_console()
|
||||
extern int cputype;
|
||||
|
||||
#if defined(NEW_SCC_DRIVER)
|
||||
return (cputype == ST_DEC_21000);
|
||||
return (cputype == ST_DEC_21000 || cputype == ST_DEC_4100);
|
||||
#else
|
||||
return (cputype == ST_DEC_21000
|
||||
|| cputype == ST_DEC_3000_300
|
||||
|| cputype == ST_DEC_3000_500);
|
||||
|| cputype == ST_DEC_4100
|
||||
|| cputype == ST_DEC_3000_300
|
||||
|| cputype == ST_DEC_3000_500);
|
||||
#endif /* NEW_SCC_DRIVER */
|
||||
}
|
||||
#endif _PMAP_MAY_USE_PROM_CONSOLE
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: ALPHA,v 1.69 1998/03/25 02:16:41 ross Exp $
|
||||
# $NetBSD: ALPHA,v 1.70 1998/04/15 00:47:21 mjacob Exp $
|
||||
#
|
||||
# Alpha kernel with all the options you'd want, and more.
|
||||
|
||||
@ -18,6 +18,7 @@ options DEC_EB164 # EB164: AlphaPC 164
|
||||
options DEC_EB64PLUS # EB64+: AlphaPC 64, etc.
|
||||
options DEC_KN20AA # KN20AA: AlphaStation 500 and 600
|
||||
options DEC_KN8AE # KN8AE: AlphaServer 8200 and 8400
|
||||
options DEC_KN300 # KN300: AlphaServer 4100
|
||||
|
||||
# Standard system options
|
||||
options KTRACE # System call tracing support
|
||||
@ -121,6 +122,12 @@ kft* at tlsb? node ? offset ?
|
||||
# Gbus Devices
|
||||
mcclock* at gbus? offset 0x20000000
|
||||
|
||||
# MCBUS bus support
|
||||
mcbus* at mainbus0
|
||||
mcmem* at mcbus? mid ?
|
||||
|
||||
#i2c at mcbus?
|
||||
|
||||
# TurboChannel host bus adapter support
|
||||
tcasic* at mainbus0
|
||||
|
||||
@ -146,6 +153,7 @@ apecs* at mainbus?
|
||||
cia* at mainbus?
|
||||
lca* at mainbus?
|
||||
dwlpx* at kft?
|
||||
mcpcia* at mcbus? mid ?
|
||||
|
||||
# PCI bus support
|
||||
pci* at apecs?
|
||||
@ -153,6 +161,7 @@ pci* at cia?
|
||||
pci* at lca?
|
||||
pci* at ppb?
|
||||
pci* at dwlpx?
|
||||
pci* at mcpcia?
|
||||
|
||||
# PCI devices
|
||||
ahc* at pci? dev ? function ? # Adaptec [23]94x, aic78x0 SCSI
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: GENERIC,v 1.79 1998/03/25 02:16:41 ross Exp $
|
||||
# $NetBSD: GENERIC,v 1.80 1998/04/15 00:47:21 mjacob Exp $
|
||||
#
|
||||
# Generic Alpha kernel. Enough to get booted, etc., but not much more.
|
||||
|
||||
@ -18,6 +18,7 @@ options DEC_EB164 # EB164: AlphaPC 164
|
||||
options DEC_EB64PLUS # EB64+: AlphaPC 64, etc.
|
||||
options DEC_KN20AA # KN20AA: AlphaStation 500 and 600
|
||||
options DEC_KN8AE # KN8AE: AlphaServer 8200 and 8400
|
||||
options DEC_KN300 # KN300: AlphaServer 4100
|
||||
|
||||
# Standard system options
|
||||
options KTRACE # System call tracing support
|
||||
@ -94,6 +95,12 @@ kft* at tlsb? node ? offset ?
|
||||
# Gbus Devices
|
||||
mcclock* at gbus? offset 0x20000000
|
||||
|
||||
# MCBUS bus support
|
||||
mcbus* at mainbus0
|
||||
mcmem* at mcbus? mid ?
|
||||
|
||||
#i2c at mcbus?
|
||||
|
||||
# TurboChannel host bus adapter support
|
||||
tcasic* at mainbus0
|
||||
|
||||
@ -119,6 +126,7 @@ apecs* at mainbus?
|
||||
cia* at mainbus?
|
||||
lca* at mainbus?
|
||||
dwlpx* at kft?
|
||||
mcpcia* at mcbus? mid ?
|
||||
|
||||
# PCI bus support
|
||||
pci* at apecs?
|
||||
@ -126,6 +134,7 @@ pci* at cia?
|
||||
pci* at lca?
|
||||
pci* at ppb?
|
||||
pci* at dwlpx?
|
||||
pci* at mcpcia?
|
||||
|
||||
# PCI devices
|
||||
ahc* at pci? dev ? function ? # Adaptec [23]94x, aic78x0 SCSI
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.alpha,v 1.68 1998/03/26 02:52:43 thorpej Exp $
|
||||
# $NetBSD: files.alpha,v 1.69 1998/04/15 00:47:22 mjacob Exp $
|
||||
#
|
||||
# alpha-specific configuration info
|
||||
|
||||
@ -18,6 +18,7 @@ defopt DEC_EB164 # EB164: AlphaPC 164
|
||||
defopt DEC_EB64PLUS # EB64+: AlphaPC 64, etc.
|
||||
defopt DEC_KN20AA # KN20AA: AlphaStation 500 and 600
|
||||
defopt DEC_KN8AE # KN8AE: AlphaServer 8200 and 8400
|
||||
defopt DEC_KN300 # KN300: AlphaServer 4X00
|
||||
defopt AVALON_A12 # Avalon: A12T1, A12M Parallel Supercomputer
|
||||
|
||||
# Miscellaneous CPU-specific option headers
|
||||
@ -34,7 +35,8 @@ define wsconsdev {[console = -1]}
|
||||
# this loses, but there's no way to define attributes which have attributes
|
||||
define alpha_shared_intr
|
||||
file arch/alpha/common/shared_intr.c alpha_shared_intr | dec_eb164 |
|
||||
dec_eb64plus | dec_kn20aa | dec_kn8ae
|
||||
dec_eb64plus | dec_kn20aa | dec_kn8ae |
|
||||
dec_kn300
|
||||
define alpha_sgmap
|
||||
file arch/alpha/common/sgmap_common.c alpha_sgmap | dec_3000_500
|
||||
|
||||
@ -116,6 +118,17 @@ device gbus { offset = -1 }
|
||||
attach gbus at tlsb
|
||||
file arch/alpha/tlsb/gbus.c gbus
|
||||
|
||||
#
|
||||
# MCBUS support
|
||||
#
|
||||
|
||||
device mcbus { mid = -1 }
|
||||
attach mcbus at mainbus
|
||||
file arch/alpha/mcbus/mcbus.c mcbus & dec_kn300
|
||||
|
||||
device mcmem
|
||||
attach mcmem at mcbus
|
||||
file arch/alpha/mcbus/mcmem.c mcmem
|
||||
|
||||
#
|
||||
# Bus-independent support for DEC devices
|
||||
@ -272,11 +285,10 @@ file arch/alpha/pci/a12c_pci.c a12c
|
||||
device dwlpx: pcibus, alpha_sgmap, alpha_pci_sgmap_pte32
|
||||
attach dwlpx at kft
|
||||
file arch/alpha/pci/dwlpx.c dwlpx
|
||||
file arch/alpha/pci/dwlpx_bus_io.c dwlpx
|
||||
file arch/alpha/pci/dwlpx_bus_mem.c dwlpx
|
||||
file arch/alpha/pci/dwlpx_dma.c dwlpx
|
||||
file arch/alpha/pci/dwlpx_pci.c dwlpx
|
||||
file arch/alpha/pci/pci_kn8ae.c dwlpx # XXX doesn't really fit here
|
||||
file arch/alpha/pci/dwlpx_bus_mem.c dwlpx
|
||||
file arch/alpha/pci/dwlpx_bus_io.c dwlpx
|
||||
|
||||
device lca: pcibus, alpha_sgmap, alpha_pci_sgmap_pte64
|
||||
attach lca at mainbus
|
||||
@ -286,6 +298,15 @@ file arch/alpha/pci/lca_bus_mem.c lca
|
||||
file arch/alpha/pci/lca_dma.c lca
|
||||
file arch/alpha/pci/lca_pci.c lca
|
||||
|
||||
device mcpcia: pcibus, alpha_sgmap, alpha_pci_sgmap_pte64
|
||||
attach mcpcia at mcbus
|
||||
file arch/alpha/pci/mcpcia.c mcpcia
|
||||
file arch/alpha/pci/mcpcia_bus_io.c mcpcia
|
||||
file arch/alpha/pci/mcpcia_bus_mem.c mcpcia
|
||||
file arch/alpha/pci/mcpcia_dma.c mcpcia
|
||||
file arch/alpha/pci/mcpcia_pci.c mcpcia
|
||||
|
||||
|
||||
# CPU support files
|
||||
file arch/alpha/pci/pci_2100_a50.c dec_2100_a50
|
||||
file arch/alpha/pci/pci_a12.c avalon_a12
|
||||
@ -295,6 +316,8 @@ file arch/alpha/pci/pci_eb164_intr.s dec_eb164
|
||||
#file arch/alpha/pci/pci_eb64plus.c dec_eb64plus
|
||||
file arch/alpha/pci/pci_eb64plus_intr.s dec_eb64plus
|
||||
file arch/alpha/pci/pci_kn20aa.c dec_kn20aa
|
||||
file arch/alpha/pci/pci_kn8ae.c dec_kn8ae
|
||||
file arch/alpha/pci/pci_kn300.c dec_kn300
|
||||
|
||||
|
||||
#
|
||||
@ -396,6 +419,7 @@ file arch/alpha/alpha/dec_eb164.c dec_eb164
|
||||
file arch/alpha/alpha/dec_eb64plus.c dec_eb64plus
|
||||
file arch/alpha/alpha/dec_kn20aa.c dec_kn20aa
|
||||
file arch/alpha/alpha/dec_kn8ae.c dec_kn8ae
|
||||
file arch/alpha/alpha/dec_kn300.c dec_kn300
|
||||
file arch/alpha/alpha/avalon_a12.c avalon_a12
|
||||
|
||||
# Kernel debugger support
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: intrcnt.h,v 1.10 1998/03/02 07:47:52 ross Exp $ */
|
||||
/* $NetBSD: intrcnt.h,v 1.11 1998/04/15 00:47:33 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
|
||||
@ -130,7 +130,28 @@
|
||||
ASCIZ "a12 IEI"; \
|
||||
ASCIZ "xbar FORUN"; \
|
||||
ASCIZ "xbar FURUN"; \
|
||||
ASCIZ "a12 ICW";
|
||||
ASCIZ "a12 ICW"; \
|
||||
ASCIZ "kn8ae ioerr"; \
|
||||
ASCIZ "kn8ae pci"; \
|
||||
ASCIZ "kn300 irq 0"; \
|
||||
ASCIZ "kn300 irq 1"; \
|
||||
ASCIZ "kn300 irq 2"; \
|
||||
ASCIZ "kn300 irq 3"; \
|
||||
ASCIZ "kn300 irq 4"; \
|
||||
ASCIZ "kn300 irq 5"; \
|
||||
ASCIZ "kn300 irq 6"; \
|
||||
ASCIZ "kn300 irq 7"; \
|
||||
/* 0x70 */ ASCIZ "kn300 irq 8"; \
|
||||
ASCIZ "kn300 irq 9"; \
|
||||
ASCIZ "kn300 irq 10"; \
|
||||
ASCIZ "kn300 irq 11"; \
|
||||
ASCIZ "kn300 irq 12"; \
|
||||
ASCIZ "kn300 irq 13"; \
|
||||
ASCIZ "kn300 irq 14"; \
|
||||
ASCIZ "kn300 irq 15"; \
|
||||
ASCIZ "kn300 ncr810"; \
|
||||
ASCIZ "kn300 i2c ctrl"; \
|
||||
ASCIZ "kn300 i2c bus";
|
||||
|
||||
#define INTRCNT_DEFINITION \
|
||||
/* 0x00 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
|
||||
@ -139,7 +160,8 @@
|
||||
/* 0x30 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
|
||||
/* 0x40 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
|
||||
/* 0x50 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
|
||||
/* 0x60 */ .quad 0, 0, 0, 0, 0, 0, 0;
|
||||
/* 0x60 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
|
||||
/* 0x70 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
|
||||
|
||||
#define INTRCNT_CLOCK 0
|
||||
#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1)
|
||||
@ -158,6 +180,13 @@
|
||||
#define INTRCNT_EB164_IRQ_LEN 24
|
||||
#define INTRCNT_A12_IRQ (INTRCNT_EB164_IRQ + INTRCNT_EB164_IRQ_LEN)
|
||||
#define INTRCNT_A12_IRQ_LEN 10
|
||||
#define INTRCNT_KN8AE_IRQ (INTRCNT_A12_IRQ + INTRCNT_A12_IRQ_LEN)
|
||||
#define INTRCNT_KN8AE_IRQ_LEN 2
|
||||
#define INTRCNT_KN300_IRQ (INTRCNT_KN8AE_IRQ + INTRCNT_KN8AE_IRQ_LEN)
|
||||
# define INTRCNT_KN300_NCR810 INTRCNT_KN300_IRQ + 16
|
||||
# define INTRCNT_KN300_I2C_CTRL INTRCNT_KN300_IRQ + 17
|
||||
# define INTRCNT_KN300_I2C_BUS INTRCNT_KN300_IRQ + 18
|
||||
#define INTRCNT_KN300_LEN 19
|
||||
|
||||
#ifndef _LOCORE
|
||||
extern volatile long intrcnt[];
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.h,v 1.12 1998/03/26 02:53:21 thorpej Exp $ */
|
||||
/* $NetBSD: pmap.h,v 1.13 1998/04/15 00:47:33 mjacob Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -159,12 +159,13 @@ struct pv_page {
|
||||
#include "opt_dec_kn8ae.h" /* XXX */
|
||||
|
||||
#if defined(NEW_SCC_DRIVER)
|
||||
#if defined(DEC_KN8AE)
|
||||
#if defined(DEC_KN8AE) || defined(DEC_KN300)
|
||||
#define _PMAP_MAY_USE_PROM_CONSOLE
|
||||
#endif
|
||||
#else /* ! NEW_SCC_DRIVER */
|
||||
#if defined(DEC_3000_300) \
|
||||
|| defined(DEC_3000_500) \
|
||||
|| defined(DEC_KN300) \
|
||||
|| defined(DEC_KN8AE) /* XXX */
|
||||
#define _PMAP_MAY_USE_PROM_CONSOLE /* XXX */
|
||||
#endif /* XXX */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rpb.h,v 1.19 1998/03/20 21:48:03 thorpej Exp $ */
|
||||
/* $NetBSD: rpb.h,v 1.20 1998/04/15 00:47:33 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
@ -59,7 +59,7 @@ struct rpb {
|
||||
#define ST_DEC_2100_A500 9 /* "Sable" (?) */
|
||||
#define ST_DEC_APXVME_64 10 /* "AXPvme" (VME?) */
|
||||
#define ST_DEC_AXPPCI_33 11 /* "NoName" (PCI/ISA) */
|
||||
#define ST_DEC_21000 12 /* "TurboLaser" (?) */
|
||||
#define ST_DEC_21000 12 /* "TurboLaser" (PCI/EISA) */
|
||||
#define ST_DEC_2100_A50 13 /* "Avanti" (PCI/ISA) */
|
||||
#define ST_DEC_MUSTANG 14 /* "Mustang" (?) */
|
||||
#define ST_DEC_KN20AA 15 /* kn20aa (PCI/EISA) */
|
||||
@ -67,7 +67,7 @@ struct rpb {
|
||||
#define ST_EB66 19 /* EB66 (PCI/ISA?) */
|
||||
#define ST_EB64P 20 /* EB64+ (PCI/ISA?) */
|
||||
#define ST_ALPHABOOK1 21 /* Alphabook (?) */
|
||||
#define ST_DEC_4100 22 /* "Rawhide" (?) */
|
||||
#define ST_DEC_4100 22 /* "Rawhide" (PCI/EISA) */
|
||||
#define ST_DEC_EV45_PBP 23 /* "Lego" (?) */
|
||||
#define ST_DEC_2100A_A500 24 /* "Lynx" (?) */
|
||||
#define ST_EB164 26 /* EB164 (PCI/ISA) */
|
||||
|
230
sys/arch/alpha/mcbus/mcbus.c
Normal file
230
sys/arch/alpha/mcbus/mcbus.c
Normal file
@ -0,0 +1,230 @@
|
||||
/* $NetBSD: mcbus.c,v 1.1 1998/04/15 00:48:12 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by Matthew Jacob
|
||||
* NASA AMES Research Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Autoconfiguration and support routines for the TurboLaser System Bus
|
||||
* found on AlphaServer 8200 and 8400 systems.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.1 1998/04/15 00:48:12 mjacob Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#include <machine/autoconf.h>
|
||||
#include <machine/rpb.h>
|
||||
#include <machine/pte.h>
|
||||
|
||||
#include <alpha/mcbus/mcbusreg.h>
|
||||
#include <alpha/mcbus/mcbusvar.h>
|
||||
|
||||
#include "locators.h"
|
||||
|
||||
#define KV(_addr) ((caddr_t)ALPHA_PHYS_TO_K0SEG((_addr)))
|
||||
|
||||
extern struct cfdriver mcbus_cd;
|
||||
extern int cputype;
|
||||
|
||||
struct mcbus_cpu_busdep mcbus_primary;
|
||||
|
||||
static int mcbusmatch __P((struct device *, struct cfdata *, void *));
|
||||
static void mcbusattach __P((struct device *, struct device *, void *));
|
||||
static int mcbusprint __P((void *, const char *));
|
||||
static int mcbussubmatch __P((struct device *, struct cfdata *, void *));
|
||||
static char *mcbus_node_type_str __P((u_int8_t));
|
||||
|
||||
typedef struct {
|
||||
struct device mcbus_dev;
|
||||
u_int8_t mcbus_types[MCBUS_MID_MAX];
|
||||
} mcbus_softc_t;
|
||||
|
||||
struct cfattach mcbus_ca = {
|
||||
sizeof (mcbus_softc_t), mcbusmatch, mcbusattach
|
||||
};
|
||||
|
||||
extern void mcpcia_config_cleanup __P((void));
|
||||
|
||||
|
||||
static int
|
||||
mcbusprint(aux, cp)
|
||||
void *aux;
|
||||
const char *cp;
|
||||
{
|
||||
struct mcbus_dev_attach_args *tap = aux;
|
||||
printf(" mid %d: %s", tap->ma_mid, mcbus_node_type_str(tap->ma_type));
|
||||
return (UNCONF);
|
||||
}
|
||||
|
||||
static int
|
||||
mcbussubmatch(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
struct mcbus_dev_attach_args *tap = aux;
|
||||
if (tap->ma_name != mcbus_cd.cd_name)
|
||||
return (0);
|
||||
if (cf->cf_loc[MCBUSCF_MID] != MCBUSCF_MID_DEFAULT &&
|
||||
cf->cf_loc[MCBUSCF_MID] != tap->ma_mid)
|
||||
return (0);
|
||||
return ((*cf->cf_attach->ca_match)(parent, cf, aux));
|
||||
}
|
||||
|
||||
static int
|
||||
mcbusmatch(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
struct confargs *ca = aux;
|
||||
|
||||
/* Make sure we're looking for a MCBUS. */
|
||||
if (strcmp(ca->ca_name, mcbus_cd.cd_name) != 0)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Only available on 4100 processor type platforms.
|
||||
*/
|
||||
if (cputype != ST_DEC_4100)
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
static void
|
||||
mcbusattach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
{
|
||||
static const char *bcs[4] = {
|
||||
"(no bcache)", "1MB BCache", "4MB BCache", "??????"
|
||||
};
|
||||
static const u_int8_t pci_mid_order[4] = { 5, 4, 7, 6 };
|
||||
struct mcbus_dev_attach_args ta;
|
||||
mcbus_softc_t *mbp = (mcbus_softc_t *)self;
|
||||
u_int8_t mid;
|
||||
int i;
|
||||
|
||||
printf("\n");
|
||||
|
||||
mbp->mcbus_types[0] = MCBUS_TYPE_RES;
|
||||
for (mid = 1; mid <= MCBUS_MID_MAX; ++mid) {
|
||||
mbp->mcbus_types[mid] = MCBUS_TYPE_UNK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find and "configure" memory.
|
||||
*/
|
||||
ta.ma_name = mcbus_cd.cd_name;
|
||||
ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
|
||||
ta.ma_mid = 1;
|
||||
ta.ma_type = MCBUS_TYPE_MEM;
|
||||
mbp->mcbus_types[1] = MCBUS_TYPE_MEM;
|
||||
config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
|
||||
|
||||
/*
|
||||
* Now find PCI busses. In keeping with Digital's ordering
|
||||
* of things, we'll search in a specific MID order.
|
||||
*/
|
||||
for (i = 0; i < MCPCIA_PER_MCBUS; i++) {
|
||||
mid = pci_mid_order[i];
|
||||
ta.ma_name = mcbus_cd.cd_name;
|
||||
ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
|
||||
ta.ma_mid = mid;
|
||||
ta.ma_type = MCBUS_TYPE_PCI;
|
||||
/*
|
||||
* Attach any children nodes (PCI busses).
|
||||
*/
|
||||
config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
|
||||
}
|
||||
|
||||
/*
|
||||
* Deal with hooking CPU instances to MCBUS module ids.
|
||||
*
|
||||
* Note that we do this here because it's the read of
|
||||
* stupid MCPCIA WHOAMI register that can get us the
|
||||
* module ID and type of the configuring CPU.
|
||||
*/
|
||||
|
||||
if (mcbus_primary.mcbus_valid) {
|
||||
mid = mcbus_primary.mcbus_cpu_mid;
|
||||
printf("%s mid %d: %s %s\n", self->dv_xname,
|
||||
mid, mcbus_node_type_str(MCBUS_TYPE_CPU),
|
||||
bcs[mcbus_primary.mcbus_bcache & 0x3]);
|
||||
#if 0
|
||||
ta.ma_name = mcbus_cd.cd_name;
|
||||
ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
|
||||
ta.ma_mid = mid;
|
||||
ta.ma_type = MCBUS_TYPE_CPU;
|
||||
mbp->mcbus_types[mid] = MCBUS_TYPE_CPU;
|
||||
config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Now clean up after configuring everything.
|
||||
*
|
||||
* This is an unfortunate layering violation- but
|
||||
* we can't enable interrupts until *all* probing
|
||||
* is done, but the code and knowledge to clean
|
||||
* up after probing and to enable interrupts is
|
||||
* down in the MCPCIA layer.
|
||||
*/
|
||||
mcpcia_config_cleanup();
|
||||
}
|
||||
|
||||
static char *
|
||||
mcbus_node_type_str(type)
|
||||
u_int8_t type;
|
||||
{
|
||||
switch (type) {
|
||||
case MCBUS_TYPE_RES:
|
||||
panic ("RESERVED TYPE IN MCBUS_NODE_TYPE_STR");
|
||||
break;
|
||||
case MCBUS_TYPE_UNK:
|
||||
panic ("UNKNOWN TYPE IN MCBUS_NODE_TYPE_STR");
|
||||
break;
|
||||
case MCBUS_TYPE_MEM:
|
||||
return ("Memory");
|
||||
case MCBUS_TYPE_CPU:
|
||||
return ("CPU");
|
||||
case MCBUS_TYPE_PCI:
|
||||
return ("PCI Bridge");
|
||||
default:
|
||||
panic("REALLY UNKNWON (%x) TYPE IN MCBUS_NODE_TYPE_STR", type);
|
||||
break;
|
||||
}
|
||||
}
|
77
sys/arch/alpha/mcbus/mcbusreg.h
Normal file
77
sys/arch/alpha/mcbus/mcbusreg.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* $NetBSD: mcbusreg.h,v 1.1 1998/04/15 00:48:12 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by Matthew Jacob
|
||||
* NASA AMES Research Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for the MC System Bus found on
|
||||
* AlphaServer 4100 systems.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Information gathered from:"
|
||||
*
|
||||
* "Rawhide System Programmer's Manual, revision 1.4".
|
||||
*/
|
||||
|
||||
/*
|
||||
* There are 7 possible MC bus modules (architecture says 10, but
|
||||
* the address map details say otherwise), 1 though 7.
|
||||
* Their uses are defined as follows:
|
||||
*
|
||||
* MID Module
|
||||
* ---- ------
|
||||
* 1 Memory
|
||||
* 2 CPU
|
||||
* 3 CPU
|
||||
* 4 CPU, PCI
|
||||
* 5 CPU, PCI
|
||||
* 6 CPU, PCI
|
||||
* 7 CPU, PCI
|
||||
*
|
||||
*/
|
||||
#define MCBUS_MID_MAX 7
|
||||
|
||||
/*
|
||||
* For this architecture, bit 39 of a 40 bit address controls whether
|
||||
* you access I/O or Memory space. Further, there *could* be multiple
|
||||
* MC busses (but only one specified for now).
|
||||
*/
|
||||
|
||||
#define MCBUS_IOSPACE 0x0000008000000000L
|
||||
#define MCBUS_GID_MASK 0x0000007000000000L
|
||||
#define MCBUS_GID_SHIFT 36
|
||||
#define MCBUS_MID_MASK 0x0000000E00000000L
|
||||
#define MCBUS_MID_SHIFT 33
|
||||
|
||||
|
||||
#define MCPCIA_PER_MCBUS 4
|
||||
|
||||
#define MAX_MC_BUS 8
|
74
sys/arch/alpha/mcbus/mcbusvar.h
Normal file
74
sys/arch/alpha/mcbus/mcbusvar.h
Normal file
@ -0,0 +1,74 @@
|
||||
/* $NetBSD: mcbusvar.h,v 1.1 1998/04/15 00:48:12 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by Matthew Jacob
|
||||
* NASA AMES Research Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for the MCbus System Bus found on AlphaServer 4100 systems.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The structure used to attach devices to the MCbus.
|
||||
*/
|
||||
struct mcbus_dev_attach_args {
|
||||
char * ma_name; /* so things aren't confused */
|
||||
u_int8_t ma_gid; /* GID of MCBUS (MCBUS #) */
|
||||
u_int8_t ma_mid; /* Module ID on MCBUS */
|
||||
u_int8_t ma_type; /* Module "type" */
|
||||
u_int8_t ma_configured; /* nonzero if configured */
|
||||
};
|
||||
#define MCBUS_GID_FROM_INSTANCE(unit) (7 - unit)
|
||||
|
||||
/*
|
||||
* Bus-dependent structure for CPUs. This is dynamically allocated
|
||||
* for each CPU on the MCbus, and glued into the cpu_softc as sc_busdep,
|
||||
* if there is such a beast available. Otherwise, a single global version
|
||||
* is used so that the MCPCIA configuration code can determine toads
|
||||
* like module id and bcache size of the master CPU.
|
||||
*/
|
||||
struct mcbus_cpu_busdep {
|
||||
u_int8_t mcbus_cpu_mid; /* MCbus Module ID */
|
||||
u_int8_t mcbus_bcache; /* BCache on this CPU */
|
||||
u_int8_t mcbus_valid;
|
||||
};
|
||||
extern struct mcbus_cpu_busdep mcbus_primary;
|
||||
|
||||
#define MCBUS_CPU_BCACHE_0MB 0
|
||||
#define MCBUS_CPU_BCACHE_1MB 1
|
||||
#define MCBUS_CPU_BCACHE_4MB 2
|
||||
|
||||
/*
|
||||
* "types"
|
||||
*/
|
||||
#define MCBUS_TYPE_RES 0
|
||||
#define MCBUS_TYPE_UNK 1
|
||||
#define MCBUS_TYPE_MEM 2
|
||||
#define MCBUS_TYPE_CPU 3
|
||||
#define MCBUS_TYPE_PCI 4
|
78
sys/arch/alpha/mcbus/mcmem.c
Normal file
78
sys/arch/alpha/mcbus/mcmem.c
Normal file
@ -0,0 +1,78 @@
|
||||
/* $NetBSD: mcmem.c,v 1.1 1998/04/15 00:48:12 mjacob Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by Matthew Jacob
|
||||
* NASA AMES Research Center.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dummy Node for MCBUS Memory Modules found on AlphaServer 4100 systems.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: mcmem.c,v 1.1 1998/04/15 00:48:12 mjacob Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#include <machine/autoconf.h>
|
||||
#include <machine/rpb.h>
|
||||
#include <machine/pte.h>
|
||||
|
||||
#include <alpha/mcbus/mcbusreg.h>
|
||||
#include <alpha/mcbus/mcbusvar.h>
|
||||
|
||||
static int mcmemmatch __P((struct device *, struct cfdata *, void *));
|
||||
static void mcmemattach __P((struct device *, struct device *, void *));
|
||||
struct cfattach mcmem_ca = {
|
||||
sizeof (struct device), mcmemmatch, mcmemattach
|
||||
};
|
||||
|
||||
static int
|
||||
mcmemmatch(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
struct mcbus_dev_attach_args *ta = aux;
|
||||
if (ta->ma_type == MCBUS_TYPE_MEM)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
mcmemattach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
{
|
||||
printf("\n");
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user