Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Modified CCM register defines.



details:   https://anonhg.NetBSD.org/src/rev/2bcba6e62aeb
branches:  trunk
changeset: 323557:2bcba6e62aeb
user:      hkenken <hkenken%NetBSD.org@localhost>
date:      Wed Jun 20 07:05:37 2018 +0000

description:
Modified CCM register defines.

diffstat:

 sys/arch/arm/imx/files.imx6               |   4 +++-
 sys/arch/arm/imx/imx6_ccm.c               |   8 ++++----
 sys/arch/arm/imx/imx6_ccmreg.h            |  30 +++++++++++++++++-------------
 sys/arch/arm/imx/imx6_reg.h               |   5 +++--
 sys/arch/evbarm/nitrogen6/nitrogen6_usb.c |  22 +++++++++++-----------
 5 files changed, 38 insertions(+), 31 deletions(-)

diffs (214 lines):

diff -r 683427f1e84f -r 2bcba6e62aeb sys/arch/arm/imx/files.imx6
--- a/sys/arch/arm/imx/files.imx6       Wed Jun 20 05:59:22 2018 +0000
+++ b/sys/arch/arm/imx/files.imx6       Wed Jun 20 07:05:37 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.imx6,v 1.13 2018/03/17 18:34:09 ryo Exp $
+#      $NetBSD: files.imx6,v 1.14 2018/06/20 07:05:37 hkenken Exp $
 #
 # Configuration info for the Freescale i.MX6
 #
@@ -36,6 +36,8 @@
 attach imxccm at axi
 file   arch/arm/imx/imx6_ccm.c                 imxccm  needs-flag
 defflag opt_imx6clk.h                          IMXCCMDEBUG
+defparam opt_imx6clk.h                         IMX6_OSC_FREQ
+defparam opt_imx6clk.h                         IMX6_CKIL_FREQ
 
 # iMX6 Enhanced Periodic Interrupt Timer
 device imxclock
diff -r 683427f1e84f -r 2bcba6e62aeb sys/arch/arm/imx/imx6_ccm.c
--- a/sys/arch/arm/imx/imx6_ccm.c       Wed Jun 20 05:59:22 2018 +0000
+++ b/sys/arch/arm/imx/imx6_ccm.c       Wed Jun 20 07:05:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx6_ccm.c,v 1.8 2018/05/23 10:42:05 hkenken Exp $     */
+/*     $NetBSD: imx6_ccm.c,v 1.9 2018/06/20 07:05:37 hkenken Exp $     */
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.8 2018/05/23 10:42:05 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.9 2018/06/20 07:05:37 hkenken Exp $");
 
 #include "opt_imx.h"
 #include "opt_imx6clk.h"
@@ -556,7 +556,7 @@
                break;
        case IMX6CLK_PLL7:
                v = imx6_ccm_analog_read(CCM_ANALOG_PLL_USB2);
-               freq = IMX6_OSC_FREQ * ((v & CCM_ANALOG_PLL_USBn_DIV_SELECT) ? 22 : 20);
+               freq = IMX6_OSC_FREQ * ((v & CCM_ANALOG_PLL_DIV_SELECT) ? 22 : 20);
                break;
 
 #if 0
@@ -899,7 +899,7 @@
                v = imx6_ccm_analog_read(pllreg);
                if (on) {
                        v |= en;
-                       v &= ~CCM_ANALOG_PLL_USBn_BYPASS;
+                       v &= ~CCM_ANALOG_PLL_BYPASS;
                } else {
                        v &= ~en;
                }
diff -r 683427f1e84f -r 2bcba6e62aeb sys/arch/arm/imx/imx6_ccmreg.h
--- a/sys/arch/arm/imx/imx6_ccmreg.h    Wed Jun 20 05:59:22 2018 +0000
+++ b/sys/arch/arm/imx/imx6_ccmreg.h    Wed Jun 20 07:05:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx6_ccmreg.h,v 1.7 2018/05/23 10:42:05 hkenken Exp $  */
+/*     $NetBSD: imx6_ccmreg.h,v 1.8 2018/06/20 07:05:37 hkenken Exp $  */
 
 /*
  * Copyright (c) 2014 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -44,6 +44,9 @@
 #ifndef IMX6_OSC_FREQ
 #define IMX6_OSC_FREQ  (24 * 1000 * 1000)      /* 24MHz */
 #endif
+#ifndef IMX6_CKIL_FREQ
+#define IMX6_CKIL_FREQ 32768
+#endif
 
 #define CCM_CCR                                        0x00000000
 #define  CCM_CCR_RBC_EN                                __BIT(27)
@@ -292,6 +295,9 @@
 #define  CCM_CCGR6_USBOH3_CLK_ENABLE           __BITS(1, 0)
 
 #define CCM_ANALOG_PLL_ARM                     0x00000000      /* = 020c8000 */
+#define CCM_ANALOG_PLL_ARM_SET                 0x00000004
+#define CCM_ANALOG_PLL_ARM_CLR                 0x00000008
+#define CCM_ANALOG_PLL_ARM_TOG                 0x0000000c
 #define  CCM_ANALOG_PLL_ARM_LOCK               __BIT(31)
 #define  CCM_ANALOG_PLL_ARM_PLL_SEL            __BIT(19)
 #define  CCM_ANALOG_PLL_ARM_LVDS_24MHZ_SEL     __BIT(18)
@@ -302,10 +308,13 @@
 #define  CCM_ANALOG_PLL_ARM_POWERDOWN          __BIT(12)
 #define  CCM_ANALOG_PLL_ARM_DIV_SELECT         __BITS(6, 0)
 
-#define CCM_ANALOG_PLL_ARM_SET                 0x00000004
-#define CCM_ANALOG_PLL_ARM_CLR                 0x00000008
-#define CCM_ANALOG_PLL_ARM_TOG                 0x0000000c
-#define  CCM_ANALOG_PLL_ARM_DIV_SELECT         __BITS(6, 0)
+#define  CCM_ANALOG_PLL_LOCK                   __BIT(31)
+#define  CCM_ANALOG_PLL_BYPASS                 __BIT(16)
+#define  CCM_ANALOG_PLL_BYPASS_CLK_SRC         __BITS(15, 14)
+#define  CCM_ANALOG_PLL_ENABLE                 __BIT(13)
+#define  CCM_ANALOG_PLL_POWER                  __BIT(12)
+#define  CCM_ANALOG_PLL_EN_USB_CLK             __BIT(6)
+#define  CCM_ANALOG_PLL_DIV_SELECT             __BITS(1, 0)
 
 #define CCM_ANALOG_PLL_USB1                    0x00000010
 #define CCM_ANALOG_PLL_USB1_SET                        0x00000014
@@ -331,14 +340,6 @@
 #define  CCM_ANALOG_PLL_USB2_EN_USB_CLK                __BIT(6)
 #define  CCM_ANALOG_PLL_USB2_DIV_SELECT                __BITS(1, 0)
 
-#define  CCM_ANALOG_PLL_USBn_LOCK              __BIT(31)
-#define  CCM_ANALOG_PLL_USBn_BYPASS            __BIT(16)
-#define  CCM_ANALOG_PLL_USBn_BYPASS_CLK_SRC    __BITS(15, 14)
-#define  CCM_ANALOG_PLL_USBn_ENABLE            __BIT(13)
-#define  CCM_ANALOG_PLL_USBn_POWER             __BIT(12)
-#define  CCM_ANALOG_PLL_USBn_EN_USB_CLK                __BIT(6)
-#define  CCM_ANALOG_PLL_USBn_DIV_SELECT                __BITS(1, 0)
-
 #define CCM_ANALOG_PLL_SYS                     0x00000030
 #define CCM_ANALOG_PLL_SYS_SET                 0x00000034
 #define CCM_ANALOG_PLL_SYS_CLR                 0x00000038
@@ -346,6 +347,7 @@
 #define  CCM_ANALOG_PLL_SYS_BYPASS             __BIT(16)
 #define  CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC     __BITS(15, 14)
 #define  CCM_ANALOG_PLL_SYS_ENABLE             __BIT(13)
+#define  CCM_ANALOG_PLL_SYS_POWERDOWN          __BIT(12)
 #define  CCM_ANALOG_PLL_SYS_DIV_SELECT         __BIT(0)
 #define CCM_ANALOG_PLL_SYS_SS                  0x00000040
 #define CCM_ANALOG_PLL_SYS_NUM                 0x00000050
@@ -358,6 +360,7 @@
 #define  CCM_ANALOG_PLL_AUDIO_BYPASS           __BIT(16)
 #define  CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC   __BITS(15, 14)
 #define  CCM_ANALOG_PLL_AUDIO_ENABLE           __BIT(13)
+#define  CCM_ANALOG_PLL_AUDIO_POWERDOWN                __BIT(12)
 #define  CCM_ANALOG_PLL_AUDIO_DIV_SELECT       __BITS(6, 0)
 #define CCM_ANALOG_PLL_AUDIO_NUM               0x00000080
 #define CCM_ANALOG_PLL_AUDIO_DENOM             0x00000090
@@ -366,6 +369,7 @@
 #define  CCM_ANALOG_PLL_VIDEO_BYPASS           __BIT(16)
 #define  CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC   __BITS(15, 14)
 #define  CCM_ANALOG_PLL_VIDEO_ENABLE           __BIT(13)
+#define  CCM_ANALOG_PLL_VIDEO_POWERDOWN                __BIT(12)
 #define  CCM_ANALOG_PLL_VIDEO_DIV_SELECT       __BITS(6, 0)
 #define CCM_ANALOG_PLL_VIDEO_SET               0x000000a4
 #define CCM_ANALOG_PLL_VIDEO_CLR               0x000000a8
