diff --git a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig index e31df276..f6aaf8b9 100644 --- a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig @@ -106,6 +106,7 @@ BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MEDIATEK_MT7601U=y 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_RTL8189FS_OPENIPC=y # BR2_PACKAGE_RTL8188EU is not set # Motors diff --git a/general/overlay/etc/wireless/sdio b/general/overlay/etc/wireless/sdio index da587d62..9b8d6aa4 100755 --- a/general/overlay/etc/wireless/sdio +++ b/general/overlay/etc/wireless/sdio @@ -8,6 +8,13 @@ set_gpio() { sleep 1 } +set_mmc() { + mmc=/sys/devices/platform/jzmmc_v1.2.$1/present + if [ "$(cat $mmc)" = "N" ]; then + echo "INSERT" > $mmc + fi +} + # T31 ATBM603X mmc0 if [ "$1" = "atbm603x-t31-mmc0" ]; then # PB10 in wifi mmc1 is in the pull-down state by default, it needs to be set to a high-impedance state @@ -15,16 +22,12 @@ if [ "$1" = "atbm603x-t31-mmc0" ]; then # set wifi mmc1 clk drive capability to 8mA devmem 0x10011134 32 0x20000 - # "insert" the bus mmc0 device - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.0/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.0/present - sleep 1 - fi + set_mmc 0 cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp - modprobe atbm603x_wifi_sdi0 + modprobe atbm603x_wifi_sdi0 atbm_printk_mask=0 exit 0 fi @@ -33,16 +36,64 @@ if [ "$1" = "atbm603x-t31-mmc1" ]; then # not sure what this does, but it's copied from the stock fw devmem 0x10011110 32 0x6e094800 - # "insert" the bus mmc1 device - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.1/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.1/present - sleep 1 - fi + set_mmc 1 cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp - modprobe atbm603x_wifi_sdi1 + modprobe atbm603x_wifi_sdi1 atbm_printk_mask=0 + exit 0 +fi + +# T31 Wyze V3 / AtomCam 2 ATBM603x +if [ "$1" = "atbm603x-t31-wyze-v3" ]; then + set_gpio 57 1 + + set_mmc 1 + + cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp + cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp + + modprobe atbm603x_wifi_sdi1 atbm_printk_mask=0 + sleep 1 + exit 0 +fi + +# T31 Wyze V3 RTL8189FTV +if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then + set_gpio 57 1 + + set_mmc 1 + + modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 + sleep 1 + exit 0 +fi + +# T31 Wyze DB3 RTL8189FTV +if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then + set_mmc 1 + + modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 + sleep 1 + exit 0 +fi + +# T20 Wyze V2 RTL8189FTV +if [ "$1" = "rtl8189ftv-t20-wyze-v2" ]; then + set_mmc 1 + + modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 + sleep 1 + exit 0 +fi + +# T20 Wyze PanV1 RTL8189ES +if [ "$1" = "rtl8189ftv-t20-wyze-pan-v1" ]; then + set_mmc 1 + + modprobe 8189es rtw_power_mgnt=0 rtw_enusbss=0 + sleep 1 exit 0 fi