* Move some generic ARM OpenFirmware stuff into arch/arm/ofw (still

more can move, but not yet).
* Garbage-collect some cruft from arch/arm32 in preparation for
  renaming to arch/shark.
This commit is contained in:
thorpej 2002-02-06 21:30:25 +00:00
parent 6c8b3885d6
commit d17cc4f043
20 changed files with 53 additions and 814 deletions

View File

@ -0,0 +1,3 @@
# $NetBSD: files.ofw,v 1.1 2002/02/06 21:30:25 thorpej Exp $
file arch/arm/ofw/openfirm.c

View File

@ -0,0 +1,6 @@
# $NetBSD: files.ofwgencfg,v 1.1 2002/02/06 21:30:26 thorpej Exp $
file arch/arm/ofw/ofw_irq.S
file arch/arm/ofw/ofw_irqhandler.c
file arch/arm/ofw/ofwgencfg_clock.c
file arch/arm/ofw/ofwgencfg_machdep.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofw_irq.S,v 1.11 2001/12/20 01:20:26 thorpej Exp $ */
/* $NetBSD: ofw_irq.S,v 1.1 2002/02/06 21:30:26 thorpej Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofw_irqhandler.c,v 1.12 2002/02/01 22:27:12 thorpej Exp $ */
/* $NetBSD: ofw_irqhandler.c,v 1.1 2002/02/06 21:30:26 thorpej Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofwgencfg_clock.c,v 1.11 2001/11/27 01:06:29 thorpej Exp $ */
/* $NetBSD: ofwgencfg_clock.c,v 1.1 2002/02/06 21:30:26 thorpej Exp $ */
/*
* Copyright 1997

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofwgencfg_machdep.c,v 1.21 2002/01/25 19:19:27 thorpej Exp $ */
/* $NetBSD: ofwgencfg_machdep.c,v 1.1 2002/02/06 21:30:26 thorpej Exp $ */
/*
* Copyright 1997

View File

@ -1,4 +1,4 @@
/* $NetBSD: openfirm.c,v 1.7 2001/11/26 20:49:05 thorpej Exp $ */
/* $NetBSD: openfirm.c,v 1.1 2002/02/06 21:30:27 thorpej Exp $ */
/*
* Copyright 1997

View File

@ -1,4 +1,4 @@
# $NetBSD: OFWGENCFG,v 1.16 2002/01/27 13:23:12 jdolecek Exp $
# $NetBSD: OFWGENCFG,v 1.17 2002/02/06 21:30:27 thorpej Exp $
#
# OFWGENCFG: 'generic' configuration for Open Firmware boards.
#
@ -7,6 +7,7 @@
#
include "arch/arm32/conf/std.arm32"
include "arch/arm32/conf/std.ofwgencfg"
# estimated number of users
@ -24,7 +25,6 @@ makeoptions COPTS="-O2 -march=armv4 -mtune=strongarm"
# Architecture options
options OFW # Enable common Open Firmware bits
options OFWGENCFG # Enable Open Firmware bits specific to GENERIC configuration
# FPA options

View File

@ -1,4 +1,4 @@
# $NetBSD: SHARK,v 1.45 2002/01/27 13:23:12 jdolecek Exp $
# $NetBSD: SHARK,v 1.46 2002/02/06 21:30:28 thorpej Exp $
# From: NetBSD: GENERIC,v 1.72 2000/08/04 02:17:46 hubertf Exp
#
# SHARK
@ -6,7 +6,7 @@
include "arch/arm32/conf/std.arm32"
#ident "GENERIC-$Revision: 1.45 $"
#ident "GENERIC-$Revision: 1.46 $"
# estimated number of users
maxusers 32
@ -25,7 +25,6 @@ options CPU_SA110 # Support the SA110 core
# Architecture options
options OFW # Enable common Open Firmware bits
options SHARK # We are a Shark
options NSIO # We are using the National Semi SuperIO
makeoptions COPTS="-O2 -march=armv4 -mtune=strongarm"

View File

@ -1,4 +1,4 @@
# $NetBSD: SHARKINST,v 1.12 2002/01/27 13:23:12 jdolecek Exp $
# $NetBSD: SHARKINST,v 1.13 2002/02/06 21:30:28 thorpej Exp $
# From: NetBSD: SHARK,v 1.23 1999/06/26 06:56:26 cgd Exp
#
# SHARK Install Kernel
@ -26,7 +26,6 @@ makeoptions COPTS="-O2 -march=armv4 -mtune=strongarm"
# Architecture options
options OFW # Enable common Open Firmware bits
options SHARK # We are a Shark
options NSIO # We are using the National Semi SuperIO

View File

@ -1,4 +1,4 @@
# $NetBSD: files.arm32,v 1.134 2002/02/02 18:37:42 jdolecek Exp $
# $NetBSD: files.arm32,v 1.135 2002/02/06 21:30:28 thorpej Exp $
#
# First try for arm-specific configuration info
#
@ -41,14 +41,14 @@ major {wd = 16}
# Common OFW files
include "dev/ofw/files.ofw"
include "arch/arm/ofw/files.ofw"
attach ofbus at root with ofbus_root
file arch/arm32/ofw/ofw.c ofw
file arch/arm32/ofw/openfirm.c ofw
file arch/arm32/ofw/oftodclock.c ofw & (shark | ofwgencfg)
file arch/arm32/ofw/ofw.c
file arch/arm32/ofw/oftodclock.c
# OFW console initialization
file arch/arm32/ofw/consinit.c ofw
file dev/cninit.c ofw
file arch/arm32/ofw/consinit.c
file dev/cninit.c
# ISA DMA glue
file arch/arm32/isa/isadma_machdep.c isadma
@ -68,14 +68,14 @@ file arch/arm32/ofw/wdc_ofisa_machdep.c wdc_ofisa
# Glue for OFW ISA device attachment
device ofisapc {}
attach ofisapc at ofbus
file arch/arm32/ofw/ofisapc.c pc & ofw
file arch/arm32/ofw/ofisapc.c pc
device ofisascr {}
attach ofisascr at ofisa
file arch/arm32/ofw/ofisascr.c scr & ofw
file arch/arm32/ofw/ofisascr.c scr
device ofrom
attach ofrom at ofbus
file arch/arm32/ofw/ofrom.c ofrom needs-flag
file arch/arm32/ofw/ofrom.c ofrom needs-flag
# Memory disk driver
file arch/arm32/dev/md_hooks.c md & memory_disk_hooks
@ -129,76 +129,23 @@ file arch/arm32/isa/isa_shark_machdep.c shark
file arch/arm32/isa/isa_io.c shark | isa
file arch/arm32/isa/isa_io_asm.S shark | isa
# OFWGENCFG specific files
file arch/arm32/ofw/ofw_irq.S ofwgencfg
file arch/arm32/ofw/ofw_irqhandler.c ofwgencfg
file arch/arm32/ofw/ofwgencfg_clock.c ofwgencfg
file arch/arm32/ofw/ofwgencfg_machdep.c ofwgencfg
# National Semiconductor PC97307VUL SuperIO chip configuration routines
define nsio
file arch/arm32/shark/ns87307.c nsio & shark
file arch/arm32/shark/ns87307.c nsio & shark
# 8042 microcontroller routines for keyboard and mouse
define i8042
file arch/arm32/shark/i8042.c i8042
file arch/arm32/shark/i8042.c i8042
defpseudo profiler: disk
file arch/arm32/shark/profile.c profiler needs-flag
file arch/arm32/shark/profile.c profiler needs-flag
# SHARK pc console
device pc: tty, spckbd, i8042
attach pc at ofisapc
file arch/arm32/shark/pccons.c pc & ofw needs-flag
file arch/arm32/shark/pccons.c pc needs-flag
# Smart Card Reader
device scr: tty
file arch/arm32/shark/scr.c scr needs-flag
attach scr at ofisascr
# ISA Plug 'n Play autoconfiguration glue.
file arch/arm32/isa/isapnp_machdep.c isapnp
# EBSA285/CATS class board
device sysbeep
attach sysbeep at pcppi with sysbeep_isa
file arch/arm32/isa/sysbeep_isa.c sysbeep_isa
device dsrtc: todservice
attach dsrtc at isa
file arch/arm32/isa/dsrtc.c dsrtc
# Machine-independent I2O drivers.
include "dev/i2o/files.i2o"
# PCI devices
include "arch/arm/conf/files.footbridge"
#
# Include PCI config
#
include "dev/pci/files.pci"
# network devices MII bus
include "dev/mii/files.mii"
device pcib: isabus
attach pcib at pci
file arch/arm32/pci/pcib.c pcib
# XXX THE FOLLOWING BLOCK SHOULD GO INTO dev/pci/files.pci, BUT CANNOT
# XXX BECAUSE NOT 'lpt' IS DEFINED IN files.isa, RATHER THAN files.
# XXX (when the conf/files and files.isa bogons are fixed, this can
# XXX be fixed as well.)
attach lpt at puc with lpt_puc
file dev/pci/lpt_puc.c lpt_puc
file arch/arm32/pci/pciide_machdep.c pciide
# Include USB stuff
include "dev/usb/files.usb"
include "dev/pckbc/files.pckbc"

View File

@ -1,4 +1,4 @@
# $NetBSD: std.arm32,v 1.14 2001/08/19 05:51:09 matt Exp $
# $NetBSD: std.arm32,v 1.15 2002/02/06 21:30:29 thorpej Exp $
#
# standard NetBSD/arm32 options
@ -10,3 +10,6 @@ options EXEC_SCRIPT
# To support easy transit to ../arch/arm/arm32
options ARM32
# XXX
options OFW

View File

@ -0,0 +1,7 @@
# $NetBSD: std.ofwgencfg,v 1.1 2002/02/06 21:30:29 thorpej Exp $
#
# Configuration options for generic OpenFirmware configurations.
#
# Pull in OFWGENCFG config definitions.
include "arch/arm/ofw/files.ofwgencfg"

View File

@ -1,267 +0,0 @@
/* $NetBSD: dsrtc.c,v 1.3 2002/01/07 22:58:08 chris Exp $ */
/*
* Copyright (c) 1998 Mark Brinicombe.
* Copyright (c) 1998 Causality Limited.
* All rights reserved.
*
* Written by Mark Brinicombe, Causality Limited
*
* 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD Project.
* 4. The name of the company nor the name of the author may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY CAUASLITY LIMITED ``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 CAUSALITY LIMITED 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.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <machine/rtc.h>
#include <arm32/dev/todclockvar.h>
#include <arm32/isa/ds1687reg.h>
#include <dev/isa/isavar.h>
#define NRTC_PORTS 2
struct dsrtc_softc {
struct device sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
};
void dsrtcattach __P((struct device *parent, struct device *self, void *aux));
int dsrtcmatch __P((struct device *parent, struct cfdata *cf, void *aux));
int ds1687_read __P((struct dsrtc_softc *sc, int addr));
void ds1687_write __P((struct dsrtc_softc *sc, int addr, int data));
int ds1687_ram_read __P((struct dsrtc_softc *sc, int addr));
void ds1687_ram_write __P((struct dsrtc_softc *sc, int addr, int data));
static void ds1687_bank_select __P((struct dsrtc_softc *, int));
static int dsrtc_write __P((void *, rtc_t *));
static int dsrtc_read __P((void *, rtc_t *));
int
ds1687_read(sc, addr)
struct dsrtc_softc *sc;
int addr;
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_ADDR_REG, addr);
return(bus_space_read_1(sc->sc_iot, sc->sc_ioh, RTC_DATA_REG));
}
void
ds1687_write(sc, addr, data)
struct dsrtc_softc *sc;
int addr;
int data;
{
bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_ADDR_REG, addr);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_DATA_REG, data);
}
static void
ds1687_bank_select(sc, bank)
struct dsrtc_softc *sc;
int bank;
{
int data;
data = ds1687_read(sc, RTC_REG_A);
data &= ~RTC_REG_A_BANK_MASK;
if (bank)
data |= RTC_REG_A_BANK1;
ds1687_write(sc, RTC_REG_A, data);
}
#if 0
/* Nothing uses these yet */
int
ds1687_ram_read(sc, addr)
struct dsrtc_softc *sc;
int addr;
{
if (addr < RTC_PC_RAM_SIZE)
return(ds1687_read(sc, RTC_PC_RAM_START + addr));
addr -= RTC_PC_RAM_SIZE;
if (addr < RTC_BANK0_RAM_SIZE)
return(ds1687_read(sc, RTC_BANK0_RAM_START + addr));
addr -= RTC_BANK0_RAM_SIZE;
if (addr < RTC_EXT_RAM_SIZE) {
int data;
ds1687_bank_select(sc, 1);
ds1687_write(sc, RTC_EXT_RAM_ADDRESS, addr);
data = ds1687_read(sc, RTC_EXT_RAM_DATA);
ds1687_bank_select(sc, 0);
return(data);
}
return(-1);
}
void
ds1687_ram_write(sc, addr, val)
struct dsrtc_softc *sc;
int addr;
int val;
{
if (addr < RTC_PC_RAM_SIZE)
return(ds1687_write(sc, RTC_PC_RAM_START + addr, val));
addr -= RTC_PC_RAM_SIZE;
if (addr < RTC_BANK0_RAM_SIZE)
return(ds1687_write(sc, RTC_BANK0_RAM_START + addr, val));
addr -= RTC_BANK0_RAM_SIZE;
if (addr < RTC_EXT_RAM_SIZE) {
ds1687_bank_select(sc, 1);
ds1687_write(sc, RTC_EXT_RAM_ADDRESS, addr);
ds1687_write(sc, RTC_EXT_RAM_DATA, val);
ds1687_bank_select(sc, 0);
}
}
#endif
static int
dsrtc_write(arg, rtc)
void *arg;
rtc_t *rtc;
{
struct dsrtc_softc *sc = arg;
ds1687_write(sc, RTC_SECONDS, rtc->rtc_sec);
ds1687_write(sc, RTC_MINUTES, rtc->rtc_min);
ds1687_write(sc, RTC_HOURS, rtc->rtc_hour);
ds1687_write(sc, RTC_DAYOFMONTH, rtc->rtc_day);
ds1687_write(sc, RTC_MONTH, rtc->rtc_mon);
ds1687_write(sc, RTC_YEAR, rtc->rtc_year);
ds1687_bank_select(sc, 1);
ds1687_write(sc, RTC_CENTURY, rtc->rtc_cen);
ds1687_bank_select(sc, 0);
return(1);
}
static int
dsrtc_read(arg, rtc)
void *arg;
rtc_t *rtc;
{
struct dsrtc_softc *sc = arg;
rtc->rtc_micro = 0;
rtc->rtc_centi = 0;
rtc->rtc_sec = ds1687_read(sc, RTC_SECONDS);
rtc->rtc_min = ds1687_read(sc, RTC_MINUTES);
rtc->rtc_hour = ds1687_read(sc, RTC_HOURS);
rtc->rtc_day = ds1687_read(sc, RTC_DAYOFMONTH);
rtc->rtc_mon = ds1687_read(sc, RTC_MONTH);
rtc->rtc_year = ds1687_read(sc, RTC_YEAR);
ds1687_bank_select(sc, 1);
rtc->rtc_cen = ds1687_read(sc, RTC_CENTURY);
ds1687_bank_select(sc, 0);
return(1);
}
/* device and attach structures */
struct cfattach dsrtc_ca = {
sizeof(struct dsrtc_softc), dsrtcmatch, dsrtcattach
};
/*
* dsrtcmatch()
*
* Validate the IIC address to make sure its an RTC we understand
*/
int
dsrtcmatch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct isa_attach_args *ia = aux;
if (ia->ia_nio < 1 ||
ia->ia_io[0].ir_addr == ISACF_PORT_DEFAULT)
return (0);
ia->ia_nio = 1;
ia->ia_io[0].ir_size = NRTC_PORTS;
ia->ia_niomem = 0;
ia->ia_nirq = 0;
ia->ia_ndrq = 0;
return(1);
}
/*
* dsrtcattach()
*
* Attach the rtc device
*/
void
dsrtcattach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
{
struct dsrtc_softc *sc = (struct dsrtc_softc *)self;
struct isa_attach_args *ia = aux;
struct todclock_attach_args ta;
sc->sc_iot = ia->ia_iot;
if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr,
ia->ia_io[0].ir_size, 0, &sc->sc_ioh)) {
printf(": cannot map I/O space\n");
return;
}
ds1687_write(sc, RTC_REG_A, RTC_REG_A_DV1);
ds1687_write(sc, RTC_REG_B, RTC_REG_B_BINARY | RTC_REG_B_24_HOUR);
if (!(ds1687_read(sc, RTC_REG_D) & RTC_REG_D_VRT))
printf(": lithium cell is dead, RTC unreliable");
printf("\n");
ta.ta_name = "todclock";
ta.ta_rtc_arg = sc;
ta.ta_rtc_write = dsrtc_write;
ta.ta_rtc_read = dsrtc_read;
ta.ta_flags = 0;
config_found(self, &ta, NULL);
}
/* End of dsrtc.c */

