coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ramstage.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <boardid.h>
4 #include <smbios.h>
5 #include <soc/gpio.h>
6 #include <variant/gpio.h>
7 
8 #if CONFIG(GENERATE_SMBIOS_TABLES)
9 /* mainboard silk screen shows DIMM-A and DIMM-B */
10 void smbios_fill_dimm_locator(const struct dimm_info *dimm,
11  struct smbios_type17 *t)
12 {
13  switch (dimm->channel_num) {
14  case 0:
15  t->device_locator = smbios_add_string(t->eos, "DIMM-A");
16  break;
17  case 1:
18  t->device_locator = smbios_add_string(t->eos, "DIMM-B");
19  break;
20  default:
21  t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
22  break;
23  }
24 }
25 #endif
26 
27 static const struct pad_config gpio_unused[] = {
28 /* SUSWARN# */ PAD_NC(GPP_A13, NONE),
29 /* SUSACK# */ PAD_NC(GPP_A15, NONE),
30 /* M2_SKT2_CFG0 */ PAD_NC(GPP_H12, NONE),
31 /* M2_SKT2_CFG1 */ PAD_NC(GPP_H13, NONE),
32 };
33 
34 static void mainboard_init(void *chip_info)
35 {
36  const struct pad_config *gpio_table;
37  size_t num_gpios;
38 
39  gpio_table = variant_gpio_table(&num_gpios);
40  gpio_configure_pads(gpio_table, num_gpios);
41 
42  /* Disable unused pads for devices with board ID > 2 */
43  if (board_id() > 2)
45 }
46 
49 };
#define GPP_H12
#define GPP_H13
#define GPP_A15
#define GPP_A13
int smbios_add_string(u8 *start, const char *str)
Definition: smbios.c:40
#define ARRAY_SIZE(a)
Definition: helpers.h:12
uint32_t board_id(void)
board_id() - Get the board version
Definition: ec_boardid.c:6
static const struct pad_config gpio_table[]
Definition: gpio.h:24
struct chip_operations mainboard_ops
Definition: ramstage.c:11
const struct pad_config *__weak variant_gpio_table(size_t *num)
Definition: gpio.c:406
void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
Definition: ramstage.c:8
static void mainboard_init(void *chip_info)
Definition: ramstage.c:34
static const struct pad_config gpio_unused[]
Definition: ramstage.c:27
void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
program a particular set of GPIO
Definition: gpio.c:307
#define PAD_NC(pin)
Definition: gpio_defs.h:263
void(* init)(void *chip_info)
Definition: device.h:25
If this table is filled and put in CBMEM, then these info in CBMEM will be used to generate smbios ty...
Definition: memory_info.h:19
uint8_t channel_num
Definition: memory_info.h:36
u8 device_locator
Definition: smbios.h:869
u8 eos[2]
Definition: smbios.h:884