Parcourir la source

add python_test

Joe il y a 1 semaine
Parent
commit
3515336617
100 fichiers modifiés avec 2120 ajouts et 0 suppressions
  1. 1 0
      python_test/1
  2. BIN
      python_test/4K_Chimei-inn.mp4
  3. BIN
      python_test/Big_Buck_Bunny_1080P.mp4
  4. BIN
      python_test/CoEx/.DS_Store
  5. 3 0
      python_test/CoEx/bt-off.sh
  6. 5 0
      python_test/CoEx/bt-tx.sh
  7. 3 0
      python_test/CoEx/chm.sh
  8. 9 0
      python_test/CoEx/count.sh
  9. 13 0
      python_test/CoEx/nvrm_back.sh
  10. 32 0
      python_test/CoEx/nvrm_mod.sh
  11. 2 0
      python_test/CoEx/runme/off.txt
  12. 18 0
      python_test/CoEx/runme/runme-2405-0dBm.txt
  13. 18 0
      python_test/CoEx/runme/runme-2405-10dBm.txt
  14. 18 0
      python_test/CoEx/runme/runme-2410-0dBm.txt
  15. 18 0
      python_test/CoEx/runme/runme-2410-10dBm.txt
  16. 18 0
      python_test/CoEx/runme/runme-2415-0dBm.txt
  17. 18 0
      python_test/CoEx/runme/runme-2415-10dBm.txt
  18. 18 0
      python_test/CoEx/runme/runme-2420-0dBm.txt
  19. 18 0
      python_test/CoEx/runme/runme-2420-10dBm.txt
  20. 18 0
      python_test/CoEx/runme/runme-2425-0dBm.txt
  21. 18 0
      python_test/CoEx/runme/runme-2425-10dBm.txt
  22. 18 0
      python_test/CoEx/runme/runme-2430-0dBm.txt
  23. 18 0
      python_test/CoEx/runme/runme-2430-10dBm.txt
  24. 18 0
      python_test/CoEx/runme/runme-2435-0dBm.txt
  25. 18 0
      python_test/CoEx/runme/runme-2435-10dBm.txt
  26. 18 0
      python_test/CoEx/runme/runme-2440-0dBm.txt
  27. 18 0
      python_test/CoEx/runme/runme-2440-10dBm.txt
  28. 18 0
      python_test/CoEx/runme/runme-2445-0dBm.txt
  29. 18 0
      python_test/CoEx/runme/runme-2445-10dBm.txt
  30. 18 0
      python_test/CoEx/runme/runme-2450-0dBm.txt
  31. 18 0
      python_test/CoEx/runme/runme-2450-10dBm.txt
  32. 18 0
      python_test/CoEx/runme/runme-2455-0dBm.txt
  33. 18 0
      python_test/CoEx/runme/runme-2455-10dBm.txt
  34. 18 0
      python_test/CoEx/runme/runme-2460-0dBm.txt
  35. 18 0
      python_test/CoEx/runme/runme-2460-10dBm.txt
  36. 18 0
      python_test/CoEx/runme/runme-2465-0dBm.txt
  37. 18 0
      python_test/CoEx/runme/runme-2465-10dBm.txt
  38. 18 0
      python_test/CoEx/runme/runme-2470-0dBm.txt
  39. 18 0
      python_test/CoEx/runme/runme-2470-10dBm.txt
  40. 18 0
      python_test/CoEx/runme/runme-2475-0dBm.txt
  41. 18 0
      python_test/CoEx/runme/runme-2475-10dBm.txt
  42. 18 0
      python_test/CoEx/runme/runme-2480-0dBm.txt
  43. 18 0
      python_test/CoEx/runme/runme-2480-10dBm.txt
  44. 37 0
      python_test/CoEx/wifi-init.sh
  45. 24 0
      python_test/CoEx/wifi-rx.sh
  46. BIN
      python_test/Logs/.DS_Store
  47. BIN
      python_test/RTC/GET_VBT
  48. 27 0
      python_test/RTC/test.c
  49. BIN
      python_test/Rainbow_720P.mp4
  50. BIN
      python_test/Results/.DS_Store
  51. 59 0
      python_test/SerialPort.py
  52. BIN
      python_test/SerialPort.pyc
  53. BIN
      python_test/Seven_Segment_Display/Seven_Segment_Display
  54. 31 0
      python_test/Seven_Segment_Display/test.c
  55. 9 0
      python_test/TestZone.desktop
  56. 0 0
      python_test/__init__.py
  57. BIN
      python_test/amidelnx_64
  58. 10 0
      python_test/beep.sh
  59. BIN
      python_test/beep/beep
  60. 39 0
      python_test/beep/test.c
  61. 13 0
      python_test/bios-release-date.sh
  62. 13 0
      python_test/bios-ver.sh
  63. 11 0
      python_test/boot-fs.sh
  64. 11 0
      python_test/boot-mcu.sh
  65. BIN
      python_test/boot_test_v16/.GetEcVersion.sh.swp
  66. 5 0
      python_test/boot_test_v16/.vscode/settings.json
  67. 9 0
      python_test/boot_test_v16/.vscode/sftp.json
  68. 5 0
      python_test/boot_test_v16/EcIO/.vscode/settings.json
  69. BIN
      python_test/boot_test_v16/EcIO/ecmips64
  70. BIN
      python_test/boot_test_v16/EcIO/ecx86_64
  71. BIN
      python_test/boot_test_v16/EcIO/libecmips64.so
  72. BIN
      python_test/boot_test_v16/EcIO/libecx86_64.so
  73. 4 0
      python_test/boot_test_v16/EcIO/readme.txt
  74. 34 0
      python_test/boot_test_v16/EcIO/suguang_fan.py
  75. 28 0
      python_test/boot_test_v16/EcIO/suguang_fan_set.py
  76. BIN
      python_test/boot_test_v16/EcIO/suguang_fan_tool.tar.xz
  77. BIN
      python_test/boot_test_v16/EcIO/suguang_fan_tool_v2.tar.xz
  78. 169 0
      python_test/boot_test_v16/GetEcVersion.sh
  79. 178 0
      python_test/boot_test_v16/RunTest - 副本(1).sh
  80. 178 0
      python_test/boot_test_v16/RunTest.sh
  81. 178 0
      python_test/boot_test_v16/S3S4.sh
  82. 5 0
      python_test/boot_test_v16/action.cfg
  83. 5 0
      python_test/boot_test_v16/coldboot20241219.log
  84. 10 0
      python_test/boot_test_v16/coldboot20260608.log
  85. 6 0
      python_test/boot_test_v16/ec20250805.log
  86. BIN
      python_test/boot_test_v16/ecaarch64
  87. BIN
      python_test/boot_test_v16/ecaarch64_D3000
  88. BIN
      python_test/boot_test_v16/ecloongarch64
  89. BIN
      python_test/boot_test_v16/ecmips64
  90. BIN
      python_test/boot_test_v16/ecx86_64
  91. 184 0
      python_test/boot_test_v16/grub.cfg
  92. 149 0
      python_test/boot_test_v16/reboot.sh
  93. BIN
      python_test/boot_test_v16/rtc_resume
  94. BIN
      python_test/boot_test_v16/rtc_resume_la
  95. 24 0
      python_test/boot_test_v16/script.sh
  96. 17 0
      python_test/boot_test_v16/set_power_plan.sh
  97. 1 0
      python_test/boot_test_v16/times.left
  98. 3 0
      python_test/boot_test_v16/warnboot20241219.log
  99. BIN
      python_test/boot_test_v16/wav/coldboot.wav
  100. BIN
      python_test/boot_test_v16/wav/hibernate.wav

+ 1 - 0
python_test/1

@@ -0,0 +1 @@
+grep: 2: No such file or directory

BIN
python_test/4K_Chimei-inn.mp4


BIN
python_test/Big_Buck_Bunny_1080P.mp4


BIN
python_test/CoEx/.DS_Store


