Raul E Rangel | d0b059f | 2022-03-24 17:04:11 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <amdblocks/spi.h> |
| 4 | #include <soc/espi.h> |
| 5 | #include <types.h> |
| 6 | |
Felix Held | 0e9dbf0 | 2023-01-19 23:06:54 +0100 | [diff] [blame^] | 7 | #define ESPI_CNTRL_REGISTER 0x10 /* SPI register, not eSPI register! */ |
Raul E Rangel | d0b059f | 2022-03-24 17:04:11 -0600 | [diff] [blame] | 8 | #define LOCK_SPIX10_BIT2 BIT(3) |
| 9 | #define ESPI_MUX_SPI1 BIT(2) |
| 10 | #define ROM_ADDR_WR_PROT BIT(1) |
| 11 | #define DIS_ESPI_MASCTL_REG_WR BIT(0) |
| 12 | |
| 13 | void espi_switch_to_spi1_pads(void) |
| 14 | { |
| 15 | uint8_t reg = spi_read8(ESPI_CNTRL_REGISTER); |
| 16 | |
| 17 | reg |= ESPI_MUX_SPI1; |
| 18 | |
| 19 | spi_write8(ESPI_CNTRL_REGISTER, reg); |
| 20 | } |