Merge branch 'feat/esp32p4_eco5_emac_v6.0' into 'release/v6.0'

Added PTP PPS Feature (v6.0)

See merge request espressif/esp-idf!45060
This commit is contained in:
Jiang Jiang Jian
2026-01-29 14:01:33 +08:00
23 changed files with 544 additions and 130 deletions
+13 -3
View File
@@ -1,16 +1,25 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "soc/emac_periph.h"
#include "soc/io_mux_reg.h"
/**
* In emac_periph terms, `SIG_GPIO_OUT_IDX` indicates that the EMAC signal cannot be connected
* via the GPIO Matrix (i.e. such connection doesn't exist for the function), so it should
* stay in the default "unconnected state".
*
* Note: `SIG_GPIO_OUT_IDX` is defined for all targets and is usually used to signify "disconnect
* from peripheral signal" (a default unconnected peripheral state).
*/
const emac_io_info_t emac_io_idx = {
.mdc_idx = EMAC_MDC_O_IDX,
.mdo_idx = EMAC_MDO_O_IDX,
.mdi_idx = EMAC_MDI_I_IDX,
.mii_tx_clk_i_idx = SIG_GPIO_OUT_IDX, // indicates EMAC signal cannot be connected via GPIO Matrix on the target
.mii_tx_clk_i_idx = SIG_GPIO_OUT_IDX,
.mii_tx_en_o_idx = SIG_GPIO_OUT_IDX,
.mii_txd0_o_idx = SIG_GPIO_OUT_IDX,
.mii_txd1_o_idx = SIG_GPIO_OUT_IDX,
@@ -27,7 +36,8 @@ const emac_io_info_t emac_io_idx = {
.mii_tx_er_o_idx = SIG_GPIO_OUT_IDX,
.mii_rx_er_i_idx = SIG_GPIO_OUT_IDX,
.rmii_refclk_i_idx = SIG_GPIO_OUT_IDX,
.rmii_refclk_o_idx = SIG_GPIO_OUT_IDX
.rmii_refclk_o_idx = SIG_GPIO_OUT_IDX,
.ptp_pps_idx = SIG_GPIO_OUT_IDX,
};
static const emac_iomux_info_t emac_rmii_iomux_clki[] = {
@@ -145,6 +145,7 @@ typedef struct emac_dma_dev_s {
uint32_t dmarxcurrdesc; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmatxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmarxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t hwfeat; /*Hardware features*/
} emac_dma_dev_t;
extern emac_dma_dev_t EMAC_DMA;
+16 -1
View File
@@ -3,12 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "hal/config.h"
#include "soc/emac_periph.h"
#include "soc/io_mux_reg.h"
#if __has_include("soc/emac_reg.h")
#include "soc/emac_reg.h"
#endif
/**
* In emac_periph terms, `SIG_GPIO_OUT_IDX` indicates that the EMAC signal cannot be connected
* via the GPIO Matrix (i.e. such connection doesn't exist for the function), so it should
* stay in the default "unconnected state".
*
* Note: `SIG_GPIO_OUT_IDX` is defined for all targets and is usually used to signify "disconnect
* from peripheral signal" (a default unconnected peripheral state).
*/
const emac_io_info_t emac_io_idx = {
.mdc_idx = MII_MDC_PAD_OUT_IDX,
.mdo_idx = MII_MDO_PAD_OUT_IDX,
@@ -30,7 +40,12 @@ const emac_io_info_t emac_io_idx = {
.mii_tx_er_o_idx = EMAC_PHY_TXER_PAD_OUT_IDX,
.mii_rx_er_i_idx = EMAC_PHY_RXER_PAD_IN_IDX,
.rmii_refclk_i_idx = SIG_GPIO_OUT_IDX,
.rmii_refclk_o_idx = SIG_GPIO_OUT_IDX
.rmii_refclk_o_idx = SIG_GPIO_OUT_IDX,
#if HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300
.ptp_pps_idx = EMAC_PTP_PPS_PAD_OUT_IDX,
#else
.ptp_pps_idx = SIG_GPIO_OUT_IDX,
#endif
};
static const emac_iomux_info_t emac_rmii_iomux_clki[] = {
@@ -145,6 +145,7 @@ typedef struct emac_dma_dev_s {
uint32_t dmarxcurrdesc; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmatxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmarxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t hwfeat; /*Hardware features*/
} emac_dma_dev_t;
extern emac_dma_dev_t EMAC_DMA;
@@ -145,6 +145,7 @@ typedef struct emac_dma_dev_s {
uint32_t dmarxcurrdesc; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmatxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t dmarxcurraddr_buf; /*The address of the current receive descriptor list. Cleared on Reset.Pointer updated by the DMA during operation.*/
uint32_t hwfeat; /*Hardware features*/
} emac_dma_dev_t;
extern emac_dma_dev_t EMAC_DMA;
+1
View File
@@ -44,6 +44,7 @@ typedef struct {
uint32_t mii_tx_er_o_idx;
uint32_t rmii_refclk_i_idx;
uint32_t rmii_refclk_o_idx;
uint32_t ptp_pps_idx;
} emac_io_info_t;
typedef struct {