hibernate.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #include <linux/linkage.h>
  2. #include <asm/blackfin.h>
  3. #include <asm/dpmc.h>
  4. #define PM_STACK (COREA_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
  5. .section .l1.text
  6. ENTRY(_enter_hibernate)
  7. /* switch stack to L1 scratch, prepare for ddr srfr */
  8. P0.H = HI(PM_STACK);
  9. P0.L = LO(PM_STACK);
  10. SP = P0;
  11. call _bf609_ddr_sr;
  12. call _bfin_hibernate_syscontrol;
  13. P0.H = HI(DPM0_RESTORE4);
  14. P0.L = LO(DPM0_RESTORE4);
  15. P1.H = _bf609_pm_data;
  16. P1.L = _bf609_pm_data;
  17. [P0] = P1;
  18. P0.H = HI(DPM0_CTL);
  19. P0.L = LO(DPM0_CTL);
  20. R3.H = HI(0x00000010);
  21. R3.L = LO(0x00000010);
  22. bfin_init_pm_bench_cycles;
  23. [P0] = R3;
  24. SSYNC;
  25. ENDPROC(_enter_hibernate_mode)
  26. .section .text
  27. ENTRY(_bf609_hibernate)
  28. bfin_cpu_reg_save;
  29. bfin_core_mmr_save;
  30. P0.H = _bf609_pm_data;
  31. P0.L = _bf609_pm_data;
  32. R1.H = 0xDEAD;
  33. R1.L = 0xBEEF;
  34. R2.H = .Lpm_resume_here;
  35. R2.L = .Lpm_resume_here;
  36. [P0++] = R1;
  37. [P0++] = R2;
  38. [P0++] = SP;
  39. P1.H = _enter_hibernate;
  40. P1.L = _enter_hibernate;
  41. call (P1);
  42. .Lpm_resume_here:
  43. bfin_core_mmr_restore;
  44. bfin_cpu_reg_restore;
  45. [--sp] = RETI; /* Clear Global Interrupt Disable */
  46. SP += 4;
  47. RTS;
  48. ENDPROC(_bf609_hibernate)