+ 3 - 0
python_test/CoEx/bt-off.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/BlueTool -f /etc/bluetool/off.txt

+ 5 - 0
python_test/CoEx/bt-tx.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+file="runme-"$1"-"$2"dBm.txt"
+echo $file
+/usr/sbin/BlueTool -f /etc/bluetool/$file

+ 3 - 0
python_test/CoEx/chm.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+chmod 755 ~/CoEx/*.sh

+ 9 - 0
python_test/CoEx/count.sh

@@ -0,0 +1,9 @@
+#!/bin/sh
+
+a=$(/usr/local/bin/wl pkteng_stats | grep count | cut -d" " -f4)
+#echo $a
+sleep 1
+b=$(/usr/local/bin/wl pkteng_stats | grep count | cut -d" " -f4)
+#echo $b
+c=$(($b-$a))
+echo $c

+ 13 - 0
python_test/CoEx/nvrm_back.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+a=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $4}' | cut -d'=' -f2 | sed 's/\./\\./g')
+vendor=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $5}' | cut -d"\"" -f1)
+c=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "$a" | grep "$vendor" | awk '{print $5}')
+
+loc="/AppleInternal/Diags/WiFiFirmware/J34/"; 
+
+filename=$(echo $c | cut -d'.' -f1)
+exts=$(echo $c | cut -d'.' -f2)
+newfname=$filename"-orig."$exts
+
+mv $loc$newfname $loc$c

+ 32 - 0
python_test/CoEx/nvrm_mod.sh

@@ -0,0 +1,32 @@
+#!/bin/sh
+
+/sbin/mount -uw /
+rm -f temp.nvm
+rm -f tempnvrm.txt
+
+fname=$2
+loc="/AppleInternal/Diags/WiFiFirmware/"$1"/"
+
+filename=$(echo $fname | cut -d'.' -f1)
+exts=$(echo $fname | cut -d'.' -f2)
+newfname=$filename"-orig."$exts
+
+if [ -f "$loc$newfname" ]; then
+  echo "Backup nvram file exists!"
+else
+  cp $loc$fname $loc$newfname
+fi
+cat $loc$fname | tr -c "[:print:]^\n" "\n" > temp.nvm
+
+if [ `cat temp.nvm | grep "btc_mode=4" | wc -l` -eq 0 ]; then
+  len=$(cat temp.nvm | wc -l)
+  i=1
+  while [ `head -$i temp.nvm | tail -1 | grep "boardflags2" | wc -l` -eq 0 ]; do i=$(($i+1)); done
+  head -$(($i-1)) temp.nvm > tempnvrm.txt
+
+  echo "boardflags2=0x800000" >> tempnvrm.txt
+  echo "btc_mode=4" >> tempnvrm.txt
+
+  tail -n +$(($i+1)) temp.nvm >> tempnvrm.txt
+  mv tempnvrm.txt $loc$fname
+fi

+ 2 - 0
python_test/CoEx/runme/off.txt

@@ -0,0 +1,2 @@
+power off
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2405-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x03 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2405-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x03 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2410-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x08 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2410-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x08 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2415-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x0D 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2415-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x0D 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2420-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x12 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2420-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x12 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2425-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x17 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2425-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x17 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2430-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x1C 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2430-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x1C 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2435-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x21 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2435-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x21 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2440-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x26 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2440-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x26 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2445-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x2B 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2445-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x2B 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2450-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x30 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2450-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x30 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2455-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x35 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2455-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x35 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2460-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x3A 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2460-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x3F 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2465-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x3F 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2465-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x3F 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2470-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x44 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2470-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x44 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2475-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x49 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2475-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x49 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2480-0dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+#hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x4E 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x01
+quit

+ 18 - 0
python_test/CoEx/runme/runme-2480-10dBm.txt

@@ -0,0 +1,18 @@
+device -D
+device -D
+wake on
+power off
+power on
+hci reset
+bcm -B
+#bcm -w /etc/bluetool/BCM4324B5_11.1.101.118_Syrah_MFG_USI_20130425.hcd
+bcm -W
+device -s 115200
+bcm -B
+bcm -A
+bcm -N
+bcm -v
+hci cmd 0x0C03
+hci cmd 0xFCE2 0x0C 0x00 0x00 0x00 0x01 0x08
+hci cmd 0xFC51 0x00 0x00 0x00 0xB3 0x24 0x43 0x01 0x4E 0x04 0x01 0x0F 0xFFFF 0x09 0x00 0x00
+quit

+ 37 - 0
python_test/CoEx/wifi-init.sh

@@ -0,0 +1,37 @@
+#!/bin/sh
+export PATH=$PATH:/usr/local/bin
+
+#/usr/libexec/wifiFirmwareLoader -f | tail -1 | cut -d" " -f6
+launchctl unload /System/Library/LaunchDaemons/com.apple.wifid.plist
+launchctl unload /System/Library/LaunchDaemons/com.apple.BTServer.plist
+launchctl remove com.apple.SwitchBoard
+#launchctl unload /System/Library/LaunchDaemons/com.apple.CommCenter.plist
+wl ver
+
+/usr/libexec/wifiFirmwareLoader -f 
+a=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $4}' | cut -d'=' -f2 | sed 's/\./\\./g')
+echo $a
+vendor=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $5}' | cut -d"\"" -f1)
+echo $vendor
+cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep $a | grep $vendor
+b=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "^$a" | grep "$vendor" | awk '{print $4}')
+echo $b
+c=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "^$a" | grep "$vendor" | awk '{print $5}')
+echo $c
+
+~/CoEx/nvrm_mod.sh J34 $c
+
+/usr/libexec/wifiFirmwareLoader -N /AppleInternal/Diags/WiFiFirmware/J34/$c -F /AppleInternal/Diags/WiFiFirmware/J34/$b "mfg"
+
+sleep 1
+wl ver; wl revinfo;
+wl down; wl cur_etheraddr 00:00:00:C0:FF:EE; wl country ALL; wl mpc 0;
+wl mimo_preamble 0; wl mimo_bw_cap 1;
+wl stbc_tx 0; wl stbc_rx 0; wl up; wl isup;
+echo "init done"
+
+powerctrl Factor1=1
+
+/sbin/mount -uw /
+mkdir /etc/bluetool
+cp ~/CoEx/runme/*.txt /etc/bluetool

+ 24 - 0
python_test/CoEx/wifi-rx.sh

@@ -0,0 +1,24 @@
+#!/bin/sh
+export PATH=$PATH:/usr/local/bin
+wl pkteng_stop rx
+
+wl txchain $1
+wl rxchain $1
+
+wl txchain
+wl rxchain
+wl btc_mode
+wl btc_mode 4
+wl btc_mode
+
+wl down; wl up; 
+wl channel $2; 
+wl glacial_timer 150000
+wl fast_timer 150000
+wl slow_timer 150000
+wl scansuppress 1; 
+wl pkteng_start 00:00:00:C0:FF:EE rx;
+
+wl txchain
+wl rxchain
+wl btc_mode

BIN
python_test/Logs/.DS_Store


BIN
python_test/RTC/GET_VBT


+ 27 - 0
python_test/RTC/test.c

@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+#include <stdint.h>
+#include <string.h>
+
+int main(void)
+{
+    unsigned char val;
+    if (ioperm(0xA45, 1, 1) < 0 || ioperm(0xA46, 1, 1) < 0 || ioperm(0xEB, 1, 1) < 0) {
+        perror("Failed to request I/O port permission");
+        return 1;
+    }    
+
+    outb(0x00,0xA45);
+    outb(inb(0xA46) | 0x40, 0xA46);//update VBAT
+
+    outb(0x00,0xEB);
+    outb(0x00,0xEB);
+    outb(0x00,0xEB);
+
+    outb(0x28,0xA45);
+    val = inb(0xA46);//read VBAT    
+
+    printf("VBAT value = %dmv\n", val * 2 * 11);
+}

BIN
python_test/Rainbow_720P.mp4


BIN
python_test/Results/.DS_Store


+ 59 - 0
python_test/SerialPort.py

@@ -0,0 +1,59 @@
+import serial
+import datetime
+import time
+
+class SerialPort():
+    def __init__(self,PortName,BaudRate=115200,TimeOut=6):
+        try:
+            self.port = serial.Serial(PortName, baudrate=BaudRate,timeout=TimeOut)
+        except:
+            raise RuntimeError("Open serial port error: %s", PortName)
+
+    def close(self):
+        self.port.flush()
+        self.port.close()
+
+    def sendcmd(self, cmd):
+        if self.port.is_open:
+            self.port.flushInput()
+            self.port.flushOutput()
+            print datetime.datetime.now().strftime("\n%Y-%m-%d %H:%M:%S.%f"), '    ', cmd,
+            self.port.write(cmd + '\n')
+        else:
+            raise RuntimeError("Cmd send error, port not open: %s", self.port.name)
+
+    def sendcmd_bybyte(self, cmd,interval=0.020):
+        if self.port.is_open:
+            self.port.flushInput()
+            self.port.flushOutput()
+            print datetime.datetime.now().strftime("\n%Y-%m-%d %H:%M:%S.%f"), '    ', cmd,
+
+            for sc in cmd:
+                self.port.write(sc)
+                time.sleep(interval)
+            self.port.write("\n")
+        else:
+            raise RuntimeError("Cmd send error, port not open: %s", self.port.name)
+
+    def readResponse(self,terminator=']'):
+        res = self.port.read_until(terminator)
+        print datetime.datetime.now().strftime("\n%Y-%m-%d %H:%M:%S.%f"), '    ', res,
+        if terminator in res:
+            return res
+        else:
+            raise RuntimeError("Error: timeout %s",res)
+
+    def send_read(self,cmd,terminator=']'):
+        self.read_existing()
+        self.sendcmd(cmd)
+        return self.readResponse(terminator)
+
+    def read_existing(self):
+        # res = self.port.read(self.port.in_waiting)
+        res = self.port.read_all()
+        if res != "":
+            print datetime.datetime.now().strftime("\n%Y-%m-%d %H:%M:%S.%f"), '    ', res,
+        return res
+
+    def setTimeout(self,timeOut=6):
+        self.port.timeout = timeOut

BIN
python_test/SerialPort.pyc


BIN
python_test/Seven_Segment_Display/Seven_Segment_Display


+ 31 - 0
python_test/Seven_Segment_Display/test.c

@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+#include <stdint.h>
+#include <string.h>
+
+int main(void)
+{
+    unsigned char val;
+    if (ioperm(0x80, 1, 1) < 0) { //申请 0x80 端口的访问权限
+        perror("Failed to request I/O port permission");
+        return 1;
+    }    
+/*
+    outb(0x00,0xA45);
+    outb(inb(0xA46) | 0x40, 0xA46);//update VBAT
+
+    outb(0x00,0xEB);
+    outb(0x00,0xEB);
+    outb(0x00,0xEB);
+
+    outb(0x28,0xA45);
+    val = inb(0xA46);//read VBAT    
+*/
+	outb(0x88, 0x80); //用户空间也有 outb 函数(需链接 libx86)
+	ioperm(0x80,1,0); //释放权限
+
+    //printf("VBAT value = %dmv\n", val * 2 * 11);
+	return 0;
+}

