弄完CODEC 後,接下來要開始難度較高的Kernel Suspend 了。
聽說AM33x + LPDDR(mDDR) 我們是台灣第一家始用.......
2012/06 /07 :
這幾天稍微修正 BSP 後 ,順利可以suspend , 並且可以順利 Resume ..........
其中有些錯誤 ,
A :Sleep33xx.S 中有ㄧ個暫存器 248是錯誤的, 應該是252。
B: At same file , bl data_macro_cm 確沒有完整得 return , 所以 0xa4 沒有設定。
C: pm33xx.c 中的M3 ipc resume address 是固定的位置 , 應該用計算方式比較好。
另外 , pm33x.h 內要填寫mDDR 的參數 , 在 Resume 時要填回。
這樣就可以 suspend resume 了。
假日在補上 和CODEC 一樣的 Function list 。
:./kernel/power/main.c
state_store()
{
enter_state();
}
:./kernel/power/suspend.c
enter_state()
{
valid_state(); ==> suspend_valid_only_mem();
sys_sync();
suspend_prepare();
pm_restrict_gfp_mask();
suspend_devices_and_enter();
// wakeup Process......
pm_restore_gfp_mask();
suspend_finish();
}
suspend_prepare()
{
pm_prepare_console();
pm_notifier_call_chain();
usermodehelper_disable();
suspend_freeze_processes();
suspend_thaw_processes();
usermodehelper_enable();
}
suspend_devices_and_enter()
{
trace_machine_suspend();
suspend_ops->begin() ==> am33xx_pm_begin();
suspend_console();
suspend_test_start();
dpm_suspend_start();
suspend_test_finish();
suspend_test();
suspend_enter(); // System sleeping..... !
// Resume process......
suspend_test_start();
dpm_resume_end();
suspend_test_finish();
resume_console();
suspend_ops->end ==> am33xx_pm_end();
trace_machine_suspend();
}
suspend_enter()
{
suspend_ops->prepare ==> am33xx_pm_prepare_late();
dpm_suspend_noirq();
suspend_ops->prepare_late ==> xxx
disable_nonboot_cpus();
arch_suspend_disable_irqs();
syscore_suspend();
suspend_ops->enter ==> am33xx_pm_enter(); --> am33xx_pm_suspend();
// Resume Process ....
arch_suspend_enable_irqs();
enable_nonboot_cpus();
suspend_ops->wake ==> xxx
dpm_resume_noirq();
suspend_ops->finish ==> am33xx_pm_finish();
}
am33xx_do_sram_idle()
{
ENTRY(am33xx_do_wfi)
## EMIF config for low power mode .
## Disable EMIF.
## Weak pull down for DQ, DM.
## Disable VTP.
## IO to work in mDDR mode. ==> not ste it
## Enable SRAM LDO ret mode.
## Put the PLLs in bypass mode.
## ==================================
## Relock the PLLs.
## Disable SRAM LDO ret mode.
## IO to work in DDR mode.
## Restore the pull for DQ, DM.
## Enable VTP.
## Enable EMIF.
## Disable EMIF self-refresh.
## ==================================
## Take the PLLs out of LP_BYPASS.
## Disable SRAM LDO ret mode.
## Restore the pull for DQ, DM
## Take out IO of mDDR mode
## Enable VTP
## Restore DDR Setting .
## Enable EMIF
## Disable EMIF self-refresh
.......
}
聽說AM33x + LPDDR(mDDR) 我們是台灣第一家始用.......
2012/06 /07 :
這幾天稍微修正 BSP 後 ,順利可以suspend , 並且可以順利 Resume ..........
其中有些錯誤 ,
A :Sleep33xx.S 中有ㄧ個暫存器 248是錯誤的, 應該是252。
B: At same file , bl data_macro_cm 確沒有完整得 return , 所以 0xa4 沒有設定。
C: pm33xx.c 中的M3 ipc resume address 是固定的位置 , 應該用計算方式比較好。
另外 , pm33x.h 內要填寫mDDR 的參數 , 在 Resume 時要填回。
這樣就可以 suspend resume 了。
假日在補上 和CODEC 一樣的 Function list 。
:./kernel/power/main.c
state_store()
{
enter_state();
}
:./kernel/power/suspend.c
enter_state()
{
valid_state(); ==> suspend_valid_only_mem();
sys_sync();
suspend_prepare();
pm_restrict_gfp_mask();
suspend_devices_and_enter();
// wakeup Process......
pm_restore_gfp_mask();
suspend_finish();
}
suspend_prepare()
{
pm_prepare_console();
pm_notifier_call_chain();
usermodehelper_disable();
suspend_freeze_processes();
suspend_thaw_processes();
usermodehelper_enable();
}
suspend_devices_and_enter()
{
trace_machine_suspend();
suspend_ops->begin() ==> am33xx_pm_begin();
suspend_console();
suspend_test_start();
dpm_suspend_start();
suspend_test_finish();
suspend_test();
suspend_enter(); // System sleeping..... !
// Resume process......
suspend_test_start();
dpm_resume_end();
suspend_test_finish();
resume_console();
suspend_ops->end ==> am33xx_pm_end();
trace_machine_suspend();
}
suspend_enter()
{
suspend_ops->prepare ==> am33xx_pm_prepare_late();
dpm_suspend_noirq();
suspend_ops->prepare_late ==> xxx
disable_nonboot_cpus();
arch_suspend_disable_irqs();
syscore_suspend();
suspend_ops->enter ==> am33xx_pm_enter(); --> am33xx_pm_suspend();
// Resume Process ....
arch_suspend_enable_irqs();
enable_nonboot_cpus();
suspend_ops->wake ==> xxx
dpm_resume_noirq();
suspend_ops->finish ==> am33xx_pm_finish();
}
am33xx_do_sram_idle()
{
ENTRY(am33xx_do_wfi)
## EMIF config for low power mode .
## Disable EMIF.
## Weak pull down for DQ, DM.
## Disable VTP.
## IO to work in mDDR mode. ==> not ste it
## Enable SRAM LDO ret mode.
## Put the PLLs in bypass mode.
## ==================================
## Relock the PLLs.
## Disable SRAM LDO ret mode.
## IO to work in DDR mode.
## Restore the pull for DQ, DM.
## Enable VTP.
## Enable EMIF.
## Disable EMIF self-refresh.
## ==================================
## Take the PLLs out of LP_BYPASS.
## Disable SRAM LDO ret mode.
## Restore the pull for DQ, DM
## Take out IO of mDDR mode
## Enable VTP
## Restore DDR Setting .
## Enable EMIF
## Disable EMIF self-refresh
.......
}
沒有留言:
張貼留言