diff -r 683427f1e84f -r 2bcba6e62aeb sys/arch/arm/imx/imx6_reg.h
--- a/sys/arch/arm/imx/imx6_reg.h       Wed Jun 20 05:59:22 2018 +0000
+++ b/sys/arch/arm/imx/imx6_reg.h       Wed Jun 20 07:05:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx6_reg.h,v 1.7 2017/11/09 05:57:23 hkenken Exp $     */
+/*     $NetBSD: imx6_reg.h,v 1.8 2018/06/20 07:05:37 hkenken Exp $     */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -131,9 +131,10 @@
 #define        AIPS1_DCIC2_BASE        0x000e8000
 #define        AIPS1_DCIC1_BASE        0x000e4000
 #define        AIPS1_IOMUXC_BASE       0x000e0000
-#define        AIPS1_IOMUXC_SIZE       0x00005000
+#define        AIPS1_IOMUXC_SIZE       0x00004000
 #define        AIPS1_GPC_BASE          0x000dc000
 #define        AIPS1_SRC_BASE          0x000d8000
+#define        AIPS1_SRC_SIZE          0x00004000
 #define        AIPS1_EPIT2_BASE        0x000d4000
 #define        AIPS1_EPIT1_BASE        0x000d0000
 #define        AIPS1_EPIT_SIZE         0x00000020
diff -r 683427f1e84f -r 2bcba6e62aeb sys/arch/evbarm/nitrogen6/nitrogen6_usb.c
--- a/sys/arch/evbarm/nitrogen6/nitrogen6_usb.c Wed Jun 20 05:59:22 2018 +0000
+++ b/sys/arch/evbarm/nitrogen6/nitrogen6_usb.c Wed Jun 20 07:05:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nitrogen6_usb.c,v 1.3 2017/11/09 05:57:23 hkenken Exp $        */
+/*     $NetBSD: nitrogen6_usb.c,v 1.4 2018/06/20 07:05:37 hkenken Exp $        */
 
 /*
  * Copyright (c) 2013  Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nitrogen6_usb.c,v 1.3 2017/11/09 05:57:23 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nitrogen6_usb.c,v 1.4 2018/06/20 07:05:37 hkenken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -127,13 +127,13 @@
        imx6_ccm_analog_write(USB_ANALOG_USB1_CHRG_DETECT,
            USB_ANALOG_USB_CHRG_DETECT_EN_B |
            USB_ANALOG_USB_CHRG_DETECT_CHK_CHRG_B);
-       imx6_pll_power(CCM_ANALOG_PLL_USB1, 1, CCM_ANALOG_PLL_USBn_ENABLE);
+       imx6_pll_power(CCM_ANALOG_PLL_USB1, 1, CCM_ANALOG_PLL_ENABLE);
        imx6_ccm_analog_write(CCM_ANALOG_PLL_USB1_CLR,
-           CCM_ANALOG_PLL_USBn_BYPASS);
+           CCM_ANALOG_PLL_BYPASS);
        imx6_ccm_analog_write(CCM_ANALOG_PLL_USB1_SET,
-          CCM_ANALOG_PLL_USBn_ENABLE |
-          CCM_ANALOG_PLL_USBn_POWER |
-          CCM_ANALOG_PLL_USBn_EN_USB_CLK);
+          CCM_ANALOG_PLL_ENABLE |
+          CCM_ANALOG_PLL_POWER |
+          CCM_ANALOG_PLL_EN_USB_CLK);
 
        imxehci_reset(sc);
 
@@ -157,11 +157,11 @@
            USB_ANALOG_USB_CHRG_DETECT_EN_B |
            USB_ANALOG_USB_CHRG_DETECT_CHK_CHRG_B);
        imx6_ccm_analog_write(CCM_ANALOG_PLL_USB2_CLR,
-           CCM_ANALOG_PLL_USBn_BYPASS);
+           CCM_ANALOG_PLL_BYPASS);
        imx6_ccm_analog_write(CCM_ANALOG_PLL_USB2_SET,
-           CCM_ANALOG_PLL_USBn_ENABLE |
-           CCM_ANALOG_PLL_USBn_POWER |
-           CCM_ANALOG_PLL_USBn_EN_USB_CLK);
+           CCM_ANALOG_PLL_ENABLE |
+           CCM_ANALOG_PLL_POWER |
+           CCM_ANALOG_PLL_EN_USB_CLK);
 
        v = bus_space_read_4(usbc->sc_iot, usbc->sc_ioh, USBNC_USB_UH1_CTRL);
        v |= USBNC_USB_UH1_CTRL_OVER_CUR_POL;



Home | Main Index | Thread Index | Old Index