of_memory.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * OpenFirmware helpers for memory drivers
  4. *
  5. * Copyright (C) 2012 Texas Instruments, Inc.
  6. * Copyright (C) 2020 Krzysztof Kozlowski <[email protected]>
  7. */
  8. #ifndef __LINUX_MEMORY_OF_REG_H
  9. #define __LINUX_MEMORY_OF_REG_H
  10. #if defined(CONFIG_OF) && defined(CONFIG_DDR)
  11. const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
  12. struct device *dev);
  13. const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
  14. struct device *dev,
  15. u32 device_type, u32 *nr_frequencies);
  16. const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np,
  17. struct device *dev);
  18. const struct lpddr3_timings *
  19. of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
  20. struct device *dev, u32 device_type, u32 *nr_frequencies);
  21. const struct lpddr2_info *of_lpddr2_get_info(struct device_node *np,
  22. struct device *dev);
  23. #else
  24. static inline const struct lpddr2_min_tck
  25. *of_get_min_tck(struct device_node *np, struct device *dev)
  26. {
  27. return NULL;
  28. }
  29. static inline const struct lpddr2_timings
  30. *of_get_ddr_timings(struct device_node *np_ddr, struct device *dev,
  31. u32 device_type, u32 *nr_frequencies)
  32. {
  33. return NULL;
  34. }
  35. static inline const struct lpddr3_min_tck
  36. *of_lpddr3_get_min_tck(struct device_node *np, struct device *dev)
  37. {
  38. return NULL;
  39. }
  40. static inline const struct lpddr3_timings
  41. *of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
  42. struct device *dev, u32 device_type, u32 *nr_frequencies)
  43. {
  44. return NULL;
  45. }
  46. static inline const struct lpddr2_info
  47. *of_lpddr2_get_info(struct device_node *np, struct device *dev)
  48. {
  49. return NULL;
  50. }
  51. #endif /* CONFIG_OF && CONFIG_DDR */
  52. #endif /* __LINUX_MEMORY_OF_REG_ */