Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/omap Add gpmc_register_read and gpmc_register_w...



details:   https://anonhg.NetBSD.org/src/rev/67557db11982
branches:  trunk
changeset: 757551:67557db11982
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Sat Sep 04 16:23:47 2010 +0000

description:
Add gpmc_register_read and gpmc_register_write to access registers
mapped by the gpmc driver (eg.: GPMC_CONFIG, GPMC_STATUS).

The driver should save the parent (gpmc) device's sc pointer
to be able to use these functions.

diffstat:

 sys/arch/arm/omap/omap2_gpmc.c    |  18 +++++++++++++++---
 sys/arch/arm/omap/omap2_gpmcvar.h |   8 +++++++-
 2 files changed, 22 insertions(+), 4 deletions(-)

diffs (58 lines):

diff -r c491ed494ecd -r 67557db11982 sys/arch/arm/omap/omap2_gpmc.c
--- a/sys/arch/arm/omap/omap2_gpmc.c    Sat Sep 04 14:22:28 2010 +0000
+++ b/sys/arch/arm/omap/omap2_gpmc.c    Sat Sep 04 16:23:47 2010 +0000
@@ -1,7 +1,7 @@
-/*     $Id: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $      */
+/*     $Id: omap2_gpmc.c,v 1.8 2010/09/04 16:23:47 ahoka Exp $ */
 
 /* adapted from: */
-/*     $NetBSD: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $ */
+/*     $NetBSD: omap2_gpmc.c,v 1.8 2010/09/04 16:23:47 ahoka Exp $ */
 
 
 /*
@@ -102,7 +102,7 @@
 
 #include "opt_omap.h"
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.7 2010/08/28 04:00:35 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.8 2010/09/04 16:23:47 ahoka Exp $");
 
 #include "locators.h"
 
@@ -316,3 +316,15 @@
 
        return UNCONF;
 }
+
+uint32_t
+gpmc_register_read(struct gpmc_softc *sc, bus_size_t reg)
+{
+       return bus_space_read_4(sc->sc_iot, sc->sc_ioh, reg);
+}
+
+void
+gpmc_register_write(struct gpmc_softc *sc, bus_size_t reg, const uint32_t data)
+{
+       bus_space_write_4(sc->sc_iot, sc->sc_ioh, reg, data);
+}
diff -r c491ed494ecd -r 67557db11982 sys/arch/arm/omap/omap2_gpmcvar.h
--- a/sys/arch/arm/omap/omap2_gpmcvar.h Sat Sep 04 14:22:28 2010 +0000
+++ b/sys/arch/arm/omap/omap2_gpmcvar.h Sat Sep 04 16:23:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: omap2_gpmcvar.h,v 1.2 2010/07/07 21:10:39 ahoka Exp $  */
+/*     $NetBSD: omap2_gpmcvar.h,v 1.3 2010/09/04 16:23:47 ahoka Exp $  */
 /*
  * Copyright (c) 2007 Microsoft
  * All rights reserved.
@@ -41,4 +41,10 @@
        int             gpmc_cs;
 };
 
+struct gpmc_softc;
+
+uint32_t gpmc_register_read(struct gpmc_softc *sc, bus_size_t reg);
+void gpmc_register_write(struct gpmc_softc *sc, bus_size_t reg,
+    const uint32_t data);
+
 #endif /* _OMAP2430GPMCVAR_H */



Home | Main Index | Thread Index | Old Index