dram_port.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2018 Marvell International Ltd.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. * https://spdx.org/licenses
  6. */
  7. #include <arch_helpers.h>
  8. #include <common/debug.h>
  9. #include <mv_ddr_if.h>
  10. #include <plat_marvell.h>
  11. /*
  12. * This function may modify the default DRAM parameters
  13. * based on information received from SPD or bootloader
  14. * configuration located on non volatile storage
  15. */
  16. void plat_marvell_dram_update_topology(void)
  17. {
  18. }
  19. /*
  20. * This struct provides the DRAM training code with
  21. * the appropriate board DRAM configuration
  22. */
  23. static struct mv_ddr_topology_map board_topology_map = {
  24. /* FIXME: MISL board 2CS 4Gb x8 devices of micron - 2133P */
  25. DEBUG_LEVEL_ERROR,
  26. 0x1, /* active interfaces */
  27. /* cs_mask, mirror, dqs_swap, ck_swap X subphys */
  28. { { { {0x3, 0x2, 0, 0},
  29. {0x3, 0x2, 0, 0},
  30. {0x3, 0x2, 0, 0},
  31. {0x3, 0x2, 0, 0},
  32. {0x3, 0x2, 0, 0},
  33. {0x3, 0x2, 0, 0},
  34. {0x3, 0x2, 0, 0},
  35. {0x3, 0x2, 0, 0},
  36. {0x3, 0x2, 0, 0} },
  37. SPEED_BIN_DDR_2133P, /* speed_bin */
  38. MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
  39. MV_DDR_DIE_CAP_4GBIT, /* die capacity */
  40. MV_DDR_FREQ_SAR, /* frequency */
  41. 0, 0, /* cas_l, cas_wl */
  42. MV_DDR_TEMP_LOW} }, /* temperature */
  43. MV_DDR_32BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
  44. MV_DDR_CFG_DEFAULT, /* ddr configuration data source */
  45. NOT_COMBINED, /* ddr twin-die combined*/
  46. { {0} }, /* raw spd data */
  47. {0}, /* timing parameters */
  48. { /* electrical configuration */
  49. { /* memory electrical configuration */
  50. MV_DDR_RTT_NOM_PARK_RZQ_DISABLE, /* rtt_nom */
  51. {
  52. MV_DDR_RTT_NOM_PARK_RZQ_DIV4, /* rtt_park 1cs */
  53. MV_DDR_RTT_NOM_PARK_RZQ_DIV1 /* rtt_park 2cs */
  54. },
  55. {
  56. MV_DDR_RTT_WR_DYN_ODT_OFF, /* rtt_wr 1cs */
  57. MV_DDR_RTT_WR_RZQ_DIV2 /* rtt_wr 2cs */
  58. },
  59. MV_DDR_DIC_RZQ_DIV7 /* dic */
  60. },
  61. { /* phy electrical configuration */
  62. MV_DDR_OHM_30, /* data_drv_p */
  63. MV_DDR_OHM_30, /* data_drv_n */
  64. MV_DDR_OHM_30, /* ctrl_drv_p */
  65. MV_DDR_OHM_30, /* ctrl_drv_n */
  66. {
  67. MV_DDR_OHM_60, /* odt_p 1cs */
  68. MV_DDR_OHM_120 /* odt_p 2cs */
  69. },
  70. {
  71. MV_DDR_OHM_60, /* odt_n 1cs */
  72. MV_DDR_OHM_120 /* odt_n 2cs */
  73. },
  74. },
  75. { /* mac electrical configuration */
  76. MV_DDR_ODT_CFG_NORMAL, /* odtcfg_pattern */
  77. MV_DDR_ODT_CFG_ALWAYS_ON, /* odtcfg_write */
  78. MV_DDR_ODT_CFG_NORMAL, /* odtcfg_read */
  79. },
  80. }
  81. };
  82. struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
  83. {
  84. /* Return the board topology as defined in the board code */
  85. return &board_topology_map;
  86. }