ODROID-C5: add wake up by external ethernet phy

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I8b731cdb7afe0637d913bbdf8b32050794bc54a6
diff --git a/s7d_odroidc5/CMakeLists.txt b/s7d_odroidc5/CMakeLists.txt
index a364c84..a82d720 100644
--- a/s7d_odroidc5/CMakeLists.txt
+++ b/s7d_odroidc5/CMakeLists.txt
@@ -9,6 +9,7 @@
 aml_library_sources(
 	power.c
 	hw_business.c
+	extphy.c
 )
 
 aml_library_sources_ifdef(
diff --git a/s7d_odroidc5/extphy.c b/s7d_odroidc5/extphy.c
new file mode 100644
index 0000000..dc8a389
--- /dev/null
+++ b/s7d_odroidc5/extphy.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2025 Hardkernel Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "keypad.h"
+#include "gpio.h"
+#include "suspend.h"
+
+#define GPIO_EXTPHY_WOL		GPIOH_10
+
+static void vExtPhyCallBack(struct xReportEvent event)
+{
+	uint32_t buf[4] = { 0 };
+
+	if (event.ulCode == GPIO_EXTPHY_WOL) {
+		buf[0] = ETH_PHY_GPIO;
+		STR_Wakeup_src_Queue_Send_FromISR(buf);
+		printf("EXTPHY: EVENT 0x%x,%d,%d\n", event.event, event.ulCode,
+				event.responseTime);
+	}
+}
+
+struct xGpioKeyInfo gpioKeyInfo[] = {
+	GPIO_KEY_INFO(GPIO_EXTPHY_WOL, HIGH, EVENT_SHORT, vExtPhyCallBack, NULL),
+};
+
+void vExtPhyInit(void)
+{
+	vCreateGpioKey(gpioKeyInfo, sizeof(gpioKeyInfo) / sizeof(struct xGpioKeyInfo));
+}
+
+void vExtPhyDeinit(void)
+{
+	vDestroyGpioKey();
+}
diff --git a/s7d_odroidc5/power.c b/s7d_odroidc5/power.c
index 39e63f1..89890ed 100644
--- a/s7d_odroidc5/power.c
+++ b/s7d_odroidc5/power.c
@@ -24,6 +24,9 @@
 
 #include "hdmi_cec.h"
 
+extern void vExtPhyInit(void);
+extern void vExtPhyDeinit(void);
+
 static TaskHandle_t cecTask;
 
 #define VCC5V_GPIO		GPIOC_7
@@ -96,6 +99,7 @@
 
 	vBackupAndClearGpioIrqReg();
 	vGpioIRQInit();
+	vExtPhyInit();
 	vGpioKeyEnable();
 
 #if BL30_SUSPEND_DEBUG_EN
@@ -117,6 +121,7 @@
 	}
 
 	vGpioKeyDisable();
+	vExtPhyDeinit();
 	vRestoreGpioIrqReg();
 
 #if BL30_SUSPEND_DEBUG_EN