Home | History | Annotate | Line # | Download | only in dev
if_ie_obio.c revision 1.35
      1  1.35  christos /*	$NetBSD: if_ie_obio.c,v 1.35 2007/03/04 06:00:44 christos Exp $	*/
      2   1.1        pk 
      3   1.1        pk /*-
      4   1.1        pk  * Copyright (c) 1997 The NetBSD Foundation, Inc.
      5   1.1        pk  * All rights reserved.
      6   1.1        pk  *
      7   1.1        pk  * This code is derived from software contributed to The NetBSD Foundation
      8   1.1        pk  * by Paul Kranenburg.
      9   1.1        pk  *
     10   1.1        pk  * Redistribution and use in source and binary forms, with or without
     11   1.1        pk  * modification, are permitted provided that the following conditions
     12   1.1        pk  * are met:
     13   1.1        pk  * 1. Redistributions of source code must retain the above copyright
     14   1.1        pk  *    notice, this list of conditions and the following disclaimer.
     15   1.1        pk  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1        pk  *    notice, this list of conditions and the following disclaimer in the
     17   1.1        pk  *    documentation and/or other materials provided with the distribution.
     18   1.1        pk  * 3. All advertising materials mentioning features or use of this software
     19   1.1        pk  *    must display the following acknowledgement:
     20   1.1        pk  *        This product includes software developed by the NetBSD
     21   1.1        pk  *        Foundation, Inc. and its contributors.
     22   1.1        pk  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23   1.1        pk  *    contributors may be used to endorse or promote products derived
     24   1.1        pk  *    from this software without specific prior written permission.
     25   1.1        pk  *
     26   1.1        pk  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27   1.1        pk  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28   1.1        pk  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29   1.1        pk  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30   1.1        pk  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31   1.1        pk  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32   1.1        pk  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33   1.1        pk  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34   1.1        pk  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35   1.1        pk  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36   1.1        pk  * POSSIBILITY OF SUCH DAMAGE.
     37   1.1        pk  */
     38   1.1        pk 
     39   1.1        pk /*-
     40   1.1        pk  * Copyright (c) 1995 Charles D. Cranor
     41   1.1        pk  * All rights reserved.
     42   1.1        pk  *
     43   1.1        pk  * Redistribution and use in source and binary forms, with or without
     44   1.1        pk  * modification, are permitted provided that the following conditions
     45   1.1        pk  * are met:
     46   1.1        pk  * 1. Redistributions of source code must retain the above copyright
     47   1.1        pk  *    notice, this list of conditions and the following disclaimer.
     48   1.1        pk  * 2. Redistributions in binary form must reproduce the above copyright
     49   1.1        pk  *    notice, this list of conditions and the following disclaimer in the
     50   1.1        pk  *    documentation and/or other materials provided with the distribution.
     51   1.1        pk  * 3. All advertising materials mentioning features or use of this software
     52   1.1        pk  *    must display the following acknowledgement:
     53   1.1        pk  *      This product includes software developed by Charles D. Cranor.
     54   1.1        pk  * 4. The name of the author may not be used to endorse or promote products
     55   1.1        pk  *    derived from this software without specific prior written permission.
     56   1.1        pk  *
     57   1.1        pk  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     58   1.1        pk  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     59   1.1        pk  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     60   1.1        pk  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     61   1.1        pk  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     62   1.1        pk  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     63   1.1        pk  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     64   1.1        pk  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     65   1.1        pk  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     66   1.1        pk  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     67   1.1        pk  */
     68   1.1        pk 
     69   1.1        pk 
     70   1.1        pk 
     71   1.1        pk /*
     72   1.1        pk  * Sparc OBIO front-end for the Intel 82586 Ethernet driver
     73   1.1        pk  *
     74   1.1        pk  * Converted to SUN ie driver by Charles D. Cranor,
     75   1.1        pk  *		October 1994, January 1995.
     76   1.1        pk  */
     77   1.1        pk 
     78   1.1        pk /*
     79   1.1        pk  * The i82586 is a very painful chip, found in sun3's, sun-4/100's
     80   1.1        pk  * sun-4/200's, and VME based suns.  The byte order is all wrong for a
     81   1.1        pk  * SUN, making life difficult.  Programming this chip is mostly the same,
     82   1.1        pk  * but certain details differ from system to system.  This driver is
     83   1.1        pk  * written so that different "ie" interfaces can be controled by the same
     84   1.1        pk  * driver.
     85   1.1        pk  */
     86  1.30     lukem 
     87  1.30     lukem #include <sys/cdefs.h>
     88  1.35  christos __KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.35 2007/03/04 06:00:44 christos Exp $");
     89   1.1        pk 
     90   1.1        pk #include <sys/param.h>
     91   1.1        pk #include <sys/systm.h>
     92   1.1        pk #include <sys/errno.h>
     93   1.1        pk #include <sys/device.h>
     94   1.1        pk #include <sys/malloc.h>
     95   1.1        pk #include <sys/protosw.h>
     96   1.1        pk #include <sys/socket.h>
     97   1.1        pk 
     98   1.1        pk #include <net/if.h>
     99   1.1        pk #include <net/if_types.h>
    100   1.1        pk #include <net/if_dl.h>
    101   1.1        pk #include <net/if_media.h>
    102   1.1        pk #include <net/if_ether.h>
    103   1.1        pk 
    104  1.16       mrg #include <uvm/uvm_extern.h>
    105   1.1        pk 
    106  1.17        pk #include <machine/bus.h>
    107  1.17        pk #include <machine/intr.h>
    108   1.1        pk #include <machine/autoconf.h>
    109   1.1        pk 
    110   1.1        pk #include <dev/ic/i82586reg.h>
    111   1.1        pk #include <dev/ic/i82586var.h>
    112   1.1        pk 
    113   1.1        pk /*
    114   1.1        pk  * the on-board interface
    115   1.1        pk  */
    116   1.1        pk struct ieob {
    117   1.1        pk 	u_char  obctrl;
    118   1.1        pk };
    119   1.1        pk #define IEOB_NORSET 0x80	/* don't reset the board */
    120   1.1        pk #define IEOB_ONAIR  0x40	/* put us on the air */
    121   1.1        pk #define IEOB_ATTEN  0x20	/* attention! */
    122   1.1        pk #define IEOB_IENAB  0x10	/* interrupt enable */
    123   1.1        pk #define IEOB_XXXXX  0x08	/* free bit */
    124   1.1        pk #define IEOB_XCVRL2 0x04	/* level 2 transceiver? */
    125   1.1        pk #define IEOB_BUSERR 0x02	/* bus error */
    126   1.1        pk #define IEOB_INT    0x01	/* interrupt */
    127   1.1        pk 
    128   1.1        pk #define IEOB_ADBASE 0xff000000  /* KVA base addr of 24 bit address space */
    129   1.1        pk 
    130   1.1        pk 
    131  1.33       uwe static void ie_obreset(struct ie_softc *, int);
    132  1.33       uwe static void ie_obattend(struct ie_softc *, int);
    133  1.33       uwe static void ie_obrun(struct ie_softc *);
    134   1.1        pk 
    135  1.33       uwe int ie_obio_match(struct device *, struct cfdata *, void *);
    136  1.33       uwe void ie_obio_attach(struct device *, struct device *, void *);
    137   1.1        pk 
    138  1.26   thorpej CFATTACH_DECL(ie_obio, sizeof(struct ie_softc),
    139  1.27   thorpej     ie_obio_match, ie_obio_attach, NULL, NULL);
    140   1.1        pk 
    141   1.1        pk /* Supported media */
    142   1.1        pk static int media[] = {
    143   1.1        pk 	IFM_ETHER | IFM_10_2,
    144  1.33       uwe };
    145   1.1        pk #define NMEDIA	(sizeof(media) / sizeof(media[0]))
    146   1.1        pk 
    147   1.1        pk 
    148   1.1        pk /*
    149   1.1        pk  * OBIO ie support routines
    150   1.1        pk  */
    151  1.33       uwe static void
    152  1.33       uwe ie_obreset(struct ie_softc *sc, int what)
    153   1.1        pk {
    154   1.1        pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    155  1.33       uwe 
    156   1.1        pk 	ieo->obctrl = 0;
    157   1.1        pk 	delay(100);			/* XXX could be shorter? */
    158   1.1        pk 	ieo->obctrl = IEOB_NORSET;
    159   1.1        pk }
    160  1.33       uwe 
    161  1.33       uwe static void
    162  1.33       uwe ie_obattend(struct ie_softc *sc, int why)
    163   1.1        pk {
    164   1.1        pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    165   1.1        pk 
    166   1.1        pk 	ieo->obctrl |= IEOB_ATTEN;	/* flag! */
    167   1.1        pk 	ieo->obctrl &= ~IEOB_ATTEN;	/* down. */
    168   1.1        pk }
    169   1.1        pk 
    170  1.33       uwe static void
    171  1.33       uwe ie_obrun(struct ie_softc *sc)
    172   1.1        pk {
    173   1.1        pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    174   1.1        pk 
    175   1.1        pk 	ieo->obctrl |= (IEOB_ONAIR|IEOB_IENAB|IEOB_NORSET);
    176   1.1        pk }
    177   1.1        pk 
    178  1.33       uwe void ie_obio_memcopyin(struct ie_softc *, void *, int, size_t);
    179  1.33       uwe void ie_obio_memcopyout(struct ie_softc *, const void *, int, size_t);
    180   1.1        pk 
    181   1.1        pk /*
    182   1.1        pk  * Copy board memory to kernel.
    183   1.1        pk  */
    184   1.1        pk void
    185  1.33       uwe ie_obio_memcopyin(struct ie_softc *sc, void *p, int offset, size_t size)
    186   1.1        pk {
    187   1.1        pk 	void *addr = (void *)((u_long)sc->bh + offset);/*XXX - not MI!*/
    188  1.33       uwe 
    189   1.1        pk 	wcopy(addr, p, size);
    190   1.1        pk }
    191   1.1        pk 
    192   1.1        pk /*
    193   1.1        pk  * Copy from kernel space to naord memory.
    194   1.1        pk  */
    195   1.1        pk void
    196  1.33       uwe ie_obio_memcopyout(struct ie_softc *sc, const void *p, int offset, size_t size)
    197   1.1        pk {
    198   1.1        pk 	void *addr = (void *)((u_long)sc->bh + offset);/*XXX - not MI!*/
    199  1.33       uwe 
    200   1.1        pk 	wcopy(p, addr, size);
    201   1.1        pk }
    202   1.1        pk 
    203   1.1        pk /* read a 16-bit value at BH offset */
    204  1.33       uwe uint16_t ie_obio_read16(struct ie_softc *, int);
    205   1.1        pk /* write a 16-bit value at BH offset */
    206  1.33       uwe void ie_obio_write16(struct ie_softc *, int, uint16_t);
    207  1.33       uwe void ie_obio_write24(struct ie_softc *, int, int);
    208   1.1        pk 
    209  1.33       uwe uint16_t
    210  1.33       uwe ie_obio_read16(struct ie_softc *sc, int offset)
    211   1.1        pk {
    212  1.33       uwe 	uint16_t v = bus_space_read_2(sc->bt, sc->bh, offset);
    213  1.33       uwe 
    214   1.1        pk 	return (((v&0xff)<<8) | ((v>>8)&0xff));
    215   1.1        pk }
    216   1.1        pk 
    217   1.1        pk void
    218  1.33       uwe ie_obio_write16(struct ie_softc *sc, int offset, uint16_t v)
    219   1.1        pk {
    220   1.1        pk 	v = (((v&0xff)<<8) | ((v>>8)&0xff));
    221   1.1        pk 	bus_space_write_2(sc->bt, sc->bh, offset, v);
    222   1.1        pk }
    223   1.1        pk 
    224   1.1        pk void
    225  1.33       uwe ie_obio_write24(struct ie_softc *sc, int offset, int addr)
    226   1.1        pk {
    227   1.9        pk 	u_char *f = (u_char *)&addr;
    228  1.33       uwe 	uint16_t v0, v1;
    229   1.9        pk 	u_char *t;
    230   1.9        pk 
    231   1.9        pk 	t = (u_char *)&v0;
    232   1.9        pk 	t[0] = f[3]; t[1] = f[2];
    233   1.9        pk 	bus_space_write_2(sc->bt, sc->bh, offset, v0);
    234   1.9        pk 
    235   1.9        pk 	t = (u_char *)&v1;
    236   1.9        pk 	t[0] = f[1]; t[1] = 0;
    237   1.9        pk 	bus_space_write_2(sc->bt, sc->bh, offset+2, v1);
    238   1.1        pk }
    239   1.1        pk 
    240   1.1        pk int
    241  1.33       uwe ie_obio_match(struct device *parent, struct cfdata *cf, void *aux)
    242   1.1        pk {
    243   1.4        pk 	union obio_attach_args *uoba = aux;
    244   1.4        pk 	struct obio4_attach_args *oba;
    245   1.1        pk 
    246   1.4        pk 	if (uoba->uoba_isobio4 == 0)
    247   1.1        pk 		return (0);
    248   1.1        pk 
    249   1.4        pk 	oba = &uoba->uoba_oba4;
    250  1.24        pk 	return (bus_space_probe(oba->oba_bustag, oba->oba_paddr,
    251   1.6        pk 				1,	/* probe size */
    252   1.6        pk 				0,	/* offset */
    253   1.6        pk 				0,	/* flags */
    254   1.6        pk 				NULL, NULL));
    255   1.1        pk }
    256   1.1        pk 
    257   1.1        pk void
    258  1.33       uwe ie_obio_attach(struct device *parent, struct device *self, void *aux)
    259   1.1        pk {
    260   1.4        pk 	union obio_attach_args *uoba = aux;
    261   1.4        pk 	struct obio4_attach_args *oba = &uoba->uoba_oba4;
    262   1.1        pk 	struct ie_softc *sc = (void *) self;
    263  1.14        pk 	bus_dma_tag_t dmatag = oba->oba_dmatag;
    264   1.4        pk 	bus_space_handle_t bh;
    265   1.8        pk 	bus_dma_segment_t seg;
    266   1.8        pk 	int rseg;
    267  1.14        pk 	int error;
    268   1.7        pk 	paddr_t pa;
    269   1.4        pk 	struct intrhand *ih;
    270  1.32   tsutsui 	bus_size_t memsize;
    271   1.9        pk 	u_long iebase;
    272  1.33       uwe 	uint8_t myaddr[ETHER_ADDR_LEN];
    273   1.1        pk 
    274   1.8        pk 	sc->bt = oba->oba_bustag;
    275   1.1        pk 
    276   1.1        pk 	sc->hwreset = ie_obreset;
    277   1.1        pk 	sc->chan_attn = ie_obattend;
    278   1.1        pk 	sc->hwinit = ie_obrun;
    279   1.1        pk 	sc->memcopyout = ie_obio_memcopyout;
    280   1.1        pk 	sc->memcopyin = ie_obio_memcopyin;
    281  1.18     bjh21 
    282  1.18     bjh21 	sc->ie_bus_barrier = NULL;
    283   1.1        pk 	sc->ie_bus_read16 = ie_obio_read16;
    284   1.1        pk 	sc->ie_bus_write16 = ie_obio_write16;
    285   1.1        pk 	sc->ie_bus_write24 = ie_obio_write24;
    286  1.32   tsutsui 	sc->sc_msize = memsize = 65536; /* XXX */
    287   1.1        pk 
    288  1.24        pk 	if (bus_space_map(oba->oba_bustag, oba->oba_paddr,
    289  1.24        pk 			  sizeof(struct ieob),
    290  1.24        pk 			  BUS_SPACE_MAP_LINEAR,
    291  1.24        pk 			  &bh) != 0) {
    292   1.4        pk 		printf("%s: cannot map registers\n", self->dv_xname);
    293   1.4        pk 		return;
    294   1.4        pk 	}
    295   1.4        pk 	sc->sc_reg = (void *)bh;
    296   1.1        pk 
    297   1.1        pk 	/*
    298   1.8        pk 	 * Allocate control & buffer memory.
    299   1.1        pk 	 */
    300  1.32   tsutsui 	if ((error = bus_dmamap_create(dmatag, memsize, 1, memsize, 0,
    301  1.14        pk 					BUS_DMA_NOWAIT|BUS_DMA_24BIT,
    302  1.14        pk 					&sc->sc_dmamap)) != 0) {
    303  1.14        pk 		printf("%s: DMA map create error %d\n",
    304  1.14        pk 			sc->sc_dev.dv_xname, error);
    305  1.14        pk 		return;
    306  1.14        pk 	}
    307  1.32   tsutsui 	if ((error = bus_dmamem_alloc(dmatag, memsize, 64*1024, 0,
    308   1.8        pk 			     &seg, 1, &rseg,
    309  1.14        pk 			     BUS_DMA_NOWAIT | BUS_DMA_24BIT)) != 0) {
    310  1.14        pk 		printf("%s: DMA memory allocation error %d\n",
    311  1.14        pk 			self->dv_xname, error);
    312  1.14        pk 		return;
    313  1.14        pk 	}
    314  1.14        pk 
    315  1.14        pk 	/* Map DMA buffer in CPU addressable space */
    316  1.32   tsutsui 	if ((error = bus_dmamem_map(dmatag, &seg, rseg, memsize,
    317  1.35  christos 				    (void **)&sc->sc_maddr,
    318  1.14        pk 				    BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
    319  1.14        pk 		printf("%s: DMA buffer map error %d\n",
    320  1.14        pk 			sc->sc_dev.dv_xname, error);
    321  1.14        pk 		bus_dmamem_free(dmatag, &seg, rseg);
    322   1.8        pk 		return;
    323   1.8        pk 	}
    324  1.14        pk 
    325  1.14        pk 	/* Load the segment */
    326  1.19   thorpej 	if ((error = bus_dmamap_load(dmatag, sc->sc_dmamap,
    327  1.32   tsutsui 				     sc->sc_maddr, memsize, NULL,
    328  1.19   thorpej 				     BUS_DMA_NOWAIT)) != 0) {
    329  1.14        pk 		printf("%s: DMA buffer map load error %d\n",
    330  1.14        pk 			sc->sc_dev.dv_xname, error);
    331  1.32   tsutsui 		bus_dmamem_unmap(dmatag, sc->sc_maddr, memsize);
    332  1.14        pk 		bus_dmamem_free(dmatag, &seg, rseg);
    333   1.8        pk 		return;
    334   1.8        pk 	}
    335   1.1        pk 
    336  1.32   tsutsui 	wzero(sc->sc_maddr, memsize);
    337   1.1        pk 	sc->bh = (bus_space_handle_t)(sc->sc_maddr);
    338   1.1        pk 
    339   1.1        pk 	/*
    340   1.5        pk 	 * The i82586's 24-bit address space maps to the last 16MB of
    341   1.5        pk 	 * KVA space ().  In addition, the SCP must appear
    342   1.5        pk 	 * at IE_SCP_ADDR within the 24-bit address space,
    343   1.5        pk 	 * i.e. at KVA  IEOB_ADBASE+IE_SCP_ADDR, at the very top of
    344   1.5        pk 	 * kernel space.  We double-map this last page to the first
    345   1.5        pk 	 * page (starting at `maddr') of the memory we allocate to the chip.
    346   1.5        pk 	 * (a side-effect of this double-map is that the ISCP and SCB
    347   1.5        pk 	 * structures also get aliased there, but we ignore this). The
    348   1.5        pk 	 * first page at `maddr' is only used for ISCP, SCB and the aliased
    349  1.29   thorpej 	 * SCP; the actual buffers start at maddr+PAGE_SIZE.
    350   1.5        pk 	 *
    351   1.5        pk 	 * In a picture:
    352   1.1        pk 
    353   1.4        pk 	|---//--- ISCP-SCB-----scp-|--//- buffers -//-|... |iscp-scb-----SCP-|
    354   1.5        pk 	|         |                |                  |    |             |   |
    355  1.29   thorpej 	|         |<---PAGE_SIZE-->|                  |    |<--PAGE_SIZE-+-->|
    356  1.32   tsutsui 	|         |<------------ memsize ------------>|    |       ^     |
    357   1.5        pk 	|         |                                                |     |
    358   1.4        pk 	|         \@maddr                                 (last page dbl mapped)
    359   1.5        pk 	|                                                                |
    360   1.5        pk 	\@IEOB_ADBASE                           @IEOB_ADBASE+IE_SCP_ADDR-+
    361   1.5        pk 
    362   1.5        pk 	 *
    363   1.5        pk 	 */
    364   1.4        pk 
    365   1.8        pk 	/* Double map the SCP */
    366  1.34   thorpej 	if (pmap_extract(pmap_kernel(), (vaddr_t)sc->sc_maddr, &pa) == false)
    367   1.1        pk 		panic("ie pmap_extract");
    368   1.1        pk 
    369   1.1        pk 	pmap_enter(pmap_kernel(), trunc_page(IEOB_ADBASE+IE_SCP_ADDR),
    370  1.10   mycroft 	    pa | PMAP_NC /*| PMAP_IOC*/,
    371  1.12   thorpej 	    VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
    372  1.23     chris 	pmap_update(pmap_kernel());
    373   1.1        pk 
    374   1.8        pk 	/* Map iscp at location 0 (relative to `maddr') */
    375   1.5        pk 	sc->iscp = 0;
    376   1.5        pk 
    377   1.5        pk 	/* scb follows iscp */
    378   1.5        pk 	sc->scb = IE_ISCP_SZ;
    379   1.5        pk 
    380   1.9        pk 	/* scp is at the fixed location IE_SCP_ADDR (modulo the page size) */
    381   1.9        pk 	sc->scp = IE_SCP_ADDR & PGOFSET;
    382   1.5        pk 
    383   1.9        pk 	/* Calculate the 24-bit base of i82586 operations */
    384  1.14        pk 	iebase = (u_long)sc->sc_dmamap->dm_segs[0].ds_addr -
    385  1.14        pk 			(u_long)IEOB_ADBASE;
    386   1.8        pk 	ie_obio_write16(sc, IE_ISCP_SCB(sc->iscp), sc->scb);
    387   1.9        pk 	ie_obio_write24(sc, IE_ISCP_BASE(sc->iscp), iebase);
    388   1.9        pk 	ie_obio_write24(sc, IE_SCP_ISCP(sc->scp), iebase + sc->iscp);
    389   1.1        pk 
    390   1.1        pk 	/*
    391   1.9        pk 	 * Rest of first page is unused (wasted!); the other pages
    392   1.9        pk 	 * are used for buffers.
    393   1.1        pk 	 */
    394  1.29   thorpej 	sc->buf_area = PAGE_SIZE;
    395  1.32   tsutsui 	sc->buf_area_sz = memsize - PAGE_SIZE;
    396   1.9        pk 
    397   1.9        pk 	if (i82586_proberam(sc) == 0) {
    398   1.9        pk 		printf(": memory probe failed\n");
    399   1.9        pk 		return;
    400   1.9        pk 	}
    401   1.1        pk 
    402  1.31        pk 	prom_getether(0, myaddr);
    403   1.1        pk 	i82586_attach(sc, "onboard", myaddr, media, NMEDIA, media[0]);
    404   1.1        pk 
    405   1.4        pk 	/* Establish interrupt channel */
    406   1.4        pk 	ih = bus_intr_establish(oba->oba_bustag,
    407  1.28        pk 				oba->oba_pri, IPL_NET,
    408   1.4        pk 				i82586_intr, sc);
    409   1.1        pk }
    410