Angel Pons | 60ec365 | 2020-04-03 01:22:13 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <baseboard/variants.h> |
| 5 | #include <device/device.h> |
John Zhao | d05b15e | 2020-07-25 17:23:53 -0700 | [diff] [blame] | 6 | #include <ec/ec.h> |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 7 | #include <soc/gpio.h> |
Wonkyu Kim | cf4ede8 | 2020-03-03 17:32:48 -0800 | [diff] [blame] | 8 | #include <smbios.h> |
Joel Kitching | a1b1517 | 2020-03-12 18:15:34 +0800 | [diff] [blame] | 9 | #include <string.h> |
Wonkyu Kim | cf4ede8 | 2020-03-03 17:32:48 -0800 | [diff] [blame] | 10 | |
| 11 | const char *smbios_system_sku(void) |
| 12 | { |
| 13 | static char sku_str[7] = ""; /* sku{0..255} */ |
| 14 | uint32_t sku_id = 255; |
| 15 | |
| 16 | snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id); |
| 17 | return sku_str; |
| 18 | } |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 19 | |
| 20 | static void mainboard_init(void *chip_info) |
| 21 | { |
| 22 | const struct pad_config *pads; |
| 23 | size_t num; |
| 24 | |
| 25 | pads = variant_gpio_table(&num); |
| 26 | gpio_configure_pads(pads, num); |
John Zhao | d05b15e | 2020-07-25 17:23:53 -0700 | [diff] [blame] | 27 | |
| 28 | mainboard_ec_init(); |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 29 | } |
| 30 | |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 31 | struct chip_operations mainboard_ops = { |
| 32 | .init = mainboard_init, |
Ravi Sarawadi | ebb2d3c | 2019-12-19 23:01:48 -0800 | [diff] [blame] | 33 | }; |