Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/arch Implement flash(4) glue at exb(4).
details: https://anonhg.NetBSD.org/src/rev/3ef523fa4dcc
branches: uebayasi-xip
changeset: 751767:3ef523fa4dcc
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Wed Aug 11 13:56:27 2010 +0000
description:
Implement flash(4) glue at exb(4).
diffstat:
sys/arch/evbppc/conf/majors.evbppc | 3 +-
sys/arch/powerpc/conf/files.ibm4xx | 6 ++-
sys/arch/powerpc/ibm4xx/dev/flash_exb.c | 69 +++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 2 deletions(-)
diffs (107 lines):
diff -r a7686c4efde6 -r 3ef523fa4dcc sys/arch/evbppc/conf/majors.evbppc
--- a/sys/arch/evbppc/conf/majors.evbppc Wed Aug 11 13:53:22 2010 +0000
+++ b/sys/arch/evbppc/conf/majors.evbppc Wed Aug 11 13:56:27 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: majors.evbppc,v 1.28 2008/11/12 12:36:00 ad Exp $
+# $NetBSD: majors.evbppc,v 1.28.6.1 2010/08/11 13:56:27 uebayasi Exp $
#
# Device majors for evbppc
# (When possible, make entries the same as macppc)
@@ -80,6 +80,7 @@
device-major nsmb char 98 nsmb
device-major xlcom char 99 xlcom
+device-major flash char 100 block 15 flash
# Majors up to 143 are reserved for machine-dependant drivers.
# New machine-independent driver majors are assigned in
diff -r a7686c4efde6 -r 3ef523fa4dcc sys/arch/powerpc/conf/files.ibm4xx
--- a/sys/arch/powerpc/conf/files.ibm4xx Wed Aug 11 13:53:22 2010 +0000
+++ b/sys/arch/powerpc/conf/files.ibm4xx Wed Aug 11 13:56:27 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.ibm4xx,v 1.10.88.2 2010/08/11 13:53:22 uebayasi Exp $
+# $NetBSD: files.ibm4xx,v 1.10.88.3 2010/08/11 13:56:28 uebayasi Exp $
#
# IBM 4xx specific configuration info
@@ -74,3 +74,7 @@
device exb {[addr = -1]}
attach exb at plb
file arch/powerpc/ibm4xx/dev/exb.c exb
+
+# FlashROM on external bus
+attach flash at exb with flash_exb
+file arch/powerpc/ibm4xx/dev/flash_exb.c flash_exb
diff -r a7686c4efde6 -r 3ef523fa4dcc sys/arch/powerpc/ibm4xx/dev/flash_exb.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/powerpc/ibm4xx/dev/flash_exb.c Wed Aug 11 13:56:27 2010 +0000
@@ -0,0 +1,69 @@
+/* $Id: flash_exb.c,v 1.1.2.1 2010/08/11 13:56:28 uebayasi Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Masao Uebayashi.
+ *
+ * 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/param.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/bus.h>
+
+#include <dev/flashvar.h>
+
+#include <powerpc/ibm4xx/dev/exbvar.h>
+
+static int flash_match(device_t, struct cfdata *, void *);
+static void flash_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(flash_exb, sizeof(struct flash_softc),
+ flash_match, flash_attach, NULL, NULL);
+
+static int
+flash_match(device_t parent, struct cfdata *cf, void *aux)
+{
+ struct exb_conf *ec = aux;
+
+ if (strcmp(ec->ec_name, "flash") == 0)
+ return 1;
+
+ return 0;
+}
+
+static void
+flash_attach(device_t parent, device_t self, void *aux)
+{
+ struct flash_softc *sc = device_private(self);
+ struct exb_conf *ec = aux;
+
+ sc->sc_addr = ec->ec_addr;
+ sc->sc_size = ec->ec_size;
+ sc->sc_iot = ec->ec_bust;
+
+ flash_init(sc);
+}
Home |
Main Index |
Thread Index |
Old Index