stm32mp1_ddr_helpers.c 542 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2017-2022, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <drivers/st/stm32mp1_ddr_helpers.h>
  7. #include <lib/mmio.h>
  8. #include <platform_def.h>
  9. void ddr_enable_clock(void)
  10. {
  11. stm32mp1_clk_rcc_regs_lock();
  12. mmio_setbits_32(stm32mp_rcc_base() + RCC_DDRITFCR,
  13. RCC_DDRITFCR_DDRC1EN |
  14. #if STM32MP_DDR_DUAL_AXI_PORT
  15. RCC_DDRITFCR_DDRC2EN |
  16. #endif
  17. RCC_DDRITFCR_DDRPHYCEN |
  18. RCC_DDRITFCR_DDRPHYCAPBEN |
  19. RCC_DDRITFCR_DDRCAPBEN);
  20. stm32mp1_clk_rcc_regs_unlock();
  21. }