diff --git a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig index e31df276..d1fae281 100644 --- a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig @@ -107,6 +107,8 @@ BR2_PACKAGE_INGENIC_ATBM603X_SDIO_T31=y BR2_PACKAGE_INGENIC_ATBM603X_SDIO_T31_MMC0=y BR2_PACKAGE_INGENIC_ATBM603X_SDIO_T31_MMC1=y # BR2_PACKAGE_RTL8188EU is not set +BR2_PACKAGE_RTL8189FS_OPENIPC=y +BR2_PACKAGE_RTL8189FS_OPENIPC_INGENIC=y # Motors BR2_PACKAGE_INGENIC_MOTORS_T31=y diff --git a/general/package/rtl8189fs-openipc/0002-ingenic_sdio.patch b/general/package/rtl8189fs-openipc/0002-ingenic_sdio.patch new file mode 100644 index 00000000..d0c5d4f5 --- /dev/null +++ b/general/package/rtl8189fs-openipc/0002-ingenic_sdio.patch @@ -0,0 +1,75 @@ +--- a/platform/platform_ingenic_sdio.c 1969-12-31 16:00:00.000000000 -0800 ++++ b/platform/platform_ingenic_sdio.c 2023-08-17 23:00:32.781683075 -0700 +@@ -0,0 +1,59 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#define GPIO_WIFI_WAKEUP GPIO_PC(17) ++#define GPIO_WIFI_RST_N GPIO_PC(16) ++#define SDIO_WIFI_POWER GPIO_PB(25) ++#define WLAN_SDIO_INDEX 1 ++ ++/* static int wl_pw_en = 0; */ ++extern void rtc32k_enable(void); ++extern void rtc32k_disable(void); ++ ++void wlan_pw_en_enable(void) ++{ ++} ++ ++void wlan_pw_en_disable(void) ++{ ++} ++ ++ ++/* ++ On T31 devices, we call jzmmc_manual_detect() to force a re-scan SDIO card on the mmc bus ++*/ ++int platform_wifi_power_on(void) ++{ ++ ++ /* gpio_request(SDIO_WIFI_POWER, "sdio_wifi_power_on"); ++ gpio_direction_output(SDIO_WIFI_POWER, 1); ++ printk("wlan power on\n"); ++ msleep(10); */ ++ ++ jzmmc_manual_detect(WLAN_SDIO_INDEX, 1); ++ printk("jzmmc manual detect complete\n"); ++ ++ return 0; ++} ++ ++int platform_wifi_power_off(void) ++{ ++ /* gpio_free(SDIO_WIFI_POWER); ++ gpio_direction_output(SDIO_WIFI_POWER, 0); ++ printk("wlan power off\n"); */ ++ printk("wlan power off called\n"); ++ return 0; ++} + +--- a/Makefile 2023-08-17 23:28:30.921779207 -0700 ++++ b/Makefile 2023-08-17 23:28:10.009147387 -0700 +@@ -250,7 +250,8 @@ + + + EXTRA_CFLAGS += -I$(src)/platform +-_PLATFORM_FILES := platform/platform_ops.o ++#_PLATFORM_FILES := platform/platform_ops.o ++_PLATFORM_FILES := platform/platform_ingenic_sdio.o + + + EXTRA_CFLAGS += -I$(src)/hal/btc diff --git a/general/package/rtl8189fs-openipc/Config.in b/general/package/rtl8189fs-openipc/Config.in index da339097..51b2d0e6 100644 --- a/general/package/rtl8189fs-openipc/Config.in +++ b/general/package/rtl8189fs-openipc/Config.in @@ -8,3 +8,12 @@ config BR2_PACKAGE_RTL8189FS_OPENIPC comment "rtl8189fs needs a Linux kernel to be built" depends on !BR2_LINUX_KERNEL + +if BR2_PACKAGE_RTL8189FS_OPENIPC + +config BR2_PACKAGE_RTL8189FS_OPENIPC_INGENIC + bool "rtl8189fs_openipc_ingenic" + default n + help + Certain Ingenic T31 devices require the driver to manually force a re-scan of the sdio bus after the GPIO is enabled for WLAN to function, select to enable support. +endif diff --git a/general/package/rtl8189fs-openipc/rtl8189fs-openipc.mk b/general/package/rtl8189fs-openipc/rtl8189fs-openipc.mk index 74b3a67c..a765082a 100644 --- a/general/package/rtl8189fs-openipc/rtl8189fs-openipc.mk +++ b/general/package/rtl8189fs-openipc/rtl8189fs-openipc.mk @@ -20,5 +20,9 @@ RTL8189FS_OPENIPC_MODULE_MAKE_OPTS = CONFIG_RTL8189FS=m \ KVER=$(LINUX_VERSION_PROBED) \ KSRC=$(LINUX_DIR) +ifeq ($(BR2_PACKAGE_RTL8189FS_OPENIPC_INGENIC),y) +RTL8189FS_OPENIPC_PATCHES += 0002-ingenic_sdio.patch +endif + $(eval $(kernel-module)) $(eval $(generic-package))