coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
memory.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <baseboard/variants.h>
4 #include <boardid.h>
5 #include <gpio.h>
6 
8 {
9  /*
10  * The memory straps in the P0 build don't match those generated by
11  * spd_tools, so override the memory ID to 0.
12  */
13  if (board_id() == 0)
14  return 0;
15 
16  /*
17  * Memory configuration board straps
18  * GPIO_MEM_CONFIG_0 GPP_E1
19  * GPIO_MEM_CONFIG_1 GPP_E2
20  * GPIO_MEM_CONFIG_2 GPP_E3
21  */
22  gpio_t spd_gpios[] = {
23  GPP_E1,
24  GPP_E2,
25  GPP_E3,
26  };
27 
28  return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
29 }
#define GPP_E3
#define GPP_E2
#define GPP_E1
#define ARRAY_SIZE(a)
Definition: helpers.h:12
uint32_t board_id(void)
board_id() - Get the board version
Definition: ec_boardid.c:6
uint32_t gpio_base2_value(const gpio_t gpio[], int num_gpio)
Definition: gpio.c:30
int __weak variant_memory_sku(void)
Definition: memory.c:74