Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/imx EPIT support as system clock for i.MX31



details:   https://anonhg.NetBSD.org/src/rev/afa173436fd0
branches:  trunk
changeset: 758784:afa173436fd0
user:      bsh <bsh%NetBSD.org@localhost>
date:      Mon Nov 15 18:19:19 2010 +0000

description:
EPIT support as system clock for i.MX31

diffstat:

 sys/arch/arm/imx/files.imx31   |  10 +++++++++-
 sys/arch/arm/imx/imx31_clock.c |  16 +++++++++++++++-
 sys/arch/arm/imx/imx31reg.h    |  14 +++++++++++++-
 3 files changed, 37 insertions(+), 3 deletions(-)

diffs (95 lines):

diff -r 17f33c80d1d1 -r afa173436fd0 sys/arch/arm/imx/files.imx31
--- a/sys/arch/arm/imx/files.imx31      Mon Nov 15 18:18:39 2010 +0000
+++ b/sys/arch/arm/imx/files.imx31      Mon Nov 15 18:19:19 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.imx31,v 1.5 2010/11/13 06:28:20 bsh Exp $
+#      $NetBSD: files.imx31,v 1.6 2010/11/15 18:19:19 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
@@ -51,6 +51,14 @@
 
 # iMX clock
 file   arch/arm/imx/imxclock.c
+file   arch/arm/imx/imx31_clock.c
+
+# Clock Control Module
+device imxccm
+attach imxccm  at aips
+file   arch/arm/imx/imx31_ccm.c        imxccm          needs-flag
+
+defparam opt_imx31clk.h IMX31_IPGCLK_FREQ
 
 # iMX UART
 device imxuart
diff -r 17f33c80d1d1 -r afa173436fd0 sys/arch/arm/imx/imx31_clock.c
--- a/sys/arch/arm/imx/imx31_clock.c    Mon Nov 15 18:18:39 2010 +0000
+++ b/sys/arch/arm/imx/imx31_clock.c    Mon Nov 15 18:19:19 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx31_clock.c,v 1.1 2010/11/13 06:51:37 bsh Exp $ */
+/*     $NetBSD: imx31_clock.c,v 1.2 2010/11/15 18:19:19 bsh Exp $ */
 /*
  * Copyright (c) 2009,2010  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
@@ -45,8 +45,14 @@
 
 #include <arm/imx/imx31reg.h>
 #include <arm/imx/imx31var.h>
+#if 0 /* notyet */
 #include <arm/imx/imx31_ccmvar.h>
+#endif
 #include <arm/imx/imxclockvar.h>
+#include <arm/imx/imxepitreg.h>
+
+#include "imxccm.h"    /* if CCM driver is configured into the kernel */
+#include "opt_imx31clk.h"
 
 static int imxclock_match(device_t, struct cfdata *, void *);
 static void imxclock_attach(device_t, device_t, void *);
@@ -105,10 +111,18 @@
 int
 imxclock_get_timerfreq(struct imxclock_softc *sc)
 {
+#if NIMXCCM > 0
        struct imx31_clocks clk;
        imx31_get_clocks(&clk);
 
        return clk.ipg_clk;
+#else
+#ifndef        IMX31_IPGCLK_FREQ
+#error IMX31_IPGCLK_FREQ need to be defined.
+#endif
+       return IMX31_IPGCLK_FREQ;
+
+#endif
 }
 
 
diff -r 17f33c80d1d1 -r afa173436fd0 sys/arch/arm/imx/imx31reg.h
--- a/sys/arch/arm/imx/imx31reg.h       Mon Nov 15 18:18:39 2010 +0000
+++ b/sys/arch/arm/imx/imx31reg.h       Mon Nov 15 18:19:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imx31reg.h,v 1.4 2010/11/13 06:44:11 bsh Exp $ */
+/* $NetBSD: imx31reg.h,v 1.5 2010/11/15 18:19:19 bsh Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -58,6 +58,18 @@
 #define        GPIO3_BASE      0x53fa4000
 /* register definitions in imxgpiore.h */
 
+#define        GPIO_NPINS              32
+#define        GPIO_NGROUPS            3
+
+#define        GPIO_NO_SCLK0           GPIO_NO(3, 2)
+
+
+/* EPIT */
+
+#define        EPIT1_BASE      0x53f94000
+#define        EPIT2_BASE      0x53f98000
+
+
 #define        INTC_BASE               0x68000000
 #define        INTC_SIZE               0x0400
 #define        IMX31_INTCNTL           0x0000  /* Interrupt Control (RW) */



Home | Main Index | Thread Index | Old Index