+ 9 - 0
python_test/TestZone.desktop

@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Name=TestZone
+Comment=Run my custom script
+Icon=/data/Ac0.png
+Exec=/data/python_test/run.sh
+Terminal=true
+Categories=Utility;Application

+ 0 - 0
python_test/__init__.py


BIN
python_test/amidelnx_64


+ 10 - 0
python_test/beep.sh

@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# get seven segment display
+
+
+ec_suspend=`echo "111111" | sudo -S ls`
+sudo ./beep/beep
+echo "1"
+
+

BIN
python_test/beep/beep


+ 39 - 0
python_test/beep/test.c

@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+#include <stdint.h>
+#include <string.h>
+
+
+#define PORT_SPKR 0x61
+#define PORT_CTRL 0x43
+#define PORT_CH2  0x42
+
+int main()
+{
+    unsigned char val;
+    if (ioperm(PORT_CTRL, 1, 1) < 0 || ioperm(PORT_SPKR, 1, 1) < 0 || ioperm(PORT_CH2, 1, 1) < 0) {
+        perror("Failed to request I/O port permission");
+        return 1;
+    }    
+
+    // 设置timer2
+    outb(0xB6, PORT_CTRL);
+
+    // 设置频率
+    outb(0x33, PORT_CH2);
+    outb(0x05, PORT_CH2);
+
+    // 打开speaker
+    val = inb(PORT_SPKR);
+    outb(val | 3, PORT_SPKR);
+
+    // 响1秒
+    sleep(1);
+
+    // 关闭speaker
+    outb(val, PORT_SPKR);
+
+    return 0;
+}

+ 13 - 0
python_test/bios-release-date.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# get bios release date
+bios_date=`dmesg | grep -E "BIOS +.*\w+\/\w+\/\w+" | awk -F"BIOS " '{print $2}' | awk '{print $2}' | head -1`
+
+sleep 1
+
+echo $bios_date
+
+#echo "0"
+
+
+

+ 13 - 0
python_test/bios-ver.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# get bios version
+bios_ver=`dmesg | grep -E "BIOS +.*\w+\/\w+\/\w+" | awk -F"BIOS " '{print $2}' | awk '{print $1}' | head -1`
+
+#sleep 1
+
+echo $bios_ver
+
+#echo "0"
+
+
+

+ 11 - 0
python_test/boot-fs.sh

@@ -0,0 +1,11 @@
+#!/usr/bin/expect
+set timeout 20
+set prompt "] "
+
+spawn ./usbterm
+
+expect "PID:*"
+send "fsboot\r"
+
+expect -re $prompt
+interact

+ 11 - 0
python_test/boot-mcu.sh

@@ -0,0 +1,11 @@
+#!/usr/bin/expect
+set timeout 20
+set prompt "] "
+
+spawn ./nanokdp -d /dev/cu.usbserial-MCU2
+
+expect "*MCU2"
+send "help\r"
+
+expect -re $prompt
+interact 

BIN
python_test/boot_test_v16/.GetEcVersion.sh.swp


+ 5 - 0
python_test/boot_test_v16/.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "files.associations": {
+        "mman.h": "c"
+    }
+}

+ 9 - 0
python_test/boot_test_v16/.vscode/sftp.json

@@ -0,0 +1,9 @@
+{
+    "name": "My Server",
+    "host": "192.168.174.11",
+    "protocol": "sftp",
+    "port": 22,
+    "username": "uos",
+    "remotePath": "/home/uos/Desktop/boot_test_v8.3",
+    "uploadOnSave": true
+}

+ 5 - 0
python_test/boot_test_v16/EcIO/.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "files.associations": {
+        "stdio.h": "c"
+    }
+}

BIN
python_test/boot_test_v16/EcIO/ecmips64


BIN
python_test/boot_test_v16/EcIO/ecx86_64


BIN
python_test/boot_test_v16/EcIO/libecmips64.so


BIN
python_test/boot_test_v16/EcIO/libecx86_64.so


+ 4 - 0
python_test/boot_test_v16/EcIO/readme.txt

@@ -0,0 +1,4 @@
+监控转速和温度
+sudo ./suguang_fan.py
+调整转速:
+sudo ./suguang_fan_set.py

+ 34 - 0
python_test/boot_test_v16/EcIO/suguang_fan.py

