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