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>
18 #include <drivers/vpd/vpd.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
))
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
))
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
) {
51 t
->device_locator
= smbios_add_string(t
->eos
, "DIMM-A");
54 t
->device_locator
= smbios_add_string(t
->eos
, "DIMM-B");
57 t
->device_locator
= smbios_add_string(t
->eos
, "UNKNOWN");
62 static void mainboard_init(void *chip_info
)
64 const struct pad_config
*gpio_table
;
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
,