summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2005-04-01 03:28:55 +0000
committergrehan <grehan@FreeBSD.org>2005-04-01 03:28:55 +0000
commita6baad1fc1a9dd81496feaa3b9c2d6e293db7645 (patch)
tree98ce826e414bb142bfe86a522d0dcb4e7b999d5e /sys/powerpc/powermac
parent33abdc3f0d6ec209d78fdcb6b6552cea4e3d92d8 (diff)
downloadFreeBSD-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/powermac')
-rw-r--r--sys/powerpc/powermac/ata_kauai.c12
-rw-r--r--sys/powerpc/powermac/ata_macio.c13
2 files changed, 25 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;
+}
+
OpenPOWER on IntegriCloud