--- //depot/vendor/freebsd/src/sys/conf/files.pc98 +++ //depot/user/jhb/cleanup/sys/conf/files.pc98 @@ -98,6 +98,8 @@ dev/ed/if_ed_cbus.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/fb/fb.c optional fb | gdc +dev/fdc/fdc.c optional fdc +dev/fdc/fdc_cbus.c optional fdc isa dev/fe/if_fe_cbus.c optional fe isa dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_intel.c optional hwpmc @@ -217,8 +219,6 @@ libkern/umoddi3.c standard pc98/apm/apm_bioscall.S optional apm pc98/cbus/cbus_dma.c optional isa -pc98/cbus/fdc.c optional fdc -pc98/cbus/fdc_cbus.c optional fdc isa pc98/cbus/gdc.c optional gdc pc98/cbus/nmi.c standard pc98/cbus/olpt.c optional olpt --- //depot/vendor/freebsd/src/sys/dev/fdc/fdc.c +++ //depot/user/jhb/cleanup/sys/dev/fdc/fdc.c @@ -82,9 +82,13 @@ #include #include +#ifdef PC98 +#include +#else #include +#include +#endif #include -#include #include @@ -136,33 +140,56 @@ */ static struct fd_type fd_searchlist_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0 } }; static struct fd_type fd_searchlist_12m[] = { +#ifdef PC98 { FDF_5_1200 | FL_AUTO }, + { FDF_5_720 | FL_AUTO }, + { FDF_5_360 | FL_AUTO }, + { FDF_5_640 | FL_AUTO }, + { FDF_5_1230 | FL_AUTO }, +#else + { FDF_5_1200 | FL_AUTO }, { FDF_5_360 | FL_2STEP | FL_AUTO}, +#endif { 0 } }; static struct fd_type fd_searchlist_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0 } }; static struct fd_type fd_searchlist_144m[] = { +#ifdef PC98 + { FDF_3_1440 | FL_AUTO}, + { FDF_3_1200 | FL_AUTO}, + { FDF_3_720 | FL_AUTO}, + { FDF_3_360 | FL_AUTO}, + { FDF_3_640 | FL_AUTO}, + { FDF_3_1230 | FL_AUTO}, +#else { FDF_3_1440 | FL_AUTO}, { FDF_3_720 | FL_AUTO}, +#endif { 0 } }; static struct fd_type fd_searchlist_288m[] = { +#ifndef PC98 { FDF_3_1440 | FL_AUTO }, #if 0 { FDF_3_2880 | FL_AUTO }, /* XXX: probably doesn't work */ #endif { FDF_3_720 | FL_AUTO}, +#endif { 0 } }; @@ -183,7 +210,27 @@ * Internals start here */ +#ifdef PC98 /* registers */ +#define FDSTS 0 /* NEC 765 Main Status Register (R) */ +#define FDDATA 1 /* NEC 765 Data Register (R/W) */ +#define FDCTL 2 /* FD Control Register */ +#define FDC_RST 0x80 /* FDC RESET */ +#define FDC_RDY 0x40 /* force READY */ +#define FDC_DD 0x20 /* FDD Mode Exchange 0:1M 1:640K */ +#define FDC_DMAE 0x10 /* enable floppy DMA */ +#define FDC_MTON 0x08 /* MOTOR ON (when EMTON=1)*/ +#define FDC_TMSK 0x04 /* TIMER MASK */ +#define FDC_TTRG 0x01 /* TIMER TRIGER */ + +#define FDP 3 +#define FDP_EMTON 0x04 /* enable MTON */ +#define FDP_FDDEXC 0x02 /* FDD Mode Exchange 1:1M 0:640K */ +#define FDP_PORTEXC 0x01 /* PORT Exchane 1:1M 0:640K */ + +#define FDEM 4 +#else +/* registers */ #define FDOUT 2 /* Digital Output Register (W) */ #define FDO_FDSEL 0x03 /* floppy device select */ #define FDO_FRST 0x04 /* floppy controller reset */ @@ -197,6 +244,7 @@ #define FDDSR 4 /* Data Rate Select Register (W) */ #define FDDATA 5 /* NEC 765 Data Register (R/W) */ #define FDCTL 7 /* Control Register (W) */ +#endif /* PC98 */ /* * The YE-DATA PC Card floppies use PIO to read in the data rather @@ -219,9 +267,11 @@ #define FDBCDR 0 /* And 1 */ #define FD_YE_DATAPORT 6 /* Drive Data port */ +#ifndef PC98 #define FDI_DCHG 0x80 /* diskette has been changed */ /* requires drive and motor being selected */ /* is cleared by any step pulse to drive */ +#endif /* * We have three private BIO commands. @@ -258,6 +308,9 @@ struct g_provider *fd_provider; device_t dev; struct bio_queue_head fd_bq; +#ifdef PC98 + int pc98_trans; +#endif }; #define FD_NOT_VALID -2 @@ -281,11 +334,19 @@ SYSCTL_INT(_debug_fdc, OID_AUTO, retries, CTLFLAG_RW, &retries, 0, "Number of retries to attempt"); -static int spec1 = 0xaf; +#ifdef PC98 +static int spec1 = NE7_SPEC_1(4, 240); +#else +static int spec1 = NE7_SPEC_1(6, 240); +#endif SYSCTL_INT(_debug_fdc, OID_AUTO, spec1, CTLFLAG_RW, &spec1, 0, "Specification byte one (step-rate + head unload)"); -static int spec2 = 0x10; +#ifdef PC98 +static int spec2 = NE7_SPEC_2(2, 0); +#else +static int spec2 = NE7_SPEC_2(16, 0); +#endif SYSCTL_INT(_debug_fdc, OID_AUTO, spec2, CTLFLAG_RW, &spec2, 0, "Specification byte two (head load time + no-dma)"); @@ -335,12 +396,14 @@ fdregwr(fdc, FDCTL, v); } +#ifndef PC98 static void fdout_wr(struct fdc_data *fdc, u_int8_t v) { fdregwr(fdc, FDOUT, v); } +#endif static u_int8_t fdsts_rd(struct fdc_data *fdc) @@ -349,12 +412,14 @@ return fdregrd(fdc, FDSTS); } +#ifndef PC98 static void fddsr_wr(struct fdc_data *fdc, u_int8_t v) { fdregwr(fdc, FDDSR, v); } +#endif static void fddata_wr(struct fdc_data *fdc, u_int8_t v) @@ -370,12 +435,14 @@ return fdregrd(fdc, FDDATA); } +#ifndef PC98 static u_int8_t fdin_rd(struct fdc_data *fdc) { return fdregrd(fdc, FDCTL); } +#endif /* * Magic pseudo-DMA initialization for YE FDC. Sets count and @@ -502,11 +569,90 @@ return (0); } +#ifdef PC98 +static void fd_motor(struct fd_data *fd, int turnon); + +static int pc98_trans = 0; /* 0 : HD , 1 : DD , 2 : 1.44 */ +static int pc98_trans_prev = -1; + +static void +set_density(struct fdc_data *fdc) +{ + /* always motor on */ + fdregwr(fdc, FDP, (pc98_trans != 1 ? FDP_FDDEXC : 0) | FDP_PORTEXC); + DELAY(100); + fdctl_wr(fdc, FDC_RST | FDC_DMAE); + /* in the case of note W, always inhibit 100ms timer */ +} + +static int +pc98_fd_check_ready(struct fd_data *fd) +{ + struct fdc_data *fdc = fd->fdc; + int retry = 0, status; + int fdu = device_get_unit(fd->dev); + + while (retry++ < 30000) { + fd_motor(fd, 1); + fdc_out(fdc, NE7CMD_SENSED); /* Sense Drive Status */ + DELAY(100); + fdc_out(fdc, fdu); /* Drive number */ + DELAY(100); + if ((fdc_in(fdc, &status) == 0) && (status & NE7_ST3_RD)) { + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); + DELAY(10); + return (0); + } + } + return (-1); +} + static void +pc98_fd_check_type(struct fd_data *fd, int unit) +{ + struct fdc_data *fdc; + + if (fd->type != FDT_NONE || unit < 0 || unit > 3) + return; + + fdc = fd->fdc; + + /* Look up what the BIOS thinks we have. */ + if (!((PC98_SYSTEM_PARAMETER(0x55c) >> unit) & 0x01)) { + fd->type = FDT_NONE; + return; + } + if ((PC98_SYSTEM_PARAMETER(0x5ae) >> unit) & 0x01) { + /* Check 3mode I/F */ + fd->pc98_trans = 0; + fdregwr(fdc, FDEM, (unit << 5) | 0x10); + if (!(fdregrd(fdc, FDEM) & 0x01)) { + fd->type = FDT_144M; + return; + } + device_printf(fd->dev, + "Warning: can't control 3mode I/F, fallback to 2mode.\n"); + } + + fd->type = FDT_12M; +} +#endif /* PC98 */ + +static void fdc_reset(struct fdc_data *fdc) { int i, r[10]; +#ifdef PC98 + set_density(fdc); + if (pc98_machine_type & M_EPSON_PC98) + fdctl_wr(fdc, FDC_RST | FDC_RDY | FDC_DD | FDC_MTON); + else + fdctl_wr(fdc, FDC_RST | FDC_RDY | FDC_DMAE | FDC_MTON); + DELAY(200); + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); + DELAY(10); +#else if (fdc->fdct == FDC_ENHANCED) { /* Try a software reset, default precomp, and 500 kb/s */ fddsr_wr(fdc, I8207X_DSR_SR); @@ -519,6 +665,7 @@ } DELAY(100); fdout_wr(fdc, fdc->fdout); +#endif /* XXX after a reset, silently believe the FDC will accept commands */ if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, spec1, spec2, 0)) @@ -612,6 +759,7 @@ return ret; } +#ifndef PC98 /* * Select this drive */ @@ -649,6 +797,7 @@ if (once) wakeup(&fd->fdc->head); } +#endif static void fd_motor(struct fd_data *fd, int turnon) @@ -659,6 +808,11 @@ /* mtx_assert(&fdc->fdc_mtx, MA_OWNED); */ +#ifdef PC98 + fdregwr(fdc, FDP, (pc98_trans != 1 ? FDP_FDDEXC : 0) | FDP_PORTEXC); + DELAY(10); + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); +#else if (turnon) { fd->flags |= FD_MOTORWAIT; fdc->fdout |= (FDO_MOEN0 << fd->fdsu); @@ -669,6 +823,7 @@ fdc->fdout &= ~(FDO_MOEN0 << fd->fdsu); } fdout_wr(fdc, fdc->fdout); +#endif } static void @@ -836,15 +991,41 @@ } /* Select drive, setup params */ +#ifdef PC98 + pc98_trans = fd->ft->trans; + if (pc98_trans_prev != pc98_trans) { + int i; + + set_density(fdc); + for (i = 0; i < 10; i++) { + outb(0x5f, 0); + outb(0x5f, 0); + } + pc98_trans_prev = pc98_trans; + } + if (pc98_trans != fd->pc98_trans) { + if (fd->type == FDT_144M) { + fdregwr(fdc, FDEM, + (device_get_unit(fd->dev) << 5) | 0x10 | + (pc98_trans >> 1)); + outb(0x5f, 0); + outb(0x5f, 0); + } + fd->pc98_trans = pc98_trans; + } +#else fd_select(fd); if (fdc->fdct == FDC_ENHANCED) fddsr_wr(fdc, fd->ft->trans); else fdctl_wr(fdc, fd->ft->trans); +#endif if (bp->bio_cmd & BIO_PROBE) { if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) && +#ifndef PC98 !(fdin_rd(fdc) & FDI_DCHG) && +#endif !(fd->flags & FD_EMPTY)) || fd_probe_disk(fd, &need_recal) == 0) return (fdc_biodone(fdc, 0)); @@ -857,6 +1038,7 @@ if (fd->flags & FD_EMPTY) return (fdc_biodone(fdc, ENXIO)); +#ifndef PC98 /* Check if we lost our media */ if (fdin_rd(fdc) & FDI_DCHG) { if (debugflags & 0x40) @@ -874,9 +1056,10 @@ g_topology_unlock(); return (fdc_biodone(fdc, ENXIO)); } +#endif /* Check if the floppy is write-protected */ - if(bp->bio_cmd & (BIO_FMT | BIO_WRITE)) { + if (bp->bio_cmd & (BIO_FMT | BIO_WRITE)) { retry_line = __LINE__; if(fdc_sense_drive(fdc, &st3) != 0) return (1); @@ -907,6 +1090,9 @@ if ((need_recal & (1 << fd->fdsu)) || (cylinder == 0 && fd->track != 0) || fdc->retry > 2) { +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif retry_line = __LINE__; if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) return (1); @@ -928,6 +1114,9 @@ * SEEK to where we want to be */ if (cylinder != fd->track) { +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif retry_line = __LINE__; if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, descyl, 0)) return (1); @@ -1230,6 +1419,7 @@ if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) goto done; /* XXX */ *recal |= (1 << fd->fdsu); +#ifndef PC98 if (fdin_rd(fdc) & FDI_DCHG) { if (debugflags & 0x40) printf("Empty in probe\n"); @@ -1237,6 +1427,9 @@ fd->flags |= FD_EMPTY; mtx_unlock(&fdc->fdc_mtx); } else { +#else + { +#endif if (fdc_sense_drive(fdc, &st3) != 0) goto done; if (debugflags & 0x40) @@ -1372,7 +1565,12 @@ } else { if (debugflags & 0x40) { device_printf(fd->dev, - "autoselected %d KB medium\n", fd->ft->size / 2); + "autoselected %d KB medium\n", +#ifdef PC98 + (128 << (fd->ft->secsize)) * fd->ft->size / 1024); +#else + fd->ft->size / 2); +#endif fdprinttype(fd->ft); } return (0); @@ -1425,6 +1623,10 @@ busy = 0; if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) { +#ifdef PC98 + if (pc98_fd_check_ready(fd) == -1) + return (ENXIO); +#endif if (fdmisccmd(fd, BIO_PROBE, NULL)) return (ENXIO); if (fd->flags & FD_EMPTY) @@ -1494,6 +1696,10 @@ fd = pp->geom->softc; +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif + switch (cmd) { case FD_GTYPE: /* get drive type */ *(struct fd_type *)data = *fd->ft; @@ -1661,6 +1867,12 @@ { int ic_type, part_id; +#ifdef PC98 + /* See if it can handle a command. */ + if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, NE7_SPEC_1(4, 240), + NE7_SPEC_2(2, 0), 0)) + return (ENXIO); +#else /* * A status value of 0xff is very unlikely, but not theoretically * impossible, but it is far more likely to indicate an empty bus. @@ -1686,8 +1898,10 @@ return (ENXIO); /* Then, see if it can handle a command. */ - if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, 0xaf, 0x1e, 0)) + if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, NE7_SPEC_1(6, 240), + NE7_SPEC_2(31, 0), 0)) return (ENXIO); +#endif /* * Try to identify the chip. @@ -1749,7 +1963,11 @@ mtx_unlock(&fdc->fdc_mtx); /* reset controller, turn motor off */ +#ifdef PC98 + fdc_reset(fdc); +#else fdout_wr(fdc, 0); +#endif if (!(fdc->flags & FDC_NODMA)) isa_dma_release(fdc->dmachan); @@ -1823,7 +2041,11 @@ mtx_init(&fdc->fdc_mtx, "fdc lock", NULL, MTX_DEF); /* reset controller, turn motor off, clear fdout mirror reg */ +#ifdef PC98 + fdc_reset(fdc); +#else fdout_wr(fdc, fdc->fdout = 0); +#endif bioq_init(&fdc->head); kproc_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0, @@ -1877,8 +2099,11 @@ static int fd_probe(device_t dev) { - int i, unit; + int unit; +#ifndef PC98 + int i; u_int st0, st3; +#endif struct fd_data *fd; struct fdc_data *fdc; int fdsu; @@ -1905,7 +2130,9 @@ fd->type = type; } -#if (defined(__i386__) && !defined(PC98)) || defined(__amd64__) +#ifdef PC98 + pc98_fd_check_type(fd, unit); +#elif defined(__i386__) || defined(__amd64__) if (fd->type == FDT_NONE && (unit == 0 || unit == 1)) { /* Look up what the BIOS thinks we have. */ if (unit == 0) @@ -1920,6 +2147,7 @@ if (fd->type == FDT_NONE) return (ENXIO); +#ifndef PC98 /* mtx_lock(&fdc->fdc_mtx); */ @@ -1972,11 +2200,20 @@ if ((flags & FD_NO_PROBE) == 0 && (st0 & NE7_ST0_EC) != 0) /* no track 0 -> no drive present */ return (ENXIO); +#endif /* PC98 */ done: switch (fd->type) { +#ifdef PC98 + case FDT_144M: + device_set_desc(dev, "1.44M FDD"); + break; case FDT_12M: + device_set_desc(dev, "1M/640K FDD"); + break; +#else + case FDT_12M: device_set_desc(dev, "1200-KB 5.25\" drive"); break; case FDT_144M: @@ -1991,6 +2228,7 @@ case FDT_720K: device_set_desc(dev, "720-KB 3.5\" drive"); break; +#endif default: return (ENXIO); } @@ -1998,6 +2236,9 @@ fd->fdc = fdc; fd->fdsu = fdsu; fd->options = 0; +#ifdef PC98 + fd->pc98_trans = 0; +#endif callout_init_mtx(&fd->toffhandle, &fd->fdc->fdc_mtx, 0); /* initialize densities for subdevices */ --- /dev/null +++ //depot/user/jhb/cleanup/sys/dev/fdc/fdc_cbus.c @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2004 TAKAHASHI Yoshihiro + * 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, + * without modification, immediately at the beginning of the file. + * 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 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. + */ + +#include +__FBSDID("$FreeBSD: head/sys/pc98/cbus/fdc_cbus.c 146216 2005-05-14 10:51:16Z nyan $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +static bus_addr_t fdc_iat[] = {0, 2, 4}; + +static int +fdc_cbus_alloc_resources(device_t dev, struct fdc_data *fdc) +{ + struct resource *res; + int i, rid; + + fdc->fdc_dev = dev; + rid = 0; + res = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, fdc_iat, 3, + RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "cannot reserve I/O port range\n"); + return (ENXIO); + } + isa_load_resourcev(res, fdc_iat, 3); + for (i = 0; i < 3; i++) { + fdc->resio[i] = res; + fdc->ridio[i] = rid; + fdc->ioff[i] = i; + fdc->ioh[i] = rman_get_bushandle(res); + } + fdc->iot = rman_get_bustag(res); + + rid = 3; + bus_set_resource(dev, SYS_RES_IOPORT, rid, IO_FDPORT, 1); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "cannot reserve I/O port range\n"); + return (ENXIO); + } + fdc->resio[3] = res; + fdc->ridio[3] = rid; + fdc->ioff[3] = 0; + fdc->ioh[3] = rman_get_bushandle(res); + /* XXX: Reuses fdc->iot */ + + rid = 4; + bus_set_resource(dev, SYS_RES_IOPORT, rid, 0x4be, 1); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "cannot reserve I/O port range\n"); + return (ENXIO); + } + fdc->resio[4] = res; + fdc->ridio[4] = rid; + fdc->ioff[4] = 0; + fdc->ioh[4] = rman_get_bushandle(res); + /* XXX: Reuses fdc->iot */ + + fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &fdc->rid_irq, + RF_ACTIVE); + if (fdc->res_irq == NULL) { + device_printf(dev, "cannot reserve interrupt line\n"); + return (ENXIO); + } + + if ((fdc->flags & FDC_NODMA) == 0) { + fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &fdc->rid_drq, RF_ACTIVE); + if (fdc->res_drq == NULL) { + device_printf(dev, "cannot reserve DMA request line\n"); + return (ENXIO); + } + fdc->dmachan = rman_get_start(fdc->res_drq); + } + + return (0); +} + +static int +fdc_cbus_probe(device_t dev) +{ + int error; + struct fdc_data *fdc; + + fdc = device_get_softc(dev); + + /* Check pnp ids */ + if (isa_get_vendorid(dev)) + return (ENXIO); + + /* Attempt to allocate our resources for the duration of the probe */ + error = fdc_cbus_alloc_resources(dev, fdc); + if (error == 0) + error = fdc_initial_reset(dev, fdc); + + fdc_release_resources(fdc); + return (error); +} + +static int +fdc_cbus_attach(device_t dev) +{ + struct fdc_data *fdc; + int error; + + fdc = device_get_softc(dev); + error = fdc_cbus_alloc_resources(dev, fdc); + if (error == 0) + error = fdc_attach(dev); + if (error == 0) + error = fdc_hints_probe(dev); + if (error) + fdc_release_resources(fdc); + return (error); +} + +static device_method_t fdc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fdc_cbus_probe), + DEVMETHOD(device_attach, fdc_cbus_attach), + DEVMETHOD(device_detach, fdc_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, fdc_print_child), + DEVMETHOD(bus_read_ivar, fdc_read_ivar), + DEVMETHOD(bus_write_ivar, fdc_write_ivar), + /* Our children never use any other bus interface methods. */ + + { 0, 0 } +}; + +static driver_t fdc_driver = { + "fdc", + fdc_methods, + sizeof(struct fdc_data) +}; + +DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); --- //depot/vendor/freebsd/src/sys/dev/fdc/fdcvar.h +++ //depot/user/jhb/cleanup/sys/dev/fdc/fdcvar.h @@ -49,7 +49,9 @@ #define FDC_KTHREAD_ALIVE 0x2000 /* worker thread is alive */ struct fd_data *fd; /* The active drive */ int retry; +#ifndef PC98 int fdout; /* mirror of the w/o digital output reg */ +#endif u_int status[7]; /* copy of the registers */ enum fdc_type fdct; /* chip version of FDC */ int fdc_errs; /* number of logged errors */ --- //depot/vendor/freebsd/src/sys/modules/fdc/Makefile +++ //depot/user/jhb/cleanup/sys/modules/fdc/Makefile @@ -2,11 +2,10 @@ KMOD= fdc +.PATH: ${.CURDIR}/../../dev/fdc .if ${MACHINE} == "pc98" -.PATH: ${.CURDIR}/../../pc98/cbus SRCS= fdc.c fdc_cbus.c .else -.PATH: ${.CURDIR}/../../dev/fdc SRCS= fdc.c fdc_isa.c fdc_pccard.c .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" SRCS+= opt_acpi.h acpi_if.h fdc_acpi.c