From bda2251669fc998548ec2633f06e019262cb6d12 Mon Sep 17 00:00:00 2001 From: Felipe Moura Date: Tue, 15 Sep 2026 20:29:19 -0300 Subject: [PATCH] boards/esp32s3-xiao: wire up esp_openeth_initialize() esp32s3-devkit, esp32s3-ws-lcd128, lckfb-szpi-esp32s3 and esp32-devkitc all call esp_openeth_initialize() from their bring-up to register the openeth MAC (the NIC QEMU's esp32s3 machine provides); esp32s3-xiao never did, so CONFIG_ESP32S3_OPENETH built but no wlan/eth netdev ever registered under QEMU -- same shape of gap as the IMU, SD, console, Wi-Fi and SPI-flash wiring already fixed for this board. Confirmed under QEMU's esp32s3 machine, combined with the esp_openeth RX-interrupt fix (merged in 88c8623cedb): the netdev registers and the guest genuinely sends and receives. Signed-off-by: Felipe Moura Assisted-by: Claude:claude-sonnet-5 --- .../esp32s3/esp32s3-xiao/src/esp32s3-xiao.h | 17 +++++++++++++++++ .../esp32s3/esp32s3-xiao/src/esp32s3_bringup.c | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3-xiao.h b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3-xiao.h index 71b188871b0..1413c4ac227 100644 --- a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3-xiao.h +++ b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3-xiao.h @@ -98,5 +98,22 @@ int board_i2c_init(void); int board_lsm6ds3trc_initialize(int devno, int busno); #endif +/**************************************************************************** + * Name: esp_openeth_initialize + * + * Description: + * Register the openeth MAC driver, the NIC emulated by QEMU's esp32s3 + * machine. Implemented by the shared Espressif code in + * arch/xtensa/src/common/espressif/esp_openeth.c. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ESP32S3_OPENETH +int esp_openeth_initialize(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_XIAO_SRC_ESP32S3_XIAO_H */ diff --git a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c index f2818899e60..6dc222264d9 100644 --- a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c +++ b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c @@ -181,6 +181,18 @@ int esp32s3_bringup(void) # endif #endif +#ifdef CONFIG_ESP32S3_OPENETH + /* The NIC QEMU's esp32s3 machine provides; compiles away on real + * hardware, where CONFIG_ESP32S3_OPENETH is never set. + */ + + ret = esp_openeth_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize openeth: %d\n", ret); + } +#endif + /* If we got here then perhaps not all initialization was successful, but * at least enough succeeded to bring-up NSH with perhaps reduced * capabilities.