Commit Graph

143 Commits

Author SHA1 Message Date
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
Bogdan Kolendovskyy
91630fab36 Merge branch 'bugfix/ip101_reset_timing' into 'master'
fix(esp_eth): ip101-specific reset_hw to match reset timings from datasheet

Closes IDF-9160

See merge request espressif/esp-idf!28906
2024-02-09 16:44:24 +08:00
Ondrej Kosta
5df5f0cf80 Merge branch 'feature/spi_eth_no_int' into 'master'
feat(esp_eth): added SPI Ethernet module polling mode

Closes IDFGH-11561

See merge request espressif/esp-idf!28782
2024-02-08 22:34:47 +08:00
Bogdan Kolendovskyy
222f67f043 fix(esp_eth): ip101-specific reset_hw to match reset timings from datasheet
IP101 requires 10ms reset assertion time and 10ms post-reset delay to properly initialize.
2024-02-07 11:24:17 +01:00
Ondrej Kosta
fd0a1dc53c feat(esp_eth): added SPI Ethernet module polling mode
Closes https://github.com/espressif/esp-idf/issues/12682
2024-02-07 11:21:57 +01:00
Bogdan Kolendovskyy
d9e1d69b4e esp_eth: Add functions to access PHY using MDIO
Specifically:
  - Set/get address
  - Read/write data at address with specified MDIO access function
  - Read/write both address and data with a single call
2024-01-30 12:08:18 +01:00
Ondrej Kosta
ce388a4111 feat(esp_eth): Added support of internal EMAC for ESP32P4
Refactored internal EMAC DMA access.

Added MPLL acquire to manage access to the MPLL by multiple periphs.
2024-01-16 14:29:25 +01:00
Ondrej Kosta
78f791d4d5 feat(esp_eth): added ioctl option to read/write PHY registers
LAN87xx: Added extra delay after setting PHY speed
2023-11-08 12:40:28 +00:00
morris
d78750306d refactor(emac): use clock_output driver for configuring RMII reference clock 2023-10-31 14:24:48 +08:00
Ondrej Kosta
a93d53aadb fix(esp_eth): various Ethernet driver fixes
ksz8851snl: enabled reception of multicast frames

Internal EMAC: fixed APLL CLK deinitialization

DM9051 and KSZ80xx: fixed speed configuration when not in loopback mode

phy_802_3: added multiple attempts when autodetecting PHY address
2023-10-12 07:23:51 +00:00
Bogdan Kolendovskyy
fac7cb4b78 Merge branch 'bugfix/rtl8201_reset_timing' into 'master'
esp_eth: rtl8201 timing fix

Closes IDFGH-10170

See merge request espressif/esp-idf!25814
2023-10-04 03:00:23 +08:00
Bogdan Kolendovskyy
c75fab3fa4 esp_eth: change rtl8201 reset timing to match datasheet
In esp_eth_phy_rtl8201.c:
Add 150ms delay after hardware reset, chage reset assertion time to 10ms

In esp_eth_phy_802_3.c:
Change reset function to use vTaskDelay for long (>=10ms) reset assertion time
Change esp_eth_phy_802_3_detect_phy_addr to check range 0-31 instead of 0-15.
2023-10-02 10:10:25 +02:00
Ondrej Kosta
e0c225b4f7 Merge branch 'feature/eth_spi_abstraction' into 'master'
Abstraction of SPI driver for SPI Ethernet modules

Closes IDF-7645

See merge request espressif/esp-idf!24429
2023-09-27 18:36:25 +08:00
Ondrej Kosta
ecd1759a0b feat(esp_eth): abstraction of SPI driver for SPI Ethernet modules 2023-09-26 07:58:05 +00:00
Bogdan Kolendovskyy
303d2c2dc6 fix(esp_eth): Add model number 0x13 to list of suported models
Add model number 0x13 to KSZ80xx driver's list of supported models
corresonding to KSZ8041RLNI.
2023-09-25 11:24:52 +02:00
morris
0b970a8dfe refactor(emac): add LL functions for bus clock control 2023-09-04 10:52:03 +08:00
Omar Chebib
3e9d2155eb feat(esp_eth): add opencores ethernet support for ESP32-C3 (QEMU) target 2023-08-24 10:32:46 +08:00
Bogdan Kolendovskyy
224ba396f1 esp_eth: add loopback test, change chip drivers to reflect chip specific behaviour
In esp_eth_test_apps.c:
Add test of loopback functionality. Change speed/duplex/autonegotiation test - remove need to enable loopback (required
for it to work on some phys supported by ESP-IDF)

