summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/system-imx31.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/system-imx31.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/system-imx31.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c
index b3f0fd66c9..c710c5b93c 100644
--- a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c
@@ -49,7 +49,7 @@ unsigned int iim_prod_rev(void)
49static void iim_init(void) 49static void iim_init(void)
50{ 50{
51 /* Initialize the IC revision info (required by SDMA) */ 51 /* Initialize the IC revision info (required by SDMA) */
52 imx31_clkctl_module_clock_gating(CG_IIM, CGM_ON_ALL); 52 ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT);
53 product_rev = IIM_PREV; 53 product_rev = IIM_PREV;
54 system_rev = IIM_SREV; 54 system_rev = IIM_SREV;
55} 55}
@@ -59,13 +59,13 @@ static void iim_init(void)
59/* Initialize the watchdog timer */ 59/* Initialize the watchdog timer */
60void watchdog_init(unsigned int half_seconds) 60void watchdog_init(unsigned int half_seconds)
61{ 61{
62 uint16_t wcr = WDOG_WCR_WTw(half_seconds) | /* Timeout */ 62 uint16_t wcr = ((half_seconds << WDOG_WCR_WT_POS) & WDOG_WCR_WT) |
63 WDOG_WCR_WOE | /* WDOG output enabled */ 63 WDOG_WCR_WOE | /* WDOG output enabled */
64 WDOG_WCR_WDA | /* WDOG assertion - no effect */ 64 WDOG_WCR_WDA | /* WDOG assertion - no effect */
65 WDOG_WCR_SRS | /* System reset - no effect */ 65 WDOG_WCR_SRS | /* System reset - no effect */
66 WDOG_WCR_WRE; /* Generate a WDOG signal */ 66 WDOG_WCR_WRE; /* Generate a WDOG signal */
67 67
68 imx31_clkctl_module_clock_gating(CG_WDOG, CGM_ON_RUN_WAIT); 68 ccm_module_clock_gating(CG_WDOG, CGM_ON_RUN_WAIT);
69 69
70 WDOG_WCR = wcr; 70 WDOG_WCR = wcr;
71 WDOG_WSR = 0x5555; 71 WDOG_WSR = 0x5555;
@@ -86,8 +86,8 @@ void watchdog_service(void)
86/* Start the general-purpose timer (1MHz) */ 86/* Start the general-purpose timer (1MHz) */
87void gpt_start(void) 87void gpt_start(void)
88{ 88{
89 imx31_clkctl_module_clock_gating(CG_GPT, CGM_ON_RUN_WAIT); 89 ccm_module_clock_gating(CG_GPT, CGM_ON_RUN_WAIT);
90 unsigned int ipg_mhz = imx31_clkctl_get_ipg_clk() / 1000000; 90 unsigned int ipg_mhz = ccm_get_ipg_clk() / 1000000;
91 91
92 GPTCR &= ~GPTCR_EN; /* Disable counter */ 92 GPTCR &= ~GPTCR_EN; /* Disable counter */
93 GPTCR |= GPTCR_SWR; /* Reset module */ 93 GPTCR |= GPTCR_SWR; /* Reset module */
@@ -123,7 +123,7 @@ void system_reboot(void)
123void system_exception_wait(void) 123void system_exception_wait(void)
124{ 124{
125 /* Called in many contexts so button reading may be a chore */ 125 /* Called in many contexts so button reading may be a chore */
126 avic_disable_int(ALL); 126 avic_disable_int(INT_ALL);
127 core_idle(); 127 core_idle();
128 while (1); 128 while (1);
129} 129}
@@ -174,8 +174,8 @@ void system_init(void)
174 174
175 unsigned int i; 175 unsigned int i;
176 176
177 /* MCR WFI enables wait mode */ 177 /* MCR WFI enables wait mode (CCM_CCMR_LPM_WAIT_MODE = 0) */
178 CLKCTL_CCMR &= ~(3 << 14); 178 imx31_regclr32(&CCM_CCMR, CCM_CCMR_LPM);
179 179
180 iim_init(); 180 iim_init();
181 181
@@ -189,7 +189,7 @@ void system_init(void)
189 imx31_regclr32(&UCR1_5, EUARTUCR1_UARTEN); 189 imx31_regclr32(&UCR1_5, EUARTUCR1_UARTEN);
190 190
191 for (i = 0; i < ARRAYLEN(disable_clocks); i++) 191 for (i = 0; i < ARRAYLEN(disable_clocks); i++)
192 imx31_clkctl_module_clock_gating(disable_clocks[i], CGM_OFF); 192 ccm_module_clock_gating(disable_clocks[i], CGM_OFF);
193 193
194 avic_init(); 194 avic_init();
195 gpt_start(); 195 gpt_start();
@@ -242,7 +242,7 @@ void __attribute__((naked)) imx31_regclr32(volatile uint32_t *reg_p,
242void system_prepare_fw_start(void) 242void system_prepare_fw_start(void)
243{ 243{
244 disable_interrupt(IRQ_FIQ_STATUS); 244 disable_interrupt(IRQ_FIQ_STATUS);
245 avic_disable_int(ALL); 245 avic_disable_int(INT_ALL);
246 mc13783_close(); 246 mc13783_close();
247 tick_stop(); 247 tick_stop();
248} 248}