Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/drivers/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ menuconfig RT_USING_ETHERNET

if RT_USING_ETHERNET
rsource "cadence/Kconfig"
rsource "realtek/Kconfig"
rsource "synopsys/Kconfig"
osource "$(SOC_DM_ETHERNET_DIR)/Kconfig"
endif
22 changes: 22 additions & 0 deletions components/drivers/ethernet/realtek/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
config RT_ETHERNET_REALTEK
bool "Realtek RTL8125 Ethernet"
depends on RT_USING_PCI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] 补上 DMA 依赖

这里需要加上 select RT_USING_DMA。目前可以选出 RT_ETHERNET_REALTEK=y、RT_USING_DMA=n 的配置,但驱动无条件调用 rt_dma_alloc_coherent() 和 rt_dma_free_coherent()。DMA 关闭时,rtdevice.h 不包含对应头文件,DMA 源文件也不参与构建,会导致编译或链接失败。RT_USING_PCI 本身没有选中 DMA。

depends on !RT_LWIP_USING_HW_CHECKSUM
default n
help
Enable the RT-Thread native PCI driver for Realtek RTL8125/RTL8162
Ethernet controllers. The driver implements one TX/RX queue, interrupt
driven receive, descriptor-ring DMA, link change reporting, and
10/100/1000/2500M auto-negotiation.
Requires lwIP software checksums; disable the global hardware checksum
option before enabling this driver.

config RT_REALTEK_PTP
bool "PTP supported"
depends on RT_ETHERNET_REALTEK
depends on RT_USING_PTP
default n
help
Register the RTL8125 hardware PTP clock with the RT-Thread PTP
framework. Supported operations include gettime, settime, adjtime,
adjfreq, and PPS where the selected hardware PTP block supports it.
18 changes: 18 additions & 0 deletions components/drivers/ethernet/realtek/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from building import *

group = []

if not GetDepend(['RT_ETHERNET_REALTEK']):
Return('group')

cwd = GetCurrentDir()
CPPPATH = [cwd + '/../../include', cwd + '/../']

src = ['r8125.c']

if GetDepend(['RT_REALTEK_PTP']):
src += ['r8125_ptp.c']

group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)

Return('group')
Loading
Loading