Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/gumstix Ensure enable clocks for omapmputmr.



details:   https://anonhg.NetBSD.org/src/rev/a05510dc3184
branches:  trunk
changeset: 344459:a05510dc3184
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Thu Mar 31 14:33:17 2016 +0000

description:
Ensure enable clocks for omapmputmr.

diffstat:

 sys/arch/evbarm/gumstix/gumstix_machdep.c |  34 ++++++++++++++++++++++++++++++-
 sys/arch/evbarm/gumstix/gumstixreg.h      |   7 +++--
 2 files changed, 37 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r e197fc4e4035 -r a05510dc3184 sys/arch/evbarm/gumstix/gumstix_machdep.c
--- a/sys/arch/evbarm/gumstix/gumstix_machdep.c Thu Mar 31 13:27:44 2016 +0000
+++ b/sys/arch/evbarm/gumstix/gumstix_machdep.c Thu Mar 31 14:33:17 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gumstix_machdep.c,v 1.50 2014/06/07 10:30:13 kiyohara Exp $ */
+/*     $NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -169,6 +169,7 @@
 #include <arm/arm32/machdep.h>
 #ifdef OVERO
 #include <arm/omap/omap2_gpmcreg.h>
+#include <arm/omap/omap2_obiovar.h>
 #include <arm/omap/omap2_prcm.h>
 #include <arm/omap/omap2_reg.h>
 #include <arm/omap/omap_var.h>
@@ -335,6 +336,13 @@
        },
 #elif defined(OVERO)
        {
+               OVERO_L4_CORE_VBASE,
+               _A(OMAP3530_L4_CORE_BASE),
+               _S(L1_S_SIZE),          /* No need 16MB.  Use only first 1MB */
+               VM_PROT_READ | VM_PROT_WRITE,
+               PTE_NOCACHE
+       },
+       {
                OVERO_L4_PERIPHERAL_VBASE,
                _A(OMAP3530_L4_PERIPHERAL_BASE),
                _S(OMAP3530_L4_PERIPHERAL_SIZE),
@@ -920,4 +928,28 @@
                            " property for %s\n", device_xname(dev));
                }
        }
+       if (device_is_a(dev, "omapmputmr")) {
+#ifdef OVERO
+               struct obio_attach_args *obio = aux;
+               int en;
+
+               switch (obio->obio_addr) {
+               case 0x49032000:        /* GPTIMER2 */
+               case 0x49034000:        /* GPTIMER3 */
+               case 0x49036000:        /* GPTIMER4 */
+               case 0x49038000:        /* GPTIMER5 */
+               case 0x4903a000:        /* GPTIMER6 */
+               case 0x4903c000:        /* GPTIMER7 */
+               case 0x4903e000:        /* GPTIMER8 */
+               case 0x49040000:        /* GPTIMER9 */
+                       /* Ensure enable PRCM.CM_[FI]CLKEN_PER[3:10]. */
+                       en = 1 << (((obio->obio_addr >> 13) & 0x3f) - 0x16);
+                       ioreg_write(OVERO_L4_CORE_VBASE + 0x5000,
+                           ioreg_read(OVERO_L4_CORE_VBASE + 0x5000) | en);
+                       ioreg_write(OVERO_L4_CORE_VBASE + 0x5010,
+                           ioreg_read(OVERO_L4_CORE_VBASE + 0x5010) | en);
+                       break;
+               }
+#endif
+       }
 }
diff -r e197fc4e4035 -r a05510dc3184 sys/arch/evbarm/gumstix/gumstixreg.h
--- a/sys/arch/evbarm/gumstix/gumstixreg.h      Thu Mar 31 13:27:44 2016 +0000
+++ b/sys/arch/evbarm/gumstix/gumstixreg.h      Thu Mar 31 14:33:17 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gumstixreg.h,v 1.7 2012/12/24 06:49:41 kiyohara Exp $  */
+/*     $NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -47,8 +47,9 @@
 #define GUMSTIX_HWUART_VBASE           0xfd600000
 #define GUMSTIX_LCDC_VBASE             0xfd700000
 
-#define OVERO_L4_PERIPHERAL_VBASE      0xc0000000
-#define OVERO_GPMC_VBASE               0xc0100000
+#define OVERO_L4_CORE_VBASE            0xc0000000
+#define OVERO_L4_PERIPHERAL_VBASE      0xc0100000
+#define OVERO_GPMC_VBASE               0xc0200000
 
 
 #define ioreg_read(a)          (*(volatile unsigned *)(a))



Home | Main Index | Thread Index | Old Index