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

driver: ethernet: add adin2111 #57848

Merged
merged 4 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@
/drivers/ethernet/*w5500* @parthitce
/drivers/ethernet/*xlnx_gem* @ibirnbaum
/drivers/ethernet/*smsc91x* @sgrrzhf
/drivers/ethernet/*adin2111* @GeorgeCGV
/drivers/ethernet/phy/ @rlubos @tbursztyka @arvinf
/drivers/ethernet/phy/*adin2111* @GeorgeCGV
/drivers/mdio/ @rlubos @tbursztyka @arvinf
/drivers/mdio/*adin2111* @GeorgeCGV
/drivers/flash/ @nashif @de-nordic
/drivers/flash/*stm32_qspi* @lmajewski
/drivers/flash/*b91* @andy-liu-telink
Expand Down
1 change: 1 addition & 0 deletions drivers/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ zephyr_library_sources_ifdef(CONFIG_ETH_CYCLONEV eth_cyclonev.c)
zephyr_library_sources_ifdef(CONFIG_SLIP_TAP eth_slip_tap.c)
zephyr_library_sources_ifdef(CONFIG_ETH_SMSC91X eth_smsc91x.c)
zephyr_library_sources_ifdef(CONFIG_ETH_IVSHMEM eth_ivshmem.c eth_ivshmem_queue.c)
zephyr_library_sources_ifdef(CONFIG_ETH_ADIN2111 eth_adin2111.c)

if(CONFIG_ETH_NXP_S32_NETC)
zephyr_library_sources(eth_nxp_s32_netc.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ source "drivers/ethernet/Kconfig.cyclonev"
source "drivers/ethernet/Kconfig.nxp_s32"
source "drivers/ethernet/Kconfig.smsc91x"
source "drivers/ethernet/Kconfig.ivshmem"
source "drivers/ethernet/Kconfig.adin2111"

source "drivers/ethernet/phy/Kconfig"

Expand Down
67 changes: 67 additions & 0 deletions drivers/ethernet/Kconfig.adin2111
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright (c) 2023 PHOENIX CONTACT Electronics GmbH
# SPDX-License-Identifier: Apache-2.0

menuconfig ETH_ADIN2111
bool "ADIN2111 2-port 10BASE-T1L Controller"
default y
depends on DT_HAS_ADI_ADIN2111_ENABLED
select SPI
select MDIO
help
The ADIN2111 is a low power, 2-port 10BASE-T1L transceiver
designed for industrial Ethernet applications, and is compliant with
the IEEE® 802.3cg-2019™ Ethernet standard for long reach, 10
Mbps single pair Ethernet (SPE).

Featuring an integrated media access control (MAC) and a switch,
the ADIN2111 enables direct connectivity with a variety of controllers
via a serial peripheral inter-face (SPI).

if ETH_ADIN2111

config ETH_ADIN2111_INIT_PRIORITY
int "ADIN2111 driver init priority"
default 72
help
ADIN2111 device driver initialization priority.
Must be initialized after SPI, but before MDIO
and ports.

Both ports use ETH_INIT_PRIORITY initialization priority.

config ETH_ADIN2111_IRQ_THREAD_STACK_SIZE
int "Stack size for a thread that processes ADIN IRQ"
default 2048
help
Size of the stack used for internal thread which is ran to
process raised INT IRQ.

config ETH_ADIN2111_IRQ_THREAD_PRIO
int "Priority for internal incoming packet handler"
default 2
help
Priority level for internal thread which is ran for ADIN
INT IRQ processing.

config ETH_ADIN2111_TIMEOUT
int "IP buffer timeout"
default 100
help
Given timeout in milliseconds. Maximum amount of time
that the driver will wait from the IP stack to get
a memory buffer before the Ethernet frame is dropped.

config ETH_ADIN2111_SPI_CFG0
bool "SPI_CFG0"
default y
help
Must be set when ADIN uses 8-bit CRC (Generic SPI)
or Protection Mode (OPEN Alliance) on the SPI Host Interface.

config ETH_ADIN2111_BUFFER_SIZE
int "Buffer size in bytes use for frame transmission"
default 1524
help
Transmission and reception buffer size.

endif # ETH_ADIN2111