mx25: Define more standard clocks
Define AHB, IPG and CSPI clocks. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Stefano Babic <sbabic@denx.de>
This commit is contained in:
parent
fac7c817c3
commit
c3b5189031
@ -101,6 +101,11 @@ ulong imx_get_ahbclk(void)
|
|||||||
return fref / div;
|
return fref / div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ulong imx_get_ipgclk(void)
|
||||||
|
{
|
||||||
|
return imx_get_ahbclk() / 2;
|
||||||
|
}
|
||||||
|
|
||||||
ulong imx_get_perclk(int clk)
|
ulong imx_get_perclk(int clk)
|
||||||
{
|
{
|
||||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||||
@ -120,6 +125,11 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
|
|||||||
switch (clk) {
|
switch (clk) {
|
||||||
case MXC_ARM_CLK:
|
case MXC_ARM_CLK:
|
||||||
return imx_get_armclk();
|
return imx_get_armclk();
|
||||||
|
case MXC_AHB_CLK:
|
||||||
|
return imx_get_ahbclk();
|
||||||
|
case MXC_IPG_CLK:
|
||||||
|
case MXC_CSPI_CLK:
|
||||||
|
return imx_get_ipgclk();
|
||||||
case MXC_FEC_CLK:
|
case MXC_FEC_CLK:
|
||||||
return imx_get_ahbclk();
|
return imx_get_ahbclk();
|
||||||
default:
|
default:
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum mxc_clock {
|
enum mxc_clock {
|
||||||
|
/* PER clocks (do not change order) */
|
||||||
MXC_CSI_CLK,
|
MXC_CSI_CLK,
|
||||||
MXC_EPIT_CLK,
|
MXC_EPIT_CLK,
|
||||||
MXC_ESAI_CLK,
|
MXC_ESAI_CLK,
|
||||||
@ -57,7 +58,11 @@ enum mxc_clock {
|
|||||||
MXC_SSI1_CLK,
|
MXC_SSI1_CLK,
|
||||||
MXC_SSI2_CLK,
|
MXC_SSI2_CLK,
|
||||||
MXC_UART_CLK,
|
MXC_UART_CLK,
|
||||||
|
/* Other clocks */
|
||||||
MXC_ARM_CLK,
|
MXC_ARM_CLK,
|
||||||
|
MXC_AHB_CLK,
|
||||||
|
MXC_IPG_CLK,
|
||||||
|
MXC_CSPI_CLK,
|
||||||
MXC_FEC_CLK,
|
MXC_FEC_CLK,
|
||||||
MXC_CLK_NUM
|
MXC_CLK_NUM
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user