Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 2014 01:32:33 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270076 - stable/10/sys/arm/freescale/imx
Message-ID:  <201408170132.s7H1WXUn085360@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Aug 17 01:32:33 2014
New Revision: 270076
URL: http://svnweb.freebsd.org/changeset/base/270076

Log:
  MFC r269607, r269698:
  
    Cache the imx6 SoC type in a static var so that it only has to be figured
    out by sniffing hardware registers once.
  
    Add a missing clock register definition.

Modified:
  stable/10/sys/arm/freescale/imx/imx6_ccmreg.h
  stable/10/sys/arm/freescale/imx/imx6_machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/freescale/imx/imx6_ccmreg.h
==============================================================================
--- stable/10/sys/arm/freescale/imx/imx6_ccmreg.h	Sun Aug 17 01:28:03 2014	(r270075)
+++ stable/10/sys/arm/freescale/imx/imx6_ccmreg.h	Sun Aug 17 01:32:33 2014	(r270076)
@@ -36,6 +36,7 @@
 #define	  CCM_CLPCR_LPM_STOP		  0x02
 #define	CCM_CGPR			0x064
 #define	  CCM_CGPR_INT_MEM_CLK_LPM	  (1 << 17)
+#define	CCM_CCGR0			0x068
 #define	CCM_CCGR1			0x06C
 #define	CCM_CCGR2			0x070
 #define	CCM_CCGR3			0x074

Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- stable/10/sys/arm/freescale/imx/imx6_machdep.c	Sun Aug 17 01:28:03 2014	(r270075)
+++ stable/10/sys/arm/freescale/imx/imx6_machdep.c	Sun Aug 17 01:32:33 2014	(r270076)
@@ -145,12 +145,16 @@ u_int imx_soc_type()
 {
 	uint32_t digprog, hwsoc;
 	uint32_t *pcr;
+	static u_int soctype;
 	const vm_offset_t SCU_CONFIG_PHYSADDR = 0x00a00004;
 #define	HWSOC_MX6SL	0x60
 #define	HWSOC_MX6DL	0x61
 #define	HWSOC_MX6SOLO	0x62
 #define	HWSOC_MX6Q	0x63
 
+	if (soctype != 0)
+		return (soctype);
+
 	digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG_SL);
 	hwsoc = (digprog >> IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) & 
 	    IMX6_ANALOG_DIGPROG_SOCTYPE_MASK;
@@ -174,20 +178,25 @@ u_int imx_soc_type()
 
 	switch (hwsoc) {
 	case HWSOC_MX6SL:
-		return (IMXSOC_6SL);
+		soctype = IMXSOC_6SL;
+		break;
 	case HWSOC_MX6SOLO:
-		return (IMXSOC_6S);
+		soctype = IMXSOC_6S;
+		break;
 	case HWSOC_MX6DL:
-		return (IMXSOC_6DL);
+		soctype = IMXSOC_6DL;
+		break;
 	case HWSOC_MX6Q :
-		return (IMXSOC_6Q);
+		soctype = IMXSOC_6Q;
+		break;
 	default:
 		printf("imx_soc_type: Don't understand hwsoc 0x%02x, "
 		    "digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog);
+		soctype = IMXSOC_6Q;
 		break;
 	}
 
-	return (IMXSOC_6Q);
+	return (soctype);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408170132.s7H1WXUn085360>