stm32mp_ram.h 903 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP_RAM_H
  7. #define STM32MP_RAM_H
  8. #include <stdbool.h>
  9. #include <drivers/st/stm32mp_ddr.h>
  10. #define PARAM(x, y) \
  11. { \
  12. .name = x, \
  13. .offset = offsetof(struct stm32mp_ddr_config, y), \
  14. .size = sizeof(config.y) / sizeof(uint32_t), \
  15. }
  16. #define CTL_PARAM(x) PARAM("st,ctl-"#x, c_##x)
  17. #define PHY_PARAM(x) PARAM("st,phy-"#x, p_##x)
  18. struct stm32mp_ddr_param {
  19. const char *name; /* Name in DT */
  20. const uint32_t offset; /* Offset in config struct */
  21. const uint32_t size; /* Size of parameters */
  22. };
  23. int stm32mp_ddr_dt_get_info(void *fdt, int node, struct stm32mp_ddr_info *info);
  24. int stm32mp_ddr_dt_get_param(void *fdt, int node, const struct stm32mp_ddr_param *param,
  25. uint32_t param_size, uintptr_t config);
  26. #endif /* STM32MP_RAM_H */