-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: eth_esp32: allow selecting ref clk source #65759
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
drivers: eth_esp32: allow selecting ref clk source #65759
Conversation
de31a03
to
3b17111
Compare
@sylvioalves compliance failure is related to the typo within espressif HAL, how should I fix that? |
ref_clk_gpio_output: | ||
type: int | ||
enum: | ||
- 16 | ||
- 17 | ||
description: | | ||
GPIO number to output RMII Clock. |
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.
How about using standard phandle-array for gpios? e.g. ref-clk-output-gpios = <&gpio0 16 0>;
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 don't see benefits from it since this is not handled by the Zephyr GPIO API but the espressif HAL directly. phandle-array would not be also possible to validate by the YAML parser itself as it is done right now.
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.
This is about having single way to describe GPIOs in devicetree files, regardless how those are used by driver (and whether Zephyr GPIO API is used or not).
See nordic,nrf-led-matrix.yaml
bindings, which uses standard gpios phandles for rows and columns, but internally in the driver just nRF specific representation of GPIOs are used.
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.
Fair enough, I've changed that into phandle-array
with additional build asserts.
|
3b17111
to
fd5ac18
Compare
fd5ac18
to
03afad5
Compare
03afad5
to
3631c14
Compare
Bumped hal_espressif to fix the compliance failure. |
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
3631c14
to
9276f4a
Compare
9276f4a
to
079795d
Compare
@bbilas please rebase |
8db06ea
3091e03
to
8db06ea
Compare
Done. |
@carlescufi It seems that we have not-related compliance failure, see: Error: See https://docs.zephyrproject.org/latest/build/kconfig/tips.html for more details. Found references to undefined Kconfig symbols. If any of these are false positives, then add them to UNDEF_KCONFIG_WHITELIST in /home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py. If the reference is for a comment like /* CONFIG_FOO_* */ (or /* CONFIG_FOO_*_... */), then please use exactly that form (with the '*'). The CI check knows not to flag it. More generally, a reference followed by $, @, {, *, or ## will never be flagged. CONFIG_ZTEST_NEW_API tests/drivers/console_switching/prj.conf:2 Error: Process completed with exit code 1. |
8db06ea
to
14cc8f6
Compare
Rebased with main once again... |
needs rebase |
It contains a fix for a typo within emac_hal module. Signed-off-by: Bartosz Bilas <[email protected]>
In case of boards where REF_CLK signal is not connected to the GPIO0 by default add the possibility to use the optional GPIO16/GPIO17 as a REF CLK source. Signed-off-by: Bartosz Bilas <[email protected]>
9dad825
14cc8f6
to
9dad825
Compare
Done. |
When GPIO17 or 16 is used as an external REF_CLK signal, the output is enabled in eth_esp32.c This was added in PR number zephyrproject-rtos#65759 and then refined in PR zephyrproject-rtos#74442. However this does not work for PHYs which need the REF_CLK for MDIO communication, such as LAN8720A. In such cases phy_mii driver tries to get the ID of such a PHY before REF_CLK is present. Therefore in this PR I propose to move REF_CLK initialization from eth_esp32.c to mdio_esp32.c which gets initialized before PHY and ETH. Signed-off-by: Łukasz Iwaszkiewicz <[email protected]>
When GPIO17 or 16 is used as an external REF_CLK signal, the output is enabled in eth_esp32.c This was added in PR number #65759 and then refined in PR #74442. However this does not work for PHYs which need the REF_CLK for MDIO communication, such as LAN8720A. In such cases phy_mii driver tries to get the ID of such a PHY before REF_CLK is present. Therefore in this PR I propose to move REF_CLK initialization from eth_esp32.c to mdio_esp32.c which gets initialized before PHY and ETH. Signed-off-by: Łukasz Iwaszkiewicz <[email protected]>
When GPIO17 or 16 is used as an external REF_CLK signal, the output is enabled in eth_esp32.c This was added in PR number zephyrproject-rtos#65759 and then refined in PR zephyrproject-rtos#74442. However this does not work for PHYs which need the REF_CLK for MDIO communication, such as LAN8720A. In such cases phy_mii driver tries to get the ID of such a PHY before REF_CLK is present. Therefore in this PR I propose to move REF_CLK initialization from eth_esp32.c to mdio_esp32.c which gets initialized before PHY and ETH. Signed-off-by: Łukasz Iwaszkiewicz <[email protected]>
In case of boards where REF_CLK signal is not connected to the GPIO0 by default add the possibility to use the optional GPIO16/GPIO17 as a REF CLK source.