@@ -41,6 +41,11 @@ struct espi_rts5912_config {
41
41
uint32_t emi0_clk_grp ;
42
42
uint32_t emi0_clk_idx ;
43
43
#endif
44
+ #ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
45
+ volatile struct emi_reg * const emi1_reg ;
46
+ uint32_t emi1_clk_grp ;
47
+ uint32_t emi1_clk_idx ;
48
+ #endif
44
49
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
45
50
volatile struct port80_reg * const port80_reg ;
46
51
uint32_t port80_clk_grp ;
@@ -66,6 +71,26 @@ struct espi_rts5912_data {
66
71
#endif
67
72
};
68
73
74
+ /*
75
+ * =========================================================================
76
+ * ESPI Peripheral Shared Memory Region
77
+ * =========================================================================
78
+ */
79
+
80
+ #ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
81
+ #define ESPI_RTK_PERIPHERAL_ACPI_SHD_MEM_SIZE 256
82
+
83
+ static uint8_t acpi_shd_mem_sram [ESPI_RTK_PERIPHERAL_ACPI_SHD_MEM_SIZE ] __aligned (256 );
84
+
85
+ static void espi_setup_acpi_shm (const struct espi_rts5912_config * const espi_config )
86
+ {
87
+ volatile struct emi_reg * const emi1_reg = espi_config -> emi1_reg ;
88
+
89
+ emi1_reg -> SAR = (uint32_t )& acpi_shd_mem_sram [0 ];
90
+ }
91
+
92
+ #endif /* CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION */
93
+
69
94
/*
70
95
* =========================================================================
71
96
* ESPI Peripheral Host IO (ACPI)
@@ -1858,6 +1883,10 @@ static int espi_rts5912_init(const struct device *dev)
1858
1883
/* Setup eSPI bus reset */
1859
1884
espi_bus_reset_setup (dev );
1860
1885
1886
+ #ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
1887
+ espi_setup_acpi_shm (espi_config );
1888
+ #endif
1889
+
1861
1890
#ifdef CONFIG_ESPI_PERIPHERAL_HOST_IO
1862
1891
/* Setup ACPI */
1863
1892
rc = espi_acpi_setup (dev );
@@ -1935,6 +1964,11 @@ static const struct espi_rts5912_config espi_rts5912_config = {
1935
1964
.emi0_clk_grp = DT_CLOCKS_CELL_BY_NAME (DT_DRV_INST (0 ), emi0 , clk_grp ),
1936
1965
.emi0_clk_idx = DT_CLOCKS_CELL_BY_NAME (DT_DRV_INST (0 ), emi0 , clk_idx ),
1937
1966
#endif
1967
+ #ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
1968
+ .emi1_reg = (volatile struct emi_reg * const )DT_INST_REG_ADDR_BY_NAME (0 , emi1 ),
1969
+ .emi1_clk_grp = DT_CLOCKS_CELL_BY_NAME (DT_DRV_INST (0 ), emi1 , clk_grp ),
1970
+ .emi1_clk_idx = DT_CLOCKS_CELL_BY_NAME (DT_DRV_INST (0 ), emi1 , clk_idx ),
1971
+ #endif
1938
1972
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
1939
1973
.port80_reg = (volatile struct port80_reg * const )DT_INST_REG_ADDR_BY_NAME (0 , port80 ),
1940
1974
.port80_clk_grp = DT_CLOCKS_CELL_BY_NAME (DT_DRV_INST (0 ), port80 , clk_grp ),
0 commit comments