Date: Mon, 19 Mar 2007 14:40:50 +1100 From: Antony Mawer <fbsd-questions@mawer.org> To: jlc415@gmail.com Cc: Garrett Cooper <youshi10@u.washington.edu>, freebsd-questions@freebsd.org Subject: Re: Can't see ATA drives with new install Message-ID: <45FE0642.7030603@mawer.org> In-Reply-To: <1fe953880703181355r2e1a98b5wd6162c00660bfa0f@mail.gmail.com> References: <1fe953880703170340l552b1fc1ge244469667a2bb3b@mail.gmail.com> <1fe953880703171553x68700a34gcb473e3d46d0c0fc@mail.gmail.com> <45FC7552.9040409@u.washington.edu> <1fe953880703171634l2ea482c3x9d26b807bcf83df6@mail.gmail.com> <45FC8680.4060502@u.washington.edu> <1fe953880703181355r2e1a98b5wd6162c00660bfa0f@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------000006000801080505080104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 19/03/2007 7:55 AM, jlc415@gmail.com wrote: > My kernel config already includes all that. > > Just installed OpenBSD, and the other drives work just fine. I guess > that's my OS. > > Quite disappointing that FreeBSD is actually behind in terms of > hardware support, particularly for a relatively popular motherboard. > > On 3/18/07, Garrett Cooper <youshi10@u.washington.edu> wrote: >> jlc415@gmail.com wrote: >> > It's an Intel DG965WH; Core 2 Duo CPU. >> > You may want to try the attached backport of support for the onboard Marvell IDE controller I posted to -hardware recently. The patch is against 6.2-RELEASE, and adds support for the onboard Marvell IDE controller that is present on many Intel 965-based boards. To apply: cd /usr/src patch < marvell_pata.diff make buildkernel && make installkernel And you should be right to go. --Antony --------------000006000801080505080104 Content-Type: text/plain; name="marvell_pata.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="marvell_pata.diff" --- sys/dev/ata/ata-chipset.c.orig Sun Mar 11 18:33:13 2007 +++ sys/dev/ata/ata-chipset.c Sun Mar 11 18:33:42 2007 @@ -105,14 +105,17 @@ static void ata_jmicron_reset(device_t dev); static void ata_jmicron_dmainit(device_t dev); static void ata_jmicron_setmode(device_t dev, int mode); -static int ata_marvell_chipinit(device_t dev); -static int ata_marvell_allocate(device_t dev); -static int ata_marvell_status(device_t dev); -static int ata_marvell_begin_transaction(struct ata_request *request); -static int ata_marvell_end_transaction(struct ata_request *request); -static void ata_marvell_reset(device_t dev); -static void ata_marvell_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); -static void ata_marvell_dmainit(device_t dev); +static int ata_marvell_pata_chipinit(device_t dev); +static int ata_marvell_pata_allocate(device_t dev); +static void ata_marvell_pata_setmode(device_t dev, int mode); +static int ata_marvell_edma_chipinit(device_t dev); +static int ata_marvell_edma_allocate(device_t dev); +static int ata_marvell_edma_status(device_t dev); +static int ata_marvell_edma_begin_transaction(struct ata_request *request); +static int ata_marvell_edma_end_transaction(struct ata_request *request); +static void ata_marvell_edma_reset(device_t dev); +static void ata_marvell_edma_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); +static void ata_marvell_edma_dmainit(device_t dev); static int ata_national_chipinit(device_t dev); static void ata_national_setmode(device_t dev, int mode); static int ata_nvidia_chipinit(device_t dev); @@ -2309,12 +2312,14 @@ struct ata_pci_controller *ctlr = device_get_softc(dev); struct ata_chip_id *idx; static struct ata_chip_id ids[] = - {{ ATA_M88SX5040, 0, 4, MV5XXX, ATA_SA150, "88SX5040" }, - { ATA_M88SX5041, 0, 4, MV5XXX, ATA_SA150, "88SX5041" }, - { ATA_M88SX5080, 0, 8, MV5XXX, ATA_SA150, "88SX5080" }, - { ATA_M88SX5081, 0, 8, MV5XXX, ATA_SA150, "88SX5081" }, - { ATA_M88SX6041, 0, 4, MV6XXX, ATA_SA300, "88SX6041" }, - { ATA_M88SX6081, 0, 8, MV6XXX, ATA_SA300, "88SX6081" }, + {{ ATA_M88SX5040, 0, 4, MV50XX, ATA_SA150, "88SX5040" }, + { ATA_M88SX5041, 0, 4, MV50XX, ATA_SA150, "88SX5041" }, + { ATA_M88SX5080, 0, 8, MV50XX, ATA_SA150, "88SX5080" }, + { ATA_M88SX5081, 0, 8, MV50XX, ATA_SA150, "88SX5081" }, + { ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" }, + { ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" }, + { ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" }, + { ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -2325,12 +2330,62 @@ idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; - ctlr->chipinit = ata_marvell_chipinit; + switch (ctlr->chip->cfg2) { + case MV50XX: + case MV60XX: + ctlr->chipinit = ata_marvell_edma_chipinit; + break; + case MV61XX: + ctlr->chipinit = ata_marvell_pata_chipinit; + break; + } + return 0; +} + +static int +ata_marvell_pata_chipinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + + if (ata_setup_interrupt(dev)) + return ENXIO; + + ctlr->allocate = ata_marvell_pata_allocate; + ctlr->setmode = ata_marvell_pata_setmode; + ctlr->channels = ctlr->chip->cfg1; return 0; } static int -ata_marvell_chipinit(device_t dev) +ata_marvell_pata_allocate(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + /* setup the usual register normal pci style */ + if (ata_pci_allocate(dev)) + return ENXIO; + + /* dont use 32 bit PIO transfers */ + ch->flags |= ATA_USE_16BIT; + + return 0; +} + +static void +ata_marvell_pata_setmode(device_t dev, int mode) +{ + device_t gparent = GRANDPARENT(dev); + struct ata_pci_controller *ctlr = device_get_softc(gparent); + struct ata_device *atadev = device_get_softc(dev); + + mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma); + mode = ata_check_80pin(dev, mode); + if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) + atadev->mode = mode; +} + +static int +ata_marvell_edma_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); @@ -2349,9 +2404,9 @@ /* mask all PCI interrupts */ ATA_OUTL(ctlr->r_res1, 0x01d5c, 0x00000000); - ctlr->allocate = ata_marvell_allocate; - ctlr->reset = ata_marvell_reset; - ctlr->dmainit = ata_marvell_dmainit; + ctlr->allocate = ata_marvell_edma_allocate; + ctlr->reset = ata_marvell_edma_reset; + ctlr->dmainit = ata_marvell_edma_dmainit; ctlr->setmode = ata_sata_setmode; ctlr->channels = ctlr->chip->cfg1; @@ -2377,7 +2432,7 @@ } static int -ata_marvell_allocate(device_t dev) +ata_marvell_edma_allocate(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -2399,7 +2454,7 @@ /* set SATA resources */ switch (ctlr->chip->cfg2) { - case MV5XXX: + case MV50XX: ch->r_io[ATA_SSTATUS].res = ctlr->r_res1; ch->r_io[ATA_SSTATUS].offset = 0x00100 + ATA_MV_HOST_BASE(ch); ch->r_io[ATA_SERROR].res = ctlr->r_res1; @@ -2407,7 +2462,7 @@ ch->r_io[ATA_SCONTROL].res = ctlr->r_res1; ch->r_io[ATA_SCONTROL].offset = 0x00108 + ATA_MV_HOST_BASE(ch); break; - case MV6XXX: + case MV60XX: ch->r_io[ATA_SSTATUS].res = ctlr->r_res1; ch->r_io[ATA_SSTATUS].offset = 0x02300 + ATA_MV_EDMA_BASE(ch); ch->r_io[ATA_SERROR].res = ctlr->r_res1; @@ -2422,9 +2477,9 @@ ch->flags |= ATA_NO_SLAVE; ch->flags |= ATA_USE_16BIT; /* XXX SOS needed ? */ ata_generic_hw(dev); - ch->hw.begin_transaction = ata_marvell_begin_transaction; - ch->hw.end_transaction = ata_marvell_end_transaction; - ch->hw.status = ata_marvell_status; + ch->hw.begin_transaction = ata_marvell_edma_begin_transaction; + ch->hw.end_transaction = ata_marvell_edma_end_transaction; + ch->hw.status = ata_marvell_edma_status; /* disable the EDMA machinery */ ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000002); @@ -2467,7 +2522,7 @@ } static int -ata_marvell_status(device_t dev) +ata_marvell_edma_status(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -2521,7 +2576,7 @@ /* must be called with ATA channel locked and state_mtx held */ static int -ata_marvell_begin_transaction(struct ata_request *request) +ata_marvell_edma_begin_transaction(struct ata_request *request) { struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); @@ -2613,7 +2668,7 @@ /* must be called with ATA channel locked and state_mtx held */ static int -ata_marvell_end_transaction(struct ata_request *request) +ata_marvell_edma_end_transaction(struct ata_request *request) { struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev)); struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); @@ -2667,7 +2722,7 @@ } static void -ata_marvell_reset(device_t dev) +ata_marvell_edma_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -2694,7 +2749,8 @@ } static void -ata_marvell_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +ata_marvell_edma_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, + int error) { struct ata_dmasetprd_args *args = xsc; struct ata_marvell_dma_prdentry *prd = args->dmatab; @@ -2712,14 +2768,14 @@ } static void -ata_marvell_dmainit(device_t dev) +ata_marvell_edma_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); ata_dmainit(dev); if (ch->dma) { /* note start and stop are not used here */ - ch->dma->setprd = ata_marvell_dmasetprd; + ch->dma->setprd = ata_marvell_edma_dmasetprd; } } --- sys/dev/ata/ata-pci.h 2006/09/30 14:51:49 1.49.2.10 +++ sys/dev/ata/ata-pci.h 2007/01/04 16:09:11 1.73 @@ -187,6 +188,8 @@ struct ata_connect_task { #define ATA_M88SX5081 0x508111ab #define ATA_M88SX6041 0x604111ab #define ATA_M88SX6081 0x608111ab +#define ATA_M88SX6101 0x610111ab +#define ATA_M88SX6145 0x614511ab #define ATA_MICRON_ID 0x1042 #define ATA_MICRON_RZ1000 0x10001042 @@ -364,8 +367,9 @@ struct ata_connect_task { #define HPT374 3 #define HPTOLD 0x01 -#define MV5XXX 5 -#define MV6XXX 6 +#define MV50XX 50 +#define MV60XX 60 +#define MV61XX 61 #define PROLD 0 #define PRNEW 1 --------------000006000801080505080104--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45FE0642.7030603>