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 Export a little more from the omap2 prcm d...



details:   https://anonhg.NetBSD.org/src/rev/081e677c2496
branches:  trunk
changeset: 783216:081e677c2496
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Dec 11 18:51:38 2012 +0000

description:
Export a little more from the omap2 prcm driver.

This is in anticipation of drivers that need to enable (and, for
future power management, perhaps disable) modules on an SoC.  Each
SoC has a different notion of enabling and disabling modules and will
need to implement prcm_module_enable and prcm_module_disable
separately.

diffstat:

 sys/arch/arm/omap/omap2_prcm.c |  29 +++++++++++++++++------------
 sys/arch/arm/omap/omap2_prcm.h |  17 ++++++++++++-----
 2 files changed, 29 insertions(+), 17 deletions(-)

diffs (106 lines):

diff -r 321ac1c61aa8 -r 081e677c2496 sys/arch/arm/omap/omap2_prcm.c
--- a/sys/arch/arm/omap/omap2_prcm.c    Tue Dec 11 16:37:23 2012 +0000
+++ b/sys/arch/arm/omap/omap2_prcm.c    Tue Dec 11 18:51:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: omap2_prcm.c,v 1.3 2012/01/31 04:31:37 matt Exp $      */
+/*     $NetBSD: omap2_prcm.c,v 1.4 2012/12/11 18:51:38 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2010 Adam Hoka
@@ -28,7 +28,7 @@
 
 #include "opt_omap.h"
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_prcm.c,v 1.3 2012/01/31 04:31:37 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_prcm.c,v 1.4 2012/12/11 18:51:38 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -77,6 +77,7 @@
 {
        struct obio_attach_args *obio = aux;
 
+       KASSERT(prcm_sc == NULL);
        prcm_sc = device_private(self);
 
        prcm_sc->sc_dev = self;
@@ -84,7 +85,7 @@
 
        prcm_sc->sc_base = obio->obio_addr;
        prcm_sc->sc_size = OMAP2_PRM_SIZE;
-       
+
        /* map i/o space for PRM */
        if (bus_space_map(prcm_sc->sc_iot, prcm_sc->sc_base, prcm_sc->sc_size,
            0, &prcm_sc->sc_ioh) != 0) {
@@ -95,16 +96,20 @@
        aprint_normal(": Power, Reset and Clock Management\n");
 }
 
-static uint32_t
-prcm_read(bus_addr_t module, bus_addr_t reg)
-{      
+uint32_t
+prcm_read_4(bus_size_t module, bus_size_t reg)
+{
+
+       KASSERT(prcm_sc != NULL);
        return bus_space_read_4(prcm_sc->sc_iot, prcm_sc->sc_ioh,
            module + reg);
 }
 
-static void
-prcm_write(bus_addr_t module, bus_addr_t reg, uint32_t data)
-{      
+void
+prcm_write_4(bus_size_t module, bus_size_t reg, uint32_t data)
+{
+
+       KASSERT(prcm_sc != NULL);
        bus_space_write_4(prcm_sc->sc_iot, prcm_sc->sc_ioh,
            module + reg, data);
 }
@@ -113,10 +118,10 @@
 prcm_cold_reset(void)
 {
        uint32_t val;
-       
-       val = prcm_read(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL);
+
+       val = prcm_read_4(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL);
 
        val |= OMAP_RST_DPLL3;
 
-       prcm_write(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL, val);
+       prcm_write_4(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL, val);
 }
diff -r 321ac1c61aa8 -r 081e677c2496 sys/arch/arm/omap/omap2_prcm.h
--- a/sys/arch/arm/omap/omap2_prcm.h    Tue Dec 11 16:37:23 2012 +0000
+++ b/sys/arch/arm/omap/omap2_prcm.h    Tue Dec 11 18:51:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: omap2_prcm.h,v 1.1 2010/08/28 13:02:32 ahoka Exp $     */
+/*     $NetBSD: omap2_prcm.h,v 1.2 2012/12/11 18:51:38 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2010 Adam Hoka
@@ -26,9 +26,16 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _OMAP2_PRCM_H_
-#define _OMAP2_PRCM_H_
+#ifndef _ARM_OMAP_OMAP2_PRCM_H_
+#define _ARM_OMAP_OMAP2_PRCM_H_
+
+struct omap_module;
 
-void prcm_cold_reset(void);
+uint32_t       prcm_read_4(bus_size_t, bus_size_t);
+void           prcm_write_4(bus_size_t, bus_size_t, uint32_t);
+void           prcm_cold_reset(void);
 
-#endif
+void           prcm_module_enable(const struct omap_module *);
+void           prcm_module_disable(const struct omap_module *);
+
+#endif  /* _ARM_OMAP_OMAP2_PRCM_H_ */



Home | Main Index | Thread Index | Old Index