1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include <console/console.h>
11 static const char *sdram_configs
[] = {
12 /* Samsung K4E6E304EB-EGCE */
13 [0] = "sdram-lpddr3-generic-4GB",
15 /* Hynix H9CCNNNBJTALAR */
16 [1] = "sdram-lpddr3-generic-4GB",
18 /* Samsung K4E8E324EB-EGCF */
19 [3] = "sdram-lpddr3-generic-2GB",
21 /* Micron MT52L256M32D1PF */
22 [4] = "sdram-lpddr3-generic-2GB",
24 /* Samsung K4E6E304EB-EGCE, duplicate to 0 */
25 [5] = "sdram-lpddr3-generic-4GB",
27 /* Micron MT52L512M32D2PF */
28 [6] = "sdram-lpddr3-generic-4GB",
31 static struct rk3399_sdram_params params
;
38 static enum dram_speeds
get_sdram_target_mhz(void)
40 if (CONFIG(BOARD_GOOGLE_BOB
) && board_id() < 4)
46 const struct rk3399_sdram_params
*get_sdram_config(void)
52 if (ramcode
>= ARRAY_SIZE(sdram_configs
) ||
53 !snprintf(config_file
, sizeof(config_file
), "%s-%d",
54 sdram_configs
[ramcode
], get_sdram_target_mhz()) ||
55 (cbfs_load(config_file
, ¶ms
, sizeof(params
)) != sizeof(params
)))
56 die("Cannot load SDRAM parameter file!");