#!/bin/sh set_gpio() { echo $1 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio$1/direction echo $2 > /sys/class/gpio/gpio$1/value echo $1 > /sys/class/gpio/unexport sleep 1 } # 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 devmem 0x10011128 32 0x400 # 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 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 exit 0 fi # T31 ATBM603X mmc1 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 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 exit 0 fi exit 1