Date: Sat, 30 Nov 2002 15:14:19 +0900 (JST) From: Takahashi Yoshihiro <nyan@jp.FreeBSD.org> To: sos@spider.deepcore.dk Cc: current@FreeBSD.ORG Subject: Re: ATA patches for PC98 - Please test! Message-ID: <20021130.151419.112534450.nyan@jp.FreeBSD.org> In-Reply-To: <200211292044.gATKipVT018982@spider.deepcore.dk> References: <200211292044.gATKipVT018982@spider.deepcore.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <200211292044.gATKipVT018982@spider.deepcore.dk>
Soeren Schmidt <sos@spider.deepcore.dk> writes:
> I'm trying to get this into 5.0 (I know its late, but life's tough)
>
> This brings ATA support to the PC98 arch will all bells and whistles.
> --- sys/conf/files 28 Nov 2002 01:17:48 -0000 1.738
> +++ sys/conf/files 28 Nov 2002 20:01:52 -0000
> @@ -290,6 +290,7 @@
> dev/asr/asr.c optional asr pci
> dev/ata/ata-all.c optional ata
> dev/ata/ata-isa.c optional ata isa
> +dev/ata/ata-cbus.c optional ata pc98
This should be 'dev/ata/ata-cbus.c optional ata isa' and moved into
files.pc98.
> --- sys/pc98/conf/GENERIC 31 Oct 2002 12:14:05 -0000 1.220
> +++ sys/pc98/conf/GENERIC 27 Nov 2002 10:06:46 -0000
> @@ -78,11 +78,18 @@
> # Floppy drives
> device fdc
>
> -# IDE controller and disks
> -device wdc 1
> +# ATA and ATAPI devices
> +device ata
> +device atadisk # ATA disk drives
> +device atapicd # ATAPI CDROM drives
> +device atapifd # ATAPI floppy drives
> +device atapist # ATAPI tape drives
> +options ATA_STATIC_ID # Static device numbering
>
> +# IDE controller and disks
> +#device wdc 1
> # ATAPI devices on wdc
> -device wcd 1 #IDE CD-ROM
> +#device wcd 1 #IDE CD-ROM
> #device wfd 1 #IDE Floppy (e.g. LS-120)
> #device wst 1 #IDE Tape (e.g. Travan)
What about GENERIC.hints?
> --- /dev/null Fri Nov 29 21:35:31 2002
> +++ sys/dev/ata/ata-cbus.c Thu Oct 31 19:32:25 2002
> @@ -0,0 +1,270 @@
> +/*-
> + * Copyright (c) 2002 Søren Schmidt <sos@FreeBSD.org>
> + * All rights reserved.
The original author of this file is IMAI Takeshi. Where is his
copyright?
> +static int
> +ata_cbus_attach(device_t dev)
> +{
> + struct ata_cbus_controller *scp = device_get_softc(dev);
> + int rid;
> +
> + /* allocate resources */
> + rid = ATA_IOADDR_RID;
> + scp->io = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, ata_pc98_ports,
> + ATA_IOSIZE, RF_ACTIVE);
> + if (!scp->io)
> + return ENOMEM;
> + isa_load_resourcev(scp->io, ata_pc98_ports, ATA_IOSIZE);
> +
> + rid = ATA_IOADDR_RID + ATA_IOSIZE + 1;
> + scp->altio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
> + rman_get_start(scp->io)+ATA_PC98_ALTOFFSET,
> + ~0, ATA_ALTIOSIZE, RF_ACTIVE);
> + if (!scp->altio)
> + return ENOMEM;
> +
> + rid = ATA_IOADDR_RID + ATA_IOSIZE + ATA_ALTIOSIZE + 1;
> + scp->bankio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
> + ATA_PC98_BANK, ~0,
> + ATA_PC98_BANKIOSIZE, RF_ACTIVE);
> + if (!scp->bankio)
> + return ENOMEM;
> +
> + rid = 0;
> + scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
> + 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
> +
> + scp->current_bank = -1;
> + if (!device_add_child(dev, "ata", 0))
> + return ENOMEM;
> + if (!device_add_child(dev, "ata", 1))
> + return ENOMEM;
> +
> + return bus_generic_attach(dev);
> +}
Where is vaild bank checking code?
And, what about all atapi-* changes? These changes are needed to
support buggy atapi devices.
---
TAKAHASHI Yoshihiro <nyan@FreeBSD.org>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021130.151419.112534450.nyan>
