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

Add GMAC device tree binding #23045

Merged
merged 9 commits into from
Mar 31, 2020
Merged

Conversation

stephanosio
Copy link
Member

@stephanosio stephanosio commented Feb 24, 2020

This PR adds the device tree binding for the Atmel SAM GMAC Ethernet and converts the existing compatible SoCs (SAM E70 and V71) and boards (sam_e70_xplained and sam_v71_xult) to use it.

Includes commits from #23055.

Fixes #22997.

@stephanosio
Copy link
Member Author

cc @nandojve

@zephyrbot
Copy link
Collaborator

zephyrbot commented Feb 24, 2020

All checks are passing now.

checkpatch (informational only, not a failure)

-:45: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,sam_e70_xplained" appears un-documented -- check ./dts/bindings/
#45: FILE: boards/arm/sam_e70_xplained/sam_e70_xplained-common.dtsi:11:
+	compatible = "atmel,sam_e70_xplained", "atmel,same70q21", "atmel,same70";

-:45: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,same70q21" appears un-documented -- check ./dts/bindings/
#45: FILE: boards/arm/sam_e70_xplained/sam_e70_xplained-common.dtsi:11:
+	compatible = "atmel,sam_e70_xplained", "atmel,same70q21", "atmel,same70";

-:45: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,same70" appears un-documented -- check ./dts/bindings/
#45: FILE: boards/arm/sam_e70_xplained/sam_e70_xplained-common.dtsi:11:
+	compatible = "atmel,sam_e70_xplained", "atmel,same70q21", "atmel,same70";

-:45: WARNING:LONG_LINE: line over 80 characters
#45: FILE: boards/arm/sam_e70_xplained/sam_e70_xplained-common.dtsi:11:
+	compatible = "atmel,sam_e70_xplained", "atmel,same70q21", "atmel,same70";

-:368: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,sam_v71_xult" appears un-documented -- check ./dts/bindings/
#368: FILE: boards/arm/sam_v71_xult/sam_v71_xult-common.dtsi:12:
+	compatible = "atmel,sam_v71_xult", "atmel,samv71q21", "atmel,samv71";

-:368: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,samv71q21" appears un-documented -- check ./dts/bindings/
#368: FILE: boards/arm/sam_v71_xult/sam_v71_xult-common.dtsi:12:
+	compatible = "atmel,sam_v71_xult", "atmel,samv71q21", "atmel,samv71";

-:368: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,samv71" appears un-documented -- check ./dts/bindings/
#368: FILE: boards/arm/sam_v71_xult/sam_v71_xult-common.dtsi:12:
+	compatible = "atmel,sam_v71_xult", "atmel,samv71q21", "atmel,samv71";

- total: 0 errors, 7 warnings, 1020 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

Copy link
Contributor

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

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

Just a comment to make this not show in my pending review list, as I'm not authority on DT stuff.

@stephanosio
Copy link
Member Author

@ulfalizer @galak Any suggested alternative for dt_int_val, which is apparently deprecated?

@stephanosio
Copy link
Member Author

@nandojve I am adding you as the SAM E70 platform code owner, since there currently is none and the Codeowners check is complaining about it.

@stephanosio
Copy link
Member Author

stephanosio commented Feb 24, 2020

We are currently seeing USB-related build errors for SAMV71B because the ASF usbhs.h header in hal_atmel is missing some definitions for unknown reason.

https://github.com/zephyrproject-rtos/hal_atmel/blob/5a44c9d54dffd685fb6664a646922cfe41c5cf8e/asf/sam/include/samv71/component/usbhs.h#L1299-L1325

https://github.com/zephyrproject-rtos/hal_atmel/blob/5a44c9d54dffd685fb6664a646922cfe41c5cf8e/asf/sam/include/samv71b/component/usbhs.h#L1341-L1355

https://gist.github.com/stephanosio/cc7dd2049a740bdb13b1acdf6c6325af

ADD: These definitions have also been removed in the latest SAME70 DFP 2.4.166 SAME70B usbhs.h header. Need to investigate ... => it looks like they decided to define the register bits per mode in the latest DFP. For instance, USBHS_DEVEPTISR_RXSTPI is now USBHS_DEVEPTISR_CTRL_RXSTPI.

UPDATE: I will provide a fix for this tomorrow on top of #23055 in this PR.

@stephanosio
Copy link
Member Author

Rebased

@nandojve
Copy link
Member

Tested on SAMV71 with samples/net/telnet using net->ping and net->dns.

@stephanosio stephanosio reopened this Mar 28, 2020
Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

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

If you want to pull out the commits for creating the 'B' variants that PR could get merged while the GMAC changes are still being done.

Please convert to use the new DT macro's in include/devicetree.h.

This commit adds the missing Atmel SAM-family GMAC Ethernet device
binding.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit updates the Atmel SAM GMAC driver to use the device tree
values for GMAC hardware configuration.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit adds a GMAC instance to the SAM E70 device tree, with the
chip revision-specific hardware queue count.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit adds a new `sam_e70b_xplained` variant with the chip
revision B device tree.

In addition, this commit enables the newly added GMAC device tree
instance.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit adds a GMAC instance to the SAM V71 device tree, with the
chip revision-specific hardware queue count.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit adds a new `sam_v71_xult` variant with the chip revision B
device tree.

In addition, this commit enables the newly added GMAC device tree
instance.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit removes the Kconfig MAC address configurations for the
`sam_e70_xplained` board, as these have been migrated to use the device
tree configurations.

Signed-off-by: Stephanos Ioannidis <[email protected]>
Copy link
Member

@mnkp mnkp left a comment

Choose a reason for hiding this comment

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

LGTM, comments from @galak still need to be addressed.

@stephanosio
Copy link
Member Author

If you want to pull out the commits for creating the 'B' variants that PR could get merged while the GMAC changes are still being done.

Please convert to use the new DT macro's in include/devicetree.h.

@galak I have added a new commit to convert the Atmel SAM GMAC driver to use the new DT_INST macros.

@stephanosio stephanosio requested a review from galak March 28, 2020 18:23
Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

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

in general looks good, one change associated with where the #define DT_DRV_COMPAT is done.

This commit converts the Atmel SAM GMAC driver to use the new DT_INST
macro APIs.

Signed-off-by: Stephanos Ioannidis <[email protected]>
@stephanosio
Copy link
Member Author

in general looks good, one change associated with where the #define DT_DRV_COMPAT is done.

@galak Fixed

@galak galak merged commit 57c28c0 into zephyrproject-rtos:master Mar 31, 2020
@stephanosio stephanosio deleted the add_gmac_dts branch April 23, 2020 06:24
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.

Add GMAC device tree definition
6 participants