stm32mp2_ddr_helpers.h 875 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2024, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP2_DDR_HELPERS_H
  7. #define STM32MP2_DDR_HELPERS_H
  8. #include <stdbool.h>
  9. #include <stdint.h>
  10. #include <drivers/st/stm32mp2_ddr_regs.h>
  11. enum stm32mp2_ddr_sr_mode {
  12. DDR_SR_MODE_INVALID = 0,
  13. DDR_SSR_MODE,
  14. DDR_HSR_MODE,
  15. DDR_ASR_MODE,
  16. };
  17. void ddr_activate_controller(struct stm32mp_ddrctl *ctl, bool sr_entry);
  18. void ddr_wait_lp3_mode(bool state);
  19. int ddr_sr_exit_loop(void);
  20. uint32_t ddr_get_io_calibration_val(void);
  21. int ddr_sr_entry(bool standby);
  22. int ddr_sr_exit(void);
  23. enum stm32mp2_ddr_sr_mode ddr_read_sr_mode(void);
  24. void ddr_set_sr_mode(enum stm32mp2_ddr_sr_mode mode);
  25. void ddr_save_sr_mode(void);
  26. void ddr_restore_sr_mode(void);
  27. void ddr_sub_system_clk_init(void);
  28. void ddr_sub_system_clk_off(void);
  29. #endif /* STM32MP2_DDR_HELPERS_H */