mirror of
https://github.com/nikdoof/builder.git
synced 2025-12-26 16:29:24 +00:00
add Xiaomi MJSXJ02HL
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
#
|
||||
Experimental system for building OpenIPC firmware for known devices
|
||||
#
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
AUTOLED_ARGS=""
|
||||
AUTOLED_PID_FILE=/var/run/autoled.pid
|
||||
|
||||
start() {
|
||||
printf "Starting automatic LED control: "
|
||||
umask 077
|
||||
start-stop-daemon -b -m -S -q -p $AUTOLED_PID_FILE \
|
||||
--exec /usr/sbin/autoled.sh -- $AUTOLED_ARGS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping automatic LED control: "
|
||||
start-stop-daemon -K -q -p $AUTOLED_PID_FILE
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart | reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start | restart | reload)
|
||||
if [ ! -d /sys/class/gpio/gpio0/ ]; then
|
||||
echo 0 > /sys/class/gpio/export
|
||||
echo in > /sys/class/gpio/gpio0/direction
|
||||
fi
|
||||
printf "Checking the reset button: "
|
||||
if [ $(cat /sys/class/gpio/gpio0/value) -eq 0 ]; then
|
||||
echo "PRESSED"
|
||||
# Wipe overlay partition and reboot
|
||||
echo "Let's start wipe overlay partition (/dev/mtd4)"
|
||||
/usr/sbin/sysupgrade -n -z
|
||||
else
|
||||
echo "NOT PRESSED"
|
||||
fi
|
||||
exit $?
|
||||
;;
|
||||
stop)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
AUTONIGHT_ARGS=""
|
||||
AUTONIGHT_PID_FILE=/var/run/autonight.pid
|
||||
|
||||
start() {
|
||||
printf "Starting automatic night mode changer: "
|
||||
umask 077
|
||||
start-stop-daemon -b -m -S -q -p $AUTONIGHT_PID_FILE \
|
||||
--exec /usr/sbin/autonight.sh -- $AUTONIGHT_ARGS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping automatic night mode changer: "
|
||||
start-stop-daemon -K -q -p $AUTONIGHT_PID_FILE
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart | reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
94
devices/hi3518ev300_lite_xiaomi-mjsxj02hl/general/overlay/etc/wireless/sdio
Executable file
94
devices/hi3518ev300_lite_xiaomi-mjsxj02hl/general/overlay/etc/wireless/sdio
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
set_gpio() {
|
||||
[ "$2" -eq 1 ] && gpio set $1 || gpio clear $1
|
||||
sleep 1
|
||||
}
|
||||
|
||||
set_mmc() {
|
||||
mmc=/sys/devices/platform/jzmmc_v1.2.$1/present
|
||||
[ "$(cat $mmc)" = "N" ] && echo "INSERT" > $mmc
|
||||
}
|
||||
|
||||
# Generic ATBM603X
|
||||
if [ "$1" = "atbm603x-generic" ]; then
|
||||
set_mmc 1
|
||||
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
|
||||
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
|
||||
modprobe atbm603x_wifi_sdio
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Generic RTL8189FS
|
||||
if [ "$1" = "rtl8189fs-generic" ]; then
|
||||
set_mmc 1
|
||||
modprobe 8189fs
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T20 Wyze PanV1
|
||||
if [ "$1" = "rtl8189es-t20-wyze-pan-v1" ]; then
|
||||
set_mmc 1
|
||||
modprobe 8189es rtw_power_mgnt=0 rtw_enusbss=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T20 Wyze V2
|
||||
if [ "$1" = "rtl8189ftv-t20-wyze-v2" ]; then
|
||||
set_mmc 1
|
||||
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T31 Wyze DB3
|
||||
if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then
|
||||
set_mmc 1
|
||||
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T31 Wyze PanV2
|
||||
if [ "$1" = "atbm603x-t31-wyze-pan-v2" ]; then
|
||||
set_gpio 58 0
|
||||
set_gpio 58 1
|
||||
set_mmc 1
|
||||
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
|
||||
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
|
||||
modprobe atbm603x_wifi_sdio atbm_printk_mask=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T31 Wyze V3 / AtomCam 2
|
||||
if [ "$1" = "atbm603x-t31-wyze-v3" ]; then
|
||||
set_gpio 57 0
|
||||
set_gpio 57 1
|
||||
set_mmc 1
|
||||
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
|
||||
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
|
||||
modprobe atbm603x_wifi_sdio atbm_printk_mask=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# T31 Wyze V3
|
||||
if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then
|
||||
set_gpio 57 1
|
||||
set_mmc 1
|
||||
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Hi3518ev300 Xiaomi MJSXJ02HL
|
||||
if [ "$1" = "rtl8189fs-mjsxj02hl" ]; then
|
||||
devmem 0x112C0048 32 0x1D54
|
||||
devmem 0x112C004C 32 0x1174
|
||||
devmem 0x112C0064 32 0x1174
|
||||
devmem 0x112C0060 32 0x1174
|
||||
devmem 0x112C005C 32 0x1174
|
||||
devmem 0x112C0058 32 0x1174
|
||||
devmem 0x10020028 32 0x28000000
|
||||
devmem 0x10020028 32 0x20000000
|
||||
modprobe 8189fs
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user