diff options
-rw-r--r-- | arch/blackfin/Kconfig | 114 | ||||
-rw-r--r-- | arch/blackfin/configs/BF609-EZKIT_defconfig | 5 | ||||
-rw-r--r-- | arch/blackfin/include/asm/dpmc.h | 12 | ||||
-rw-r--r-- | arch/blackfin/mach-bf609/pm.c | 83 | ||||
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 3 | ||||
-rw-r--r-- | arch/blackfin/mach-common/pm.c | 4 |
6 files changed, 192 insertions, 29 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 4e48e72291a9..383e7ecda923 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -1256,7 +1256,7 @@ config ARCH_SUSPEND_POSSIBLE | |||
1256 | 1256 | ||
1257 | choice | 1257 | choice |
1258 | prompt "Standby Power Saving Mode" | 1258 | prompt "Standby Power Saving Mode" |
1259 | depends on PM | 1259 | depends on PM && !BF60x |
1260 | default PM_BFIN_SLEEP_DEEPER | 1260 | default PM_BFIN_SLEEP_DEEPER |
1261 | config PM_BFIN_SLEEP_DEEPER | 1261 | config PM_BFIN_SLEEP_DEEPER |
1262 | bool "Sleep Deeper" | 1262 | bool "Sleep Deeper" |
@@ -1311,6 +1311,118 @@ config PM_BFIN_WAKE_GP | |||
1311 | On ADSP-BF549 this option enables the the same functionality on the | 1311 | On ADSP-BF549 this option enables the the same functionality on the |
1312 | /MRXON pin also PH7. | 1312 | /MRXON pin also PH7. |
1313 | 1313 | ||
1314 | config PM_BFIN_WAKE_PA15 | ||
1315 | bool "Allow Wake-Up from PA15" | ||
1316 | depends on PM && BF60x | ||
1317 | default n | ||
1318 | help | ||
1319 | Enable PA15 Wake-Up | ||
1320 | |||
1321 | config PM_BFIN_WAKE_PA15_POL | ||
1322 | int "Wake-up priority" | ||
1323 | depends on PM_BFIN_WAKE_PA15 | ||
1324 | default 0 | ||
1325 | help | ||
1326 | Wake-Up priority 0(low) 1(high) | ||
1327 | |||
1328 | config PM_BFIN_WAKE_PB15 | ||
1329 | bool "Allow Wake-Up from PB15" | ||
1330 | depends on PM && BF60x | ||
1331 | default n | ||
1332 | help | ||
1333 | Enable PB15 Wake-Up | ||
1334 | |||
1335 | config PM_BFIN_WAKE_PB15_POL | ||
1336 | int "Wake-up priority" | ||
1337 | depends on PM_BFIN_WAKE_PB15 | ||
1338 | default 0 | ||
1339 | help | ||
1340 | Wake-Up priority 0(low) 1(high) | ||
1341 | |||
1342 | config PM_BFIN_WAKE_PC15 | ||
1343 | bool "Allow Wake-Up from PC15" | ||
1344 | depends on PM && BF60x | ||
1345 | default n | ||
1346 | help | ||
1347 | Enable PC15 Wake-Up | ||
1348 | |||
1349 | config PM_BFIN_WAKE_PC15_POL | ||
1350 | int "Wake-up priority" | ||
1351 | depends on PM_BFIN_WAKE_PC15 | ||
1352 | default 0 | ||
1353 | help | ||
1354 | Wake-Up priority 0(low) 1(high) | ||
1355 | |||
1356 | config PM_BFIN_WAKE_PD06 | ||
1357 | bool "Allow Wake-Up from PD06(ETH0_PHYINT)" | ||
1358 | depends on PM && BF60x | ||
1359 | default n | ||
1360 | help | ||
1361 | Enable PD06(ETH0_PHYINT) Wake-up | ||
1362 | |||
1363 | config PM_BFIN_WAKE_PD06_POL | ||
1364 | int "Wake-up priority" | ||
1365 | depends on PM_BFIN_WAKE_PD06 | ||
1366 | default 0 | ||
1367 | help | ||
1368 | Wake-Up priority 0(low) 1(high) | ||
1369 | |||
1370 | config PM_BFIN_WAKE_PE12 | ||
1371 | bool "Allow Wake-Up from PE12(ETH1_PHYINT, PUSH BUTTON)" | ||
1372 | depends on PM && BF60x | ||
1373 | default n | ||
1374 | help | ||
1375 | Enable PE12(ETH1_PHYINT, PUSH BUTTON) Wake-up | ||
1376 | |||
1377 | config PM_BFIN_WAKE_PE12_POL | ||
1378 | int "Wake-up priority" | ||
1379 | depends on PM_BFIN_WAKE_PE12 | ||
1380 | default 0 | ||
1381 | help | ||
1382 | Wake-Up priority 0(low) 1(high) | ||
1383 | |||
1384 | config PM_BFIN_WAKE_PG04 | ||
1385 | bool "Allow Wake-Up from PG04(CAN0_RX)" | ||
1386 | depends on PM && BF60x | ||
1387 | default n | ||
1388 | help | ||
1389 | Enable PG04(CAN0_RX) Wake-up | ||
1390 | |||
1391 | config PM_BFIN_WAKE_PG04_POL | ||
1392 | int "Wake-up priority" | ||
1393 | depends on PM_BFIN_WAKE_PG04 | ||
1394 | default 0 | ||
1395 | help | ||
1396 | Wake-Up priority 0(low) 1(high) | ||
1397 | |||
1398 | config PM_BFIN_WAKE_PG13 | ||
1399 | bool "Allow Wake-Up from PG13" | ||
1400 | depends on PM && BF60x | ||
1401 | default n | ||
1402 | help | ||
1403 | Enable PG13 Wake-Up | ||
1404 | |||
1405 | config PM_BFIN_WAKE_PG13_POL | ||
1406 | int "Wake-up priority" | ||
1407 | depends on PM_BFIN_WAKE_PG13 | ||
1408 | default 0 | ||
1409 | help | ||
1410 | Wake-Up priority 0(low) 1(high) | ||
1411 | |||
1412 | config PM_BFIN_WAKE_USB | ||
1413 | bool "Allow Wake-Up from (USB)" | ||
1414 | depends on PM && BF60x | ||
1415 | default n | ||
1416 | help | ||
1417 | Enable (USB) Wake-up | ||
1418 | |||
1419 | config PM_BFIN_WAKE_USB_POL | ||
1420 | int "Wake-up priority" | ||
1421 | depends on PM_BFIN_WAKE_USB | ||
1422 | default 0 | ||
1423 | help | ||
1424 | Wake-Up priority 0(low) 1(high) | ||
1425 | |||
1314 | endmenu | 1426 | endmenu |
1315 | 1427 | ||
1316 | menu "CPU Frequency scaling" | 1428 | menu "CPU Frequency scaling" |
diff --git a/arch/blackfin/configs/BF609-EZKIT_defconfig b/arch/blackfin/configs/BF609-EZKIT_defconfig index 0864f7aaa572..be9526bee4fb 100644 --- a/arch/blackfin/configs/BF609-EZKIT_defconfig +++ b/arch/blackfin/configs/BF609-EZKIT_defconfig | |||
@@ -33,7 +33,8 @@ CONFIG_CPLB_SWITCH_TAB_L1=y | |||
33 | CONFIG_NOMMU_INITIAL_TRIM_EXCESS=0 | 33 | CONFIG_NOMMU_INITIAL_TRIM_EXCESS=0 |
34 | CONFIG_BINFMT_FLAT=y | 34 | CONFIG_BINFMT_FLAT=y |
35 | CONFIG_BINFMT_ZFLAT=y | 35 | CONFIG_BINFMT_ZFLAT=y |
36 | # CONFIG_SUSPEND is not set | 36 | CONFIG_PM_BFIN_WAKE_PE12=y |
37 | CONFIG_PM_BFIN_WAKE_PE12_POL=1 | ||
37 | CONFIG_CPU_FREQ=y | 38 | CONFIG_CPU_FREQ=y |
38 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y | 39 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y |
39 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y | 40 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y |
@@ -119,7 +120,7 @@ CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61=m | |||
119 | CONFIG_SND_SOC_ALL_CODECS=m | 120 | CONFIG_SND_SOC_ALL_CODECS=m |
120 | CONFIG_USB=y | 121 | CONFIG_USB=y |
121 | CONFIG_USB_MUSB_HDRC=y | 122 | CONFIG_USB_MUSB_HDRC=y |
122 | CONFIG_USB_MUSB_BLACKFIN=y | 123 | CONFIG_USB_MUSB_BLACKFIN=m |
123 | CONFIG_USB_STORAGE=y | 124 | CONFIG_USB_STORAGE=y |
124 | CONFIG_USB_GADGET=y | 125 | CONFIG_USB_GADGET=y |
125 | CONFIG_USB_GADGET_MUSB_HDRC=y | 126 | CONFIG_USB_GADGET_MUSB_HDRC=y |
diff --git a/arch/blackfin/include/asm/dpmc.h b/arch/blackfin/include/asm/dpmc.h index b47399cda6ed..528f47685781 100644 --- a/arch/blackfin/include/asm/dpmc.h +++ b/arch/blackfin/include/asm/dpmc.h | |||
@@ -729,6 +729,16 @@ | |||
729 | #define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */ | 729 | #define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */ |
730 | #endif | 730 | #endif |
731 | 731 | ||
732 | #ifdef CONFIG_BF60x | ||
733 | #define PA15WE 0x00000001 /* Allow Wake-Up from PA15 */ | ||
734 | #define PB15WE 0x00000002 /* Allow Wake-Up from PB15 */ | ||
735 | #define PC15WE 0x00000004 /* Allow Wake-Up from PC15 */ | ||
736 | #define PD06WE 0x00000008 /* Allow Wake-Up from PD06(ETH0_PHYINT) */ | ||
737 | #define PE12WE 0x00000010 /* Allow Wake-Up from PE12(ETH1_PHYINT, PUSH BUTTON) */ | ||
738 | #define PG04WE 0x00000020 /* Allow Wake-Up from PG04(CAN0_RX) */ | ||
739 | #define PG13WE 0x00000040 /* Allow Wake-Up from PG13 */ | ||
740 | #define USBWE 0x00000080 /* Allow Wake-Up from (USB) */ | ||
741 | #else | ||
732 | #define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */ | 742 | #define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */ |
733 | #define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */ | 743 | #define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */ |
734 | #define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */ | 744 | #define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */ |
@@ -744,7 +754,7 @@ | |||
744 | #else | 754 | #else |
745 | #define USBWE 0x0800 /* Enable USB Wakeup From Hibernate */ | 755 | #define USBWE 0x0800 /* Enable USB Wakeup From Hibernate */ |
746 | #endif | 756 | #endif |
747 | 757 | #endif | |
748 | 758 | ||
749 | #ifndef __ASSEMBLY__ | 759 | #ifndef __ASSEMBLY__ |
750 | 760 | ||
diff --git a/arch/blackfin/mach-bf609/pm.c b/arch/blackfin/mach-bf609/pm.c index bbc5a79b5e22..79cdf41096c2 100644 --- a/arch/blackfin/mach-bf609/pm.c +++ b/arch/blackfin/mach-bf609/pm.c | |||
@@ -212,6 +212,65 @@ void bfin_hibernate(unsigned long mask) | |||
212 | void bf609_cpu_pm_enter(suspend_state_t state) | 212 | void bf609_cpu_pm_enter(suspend_state_t state) |
213 | { | 213 | { |
214 | int error; | 214 | int error; |
215 | unsigned long wakeup = 0; | ||
216 | unsigned long wakeup_pol = 0; | ||
217 | |||
218 | #ifdef CONFIG_PM_BFIN_WAKE_PA15 | ||
219 | wakeup |= PA15WE; | ||
220 | # if CONFIG_PM_BFIN_WAKE_PA15_POL | ||
221 | wakeup_pol |= PA15WE; | ||
222 | # endif | ||
223 | #endif | ||
224 | |||
225 | #ifdef CONFIG_PM_BFIN_WAKE_PB15 | ||
226 | wakeup |= PB15WE; | ||
227 | # if CONFIG_PM_BFIN_WAKE_PA15_POL | ||
228 | wakeup_pol |= PB15WE; | ||
229 | # endif | ||
230 | #endif | ||
231 | |||
232 | #ifdef CONFIG_PM_BFIN_WAKE_PC15 | ||
233 | wakeup |= PC15WE; | ||
234 | # if CONFIG_PM_BFIN_WAKE_PC15_POL | ||
235 | wakeup_pol |= PC15WE; | ||
236 | # endif | ||
237 | #endif | ||
238 | |||
239 | #ifdef CONFIG_PM_BFIN_WAKE_PD06 | ||
240 | wakeup |= PD06WE; | ||
241 | # if CONFIG_PM_BFIN_WAKE_PD06_POL | ||
242 | wakeup_pol |= PD06WE; | ||
243 | # endif | ||
244 | #endif | ||
245 | |||
246 | #ifdef CONFIG_PM_BFIN_WAKE_PE12 | ||
247 | wakeup |= PE12WE; | ||
248 | # if CONFIG_PM_BFIN_WAKE_PE12_POL | ||
249 | wakeup_pol |= PE12WE; | ||
250 | # endif | ||
251 | #endif | ||
252 | |||
253 | #ifdef CONFIG_PM_BFIN_WAKE_PG04 | ||
254 | wakeup |= PG04WE; | ||
255 | # if CONFIG_PM_BFIN_WAKE_PG04_POL | ||
256 | wakeup_pol |= PG04WE; | ||
257 | # endif | ||
258 | #endif | ||
259 | |||
260 | #ifdef CONFIG_PM_BFIN_WAKE_PG13 | ||
261 | wakeup |= PG13WE; | ||
262 | # if CONFIG_PM_BFIN_WAKE_PG13_POL | ||
263 | wakeup_pol |= PG13WE; | ||
264 | # endif | ||
265 | #endif | ||
266 | |||
267 | #ifdef CONFIG_PM_BFIN_WAKE_USB | ||
268 | wakeup |= USBWE; | ||
269 | # if CONFIG_PM_BFIN_WAKE_USB_POL | ||
270 | wakeup_pol |= USBWE; | ||
271 | # endif | ||
272 | #endif | ||
273 | |||
215 | error = irq_set_irq_wake(255, 1); | 274 | error = irq_set_irq_wake(255, 1); |
216 | if(error < 0) | 275 | if(error < 0) |
217 | printk(KERN_DEBUG "Unable to get irq wake\n"); | 276 | printk(KERN_DEBUG "Unable to get irq wake\n"); |
@@ -220,9 +279,9 @@ void bf609_cpu_pm_enter(suspend_state_t state) | |||
220 | printk(KERN_DEBUG "Unable to get irq wake\n"); | 279 | printk(KERN_DEBUG "Unable to get irq wake\n"); |
221 | 280 | ||
222 | if (state == PM_SUSPEND_STANDBY) | 281 | if (state == PM_SUSPEND_STANDBY) |
223 | bfin_deepsleep(0xffff); | 282 | bfin_deepsleep(wakeup); |
224 | else { | 283 | else { |
225 | bfin_hibernate(0xffff); | 284 | bfin_hibernate(wakeup); |
226 | } | 285 | } |
227 | } | 286 | } |
228 | 287 | ||
@@ -263,26 +322,8 @@ static int __init bf609_init_pm(void) | |||
263 | { | 322 | { |
264 | int irq; | 323 | int irq; |
265 | int error; | 324 | int error; |
266 | error = gpio_request(GPIO_PG4, "gpiopg4"); | ||
267 | if (error < 0) { | ||
268 | printk(KERN_DEBUG "failed to request GPIO %d, error %d\n", | ||
269 | GPIO_PG4, error); | ||
270 | } | ||
271 | |||
272 | irq = gpio_to_irq(GPIO_PG4); | ||
273 | if (irq < 0) { | ||
274 | error = irq; | ||
275 | printk(KERN_DEBUG "Unable to get irq number for GPIO %d, error %d\n", | ||
276 | GPIO_PG4, error); | ||
277 | } | ||
278 | |||
279 | printk(KERN_DEBUG "%s gpio %d irq %d\n", __func__, GPIO_PG4, irq); | ||
280 | |||
281 | error = request_irq(irq, test_isr, IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND, "gpiopg4", NULL); | ||
282 | if(error < 0) | ||
283 | printk(KERN_DEBUG "Unable to get irq\n"); | ||
284 | 325 | ||
285 | #if 1 | 326 | #if CONFIG_PM_BFIN_WAKE_PE12 |
286 | irq = gpio_to_irq(GPIO_PE12); | 327 | irq = gpio_to_irq(GPIO_PE12); |
287 | if (irq < 0) { | 328 | if (irq < 0) { |
288 | error = irq; | 329 | error = irq; |
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 1146a6152ae6..2729cba715b0 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -437,7 +437,7 @@ static void bfin_internal_unmask_irq_chip(struct irq_data *d) | |||
437 | } | 437 | } |
438 | #endif | 438 | #endif |
439 | 439 | ||
440 | #ifdef CONFIG_PM | 440 | #if defined(CONFIG_PM) && !defined(CONFIG_BF60x) |
441 | int bfin_internal_set_wake(unsigned int irq, unsigned int state) | 441 | int bfin_internal_set_wake(unsigned int irq, unsigned int state) |
442 | { | 442 | { |
443 | u32 bank, bit, wakeup = 0; | 443 | u32 bank, bit, wakeup = 0; |
@@ -496,6 +496,7 @@ static int bfin_internal_set_wake_chip(struct irq_data *d, unsigned int state) | |||
496 | return bfin_internal_set_wake(d->irq, state); | 496 | return bfin_internal_set_wake(d->irq, state); |
497 | } | 497 | } |
498 | #else | 498 | #else |
499 | # define bfin_internal_set_wake(irq, state) | ||
499 | # define bfin_internal_set_wake_chip NULL | 500 | # define bfin_internal_set_wake_chip NULL |
500 | #endif | 501 | #endif |
501 | 502 | ||
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index c25c2f1c819c..610a3cdf3998 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c | |||
@@ -153,9 +153,6 @@ int bfin_pm_suspend_mem_enter(void) | |||
153 | 153 | ||
154 | #ifndef CONFIG_BF60x | 154 | #ifndef CONFIG_BF60x |
155 | wakeup = bfin_read_VR_CTL() & ~FREQ; | 155 | wakeup = bfin_read_VR_CTL() & ~FREQ; |
156 | #else | ||
157 | |||
158 | #endif | ||
159 | wakeup |= SCKELOW; | 156 | wakeup |= SCKELOW; |
160 | 157 | ||
161 | #ifdef CONFIG_PM_BFIN_WAKE_PH6 | 158 | #ifdef CONFIG_PM_BFIN_WAKE_PH6 |
@@ -164,6 +161,7 @@ int bfin_pm_suspend_mem_enter(void) | |||
164 | #ifdef CONFIG_PM_BFIN_WAKE_GP | 161 | #ifdef CONFIG_PM_BFIN_WAKE_GP |
165 | wakeup |= GPWE; | 162 | wakeup |= GPWE; |
166 | #endif | 163 | #endif |
164 | #endif | ||
167 | 165 | ||
168 | ret = blackfin_dma_suspend(); | 166 | ret = blackfin_dma_suspend(); |
169 | 167 | ||