@@ -0,0 +1,34 @@
+#!/usr/bin/python3
+import os, time, sys
+
+FAN1 = (0x67, 0x68)
+FAN2 = (0x6B, 0x6C)
+TEMP_ADDR = 0x65
+
+def read_reg(add):
+    cmd = "./ecx86_64 -a %s -r" % hex(add)
+    f = os.popen(cmd)
+    return int(f.read(), 16)
+
+
+def main():
+    while True:
+        f1_h = read_reg(FAN1[0])
+        f1_l = read_reg(FAN1[1])
+        f1_speed = ((f1_h & 0xFF) << 8) | (f1_l & 0xFF)
+
+        f2_h = read_reg(FAN2[0])
+        f2_l = read_reg(FAN2[1])
+        f2_speed = ((f2_h & 0xFF) << 8) | (f2_l & 0xFF)
+        
+        temp = read_reg(TEMP_ADDR)
+        
+        sys.stdout.write("\r")
+        sys.stdout.write("temp: %s fan1 rpm: %s \t fan2 rpm: %s           " % (temp, f1_speed, f2_speed))
+        sys.stdout.flush()
+        time.sleep(1)
+
+
+if __name__ == '__main__':
+    os.system("chmod +x ./ecx86_64")
+    main()

+ 28 - 0
python_test/boot_test_v16/EcIO/suguang_fan_set.py

@@ -0,0 +1,28 @@
+#!/usr/bin/python3
+import os, time, sys
+
+FAN1 = (0x67, 0x68)
+FAN2 = (0x6B, 0x6C)
+
+PWN = 0x0D
+TEST_EN = 0x0E
+
+
+def read_reg(add):
+    cmd = "./ecx86_64 -a %s -r" % hex(add)
+    f = os.popen(cmd)
+    return int(f.read(), 16)
+
+
+def main():
+    while True:
+        sval = input("请输入风扇转速等级(1~254):")
+        val = int(sval)
+        os.system("./ecx86_64 -a %s -w %s" % (hex(PWN), hex(val)))
+
+
+
+if __name__ == '__main__':
+    os.system("chmod +x ./ecx86_64")
+    os.system("./ecx86_64 -a %s -w %s" % (hex(TEST_EN), 1))
+    main()

BIN
python_test/boot_test_v16/EcIO/suguang_fan_tool.tar.xz


BIN
python_test/boot_test_v16/EcIO/suguang_fan_tool_v2.tar.xz


+ 169 - 0
python_test/boot_test_v16/GetEcVersion.sh

