coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sdram_configs.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <boardid.h>
4 #include <console/console.h>
5 #include <soc/emi.h>
6 
7 static const struct mt8173_sdram_params sdram_configs[] = {
8 #include "sdram_inf/sdram-lpddr3-H9CCNNN8GTMLAR-2GB.inc" /* ram_code = 0000 */
9 #include "sdram_inf/sdram-lpddr3-K4E8E304EE-2GB.inc" /* ram_code = 0001 */
10 #include "sdram_inf/sdram-lpddr3-K4E6E304EE-4GB.inc" /* ram_code = 0010 */
11 #include "sdram_inf/sdram-lpddr3-H9CCNNNBLTBLAR-4GB.inc" /* ram_code = 0011 */
12 #include "sdram_inf/sdram-lpddr3-K4E6E304EB-4GB.inc" /* ram_code = 0100 */
13 #include "sdram_inf/sdram-lpddr3-K4E8E324EB-2GB.inc" /* ram_code = 0101 */
14 #include "sdram_inf/sdram-lpddr3-MT52L512M32D2PF-4GB.inc" /* ram_code = 0110 */
15 #include "sdram_inf/sdram-lpddr3-H9CCNNNBJTALAR-4GB.inc" /* ram_code = 0111 */
16 #include "sdram_inf/sdram-lpddr3-MT52L256M32D1PF-2GB.inc" /* ram_code = 1000 */
17 #include "sdram_inf/sdram-lpddr3-K4E6E304ED-4GB.inc" /* ram_code = 1001 */
18 #include "sdram_inf/sdram-lpddr3-NT6CL512T32AM-H0-4GB.inc" /* ram_code = 1010 */
19 #include "sdram_inf/sdram-lpddr3-K4E6E304EC-EGCG-4GB.inc" /* ram_code = 1011 */
20 #include "sdram_inf/sdram-unused.inc" /* ram_code = 1100 */
21 #include "sdram_inf/sdram-unused.inc" /* ram_code = 1101 */
22 #include "sdram_inf/sdram-unused.inc" /* ram_code = 1110 */
23 #include "sdram_inf/sdram-unused.inc" /* ram_code = 1111 */
24 };
25 
27 {
28  u32 ramcode = ram_code();
29 
30  if (ramcode >= ARRAY_SIZE(sdram_configs)
31  || sdram_configs[ramcode].type == TYPE_INVALID)
32  die("Invalid RAMCODE.");
33 
34  return &sdram_configs[ramcode];
35 }
const struct sdram_info * get_sdram_config(void)
Definition: sdram_configs.c:85
uint32_t ram_code(void)
#define ARRAY_SIZE(a)
Definition: helpers.h:12
void __noreturn die(const char *fmt,...)
Definition: die.c:17
unsigned int type
Definition: edid.c:57
@ TYPE_INVALID
Definition: emi.h:12
static const struct mt8173_sdram_params sdram_configs[]
Definition: sdram_configs.c:7
uint32_t u32
Definition: stdint.h:51