-
Notifications
You must be signed in to change notification settings - Fork 3k
K64f non-blocking powerup #7206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changed K64F/K66F power up to return without waiting for link up i.e. for the ethernet cable to be connected. This is needed for non-blocking use of driver e.g. for using the driver from event queue.
Currently, if all TX descriptors are in use and IP stack calls K64F/K66F ethernet driver link out, link out drops the packet. Added 10ms delay to link out to wait for a descriptor to become available before dropping the packet.
Thank you. Can we make changes to the PHY driver in the HAL layer and calls these functions instead of moving the PHY implementation to this driver. |
status_t result = kStatus_Success; | ||
uint32_t instance = ENET_GetInstance(base); | ||
|
||
#if TARGET_K66F |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we would like to split the PHY_Init function into 2. Can this be done inside fsl_phy.c and then call those functions rather than move the implementation from fsl_phy.c to inside this driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good. Will you make a commit about the fsl_phy.c changes? Or should I make those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have attached a patch, can you take a look and update PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll apply the patch.
prev_state.speed = (phy_speed_t)STATE_UNKNOWN; | ||
prev_state.duplex = (phy_duplex_t)STATE_UNKNOWN; | ||
|
||
phy_task_handle = mbed::mbed_event_queue()->call_every(PHY_TASK_PERIOD_MS, mbed::callback(this, &Kinetis_EMAC::phy_task)); | ||
mbed::mbed_event_queue()->call(mbed::callback(this, &Kinetis_EMAC::phy_task)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first call_every() callback is triggered after 200ms. Now the first call() callback is triggered right after the power up and then every 200ms.
PHY init and autonegotation is split into own functions.
Updated the patch to the pull request. |
@ARMmbed/mbed-os-ipcore Thoughts? |
/morph build |
Build : SUCCESSBuild number : 2383 Triggering tests/morph test |
Test : SUCCESSBuild number : 2172 |
Exporter Build : FAILUREBuild number : 2016 |
Relaunching since something went wrong with the nodes. |
The failure is due to build node been unresponsive. re-triggering /morph export-build |
Exporter Build : SUCCESSBuild number : 2024 |
@mikaleppanen Do we need similar changes for the LPC546XX driver as well? |
@mmahadevan108 Yes, it would be a good change to LPC546XX as well. |
Description
Changed K64F/K66F power up to return without waiting for link up i.e. for the ethernet cable to be connected. This is needed for non-blocking use of driver e.g. for using the driver from event queue.
Added delay to K64F/K66F ethernet TX when all descriptors are in use. Previously, if all TX descriptors were in use and IP stack called K64F/K66F ethernet driver link out, link out dropped the packet. Added 10ms delay to link out to wait for a descriptor to become available before dropping the packet.
Pull request type