From aad9ab02e8200e079fb8b6e8e76268e04531d7b4 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 6 Jun 2024 21:22:51 +0200 Subject: [PATCH] feat(esp_eth): enable openeth in QEMU for ESP32-S3 --- components/esp_eth/src/openeth/esp_openeth.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/components/esp_eth/src/openeth/esp_openeth.h b/components/esp_eth/src/openeth/esp_openeth.h index 5eb13d5777..2aab7410c1 100644 --- a/components/esp_eth/src/openeth/esp_openeth.h +++ b/components/esp_eth/src/openeth/esp_openeth.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,17 +8,12 @@ #include "sdkconfig.h" #include "soc/interrupts.h" -#if CONFIG_IDF_TARGET_ESP32C3 - -/** - * @brief Since ESP32-C3 target in QEMU doesn't support Wifi, reuse its interrupt source for ethernet +/* + * For targets which don't have an ethernet MAC and the associated interrupt source, + * we can reuse the Wifi interrupt source for ethernet, since QEMU doesn't emulate Wifi (yet). + * We also map the EMAC registers to an unused address range. */ +#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 #define ETS_ETH_MAC_INTR_SOURCE ETS_WIFI_MAC_INTR_SOURCE - - -/** - * @brief Use an empty I/O range for the ethernet registers - */ #define DR_REG_EMAC_BASE 0x600CD000 - -#endif // CONFIG_IDF_TARGET_ESP32C3 +#endif