Angel Pons | 08b5280 | 2020-04-05 13:22:20 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Hannah Williams | 5e83e8b | 2018-02-09 18:35:17 -0800 | [diff] [blame] | 2 | |
| 3 | #include <baseboard/variants.h> |
| 4 | #include <bootblock_common.h> |
| 5 | #include <ec/ec.h> |
| 6 | #include <intelblocks/lpc_lib.h> |
| 7 | #include <soc/gpio.h> |
| 8 | |
| 9 | void bootblock_mainboard_init(void) |
| 10 | { |
Marco Chen | 8a6174d | 2019-07-15 08:50:35 +0800 | [diff] [blame] | 11 | const struct pad_config *pads, *override_pads; |
| 12 | size_t num, override_num; |
Hannah Williams | 5e83e8b | 2018-02-09 18:35:17 -0800 | [diff] [blame] | 13 | |
Hannah Williams | cf45830 | 2018-01-09 18:23:40 -0800 | [diff] [blame] | 14 | lpc_configure_pads(); |
Furquan Shaikh | 4dc6646 | 2018-07-27 14:14:27 -0700 | [diff] [blame] | 15 | |
| 16 | /* |
| 17 | * Perform EC init before configuring GPIOs. This is because variant |
| 18 | * might talk to the EC to get board id and hence it will require EC |
| 19 | * init to have already performed. |
| 20 | */ |
| 21 | mainboard_ec_init(); |
| 22 | |
Hannah Williams | 5e83e8b | 2018-02-09 18:35:17 -0800 | [diff] [blame] | 23 | pads = variant_early_gpio_table(&num); |
Marco Chen | 8a6174d | 2019-07-15 08:50:35 +0800 | [diff] [blame] | 24 | override_pads = variant_early_override_gpio_table(&override_num); |
| 25 | gpio_configure_pads_with_override(pads, num, |
| 26 | override_pads, override_num); |
Hannah Williams | 5e83e8b | 2018-02-09 18:35:17 -0800 | [diff] [blame] | 27 | } |