In Kconfig.projbuild:
Add parameters to select which configuration is used - standard or custom.
Add for custom configuration parameters to select MDC and MDIO pins (required to work with WESP-32 and other boards that
use non-standard pin assignments).

In esp_eth_test_common.c:
Add code to support changes made in Kconfig

In sdkconfig.ci.default_rtl8201:
Change config which is used. Now custom is used and MDC is gpio 16, MDIO is gpio 17. Reuqired to work with WESP-32

In esp_eth_phy_802_3.h:
Make 802.3 API public.

In esp_eth_phy_802_3.c:
Add loopback check in eth_phy_802_3_set_duplex(). Now ESP_ERR_INVALID_STATE is invoked on attempt to set duplex to half
when loopback is enabled.
Remove static property from esp_eth_phy_802_3_autonego_ctrl and esp_eth_phy_802_3_loopback.

In esp_eth_phy_dm9051.c:
Add dm9051_loopback() because DM9051 requires setting additional bit to enable auto-negotiation loopback for data to be
received. Add dm9051_set_speed() which invokes ESP_ERR_INVALID_STATE on attempt to set speed to 10 Mbps when loopback is
enabled because such speed configuration is unsupported.

In esp_eth_phy_ksz80xx.c:
Add ksz80xx_set_speed() which invokes ESP_ERR_INVALID_STATE on attempt to set speed to 10 Mbps when loopback is enabled
because such speed configuration is unsupported.

In esp_eth_phy_ksz8851snl.c:
Change phy_ksz8851_set_duplex() to invoke ESP_ERR_INVALID_STATE on attempt to set duplex to half when loopback is enabled.

In  esp_eth_phy_dp83848.c, esp_eth_phy_rtl8201.c:
Add autonego_ctrl implementation which prevents enabling autonegotiation when loopback is enabled.
Add loopback implementation which disables autonegotiation prior to enabling loopback.

In esp_eth_phy_lan87xx.c:
Add autonego_ctrl implementation which prevents enabling autonegotiation when loopback is enabled.
Add loopback implementation which disables autonegotiation prior to enabling loopback.
Fix link indicating being down when loopback is enabled by force setting link up.
2023-08-03 13:18:44 +02:00
Bogdan Kolendovskyy
a28d87e72a fix(eth_netif_glue): Move reporting speed to action connected
esp_eth_netif_glue.c:
Moved reporting link speed to action connected, removed speed reportg code from action start.
2023-07-27 13:15:42 +02:00
Ondrej Kosta
5ebe6b51d8 esp_eth: fixed esp_eth_transmit_vargs to transmit only when link is up
esp_eth test: clear unicast Rx event before wait
2023-05-23 08:23:34 +02:00
Jackson Ming Hu
896a07e5d6 w5500: rework version check to avoid a false alarm on fault detection
See: https://github.com/espressif/esp-idf/issues/11331
2023-05-19 15:33:22 +02:00
Ondrej Kosta
c231c79fc8 HAL: wrapped emac_ll functions to emac_hal
Closes #9934
2023-04-19 12:46:45 +00:00
Ondrej Kosta
3d66a10114 Ethernet driver and documentation clean-up 2023-04-04 11:33:08 +00:00
Ondrej
2ec7fc8f10 esp_eth: allowed DM9051 to receive multicast packets
Removed extra PHY status link checks from DM9051 MAC layer
2023-03-14 13:59:27 +00:00
Ondrej Kosta
05510e67d1 Merge branch 'bugfix/eth_lan8720_ci' into 'master'
esp_eth: start/stop and L2 test stability improvements

