Skip to content

Conversation

@htibosch
Copy link
Contributor

Description

As the title says, this PR is adding a driver for 2 platforms: SAM4E and SAME70.

The driver makes use of the module ../Common/phyHandler.c, which initialises and polls the Ethernet PHY.

Related Issue

A user on the FreeRTOS forum asked for this driver. He had found a reference on SourceForge, but the ZIP file had been deleted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@htibosch
Copy link
Contributor Author

About the last commit:

The function usGenerateProtocolChecksum() now needs a parameter that indicates the length of a packet.
The function xNetworkInterfaceOutput() called a function called xCheckLoopback(0, which is not defined. Added this parameter to vGMACGenerateChecksum() as well.

@AniruddhaKanhere
Copy link
Member

/bot run checks

gkwicker
gkwicker previously approved these changes Apr 23, 2020
@htibosch
Copy link
Contributor Author

The EMAC task was started with a fixed high task-priority. In other drivers a macro is defined:

  #define niEMAC_HANDLER_TASK_PRIORITY     configMAX_PRIORITIES - 1

Users can override this macro in FreeRTOSIPConfig.h.

A second change: The driver didn't work on SAME70 Rev-B. The reason was that mentioned part has 6 priority queues in its EMAC.
Those queues are also initialised now:

    /* Note that SAME70 REV B had 6 priority queues. */
    gmac_set_tx_priority_queue(p_hw, (uint32_t)&gs_tx_desc_null, GMAC_QUE_3);
    gmac_set_tx_priority_queue(p_hw, (uint32_t)&gs_tx_desc_null, GMAC_QUE_4);
    gmac_set_tx_priority_queue(p_hw, (uint32_t)&gs_tx_desc_null, GMAC_QUE_5);

The changes are tested on both SAME70 Rev-A and Rev-B.

Hein

@htibosch
Copy link
Contributor Author

htibosch commented May 1, 2020

About the commit "phyHandling.c : Make the right choice between slow and frequent polling of the Ethernet PHY"

When the PHY Link Status is low, one wants to poll the status frequently. But once the PHY is connected, frequent polling of the PHY would be disturbing, and a slow polling is preferred.

In order to check the Link Status, the mask was compared with a const phyBMSR_LINK_STATUS, which is incorrect, mentioned macro is a register bit.

-    if( ( pxPhyObject->ulLinkStatusMask & phyBMSR_LINK_STATUS ) != 0 )
+    if( ( pxPhyObject->ulLinkStatusMask & ( ulBitMask >> 1 ) ) != 0 )

@htibosch
Copy link
Contributor Author

htibosch commented Jun 1, 2020

Closing this PR #57 because a new PR #78 (v2) will take it over.
Hein

@htibosch htibosch closed this Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants