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.