sram.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * arch/arm/plat-omap/include/mach/sram.h
  3. *
  4. * Interface for functions that need to be run in internal SRAM
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ARCH_ARM_OMAP_SRAM_H
  11. #define __ARCH_ARM_OMAP_SRAM_H
  12. #ifndef __ASSEMBLY__
  13. #include <asm/fncpy.h>
  14. extern void *omap_sram_push_address(unsigned long size);
  15. /* Macro to push a function to the internal SRAM, using the fncpy API */
  16. #define omap_sram_push(funcp, size) ({ \
  17. typeof(&(funcp)) _res = NULL; \
  18. void *_sram_address = omap_sram_push_address(size); \
  19. if (_sram_address) \
  20. _res = fncpy(_sram_address, &(funcp), size); \
  21. _res; \
  22. })
  23. extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
  24. extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  25. u32 base_cs, u32 force_unlock);
  26. extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  27. u32 mem_type);
  28. extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
  29. extern u32 omap3_configure_core_dpll(
  30. u32 m2, u32 unlock_dll, u32 f, u32 inc,
  31. u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
  32. u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
  33. u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
  34. u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
  35. extern void omap3_sram_restore_context(void);
  36. /* Do not use these */
  37. extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
  38. extern unsigned long omap1_sram_reprogram_clock_sz;
  39. extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
  40. extern unsigned long omap24xx_sram_reprogram_clock_sz;
  41. extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  42. u32 base_cs, u32 force_unlock);
  43. extern unsigned long omap242x_sram_ddr_init_sz;
  44. extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
  45. int bypass);
  46. extern unsigned long omap242x_sram_set_prcm_sz;
  47. extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  48. u32 mem_type);
  49. extern unsigned long omap242x_sram_reprogram_sdrc_sz;
  50. extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
  51. u32 base_cs, u32 force_unlock);
  52. extern unsigned long omap243x_sram_ddr_init_sz;
  53. extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
  54. int bypass);
  55. extern unsigned long omap243x_sram_set_prcm_sz;
  56. extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
  57. u32 mem_type);
  58. extern unsigned long omap243x_sram_reprogram_sdrc_sz;
  59. extern u32 omap3_sram_configure_core_dpll(
  60. u32 m2, u32 unlock_dll, u32 f, u32 inc,
  61. u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
  62. u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
  63. u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
  64. u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
  65. extern unsigned long omap3_sram_configure_core_dpll_sz;
  66. #ifdef CONFIG_PM
  67. extern void omap_push_sram_idle(void);
  68. #else
  69. static inline void omap_push_sram_idle(void) {}
  70. #endif /* CONFIG_PM */
  71. #endif /* __ASSEMBLY__ */
  72. /*
  73. * OMAP2+: define the SRAM PA addresses.
  74. * Used by the SRAM management code and the idle sleep code.
  75. */
  76. #define OMAP2_SRAM_PA 0x40200000
  77. #define OMAP3_SRAM_PA 0x40200000
  78. #ifdef CONFIG_OMAP4_ERRATA_I688
  79. #define OMAP4_SRAM_PA 0x40304000
  80. #define OMAP4_SRAM_VA 0xfe404000
  81. #else
  82. #define OMAP4_SRAM_PA 0x40300000
  83. #endif
  84. #define AM33XX_SRAM_PA 0x40300000
  85. #endif