Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
Jon Murphy | 9042427 | 2022-02-16 06:34:39 -0700 | [diff] [blame] | 3 | #include <baseboard/variants.h> |
Jon Murphy | 9e00571 | 2022-02-17 14:48:55 -0700 | [diff] [blame] | 4 | #include <console/console.h> |
Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 5 | #include <device/device.h> |
Jon Murphy | cbf0f98 | 2022-02-16 06:47:46 -0700 | [diff] [blame^] | 6 | #include <variant/ec.h> |
Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 7 | |
Jon Murphy | 9042427 | 2022-02-16 06:34:39 -0700 | [diff] [blame] | 8 | static void mainboard_configure_gpios(void) |
| 9 | { |
| 10 | size_t base_num_gpios, override_num_gpios; |
| 11 | const struct soc_amd_gpio *base_gpios, *override_gpios; |
| 12 | |
| 13 | variant_base_gpio_table(&base_gpios, &base_num_gpios); |
| 14 | variant_override_gpio_table(&override_gpios, &override_num_gpios); |
| 15 | |
| 16 | gpio_configure_pads_with_override(base_gpios, base_num_gpios, |
| 17 | override_gpios, override_num_gpios); |
| 18 | } |
| 19 | |
Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 20 | static void mainboard_init(void *chip_info) |
| 21 | { |
Jon Murphy | 9042427 | 2022-02-16 06:34:39 -0700 | [diff] [blame] | 22 | mainboard_configure_gpios(); |
Jon Murphy | cbf0f98 | 2022-02-16 06:47:46 -0700 | [diff] [blame^] | 23 | mainboard_ec_init(); |
Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | static void mainboard_enable(struct device *dev) |
| 27 | { |
Jon Murphy | 9e00571 | 2022-02-17 14:48:55 -0700 | [diff] [blame] | 28 | printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); |
Karthikeyan Ramasubramanian | a84d4f23 | 2022-02-02 10:10:03 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | struct chip_operations mainboard_ops = { |
| 32 | .init = mainboard_init, |
| 33 | .enable_dev = mainboard_enable, |
| 34 | }; |