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;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to