mb/*/*/acpi_tables: Remove unnecessary function call
[coreboot.git] / src / mainboard / google / drallion / ramstage.c
blob385504522f1aedbe9c4d928030e0f9aca663e947
1 /*
2 * This file is part of the coreboot project.
4 * Copyright 2018 Google LLC
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <arch/acpi.h>
17 #include <boardid.h>
18 #include <drivers/vpd/vpd.h>
19 #include <smbios.h>
20 #include <soc/gpio.h>
21 #include <soc/ramstage.h>
22 #include <variant/gpio.h>
23 #include <vendorcode/google/chromeos/chromeos.h>
25 #define VPD_KEY_SYSTEM_SERIAL "serial_number"
26 #define VPD_KEY_MAINBOARD_SERIAL "mlb_serial_number"
27 #define VPD_SERIAL_LEN 64
29 const char *smbios_system_serial_number(void)
31 static char serial[VPD_SERIAL_LEN];
32 if (vpd_gets(VPD_KEY_SYSTEM_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO))
33 return serial;
34 return "";
37 const char *smbios_mainboard_serial_number(void)
39 static char serial[VPD_SERIAL_LEN];
40 if (vpd_gets(VPD_KEY_MAINBOARD_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO))
41 return serial;
42 return "";
45 /* mainboard silk screen shows DIMM-A and DIMM-B */
46 void smbios_fill_dimm_locator(const struct dimm_info *dimm,
47 struct smbios_type17 *t)
49 switch (dimm->channel_num) {
50 case 0:
51 t->device_locator = smbios_add_string(t->eos, "DIMM-A");
52 break;
53 case 1:
54 t->device_locator = smbios_add_string(t->eos, "DIMM-B");
55 break;
56 default:
57 t->device_locator = smbios_add_string(t->eos, "UNKNOWN");
58 break;
62 static void mainboard_init(void *chip_info)
64 const struct pad_config *gpio_table;
65 size_t num_gpios;
67 gpio_table = variant_gpio_table(&num_gpios);
68 cnl_configure_pads(gpio_table, num_gpios);
71 static void mainboard_enable(struct device *dev)
73 dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
76 struct chip_operations mainboard_ops = {
77 .init = mainboard_init,
78 .enable_dev = mainboard_enable,