[Fuego] [PATCH 6/6] Functional.arch_timer: support for arm64 & multi core
Li Xiaoming
lixm.fnst at cn.fujitsu.com
Mon Jul 16 10:41:47 UTC 2018
Details: this patch is together with another with another patch
of modify template-dev.board in fuego repo
Signed-off-by: Li Xiaoming <lixm.fnst at cn.fujitsu.com>
---
.../fix-arch-timer-rate.patch | 14 +++++
engine/tests/Functional.arch_timer/fuego_test.sh | 17 ++++-
.../Functional.arch_timer/support-multi-cpu.patch | 73 ++++++++++++++++++++++
3 files changed, 103 insertions(+), 1 deletion(-)
create mode 100644 engine/tests/Functional.arch_timer/fix-arch-timer-rate.patch
create mode 100644 engine/tests/Functional.arch_timer/support-multi-cpu.patch
diff --git a/engine/tests/Functional.arch_timer/fix-arch-timer-rate.patch b/engine/tests/Functional.arch_timer/fix-arch-timer-rate.patch
new file mode 100644
index 0000000..9de9fcd
--- /dev/null
+++ b/engine/tests/Functional.arch_timer/fix-arch-timer-rate.patch
@@ -0,0 +1,14 @@
+diff -uNr old/arch_timer/dmesg-lager.sh new/arch_timer/dmesg-lager.sh
+--- old/arch_timer/dmesg-lager.sh 2014-04-28 15:48:56.000000000 +0800
++++ new/arch_timer/dmesg-lager.sh 2018-05-03 09:35:32.538873698 +0800
+@@ -5,4 +5,9 @@
+
+ echo "Arch ARM timer dmesg feature test"
+
+-exec $(dirname $0)/../common/dmesg.sh "ARM arch timer >56 bits at 10000kHz"
++ARCH_TIMER_RATE="10000kHz"
++if [ $1 ] ; then
++ ARCH_TIMER_RATE=$1
++fi
++
++exec $(dirname $0)/../common/dmesg.sh "ARM arch timer >56 bits at $ARCH_TIMER_RATE"
diff --git a/engine/tests/Functional.arch_timer/fuego_test.sh b/engine/tests/Functional.arch_timer/fuego_test.sh
index de6922b..89febac 100755
--- a/engine/tests/Functional.arch_timer/fuego_test.sh
+++ b/engine/tests/Functional.arch_timer/fuego_test.sh
@@ -3,6 +3,15 @@ tarball=dung-3.4.25-m2.tar.gz
function test_build {
patch -N -s -p1 < $TEST_HOME/switch-bash-to-sh-arch_timer-interrupt-lager.patch
+ TMPFILE="$BOARD_TESTDIR/fuego.$TESTDIR/cpuinfo.txt"
+ TMPFILE2="$LOGDIR/../cpuinfo.$PLATFORM"
+ report "cat /proc/cpuinfo| grep "processor"| wc -l > $TMPFILE"
+ get $TMPFILE $TMPFILE2
+ CPU=$(cat $TMPFILE2)
+ if [ $CPU -gt 1 ] ; then
+ patch -N -s -p1 < $TEST_HOME/support-multi-cpu.patch
+ fi
+ patch -N -s -p1 < $TEST_HOME/fix-arch-timer-rate.patch
touch test_suit_ready
}
@@ -11,10 +20,16 @@ function test_deploy {
}
function test_run {
- report "cd $BOARD_TESTDIR/fuego.$TESTDIR/arch_timer; ./arch_timer-interrupt-lager.sh ; ./dmesg-lager.sh; ./proc-interrupts-lager.sh"
+ report "cd $BOARD_TESTDIR/fuego.$TESTDIR/arch_timer; ./arch_timer-interrupt-lager.sh ; ./dmesg-lager.sh $ARCH_TIMER_RATE; ./proc-interrupts-lager.sh $ARCH_TIMER_IRQ"
}
function test_processing {
+ FUNCTIONAL_ARCH_TIMER_RES_LINES_COUNT=3
+ TMPFILE2="$LOGDIR/../cpuinfo.$PLATFORM"
+ CPU=$(cat $TMPFILE2)
+ if [ $CPU -gt 1 ] ; then
+ FUNCTIONAL_ARCH_TIMER_RES_LINES_COUNT=2
+ fi
assert_define FUNCTIONAL_ARCH_TIMER_RES_LINES_COUNT
check_capability "RENESAS"
diff --git a/engine/tests/Functional.arch_timer/support-multi-cpu.patch b/engine/tests/Functional.arch_timer/support-multi-cpu.patch
new file mode 100644
index 0000000..2c5de14
--- /dev/null
+++ b/engine/tests/Functional.arch_timer/support-multi-cpu.patch
@@ -0,0 +1,73 @@
+diff -uNr old/arch_timer/proc-interrupts-lager.sh new/arch_timer/proc-interrupts-lager.sh
+--- old/arch_timer/proc-interrupts-lager.sh 2014-04-28 15:48:56.000000000 +0800
++++ new/arch_timer/proc-interrupts-lager.sh 2018-05-03 11:51:07.438404670 +0800
+@@ -1,14 +1,26 @@
+ #!/bin/sh
+
+-set -e
++#set -e
+ #set -x
+
+ echo "arch_timer /proc/interrupts presence test"
+
+ IRQ=27
++if [ $1 ] ; then
++ IRQ=$1
++fi
+ DIV_NAME="arch_timer"
+-if $(dirname $0)/../common/proc-interrupts.sh "$DIV_NAME" | grep "$IRQ"; then
+- echo "Test passed"
++$(dirname $0)/../common/proc-interrupts.sh "$DIV_NAME" | grep "$IRQ" > irq_temp
++if [ -s irq_temp ]
++then
++ IRQ_TEMP=$(cat irq_temp | awk '{print $1}')
++ IRQ_TEMP=${IRQ_TEMP%:*}
++ if [ $IRQ_TEMP -eq $IRQ ]
++ then
++ echo "Test passed"
++ else
++ echo "Test has not passed. Expect=$IRQ Execute=$IRQ_TEMP"
++ fi
+ else
+- echo "Test has not passed"
++ echo "Test has not passed. Expect=$IRQ Execute=$IRQ_TEMP"
+ fi
+diff -uNr old/common/interrupt-count.sh new/common/interrupt-count.sh
+--- old/common/interrupt-count.sh 2014-04-28 15:33:41.000000000 +0800
++++ new/common/interrupt-count.sh 2018-05-03 19:13:06.569740857 +0800
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # count interrupt of device
+
+-set -e
++#set -e
+ #set -x
+
+ if [ $# -ne 1 ]; then
+@@ -14,7 +14,23 @@
+ $(dirname $0)/../common/proc-interrupts.sh "$1" > irq_temp
+
+ # Filter interrupt number
+-read IRQ < irq_temp
+-IRQ=${IRQ%% [A-Za-z]*}
+-IRQ=${IRQ#* }
++if [ -s $(dirname $0)/../cpuinfo.txt ]
++then
++ CPU=$(cat $(dirname $0)/../cpuinfo.txt)
++else
++ CPU=1
++fi
++CPU=$[$CPU+1]
++while read IRQLIST
++do
++ i=1
++ for IRQI in $IRQLIST
++ do
++ if [ $i -gt 1 -a $i -le $CPU ]
++ then
++ IRQ=$[IRQ+IRQI]
++ fi
++ ((i++))
++ done
++done < irq_temp
+ echo $IRQ
--
2.7.4
More information about the Fuego
mailing list