summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2015-04-07 09:16:03 (GMT)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2015-04-07 09:16:03 (GMT)
commit1f52e0be8ef57ae5ccbd070e620459f9b2e332e7 (patch)
tree9edd15b384b15fd96807c140c8a8f2bc4bfc0d38
parentd9f1537f738a6bf8a4528ed6005ac6f366877f07 (diff)
downloadtest-definitions-emc.tar.gz
test-definitions-emc.tar.xz
tegra-emc: Add test for the External Memory Controller in Tegra SoCsemc
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
-rw-r--r--kernel/tegra-emc/README.txt3
-rw-r--r--kernel/tegra-emc/profiles.yaml12
-rwxr-xr-xkernel/tegra-emc/scripts/emc-test.py35
-rw-r--r--kernel/tegra-emc/tegra-emc.json53
-rw-r--r--kernel/tegra-emc/tegra-emc.yaml22
5 files changed, 125 insertions, 0 deletions
diff --git a/kernel/tegra-emc/README.txt b/kernel/tegra-emc/README.txt
new file mode 100644
index 0000000..e678b15
--- /dev/null
+++ b/kernel/tegra-emc/README.txt
@@ -0,0 +1,3 @@
+Test for the External Memory Controller on Tegra SoCs
+
+This test checks if the system is able to change the rate of the EMC clock.
diff --git a/kernel/tegra-emc/profiles.yaml b/kernel/tegra-emc/profiles.yaml
new file mode 100644
index 0000000..838f738
--- /dev/null
+++ b/kernel/tegra-emc/profiles.yaml
@@ -0,0 +1,12 @@
+profiles:
+ - name: jetson-tk1
+ variables:
+ device-type: jetson-tk1
+
+ - name: tegra124-nyan-big
+ variables:
+ device-type: tegra124-nyan-big
+
+ - name: tegra124-nyan-blaze
+ variables:
+ device-type: tegra124-nyan-blaze
diff --git a/kernel/tegra-emc/scripts/emc-test.py b/kernel/tegra-emc/scripts/emc-test.py
new file mode 100755
index 0000000..624a3ff
--- /dev/null
+++ b/kernel/tegra-emc/scripts/emc-test.py
@@ -0,0 +1,35 @@
+#!/usr/bin/python2.7
+#
+# Get the kernel to change to each of the frequencies listed in the DT and
+# check that the rate change was effective
+
+import os
+import sys
+
+timings_dir = '/sys/firmware/devicetree/base/clock@0,60006000/emc-timings-1/'
+frequencies = []
+ret = 0
+
+for file_ in os.listdir(timings_dir):
+ if file_.startswith('timing-'):
+ freq = int(file_.split('-')[1])
+ frequencies.append(freq)
+
+frequencies.sort()
+
+for freq in frequencies:
+ f = os.open('/sys/kernel/debug/emc_rate', os.O_WRONLY)
+ os.write(f, str(freq))
+ os.close(f)
+
+ f = os.open('/sys/kernel/debug/clk/emc/clk_rate', os.O_RDONLY)
+ if int(os.read(f, 1024).strip()) == freq:
+ result = 'pass'
+ else:
+ result = 'fail'
+ ret = 1
+ os.close(f)
+
+ print '%d-frequency: %s' % (freq, result)
+
+sys.exit(ret)
diff --git a/kernel/tegra-emc/tegra-emc.json b/kernel/tegra-emc/tegra-emc.json
new file mode 100644
index 0000000..01b377e
--- /dev/null
+++ b/kernel/tegra-emc/tegra-emc.json
@@ -0,0 +1,53 @@
+{
+ "actions": [
+ {
+ "command": "deploy_kernel",
+ "parameters": {
+ "dtb": "{{kernbase}}/{{fdtfile}}.dtb",
+ "kernel": "{{kernbase}}/zImage",
+ "login_commands": [
+ "sudo su"
+ ],
+ "login_prompt": "login:",
+ "password": "collabora",
+ "password_prompt": "Password:",
+ "username": "collabora"
+ }
+ },
+ {
+ "command": "deploy_image",
+ "parameters": {
+ "image": "{{image}}"
+ }
+ },
+ {
+ "command": "boot_image",
+ "parameters": {
+ "options": ["boot_cmds=boot_cmds_image"],
+ "test_image_prompt": "root@singularity"
+ }
+ },
+ {
+ "command": "lava_test_shell",
+ "parameters": {
+ "testdef_repos": [
+ {
+ "git-repo": "{{repobase}}/test-definitions.git",
+ "testdef": "kernel/tegra-emc/tegra-emc.yaml"
+ }
+ ],
+ "timeout": 360
+ }
+ },
+ {
+ "command": "submit_results",
+ "parameters": {
+ "server": "https://lava.collabora.co.uk/RPC2/",
+ "stream": "{{bundle-stream}}"
+ }
+ }
+ ],
+ "device_type": "{{device-type}}",
+ "job_name": "tegra-emc-{{device-type}}",
+ "timeout": 480
+}
diff --git a/kernel/tegra-emc/tegra-emc.yaml b/kernel/tegra-emc/tegra-emc.yaml
new file mode 100644
index 0000000..6597678
--- /dev/null
+++ b/kernel/tegra-emc/tegra-emc.yaml
@@ -0,0 +1,22 @@
+metadata:
+ name: tegra-emc
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "A simple test for EMC scaling on Tegra."
+ maintainer:
+ - tomeu.vizoso@collabora.com
+ scope:
+ - functional
+ devices:
+ - jetson-tk1
+ - tegra124-nyan-big
+ - tegra124-nyan-blaze
+ environment:
+ - lava-test-shell
+
+run:
+ steps:
+ - lava-test-case tegra-emc --shell ./scripts/emc-test.py
+
+parse:
+ pattern: '(?P<test_case_id>\S*):\s+(?P<result>(pass|fail))'
+