Module Name:    src
Committed By:   uebayasi
Date:           Wed Apr 28 13:41:41 UTC 2010

Modified Files:
        src/sys/dev [uebayasi-xip]: flash.c flashvar.h

Log Message:
At device attachment, register the given bus address region as possible
"managed" region using the new bus_space_physload_device(9) API.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/dev/flash.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/flashvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/flash.c
diff -u src/sys/dev/flash.c:1.1.2.4 src/sys/dev/flash.c:1.1.2.5
--- src/sys/dev/flash.c:1.1.2.4	Sun Feb 28 05:03:58 2010
+++ src/sys/dev/flash.c	Wed Apr 28 13:41:41 2010
@@ -1,4 +1,4 @@
-/*	$Id: flash.c,v 1.1.2.4 2010/02/28 05:03:58 uebayasi Exp $	*/
+/*	$Id: flash.c,v 1.1.2.5 2010/04/28 13:41:41 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -237,6 +237,15 @@
 	    sc->sc_size / 1024, sc->sc_wordsize * 8);
 #endif
 
+#ifdef XIP
+#ifndef __HAVE_BUS_SPACE_PHYSLOAD
+#error bus_space_physload_device(9) must be supported to use XIP!
+#else
+	sc->sc_phys = bus_space_physload_device(sc->sc_iot, sc->sc_addr, sc->sc_size,
+	    PROT_READ | PROT_WRITE, BUS_SPACE_MAP_LINEAR);
+#endif
+#endif
+
 	disk_init(&sc->sc_dkdev, device_xname(&sc->sc_dev), NULL);
 	disk_attach(&sc->sc_dkdev);
 }

Index: src/sys/dev/flashvar.h
diff -u src/sys/dev/flashvar.h:1.1.2.2 src/sys/dev/flashvar.h:1.1.2.3
--- src/sys/dev/flashvar.h:1.1.2.2	Wed Feb 24 01:19:37 2010
+++ src/sys/dev/flashvar.h	Wed Apr 28 13:41:41 2010
@@ -1,4 +1,4 @@
-/*	$Id: flashvar.h,v 1.1.2.2 2010/02/24 01:19:37 uebayasi Exp $	*/
+/*	$Id: flashvar.h,v 1.1.2.3 2010/04/28 13:41:41 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -50,6 +50,7 @@
 	int (*sc_program)(struct flash_softc *, u_long, u_long);
 	int (*sc_eraseblk)(struct flash_softc *, u_long);
 	struct flash_product *sc_product;
+	void *sc_phys;
 };
 
 int flash_map(struct flash_softc *, u_long);

Reply via email to