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

drivers: ethernet: renesas: Support Renesas RA8 Ethernet driver #77850

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

thaoluonguw
Copy link
Collaborator

@thaoluonguw thaoluonguw commented Sep 1, 2024

This PR is to support Ethernet driver for the Renesas RA8 boards
The driver design is based on the using Ethernet and Ethernet PHY FSP driver from hal_renesas to implement.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 1, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_renesas zephyrproject-rtos/hal_renesas@1032651 (main) zephyrproject-rtos/hal_renesas#34 zephyrproject-rtos/hal_renesas#34/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_renesas DNM This PR should not be merged (Do Not Merge) labels Sep 1, 2024
@thaoluonguw thaoluonguw changed the title Support renesas ra8 ethernet drivers: ethernet: renesas: Support Renesas RA8 Ethernet driver Sep 1, 2024
@thaoluonguw thaoluonguw marked this pull request as ready for review September 23, 2024 18:21
interrupts:
required: true

phy-type:
Copy link
Member

Choose a reason for hiding this comment

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

This is too similar to the generic phy-connection-type. Also I don't think it's a good idea to have an enum of a bunch of different specific phy devices. The phy should be a separate node in DT if it is a separate device in hardware.

Copy link
Member

Choose a reason for hiding this comment

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

@decsny , Changed to phy-connection-type

reg = <0x40354100 0xfc>;
interrupts = <42 0>;
local-mac-address = [00 11 22 33 44 55];
phy-type = <RA_PHY_ICS1894>;
Copy link
Member

Choose a reason for hiding this comment

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

some info specific external phy doesn't belong in an soc devictree, unless that phy is embedded in the soc

Copy link
Member

Choose a reason for hiding this comment

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

@decsny , Thank you for you feedback, now we are using phy node

}
}
} else if (res == -EAGAIN) {
res = R_ETHER_LinkProcess(&ctx->ctrl);
Copy link
Member

Choose a reason for hiding this comment

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

should be using zephyr phy API in the driver, no new vendor hal phy apis please, users hate this

Copy link
Member

Choose a reason for hiding this comment

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

@decsny , Thank you for you feedback, we change to implement mdio driver and now is using phy API from Zephyr, could you please help to recheck

samples/net/cloud/aws_iot_mqtt/boards/ek_ra8m1.overlay Outdated Show resolved Hide resolved
samples/net/dhcpv4_client/boards/mck_ra8t1.conf Outdated Show resolved Hide resolved
drivers/ethernet/Kconfig.renesas_ra Show resolved Hide resolved
samples/net/cloud/aws_iot_mqtt/boards/mck_ra8t1.conf Outdated Show resolved Hide resolved
@duynguyenxa duynguyenxa force-pushed the support_renesas_ra8_ethernet branch 3 times, most recently from 446ca92 to d0199df Compare October 29, 2024 04:38
@duynguyenxa duynguyenxa force-pushed the support_renesas_ra8_ethernet branch 5 times, most recently from b92bf83 to ac021e5 Compare October 30, 2024 01:48
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is on by default, if the device supports it. so no need to enable it explicit.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you, I rebase the change and remove the commit for this.

CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y

CONFIG_NET_DHCPV4=y
CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=2
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it necessary to set this to 2 instead using the default of 10?

Copy link
Member

Choose a reason for hiding this comment

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

Thank you, I rebase the change and remove the commit for this.

@kartben kartben assigned KhiemNguyenT and unassigned kartben Nov 8, 2024
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y
Copy link
Collaborator

Choose a reason for hiding this comment

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

with #80677 merged, this file and the other board specific files are no longer needed for that sample.

Copy link
Member

Choose a reason for hiding this comment

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

@maass-hamburg , Thank you, I rebase the change and remove the commit for this.

Add support for mdio driver for Renesas RA MCU series
This support utilize the r_ether_phy driver in hal renesas
to support mdio write and read function

Signed-off-by: Duy Nguyen <[email protected]>
The ICS1894 phy AN_COMPLETE bit is latched high, this make the
BMSR first read return incorrect status of the AN state, update
one more BMSR read to ensure all latched bit is clear and BMSR
return actual status of the phy chip

Signed-off-by: Duy Nguyen <[email protected]>
This commit is to enable Ethernet drivers support on Renesas RA
MCU, first target support is the Renesas RA8 series

Signed-off-by: Duy Nguyen <[email protected]>
@duynguyenxa
Copy link
Member

@decsny , could you help to recheck this PR

duynguyenxa and others added 3 commits November 21, 2024 17:00
Enable Ethernet controller node and mdio node for RA boards.
Add pinctl for mdio and Ethernet usage

Signed-off-by: Duy Nguyen <[email protected]>
Temporary update hal_renesas commit for Ethernet

Signed-off-by: Thao Luong <[email protected]>
When publish message, the dup_flag is not intialize
causing it to have random value and making the AWS MQTT
broker to reject the message
Add initialize dup_flag as 0

Signed-off-by: Duy Nguyen <[email protected]>

#define ETHER_ISR_EE_RECEIVE_EVENT_MASK (0x01070000)

#if ((ETHER_TOTAL_BUF_NUM) >= 2)
Copy link
Member

Choose a reason for hiding this comment

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

BTW, you could avoid these long list of conditional variable declarations by using LISTIFY() macro. It would make the code a bit more readable by avoiding this repetitive code.

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.

8 participants