From 5429cc10572e050a01dae7205577968ade543892 Mon Sep 17 00:00:00 2001 From: Ondrej Kosta Date: Fri, 20 Dec 2024 17:01:33 +0100 Subject: [PATCH] ci(esp_eth): added ESP32P4 as target for ETH tests --- .../esp_eth/test_apps/.build-test-rules.yml | 4 ++-- components/esp_eth/test_apps/README.md | 4 ++-- .../esp_eth/test_apps/pytest_esp_eth.py | 23 +++++++++++++++++++ .../sdkconfig.ci.default_ip101_esp32p4 | 4 +--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/components/esp_eth/test_apps/.build-test-rules.yml b/components/esp_eth/test_apps/.build-test-rules.yml index 5499c2b035..dc4d00c17b 100644 --- a/components/esp_eth/test_apps/.build-test-rules.yml +++ b/components/esp_eth/test_apps/.build-test-rules.yml @@ -2,7 +2,7 @@ components/esp_eth/test_apps: enable: - - if: IDF_TARGET == "esp32" - reason: only test on esp32 + - if: IDF_TARGET in ["esp32", "esp32p4"] + reason: ESP32 and ESP32P4 have internal EMAC. SPI Ethernet runners are based on ESP32. depends_components: - esp_eth diff --git a/components/esp_eth/test_apps/README.md b/components/esp_eth/test_apps/README.md index 0e2cf8cb13..9747c000db 100644 --- a/components/esp_eth/test_apps/README.md +++ b/components/esp_eth/test_apps/README.md @@ -1,6 +1,6 @@ # EMAC Test -| Supported Targets | ESP32 | -| ----------------- | ----- | +| Supported Targets | ESP32 | ESP32-P4 | +| ----------------- | ----- | -------- | This test app is used to test Ethernet MAC behavior with different chips. diff --git a/components/esp_eth/test_apps/pytest_esp_eth.py b/components/esp_eth/test_apps/pytest_esp_eth.py index 3e954ed2c7..07b45872ef 100644 --- a/components/esp_eth/test_apps/pytest_esp_eth.py +++ b/components/esp_eth/test_apps/pytest_esp_eth.py @@ -265,6 +265,29 @@ def test_esp_eth_ip101(dut: IdfDut) -> None: ethernet_l2_test(dut) +# ----------- IP101 ESP32P4 ----------- +@pytest.mark.esp32p4 +@pytest.mark.eth_ip101 +@pytest.mark.parametrize('config', [ + 'default_ip101_esp32p4', +], indirect=True) +def test_esp32p4_ethernet(dut: IdfDut) -> None: + ethernet_test(dut) + dut.serial.hard_reset() + ethernet_l2_test(dut) + + +@pytest.mark.esp32p4 +@pytest.mark.eth_ip101 +@pytest.mark.parametrize('config', [ + 'default_ip101_esp32p4', +], indirect=True) +def test_esp32p4_emac(dut: IdfDut) -> None: + ethernet_int_emac_test(dut) + dut.serial.hard_reset() + ethernet_heap_alloc_test(dut) + + # ----------- LAN8720 ----------- @pytest.mark.esp32 @pytest.mark.eth_lan8720 diff --git a/components/esp_eth/test_apps/sdkconfig.ci.default_ip101_esp32p4 b/components/esp_eth/test_apps/sdkconfig.ci.default_ip101_esp32p4 index 7a385264d3..a73773ba25 100644 --- a/components/esp_eth/test_apps/sdkconfig.ci.default_ip101_esp32p4 +++ b/components/esp_eth/test_apps/sdkconfig.ci.default_ip101_esp32p4 @@ -8,6 +8,4 @@ CONFIG_ESP_TASK_WDT_EN=n CONFIG_TARGET_USE_INTERNAL_ETHERNET=y CONFIG_TARGET_ETH_PHY_DEVICE_IP101=y -CONFIG_TARGET_USE_DEFAULT_EMAC_CONFIG=n -CONFIG_TARGET_IO_MDC=31 -CONFIG_TARGET_IO_MDIO=27 +CONFIG_TARGET_USE_DEFAULT_EMAC_CONFIG=y