2 * IMX Clock Control Module base class
4 * Copyright (C) 2012 NICTA
5 * Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
7 * This work is licensed under the terms of the GNU GPL, version 2 or later.
8 * See the COPYING file in the top-level directory.
14 #include "hw/sysbus.h"
15 #include "qom/object.h"
17 #define CKIL_FREQ 32768 /* nominal 32khz clock */
19 /* PLL control registers */
20 #define PD(v) (((v) >> 26) & 0xf)
21 #define MFD(v) (((v) >> 16) & 0x3ff)
22 #define MFI(v) (((v) >> 10) & 0xf);
23 #define MFN(v) ((v) & 0x3ff)
25 #define PLL_PD(x) (((x) & 0xf) << 26)
26 #define PLL_MFD(x) (((x) & 0x3ff) << 16)
27 #define PLL_MFI(x) (((x) & 0xf) << 10)
28 #define PLL_MFN(x) (((x) & 0x3ff) << 0)
30 #define TYPE_IMX_CCM "imx.ccm"
31 OBJECT_DECLARE_TYPE(IMXCCMState
, IMXCCMClass
, IMX_CCM
)
35 SysBusDevice parent_obj
;
53 SysBusDeviceClass parent_class
;
56 uint32_t (*get_clock_frequency
)(IMXCCMState
*s
, IMXClk clk
);
59 uint32_t imx_ccm_calc_pll(uint32_t pllreg
, uint32_t base_freq
);
61 uint32_t imx_ccm_get_clock_frequency(IMXCCMState
*s
, IMXClk clock
);
63 #endif /* IMX_CCM_H */