190 Commits

Author SHA1 Message Date
Ondrej Kosta
ae3fbe1ada fix(esp_eth): fixes EMAC MDC out of the range issue
Closes https://github.com/espressif/esp-idf/issues/17984
2025-12-11 17:30:30 +01:00
Song Ruo Jing
1862fdec74 refactor(gpio): split GPIO HAL into separate component
cleaned up some includes in GPIO peripheral files
2025-11-26 15:35:07 +08:00
Ondrej Kosta
1e6f49d178 Merge branch 'chore/update-protocol-eth-connect' into 'master'
feat(protocol_examples_common): Use Ethernet Init component

Closes IDF-14227

See merge request espressif/esp-idf!42265
2025-11-20 17:28:17 +08:00
glmfe
f398594982 feat(protocol_examples_common): Use Ethernet Init component
- Refactored protocol_examples_common to use ethernet_init component
2025-11-19 15:58:12 +01:00
glmfe
9fd020d9da refactor(hal): graduate emac hal into a new component
- Separate emac from hal component to a new one: esp_hal_emac.
2025-11-12 06:55:46 -03:00
Ondrej Kosta
d622d4d9ac feat(esp_eth): removed SPI Ethernet and PHY drivers from IDF 2025-09-28 16:19:42 +02:00
Marius Vikhammer
484d2c5c2f fix(system): fixed issues with unused variable warnings when compiling with NDEBUG 2025-09-19 15:42:07 +08:00
Ondrej Kosta
5aa97623c1 feat(esp_eth): removed RMII CLK Kconfig option 2025-09-17 11:46:06 +02:00
Ondrej Kosta
2ed090ba3d feat(esp_eth): changed ETH PHY API of esp_eth_phy_802_3_reset_hw 2025-09-16 17:54:35 +08:00
Ondrej Kosta
b3e2f89f49 feat(esp_eth): added EMAC sleep retention for ESP32P4 2025-08-11 12:53:24 +02:00
Ondrej Kosta
48b37dd56e Merge branch 'contrib/github_pr_16016' into 'master'
Enable Timestamping for Non-PTP Ethernet frames (GitHub PR)

Closes IDFGH-15359

See merge request espressif/esp-idf!39581
2025-06-09 16:58:07 +08:00
Frangen, Leon
eae1f3c302 feat(esp_eth): Enable rx/tx timestamp for non-PTP frames via ioctl 2025-06-06 11:35:10 +02:00
wuzhenghui
65b7e70564 feat(driver): support acquire/release clock source dependency for all drivers 2025-05-27 21:21:38 +08:00
Ondrej Kosta
e941910c0f feat(esp_eth): Added destination MAC address filter configuration interface 2025-04-29 13:54:56 +02:00
Ondrej Kosta
f3a3988649 fix(esp_eth): fixed ESP32P4 EMAC REF RMII CLK output mode
fixed units returned and used by periph_rtc_mpll_freq_set function
2025-03-12 09:29:17 +00:00
Song Ruo Jing
53d8b70e8b fix(gpio): fix IO output enable control
oen_sel and oen_inv_sel fields from func_out_sel_cfg register
2025-02-20 19:49:28 +08:00
Song Ruo Jing
3a8d065908 refactor(gpio): improve gpio_iomux_in/out API 2025-02-10 21:44:07 +08:00
Ondrej Kosta
e188afdacf Merge branch 'docs/eth_memory_consideration' into 'master'
Non-functional Ethernet updates

Closes IDFGH-13346 and IDF-11736

See merge request espressif/esp-idf!36219
2025-01-27 19:24:34 +08:00
Ondrej Kosta
83fecdd5d3 change(esp_eth): new gpio init strategy 2025-01-15 22:53:33 +08:00
Ondrej Kosta
5c9da4a13b fix(esp_eth): removed deadcode from emac 2025-01-07 17:01:36 +01:00
Ivan Grokhotkov
6d06f5fe44 fix(esp_eth): fix openeth driver to consider MAC address set in QEMU
Openeth driver did not consider the possibility that the MAC address
was specified when launching QEMU, and would always overwrite that
address with the address obtained from esp_read_mac.
When running QEMU, setting the MAC address via QEMU arguments is more
convenient than crafting an eFuse file with the correct MAC address.
This change modifies openeth driver to first check if an address has
been set in QEMU and uses it if so. Otherwise it falls back to the
address obtained from esp_read_mac.

As part of this change, also removed the unnecessary variable
emac_opencores_t::addr, the address is only kept in the registers of
the emulated peripheral now.

For full effect this also requires changes in QEMU, see
https://github.com/espressif/qemu/issues/107 for background. Without
changes in QEMU, this commit keeps the same behavior.
2024-12-10 12:29:10 +01:00
Ondrej Kosta
d2b1202d5a feat(esp_eth): added HW Time Stamping support for ESP32P4
Added mechanism to L2 TAP to retreive time stamp

Added PTP time synchronization example
2024-11-07 15:01:24 +08:00
Ondrej Kosta
0738314308 feat(esp_eth): added new generic PHY driver 2024-10-11 10:14:53 +02:00
Tian Sen Wen
61e05bddc9 fix(esp_eth): Fix DM9051 abnormal operation when SPI clock is too high
Simplified buffer allocation for DM9051
2024-08-08 20:53:48 +08:00
Ivan Grokhotkov
728136a91d fix(esp_eth): fix variable declarations inside switch for clang 2024-07-12 12:14:32 +02:00
Ivan Grokhotkov
aad9ab02e8 feat(esp_eth): enable openeth in QEMU for ESP32-S3 2024-06-12 10:50:13 +02:00
Ondrej Kosta
e9adde3485 Merge branch 'bugfix/yeat_another_memory_leak' into 'master'
fix(esp_eth): Fixed another memory leak ESP MAC

