driver: espi: add espi peripheral channel acpi shd mem driver for rts5912
add espi peripheral channel acpi shd mem driver for rts5912 Signed-off-by: jhan bo chao <jhan_bo_chao@realtek.com>
This commit is contained in:
parent
4320fb5249
commit
805b213424
2 changed files with 37 additions and 0 deletions
|
@ -10,6 +10,9 @@ config ESPI_RTS5912
|
||||||
|
|
||||||
if ESPI_RTS5912
|
if ESPI_RTS5912
|
||||||
|
|
||||||
|
config ESPI_PERIPHERAL_ACPI_SHM_REGION
|
||||||
|
default y
|
||||||
|
|
||||||
config ESPI_PERIPHERAL_HOST_IO
|
config ESPI_PERIPHERAL_HOST_IO
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,11 @@ struct espi_rts5912_config {
|
||||||
uint32_t emi0_clk_grp;
|
uint32_t emi0_clk_grp;
|
||||||
uint32_t emi0_clk_idx;
|
uint32_t emi0_clk_idx;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
|
||||||
|
volatile struct emi_reg *const emi1_reg;
|
||||||
|
uint32_t emi1_clk_grp;
|
||||||
|
uint32_t emi1_clk_idx;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
||||||
volatile struct port80_reg *const port80_reg;
|
volatile struct port80_reg *const port80_reg;
|
||||||
uint32_t port80_clk_grp;
|
uint32_t port80_clk_grp;
|
||||||
|
@ -66,6 +71,26 @@ struct espi_rts5912_data {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* =========================================================================
|
||||||
|
* ESPI Peripheral Shared Memory Region
|
||||||
|
* =========================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
|
||||||
|
#define ESPI_RTK_PERIPHERAL_ACPI_SHD_MEM_SIZE 256
|
||||||
|
|
||||||
|
static uint8_t acpi_shd_mem_sram[ESPI_RTK_PERIPHERAL_ACPI_SHD_MEM_SIZE] __aligned(256);
|
||||||
|
|
||||||
|
static void espi_setup_acpi_shm(const struct espi_rts5912_config *const espi_config)
|
||||||
|
{
|
||||||
|
volatile struct emi_reg *const emi1_reg = espi_config->emi1_reg;
|
||||||
|
|
||||||
|
emi1_reg->SAR = (uint32_t)&acpi_shd_mem_sram[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* =========================================================================
|
* =========================================================================
|
||||||
* ESPI Peripheral Host IO (ACPI)
|
* ESPI Peripheral Host IO (ACPI)
|
||||||
|
@ -1858,6 +1883,10 @@ static int espi_rts5912_init(const struct device *dev)
|
||||||
/* Setup eSPI bus reset */
|
/* Setup eSPI bus reset */
|
||||||
espi_bus_reset_setup(dev);
|
espi_bus_reset_setup(dev);
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
|
||||||
|
espi_setup_acpi_shm(espi_config);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO
|
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO
|
||||||
/* Setup ACPI */
|
/* Setup ACPI */
|
||||||
rc = espi_acpi_setup(dev);
|
rc = espi_acpi_setup(dev);
|
||||||
|
@ -1935,6 +1964,11 @@ static const struct espi_rts5912_config espi_rts5912_config = {
|
||||||
.emi0_clk_grp = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi0, clk_grp),
|
.emi0_clk_grp = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi0, clk_grp),
|
||||||
.emi0_clk_idx = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi0, clk_idx),
|
.emi0_clk_idx = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi0, clk_idx),
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
|
||||||
|
.emi1_reg = (volatile struct emi_reg *const)DT_INST_REG_ADDR_BY_NAME(0, emi1),
|
||||||
|
.emi1_clk_grp = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi1, clk_grp),
|
||||||
|
.emi1_clk_idx = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), emi1, clk_idx),
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
|
||||||
.port80_reg = (volatile struct port80_reg *const)DT_INST_REG_ADDR_BY_NAME(0, port80),
|
.port80_reg = (volatile struct port80_reg *const)DT_INST_REG_ADDR_BY_NAME(0, port80),
|
||||||
.port80_clk_grp = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), port80, clk_grp),
|
.port80_clk_grp = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(0), port80, clk_grp),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue