ddrmc-vf610-calibration.h 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * ddrmc DDR3 calibration code for NXP's VF610
  4. *
  5. * Copyright (C) 2018 DENX Software Engineering
  6. * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
  7. *
  8. */
  9. #ifndef __DDRMC_VF610_CALIBRATOIN_H_
  10. #define __DDRMC_VF610_CALIBRATOIN_H_
  11. /*
  12. * Number of "samples" in the calibration bitmap
  13. * to be considered during calibration.
  14. */
  15. #define N_SAMPLES 3
  16. /*
  17. * Constants to indicate if we are looking for a rising or
  18. * falling edge in the calibration bitmap
  19. */
  20. enum edge {
  21. FALLING_EDGE = 1,
  22. RISING_EDGE
  23. };
  24. /*
  25. * The max number of delay elements when DQS to DQ setting
  26. */
  27. #define DDRMC_DQS_DQ_MAX_DELAY 0xFF
  28. /**
  29. * ddrmc_calibration - Vybrid's (VF610) DDR3 calibration code
  30. *
  31. * This function is calculating proper memory controller values
  32. * during run time.
  33. *
  34. * @param ddrmr_regs - memory controller registers
  35. *
  36. * Return: 0 on success, otherwise error code
  37. */
  38. int ddrmc_calibration(struct ddrmr_regs *ddrmr);
  39. #endif /* __DDRMC_VF610_CALIBRATOIN_H_ */