From 352fc38e6dfbb6f5d7b7be06201c54b7469885e9 Mon Sep 17 00:00:00 2001 From: MangoBuge <771992497@qq.com> Date: Sat, 20 Aug 2022 23:47:42 +0800 Subject: [PATCH] fix defconfig for f133 --- .../f133/configs/mq_r/linux-5.4/config-5.4 | 46 +++- .../chips/f133/configs/mq_r/sys_partition.fex | 2 +- target/allwinner/f133-mq_r/BoardConfig.mk | 2 +- .../base-files/etc/bluetooth/bluetooth.json | 28 +++ .../base-files/etc/bluetooth/bt_init.sh | 92 +++++++ .../f133-mq_r/base-files/etc/config/fstab | 55 +++++ .../f133-mq_r/base-files/etc/rc.local | 4 + .../busybox-init-base-files/etc/localtime | Bin 405 -> 0 bytes target/allwinner/f133-mq_r/defconfig | 225 ++++++++++++------ target/allwinner/f133-mq_r/modules.mk | 160 ------------- 10 files changed, 377 insertions(+), 237 deletions(-) create mode 100644 target/allwinner/f133-mq_r/base-files/etc/bluetooth/bluetooth.json create mode 100755 target/allwinner/f133-mq_r/base-files/etc/bluetooth/bt_init.sh create mode 100755 target/allwinner/f133-mq_r/base-files/etc/config/fstab create mode 100644 target/allwinner/f133-mq_r/base-files/etc/rc.local delete mode 100755 target/allwinner/f133-mq_r/busybox-init-base-files/etc/localtime diff --git a/device/config/chips/f133/configs/mq_r/linux-5.4/config-5.4 b/device/config/chips/f133/configs/mq_r/linux-5.4/config-5.4 index 255f485..2a392fa 100755 --- a/device/config/chips/f133/configs/mq_r/linux-5.4/config-5.4 +++ b/device/config/chips/f133/configs/mq_r/linux-5.4/config-5.4 @@ -471,6 +471,7 @@ CONFIG_IPV6=y # CONFIG_INET6_ESP is not set # CONFIG_INET6_IPCOMP is not set # CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_ILA is not set # CONFIG_IPV6_VTI is not set # CONFIG_IPV6_SIT is not set # CONFIG_IPV6_TUNNEL is not set @@ -480,7 +481,50 @@ CONFIG_IPV6=y # CONFIG_IPV6_SEG6_HMAC is not set # CONFIG_NETWORK_SECMARK is not set # CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set +CONFIG_NETFILTER=y +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +# CONFIG_NETFILTER_INGRESS is not set +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NETFILTER_NETLINK_OSF is not set +# CONFIG_NF_CONNTRACK is not set +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_TABLES is not set +# CONFIG_NETFILTER_XTABLES is not set +# end of Core Netfilter Configuration + +# CONFIG_IP_SET is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_TPROXY_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +# CONFIG_NF_LOG_ARP is not set +# CONFIG_NF_LOG_IPV4 is not set +# CONFIG_NF_REJECT_IPV4 is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_ARPTABLES is not set +# end of IP: Netfilter Configuration + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TPROXY_IPV6 is not set +# CONFIG_NF_DUP_IPV6 is not set +# CONFIG_NF_REJECT_IPV6 is not set +# CONFIG_NF_LOG_IPV6 is not set +# CONFIG_IP6_NF_IPTABLES is not set +# end of IPv6: Netfilter Configuration + # CONFIG_BPFILTER is not set # CONFIG_IP_DCCP is not set # CONFIG_IP_SCTP is not set diff --git a/device/config/chips/f133/configs/mq_r/sys_partition.fex b/device/config/chips/f133/configs/mq_r/sys_partition.fex index 04db8c8..053f1ad 100755 --- a/device/config/chips/f133/configs/mq_r/sys_partition.fex +++ b/device/config/chips/f133/configs/mq_r/sys_partition.fex @@ -53,7 +53,7 @@ size = 16384 [partition] name = boot - size = 12800 + size = 15120 downloadfile = "boot.fex" user_type = 0x8000 diff --git a/target/allwinner/f133-mq_r/BoardConfig.mk b/target/allwinner/f133-mq_r/BoardConfig.mk index 31bbb7e..8ca52b2 100755 --- a/target/allwinner/f133-mq_r/BoardConfig.mk +++ b/target/allwinner/f133-mq_r/BoardConfig.mk @@ -18,7 +18,7 @@ BOARD_DATAFS_FLASH_BLOCK_SIZE := 4096 TARGET_VERSION_MANUFACTURER_URL := www.allwinnertech.com TARGET_VERSION_MANUFACTURER := allwinnertech -TARGET_VERSION_PRODUCT := v2.1 +TARGET_VERSION_PRODUCT := v3.5 TARGET_VERSION_HWREV := v1.0 BOARD_CHARGER_ENABLE_SUSPEND := true diff --git a/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bluetooth.json b/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bluetooth.json new file mode 100644 index 0000000..f2836a2 --- /dev/null +++ b/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bluetooth.json @@ -0,0 +1,28 @@ +{ + "profile":{ + "a2dp_sink":1, + "a2dp_source":0, + "avrcp":1, + "hfp_hf":1, + "hfp_ag":0, + "gatt_client":0, + "gatt_server":0 + }, + "a2dp_sink":{ + "device":"default", + "buffer_size":30080, + "period_size":3760 + }, + "a2dp_source":{ + "hci_index":0, + "DEV":"00:00:00:00:00:00", + "DELAY":20000 + }, + "hfp_pcm":{ + "rate":16000, + "phone_to_dev_cap":"hw:snddaudio1", + "phone_to_dev_play":"default", + "dev_to_phone_cap":"CaptureMic", + "dev_to_phone_play":"hw:snddaudio1" + } +} diff --git a/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bt_init.sh b/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bt_init.sh new file mode 100755 index 0000000..05a3fa0 --- /dev/null +++ b/target/allwinner/f133-mq_r/base-files/etc/bluetooth/bt_init.sh @@ -0,0 +1,92 @@ +#!/bin/sh +bt_hciattach="rtk_hciattach" +start_hci_attach() +{ + h=`ps | grep "$bt_hciattach" | grep -v grep` + [ -n "$h" ] && { + killall "$bt_hciattach" + sleep 1 + } + + #8723ds h5 init + echo 0 > /sys/class/rfkill/rfkill0/state; + sleep 1 + echo 1 > /sys/class/rfkill/rfkill0/state; + sleep 1 + + "$bt_hciattach" -n -s 115200 /dev/ttyS1 rtk_h5 >/dev/null 2>&1 & + sleep 1 + + wait_hci0_count=0 + while true + do + [ -d /sys/class/bluetooth/hci0 ] && break + sleep 1 + let wait_hci0_count++ + [ $wait_hci0_count -eq 8 ] && { + echo "bring up hci0 failed" + exit 1 + } + done +} + +start() { + + if [ -d "/sys/class/bluetooth/hci0" ];then + echo "Bluetooth init has been completed!!" + else + start_hci_attach + fi + + d=`ps | grep bluetoothd | grep -v grep` + [ -z "$d" ] && { +# bluetoothd -n & + /etc/bluetooth/bluetoothd start + sleep 1 + } + +} + +ble_start() { + if [ -d "/sys/class/bluetooth/hci0" ];then + echo "Bluetooth init has been completed!!" + else + start_hci_attach + fi + + hci_is_up=`hciconfig hci0 | grep RUNNING` + [ -z "$hci_is_up" ] && { + hciconfig hci0 up + } + + MAC_STR=`hciconfig | grep "BD Address" | awk '{print $3}'` + LE_MAC=${MAC_STR/2/C} + OLD_LE_MAC_T=`cat /sys/kernel/debug/bluetooth/hci0/random_address` + OLD_LE_MAC=$(echo $OLD_LE_MAC_T | tr [a-z] [A-Z]) + if [ -n "$LE_MAC" ];then + if [ "$LE_MAC" != "$OLD_LE_MAC" ];then + hciconfig hci0 lerandaddr $LE_MAC + else + echo "the ble random_address has been set." + fi + fi +} + +stop() { + echo "nothing to do." +} + +case "$1" in + start|"") + start + ;; + stop) + stop + ;; + ble_start) + ble_start + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 +esac diff --git a/target/allwinner/f133-mq_r/base-files/etc/config/fstab b/target/allwinner/f133-mq_r/base-files/etc/config/fstab new file mode 100755 index 0000000..57716a5 --- /dev/null +++ b/target/allwinner/f133-mq_r/base-files/etc/config/fstab @@ -0,0 +1,55 @@ +config 'global' + option anon_swap '0' + option anon_mount '0' + option auto_swap '1' + option auto_mount '1' + option delay_root '5' + option check_fs '1' + +config 'mount' + option target '/boot' + option device '/dev/by-name/boot' + option options 'ro,sync' + option enabled '1' + +config 'mount' + option target '/boot-res' + option device '/dev/by-name/boot-res' + option options 'ro,sync' + option enabled '1' + +config 'mount' + option target '/mnt/UDISK' + option device '/dev/by-name/UDISK' + option options 'rw,async' + option enabled '0' + +config 'mount' + option target '/overlay' + option device '/dev/by-name/rootfs_data' + option options 'rw,async,noatime' + option enabled '1' + +config 'mount' + option target '/mnt/SDCARD' + option device '/dev/mmcblk0' + option options 'rw,async' + option enabled '0' + +config 'mount' + option target '/mnt/SDCARD' + option device '/dev/mmcblk0p1' + option options 'rw,async' + option enabled '0' + +config 'mount' + option target '/mnt/exUDISK' + option device '/dev/sda' + option options 'rw,async' + option enabled '1' + +config 'mount' + option target '/mnt/exUDISK' + option device '/dev/sda1' + option options 'rw,async' + option enabled '1' diff --git a/target/allwinner/f133-mq_r/base-files/etc/rc.local b/target/allwinner/f133-mq_r/base-files/etc/rc.local new file mode 100644 index 0000000..5639477 --- /dev/null +++ b/target/allwinner/f133-mq_r/base-files/etc/rc.local @@ -0,0 +1,4 @@ +# Put your custom commands here that should be executed once +# the system init finished. By default this file does nothing. + +exit 0 diff --git a/target/allwinner/f133-mq_r/busybox-init-base-files/etc/localtime b/target/allwinner/f133-mq_r/busybox-init-base-files/etc/localtime deleted file mode 100755 index 240c4c6f76dae5e2b0e4156805098a72034dd287..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 405 zcmWHE%1kq2zyQoZ5fBCeK_CXPc{co;wctbyW5bDG>IEmS@->{g9rZzOml=b6W_^J| zT}FeVXJUa;oL7UgrgMRcdpd)vQ2Ylqbx#JhPmUin*tHonE-8OtVnl-s422JXhBMSn zU}RxnC}?2d@bL{{aCQOW;1G}m5QLE6$p1h9awv!fITlO<9SovDjt0>nhl9)oIUWQ+ z9stoGPk?BUM?f^lGawq|ArKAn6bOJk2BJZp1Jghcf@qK@!8ExZ