Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Add an ebus frontend for the Winbond W83l51...
details: https://anonhg.NetBSD.org/src/rev/0e3f23b58a35
branches: trunk
changeset: 971975:0e3f23b58a35
user: jdc <jdc%NetBSD.org@localhost>
date: Mon May 11 15:56:15 2020 +0000
description:
Add an ebus frontend for the Winbond W83l518D SD card reader as found on
Tadpole SPARCLE latops.
diffstat:
sys/arch/sparc64/conf/files.sparc64 | 6 ++-
sys/arch/sparc64/dev/wb_ebus.c | 86 +++++++++++++++++++++++++++++++++++++
2 files changed, 91 insertions(+), 1 deletions(-)
diffs (110 lines):
diff -r d6b4b942184d -r 0e3f23b58a35 sys/arch/sparc64/conf/files.sparc64
--- a/sys/arch/sparc64/conf/files.sparc64 Mon May 11 15:27:41 2020 +0000
+++ b/sys/arch/sparc64/conf/files.sparc64 Mon May 11 15:56:15 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sparc64,v 1.158 2019/01/27 02:08:38 pgoyette Exp $
+# $NetBSD: files.sparc64,v 1.159 2020/05/11 15:56:15 jdc Exp $
# @(#)files.sparc64 8.1 (Berkeley) 7/19/93
# sparc64-specific configuration info
@@ -140,6 +140,10 @@
attach audiocs at ebus with audiocs_ebus
file dev/ebus/cs4231_ebus.c audiocs_ebus
+include "dev/sdmmc/files.sdmmc"
+attach wb at ebus with wb_ebus
+file arch/sparc64/dev/wb_ebus.c wb_ebus
+
# PCMCIA bus (references fdc)
include "dev/pcmcia/files.pcmcia"
diff -r d6b4b942184d -r 0e3f23b58a35 sys/arch/sparc64/dev/wb_ebus.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc64/dev/wb_ebus.c Mon May 11 15:56:15 2020 +0000
@@ -0,0 +1,86 @@
+/* $NetBSD: wb_ebus.c,v 1.1 2020/05/11 15:56:15 jdc Exp $ */
+
+/*
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Julian Coleman.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: wb_ebus.c,v 1.1 2020/05/11 15:56:15 jdc Exp $");
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <machine/autoconf.h>
+
+#include <dev/ebus/ebusreg.h>
+#include <dev/ebus/ebusvar.h>
+
+#include <dev/ic/w83l518dreg.h>
+#include <dev/ic/w83l518dvar.h>
+#include <dev/ic/w83l518d_sdmmc.h>
+
+static int wb_ebus_match(device_t, cfdata_t , void *);
+static void wb_ebus_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(wb_ebus, sizeof(struct wb_softc),
+ wb_ebus_match, wb_ebus_attach, NULL, NULL);
+
+static int
+wb_ebus_match(device_t parent, cfdata_t match, void *aux)
+{
+ struct ebus_attach_args *ea = aux;
+
+ return (strcmp(ea->ea_name, "TAD,wb-sdcard") == 0);
+}
+
+static void
+wb_ebus_attach(device_t parent, device_t self, void *aux)
+{
+ struct wb_softc *sc = device_private(self);
+ struct ebus_attach_args *ea = aux;
+
+ sc->wb_dev = self;
+
+ if (bus_space_map(ea->ea_bustag, EBUS_ADDR_FROM_REG(&ea->ea_reg[0]),
+ ea->ea_reg[0].size, 0, &sc->wb_ioh) == 0)
+ sc->wb_iot = ea->ea_bustag;
+ else {
+ aprint_error(": can't map register space\n");
+ return;
+ }
+
+ bus_intr_establish(sc->wb_iot, ea->ea_intr[0], IPL_BIO, wb_intr, sc);
+
+ aprint_normal("\n");
+
+ sc->wb_type = WB_DEVNO_SD;
+ sc->wb_quirks = WB_QUIRK_1BIT; /* 4bit bus width always fails */
+ wb_attach(sc);
+}
Home |
Main Index |
Thread Index |
Old Index