View File

@ -1,165 +0,0 @@
/* $NetBSD: isapnp_machdep.c,v 1.3 1998/09/05 15:28:05 christos Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center and by Christos Zoulas.
*
* 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
/*
* Copyright (c) 1997 Thomas Gerner. 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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 ``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 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.
*/
/*
* Machine-dependent portions of ISA PnP bus autoconfiguration.
*
* N.B. This file exists mostly to get around some lameness surrounding
* the PnP spec. ISA PnP registers live where some `normal' ISA
* devices do, but are e.g. write-only registers where the normal
* device has a read-only register. This breaks in the presence of
* i/o port accounting. This file takes care of mapping ISA PnP
* registers without actually allocating them in extent maps.
*
* Since this is a machine-dependent file, we make all sorts of
* assumptions about bus.h's guts. Beware!
*
* Note: We just use bus_space{,un}map() here. This works because we
* don't do space accounting (we'd need a back-door to bypass it
* if we did!).
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <machine/bus.h>
#include <dev/isa/isavar.h>
#include <dev/isapnp/isapnpreg.h>
#include <dev/isapnp/isapnpvar.h>
/* isapnp_map():
* Map I/O regions used by PnP
*/
int
isapnp_map(sc)
struct isapnp_softc *sc;
{
#ifdef _KERNEL
int error;
#endif
#ifdef _KERNEL
if ((error = bus_space_map(sc->sc_iot, ISAPNP_ADDR, 1, 0,
&sc->sc_addr_ioh)) != 0)
return error;
if ((error = bus_space_map(sc->sc_iot, ISAPNP_WRDATA, 1, 0,
&sc->sc_wrdata_ioh)) != 0)
return error;
#endif
return (0);
}
/* isapnp_unmap():
* Unmap I/O regions used by PnP
*/
void
isapnp_unmap(sc)
struct isapnp_softc *sc;
{
bus_space_unmap(sc->sc_iot, sc->sc_addr_ioh, 1);
bus_space_unmap(sc->sc_iot, sc->sc_wrdata_ioh, 1);
}
/* isapnp_map_readport():
* Called to map the PnP `read port', which is mapped independently
* of the `write' and `addr' ports.
*
* NOTE: assumes the caller has filled in sc->sc_read_port!
*/
int
isapnp_map_readport(sc)
struct isapnp_softc *sc;
{
#ifdef _KERNEL
int error;
#endif
#ifdef _KERNEL
/* Check if some other device has already claimed this port. */
if ((error = bus_space_map(sc->sc_iot, sc->sc_read_port, 1, 0,
&sc->sc_read_ioh)) != 0)
return error;
#endif
return 0;
}
/* isapnp_unmap_readport():
* Pretend to unmap a previously mapped `read port'.
*/
void
isapnp_unmap_readport(sc)
struct isapnp_softc *sc;
{
bus_space_unmap(sc->sc_iot, sc->sc_read_ioh, 1);
}

