summaryrefslogtreecommitdiff
path: root/src/soc/amd/morgana/espi_util.c
blob: 1d0fc1731aef6f4a8377c5a1a3e4d82d70b5fca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: GPL-2.0-only */

/* TODO: Update for Morgana */

#include <amdblocks/spi.h>
#include <soc/espi.h>
#include <types.h>

#define ESPI_CNTRL_REGISTER	0x10
#define  LOCK_SPIX10_BIT2	BIT(3)
#define  ESPI_MUX_SPI1		BIT(2)
#define  ROM_ADDR_WR_PROT	BIT(1)
#define  DIS_ESPI_MASCTL_REG_WR	BIT(0)

void espi_switch_to_spi1_pads(void)
{
	uint8_t reg = spi_read8(ESPI_CNTRL_REGISTER);

	reg |= ESPI_MUX_SPI1;

	spi_write8(ESPI_CNTRL_REGISTER, reg);
}