Rex-BC Chen | 74a0629 | 2021-09-09 18:43:22 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <bootblock_common.h> |
| 4 | #include <device/mmio.h> |
Rex-BC Chen | add2e93 | 2021-12-13 19:43:17 +0800 | [diff] [blame] | 5 | #include <gpio.h> |
Rex-BC Chen | c4db2db | 2021-11-04 13:59:42 +0800 | [diff] [blame] | 6 | #include <soc/spi.h> |
Rex-BC Chen | 74a0629 | 2021-09-09 18:43:22 +0800 | [diff] [blame] | 7 | |
Rex-BC Chen | 580150d | 2021-11-17 15:50:38 +0800 | [diff] [blame] | 8 | #include "gpio.h" |
| 9 | |
Rex-BC Chen | add2e93 | 2021-12-13 19:43:17 +0800 | [diff] [blame] | 10 | static void usb3_hub_reset(void) |
| 11 | { |
| 12 | gpio_output(GPIO_USB3_HUB_RST_L, 1); |
| 13 | } |
| 14 | |
Rex-BC Chen | 74a0629 | 2021-09-09 18:43:22 +0800 | [diff] [blame] | 15 | void bootblock_mainboard_init(void) |
| 16 | { |
Rex-BC Chen | 9f01bbf | 2021-11-18 15:20:42 +0800 | [diff] [blame] | 17 | mtk_spi_init(CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS, SPI_PAD0_MASK, 3 * MHz, 0); |
Rex-BC Chen | 858481e | 2021-11-18 15:43:40 +0800 | [diff] [blame] | 18 | mtk_spi_init(CONFIG_DRIVER_TPM_SPI_BUS, SPI_PAD0_MASK, 1 * MHz, 0); |
Rex-BC Chen | 76c426a | 2021-12-03 14:25:46 +0800 | [diff] [blame] | 19 | mtk_snfc_init(SPI_NOR_GPIO_SET1); |
Rex-BC Chen | 580150d | 2021-11-17 15:50:38 +0800 | [diff] [blame] | 20 | setup_chromeos_gpios(); |
Yu-Ping Wu | 3a1333d | 2022-10-06 12:37:25 +0800 | [diff] [blame] | 21 | gpio_eint_configure(GPIO_GSC_AP_INT_ODL, IRQ_TYPE_EDGE_FALLING); |
Rex-BC Chen | add2e93 | 2021-12-13 19:43:17 +0800 | [diff] [blame] | 22 | usb3_hub_reset(); |
Rex-BC Chen | 74a0629 | 2021-09-09 18:43:22 +0800 | [diff] [blame] | 23 | } |