/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Gordon W. Ross.
*
* 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.
*
* 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.
*/
/*
* Machine-dependent glue for the Intel Ethernet (ie) driver.
*/
/* Map in the control registers. */
sc->sc_reg = bus_mapin(ca->ca_bustype,
ca->ca_paddr, sizeof(struct ieob));
/*
* The on-board "ie" is wired-up such that its
* memory access goes to the high 16 megabytes
* of the on-board memory space (on-board DVMA).
*/
sc->sc_iobase = (void *)DVMA_OBIO_SLAVE_BASE;
/*
* The on-board "ie" just uses main memory, so
* we can choose how much memory to give it.
* XXX: Would like to use less than 64K...
*/
sc->sc_msize = 0x8000; /* MEMSIZE 32K */
/* Allocate "shared" memory (in DVMA space). */
sc->sc_maddr = dvma_malloc(sc->sc_msize);
if (sc->sc_maddr == NULL)
panic(": not enough dvma space");
/*
* Set the System Configuration Pointer (SCP).
* Its location is system-dependent because the
* i82586 reads it from a fixed physical address.
* On this hardware, the i82586 address maps to
* a 24-bit offset in on-board DVMA space. The
* SCP happens to fall in a page used by the
* PROM monitor, which the PROM knows about.
*/
sc->scp = (volatile void *)((char *)sc->sc_iobase + IE_SCP_ADDR);
/*
* The rest of ram is used for buffers.
*/
sc->buf_area = sc->sc_maddr;
sc->buf_area_sz = sc->sc_msize;