Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
Mathew King | 10dd775 | 2021-01-26 16:08:14 -0700 | [diff] [blame] | 3 | #include <baseboard/variants.h> |
Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 4 | #include <device/device.h> |
Mathew King | ad83023 | 2021-02-23 13:08:15 -0700 | [diff] [blame] | 5 | #include <variant/ec.h> |
Mathew King | 5d47887 | 2021-02-16 14:05:15 -0700 | [diff] [blame] | 6 | #include <vendorcode/google/chromeos/chromeos.h> |
Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 7 | |
Mathew King | 10dd775 | 2021-01-26 16:08:14 -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 | base_gpios = variant_base_gpio_table(&base_num_gpios); |
| 14 | override_gpios = variant_override_gpio_table(&override_num_gpios); |
| 15 | |
| 16 | gpio_configure_pads_with_override(base_gpios, base_num_gpios, override_gpios, |
| 17 | override_num_gpios); |
| 18 | } |
| 19 | |
Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 20 | static void mainboard_init(void *chip_info) |
| 21 | { |
Mathew King | 10dd775 | 2021-01-26 16:08:14 -0700 | [diff] [blame] | 22 | mainboard_configure_gpios(); |
Mathew King | ad83023 | 2021-02-23 13:08:15 -0700 | [diff] [blame] | 23 | mainboard_ec_init(); |
Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | static void mainboard_enable(struct device *dev) |
| 27 | { |
Mathew King | 5d47887 | 2021-02-16 14:05:15 -0700 | [diff] [blame] | 28 | printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); |
| 29 | |
| 30 | dev->ops->acpi_inject_dsdt = chromeos_dsdt_generator; |
Mathew King | 2e2fc7a | 2020-12-08 11:33:58 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | struct chip_operations mainboard_ops = { |
| 34 | .init = mainboard_init, |
| 35 | .enable_dev = mainboard_enable, |
| 36 | }; |