-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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: ethernet: stm32: add support for DT pinctrl #29246
drivers: ethernet: stm32: add support for DT pinctrl #29246
Conversation
gmarull
commented
Oct 15, 2020
- Add support for configuring Ethernet pins using DT pinctrl entries. Note that F1 series pinctrl support is not handled as the driver does not support F1.
- Move Ethernet pinmux settings to DT pinctrl on all boards based on STM32.
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.
LGTM
LGTM, but need to add nucleo_h743zi please 😄 I have tested dumb_http_server and ping works perfectly. boards/nucleo_h743zi/nucleo_h743zi.dts
Without the DTS node we have an error on ETH init:
With the DTS node, it starts normally:
|
@lochej Thank you for active participating. Strange stuff, that nucleo-h743zi were not listed here. I found the reasons: You have no |
@gmarull Take a look at my previous comment. It looks like we may have loosed also some more boards within this PR. For example |
@Nukersson I think @gmarull checked for existance of mac in pinmux.c just like I did with a small script for uart dac and adc DT pinctrl migrations. We might need something more clever, why not check the pinctrl dtsi include of each STM32 boards and seeing if the pinctrl dtsi contains any eth pin declaration nodes ? At least we could get the list of each boards using a SOC compatible with STM32 ethernet. |
@lochej Good idea. Or we can control, which |
@Nukersson, @lochej I don't think we should mix conversions with additions. Only the boards that have eth support within Zephyr today should be part of such coinversion PR. |
Ok. You're right: why we should add something, if it is not here 😄 But @lochej - you can add ethernet support to your Nucleo-h743zi same way as h745, cause both SoCs and pinouts are very very very identical, as I said before. |
I'm ok with this principle and will sure help with this. I was surprised to not see nucleo_h743zi since it is with it that i had previously worked on H7 series ethernet. I did the necessary adjustments to try out this PR on the only ethernet enabled board i have. I think @Nukersson and I didn't properly add nucleo_h743zi when we added H7 support. Btw sorry for closing and reopening this PR (missclick), I probably shouldn't use my phone to discuss here 🙃 |
@Nukersson @erwango Dear all, here is the little script I was talking about. It lists all STM32 boards using an ethernet enabled SOC. #!/bin/bash
stm_pinctrl_dir=../modules/hal/stm32/dts
boards_dir=./boards/arm
deviceTrees=$(find $boards_dir -regex ".*/*\.dts")
for dts in $deviceTrees; do
board=$(basename $(dirname $dts))
stm_pinctrl=$(cat $dts | grep -oP "st/.*/.*-pinctrl.dtsi")
if [ -z $stm_pinctrl ]
then
#Not an STM32 board.
continue
fi
stm_pinctrl_file=$stm_pinctrl_dir/$stm_pinctrl
has_stm32_eth=$(cat $stm_pinctrl_file | grep -cP "eth_.*")
if [ $has_stm32_eth -eq 0 ]
then
#Not an STM32 eth compatible SOC
continue
fi
#Display the board name using an ETH compatible SOC
echo $board
done Here is the output of the script for now:
All boards with a * are present in this PR. Note that this only means the SOC used in those boards have ethernet capabilities, not that it is available on the board. Each one of this list might need its own PR to have ethernet support. EDIT: After checking, I marked as '+' each board having a PHY and RJ45 port on it and as '-' if the board doesn't have RJ45 port nor PHY.
But this one cannot be added without a support for F1 ethernet:
This was in case this script could help targeting work for support 😄 |
Good work as usual. As only H7 series eth support left for now, let's add it in a separate PR, after this PR were merged. We both can do it, you can take h743 and I h747 for example. |
Add support for configuring Ethernet pins using DT pinctrl entries. Note that F1 series pinctrl support is not handled as the driver does not support F1. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Move Ethernet pinmux settings to DT pinctrl on all boards based on STM32. Signed-off-by: Gerard Marull-Paretas <[email protected]>
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.
LGTM !