summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Riedmueller <s.riedmueller@phytec.de>2018-07-19 16:34:44 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2018-07-19 17:00:29 +0200
commit89b886987e19f8dbd0e4ae23eb19fcb1c4656bbc (patch)
tree230d023112d0209375a78bb5cfa07e2a348e7b26
parent632f9c5c0cc8eb28b5e350b742435bee5afeb6f3 (diff)
downloadmeta-phytec-89b886987e19f8dbd0e4ae23eb19fcb1c4656bbc.tar.bz2
meta-phytec-89b886987e19f8dbd0e4ae23eb19fcb1c4656bbc.zip
recipes-devtools: mmdc: Fix system revision check
Without this patch the mmdc tool fails to evaluate profiling for VPU and GPU. This is fixed by changing the system revision check of the tool since the upcoming kernel has no longer zero in the /proc/cpuinfo Revision but the SOC revision of the i.MX 6. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--recipes-devtools/mmdc/mmdc/0001-mmdc.c-Fix-revision-check-against-old-kernel-version.patch34
-rw-r--r--recipes-devtools/mmdc/mmdc_git.bb6
2 files changed, 39 insertions, 1 deletions
diff --git a/recipes-devtools/mmdc/mmdc/0001-mmdc.c-Fix-revision-check-against-old-kernel-version.patch b/recipes-devtools/mmdc/mmdc/0001-mmdc.c-Fix-revision-check-against-old-kernel-version.patch
new file mode 100644
index 0000000..2b7f33a
--- /dev/null
+++ b/recipes-devtools/mmdc/mmdc/0001-mmdc.c-Fix-revision-check-against-old-kernel-version.patch
@@ -0,0 +1,34 @@
+From d7db9bda759e9847da91ce26cc410f080e04c513 Mon Sep 17 00:00:00 2001
+From: Stefan Riedmueller <s.riedmueller@phytec.de>
+Date: Thu, 19 Jul 2018 15:10:43 +0200
+Subject: [PATCH] mmdc.c: Fix revision check against old kernel version
+
+With current kernel versions the revision info of /proc/cpuinfo can hold
+the SOC revision number. So we can not check against zero in revision of
+/proc/cpuinfo if we want to determine if the kernel is new (> 3.10.9).
+Since the /proc/cpuinfo holds values greater 0x1000 as SOC version for
+the i.MX 6 in kernels < 3.10.9 we can us this.
+
+This fixes an issue where the tool cannot work with VPU or GPU.
+
+Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
+---
+ mmdc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mmdc.c b/mmdc.c
+index 158622cea4e8..c95eee3e4402 100644
+--- a/mmdc.c
++++ b/mmdc.c
+@@ -186,7 +186,7 @@ static int get_system_rev(void)
+ }
+
+ //cpuinfo is changed in 3.10.9 kernel, new way is used.
+- if((ret == 0) && (system_rev ==0))
++ if((ret == 0) && (system_rev < 0x1000))
+ {
+ ret = -1;
+ fp = fopen("/sys/devices/soc0/soc_id", "r");
+--
+2.7.4
+
diff --git a/recipes-devtools/mmdc/mmdc_git.bb b/recipes-devtools/mmdc/mmdc_git.bb
index 6870a5a..017aa43 100644
--- a/recipes-devtools/mmdc/mmdc_git.bb
+++ b/recipes-devtools/mmdc/mmdc_git.bb
@@ -2,13 +2,17 @@ DESCRIPTION = "A Freescale tool to profile memory controller bandwidth on i.MX6"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://mmdc.c;beginline=5;endline=12;md5=49e09642208485988b5c22074c896653"
-SRC_URI = "git://github.com/FrankBau/mmdc;protocol=https"
+SRC_URI = "git://github.com/FrankBau/mmdc;protocol=https \
+ file://0001-mmdc.c-Fix-revision-check-against-old-kernel-version.patch \
+ "
PV = "1.0+git${SRCPV}"
SRCREV = "603e23e1c8e34773218e1820a1d17164ab9d9732"
S = "${WORKDIR}/git"
+PATCHTOOL = "git"
+
do_compile () {
${CC} ${CFLAGS} ${LDFLAGS} -o mmdc mmdc.c
}