| @@ -1,33 +1,33 @@ | | | @@ -1,33 +1,33 @@ |
1 | /* $NetBSD: svwsata.c,v 1.21 2018/06/01 16:12:01 macallan Exp $ */ | | 1 | /* $NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2005 Mark Kettenis | | 4 | * Copyright (c) 2005 Mark Kettenis |
5 | * | | 5 | * |
6 | * Permission to use, copy, modify, and distribute this software for any | | 6 | * Permission to use, copy, modify, and distribute this software for any |
7 | * purpose with or without fee is hereby granted, provided that the above | | 7 | * purpose with or without fee is hereby granted, provided that the above |
8 | * copyright notice and this permission notice appear in all copies. | | 8 | * copyright notice and this permission notice appear in all copies. |
9 | * | | 9 | * |
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 | */ | | 17 | */ |
18 | | | 18 | |
19 | #include <sys/cdefs.h> | | 19 | #include <sys/cdefs.h> |
20 | __KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.21 2018/06/01 16:12:01 macallan Exp $"); | | 20 | __KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $"); |
21 | | | 21 | |
22 | #include <sys/param.h> | | 22 | #include <sys/param.h> |
23 | #include <sys/systm.h> | | 23 | #include <sys/systm.h> |
24 | | | 24 | |
25 | #include <dev/ata/atareg.h> | | 25 | #include <dev/ata/atareg.h> |
26 | #include <dev/ata/satareg.h> | | 26 | #include <dev/ata/satareg.h> |
27 | #include <dev/ata/satavar.h> | | 27 | #include <dev/ata/satavar.h> |
28 | #include <dev/pci/pcivar.h> | | 28 | #include <dev/pci/pcivar.h> |
29 | #include <dev/pci/pcidevs.h> | | 29 | #include <dev/pci/pcidevs.h> |
30 | #include <dev/pci/pciidereg.h> | | 30 | #include <dev/pci/pciidereg.h> |
31 | #include <dev/pci/pciidevar.h> | | 31 | #include <dev/pci/pciidevar.h> |
32 | #include <dev/pci/pciide_svwsata_reg.h> | | 32 | #include <dev/pci/pciide_svwsata_reg.h> |
33 | | | 33 | |
| @@ -312,29 +312,28 @@ svwsata_mapchan(struct pciide_channel *c | | | @@ -312,29 +312,28 @@ svwsata_mapchan(struct pciide_channel *c |
312 | goto bad; | | 312 | goto bad; |
313 | } | | 313 | } |
314 | | | 314 | |
315 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, | | 315 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, |
316 | (wdc_cp->ch_channel << 8) + SVWSATA_SICR1, | | 316 | (wdc_cp->ch_channel << 8) + SVWSATA_SICR1, |
317 | bus_space_read_4(sc->sc_ba5_st, sc->sc_ba5_sh, | | 317 | bus_space_read_4(sc->sc_ba5_st, sc->sc_ba5_sh, |
318 | (wdc_cp->ch_channel << 8) + SVWSATA_SICR1) | | 318 | (wdc_cp->ch_channel << 8) + SVWSATA_SICR1) |
319 | & ~0x00040000); | | 319 | & ~0x00040000); |
320 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, | | 320 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, |
321 | (wdc_cp->ch_channel << 8) + SVWSATA_SERROR, 0xffffffff); | | 321 | (wdc_cp->ch_channel << 8) + SVWSATA_SERROR, 0xffffffff); |
322 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, | | 322 | bus_space_write_4(sc->sc_ba5_st, sc->sc_ba5_sh, |
323 | (wdc_cp->ch_channel << 8) + SVWSATA_SIM, 0); | | 323 | (wdc_cp->ch_channel << 8) + SVWSATA_SIM, 0); |
324 | | | 324 | |
325 | #ifndef notyet | | | |
326 | cp->ata_channel.ch_flags |= ATACH_DMA_BEFORE_CMD; | | 325 | cp->ata_channel.ch_flags |= ATACH_DMA_BEFORE_CMD; |
327 | #endif | | 326 | |
328 | wdcattach(wdc_cp); | | 327 | wdcattach(wdc_cp); |
329 | return; | | 328 | return; |
330 | | | 329 | |
331 | bad: | | 330 | bad: |
332 | cp->ata_channel.ch_flags |= ATACH_DISABLED; | | 331 | cp->ata_channel.ch_flags |= ATACH_DISABLED; |
333 | } | | 332 | } |
334 | | | 333 | |
335 | int | | 334 | int |
336 | svwsata_intr(void *arg) | | 335 | svwsata_intr(void *arg) |
337 | { | | 336 | { |
338 | struct pciide_softc *sc = arg; | | 337 | struct pciide_softc *sc = arg; |
339 | struct pciide_channel *cp; | | 338 | struct pciide_channel *cp; |
340 | struct ata_channel *wdc_cp; | | 339 | struct ata_channel *wdc_cp; |