From f854b8b7991c11297ab4f46f35e15ad63ba1c0d8 Mon Sep 17 00:00:00 2001 From: Jose Alberto Meza Date: Thu, 6 Jun 2024 15:59:24 -0700 Subject: [PATCH] drivers: samples: espi: Adjust terms per eSPI specification 1.5 Replace CONFIG_ESPI_SLAVE by CONFIG_ESPI_TARGET Replace CONFIG_ESPI_SAF by CONFIG_ESPI_TAF Replace ESPI_BUS_SAF_NOTIFICATION with ESPI_TAF_BUS_NOTIFICATION in API Signed-off-by: Jose Alberto Meza --- drivers/espi/CMakeLists.txt | 4 +-- drivers/espi/Kconfig | 30 +++++++++---------- drivers/espi/Kconfig.xec | 26 ++++++++-------- drivers/espi/espi_npcx.c | 14 ++++----- drivers/espi/espi_saf_mchp_xec.c | 2 +- drivers/espi/espi_saf_mchp_xec_v2.c | 4 +-- drivers/espi/espi_taf_npcx.c | 4 +-- include/zephyr/drivers/espi.h | 2 +- .../espi/boards/mec15xxevb_assy6853.conf | 4 +-- .../espi/boards/mec172xevb_assy6906.conf | 4 +-- samples/drivers/espi/src/main.c | 12 ++++---- soc/nuvoton/npcx/npcx4/Kconfig.defconfig | 2 +- 12 files changed, 54 insertions(+), 54 deletions(-) diff --git a/drivers/espi/CMakeLists.txt b/drivers/espi/CMakeLists.txt index 5379d00ea21..4826880f482 100644 --- a/drivers/espi/CMakeLists.txt +++ b/drivers/espi/CMakeLists.txt @@ -10,8 +10,8 @@ zephyr_library_sources_ifdef(CONFIG_ESPI_NPCX host_subs_npcx.c) zephyr_library_sources_ifdef(CONFIG_ESPI_TAF_NPCX espi_taf_npcx.c) zephyr_library_sources_ifdef(CONFIG_USERSPACE espi_handlers.c) zephyr_library_sources_ifdef(CONFIG_ESPI_EMUL espi_emul.c) -zephyr_library_sources_ifdef(CONFIG_ESPI_SAF_XEC espi_saf_mchp_xec.c) +zephyr_library_sources_ifdef(CONFIG_ESPI_TAF_XEC espi_saf_mchp_xec.c) zephyr_library_sources_ifdef(CONFIG_ESPI_XEC_V2 espi_mchp_xec_v2.c) zephyr_library_sources_ifdef(CONFIG_ESPI_XEC_V2 espi_mchp_xec_host_v2.c) zephyr_library_sources_ifdef(CONFIG_ESPI_IT8XXX2 espi_it8xxx2.c) -zephyr_library_sources_ifdef(CONFIG_ESPI_SAF_XEC_V2 espi_saf_mchp_xec_v2.c) +zephyr_library_sources_ifdef(CONFIG_ESPI_TAF_XEC_V2 espi_saf_mchp_xec_v2.c) diff --git a/drivers/espi/Kconfig b/drivers/espi/Kconfig index 0a8f6173b8d..0bfacd15812 100644 --- a/drivers/espi/Kconfig +++ b/drivers/espi/Kconfig @@ -22,11 +22,11 @@ module = ESPI module-str = espi source "subsys/logging/Kconfig.template.log_config" -config ESPI_SLAVE - bool "ESPI slave driver" +config ESPI_TARGET + bool "ESPI target driver" default y help - Enables eSPI driver in slave mode. + Enables eSPI driver in target mode. config ESPI_INIT_PRIORITY int "ESPI Controller driver initialization priority" @@ -50,20 +50,20 @@ config ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE bool "Automatic acknowledge for eSPI HOST warnings" default y depends on ESPI_VWIRE_CHANNEL - depends on ESPI_SLAVE + depends on ESPI_TARGET help - Enable automatic acknowledgment from eSPI slave towards eSPI host + Enable automatic acknowledgment from eSPI target towards eSPI controller whenever it receives suspend or reset warning. If this is disabled, it means the app wants to be give the opportunity to prepare for either HOST suspend or reset. config ESPI_AUTOMATIC_BOOT_DONE_ACKNOWLEDGE - bool "Automatic acknowledge slave boot status" + bool "Automatic acknowledge target boot status" default y depends on ESPI_VWIRE_CHANNEL - depends on ESPI_SLAVE + depends on ESPI_TARGET help - Enable automatic acknowledgment from slave basic configuration been + Enable automatic acknowledgment from target basic configuration been completed by sending a virtual wire message to the eSPI master. This depends on SPI boot configuration. It could be either very early in the flow after the VW channel is configured. Or it could be @@ -176,19 +176,19 @@ config ESPI_OOB_CHANNEL_RX_ASYNC Enables asynchronous handling for host-initiated OOB traffic. Otherwise OOB traffic is assumed to be always client-initiated. -config ESPI_SAF - bool "ESPI SAF driver" +config ESPI_TAF + bool "ESPI TAF driver" depends on ESPI_FLASH_CHANNEL help - Enable Slave Attached Flash eSPI driver. SAF depends upon ESPI driver + Enable Target Attached Flash eSPI driver. TAF depends upon ESPI driver and flash channel. -config ESPI_SAF_INIT_PRIORITY - int "ESPI SAF driver initialization priority" - depends on ESPI_SAF +config ESPI_TAF_INIT_PRIORITY + int "ESPI TAF driver initialization priority" + depends on ESPI_TAF default 4 help - Driver initialization priority for eSPI SAF driver. SAF driver must + Driver initialization priority for eSPI TAF driver. TAF driver must initialize after the ESPI driver. endif # ESPI diff --git a/drivers/espi/Kconfig.xec b/drivers/espi/Kconfig.xec index b1752285c59..cbf749467c7 100644 --- a/drivers/espi/Kconfig.xec +++ b/drivers/espi/Kconfig.xec @@ -63,21 +63,21 @@ config ESPI_FLASH_BUFFER_SIZE Use maximum RAM buffer size defined by spec but allow applications to override if eSPI host doesn't support it. -config ESPI_SAF_XEC - bool "XEC Microchip ESPI SAF driver" +config ESPI_TAF_XEC + bool "XEC Microchip ESPI TAF driver" default y depends on SOC_SERIES_MEC15XX depends on DT_HAS_MICROCHIP_XEC_ESPI_SAF_ENABLED help - Enable the Microchip XEC SAF ESPI driver for MEC15xx family. + Enable the Microchip XEC TAF ESPI driver for MEC15xx family. -config ESPI_SAF_XEC_V2 - bool "XEC Microchip ESPI SAF V2 driver" +config ESPI_TAF_XEC_V2 + bool "XEC Microchip ESPI TAF V2 driver" default y depends on SOC_SERIES_MEC172X depends on DT_HAS_MICROCHIP_XEC_ESPI_SAF_V2_ENABLED help - Enable the Microchip XEC SAF ESPI driver for MEC172x series. + Enable the Microchip XEC TAF ESPI driver for MEC172x series. endif #ESPI_XEC @@ -154,19 +154,19 @@ config ESPI_PERIPHERAL_XEC_EMI2 endif #ESPI_PERIPHERAL_CHANNEL -config ESPI_SAF - bool "XEC Microchip ESPI SAF driver" +config ESPI_TAF + bool "XEC Microchip ESPI TAF driver" depends on ESPI_FLASH_CHANNEL help - Enable Slave Attached Flash eSPI driver. SAF depends upon ESPI XEC driver + Enable Target Attached Flash eSPI driver. TAF depends upon ESPI XEC driver and flash channel. -config ESPI_SAF_INIT_PRIORITY - int "ESPI SAF driver initialization priority" - depends on ESPI_SAF +config ESPI_TAF_INIT_PRIORITY + int "ESPI TAF driver initialization priority" + depends on ESPI_TAF default 4 help - Driver initialization priority for eSPI SAF driver. + Driver initialization priority for ESPI TAF driver. config ESPI_PERIPHERAL_ACPI_EC_IBF_EVT_DATA bool "Read ACPI EC Event Data in IBF ISR" diff --git a/drivers/espi/espi_npcx.c b/drivers/espi/espi_npcx.c index de23de2b46a..3d3f2c71073 100644 --- a/drivers/espi/espi_npcx.c +++ b/drivers/espi/espi_npcx.c @@ -310,8 +310,8 @@ static void espi_bus_cfg_update_isr(const struct device *dev) espi_vw_send_bootload_done(dev); } -#if (defined(CONFIG_ESPI_FLASH_CHANNEL) && defined(CONFIG_ESPI_SAF)) - /* If CONFIG_ESPI_SAF is set, set to auto or manual mode accroding +#if (defined(CONFIG_ESPI_FLASH_CHANNEL) && defined(CONFIG_ESPI_TAF)) + /* If CONFIG_ESPI_TAF is set, set to auto or manual mode accroding * to configuration. */ if (IS_BIT_SET(inst->ESPICFG, NPCX_ESPICFG_FLCHANMODE)) { @@ -348,7 +348,7 @@ static void espi_bus_oob_rx_isr(const struct device *dev) #endif #if defined(CONFIG_ESPI_FLASH_CHANNEL) -#if defined(CONFIG_ESPI_SAF) +#if defined(CONFIG_ESPI_TAF) static struct espi_taf_pckt taf_pckt; static uint32_t espi_taf_parse(const struct device *dev) @@ -382,7 +382,7 @@ static uint32_t espi_taf_parse(const struct device *dev) return (uint32_t)&taf_pckt; } -#endif /* CONFIG_ESPI_SAF */ +#endif /* CONFIG_ESPI_TAF */ static void espi_bus_flash_rx_isr(const struct device *dev) { @@ -404,9 +404,9 @@ static void espi_bus_flash_rx_isr(const struct device *dev) #endif k_sem_give(&data->flash_rx_lock); } else { /* Target Attached Flash Access */ -#if defined(CONFIG_ESPI_SAF) +#if defined(CONFIG_ESPI_TAF) struct espi_event evt = { - .evt_type = ESPI_BUS_SAF_NOTIFICATION, + .evt_type = ESPI_BUS_TAF_NOTIFICATION, .evt_details = ESPI_CHANNEL_FLASH, .evt_data = espi_taf_parse(dev), }; @@ -1401,7 +1401,7 @@ static int espi_npcx_init(const struct device *dev) /* Configure host sub-modules which HW blocks belong to core domain */ npcx_host_init_subs_core_domain(dev, &data->callbacks); -#if defined(CONFIG_ESPI_FLASH_CHANNEL) && defined(CONFIG_ESPI_SAF) +#if defined(CONFIG_ESPI_FLASH_CHANNEL) && defined(CONFIG_ESPI_TAF) npcx_init_taf(dev, &data->callbacks); #endif diff --git a/drivers/espi/espi_saf_mchp_xec.c b/drivers/espi/espi_saf_mchp_xec.c index 6dd39b4f1b0..d649deaaa14 100644 --- a/drivers/espi/espi_saf_mchp_xec.c +++ b/drivers/espi/espi_saf_mchp_xec.c @@ -849,7 +849,7 @@ static const struct espi_saf_xec_config espi_saf_xec_config = { DEVICE_DT_INST_DEFINE(0, &espi_saf_xec_init, NULL, &espi_saf_xec_data, &espi_saf_xec_config, POST_KERNEL, - CONFIG_ESPI_SAF_INIT_PRIORITY, &espi_saf_xec_driver_api); + CONFIG_ESPI_TAF_INIT_PRIORITY, &espi_saf_xec_driver_api); static int espi_saf_xec_init(const struct device *dev) { diff --git a/drivers/espi/espi_saf_mchp_xec_v2.c b/drivers/espi/espi_saf_mchp_xec_v2.c index aa7ea690581..67fb4a5162f 100644 --- a/drivers/espi/espi_saf_mchp_xec_v2.c +++ b/drivers/espi/espi_saf_mchp_xec_v2.c @@ -1027,7 +1027,7 @@ static void espi_saf_done_isr(const struct device *dev) struct mchp_espi_saf * const regs = xcfg->saf_base; const struct espi_xec_irq_info *safirq = &xcfg->irq_info_list[0]; uint32_t ecp_status = regs->SAF_ECP_STATUS; - struct espi_event evt = { .evt_type = ESPI_BUS_SAF_NOTIFICATION, + struct espi_event evt = { .evt_type = ESPI_BUS_TAF_NOTIFICATION, .evt_details = BIT(0), .evt_data = ecp_status }; @@ -1142,7 +1142,7 @@ static int espi_saf_xec_init(const struct device *dev) DEVICE_DT_INST_DEFINE(0, &espi_saf_xec_init, NULL, \ &espisaf_xec_data_##n, \ &espisaf_xec_config_##n, POST_KERNEL, \ - CONFIG_ESPI_SAF_INIT_PRIORITY, \ + CONFIG_ESPI_TAF_INIT_PRIORITY, \ &espi_saf_xec_driver_api); \ \ static void espi_saf_xec_connect_irqs_##n(void) \ diff --git a/drivers/espi/espi_taf_npcx.c b/drivers/espi/espi_taf_npcx.c index c1760f7adf9..7878df2b123 100644 --- a/drivers/espi/espi_taf_npcx.c +++ b/drivers/espi/espi_taf_npcx.c @@ -499,7 +499,7 @@ static void espi_taf_work(struct k_work *item) static void espi_taf_event_handler(const struct device *dev, struct espi_callback *cb, struct espi_event event) { - if ((event.evt_type != ESPI_BUS_SAF_NOTIFICATION) || + if ((event.evt_type != ESPI_BUS_TAF_NOTIFICATION) || (event.evt_details != ESPI_CHANNEL_FLASH)) { return; } @@ -510,7 +510,7 @@ static void espi_taf_event_handler(const struct device *dev, struct espi_callbac int npcx_init_taf(const struct device *dev, sys_slist_t *callbacks) { - espi_init_callback(&espi_taf_cb, espi_taf_event_handler, ESPI_BUS_SAF_NOTIFICATION); + espi_init_callback(&espi_taf_cb, espi_taf_event_handler, ESPI_BUS_TAF_NOTIFICATION); espi_add_callback(dev, &espi_taf_cb); npcx_espi_taf_data.host_dev = dev; diff --git a/include/zephyr/drivers/espi.h b/include/zephyr/drivers/espi.h index 720f2803ac1..62e4ce5e28b 100644 --- a/include/zephyr/drivers/espi.h +++ b/include/zephyr/drivers/espi.h @@ -140,7 +140,7 @@ enum espi_bus_event { * eSPI drivers should convey the peripheral type. */ ESPI_BUS_PERIPHERAL_NOTIFICATION = BIT(4), - ESPI_BUS_SAF_NOTIFICATION = BIT(5), + ESPI_BUS_TAF_NOTIFICATION = BIT(5), }; diff --git a/samples/drivers/espi/boards/mec15xxevb_assy6853.conf b/samples/drivers/espi/boards/mec15xxevb_assy6853.conf index 62985ba39b6..fe4958b7645 100644 --- a/samples/drivers/espi/boards/mec15xxevb_assy6853.conf +++ b/samples/drivers/espi/boards/mec15xxevb_assy6853.conf @@ -5,7 +5,7 @@ CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100 CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE=n # Sample code doesn't handle ACPI host communication CONFIG_ESPI_PERIPHERAL_HOST_IO=n -# Test SAF flash portal read/erase/write on EVB -CONFIG_ESPI_SAF=y +# Test TAF flash portal read/erase/write on EVB +CONFIG_ESPI_TAF=y CONFIG_SPI=y CONFIG_SPI_XEC_QMSPI=y diff --git a/samples/drivers/espi/boards/mec172xevb_assy6906.conf b/samples/drivers/espi/boards/mec172xevb_assy6906.conf index ecdb27d5f61..de64ab5da46 100644 --- a/samples/drivers/espi/boards/mec172xevb_assy6906.conf +++ b/samples/drivers/espi/boards/mec172xevb_assy6906.conf @@ -7,7 +7,7 @@ CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100 CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE=n # Sample code doesn't handle ACPI host communication CONFIG_ESPI_PERIPHERAL_HOST_IO=n -# Test SAF flash portal read/erase/write on EVB -CONFIG_ESPI_SAF=y +# Test TAF flash portal read/erase/write on EVB +CONFIG_ESPI_TAF=y CONFIG_SPI=y CONFIG_SPI_XEC_QMSPI_LDMA=y diff --git a/samples/drivers/espi/src/main.c b/samples/drivers/espi/src/main.c index a51b79776af..fff0998459d 100644 --- a/samples/drivers/espi/src/main.c +++ b/samples/drivers/espi/src/main.c @@ -16,7 +16,7 @@ /* OOB operations will be attempted regardless of channel enabled or not */ #include "espi_oob_handler.h" -#ifdef CONFIG_ESPI_SAF +#ifdef CONFIG_ESPI_TAF #include #endif @@ -65,7 +65,7 @@ static uint8_t flash_write_buf[MAX_TEST_BUF_SIZE]; static uint8_t flash_read_buf[MAX_TEST_BUF_SIZE]; #endif -#ifdef CONFIG_ESPI_SAF +#ifdef CONFIG_ESPI_TAF #define SAF_BASE_ADDR DT_REG_ADDR(DT_NODELABEL(espi_saf0)) #define SAF_TEST_FREQ_HZ 24000000U @@ -128,7 +128,7 @@ static const struct espi_saf_flash_cfg flash_w25q128 = { * by QMSPI driver. * Use SAF hardware default TAG map. */ -#ifdef CONFIG_ESPI_SAF_XEC_V2 +#ifdef CONFIG_ESPI_TAF_XEC_V2 static const struct espi_saf_cfg saf_cfg1 = { .nflash_devices = 1U, .hwcfg = {.version = 2U, /* TODO */ @@ -757,7 +757,7 @@ int espi_saf_test1(uint32_t spi_addr) return rc; } -#endif /* CONFIG_ESPI_SAF */ +#endif /* CONFIG_ESPI_TAF */ static void host_warn_handler(uint32_t signal, uint32_t status) { @@ -1187,7 +1187,7 @@ int espi_test(void) return -ENODEV; } -#ifdef CONFIG_ESPI_SAF +#ifdef CONFIG_ESPI_TAF if (!device_is_ready(qspi_dev)) { LOG_ERR("%s: device not ready.", qspi_dev->name); return -ENODEV; @@ -1223,7 +1223,7 @@ int espi_test(void) espi_init(); -#ifdef CONFIG_ESPI_SAF +#ifdef CONFIG_ESPI_TAF /* * eSPI SAF configuration must be after eSPI configuration. * eSPI SAF EC portal flash tests before EC releases RSMRST# and diff --git a/soc/nuvoton/npcx/npcx4/Kconfig.defconfig b/soc/nuvoton/npcx/npcx4/Kconfig.defconfig index 1c4be7c3a57..330f309e1a2 100644 --- a/soc/nuvoton/npcx/npcx4/Kconfig.defconfig +++ b/soc/nuvoton/npcx/npcx4/Kconfig.defconfig @@ -13,6 +13,6 @@ config CORTEX_M_SYSTICK config ESPI_TAF_NPCX default y - depends on ESPI_SAF + depends on ESPI_TAF endif # SOC_SERIES_NPCX4