mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-18 03:28:19 +01:00
project:build.sh:optimize the method of determining whether the Ubuntu image is local
sysdrv:Makefile:modify the method of compiling WiFi/BT drivers sysdrv:drv_ko:wifi:aic8800dc:optimize Bluetooth transmission sysdrv:tools:board:buildroot:resolve the issue where the USB cannot automatically obtain an IP address sysdrv:tools:board:luckfox_config:add an optional setting for UART3M1 on the Luckfox Pico Mini sysdrv:source:kernel:arch:arm:boot:dts:eliminate display noise on the LF40-72720-ARK sysdrv:source:uboot:rkbin:bin:rv11:resolve the issue of certain SD card models not being recognized Refactor:sysdrv:Makefile:obtain WiFi/BT drivers from source compilation on the Ubuntu system Perf:sysdrv:drv_ko:wifi:aic8800dc:expand WiFi/Bluetooth rfkill management methods, increase Bluetooth communication baud rate, and reduce communication lag Fix:sysdrv:tools:board:buildroot:resolve the issue where the `rkipc` program overwrites the IP address of USB0 when the camera is activated on the Luckfox Pico Ultra Fix:source:uboot:rkbin:bin:rv11:resolve the issue where, in the presence of an image on SPI NAND, romboot prioritizes using `.bin` from SPI NAND, causing the SD card to be unrecognized Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
committed by
luckfox-eng33
parent
6a7f87806f
commit
c27bded97e
@@ -30,7 +30,7 @@ USB_CONFIGS_DIR=${USB_CONFIGFS_DIR}/configs/${USB_SKELETON}
|
||||
# For VBUS_ALWAYS_ON usb otg is not support ums
|
||||
# Since the block to ums is always occupated by USB due to no disconneted state
|
||||
UMS_BLOCK=/userdata/ums_shared.img
|
||||
UMS_BLOCK_SIZE=0 #unit M
|
||||
UMS_BLOCK_SIZE=0 #unit M
|
||||
UMS_BLOCK_TYPE=fat
|
||||
UMS_BLOCK_AUTO_MOUNT=off
|
||||
UMS_RO=0
|
||||
@@ -42,13 +42,11 @@ UVC_U_DIR=${UVC_STREAMING_DIR}/uncompressed/u/
|
||||
UVC_M_DIR=${UVC_STREAMING_DIR}/mjpeg/m/
|
||||
UVC_F_DIR=${UVC_STREAMING_DIR}/framebased/f/
|
||||
|
||||
test_write()
|
||||
{
|
||||
test -e $2 && echo $1 > $2
|
||||
test_write() {
|
||||
test -e $2 && echo $1 >$2
|
||||
}
|
||||
|
||||
function_init()
|
||||
{
|
||||
function_init() {
|
||||
mkdir ${USB_FUNCTIONS_DIR}/uac1.gs0
|
||||
test_write 1 ${USB_FUNCTIONS_DIR}/uac1.gs0/c_feature_unit
|
||||
test_write 1 ${USB_FUNCTIONS_DIR}/uac1.gs0/p_feature_unit
|
||||
@@ -66,38 +64,36 @@ function_init()
|
||||
mkdir ${USB_FUNCTIONS_DIR}/hid.usb0
|
||||
}
|
||||
|
||||
configfs_init()
|
||||
{
|
||||
configfs_init() {
|
||||
echo "Debug: configfs_init"
|
||||
mkdir /dev/usb-ffs
|
||||
|
||||
mount -t configfs none ${CONFIGFS_DIR}
|
||||
mkdir ${USB_CONFIGFS_DIR} -m 0770
|
||||
echo 0x2207 > ${USB_CONFIGFS_DIR}/idVendor
|
||||
echo 0x0310 > ${USB_CONFIGFS_DIR}/bcdDevice
|
||||
echo 0x0200 > ${USB_CONFIGFS_DIR}/bcdUSB
|
||||
mkdir ${USB_STRINGS_DIR} -m 0770
|
||||
SERIAL=`cat /proc/cpuinfo | grep Serial | awk '{print $3}'`
|
||||
if [ -z $SERIAL ];then
|
||||
echo 0x2207 >${USB_CONFIGFS_DIR}/idVendor
|
||||
echo 0x0310 >${USB_CONFIGFS_DIR}/bcdDevice
|
||||
echo 0x0200 >${USB_CONFIGFS_DIR}/bcdUSB
|
||||
mkdir ${USB_STRINGS_DIR} -m 0770
|
||||
SERIAL=$(cat /proc/cpuinfo | grep Serial | awk '{print $3}')
|
||||
if [ -z $SERIAL ]; then
|
||||
SERIAL=0123456789ABCDEF
|
||||
fi
|
||||
echo $SERIAL > ${USB_STRINGS_DIR}/serialnumber
|
||||
echo "rockchip" > ${USB_STRINGS_DIR}/manufacturer
|
||||
echo "rk3xxx" > ${USB_STRINGS_DIR}/product
|
||||
echo $SERIAL >${USB_STRINGS_DIR}/serialnumber
|
||||
echo "rockchip" >${USB_STRINGS_DIR}/manufacturer
|
||||
echo "rk3xxx" >${USB_STRINGS_DIR}/product
|
||||
|
||||
function_init
|
||||
|
||||
mkdir ${USB_CONFIGS_DIR} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE} -m 0770
|
||||
|
||||
echo 0x1 > ${USB_CONFIGFS_DIR}/os_desc/b_vendor_code
|
||||
echo "MSFT100" > ${USB_CONFIGFS_DIR}/os_desc/qw_sign
|
||||
echo 500 > ${USB_CONFIGS_DIR}/MaxPower
|
||||
echo 0x1 >${USB_CONFIGFS_DIR}/os_desc/b_vendor_code
|
||||
echo "MSFT100" >${USB_CONFIGFS_DIR}/os_desc/qw_sign
|
||||
echo 500 >${USB_CONFIGS_DIR}/MaxPower
|
||||
ln -s ${USB_CONFIGS_DIR} ${USB_CONFIGFS_DIR}/os_desc/b.1
|
||||
}
|
||||
|
||||
make_config_string()
|
||||
{
|
||||
make_config_string() {
|
||||
tmp=$CONFIG_STRING
|
||||
if [ -n "$CONFIG_STRING" ]; then
|
||||
CONFIG_STRING=${tmp}_${1}
|
||||
@@ -106,131 +102,127 @@ make_config_string()
|
||||
fi
|
||||
}
|
||||
|
||||
parse_parameter()
|
||||
{
|
||||
parse_parameter() {
|
||||
# find name and var
|
||||
NAME=`echo $1 | awk -F "=" '{print $1}'`
|
||||
VAR=`echo $1 | awk -F "=" '{print $2}'`
|
||||
NAME=$(echo $1 | awk -F "=" '{print $1}')
|
||||
VAR=$(echo $1 | awk -F "=" '{print $2}')
|
||||
|
||||
case "$NAME" in
|
||||
ums_block)
|
||||
UMS_BLOCK=${VAR}
|
||||
;;
|
||||
ums_block_size)
|
||||
if [ ! "$VAR" -gt 0 ] 2>/dev/null ;then
|
||||
echo "$VAR is not a number"
|
||||
exit 1
|
||||
fi
|
||||
UMS_BLOCK_SIZE=${VAR}
|
||||
;;
|
||||
ums_block_type)
|
||||
UMS_BLOCK_TYPE=${VAR}
|
||||
;;
|
||||
ums_block_auto_mount)
|
||||
UMS_BLOCK_AUTO_MOUNT=${VAR}
|
||||
;;
|
||||
ums_ro)
|
||||
if [ "$VAR" != "off" ]; then
|
||||
echo "Set UMS read-only"
|
||||
UMS_RO=1
|
||||
fi
|
||||
UMS_RO=0
|
||||
;;
|
||||
ums_block)
|
||||
UMS_BLOCK=${VAR}
|
||||
;;
|
||||
ums_block_size)
|
||||
if [ ! "$VAR" -gt 0 ] 2>/dev/null; then
|
||||
echo "$VAR is not a number"
|
||||
exit 1
|
||||
fi
|
||||
UMS_BLOCK_SIZE=${VAR}
|
||||
;;
|
||||
ums_block_type)
|
||||
UMS_BLOCK_TYPE=${VAR}
|
||||
;;
|
||||
ums_block_auto_mount)
|
||||
UMS_BLOCK_AUTO_MOUNT=${VAR}
|
||||
;;
|
||||
ums_ro)
|
||||
if [ "$VAR" != "off" ]; then
|
||||
echo "Set UMS read-only"
|
||||
UMS_RO=1
|
||||
fi
|
||||
UMS_RO=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
parameter_init()
|
||||
{
|
||||
while read line
|
||||
do
|
||||
parameter_init() {
|
||||
while read line; do
|
||||
case "$line" in
|
||||
usb_mtp_en)
|
||||
MTP_EN=on
|
||||
make_config_string mtp
|
||||
;;
|
||||
usb_adb_en)
|
||||
ADB_EN=on
|
||||
make_config_string adb
|
||||
;;
|
||||
usb_ums_en)
|
||||
UMS_EN=on
|
||||
make_config_string ums
|
||||
;;
|
||||
usb_ntb_en)
|
||||
NTB_EN=on
|
||||
make_config_string ntb
|
||||
;;
|
||||
usb_acm_en)
|
||||
ACM_EN=on
|
||||
make_config_string acm
|
||||
;;
|
||||
usb_uac1_en)
|
||||
UAC1_EN=on
|
||||
make_config_string uac1
|
||||
;;
|
||||
usb_uac2_en)
|
||||
UAC2_EN=on
|
||||
make_config_string uac2
|
||||
;;
|
||||
usb_uvc_en)
|
||||
UVC_EN=on
|
||||
make_config_string uvc
|
||||
;;
|
||||
usb_rndis_en)
|
||||
RNDIS_EN=on
|
||||
make_config_string rndis
|
||||
;;
|
||||
usb_hid_en)
|
||||
HID_EN=on
|
||||
make_config_string hid
|
||||
;;
|
||||
*)
|
||||
parse_parameter ${line}
|
||||
;;
|
||||
esac
|
||||
done < $USB_CONFIG_FILE
|
||||
|
||||
case "$CONFIG_STRING" in
|
||||
ums)
|
||||
PID=0x0000
|
||||
usb_mtp_en)
|
||||
MTP_EN=on
|
||||
make_config_string mtp
|
||||
;;
|
||||
mtp)
|
||||
PID=0x0001
|
||||
usb_adb_en)
|
||||
ADB_EN=on
|
||||
make_config_string adb
|
||||
;;
|
||||
adb)
|
||||
PID=0x0006
|
||||
usb_ums_en)
|
||||
UMS_EN=on
|
||||
make_config_string ums
|
||||
;;
|
||||
mtp_adb | adb_mtp)
|
||||
PID=0x0011
|
||||
usb_ntb_en)
|
||||
NTB_EN=on
|
||||
make_config_string ntb
|
||||
;;
|
||||
ums_adb | adb_ums)
|
||||
PID=0x0018
|
||||
usb_acm_en)
|
||||
ACM_EN=on
|
||||
make_config_string acm
|
||||
;;
|
||||
acm)
|
||||
PID=0x1005
|
||||
usb_uac1_en)
|
||||
UAC1_EN=on
|
||||
make_config_string uac1
|
||||
;;
|
||||
usb_uac2_en)
|
||||
UAC2_EN=on
|
||||
make_config_string uac2
|
||||
;;
|
||||
usb_uvc_en)
|
||||
UVC_EN=on
|
||||
make_config_string uvc
|
||||
;;
|
||||
usb_rndis_en)
|
||||
RNDIS_EN=on
|
||||
make_config_string rndis
|
||||
;;
|
||||
usb_hid_en)
|
||||
HID_EN=on
|
||||
make_config_string hid
|
||||
;;
|
||||
*)
|
||||
PID=0x0019
|
||||
parse_parameter ${line}
|
||||
;;
|
||||
esac
|
||||
done <$USB_CONFIG_FILE
|
||||
|
||||
case "$CONFIG_STRING" in
|
||||
ums)
|
||||
PID=0x0000
|
||||
;;
|
||||
mtp)
|
||||
PID=0x0001
|
||||
;;
|
||||
adb)
|
||||
PID=0x0006
|
||||
;;
|
||||
mtp_adb | adb_mtp)
|
||||
PID=0x0011
|
||||
;;
|
||||
ums_adb | adb_ums)
|
||||
PID=0x0018
|
||||
;;
|
||||
acm)
|
||||
PID=0x1005
|
||||
;;
|
||||
*)
|
||||
PID=0x0019
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
use_os_desc()
|
||||
{
|
||||
if [ $MTP_EN = on ];then
|
||||
echo "MTP" > ${USB_FUNCTIONS_DIR}/mtp.gs0/os_desc/interface.MTP/compatible_id
|
||||
echo 1 > ${USB_CONFIGFS_DIR}/os_desc/use
|
||||
use_os_desc() {
|
||||
if [ $MTP_EN = on ]; then
|
||||
echo "MTP" >${USB_FUNCTIONS_DIR}/mtp.gs0/os_desc/interface.MTP/compatible_id
|
||||
echo 1 >${USB_CONFIGFS_DIR}/os_desc/use
|
||||
fi
|
||||
}
|
||||
|
||||
pre_run_binary()
|
||||
{
|
||||
if [ $ADB_EN = on ];then
|
||||
pre_run_binary() {
|
||||
if [ $ADB_EN = on ]; then
|
||||
mkdir /dev/usb-ffs/adb -m 0770
|
||||
mount -o uid=2000,gid=2000 -t functionfs adb /dev/usb-ffs/adb
|
||||
start-stop-daemon --start --quiet --background --exec /usr/bin/adbd
|
||||
fi
|
||||
|
||||
if [ $NTB_EN = on ];then
|
||||
if [ $NTB_EN = on ]; then
|
||||
mkdir /dev/usb-ffs/ntb -m 0770
|
||||
mount -o uid=2000,gid=2000 -t functionfs ntb /dev/usb-ffs/ntb
|
||||
# Not start app here
|
||||
@@ -239,65 +231,60 @@ pre_run_binary()
|
||||
# Add uvc app here with start-stop-daemon
|
||||
}
|
||||
|
||||
configure_uvc_resolution_yuyv()
|
||||
{
|
||||
configure_uvc_resolution_yuyv() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_U_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*20)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*20)) > ${DIR}/dwMaxBitRate
|
||||
echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 20)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 20)) >${DIR}/dwMaxBitRate
|
||||
echo $((W * H * 2)) >${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
configure_uvc_resolution_mjpeg()
|
||||
{
|
||||
configure_uvc_resolution_mjpeg() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_M_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*20)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*20)) > ${DIR}/dwMaxBitRate
|
||||
echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 20)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 20)) >${DIR}/dwMaxBitRate
|
||||
echo $((W * H * 2)) >${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
configure_uvc_resolution_h264()
|
||||
{
|
||||
configure_uvc_resolution_h264() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_F_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*10)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*10)) > ${DIR}/dwMaxBitRate
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 10)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 10)) >${DIR}/dwMaxBitRate
|
||||
#echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
syslink_function()
|
||||
{
|
||||
syslink_function() {
|
||||
ln -s ${USB_FUNCTIONS_DIR}/$1 ${USB_CONFIGS_DIR}/f${USB_FUNCTIONS_CNT}
|
||||
let USB_FUNCTIONS_CNT=USB_FUNCTIONS_CNT+1
|
||||
}
|
||||
|
||||
bind_functions()
|
||||
{
|
||||
bind_functions() {
|
||||
USB_FUNCTIONS_CNT=1
|
||||
|
||||
test $UAC1_EN = on && syslink_function uac1.gs0
|
||||
test $UAC2_EN = on && syslink_function uac2.gs0
|
||||
|
||||
if [ $UVC_EN = on ];then
|
||||
if [ $UVC_EN = on ]; then
|
||||
#echo 3072 > ${UVC_DIR}/streaming_maxpacket
|
||||
#echo 1 > ${UVC_DIR}/streaming_bulk
|
||||
|
||||
@@ -342,55 +329,52 @@ bind_functions()
|
||||
test $ACM_EN = on && syslink_function acm.gs6
|
||||
|
||||
if [ $HID_EN = on ]; then
|
||||
echo 1 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/protocol
|
||||
echo 1 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/subclass
|
||||
echo 8 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_desc
|
||||
echo 1 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/protocol
|
||||
echo 1 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/subclass
|
||||
echo 8 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_desc
|
||||
syslink_function hid.usb0
|
||||
fi
|
||||
|
||||
if [ $UMS_EN = on ];then
|
||||
echo ${UMS_RO} > ${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/ro
|
||||
if [ $UMS_EN = on ]; then
|
||||
echo ${UMS_RO} >${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/ro
|
||||
if [ "$UMS_BLOCK_SIZE" != "0" -a ! -e ${UMS_BLOCK} ]; then
|
||||
dd if=/dev/zero of=${UMS_BLOCK} bs=1M count=${UMS_BLOCK_SIZE}
|
||||
mkfs.${UMS_BLOCK_TYPE} ${UMS_BLOCK}
|
||||
test $? && echo "Warning: failed to mkfs.${UMS_BLOCK_TYPE} ${UMS_BLOCK}"
|
||||
fi
|
||||
mkdir /mnt/ums -p
|
||||
if [ $UMS_BLOCK_AUTO_MOUNT = on ];then
|
||||
if [ $UMS_BLOCK_AUTO_MOUNT = on ]; then
|
||||
mount ${UMS_BLOCK} /mnt/ums
|
||||
else
|
||||
echo ${UMS_BLOCK} > ${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/file
|
||||
echo ${UMS_BLOCK} >${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/file
|
||||
fi
|
||||
syslink_function mass_storage.0
|
||||
fi
|
||||
|
||||
echo ${CONFIG_STRING} > ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE}/configuration
|
||||
echo ${CONFIG_STRING} >${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE}/configuration
|
||||
}
|
||||
|
||||
run_binary()
|
||||
{
|
||||
if [ $MTP_EN = on ];then
|
||||
run_binary() {
|
||||
if [ $MTP_EN = on ]; then
|
||||
start-stop-daemon --start --quiet --background --exec /usr/bin/mtp-server
|
||||
fi
|
||||
if [ $RNDIS_EN = on ];then
|
||||
if [ $RNDIS_EN = on ]; then
|
||||
|
||||
sleep .5
|
||||
ifconfig usb0 172.32.0.70
|
||||
ifconfig usb0 up
|
||||
sleep .5
|
||||
ifconfig usb0 172.32.0.70
|
||||
ifconfig usb0 up
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
program_kill()
|
||||
{
|
||||
P_PID=`ps | grep $1 | grep -v grep | awk '{print $1}'`
|
||||
program_kill() {
|
||||
P_PID=$(ps | grep $1 | grep -v grep | awk '{print $1}')
|
||||
test -z ${P_PID} || kill -9 ${P_PID}
|
||||
}
|
||||
|
||||
usb_device_stop()
|
||||
{
|
||||
echo "none" > ${USB_CONFIGFS_DIR}/UDC
|
||||
usb_device_stop() {
|
||||
echo "none" >${USB_CONFIGFS_DIR}/UDC
|
||||
program_kill adbd
|
||||
program_kill mtp-server
|
||||
ls ${USB_CONFIGS_DIR} | grep f[0-9] | xargs -I {} rm ${USB_CONFIGS_DIR}/{}
|
||||
@@ -399,38 +383,38 @@ usb_device_stop()
|
||||
case "$1" in
|
||||
start)
|
||||
ifconfig lo up
|
||||
# if [ ! -e "/tmp/.usb_config" ]; then
|
||||
# echo "$0: Cannot find .usb_config"
|
||||
# # exit 0
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# echo "usb_adb_en" >> $USB_CONFIG_FILE
|
||||
# fi
|
||||
# if [ ! -e "/tmp/.usb_config" ]; then
|
||||
# echo "$0: Cannot find .usb_config"
|
||||
# # exit 0
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# echo "usb_adb_en" >> $USB_CONFIG_FILE
|
||||
# fi
|
||||
|
||||
# if [ -e /tmp/.usb_config ]; then
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# fi
|
||||
# if [ -e /tmp/.usb_config ]; then
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# fi
|
||||
|
||||
parameter_init
|
||||
# if [ -z $CONFIG_STRING ]; then
|
||||
# echo "$0: no function be selected"
|
||||
# exit 0
|
||||
# fi
|
||||
# if [ -z $CONFIG_STRING ]; then
|
||||
# echo "$0: no function be selected"
|
||||
# exit 0
|
||||
# fi
|
||||
test -d ${USB_CONFIGFS_DIR} || configfs_init
|
||||
use_os_desc
|
||||
echo $PID > ${USB_CONFIGFS_DIR}/idProduct
|
||||
echo $PID >${USB_CONFIGFS_DIR}/idProduct
|
||||
bind_functions
|
||||
pre_run_binary
|
||||
sleep 1
|
||||
UDC=`ls /sys/class/udc/| awk '{print $1}'`
|
||||
echo $UDC > ${USB_CONFIGFS_DIR}/UDC
|
||||
UDC=$(ls /sys/class/udc/ | awk '{print $1}')
|
||||
echo $UDC >${USB_CONFIGFS_DIR}/UDC
|
||||
run_binary
|
||||
;;
|
||||
stop)
|
||||
usb_device_stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart | reload)
|
||||
# Do restart usb by udev
|
||||
echo "USB_FORCE_CHANGED" >> /tmp/.usb_config
|
||||
echo "USB_FORCE_CHANGED" >>/tmp/.usb_config
|
||||
usb_device_stop
|
||||
sleep 1
|
||||
$0 start
|
||||
@@ -440,6 +424,7 @@ restart|reload)
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
check_hciconfig() {
|
||||
if command -v hciattach &> /dev/null; then
|
||||
if lsmod | grep -q "aic8800_fdrv"; then
|
||||
hciattach -s 115200 /dev/ttyS1 any 115200 flow nosleep&
|
||||
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep&
|
||||
sleep 2
|
||||
if hciconfig -a | grep -q "hci0"; then
|
||||
hciconfig hci0 up&
|
||||
|
||||
@@ -835,7 +835,7 @@ CONFIG_MT=y
|
||||
CONFIG_PARTPROBE=y
|
||||
# CONFIG_RAIDAUTORUN is not set
|
||||
# CONFIG_READAHEAD is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
CONFIG_RFKILL=y
|
||||
CONFIG_RUNLEVEL=y
|
||||
# CONFIG_RX is not set
|
||||
CONFIG_SEEDRNG=y
|
||||
|
||||
@@ -2,10 +2,19 @@
|
||||
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||
systemctl stop wpa_supplicant
|
||||
if [ -d /usr/ko ]; then
|
||||
cd /usr/ko
|
||||
if [ -d /oem/usr/ko ]; then
|
||||
cd /oem/usr/ko
|
||||
if [ -z "$(ifconfig | grep "wlan0")" ]; then
|
||||
./insmod_wifi.sh
|
||||
insmod cfg80211.ko
|
||||
insmod libarc4.ko
|
||||
insmod ctr.ko
|
||||
insmod ccm.ko
|
||||
insmod aes_generic.ko
|
||||
insmod aic8800_bsp.ko
|
||||
sleep 0.2
|
||||
insmod aic8800_fdrv.ko
|
||||
sleep 2
|
||||
insmod aic8800_btplm.ko
|
||||
else
|
||||
# wait systemctl
|
||||
sleep 0.5
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,56 +0,0 @@
|
||||
# AIC USERCONFIG 2022/0803/1707
|
||||
|
||||
# txpwr_lvl
|
||||
enable=1
|
||||
lvl_11b_11ag_1m_2g4=20
|
||||
lvl_11b_11ag_2m_2g4=20
|
||||
lvl_11b_11ag_5m5_2g4=20
|
||||
lvl_11b_11ag_11m_2g4=20
|
||||
lvl_11b_11ag_6m_2g4=20
|
||||
lvl_11b_11ag_9m_2g4=20
|
||||
lvl_11b_11ag_12m_2g4=20
|
||||
lvl_11b_11ag_18m_2g4=20
|
||||
lvl_11b_11ag_24m_2g4=18
|
||||
lvl_11b_11ag_36m_2g4=18
|
||||
lvl_11b_11ag_48m_2g4=16
|
||||
lvl_11b_11ag_54m_2g4=16
|
||||
lvl_11n_11ac_mcs0_2g4=20
|
||||
lvl_11n_11ac_mcs1_2g4=20
|
||||
lvl_11n_11ac_mcs2_2g4=20
|
||||
lvl_11n_11ac_mcs3_2g4=20
|
||||
lvl_11n_11ac_mcs4_2g4=18
|
||||
lvl_11n_11ac_mcs5_2g4=18
|
||||
lvl_11n_11ac_mcs6_2g4=16
|
||||
lvl_11n_11ac_mcs7_2g4=16
|
||||
lvl_11n_11ac_mcs8_2g4=16
|
||||
lvl_11n_11ac_mcs9_2g4=16
|
||||
lvl_11ax_mcs0_2g4=20
|
||||
lvl_11ax_mcs1_2g4=20
|
||||
lvl_11ax_mcs2_2g4=20
|
||||
lvl_11ax_mcs3_2g4=20
|
||||
lvl_11ax_mcs4_2g4=18
|
||||
lvl_11ax_mcs5_2g4=18
|
||||
lvl_11ax_mcs6_2g4=16
|
||||
lvl_11ax_mcs7_2g4=16
|
||||
lvl_11ax_mcs8_2g4=16
|
||||
lvl_11ax_mcs9_2g4=16
|
||||
lvl_11ax_mcs10_2g4=15
|
||||
lvl_11ax_mcs11_2g4=15
|
||||
|
||||
# txpwr_ofst
|
||||
ofst_enable=0
|
||||
ofst_chan_1_4=0
|
||||
ofst_chan_5_9=0
|
||||
ofst_chan_10_13=0
|
||||
ofst_chan_36_64=0
|
||||
ofst_chan_100_120=0
|
||||
ofst_chan_122_140=0
|
||||
ofst_chan_142_165=0
|
||||
|
||||
# xtal cap
|
||||
xtal_enable=0
|
||||
xtal_cap=24
|
||||
xtal_cap_fine=31
|
||||
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# AIC USERCONFIG 2022/0803/1707
|
||||
|
||||
# txpwr_lvl
|
||||
enable=1
|
||||
lvl_11b_11ag_1m_2g4=20
|
||||
lvl_11b_11ag_2m_2g4=20
|
||||
lvl_11b_11ag_5m5_2g4=20
|
||||
lvl_11b_11ag_11m_2g4=20
|
||||
lvl_11b_11ag_6m_2g4=20
|
||||
lvl_11b_11ag_9m_2g4=20
|
||||
lvl_11b_11ag_12m_2g4=20
|
||||
lvl_11b_11ag_18m_2g4=20
|
||||
lvl_11b_11ag_24m_2g4=18
|
||||
lvl_11b_11ag_36m_2g4=18
|
||||
lvl_11b_11ag_48m_2g4=16
|
||||
lvl_11b_11ag_54m_2g4=16
|
||||
lvl_11n_11ac_mcs0_2g4=20
|
||||
lvl_11n_11ac_mcs1_2g4=20
|
||||
lvl_11n_11ac_mcs2_2g4=20
|
||||
lvl_11n_11ac_mcs3_2g4=20
|
||||
lvl_11n_11ac_mcs4_2g4=18
|
||||
lvl_11n_11ac_mcs5_2g4=18
|
||||
lvl_11n_11ac_mcs6_2g4=16
|
||||
lvl_11n_11ac_mcs7_2g4=16
|
||||
lvl_11n_11ac_mcs8_2g4=16
|
||||
lvl_11n_11ac_mcs9_2g4=16
|
||||
lvl_11ax_mcs0_2g4=20
|
||||
lvl_11ax_mcs1_2g4=20
|
||||
lvl_11ax_mcs2_2g4=20
|
||||
lvl_11ax_mcs3_2g4=20
|
||||
lvl_11ax_mcs4_2g4=18
|
||||
lvl_11ax_mcs5_2g4=18
|
||||
lvl_11ax_mcs6_2g4=16
|
||||
lvl_11ax_mcs7_2g4=16
|
||||
lvl_11ax_mcs8_2g4=16
|
||||
lvl_11ax_mcs9_2g4=16
|
||||
lvl_11ax_mcs10_2g4=15
|
||||
lvl_11ax_mcs11_2g4=15
|
||||
|
||||
# txpwr_ofst
|
||||
ofst_enable=0
|
||||
ofst_chan_1_4=0
|
||||
ofst_chan_5_9=0
|
||||
ofst_chan_10_13=0
|
||||
ofst_chan_36_64=0
|
||||
ofst_chan_100_120=0
|
||||
ofst_chan_122_140=0
|
||||
ofst_chan_142_165=0
|
||||
|
||||
# xtal cap
|
||||
xtal_enable=0
|
||||
xtal_cap=24
|
||||
xtal_cap_fine=31
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
cmd=$(realpath $0)
|
||||
_DIR=$(dirname $cmd)
|
||||
cd $_DIR
|
||||
|
||||
export PATH=$PATH:/ko
|
||||
|
||||
#aic8800
|
||||
if [ -f /usr/ko/aic8800_fdrv.ko ]; then
|
||||
mkdir -p /oem/usr/ko
|
||||
cp /usr/ko/aic8800dc_fw /oem/usr/ko -r
|
||||
insmod cfg80211.ko
|
||||
insmod libarc4.ko
|
||||
insmod ctr.ko
|
||||
insmod ccm.ko
|
||||
#insmod libaes.ko
|
||||
#insmod aes_generic.ko
|
||||
insmod aic8800_bsp.ko
|
||||
sleep 0.2
|
||||
insmod aic8800_fdrv.ko
|
||||
sleep 2
|
||||
insmod aic8800_btlpm.ko
|
||||
sleep 0.1
|
||||
fi
|
||||
Binary file not shown.
@@ -3,6 +3,9 @@
|
||||
load_luckfoxconfig() {
|
||||
if [ -f /usr/bin/luckfox-config ]; then
|
||||
luckfox-config load
|
||||
fi
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra" ] ||
|
||||
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||
luckfox_switch_rgb_resolution &
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -407,8 +407,8 @@ function luckfox_pico_mini_pin_diagram_file() {
|
||||
PWM4_M2 - SPI0_M0_CLK - GPIO1_C1 | | GPIO1_C6 - - PWM10_M1
|
||||
PWM5_M2 - SPI0_M0_MOSI - GPIO1_C2 | | GPIO1_D3 - - PWM11_M2
|
||||
PWM6_M2 - SPI0_M0_MISO - GPIO1_C3 | | GPIO1_D2 - - PWM0_M1
|
||||
PWM8_M1 - UART4_M1_RX - GPIO1_C4 | | GPIO1_D1 - - PWM10_M2
|
||||
PWM9_M1 - UART4_M1_TX - GPIO1_C5 | | GPIO1_D0 - SARADC_M1 - PWM3_M2
|
||||
PWM8_M1 - UART4_M1_RX - GPIO1_C4 | | GPIO1_D1 - UART3_M1_RX - PWM10_M2
|
||||
PWM9_M1 - UART4_M1_TX - GPIO1_C5 | | GPIO1_D0 - UART3_M1_TX - PWM3_M2
|
||||
+ - + - +
|
||||
EOF
|
||||
}
|
||||
@@ -2710,7 +2710,7 @@ elif [ "$1" == "rgb_switch" ]; then
|
||||
"18" "16" \
|
||||
"2" "2" \
|
||||
"0" "0" \
|
||||
"0" "1"
|
||||
"0" "0"
|
||||
elif [ "$(luckfox_get_pin_cfg "RGB_HACTIVE")" == "720" ]; then
|
||||
# 720 -> 480
|
||||
echo "****************************************************"
|
||||
|
||||
Reference in New Issue
Block a user