diff options
author | Jean-Christophe Dubois <jcd@tribudubois.net> | 2016-07-07 13:47:01 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-07-07 13:47:01 +0100 |
commit | 66542f639927bd1420db38a969d5fa8ad1c89ae1 (patch) | |
tree | ff404c1d71d3c61e456d399a453b68785a184b2e /include | |
parent | eef9f19eea26cd8b4553459118f87d7150b53c5a (diff) |
i.MX: split the GPT timer implementation into per SOC definitions
In various Freescale SOCs, the GPT timers can be configured to select
its input clock.
Depending on the SOC the set of available input clocks may vary.
The actual single GPT definition was no good enough and because of it
booting the sabrelite board with a i.MX6DL device tree would fail
because of an incorrect input clock definition for the i.MX6DL SOC.
This patch fixes the i.MX6DL boot failure by adding the ability to
define a different set of input clocks depending on the considered SOC.
A different class has been defined for i.MX25, i.MX31 and i.MX6 each with
its specific set of input clocks.
The patch has been tested by booting KZM, i.MX25 PDK, i.MX6Q sabrelite
and i.MX6DL sabrelite.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
Message-id: 1467325619-8374-1-git-send-email-jcd@tribudubois.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: fixed spacing round '/' operator]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/misc/imx_ccm.h | 5 | ||||
-rw-r--r-- | include/hw/timer/imx_gpt.h | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h index 48a7afad5e..33cbc09952 100644 --- a/include/hw/misc/imx_ccm.h +++ b/include/hw/misc/imx_ccm.h @@ -46,7 +46,10 @@ typedef enum { CLK_NONE, CLK_IPG, CLK_IPG_HIGH, - CLK_32k + CLK_32k, + CLK_EXT, + CLK_HIGH_DIV, + CLK_HIGH, } IMXClk; typedef struct IMXCCMClass { diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h index 461adbe53f..eac59b2a70 100644 --- a/include/hw/timer/imx_gpt.h +++ b/include/hw/timer/imx_gpt.h @@ -74,7 +74,12 @@ #define GPT_IR_OF3IE (1 << 2) #define GPT_IR_ROVIE (1 << 5) -#define TYPE_IMX_GPT "imx.gpt" +#define TYPE_IMX25_GPT "imx25.gpt" +#define TYPE_IMX31_GPT "imx31.gpt" +#define TYPE_IMX6_GPT "imx6.gpt" + +#define TYPE_IMX_GPT TYPE_IMX25_GPT + #define IMX_GPT(obj) OBJECT_CHECK(IMXGPTState, (obj), TYPE_IMX_GPT) typedef struct IMXGPTState{ @@ -103,6 +108,8 @@ typedef struct IMXGPTState{ uint32_t freq; qemu_irq irq; + + const IMXClk *clocks; } IMXGPTState; #endif /* IMX_GPT_H */ |