diff options
author | grehan <grehan@FreeBSD.org> | 2005-04-01 03:28:55 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2005-04-01 03:28:55 +0000 |
commit | a6baad1fc1a9dd81496feaa3b9c2d6e293db7645 (patch) | |
tree | 98ce826e414bb142bfe86a522d0dcb4e7b999d5e /sys/powerpc | |
parent | 33abdc3f0d6ec209d78fdcb6b6552cea4e3d92d8 (diff) | |
download | FreeBSD-src-a6baad1fc1a9dd81496feaa3b9c2d6e293db7645.zip FreeBSD-src-a6baad1fc1a9dd81496feaa3b9c2d6e293db7645.tar.gz |
Introduce channel-level setmode newbus method.
Thanks to sos for the code re-org that allowed this.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/powermac/ata_kauai.c | 12 | ||||
-rw-r--r-- | sys/powerpc/powermac/ata_macio.c | 13 | ||||
-rw-r--r-- | sys/powerpc/psim/ata_iobus.c | 13 |
3 files changed, 38 insertions, 0 deletions
diff --git a/sys/powerpc/powermac/ata_kauai.c b/sys/powerpc/powermac/ata_kauai.c index c74b579..4c03de7 100644 --- a/sys/powerpc/powermac/ata_kauai.c +++ b/sys/powerpc/powermac/ata_kauai.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/ata.h> #include <dev/ata/ata-all.h> +#include <ata_if.h> #include <dev/ofw/openfirm.h> @@ -69,6 +70,7 @@ __FBSDID("$FreeBSD$"); * Define the kauai pci bus attachment. */ static int ata_kauai_probe(device_t dev); +static void ata_kauai_setmode(device_t parent, device_t dev); static device_method_t ata_kauai_methods[] = { /* Device interface */ @@ -79,6 +81,8 @@ static device_method_t ata_kauai_methods[] = { DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), + /* ATA interface */ + DEVMETHOD(ata_setmode, ata_kauai_setmode), { 0, 0 } }; @@ -183,3 +187,11 @@ ata_kauai_probe(device_t dev) return (ata_probe(dev)); } +static void +ata_kauai_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* TODO bang kauai speed register */ + atadev->mode = ATA_PIO; +} diff --git a/sys/powerpc/powermac/ata_macio.c b/sys/powerpc/powermac/ata_macio.c index 9be8399..3375dac 100644 --- a/sys/powerpc/powermac/ata_macio.c +++ b/sys/powerpc/powermac/ata_macio.c @@ -46,6 +46,7 @@ #include <sys/rman.h> #include <sys/ata.h> #include <dev/ata/ata-all.h> +#include <ata_if.h> #include <dev/ofw/ofw_bus.h> @@ -63,12 +64,15 @@ * Define the macio ata bus attachment. */ static int ata_macio_probe(device_t dev); +static void ata_macio_setmode(device_t parent, device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_attach), + /* ATA interface */ + DEVMETHOD(ata_setmode, ata_macio_setmode), { 0, 0 } }; @@ -120,3 +124,12 @@ ata_macio_probe(device_t dev) return (ata_probe(dev)); } +static void +ata_macio_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* TODO bang macio speed register */ + atadev->mode = ATA_PIO; +} + diff --git a/sys/powerpc/psim/ata_iobus.c b/sys/powerpc/psim/ata_iobus.c index 60d0410..866bf0e 100644 --- a/sys/powerpc/psim/ata_iobus.c +++ b/sys/powerpc/psim/ata_iobus.c @@ -46,6 +46,7 @@ #include <sys/rman.h> #include <sys/ata.h> #include <dev/ata/ata-all.h> +#include <ata_if.h> #include <dev/ofw/openfirm.h> #include <powerpc/psim/iobusvar.h> @@ -211,6 +212,7 @@ ata_iobus_release_resource(device_t dev, device_t child, int type, int rid, */ static int ata_iobus_sub_probe(device_t dev); +static void ata_iobus_sub_setmode(device_t parent, device_t dev); static device_method_t ata_iobus_sub_methods[] = { /* Device interface */ @@ -219,6 +221,8 @@ static device_method_t ata_iobus_sub_methods[] = { DEVMETHOD(device_detach, ata_detach), DEVMETHOD(device_resume, ata_resume), + /* ATA interface */ + DEVMETHOD(ata_setmode, ata_iobus_sub_setmode), { 0, 0 } }; @@ -242,3 +246,12 @@ ata_iobus_sub_probe(device_t dev) return ata_probe(dev); } + +static void +ata_iobus_sub_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* Only ever PIO mode here... */ + atadev->mode = ATA_PIO; +} |