Closes IDF-10079

See merge request espressif/esp-idf!31336
2024-06-06 18:48:09 +08:00
Bogdan Kolendovskyy
75222cc6b7 Merge branch 'feature/emac_insufficient_tx_buffer_debug_log' into 'master'
feat(esp_eth): Do not produce error when insufficient TX buffer size happens

See merge request espressif/esp-idf!31175
2024-06-05 19:29:06 +08:00
Ondrej Kosta
f9071cfce1 fix(esp_eth): Fixed another memory leak ESP MAC 2024-06-05 11:30:04 +02:00
Bogdan Kolendovskyy
514d8cb51d feat(esp_eth): Do not produce error when insufficient TX buffer size happens 2024-06-04 12:06:59 +02:00
morris
e5b7987e21 refactor(emac): use heap component API to allocate cached aligned DMA buffer 2024-06-02 22:19:46 +08:00
Ondrej Kosta
a558e94952 fix(esp_eth): fixing memory leak and invalid bit shift 2024-05-15 09:27:37 +02:00
Ondrej Kosta
d15a9c2c48 feat(esp_eth): a new folder structure of the driver and other improvements
Fixed memory leak in emac_esp_new_dma function.

Polished ESP EMAC cache management.

Added emac_periph definitions based on SoC features and improved(generalized) ESP EMAC GPIO
initialization.

Added ESP EMAC GPIO reservation.

Added check for frame error condition indicated by EMAC DMA and created a target test.
2024-05-14 08:23:31 +02:00
Ondrej Kosta
7843c51ec4 Merge branch 'contrib/github_pr_13560' into 'master'
esp_eth: DP83848: correct link detection to use BMSR (GitHub PR)

Closes IDFGH-12557

See merge request espressif/esp-idf!30361
2024-04-24 14:22:45 +08:00
Karl Palsson
e2945871b7 fix(esp_eth): dp83848: correct link detection to use BMSR
Reading the link state via PHYSTS was incorrect, as it only reflects the
link state bit from BMSR.  BMSR latches link down events, and are not
cleared without being read.  (See 802.3-2008 section 2, section 22.2.4.2.13)
This leads to the original DP828xx code only supporting link up, then a
single link down event.

Switch to reading the link state via BMSR, but continuing to read the
negotiation results via PHYSTS and ANLPAR.  This is inline with
LAN8720x, RTL8201, KSZ80xx phy drivers, and other opensource drivers for
the DP838xx family of devices.

Tested on a private board with a DP83825i PHY.  No publically available
boards using the original DP83848 are known of for testing.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
2024-04-16 11:08:48 +00:00
Ondrej Kosta
60384d4fc0 fix(esp_eth): made access to PHY registers for DM9051 more robust 2024-04-15 15:39:23 +08:00
gaoxu
40f38bea6f feat(dma): refactor dma calloc function 2024-04-02 14:30:14 +08:00
Armando
78f96c4466 change(eth): use new esp_dma_calloc 2024-04-02 14:30:14 +08:00
Ondrej Kosta
9d0b8d62b0 Merge branch 'feature/emac_intr_prio' into 'master'
feat(esp_eth): added option to configure interrupt priority

Closes IDF-7969

See merge request espressif/esp-idf!29300
2024-03-19 21:09:30 +08:00
Ondrej Kosta
93db5a609a fix(esp_eth): fixed build for openeth due to incorrect printf format 2024-03-14 09:44:53 +01:00
Ondrej Kosta
6a09d98089 feat(esp_eth): added option to configure interrupt priority 2024-03-07 10:30:32 +01:00
Ondrej Kosta
edf49a92b7 fix(esp_eth): Removed -Wno-format in esp_eth component 2024-03-01 17:01:28 +01:00
Ondrej Kosta
4ddc947d1c Merge branch 'bugfix/eth_link_reset' into 'master'
fix(esp_eth): Fixed Ethernet link reset when Ethernet is stopped

Closes IDF-9195

See merge request espressif/esp-idf!29058
2024-02-28 20:26:29 +08:00
Bogdan Kolendovskyy
f02fadda87 Merge branch 'bugfix/ip101_hw_reset_include' into 'master'
fix(esp_eth): explicitly include FreeRTOS headers into ip101 driver

See merge request espressif/esp-idf!29063
2024-02-28 16:20:35 +08:00
Bogdan Kolendovskyy
eb8985886d fix(esp_eth): explicitly include FreeRTOS headers into ip101 driver to ensure availability of vTaskDelay 2024-02-27 18:13:07 +08:00
gaoxu
e9ce63532b feat(gpio): add gpio fun sellect api 2024-02-27 17:01:53 +08:00
Ondrej Kosta
1ae315e1ed fix(esp_eth): Fixed Ethernet link reset when Ethernet is stopped 2024-02-16 16:36:26 +01:00
Ondrej Kosta
dee34c2a48 Merge branch 'bugfix/spi_eth_recv_alloc' into 'master'
fix(esp_eth): improved SPI Ethernet _alloc_recv_buf error handling

Closes IDF-8601

See merge request espressif/esp-idf!29040
2024-02-16 19:52:48 +08:00
Ondrej Kosta
b0259f59c2 fix(esp_eth): improved SPI Ethernet _alloc_recv_buf error handling 2024-02-14 12:40:04 +01:00
Bogdan Kolendovskyy
748c215c63 fix(esp_eth): Use uint32_t in mmd access functions 2024-02-13 12:53:11 +01:00