Skip to content
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

libethdrivers,imx: Reintroduce ethif_imx6_init #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kent-mcleod
Copy link
Member

This init function is used by ethif_new_lwip_driver and was previously
removed in an earlier refactor. This commit reintroduces it.

Signed-off-by: Kent McLeod [email protected]

This init function is used by ethif_new_lwip_driver and was previously
removed in an earlier refactor. This commit reintroduces it.

Signed-off-by: Kent McLeod <[email protected]>
Add NIC_CONFIG_NO_CLOCK_SYS flag which prevents the ethernet driver from
trying to initialize a clock_sys driver (which requires CCM hardware
resources) during initialization.  This flag should be used when the
clocks are setup independently from the driver.

Signed-off-by: Kent McLeod <[email protected]>
ret = -ENODEV;
return -1;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a missing return 0 here.

@axel-h
Copy link
Member

axel-h commented Nov 22, 2021

As a follow-up, should we have a CI test that a system using LWIP still builds? Since i.MX6 i supported in QEMU, we could later even add a check that this actually works

@kent-mcleod
Copy link
Member Author

As a follow-up, should we have a CI test that a system using LWIP still builds? Since i.MX6 i supported in QEMU, we could later even add a check that this actually works

This would be the closest: seL4/camkes#13

@@ -10,14 +10,14 @@
#include <ethdrivers/imx6.h>
#include <utils/attribute.h>
#include <ethdrivers/raw.h>
#include "../src/plat/imx6/enet.h"
Copy link
Member

@axel-h axel-h Dec 9, 2021

Choose a reason for hiding this comment

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

If I remember correctly we had to include this here to address a nasty include problem and make these prototypes available to other C file in our driver:

int enet_mdio_read(struct enet *enet, uint16_t phy, uint16_t reg);
int enet_mdio_write(struct enet *enet, uint16_t phy, uint16_t reg, uint16_t data);

Could you leave this in for now. I'd make this a separate issue (#116) than that should be cleaned up.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does seem possible to declare just those symbols at the bottom of this file:

int enet_mdio_read(struct enet* enet, uint16_t phy, uint16_t reg);
int enet_mdio_write(struct enet* enet, uint16_t phy, uint16_t reg, uint16_t data);

Adding a relative include into a private header file breaks if these public headers are installed somewhere else which breaks how I'm using the library.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, sounds feasible, I don't remember why we did not do this. Can you put removing this header here in a separate commit, so this is separate from adding the NIC_CONFIG_NO_CLOCK_SYS flag or adding the interface again?

@axel-h
Copy link
Member

axel-h commented Dec 9, 2021

I'm fine with merging this when the style issue and the missing return are addressed. Leaving the include file for now is a nice-to-have thing.

@axel-h
Copy link
Member

axel-h commented Mar 8, 2022

@kent-mcleod: do you want to merge this?

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.

2 participants