See merge request espressif/esp-idf!21898
2023-02-09 15:36:12 +08:00
Ondrej Kosta
256d457969 esp_eth: possible start/stop issue fixed
ESP32 EMAC could hang when stopped/started multiple times at 10Mbps speed mode
2023-02-03 10:48:39 +01:00
Ondrej
5fdb49698a esp_eth: fixed copyright for W5500 2023-01-19 07:56:22 +00:00
Reinis Muiznieks
bb2f346e55 Verify w5500 chip properly 2023-01-17 11:52:51 +02:00
Ondrej Kosta
84ab32b4ef Merge branch 'bugfix/emac_memory_leak' into 'master'
Fixed false positive emac rx memory leak reported by Coverity

Closes IDF-6363

See merge request espressif/esp-idf!21341
2022-12-05 20:04:15 +08:00
Ondrej Kosta
600788da6a Merge branch 'contrib/github_pr_10292' into 'master'
fix small bug when logging eth error (GitHub PR)

Closes IDFGH-8869

See merge request espressif/esp-idf!21407
2022-12-05 17:58:37 +08:00
Ondrej
647a9dfde3 Improved emac rx task code to suppress Coverity false positive memory leak indication 2022-12-02 12:57:43 +00:00
Alexander Hübener
93a8510dc5 fixed args order 2022-12-01 21:36:13 +01:00
Ondrej
c40e4eb499 esp_eth: DM9051 stop/start issue fixed 2022-11-28 10:54:43 +00:00
Ondrej Kosta
785f154f56 Merge branch 'feature/emac_buff' into 'master'
esp_eth: receive buffer allocation optimization

Closes IDFGH-7769

See merge request espressif/esp-idf!19977
2022-11-24 00:48:19 +08:00
Omar Chebib
cd21058097 C/Cxx: unify static assertions with the macro ESP_STATIC_ASSERT
Closes https://github.com/espressif/esp-idf/issues/9938
2022-11-21 16:18:08 +08:00
Ondrej
6fff81d970 esp_eth: receive buffer allocation optimization
Receive buffers are allocated with a size equal to actual received frame size
2022-11-15 10:44:12 +00:00
Guillaume Souchere
6005cc9163 hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.
2022-07-22 00:06:06 +08:00
David Cermak
5c383d7b73 esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network
interface component.
Network interface drivers shall depend on esp_netif.
esp_netif shall depend on lwip (but not on any specific interface
driver) -- it optionally depends on vfs and esp_eth (need ethernet
header for L2/bridge mode)
2022-07-20 14:59:07 +02:00
Ondrej Kosta
bb6c6aff36 esp_eth: SPI Ethernet modules initialization simplification 2022-07-14 08:46:22 +02:00
Ondrej Kosta
43f3904304 esp_eth: IEEE 802.3 PHY MII Management Interface functionality grouped to one common file 2022-06-24 05:51:44 +00:00
David Cermak
fd366fac9e esp_eth: Remove deprecated esp_eth_receive() 2022-06-09 07:55:40 +00:00
David Cermak
343cf2696e esp_eth: Reduce internal deps onto netif-glue 2022-06-09 07:55:40 +00:00
David Cermak
5b471a1848 esp_netif/lwip: Implement basic support for vanilla-lwip (2.1.3-REL)
* Reference lwip-2.1.3-REL vanilla lwip version
* Use inherent NETIF callbacks instead of dhcp/ipv6/autoip
2022-05-18 17:10:42 +02:00
Ondrej Kosta
4051b80b4d esp_netif: remove dependency of L2 TAP Interface from netif_lwip
esp_eth: extended infrastructure to optionally provide more advanced access to MAC/PHY layers
2022-04-08 16:40:29 +02:00
David Cermak
c63c8d4df1 esp_eth: Fix open-cores explicit inclusion 2022-03-23 09:05:30 +01:00
Ondrej Kosta
c69b4c817b Fixed Ethernet lwIP netif error indication 2022-03-22 07:17:40 +00:00
David Cermak
795b7ed993 esp_netif: Remove tcpip_adapter compatibility layer 2022-03-10 08:19:43 +01:00
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30