@@ -0,0 +1,169 @@
+#!/bin/bash
+MYDIR=$(dirname $(readlink -f "$0"))
+if [ $UID -ne 0 ]; then
+    echo "请以root用户身份运行!"
+    echo "提示: sudo -s 或 su root 可以切换到root用户"
+    exit 1
+fi
+
+ARCH=$(arch)
+
+usage()
+{
+    echo "输入错误!"
+    echo "支持:睡眠(suspend)/休眠(hibernate)/重启(warnboot)/冷重启(coldboot)测试。"
+    echo "用法:./RunTest [suspend/hibernate/warnboot/coldboot] [次数]"
+    echo "例如: 循环300次重启测试: ./RunTest.sh warnboot 300"
+    exit 1
+}
+
+if [ $# -lt 2 ]; then
+    usage
+fi
+
+
+info(){
+		# 获取key所在的行
+        info_line=`sed -n "/^$1=/p" $2`
+        if [[ -z $info_line ]];then
+                echo ""
+        fi
+		# 返回key对应的value值
+        echo $info_line|awk -F '=' '{print $2}'
+}
+
+install_ec_tools()
+{
+    if [ ! -f "/proc/ec_control/resume_timer" ];then
+        cd EcTools
+        insmod ./ec_operation.ko >> /dev/null 2>&1
+        if [ ! -f "/proc/ec_control/resume_timer" ];then
+            echo "install ec tools ..."
+            make >> $login_user_home/debug.log 2>&1
+            insmod ./ec_operation.ko >> $login_user_home/debug.log
+            if [ $? -ne 0 ];then
+                echo "ERROR: install ec tools fail"
+                read
+                exit 1
+            fi
+        else
+            echo "ec tools ready"
+        fi
+        cd $MYDIR
+    fi
+}
+
+set_autorun_uos()
+{
+    #设置关闭自动更新
+    echo 设置关闭自动更新
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetAutoCheckUpdates boolean:false > /dev/null 2>&1
+    #设置关闭更新提醒
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetUpdateNotify boolean:false > /dev/null 2>&1
+    # set autologin
+    sed -i 's/^#\(autologin-user=\)$/\1'${login_user_name}'/' /etc/lightdm/lightdm.conf || echo "设置自动登陆失败,请手动设置自动登陆,已经设置请忽略"
+    echo "更改系统设置。。。"
+    su $login_user_name <<EOF
+bash $MYDIR/set_power_plan.sh;
+exit;
+EOF
+    cat > $login_user_home/.config/autostart/reboot.desktop <<EOF
+[Desktop Entry]
+Type=Application
+Exec=$MYDIR/reboot.sh
+Name=运行量产测试
+StartupNotify=false
+Terminal=true
+EOF
+}
+
+set_autorun_kylin()
+{
+    sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && .\/reboot.sh" /etc/crontab
+    # sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && DISPLAY=:0.0 mate-terminal -e .\/reboot.sh" /etc/crontab
+}
+
+login_user_id=$(grep '^\<UID_MIN\>' /etc/login.defs | awk '{print $2}')
+login_user_name=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $1}')
+login_user_home=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $6}')
+
+case "$ARCH" in
+    mips64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    
+    loongarch64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+
+    aarch64)
+        echo ""
+        # ifconfig enp3s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    x86_64)
+        chmod +x ec$ARCH
+        ;;
+    *)
+        echo "未支持 $ARCH 架构,测试未进行!"
+        exit 1
+    ;;
+esac
+
+date >> $login_user_home/debug.log
+
+
+chmod +x boot_test_v16/*.sh
+#chmod +x rtc_resume rtc_resume_la
+# chmod +x mem
+chmod +x boot_test_v16/ec*
+
+if [ $2 -le 0 ]; then
+    echo "输入有误! 循环次数必须大于0 请重新运行"
+    usage
+fi
+LOG_FILE=$1`date +%Y%m%d`.log
+
+echo "日志文件: ${LOG_FILE}"
+
+TIMECTRL=`date '+%s'`
+sed -i "s#^TIMECTRL=.*#TIMECTRL=$TIMECTRL#" ./boot_test_v16/action.cfg
+sed -i "s#^LOG=.*#LOG=$LOG_FILE#" ./boot_test_v16/action.cfg
+sed -i "s#^ACTION=.*#ACTION=$1#" ./boot_test_v16/action.cfg
+#echo "timesLeft=$2" > ./times.left
+
+echo "测试即将开始。。。"
+case "$1" in
+ec)
+    #./S3S4.sh
+    echo -ne "read EC version:" 
+   master=`echo 111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x00`
+   slave=`echo 111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x01`
+   test1=`echo 111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x02`
+   test2=`echo 111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x03`
+   echo "$master:$slave:$test1:$test2" | awk -F':' '{print $1"."$2"."$3$4}' | sed 's/0x//g' #sed 's/0x0//g;s/0x//g'
+    #exit 0
+    ;;
+register)
+	$set_autorun
+    chown $login_user_name:$login_user_name $MYDIR -R
+    #./reboot.sh
+    ;;
+status)
+    chown $login_user_name:$login_user_name $MYDIR -R
+    #./S3S4.sh
+    ;;
+expression)
+    $set_autorun
+    #./reboot.sh
+    ;;
+    *)
+    usage
+    ;;
+esac
+

+ 178 - 0
python_test/boot_test_v16/RunTest - 副本(1).sh

@@ -0,0 +1,178 @@
+#!/bin/bash
+MYDIR=$(dirname $(readlink -f "$0"))
+if [ $UID -ne 0 ]; then
+    echo "请以root用户身份运行!"
+    echo "提示: sudo -s 或 su root 可以切换到root用户"
+    exit 1
+fi
+
+ARCH=$(arch)
+
+usage()
+{
+    echo "输入错误!"
+    echo "支持:睡眠(suspend)/休眠(hibernate)/重启(warnboot)/冷重启(coldboot)测试。"
+    echo "用法:./RunTest [suspend/hibernate/warnboot/coldboot] [次数]"
+    echo "例如: 循环300次重启测试: ./RunTest.sh warnboot 300"
+    exit 1
+}
+
+if [ $# -lt 2 ]; then
+    usage
+fi
+
+
+info(){
+		# 获取key所在的行
+        info_line=`sed -n "/^$1=/p" $2`
+        if [[ -z $info_line ]];then
+                echo ""
+        fi
+		# 返回key对应的value值
+        echo $info_line|awk -F '=' '{print $2}'
+}
+
+install_ec_tools()
+{
+    if [ ! -f "/proc/ec_control/resume_timer" ];then
+        cd EcTools
+        insmod ./ec_operation.ko >> /dev/null 2>&1
+        if [ ! -f "/proc/ec_control/resume_timer" ];then
+            echo "install ec tools ..."
+            make >> $login_user_home/debug.log 2>&1
+            insmod ./ec_operation.ko >> $login_user_home/debug.log
+            if [ $? -ne 0 ];then
+                echo "ERROR: install ec tools fail"
+                read
+                exit 1
+            fi
+        else
+            echo "ec tools ready"
+        fi
+        cd $MYDIR
+    fi
+}
+
+set_autorun_uos()
+{
+    #设置关闭自动更新
+    echo 设置关闭自动更新
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetAutoCheckUpdates boolean:false > /dev/null 2>&1
+    #设置关闭更新提醒
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetUpdateNotify boolean:false > /dev/null 2>&1
+    # set autologin
+    sed -i 's/^#\(autologin-user=\)$/\1'${login_user_name}'/' /etc/lightdm/lightdm.conf || echo "设置自动登陆失败,请手动设置自动登陆,已经设置请忽略"
+    echo "更改系统设置。。。"
+    su $login_user_name <<EOF
+bash $MYDIR/set_power_plan.sh;
+exit;
+EOF
+    cat > $login_user_home/.config/autostart/reboot.desktop <<EOF
+[Desktop Entry]
+Type=Application
+Exec=$MYDIR/reboot.sh
+Name=运行量产测试
+StartupNotify=false
+Terminal=true
+EOF
+}
+
+set_autorun_kylin()
+{
+    sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && .\/reboot.sh" /etc/crontab
+    # sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && DISPLAY=:0.0 mate-terminal -e .\/reboot.sh" /etc/crontab
+}
+
+login_user_id=$(grep '^\<UID_MIN\>' /etc/login.defs | awk '{print $2}')
+login_user_name=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $1}')
+login_user_home=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $6}')
+
+case "$ARCH" in
+    mips64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    
+    loongarch64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+
+    aarch64)
+        echo ""
+        # ifconfig enp3s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    x86_64)
+        chmod +x ec$ARCH
+        ;;
+    *)
+        echo "未支持 $ARCH 架构,测试未进行!"
+        exit 1
+    ;;
+esac
+
+date >> $login_user_home/debug.log
+
+
+chmod +x ./boot_test_v16/*.sh
+chmod +x ./boot_test_v16/rtc_resume ./boot_test_v16/rtc_resume_la
+# chmod +x mem
+chmod +x ec*
+
+if [ $2 -le 0 ]; then
+    echo "输入有误! 循环次数必须大于0 请重新运行"
+    usage
+fi
+LOG_FILE=$1`date +%Y%m%d`.log
+
+echo "日志文件: ${LOG_FILE}"
+
+TIMECTRL=`date '+%s'`
+sed -i "s#^TIMECTRL=.*#TIMECTRL=$TIMECTRL#" ./boot_test_v16/action.cfg
+sed -i "s#^LOG=.*#LOG=$LOG_FILE#" ./boot_test_v16/action.cfg
+sed -i "s#^ACTION=.*#ACTION=$1#" ./boot_test_v16/action.cfg
+echo "timesLeft=$2" > ./boot_test_v16/times.left
+
+OS=`info ID /etc/os-release`
+if [ "$OS" == "uos" ];then
+    set_autorun=set_autorun_uos
+else
+    set_autorun=set_autorun_kylin
+fi
+
+echo "测试即将开始。。。"
+
+source "${MYDIR}/times.left"
+source "${MYDIR}/action.cfg"
+interval=2
+echo "TIMER=${TIMER} " >> $login_user_home/debug.log
+echo "TIMECTRL=${TIMECTRL}" >> $login_user_home/debug.log
+echo "LOG=${LOG}" >> $login_user_home/debug.log
+chown $login_user_name:$login_user_name $login_user_home/debug.log
+case "$1" in
+suspend)
+     ./boot_test_v16/S3S4.sh
+    exit 0
+    ;;
+warnboot)
+	$set_autorun
+    chown $login_user_name:$login_user_name $MYDIR -R
+    ./boot_test_v16/reboot.sh
+    ;;
+hibernate)
+    chown $login_user_name:$login_user_name $MYDIR -R
+    ./boot_test_v16/S3S4.sh
+    ;;
+coldboot)
+    $set_autorun
+    ./boot_test_v16/reboot.sh
+    ;;
+    *)
+    usage
+    ;;
+esac
+

+ 178 - 0
python_test/boot_test_v16/RunTest.sh

@@ -0,0 +1,178 @@
+#!/bin/bash
+MYDIR=$(dirname $(readlink -f "$0"))
+if [ $UID -ne 0 ]; then
+    echo "请以root用户身份运行!"
+    echo "提示: sudo -s 或 su root 可以切换到root用户"
+    exit 1
+fi
+
+ARCH=$(arch)
+
+usage()
+{
+    echo "输入错误!"
+    echo "支持:睡眠(suspend)/休眠(hibernate)/重启(warnboot)/冷重启(coldboot)测试。"
+    echo "用法:./RunTest [suspend/hibernate/warnboot/coldboot] [次数]"
+    echo "例如: 循环300次重启测试: ./RunTest.sh warnboot 300"
+    exit 1
+}
+
+if [ $# -lt 2 ]; then
+    usage
+fi
+
+
+info(){
+		# 获取key所在的行
+        info_line=`sed -n "/^$1=/p" $2`
+        if [[ -z $info_line ]];then
+                echo ""
+        fi
+		# 返回key对应的value值
+        echo $info_line|awk -F '=' '{print $2}'
+}
+
+install_ec_tools()
+{
+    if [ ! -f "/proc/ec_control/resume_timer" ];then
+        cd EcTools
+        insmod ./ec_operation.ko >> /dev/null 2>&1
+        if [ ! -f "/proc/ec_control/resume_timer" ];then
+            echo "install ec tools ..."
+            make >> $login_user_home/debug.log 2>&1
+            insmod ./ec_operation.ko >> $login_user_home/debug.log
+            if [ $? -ne 0 ];then
+                echo "ERROR: install ec tools fail"
+                read
+                exit 1
+            fi
+        else
+            echo "ec tools ready"
+        fi
+        cd $MYDIR
+    fi
+}
+
+set_autorun_uos()
+{
+    #设置关闭自动更新
+    echo 设置关闭自动更新
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetAutoCheckUpdates boolean:false > /dev/null 2>&1
+    #设置关闭更新提醒
+    dbus-send --system --dest=com.deepin.lastore --type=method_call /com/deepin/lastore com.deepin.lastore.Updater.SetUpdateNotify boolean:false > /dev/null 2>&1
+    # set autologin
+    sed -i 's/^#\(autologin-user=\)$/\1'${login_user_name}'/' /etc/lightdm/lightdm.conf || echo "设置自动登陆失败,请手动设置自动登陆,已经设置请忽略"
+    echo "更改系统设置。。。"
+    su $login_user_name <<EOF
+bash $MYDIR/set_power_plan.sh;
+exit;
+EOF
+    cat > $login_user_home/.config/autostart/reboot.desktop <<EOF
+[Desktop Entry]
+Type=Application
+Exec=$MYDIR/reboot.sh
+Name=运行量产测试
+StartupNotify=false
+Terminal=true
+EOF
+}
+
+set_autorun_kylin()
+{
+    sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && .\/reboot.sh" /etc/crontab
+    # sed -i "\$a\*\/${interval:=2} * * * * root cd \/${MYDIR} && DISPLAY=:0.0 mate-terminal -e .\/reboot.sh" /etc/crontab
+}
+
+login_user_id=$(grep '^\<UID_MIN\>' /etc/login.defs | awk '{print $2}')
+login_user_name=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $1}')
+login_user_home=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $6}')
+
+case "$ARCH" in
+    mips64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    
+    loongarch64)
+        # ifconfig enp1s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+
+    aarch64)
+        echo ""
+        # ifconfig enp3s0 down > /dev/null 2>&1
+        # # 关闭WiFi
+        # rfkill block 0 > /dev/null 2>&1
+        ;;
+    x86_64)
+        chmod +x ec$ARCH
+        ;;
+    *)
+        echo "未支持 $ARCH 架构,测试未进行!"
+        exit 1
+    ;;
+esac
+
+date >> $login_user_home/debug.log
+
+
+chmod +x ./boot_test_v16/*.sh
+chmod +x ./boot_test_v16/rtc_resume ./boot_test_v16/rtc_resume_la
+# chmod +x mem
+chmod +x ./boot_test_v16/ec*
+
+if [ $2 -le 0 ]; then
+    echo "输入有误! 循环次数必须大于0 请重新运行"
+    usage
+fi
+LOG_FILE=$1`date +%Y%m%d`.log
+
+echo "日志文件: ${LOG_FILE}"
+
+TIMECTRL=`date '+%s'`
+sed -i "s#^TIMECTRL=.*#TIMECTRL=$TIMECTRL#" ./boot_test_v16/action.cfg
+sed -i "s#^LOG=.*#LOG=$LOG_FILE#" ./boot_test_v16/action.cfg
+sed -i "s#^ACTION=.*#ACTION=$1#" ./boot_test_v16/action.cfg
+echo "timesLeft=$2" > ./boot_test_v16/times.left
+
+OS=`info ID /etc/os-release`
+if [ "$OS" == "uos" ];then
+    set_autorun=set_autorun_uos
+else
+    set_autorun=set_autorun_kylin
+fi
+
+echo "测试即将开始。。。"
+
+source "${MYDIR}/times.left"
+source "${MYDIR}/action.cfg"
+interval=2
+echo "TIMER=${TIMER} " >> $login_user_home/debug.log
+echo "TIMECTRL=${TIMECTRL}" >> $login_user_home/debug.log
+echo "LOG=${LOG}" >> $login_user_home/debug.log
+chown $login_user_name:$login_user_name $login_user_home/debug.log
+case "$1" in
+suspend)
+     ./boot_test_v16/S3S4.sh
+    exit 0
+    ;;
+warnboot)
+	$set_autorun
+    chown $login_user_name:$login_user_name $MYDIR -R
+    ./boot_test_v16/reboot.sh
+    ;;
+hibernate)
+    chown $login_user_name:$login_user_name $MYDIR -R
+    ./boot_test_v16/S3S4.sh
+    ;;
+coldboot)
+    $set_autorun
+    ./boot_test_v16/reboot.sh
+    ;;
+    *)
+    usage
+    ;;
+esac
+

+ 178 - 0
python_test/boot_test_v16/S3S4.sh

@@ -0,0 +1,178 @@
+#!/bin/bash
+MYDIR=$(dirname $(readlink -f "$0"))
+echo "dir: ${MYDIR}"  >> /tmp/debug.log
+login_user_id=$(grep '^\<UID_MIN\>' /etc/login.defs | awk '{print $2}')
+login_user_name=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $1}')
+login_user_home=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $6}')
+source "${MYDIR}/times.left"
+source "${MYDIR}/action.cfg"
+logFile=${MYDIR}/${LOG}
+count=${timesLeft}
+echo "[`date`] 开始待机${ACTION}测试。。。" | tee -a ${logFile}
+# echo "[`date`] 开始待机${ACTION}测试。。。" >> result.txt
+echo "日志文件: ${logFile}"
+echo "循环次数: ${count}"  | tee -a ${logFile}
+ARCH=$(arch)
+#ARCH="loongarch64"
+console=/dev/ttyS0
+
+if [ $ARCH = "aarch64" ]; then
+    console=/dev/ttyAMA0
+fi
+
+ec_wakeup()
+{
+    echo "write EC[0x0F] = 0x28"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x28 -a 0x0F
+    sleep 0.5
+    echo -ne "read EC[0x0F]:"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x0F  >> ${logFile}
+}
+
+
+loongson_suspend()
+{
+    if [ "$ARCH" == "mips64" ]; then
+        ${MYDIR}/rtc_resume ${TIMER}s
+    else
+        # echo "set_rtc rtc_resume_la ${TIMER}s"
+        ec_wakeup
+        sleep 1
+    fi
+    # hwclock -w
+	# freeze mem disk
+    echo mem > /sys/power/state
+}
+
+loongson_hibernate()
+{
+    ec_wakeup
+    echo disk > /sys/power/state
+}
+
+uos_suspend()
+{
+	rtcwake -m mem -s 60
+    # hwclock -w
+    #echo mem > /sys/power/state
+}
+
+
+uos_hibernate()
+{
+    #ec_wakeup
+    #echo disk > /sys/power/state
+	rtcwake -m disk -s 60
+}
+
+haiguagn_suspend()
+{
+    ec_wakeup
+    systemctl suspend
+}
+
+haiguang_hibernate()
+{
+    ec_wakeup
+    systemctl hibernate
+}
+
+phytium_suspend()
+{
+    ec_wakeup
+
+    echo "write EC[0x0C] = 0x0F"  >> ${logFile}  #aarch64
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x0F -a 0x08
+    #echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x01 -a 0x0A
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x0F -a 0x08
+    #echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x01 -a 0x0A
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x0F -a 0x08
+    #echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x01 -a 0x0A
+    sleep 0.5
+    echo -ne "read EC[0x08]:"  >> ${logFile}
+    #echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x0C  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x08  >> ${logFile}
+    systemctl suspend
+    #rtcwake -m mem -s 5
+    #sleep 60
+    ##ec_wakeup
+}
+
+phytium_hibernate()
+{
+    ec_wakeup
+    echo "write EC[0x1E] = 0x08"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo -ne "read EC[0x08]:"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x08  >> ${logFile}
+    systemctl hibernate
+    #sleep 60
+    #ec_wakeup
+}
+
+case "$ARCH" in
+    mips64)
+        suspend_action=loongson_suspend
+        hibernate_action=loongson_hibernate
+        ;;
+    loongarch64)
+        suspend_action=loongson_suspend
+        hibernate_action=loongson_hibernate
+        ;;
+    aarch64)
+        suspend_action=phytium_suspend
+        hibernate_action=phytium_hibernate
+        ;;
+    x86_64)
+        #suspend_action=haiguagn_suspend
+        #hibernate_action=haiguang_hibernate
+		suspend_action=uos_suspend
+		hibernate_action=uos_hibernate
+        ;;
+    *)
+        echo "未支持$ARCH架构,测试未进行!"
+        exit 1
+        ;;
+esac
+
+
+while [ $count -gt 0 ]
+do
+    echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} remaining ${count} times" > $console
+    echo "还剩余${count}次${ACTION}测试"
+    echo "[`date`] 还剩余${count}次${ACTION}测试" >> ${logFile}
+    if read -t 30 -p "按Enter键停止测试!" start; then
+        chown $login_user_name:$login_user_name $MYDIR -R
+        echo "测试中止!"
+        # ifconfig enp1s0 up
+        # rfkill unblock 0
+        exit 1
+    fi
+    s=$(printf "%-30s" "=")
+    echo -e "${s// /=}\n" >> ${logFile}
+    echo -e "${s// /=}\n" >> ${logFile}
+    count=$(($count-1))
+    case "${ACTION}" in
+    suspend)
+        $suspend_action
+        ;;
+    hibernate)
+        $hibernate_action
+        ;;
+    esac
+    echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} finish!" > $console
+    clear
+done
+echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} all done!" > $console
+echo "[`date`] ${ACTION}测试完成" | tee -a ${logFile}
+# echo "[`date`] ${count}次${ACTION}测试完成" >> result.txt
+chown $login_user_name:$login_user_name $MYDIR -R
+read input
+exit 0

+ 5 - 0
python_test/boot_test_v16/action.cfg

@@ -0,0 +1,5 @@
+ACTION=ec
+TIMER=1
+TIMECTRL=1774959951
+LOG=ec20260331.log
+

+ 5 - 0
python_test/boot_test_v16/coldboot20241219.log

@@ -0,0 +1,5 @@
+==============================
+
+[2024年 12月 19日 星期四 18:05:55 CST]还剩余5次coldboot。
+write EC[0x0D] = 0x1E
+read EC[0x0D]:

+ 10 - 0
python_test/boot_test_v16/coldboot20260608.log

@@ -0,0 +1,10 @@
+==============================
+
+[2026年 06月 08日 星期一 03:23:40 CST]还剩余5次coldboot。
+write EC[0x0D] = 0x1E
+read EC[0x0D]:0x1E==============================
+
+[2026年 06月 08日 星期一 09:00:51 CST]还剩余5次coldboot。
+write EC[0x0F] = 0x28
+read EC[0x0F]:0x28write EC[0x0D] = 0x1E
+read EC[0x0D]:0x1E

+ 6 - 0
python_test/boot_test_v16/ec20250805.log

@@ -0,0 +1,6 @@
+[2025年 08月 06日 星期三 11:10:21 CST] 开始待机ec测试。。。
+循环次数: 1
+[2025年 08月 06日 星期三 11:10:21 CST] 还剩余1次ec测试
+[2025年 08月 06日 星期三 11:10:56 CST] 开始待机ec测试。。。
+循环次数: 2
+[2025年 08月 06日 星期三 11:10:56 CST] 还剩余2次ec测试

BIN
python_test/boot_test_v16/ecaarch64


BIN
python_test/boot_test_v16/ecaarch64_D3000


BIN
python_test/boot_test_v16/ecloongarch64


BIN
python_test/boot_test_v16/ecmips64


BIN
python_test/boot_test_v16/ecx86_64


+ 184 - 0
python_test/boot_test_v16/grub.cfg

@@ -0,0 +1,184 @@
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+  set have_grubenv=true
+  load_env
+fi
+if [ "${next_entry}" ] ; then
+   set default="${next_entry}"
+   set next_entry=
+   save_env next_entry
+   set boot_once=true
+else
+   set default="0"
+fi
+
+if [ x"${feature_menuentry_id}" = xy ]; then
+  menuentry_id_option="--id"
+else
+  menuentry_id_option=""
+fi
+
+export menuentry_id_option
+
+if [ "${prev_saved_entry}" ]; then
+  set saved_entry="${prev_saved_entry}"
+  save_env saved_entry
+  set prev_saved_entry=
+  save_env prev_saved_entry
+  set boot_once=true
+fi
+
+function savedefault {
+  if [ -z "${boot_once}" ]; then
+    saved_entry="${chosen}"
+    save_env saved_entry
+  fi
+}
+function load_video {
+  if [ x$feature_all_video_module = xy ]; then
+    insmod all_video
+  else
+    insmod efi_gop
+    insmod efi_uga
+    insmod ieee1275_fb
+    insmod vbe
+    insmod vga
+    insmod video_bochs
+    insmod video_cirrus
+  fi
+}
+
+if [ x$feature_default_font_path = xy ] ; then
+   font=unicode
+else
+set root='hd0,gpt3'
+if [ x$feature_platform_search_hint = xy ]; then
+  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt3' --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  19054f86-3cc7-4f42-9532-edb4a044aa4c
+else
+  search --no-floppy --fs-uuid --set=root 19054f86-3cc7-4f42-9532-edb4a044aa4c
+fi
+    font="/usr/share/grub/unicode.pf2"
+fi
+set gfxmode=auto
+if loadfont $font ; then
+echo
+fi
+terminal_output gfxterm
+if [ "${recordfail}" = 1 ] ; then
+  set timeout=30
+else
+  if [ x$feature_timeout_style = xy ] ; then
+    set timeout_style=menu
+    set timeout=5
+  # Fallback normal timeout code in case the timeout_style feature is
+  # unavailable.
+  else
+    set timeout=5
+  fi
+fi
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/01_live ###
+if [ ! -z ${boot_once} ];then
+  set timeout_style=countdown
+  set load_config=load-config
+else
+  set load_config=
+fi
+### END /etc/grub.d/01_live ###
+
+### BEGIN /etc/grub.d/05_debian_theme ###
+### END /etc/grub.d/05_debian_theme ###
+
+### BEGIN /etc/grub.d/10_linux ###
+function gfxmode {
+	set gfxpayload="${1}"
+}
+set linux_gfx_mode=
+export linux_gfx_mode
+menuentry 'UnionTech OS Desktop 20 Professional GNU/Linux' --class uniontech --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-19054f86-3cc7-4f42-9532-edb4a044aa4c' {
+	set root='hd0,gpt2'
+	if [ x$feature_platform_search_hint = xy ]; then
+	  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  fcbaa12f-8584-4f02-aff5-adbcd762bfed
+	else
+	  search --no-floppy --fs-uuid --set=root fcbaa12f-8584-4f02-aff5-adbcd762bfed
+	fi
+if [ loongson != "loongson" ];then
+	echo	'Loading Linux 4.19.0-loongson-3-desktop ...'
+fi
+	linux	/vmlinuz-4.19.0-loongson-3-desktop root=UUID=19054f86-3cc7-4f42-9532-edb4a044aa4c ro  splash quiet console=tty loglevel=0
+if [ loongson != "loongson" ];then
+	echo	'Loading initial ramdisk ...'
+fi
+	initrd	/initrd.img-4.19.0-loongson-3-desktop
+    boot 
+}
+submenu 'Advanced options for UnionTech OS Desktop 20 Professional GNU/Linux' $menuentry_id_option 'gnulinux-advanced-19054f86-3cc7-4f42-9532-edb4a044aa4c' {
+	menuentry 'UnionTech OS Desktop 20 Professional GNU/Linux, with Linux 4.19.0-loongson-3-desktop' --class uniontech --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-loongson-3-desktop-advanced-19054f86-3cc7-4f42-9532-edb4a044aa4c' {
+		set root='hd0,gpt2'
+		if [ x$feature_platform_search_hint = xy ]; then
+		  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  fcbaa12f-8584-4f02-aff5-adbcd762bfed
+		else
+		  search --no-floppy --fs-uuid --set=root fcbaa12f-8584-4f02-aff5-adbcd762bfed
+		fi
+	if [ loongson != "loongson" ];then
+		echo	'Loading Linux 4.19.0-loongson-3-desktop ...'
+	fi
+		linux	/vmlinuz-4.19.0-loongson-3-desktop root=UUID=19054f86-3cc7-4f42-9532-edb4a044aa4c ro  splash quiet console=tty loglevel=0
+	if [ loongson != "loongson" ];then
+		echo	'Loading initial ramdisk ...'
+	fi
+		initrd	/initrd.img-4.19.0-loongson-3-desktop
+	    boot 
+	}
+}
+
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/11_deepin_ab_recovery ###
+### END /etc/grub.d/11_deepin_ab_recovery ###
+
+### BEGIN /etc/grub.d/15_linux_bar ###
+menuentry 'Uniontech OS Backup & Restore' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-recovery' {
+	set root='hd0,gpt6'
+	if [ x$feature_platform_search_hint = xy ]; then
+	  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt6' --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  de157839-4e13-4ba0-aee2-f46b8a4730e6
+	else
+	  search --no-floppy --fs-uuid --set=root de157839-4e13-4ba0-aee2-f46b8a4730e6
+	fi
+	linux	/doppel/vmlinuz-4.19.90 ro boot=live $load_config components toram=filesystem.squashfs locales=zh_CN.UTF-8 acpi_backlight=vendor splash quiet console=tty loglevel=0 live-media-path=doppel
+	initrd	/doppel/initrd.img-4.19.90
+	boot
+}
+
+### END /etc/grub.d/15_linux_bar ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/30_uefi-firmware ###
+### END /etc/grub.d/30_uefi-firmware ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries.  Simply type the
+# menu entries you want to add after this comment.  Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f  ${config_directory}/custom.cfg ]; then
+  source ${config_directory}/custom.cfg
+elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
+  source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###

+ 149 - 0
python_test/boot_test_v16/reboot.sh

@@ -0,0 +1,149 @@
+#!/bin/bash
+login_user_id=$(grep '^\<UID_MIN\>' /etc/login.defs | awk '{print $2}')
+login_user_name=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $1}')
+login_user_home=$(cat /etc/passwd | awk -v id="$login_user_id" -F: '{if ($3==id) print $6}')
+# echo  $login_user_id
+# echo  $login_user_name
+# echo  $login_user_home
+
+MYDIR=$(dirname $(readlink -f "$0"))
+echo "dir: ${MYDIR}"  >> /tmp/debug.log
+
+echo "${MYDIR}/times.left" >> /tmp/debug.log
+source "${MYDIR}/times.left"
+source "${MYDIR}/action.cfg"
+logFile=${MYDIR}/${LOG}
+ARCH=$(arch)
+# resultFile=$(dirname "${MYDIR}")/result/result.txt
+console=/dev/ttyS0
+
+if [ $ARCH = "aarch64" ]; then
+    console=/dev/ttyAMA0
+fi
+s=$(printf "%-30s" "=")
+echo -e "${s// /=}\n" >> ${logFile}
+now=`date '+%s'`
+if [ $(($now - $TIMECTRL)) -ge 300 ]; then
+    echo "[`date`] 警告:距离上次自动执行超5分钟"  | tee -a ${logFile}
+    # echo -e "检测到超时(5分钟)异常,测试终止!\n $now - $TIMECTRL -ge 300" >> /tmp/debug.log
+    # rm -f $login_user_home/.config/autostart/reboot.desktop
+    # chown $login_user_name:$login_user_name $MYDIR -R
+    # exit 1
+fi
+# export PATH=$PATH:$MYDIR
+
+ec_wakeup()
+{
+    echo "write EC[0x08] = 0x28"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x28 -a 0x08
+    sleep 0.5
+    echo -ne "read EC[0x08]:"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x08  >> ${logFile}
+}
+
+loongson_coldboot()
+{
+    ec_wakeup
+}
+
+
+phytium_coldboot2()
+{
+    ec_wakeup
+	#ibf write 66 bit 1 = 0  read obf 66 bit 0 = 0  
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000066 0x81 > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0xd > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0x1 > /dev/null
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000066 0x81 > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0xd > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0x1 > /dev/null
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000066 0x81 > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0xd > /dev/null
+    sleep 0.1
+    echo lc111111 | sudo -S ${MYDIR}/mem write 1 0x20000062 0x1 > /dev/null
+    sleep 0.5
+}
+
+phytium_coldboot()
+{
+    ec_wakeup
+	echo "write EC[0x08] = 0x1E"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -w 0x1E -a 0x08
+    sleep 0.5
+    echo -ne "read EC[0x08]:"  >> ${logFile}
+    echo lc111111 | sudo -S ${MYDIR}/ec$ARCH -r -a 0x08  >> ${logFile}
+}
+
+case "$ARCH" in
+    mips64)
+        coldboot_action=loongson_coldboot
+        ;;
+    aarch64)
+        coldboot_action=phytium_coldboot
+        ;;
+    *)
+        #coldboot_action=ec_wakeup
+		coldboot_action=phytium_coldboot
+        # echo "未支持$ARCH架构,测试未进行!"
+        # exit 1
+    ;;
+esac
+
+info(){
+		# 获取key所在的行
+        info_line=`sed -n "/^$1=/p" $2`
+        if [[ -z $info_line ]];then
+                echo ""
+        fi
+		# 返回key对应的value值
+        echo $info_line|awk -F '=' '{print $2}'
+}
+
+OS=`info ID /etc/os-release`
+
+
+if [ ${timesLeft} -gt '0' ];then
+    echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} remaining ${timesLeft} times" > $console
+    echo "[`date`]还剩余${timesLeft}次${ACTION}。" | tee -a ${logFile}
+    ############################################################
+    if [ "$OS" == "uos" ];then
+        if read -t 15 -p "按Enter键停止测试!" start; then
+            rm -f $login_user_home/.config/autostart/reboot.desktop
+            chown $login_user_name:$login_user_name $MYDIR -R
+            echo "测试中止!"
+            exit 1
+        fi
+    fi
+    echo "timesLeft=$((timesLeft-1))" > ${MYDIR}/times.left  
+    now=`date '+%s'`
+    sed -i "s#^TIMECTRL=.*#TIMECTRL=$now#" ${MYDIR}/action.cfg
+    chown $login_user_name:$login_user_name $MYDIR -R
+    case "${ACTION}" in
+    warnboot)
+        /sbin/reboot
+        ;;
+    coldboot)
+        $coldboot_action
+        /sbin/poweroff
+        ;;
+    esac
+    echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} finish!" > $console
+else
+    echo "[`date "+%m-%d-%H:%M:%S"`] Do ${ACTION} all done!" > $console
+    echo "[`date`] ${ACTION}测试完成" | tee -a ${logFile}
+    rm -f $login_user_home/.config/autostart/reboot.desktop
+    echo lc111111 | sudo -S sed -i '/.\/reboot.sh/d' /etc/crontab
+    chown $login_user_name:$login_user_name $MYDIR -R
+    read i
+fi

BIN
python_test/boot_test_v16/rtc_resume


BIN
python_test/boot_test_v16/rtc_resume_la


+ 24 - 0
python_test/boot_test_v16/script.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+echo $(readlink -f "$0")
+echo $0
+if [ "$1" != "cron" ]; then
+    echo "cron start"
+fi
+
+info(){
+		# 获取key所在的行
+        info_line=`sed -n "/^$1=/p" $2`
+        if [[ -z $info_line ]];then
+                echo ""
+        fi
+		# 返回key对应的value值
+        echo $info_line|awk -F '=' '{print $2}'
+}
+
+OS=`info ID /etc/os-release`
+if [ "$OS" == "ubuntu" ];then
+    #设置关闭自动更新
+    echo 设置关闭自动更新
+
+fi
+echo "done"

+ 17 - 0
python_test/boot_test_v16/set_power_plan.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+echo "set power plan"
+echo -ne "user: "
+echo $(whoami)
+# 不关屏
+gsettings set com.deepin.dde.power line-power-screen-black-delay 0
+gsettings set com.deepin.dde.power battery-screen-black-delay 0
+# 不睡眠
+gsettings set com.deepin.dde.power line-power-sleep-delay 0
+gsettings set com.deepin.dde.power battery-sleep-delay 0
+# 不锁屏
+gsettings set com.deepin.dde.power line-power-lock-delay 0
+gsettings set com.deepin.dde.power battery-lock-delay 0
+# 唤醒无密码
+gsettings set com.deepin.dde.power sleep-lock false
+# 锁屏无密码
+gsettings set com.deepin.dde.power screen-black-lock false

+ 1 - 0
python_test/boot_test_v16/times.left

@@ -0,0 +1 @@
+timesLeft=1

+ 3 - 0
python_test/boot_test_v16/warnboot20241219.log

@@ -0,0 +1,3 @@
+==============================
+
+[2024年 12月 19日 星期四 17:55:02 CST]还剩余5次warnboot。

BIN
python_test/boot_test_v16/wav/coldboot.wav


BIN
python_test/boot_test_v16/wav/hibernate.wav


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff