mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Add espi driver for x86-based platform which support espi interface such
as skylake and so on.
Added source:
1. espi.c: Add drivers which supports the utilities of peripheral and
virtual-wire channels so far.
2. espi.h: Add espi virtual-wire declaration for power sequence FW.
Modified sources:
1. lpc.c: Add interrupts and initialization steps for espi.
2. gpio.c: Add interrupt handler of espi reset.
BRANCH=none
BUG=chrome-os-partner:34346
TEST=make buildall -j; test nuvoton IC specific drivers
Change-Id: Ie80afe79d85aba47fc0b72898a8374c2898ec114
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/366181
Reviewed-by: Randall Spangler <rspangler@chromium.org>
76 lines
1.9 KiB
C
76 lines
1.9 KiB
C
/* Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
/* eSPI module for Chrome EC */
|
|
|
|
#ifndef __CROS_EC_ESPI_H
|
|
#define __CROS_EC_ESPI_H
|
|
|
|
#include "gpio_signal.h"
|
|
|
|
/* Signal through VW */
|
|
enum espi_vw_signal {
|
|
VW_SIGNAL_BASE = GPIO_COUNT,
|
|
VW_SLP_S3_L, /* index 02h (In) */
|
|
VW_SLP_S4_L,
|
|
VW_SLP_S5_L,
|
|
VW_SUS_STAT_L, /* index 03h (In) */
|
|
VW_PLTRST_L,
|
|
VW_OOB_RST_WARN,
|
|
VW_OOB_RST_ACK, /* index 04h (Out) */
|
|
VW_WAKE_L,
|
|
VW_PME_L,
|
|
VW_ERROR_FATAL, /* index 05h (Out) */
|
|
VW_ERROR_NON_FATAL,
|
|
/* Merge bit 3/0 into one signal. Need to set them simultaneously */
|
|
VW_SLAVE_BTLD_STATUS_DONE,
|
|
VW_SCI_L, /* index 06h (Out) */
|
|
VW_SMI_L,
|
|
VW_RCIN_L,
|
|
VW_HOST_RST_ACK,
|
|
VW_HOST_RST_WARN, /* index 07h (In) */
|
|
VW_SUS_ACK, /* index 40h (Out) */
|
|
VW_SUS_WARN_L, /* index 41h (In) */
|
|
VW_SUS_PWRDN_ACK_L,
|
|
VW_SLP_A_L,
|
|
VW_SLP_LAN, /* index 42h (In) */
|
|
VW_SLP_WLAN,
|
|
};
|
|
|
|
/**
|
|
* Set eSPI Virtual-Wire signal to Host
|
|
*
|
|
* @param signal vw signal needs to set
|
|
* @param level level of vw signal
|
|
* @return EC_SUCCESS, or non-zero if error.
|
|
*/
|
|
int espi_vw_set_wire(enum espi_vw_signal signal, uint8_t level);
|
|
|
|
/**
|
|
* Get eSPI Virtual-Wire signal from host
|
|
*
|
|
* @param signal vw signal needs to get
|
|
* @return 1: set by host, otherwise: no signal
|
|
*/
|
|
int espi_vw_get_wire(enum espi_vw_signal signal);
|
|
|
|
/**
|
|
* Enable VW interrupt of power sequence signal
|
|
*
|
|
* @param signal vw signal needs to enable interrupt
|
|
* @return EC_SUCCESS, or non-zero if error.
|
|
*/
|
|
int espi_vw_enable_wire_int(enum espi_vw_signal signal);
|
|
|
|
/**
|
|
* Disable VW interrupt of power sequence signal
|
|
*
|
|
* @param signal vw signal needs to disable interrupt
|
|
* @return EC_SUCCESS, or non-zero if error.
|
|
*/
|
|
int espi_vw_disable_wire_int(enum espi_vw_signal signal);
|
|
|
|
#endif /* __CROS_EC_ESPI_H */
|