Skip to content

Commit

Permalink
drivers: dm8806: link speed change interrupt handling
Browse files Browse the repository at this point in the history
On the interrupt handling, one thread per driver instance is involved
into monitoring the semaphor, sends inside the gpio callback triggered
by the gpio interrupt. Each time, when the link parameters are change,
the DM8806 is generating the gpio interrupt. After getting semaphor,
the application callback function which was linked during initialization
process is called to get the new link parameters with standard API
calls

(cherry picked from commit ef6f804)

Original-Signed-off-by: Robert Slawinski <robert.slawinski1@gmail.com>
GitOrigin-RevId: ef6f804
Cr-Build-Id: 8729035348064486593
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8729035348064486593
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I5c7bdc3ff391a3afbb72b084d12583e33f679512
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6079808
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
  • Loading branch information
Robert Slawinski authored and Chromeos LUCI committed Dec 9, 2024
1 parent 880947b commit 15c0ca7
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 28 deletions.
8 changes: 1 addition & 7 deletions drivers/ethernet/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module-str = Log level for Ethernet PHY driver
module-help = Sets log level for Ethernet PHY Device Drivers.
source "subsys/net/Kconfig.template.log_config.net"
source "drivers/ethernet/phy/Kconfig.tja1103"
source "drivers/ethernet/phy/Kconfig.dm8806"

config PHY_INIT_PRIORITY
int "Ethernet PHY driver init priority"
Expand All @@ -40,13 +41,6 @@ config PHY_ADIN2111
help
Enable ADIN2111 PHY driver.

config PHY_DM8806
bool "DM8806 PHY driver"
default y
depends on DT_HAS_DAVICOM_DM8806_PHY_ENABLED
help
Enable DM8806 PHY driver.

config PHY_MICROCHIP_KSZ8081
bool "Microchip KSZ8081 PHY Driver"
default y
Expand Down
49 changes: 49 additions & 0 deletions drivers/ethernet/phy/Kconfig.dm8806
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2024 Robert Slawinski <robert.slawinski1@gmail.com>
# SPDX-License-Identifier: Apache-2.0

# Davicom PHY DM8806 driver configuration options

menuconfig PHY_DM8806
bool "Davicom PHY DM8806 driver"
default y
depends on DT_HAS_DAVICOM_DM8806_PHY_ENABLED
depends on MDIO
help
Enable driver for Davicom DM8806 PHY.

if PHY_DM8806

choice PHY_DM8806_TRIGGER_MODE
prompt "Trigger mode"
default PHY_DM8806_TRIGGER_GLOBAL_THREAD
help
Specify the type of triggering to be used by the driver.

config PHY_DM8806_TRIGGER_NONE
bool "No trigger"

config PHY_DM8806_TRIGGER_GLOBAL_THREAD
bool "Use global thread"
depends on GPIO
select PHY_DM8806_TRIGGER

endchoice

config PHY_DM8806_TRIGGER
bool

config PHY_DM8806_THREAD_PRIORITY
int "Thread priority"
depends on PHY_DM8806_TRIGGER_GLOBAL_THREAD
default 13
help
Priority of thread used by the driver to handle interrupts.

config PHY_DM8806_THREAD_STACK_SIZE
int "Thread stack size"
depends on PHY_DM8806_TRIGGER_GLOBAL_THREAD
default 1024
help
Stack size of thread used by the driver to handle interrupts.

endif # PHY_DM8806_TRIGGER
Loading

0 comments on commit 15c0ca7

Please sign in to comment.