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

Fix and enable sam4e ethernet port #23031

Merged
merged 16 commits into from
Apr 17, 2020

Conversation

nandojve
Copy link
Member

@nandojve nandojve commented Feb 22, 2020

This PR add all missing pieces to fix and enable SAM4E Ethernet port.

The changes were tested on SAM4E and SAMV71 boards using samples/net/telnet. Tests are conducted using DHCPv4, collecting stats and ping 8.8.8.8

@zephyrbot
Copy link
Collaborator

zephyrbot commented Feb 22, 2020

All checks are passing now.

checkpatch (informational only, not a failure)

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

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

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

-:92: WARNING:LONG_LINE: line over 80 characters
#92: FILE: boards/arm/sam_e70_xplained/sam_e70_xplained.dts:16:
+	compatible = "atmel,sam_e70_xplained", "atmel,same70q21", "atmel,same70";

-:114: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,sam_e70b_xplained" appears un-documented -- check ./dts/bindings/
#114: FILE: boards/arm/sam_e70_xplained/sam_e70b_xplained.dts:15:
+	compatible = "atmel,sam_e70b_xplained", "atmel,same70q21b", "atmel,same70b";

-:114: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,same70q21b" appears un-documented -- check ./dts/bindings/
#114: FILE: boards/arm/sam_e70_xplained/sam_e70b_xplained.dts:15:
+	compatible = "atmel,sam_e70b_xplained", "atmel,same70q21b", "atmel,same70b";

-:114: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,same70b" appears un-documented -- check ./dts/bindings/
#114: FILE: boards/arm/sam_e70_xplained/sam_e70b_xplained.dts:15:
+	compatible = "atmel,sam_e70b_xplained", "atmel,same70q21b", "atmel,same70b";

-:114: WARNING:LONG_LINE: line over 80 characters
#114: FILE: boards/arm/sam_e70_xplained/sam_e70b_xplained.dts:15:
+	compatible = "atmel,sam_e70b_xplained", "atmel,same70q21b", "atmel,same70b";

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

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

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

-:182: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,sam_v71b_xult" appears un-documented -- check ./dts/bindings/
#182: FILE: boards/arm/sam_v71_xult/sam_v71b_xult.dts:15:
+	compatible = "atmel,sam_v71b_xult", "atmel,samv71q21b", "atmel,samv71b";

-:182: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,samv71q21b" appears un-documented -- check ./dts/bindings/
#182: FILE: boards/arm/sam_v71_xult/sam_v71b_xult.dts:15:
+	compatible = "atmel,sam_v71b_xult", "atmel,samv71q21b", "atmel,samv71b";

-:182: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "atmel,samv71b" appears un-documented -- check ./dts/bindings/
#182: FILE: boards/arm/sam_v71_xult/sam_v71b_xult.dts:15:
+	compatible = "atmel,sam_v71b_xult", "atmel,samv71q21b", "atmel,samv71b";

- total: 0 errors, 14 warnings, 425 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
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

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

We should add supported: netif:eth in sam4e_xpro.yaml too.

@stephanosio
Copy link
Member

Just a reminder that, if #23045 gets merged before this PR, we need to add device tree stuff here as well.

I already have the commits for that here:
stephanosio@a142166
stephanosio@da8a868

@nandojve
Copy link
Member Author

nandojve commented Feb 28, 2020

Just a reminder that, if #23045 gets merged before this PR, we need to add device tree stuff here as well.

I already have the commits for that here:
stephanosio@a142166
stephanosio@da8a868

@stephanosio I added missing netif:eth to sam4e_xpro.yaml, thank you for remind me about it. I cherry-picked both commits plus DTS definition and reworked. Now we have phy-connection-type 0dab05d to select between RMII and MII interfaces. I added more DTS options to work in future and now I'll work on max-frame-size. It'll be here soon.

Maybe you can update your version with 84e274f.

@nandojve nandojve closed this Feb 28, 2020
@nandojve nandojve reopened this Feb 28, 2020
@nandojve nandojve force-pushed the fix_sam4e_gmac branch 3 times, most recently from c99464e to ccb27ad Compare February 28, 2020 15:29
@nandojve
Copy link
Member Author

@mnkp

This cleans up DMA flags by separating the necessary flags for devices
with one or multiple RX/TX queues.

Signed-off-by: Gerson Fernando Budke <[email protected]>
This commit adds a GMAC instance to the SAM 4E device tree.

Signed-off-by: Stephanos Ioannidis <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
Add sam4e gmac pin definitions to use ethernet driver.

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve
Copy link
Member Author

rebase and added:

9ad5426 better approach to handle __nocache
62cca3b better way to handle in Kconfig

Thank you @stephanosio @galak @vlotech for all effort spend with the Kconfig issue.

vlotech and others added 13 commits April 11, 2020 14:49
Some drivers support NOCACHE_MEMORY sections. To have a default
fallback for systems where this isn't available or disabled a
fallback define is added.

Signed-off-by: Vincent van der Locht <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
Improve data cache conditional build. Now data cache code is build
only if device have support to it. This enables GMAC driver for use
with devices that don't have data cache instructions.

Signed-off-by: Gerson Fernando Budke <[email protected]>
The NOCACHE_MEMORY can be enabled only for those MCU that support data
cache. The currently SoC that doesn't have data cache is SAM4E.

Signed-off-by: Gerson Fernando Budke <[email protected]>
This add the following options to GMAC device tree bindings:
 - max-frame-size
 - max-speed
 - phy-connection-type

Signed-off-by: Gerson Fernando Budke <[email protected]>
The SAM4E GMAC version can use only MII as phy-connection-type. This
update the current default RMII value to MII.

Signed-off-by: Gerson Fernando Budke <[email protected]>
The current setup of physical layer forces RMII interface. The code was
refactored to have only one point to select proper phy interface. Now,
GMAC driver works with both RMII or MII interface. The phy connection
type is now selected by device tree. The default phy connection is RMII.

Signed-off-by: Gerson Fernando Budke <[email protected]>
This commit updates the Atmel SAM GMAC driver to select max frame size
value from the device tree. Now GMAC driver can operate with the three
different frame size options available.

The current supported values are: 1518, 1536 and 10240.

Signed-off-by: Gerson Fernando Budke <[email protected]>
This enable GMAC driver by default if the end application selects
NETWORKING. The driver will set MII interface since is the only one
available for SAM4E and will select a random MAC value.

Signed-off-by: Gerson Fernando Budke <[email protected]>
This commit enables the newly added GMAC instance in the `sam4e_xpro`
device tree.

Signed-off-by: Stephanos Ioannidis <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
Fix macro name from disable_all_queue_interrupt to
disable_all_priority_queue_interrupt.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Set model according with SoC revision A or B. Compatible follows
same approach.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Set model according with SoC revision A or B. Compatible follows
same approach.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Fixed the ETH_SAM_GMAC_QUEUES config by adding if-statements per SoC
series.

Signed-off-by: Vincent van der Locht <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve
Copy link
Member Author

Hi everyone, I was wondering if there is anything missing here? This is an important feature that have been blocked since Feb and will be great have it on Zephyr 2.3.

@jukkar jukkar merged commit d1f51db into zephyrproject-rtos:master Apr 17, 2020
@nandojve nandojve deleted the fix_sam4e_gmac branch April 17, 2020 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Boards area: Devicetree area: Ethernet platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants