Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ BaseType_t xNetworkInterfaceInitialise( void )
HAL_ETH_DescAssignMemory( &( xEthHandle ), uxIndex, pucBuffer, NULL );
}

/* Configure the MDIO Clock */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add ETH_MAC_MDIO_ClkConfig here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it calls HAL_ETH_Init in NetworkInterface.c:234, and HAL_ETH_Init calls ETH_MAC_MDIO_ClkConfig in stm32hxx_hal_eth.c:309.

HAL_ETH_SetMDIOClockRange( &( xEthHandle ) );

/* Initialize the MACB and set all PHY properties */
prvMACBProbePhy();

Expand Down
50 changes: 0 additions & 50 deletions source/portable/NetworkInterface/STM32Hxx/stm32hxx_hal_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2171,56 +2171,6 @@ extern SemaphoreHandle_t xTXDescriptorSemaphore;
}
}

/**
* @brief Configures the Clock range of ETH MDIO interface.
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
* the configuration information for ETHERNET module
* @retval None
*/
void HAL_ETH_SetMDIOClockRange( ETH_HandleTypeDef * heth )
{
uint32_t tmpreg, hclk;

/* Get the ETHERNET MACMDIOAR value */
tmpreg = ( heth->Instance )->MACMDIOAR;

/* Clear CSR Clock Range bits */
tmpreg &= ~ETH_MACMDIOAR_CR;

/* Get hclk frequency value */
hclk = HAL_RCC_GetHCLKFreq();

/* Set CR bits depending on hclk value */
if( ( hclk >= 20000000U ) && ( hclk < 35000000U ) )
{
/* CSR Clock Range between 20-35 MHz */
tmpreg |= ( uint32_t ) ETH_MACMDIOAR_CR_DIV16;
}
else if( ( hclk >= 35000000U ) && ( hclk < 60000000U ) )
{
/* CSR Clock Range between 35-60 MHz */
tmpreg |= ( uint32_t ) ETH_MACMDIOAR_CR_DIV26;
}
else if( ( hclk >= 60000000U ) && ( hclk < 100000000U ) )
{
/* CSR Clock Range between 60-100 MHz */
tmpreg |= ( uint32_t ) ETH_MACMDIOAR_CR_DIV42;
}
else if( ( hclk >= 100000000U ) && ( hclk < 150000000U ) )
{
/* CSR Clock Range between 100-150 MHz */
tmpreg |= ( uint32_t ) ETH_MACMDIOAR_CR_DIV62;
}
else /* (hclk >= 150000000)&&(hclk <= 200000000) */
{
/* CSR Clock Range between 150-200 MHz */
tmpreg |= ( uint32_t ) ETH_MACMDIOAR_CR_DIV102;
}

/* Configure the CSR Clock Range */
( heth->Instance )->MACMDIOAR = ( uint32_t ) tmpreg;
}

/**
* @brief Set the ETH MAC (L2) Filters configuration.
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,6 @@
ETH_MACConfigTypeDef * macconf );
HAL_StatusTypeDef HAL_ETH_SetDMAConfig( ETH_HandleTypeDef * heth,
ETH_DMAConfigTypeDef * dmaconf );
void HAL_ETH_SetMDIOClockRange( ETH_HandleTypeDef * heth );

/* MAC VLAN Processing APIs ************************************************/
void HAL_ETH_SetRxVLANIdentifier( ETH_HandleTypeDef * heth,
Expand Down