diff --git a/board/sharp/common/Makefile b/board/sharp/common/Makefile index 6eead34a16..c0ffa51bcf 100644 --- a/board/sharp/common/Makefile +++ b/board/sharp/common/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_VIDEO_MXS) += dma.o else obj- = __dummy__.o endif +obj-y := cpu_clkdiv.o \ No newline at end of file diff --git a/board/sharp/common/cpu_clkdiv.c b/board/sharp/common/cpu_clkdiv.c new file mode 100644 index 0000000000..a8b0d9064e --- /dev/null +++ b/board/sharp/common/cpu_clkdiv.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +void mxs_set_divcpu(uint8_t clkdiv) { + struct mxs_clkctrl_regs *clkctrl_regs = + (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE; + uint32_t clkctrl; + clkctrl = readl(&clkctrl_regs->hw_clkctrl_cpu); + clkctrl &= ~0x3F; + clkctrl |= (clkdiv & 0x3F); + writel(clkctrl, &clkctrl_regs->hw_clkctrl_cpu); +} diff --git a/board/sharp/common/cpu_clkdiv.h b/board/sharp/common/cpu_clkdiv.h new file mode 100644 index 0000000000..a5e18c7a1c --- /dev/null +++ b/board/sharp/common/cpu_clkdiv.h @@ -0,0 +1,3 @@ +#include + +void mxs_set_divcpu(uint8_t clkdiv); \ No newline at end of file diff --git a/board/sharp/pwa7200/pwa7200.c b/board/sharp/pwa7200/pwa7200.c index 648b88a8a8..75c5305a3a 100644 --- a/board/sharp/pwa7200/pwa7200.c +++ b/board/sharp/pwa7200/pwa7200.c @@ -29,6 +29,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -46,6 +47,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwa7400/pwa7400.c b/board/sharp/pwa7400/pwa7400.c index 0b6e142313..532ec6dcab 100644 --- a/board/sharp/pwa7400/pwa7400.c +++ b/board/sharp/pwa7400/pwa7400.c @@ -29,6 +29,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -46,6 +47,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh1/pwsh1.c b/board/sharp/pwsh1/pwsh1.c index c967048a81..17b1480d5a 100644 --- a/board/sharp/pwsh1/pwsh1.c +++ b/board/sharp/pwsh1/pwsh1.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh2/pwsh2.c b/board/sharp/pwsh2/pwsh2.c index 73871307a1..e657d6f172 100644 --- a/board/sharp/pwsh2/pwsh2.c +++ b/board/sharp/pwsh2/pwsh2.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh3/pwsh3.c b/board/sharp/pwsh3/pwsh3.c index 39c3ea0b58..5acc3e86ff 100644 --- a/board/sharp/pwsh3/pwsh3.c +++ b/board/sharp/pwsh3/pwsh3.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh4/pwsh4.c b/board/sharp/pwsh4/pwsh4.c index 27275495c1..69b032f3cd 100644 --- a/board/sharp/pwsh4/pwsh4.c +++ b/board/sharp/pwsh4/pwsh4.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh5/pwsh5.c b/board/sharp/pwsh5/pwsh5.c index 9da5814a3c..3bc99e6a4e 100644 --- a/board/sharp/pwsh5/pwsh5.c +++ b/board/sharp/pwsh5/pwsh5.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh6/pwsh6.c b/board/sharp/pwsh6/pwsh6.c index 5e5585ea11..f8d3f04c8b 100644 --- a/board/sharp/pwsh6/pwsh6.c +++ b/board/sharp/pwsh6/pwsh6.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); diff --git a/board/sharp/pwsh7/pwsh7.c b/board/sharp/pwsh7/pwsh7.c index f5b199ccac..ca9df9431a 100644 --- a/board/sharp/pwsh7/pwsh7.c +++ b/board/sharp/pwsh7/pwsh7.c @@ -26,6 +26,7 @@ #include #include "../common/lcd.h" +#include "../common/cpu_clkdiv.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,6 +44,8 @@ int board_early_init_f(void) mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); /* SSP1 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK1, 96000, 0); + /* set cpu clock div 1(480MHz)*/ + mxs_set_divcpu(1); #ifdef CONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT);