Skip to content

NXP lpc17xx emac driver #7086

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 5 commits into from
Jun 11, 2018
Merged

NXP lpc17xx emac driver #7086

merged 5 commits into from
Jun 11, 2018

Conversation

mikaleppanen
Copy link

@mikaleppanen mikaleppanen commented Jun 1, 2018

Description

Ported NXP lpc17xx ethernet EMAC driver to unified EMAC.

Related greentea test updates are in: #7103.

Pull request type

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

@mikaleppanen
Copy link
Author

@kjbracey-arm @SeppoTakalo Please review.

SeppoTakalo
SeppoTakalo previously approved these changes Jun 4, 2018
kjbracey
kjbracey previously approved these changes Jun 4, 2018
Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

Just passing style nits

u32_t phy_speed_100mbs:1; /**< 10/100 MBS connection speed flag. */
u32_t phy_full_duplex:1; /**< Half/full duplex connection speed flag. */
u32_t phy_link_active:1; /**< Phy link active flag. */
uint32_t phy_speed_100mbs:1; /**< 10/100 MBS connection speed flag. */
Copy link
Contributor

Choose a reason for hiding this comment

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

If touching this, that's not technically portable (or sane). Make them bools or unsigned ints.

Copy link
Author

Choose a reason for hiding this comment

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

Corrected.

idx = LPC_EMAC->TxProduceIndex;

/* Determine number of free buffers */
if (idx == cidx)
Copy link
Contributor

Choose a reason for hiding this comment

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

{} needed on single lines

Copy link
Author

Choose a reason for hiding this comment

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

Corrected.

@@ -43,12 +48,57 @@

char s_trace_buffer[100] = MEM_MNGR_TRACE;

/* For LPC boards define the heap memory bank ourselves to give us section placement
control */
#ifndef ETHMEM_SECTION
Copy link
Contributor

Choose a reason for hiding this comment

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

If we ever do decide to support Nanostack on this board, let's figure out how to put this somewhere central. But this'll do for test.

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 is true.

@mikaleppanen mikaleppanen dismissed stale reviews from kjbracey and SeppoTakalo via a258a33 June 4, 2018 09:42
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

why are test changes and new tests part of the porting the driver? I would separate these to do a review of tests and then lpcxx emac driver addition

@mikaleppanen
Copy link
Author

@0xc0170 Ok, I removed the test changes from this pull request and I'll make a new one for those.

SeppoTakalo
SeppoTakalo previously approved these changes Jun 4, 2018
@mikaleppanen
Copy link
Author

Added support for UBLOX_C027 that was missing from targets.json.

@mikaleppanen
Copy link
Author

Added missing lwip memory configurations for UBLOX_C027/ARCH_PRO.

SeppoTakalo
SeppoTakalo previously approved these changes Jun 5, 2018
@SeppoTakalo
Copy link
Contributor

@0xc0170 Please re-review. Changes now done and we would like to push this into next 5.9 patch release, or ever RC (if we still have time).

kjbracey
kjbracey previously approved these changes Jun 5, 2018
@@ -0,0 +1,178 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

license header on top of the file missing

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2018

Just one small change request and this will go to CI.

@mikaleppanen mikaleppanen dismissed stale reviews from kjbracey and SeppoTakalo via ecaa683 June 6, 2018 11:29
Mika Leppänen added 5 commits June 6, 2018 14:29
When all TX descriptors were reserved in a row so that TX buffer
reclaim interrupt did not happen during reservation sequence, after
the interrupt occurred, TX buffer reclaim did no longer free buffers.

This happened because when all descriptors were in use, last free
index pointed to consumed index.
@mikaleppanen
Copy link
Author

@0xc0170 Added the license.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2018

Build : SUCCESS

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

Triggering tests

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

@cmonr
Copy link
Contributor

cmonr commented Jun 7, 2018

Halting CI builds until RC3 PRs are completed. Will resume after.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 8, 2018

/morph test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jun 8, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 8, 2018

Pausing CI until 5.9 RC3 completes CI. Will restart jobs when able.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 10, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 10, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jun 10, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 10, 2018

@kjbracey
Copy link
Contributor

This is marked as "refactor", but it's really "fix" as LPC17xx Ethernet is totally nonfunctional in 5.9.0.

@cmonr cmonr merged commit 8c6a664 into ARMmbed:master Jun 11, 2018
@adbridge
Copy link
Contributor

adbridge commented Jun 15, 2018

Something very weird in this PR!

a5a8b35 this creates a new file and this a840225 modifies and yet they are in the commit list in the opposite order! Which understandably causes havoc with the release script cherry picking them in order!!
I'll try manually applying this as a patch at the end.

@kjbracey
Copy link
Contributor

kjbracey commented Jun 15, 2018

Correct commit order is a508b35, a840225, 4d055ab, 03541df, 97de145. GitHub has reordered the first two.

All 5 commits have the same commit timestamp, from a rebase.

The first two commits have reversed author timestamps - a840225 has an author timestamp earlier than a508b35. That's presumably what's triggered the re-order.

Seems to be a known issue: isaacs/github#386

They actually sort by author-date, not commit-date? Your script re-sorts by commit-date, I believe, but that's ineffective as the commit dates are all equal, because of the rebase.

I think you may need to work around it by asking Git itself for the order. Something like:

git fetch github pull/XXX/head
git rev-list --topo-order mbed-os-5.9..FETCH_HEAD

@cmonr
Copy link
Contributor

cmonr commented Jun 15, 2018

Wow. That's nuts.

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