| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <soc/sdram.h> |
| 5 |
|
| 6 |
#include "sdram_configs.h" |
| 7 |
|
| 8 |
static struct sdram_params sdram_configs[] = { |
| 9 |
#include "bct/sdram-unused.inc" |
| 10 |
#include "bct/sdram-hynix-2GB-792.inc" |
| 11 |
#include "bct/sdram-unused.inc" |
| 12 |
#include "bct/sdram-unused.inc" |
| 13 |
#include "bct/sdram-hynix-4GB-792.inc" |
| 14 |
#include "bct/sdram-unused.inc" |
| 15 |
#include "bct/sdram-kingston-2GB-792.inc" |
| 16 |
#include "bct/sdram-unused.inc" |
| 17 |
#include "bct/sdram-unused.inc" |
| 18 |
#include "bct/sdram-unused.inc" |
| 19 |
#include "bct/sdram-unused.inc" |
| 20 |
#include "bct/sdram-unused.inc" |
| 21 |
#include "bct/sdram-unused.inc" |
| 22 |
#include "bct/sdram-unused.inc" |
| 23 |
#include "bct/sdram-unused.inc" |
| 24 |
#include "bct/sdram-unused.inc" |
| 25 |
}; |
| 26 |
|
| 27 |
const struct sdram_params *get_sdram_config(void) |
| 28 |
{ |
| 29 |
uint32_t ramcode = sdram_get_ram_code(); |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode); |
| 36 |
if (ramcode >= ARRAY_SIZE(sdram_configs) || |
| 37 |
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) { |
| 38 |
die("Invalid RAMCODE."); |
| 39 |
} |
| 40 |
|
| 41 |
return &sdram_configs[ramcode]; |
| 42 |
} |