From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:21:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D109A68A; Fri, 13 Dec 2013 22:21:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2DBC13A6; Fri, 13 Dec 2013 22:21:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDML40M050860; Fri, 13 Dec 2013 22:21:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDML4ji050859; Fri, 13 Dec 2013 22:21:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132221.rBDML4ji050859@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259346 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:21:04 -0000 Author: ian Date: Fri Dec 13 22:21:04 2013 New Revision: 259346 URL: http://svnweb.freebsd.org/changeset/base/259346 Log: MFC r257407: Expand the list of compatible devices this driver works with. Increase the target frequency from 1 to 10 MHz because these SoCs are plenty fast enough to benefit from the extra event timer resolution. Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:19:21 2013 (r259345) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:21:04 2013 (r259346) @@ -95,7 +95,7 @@ struct imx_gpt_softc *imx_gpt_sc = NULL; static const int imx_gpt_delay_count = 78; /* Try to divide down an available fast clock to this frequency. */ -#define TARGET_FREQUENCY 1000000 +#define TARGET_FREQUENCY 10000000 /* Don't try to set an event timer period smaller than this. */ #define MIN_ET_PERIOD 10LLU @@ -107,16 +107,26 @@ static struct resource_spec imx_gpt_spec { -1, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpt", 1}, + {"fsl,imx53-gpt", 1}, + {"fsl,imx51-gpt", 1}, + {"fsl,imx31-gpt", 1}, + {"fsl,imx27-gpt", 1}, + {"fsl,imx25-gpt", 1}, + {NULL, 0} +}; + static int imx_gpt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,imx51-gpt") && - !ofw_bus_is_compatible(dev, "fsl,imx53-gpt")) - return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPT timer"); + return (BUS_PROBE_DEFAULT); + } - device_set_desc(dev, "Freescale i.MX GPT timer"); - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static int @@ -142,10 +152,7 @@ imx_gpt_attach(device_t dev) * we're running on. Eventually we could allow selection from the fdt; * the code in this driver will cope with any clock frequency. */ - if (ofw_bus_is_compatible(dev, "fsl,imx6-gpt")) - sc->sc_clksrc = GPT_CR_CLKSRC_24M; - else - sc->sc_clksrc = GPT_CR_CLKSRC_IPG; + sc->sc_clksrc = GPT_CR_CLKSRC_IPG; ctlreg = 0;