diff mbox

[v2,3/9] i.MX: Remove CCM useless clock computation handling.

Message ID 1d29018c5c595dd022ea71899ddb11780b651f4e.1454967766.git.jcd@tribudubois.net
State New
Headers show

Commit Message

Jean-Christophe Dubois Feb. 8, 2016, 10:08 p.m. UTC
Most clocks supported by the CCM are useless to the qemu framework.

Only clocks related to timers (EPIT, GPT, PWM, WATCHDOG, ...) are usefull
to QEMU code.

Therefore this patch removes clock computation handling for all clocks but:
* CLK_NONE,
* CLK_IPG,
* CLK_32k

Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
---

Changes since V1:
 * move NOCLK renaming in its own patch
 * move CLK_IPG_HIGH addition in its own patch

 hw/misc/imx25_ccm.c       | 26 --------------------------
 hw/misc/imx31_ccm.c       | 32 --------------------------------
 include/hw/misc/imx_ccm.h |  7 -------
 3 files changed, 65 deletions(-)

Comments

Peter Maydell Feb. 16, 2016, 3:20 p.m. UTC | #1
On 8 February 2016 at 22:08, Jean-Christophe Dubois <jcd@tribudubois.net> wrote:
> Most clocks supported by the CCM are useless to the qemu framework.
>
> Only clocks related to timers (EPIT, GPT, PWM, WATCHDOG, ...) are usefull
> to QEMU code.
>
> Therefore this patch removes clock computation handling for all clocks but:
> * CLK_NONE,
> * CLK_IPG,
> * CLK_32k
>
> Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/hw/misc/imx25_ccm.c b/hw/misc/imx25_ccm.c
index cc0e893..e74486f 100644
--- a/hw/misc/imx25_ccm.c
+++ b/hw/misc/imx25_ccm.c
@@ -119,20 +119,6 @@  static uint32_t imx25_ccm_get_mpll_clk(IMXCCMState *dev)
     return freq;
 }
 
-static uint32_t imx25_ccm_get_upll_clk(IMXCCMState *dev)
-{
-    uint32_t freq = 0;
-    IMX25CCMState *s = IMX25_CCM(dev);
-
-    if (!EXTRACT(s->reg[IMX25_CCM_CCTL_REG], UPLL_DIS)) {
-        freq = imx_ccm_calc_pll(s->reg[IMX25_CCM_UPCTL_REG], CKIH_FREQ);
-    }
-
-    DPRINTF("freq = %d\n", freq);
-
-    return freq;
-}
-
 static uint32_t imx25_ccm_get_mcu_clk(IMXCCMState *dev)
 {
     uint32_t freq;
@@ -183,18 +169,6 @@  static uint32_t imx25_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)
     switch (clock) {
     case CLK_NONE:
         break;
-    case CLK_MPLL:
-        freq = imx25_ccm_get_mpll_clk(dev);
-        break;
-    case CLK_UPLL:
-        freq = imx25_ccm_get_upll_clk(dev);
-        break;
-    case CLK_MCU:
-        freq = imx25_ccm_get_mcu_clk(dev);
-        break;
-    case CLK_AHB:
-        freq = imx25_ccm_get_ahb_clk(dev);
-        break;
     case CLK_IPG:
         freq = imx25_ccm_get_ipg_clk(dev);
         break;
diff --git a/hw/misc/imx31_ccm.c b/hw/misc/imx31_ccm.c
index 10c78f3..dee0b11 100644
--- a/hw/misc/imx31_ccm.c
+++ b/hw/misc/imx31_ccm.c
@@ -151,32 +151,6 @@  static uint32_t imx31_ccm_get_mcu_main_clk(IMXCCMState *dev)
     return freq;
 }
 
-static uint32_t imx31_ccm_get_mcu_clk(IMXCCMState *dev)
-{
-    uint32_t freq;
-    IMX31CCMState *s = IMX31_CCM(dev);
-
-    freq = imx31_ccm_get_mcu_main_clk(dev)
-           / (1 + EXTRACT(s->reg[IMX31_CCM_PDR0_REG], MCU));
-
-    DPRINTF("freq = %d\n", freq);
-
-    return freq;
-}
-
-static uint32_t imx31_ccm_get_hsp_clk(IMXCCMState *dev)
-{
-    uint32_t freq;
-    IMX31CCMState *s = IMX31_CCM(dev);
-
-    freq = imx31_ccm_get_mcu_main_clk(dev)
-           / (1 + EXTRACT(s->reg[IMX31_CCM_PDR0_REG], HSP));
-
-    DPRINTF("freq = %d\n", freq);
-
-    return freq;
-}
-
 static uint32_t imx31_ccm_get_hclk_clk(IMXCCMState *dev)
 {
     uint32_t freq;
@@ -210,12 +184,6 @@  static uint32_t imx31_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)
     switch (clock) {
     case CLK_NONE:
         break;
-    case CLK_MCU:
-        freq = imx31_ccm_get_mcu_clk(dev);
-        break;
-    case CLK_HSP:
-        freq = imx31_ccm_get_hsp_clk(dev);
-        break;
     case CLK_IPG:
         freq = imx31_ccm_get_ipg_clk(dev);
         break;
diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h
index 74e2705..378b78d 100644
--- a/include/hw/misc/imx_ccm.h
+++ b/include/hw/misc/imx_ccm.h
@@ -44,14 +44,7 @@  typedef struct IMXCCMState {
 
 typedef enum  {
     CLK_NONE,
-    CLK_MPLL,
-    CLK_UPLL,
-    CLK_MCU,
-    CLK_HSP,
-    CLK_MAX,
-    CLK_AHB,
     CLK_IPG,
-    CLK_PER,
     CLK_32k
 } IMXClk;