summaryrefslogtreecommitdiff
path: root/sys/arch/zaurus
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/zaurus')
-rw-r--r--sys/arch/zaurus/conf/GENERIC6
-rw-r--r--sys/arch/zaurus/conf/files.zaurus11
-rw-r--r--sys/arch/zaurus/dev/scoop_mmc.c78
3 files changed, 93 insertions, 2 deletions
diff --git a/sys/arch/zaurus/conf/GENERIC b/sys/arch/zaurus/conf/GENERIC
index 8d601f24f7b..835e7c120a9 100644
--- a/sys/arch/zaurus/conf/GENERIC
+++ b/sys/arch/zaurus/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.61 2007/02/28 21:54:43 grange Exp $
+# $OpenBSD: GENERIC,v 1.62 2007/03/18 20:53:10 uwe Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -202,6 +202,10 @@ zrc0 at pxaip? # Zaurus remote control
wskbd* at zrc? mux 1
flash0 at pxaip? # NAND flash memory
+pxammc0 at pxaip? # MMC/SD/SDIO controller
+sdmmc* at pxammc? # SD/MMC bus
+scsibus* at sdmmc? # SCSI emulation
+
# 1-Wire devices
option ONEWIREVERBOSE
owid* at onewire? # ID
diff --git a/sys/arch/zaurus/conf/files.zaurus b/sys/arch/zaurus/conf/files.zaurus
index 29feac6abe4..29facd476b6 100644
--- a/sys/arch/zaurus/conf/files.zaurus
+++ b/sys/arch/zaurus/conf/files.zaurus
@@ -1,4 +1,4 @@
-# $OpenBSD: files.zaurus,v 1.23 2006/11/25 14:31:59 uwe Exp $
+# $OpenBSD: files.zaurus,v 1.24 2007/03/18 20:53:10 uwe Exp $
#
# First try for arm-specific configuration info
#
@@ -42,6 +42,10 @@ file arch/zaurus/dev/zaurus_scoop.c scoop
attach pxapcic at pxaip with pxapcic_scoop
file arch/zaurus/dev/scoop_pcic.c pxapcic_scoop
+# SD/MMC socket controller
+attach pxammc at pxaip with pxammc_scoop
+file arch/zaurus/dev/scoop_mmc.c pxammc_scoop
+
# Dedicated SSP unit for ADC, touch screen, and backlight
device zssp
attach zssp at pxaip
@@ -102,6 +106,11 @@ include "dev/usb/files.usb"
include "dev/mii/files.mii"
#
+# Machine-independent SD/MMC drivers
+#
+include "dev/sdmmc/files.sdmmc"
+
+#
# Machine-independent 1-Wire drivers
#
include "dev/onewire/files.onewire"
diff --git a/sys/arch/zaurus/dev/scoop_mmc.c b/sys/arch/zaurus/dev/scoop_mmc.c
new file mode 100644
index 00000000000..18c4adfc987
--- /dev/null
+++ b/sys/arch/zaurus/dev/scoop_mmc.c
@@ -0,0 +1,78 @@
+/* $OpenBSD: scoop_mmc.c,v 1.1 2007/03/18 20:53:10 uwe Exp $ */
+
+/*
+ * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Attachment driver for pxammc(4) on Zaurus */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+
+#include <dev/sdmmc/sdmmcreg.h>
+
+#include <arch/arm/xscale/pxammcvar.h>
+#include <arch/zaurus/dev/zaurus_scoopvar.h>
+
+int scoop_mmc_match(struct device *, void *, void *);
+void scoop_mmc_attach(struct device *, struct device *, void *);
+
+struct cfattach pxammc_scoop_ca = {
+ sizeof(struct pxammc_softc), scoop_mmc_match,
+ scoop_mmc_attach
+};
+
+u_int32_t scoop_mmc_get_ocr(void *);
+int scoop_mmc_set_power(void *, u_int32_t);
+
+int
+scoop_mmc_match(struct device *parent, void *match, void *aux)
+{
+ return pxammc_match();
+}
+
+void
+scoop_mmc_attach(struct device *parent, struct device *self, void *aux)
+{
+ struct pxammc_softc *sc = (struct pxammc_softc *)self;
+
+ sc->tag.cookie = (void *)sc;
+ sc->tag.get_ocr = scoop_mmc_get_ocr;
+ sc->tag.set_power = scoop_mmc_set_power;
+
+ pxammc_attach(sc, aux);
+}
+
+u_int32_t
+scoop_mmc_get_ocr(void *cookie)
+{
+ return MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V;
+}
+
+int
+scoop_mmc_set_power(void *cookie, u_int32_t ocr)
+{
+ if (ISSET(ocr, MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V)) {
+ scoop_set_sdmmc_power(1);
+ return 0;
+ } else if (ocr != 0) {
+ printf("scoop_mmc_set_power: unsupported OCR (%#x)\n", ocr);
+ return EINVAL;
+ } else {
+ scoop_set_sdmmc_power(0);
+ return 0;
+ }
+}