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.
This commit is contained in:
parent
5a08a2da60
commit
9e3ae53cb8
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user