Skip to content

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

Merged
merged 3 commits into from
Jun 20, 2018
Merged

K64f non-blocking powerup #7206

merged 3 commits into from
Jun 20, 2018

Conversation

mikaleppanen
Copy link

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

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

Mika Leppänen added 2 commits June 13, 2018 09:53
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.
@0xc0170 0xc0170 requested a review from a team June 13, 2018 12:42
@0xc0170 0xc0170 requested a review from a team June 13, 2018 12:42
@mmahadevan108
Copy link
Contributor

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.
That way we can keep this driver independent from the PHY that is connected.

status_t result = kStatus_Success;
uint32_t instance = ENET_GetInstance(base);

#if TARGET_K66F
Copy link
Contributor

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.

Copy link
Author

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?

Copy link
Contributor

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.

Copy link
Author

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));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this added?

Copy link
Author

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.

@mmahadevan108
Copy link
Contributor

PHY init and autonegotation is split into own functions.
@mikaleppanen
Copy link
Author

Updated the patch to the pull request.

@cmonr
Copy link
Contributor

cmonr commented Jun 19, 2018

@ARMmbed/mbed-os-ipcore Thoughts?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 19, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 19, 2018

Build : SUCCESS

Build number : 2383
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7206/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 19, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 19, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 19, 2018

Relaunching since something went wrong with the nodes.
/morph export-build

@studavekar
Copy link
Contributor

Exporter Build : FAILURE
Build number : 2016
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/exporter/7206/

The failure is due to build node been unresponsive. re-triggering

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jun 19, 2018

@cmonr cmonr merged commit e8005f6 into ARMmbed:master Jun 20, 2018
@mmahadevan108
Copy link
Contributor

@mikaleppanen Do we need similar changes for the LPC546XX driver as well?

@mikaleppanen
Copy link
Author

@mmahadevan108 Yes, it would be a good change to LPC546XX as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants