drivers: espi: Add support for ACPI_EC1 interface
This enables the ACPI_EC1 interface which is typically accessed through ports 0x6A0 and 0x6A4 in Bios. Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
parent
d678d7a65f
commit
e71e803674
4 changed files with 48 additions and 2 deletions
|
@ -77,6 +77,21 @@ config ESPI_PERIPHERAL_HOST_IO
|
|||
help
|
||||
Enables ACPI Host I/O over eSPI peripheral channel.
|
||||
|
||||
config ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
bool "Host I/O peripheral Private Channel"
|
||||
help
|
||||
Enables ACPI Host I/O over eSPI peripheral channel for private channel.
|
||||
|
||||
config ESPI_PERIPHERAL_HOST_IO_PVT_PORT_NUM
|
||||
hex "Host I/O peripheral Private Channel"
|
||||
depends on ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
default 0x06A00000
|
||||
help
|
||||
This is the port number used by the Host and EC to communicate over
|
||||
the private channel. Please ensure the Host code is configured to use
|
||||
the same port. Also, ensure the port number selected doesn't clash
|
||||
with the existing ports (like 80, 92, 62 etc).
|
||||
|
||||
config ESPI_PERIPHERAL_PORT_92
|
||||
bool "Legacy Port 92 peripheral"
|
||||
help
|
||||
|
|
|
@ -20,6 +20,9 @@ config ESPI_FLASH_CHANNEL
|
|||
config ESPI_PERIPHERAL_HOST_IO
|
||||
default y
|
||||
|
||||
config ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
default y
|
||||
|
||||
config ESPI_PERIPHERAL_DEBUG_PORT_80
|
||||
default y
|
||||
|
||||
|
|
|
@ -790,6 +790,14 @@ static void config_sub_devices(struct device *dev)
|
|||
ESPI_EIO_BAR_REGS->EC_BAR_MBOX = ESPI_XEC_MBOX_BAR_ADDRESS |
|
||||
MCHP_ESPI_IO_BAR_HOST_VALID;
|
||||
#endif
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
ESPI_EIO_BAR_REGS->EC_BAR_ACPI_EC_1 =
|
||||
CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT_PORT_NUM |
|
||||
MCHP_ESPI_IO_BAR_HOST_VALID;
|
||||
ESPI_EIO_BAR_REGS->EC_BAR_MBOX = ESPI_XEC_MBOX_BAR_ADDRESS |
|
||||
MCHP_ESPI_IO_BAR_HOST_VALID;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
||||
ESPI_EIO_BAR_REGS->EC_BAR_P80CAP_0 = ESPI_XEC_PORT80_BAR_ADDRESS |
|
||||
MCHP_ESPI_IO_BAR_HOST_VALID;
|
||||
|
@ -1070,6 +1078,20 @@ static void ibf_isr(struct device *dev)
|
|||
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
static void ibf_pvt_isr(struct device *dev)
|
||||
{
|
||||
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
||||
struct espi_event evt = {
|
||||
.evt_type = ESPI_BUS_PERIPHERAL_NOTIFICATION,
|
||||
.evt_details = ESPI_PERIPHERAL_HOST_IO_PVT,
|
||||
.evt_data = ESPI_PERIPHERAL_NODATA
|
||||
};
|
||||
|
||||
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void ibf_kbc_isr(struct device *dev)
|
||||
{
|
||||
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
||||
|
@ -1152,6 +1174,9 @@ const struct espi_isr m2s_vwires_isr[] = {
|
|||
|
||||
const struct espi_isr peripherals_isr[] = {
|
||||
{MCHP_ACPI_EC_0_IBF_GIRQ, ibf_isr},
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
{MCHP_ACPI_EC_1_IBF_GIRQ, ibf_pvt_isr},
|
||||
#endif
|
||||
{MCHP_KBC_IBF_GIRQ, ibf_kbc_isr},
|
||||
{MCHP_PORT80_DEBUG0_GIRQ_VAL, port80_isr},
|
||||
{MCHP_PORT80_DEBUG1_GIRQ_VAL, port81_isr},
|
||||
|
@ -1328,9 +1353,11 @@ static int espi_xec_init(struct device *dev)
|
|||
#endif
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO
|
||||
MCHP_GIRQ_ENSET(config->pc_girq_id) = MCHP_ACPI_EC_0_IBF_GIRQ;
|
||||
MCHP_GIRQ_ENSET(config->pc_girq_id) = MCHP_ACPI_EC_1_IBF_GIRQ;
|
||||
MCHP_GIRQ_ENSET(config->pc_girq_id) = MCHP_ACPI_EC_2_IBF_GIRQ;
|
||||
#endif
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
MCHP_GIRQ_ENSET(config->pc_girq_id) = MCHP_ACPI_EC_1_IBF_GIRQ;
|
||||
#endif
|
||||
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
||||
MCHP_GIRQ_ENSET(config->pc_girq_id) = MCHP_PORT80_DEBUG0_GIRQ_VAL |
|
||||
MCHP_PORT80_DEBUG1_GIRQ_VAL;
|
||||
|
|
|
@ -149,7 +149,8 @@ enum espi_virtual_peripheral {
|
|||
ESPI_PERIPHERAL_UART,
|
||||
ESPI_PERIPHERAL_8042_KBC,
|
||||
ESPI_PERIPHERAL_HOST_IO,
|
||||
ESPI_PERIPHERAL_DEBUG_PORT80
|
||||
ESPI_PERIPHERAL_DEBUG_PORT80,
|
||||
ESPI_PERIPHERAL_HOST_IO_PVT
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue