blob: 17874b4aeb9ddd568a98b6facb2c2fb89989e357 [file] [log] [blame]
Angel Pons34b707f2020-04-05 13:21:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Yen Lin727ba2d2015-06-17 17:06:23 -07002
3#include <console/console.h>
4#include <soc/sdram_configs.h>
5
6static struct sdram_params sdram_configs[] = {
7#include "bct/sdram-samsung-3GB-204.inc" /* ram_code = 0000 */
8#include "bct/sdram-unused.inc" /* ram_code = 0001 */
9#include "bct/sdram-unused.inc" /* ram_code = 0010 */
10#include "bct/sdram-unused.inc" /* ram_code = 0011 */
11};
12
13const struct sdram_params *get_sdram_config()
14{
15 uint32_t ramcode = sdram_get_ram_code();
16 /*
17 * If we need to apply some special hacks to RAMCODE mapping (ex, by
18 * board_id), do that now.
19 */
20
21 printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
22 if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
23 sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
24 die("Invalid RAMCODE.");
25 }
26
27 return &sdram_configs[ramcode];
28}