View File

@ -1,85 +0,0 @@
/* $NetBSD: sysbeep_isa.c,v 1.1 1998/10/05 00:41:31 mark Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Mark Brinicombe of Causality Limited.
*
* 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/isa/isavar.h>
#include <dev/isa/pcppivar.h>
/* Prototypes */
int sysbeep_isa_match __P((struct device *parent, struct cfdata *cf, void *aux));
void sysbeep_isa_attach __P((struct device *parent, struct device *self, void *aux));
void sysbeep_isa __P((int pitch, int period));
/* device attach structure */
struct cfattach sysbeep_isa_ca = {
sizeof(struct device), sysbeep_isa_match, sysbeep_isa_attach
};
static int ppi_attached;
static pcppi_tag_t ppicookie;
int
sysbeep_isa_match(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
{
return (!ppi_attached);
}
void
sysbeep_isa_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
printf("\n");
ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie;
ppi_attached = 1;
}
void
sysbeep(pitch, period)
int pitch, period;
{
if (ppi_attached)
pcppi_bell(ppicookie, pitch, period, 0);
}

View File

@ -1,140 +0,0 @@
/* $NetBSD: pcib.c,v 1.2 1998/09/06 04:20:38 mark Exp $ */
/*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*
* from: i386/pci/pcib.c,v 1.12
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <machine/bus.h>
#include <dev/isa/isavar.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
#include "isadma.h"
int pcibmatch __P((struct device *, struct cfdata *, void *));
void pcibattach __P((struct device *, struct device *, void *));
struct cfattach pcib_ca = {
sizeof(struct device), pcibmatch, pcibattach
};
void pcib_callback __P((struct device *));
int pcib_print __P((void *, const char *));
int
pcibmatch(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
{
struct pci_attach_args *pa = aux;
/*
* Match tested PCI-ISA bridges.
*/
switch (PCI_VENDOR(pa->pa_id)) {
case PCI_VENDOR_ALI:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_ALI_M1543:
return (1);
}
break;
}
return (0);
}
void
pcibattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct pci_attach_args *pa = aux;
char devinfo[256];
printf("\n");
/*
* Just print out a description and set the ISA bus
* callback.
*/
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
printf("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
PCI_REVISION(pa->pa_class));
/* Set the ISA bus callback */
config_defer(self, pcib_callback);
}
void
pcib_callback(self)
struct device *self;
{
struct isabus_attach_args iba;
/*
* Attach the ISA bus behind this bridge.
*/
memset(&iba, 0, sizeof(iba));
iba.iba_busname = "isa";
iba.iba_iot = &isa_io_bs_tag;
iba.iba_memt = &isa_mem_bs_tag;
#if NISADMA > 0
iba.iba_dmat = &isa_bus_dma_tag;
#endif
config_found(self, &iba, pcib_print);
}
int
pcib_print(aux, pnp)
void *aux;
const char *pnp;
{
/* Only ISAs can attach to pcib's; easy. */
if (pnp)
printf("isa at %s", pnp);
return (UNCONF);
}

View File

@ -1,78 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.3 2000/11/04 14:05:55 tsutsui Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. 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, 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. 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 ``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 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.
*/
/*
* PCI IDE controller driver (arm32 machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
#include <dev/isa/isavar.h>
#include <machine/intr.h>
#include "isa.h"
void *
pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
struct device *dev;
struct pci_attach_args *pa;
int chan;
int (*func) __P((void *));
void *arg;
{
#if NISA > 0
int irq;
void *cookie;
irq = PCIIDE_COMPAT_IRQ(chan);
cookie = isa_intr_establish(NULL, irq, IST_EDGE, IPL_BIO, func, arg);
if (cookie == NULL)
return (NULL);
printf("%s: %s channel interrupting at irq %d\n", dev->dv_xname,
PCIIDE_CHANNEL_NAME(chan), irq);
return (cookie);
#else
panic("pciide_machdep_compat_intr_establish() called\n");
#endif
}

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1 2002/02/06 21:30:41 thorpej Exp $
SUBDIR= ofwboot
.include <bsd.subdir.mk>

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile.inc,v 1.1 2002/02/06 21:30:41 thorpej Exp $
BINDIR= /usr/mdec
CPPFLAGS+= -D_STANDALONE