imx-test: Create 3.10.0 version

Signed-off-by: Lauren Post <lauren.post@freescale.com>
This commit is contained in:
Lauren Post 2013-08-16 15:15:23 -05:00
parent fa0b93cd21
commit 38043e552e
3 changed files with 386 additions and 0 deletions

View File

@ -0,0 +1,344 @@
From c216fa0184d5e651849105a7b5d41f3e54e567b6 Mon Sep 17 00:00:00 2001
From: Lauren Post <lauren.post@freescale.com>
Date: Thu, 13 Jun 2013 09:19:50 -0500
Subject: [PATCH] ENGR00268211 imx-test fixes for breaks in Yocto build
environment
IMX-test recipes fixes to support finding kernel headers and patch to fix
makefiles that break yocto build environment.The patch should be removed
later when it is incorporated into linux-test but is provided now for
testing out of daily build.
Fixes in makefiles to ifdef out yocto changes
Fixes in components not supported in 3.5.7 for IMX6 because of missing
headers so exclude mmc, pf, pmic, rng, sahara, scc
Fix makefiles ar3k, vpu, als
Fix code in memtool
Fix module makefile to remove epdc and complete build
Signed-off-by: Lauren Post <lauren.post@freescale.com>
---
module_test/Makefile | 5 +++++
test/Makefile | 2 ++
test/ar3k_bt/Makefile | 22 +++++++---------------
test/make.rules | 6 +++++-
test/max8660_pmic_test/Makefile | 4 +++-
test/memtool/Makefile | 8 +++++++-
test/memtool/memtool.c | 4 +++-
test/mxc_als_test/Makefile | 2 +-
test/mxc_mmc_test/Makefile | 2 +-
test/mxc_pf_test/Makefile | 2 +-
test/mxc_pmic_test/Makefile | 2 +-
test/mxc_rng_test/Makefile | 5 ++++-
test/mxc_sahara_test/Makefile | 2 +-
test/mxc_scc/Makefile | 2 +-
test/mxc_scc2/Makefile | 2 +-
test/mxc_vpu_test/Makefile | 6 ++++++
16 files changed, 49 insertions(+), 27 deletions(-)
diff --git a/module_test/Makefile b/module_test/Makefile
index cb75eac..48781d0 100644
--- a/module_test/Makefile
+++ b/module_test/Makefile
@@ -19,8 +19,10 @@ ifeq ($(CONFIG_MXC_SDMA_API),y)
module_list-y += mxc_sdma_mem_test.o
endif
ifeq ($(CONFIG_FB_MXC_EINK_PANEL),y)
+ifeq ($(YOCTO_BUILD),0)
module_list-y += epdc_test_driver.o
endif
+endif
ifeq ($(CONFIG_FB_MXC_SIPIX_PANEL),y)
module_list-y += spdc_test_driver.o
endif
@@ -53,6 +55,9 @@ EXTRA_CFLAGS := -DLINUX_KERNEL -DIMX_NEEDS_DEPRECATED_SYMBOLS
## source.
EXTRA_CFLAGS += -I$(LINUXPATH)/drivers/mxc/security -I$(LINUXPATH)/drivers/mxc/security/rng/include -I$(LINUXPATH)/drivers/mxc/security/sahara2/include
+all: obj-m
+ $(MAKE) -C $(LINUXPATH) M=`pwd` KBUILD_OUTPUT=$(KBUILD_OUTPUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) obj-j
+
else
# Need to remove sahara objects because the test app uses same objects
diff --git a/test/Makefile b/test/Makefile
index 8c77c3c..0a28992 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,6 @@
+ifeq ($(YOCTO_BUILD),0)
export INC = -I$(TOPDIR)/include $(INCLUDE)
+endif
# Get all dirs with a Makefile
TMP_DIRS := $(foreach dir, $(wildcard *), $(wildcard $(dir)/Makefile))
diff --git a/test/ar3k_bt/Makefile b/test/ar3k_bt/Makefile
index 242952d..92e2901 100755
--- a/test/ar3k_bt/Makefile
+++ b/test/ar3k_bt/Makefile
@@ -13,25 +13,17 @@ else
OBJS =
endif
-all : $(OBJS)
-
-.PHONY: clean
-clean:
- rm -f $(OBJS)
-
-include ../make.rules
-
-
# If you want to compile the source code, please reference follow make file.
# this is default off by here.
# it will be compile on your target envroioment.(eg, ubuntu).
+all: $(OBJS)
-#CC := gcc
+CFLAGS += -lbluetooth
-#all: hciattach-ar3k
+$(OBJDIR)/hciattach-ar3k.bin :
+ $(CC) ${INC} -Wall -lbluetooth -g hciattach_ath3k.c hciattach.c hciattach_qualcomm.c hciattach_st.c hciattach_tialt.c hciattach_ti.c -o hciattach-ar3k.bin
-#hciattach-ar3k:
-# $(CC) -Wall -lbluetooth -g hciattach_ath3k.c hciattach.c hciattach_qualcomm.c hciattach_st.c hciattach_tialt.c hciattach_ti.c -o hciattach-ar3k
+clean:
+ rm -f *.o hciattach-ar3k.bin
-#clean:
-# rm -f hciattach-ar3k *.o
+include ../make.rules
diff --git a/test/make.rules b/test/make.rules
index cf17d5a..bc1d431 100755
--- a/test/make.rules
+++ b/test/make.rules
@@ -4,6 +4,7 @@ else
VERBOSE=@
endif
+ifeq ($(YOCTO_BUILD),0)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
@@ -16,9 +17,12 @@ OBJDUMP = $(CROSS_COMPILE)objdump
RM = rm -f
MAKEDIR = mkdir -p
+AFLAGS := -D__ASSEMBLY__
+endif
+
CFLAGS += -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fno-strict-aliasing -fno-common
-AFLAGS := -D__ASSEMBLY__
+
$(OBJDIR)/%.o : $(SRCDIR)/%.c
@mkdir -p `dirname $@`
diff --git a/test/max8660_pmic_test/Makefile b/test/max8660_pmic_test/Makefile
index f66a01f..f25108b 100644
--- a/test/max8660_pmic_test/Makefile
+++ b/test/max8660_pmic_test/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX51 IMX37_3STACK IMX31_3STACK IMX31ADS IMX27_3STACK IMX27ADS IMX25_3STACK"
+EXCLUDE_LIST:="IMX51 IMX37_3STACK IMX31_3STACK IMX31ADS IMX27_3STACK IMX27ADS IMX25_3STACK IMX6Q"
LTP_DIR = $(TOPDIR)/test/mxc_pmic_test/
@@ -22,7 +22,9 @@ SUBDIRS = protocol_tests \
pmic_testapp_rtc
all: $(OBJS)
+ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
+endif
libltp.a:
@$(MAKE) -C $(LTP_DIR)lib/ $@
diff --git a/test/memtool/Makefile b/test/memtool/Makefile
index 2acd873..e9524bd 100644
--- a/test/memtool/Makefile
+++ b/test/memtool/Makefile
@@ -1,8 +1,10 @@
# list of platforms which did not want this test case
EXCLUDE_LIST:=
+ifeq ($(YOCTO_BUILD),0)
LINK=$(CROSS_COMPILE)gcc
STRIP=$(CROSS_COMPILE)strip
+endif
OBJ = memtool.o \
mx6dl_modules.o \
@@ -20,12 +22,16 @@ CFLAGS+= -Os
all : $(TARGET)
$(TARGET):$(OBJ)
+ifeq ($(YOCTO_BUILD),1)
+ $(VERBOSE)$(CC) -g $(INC) $(CFLAGS) $(OBJ) $(LIBS) -o $@
+else
$(LINK) -o $(TARGET) $(OBJ) -Os
$(STRIP) $(TARGET)
+endif
.PHONY: clean
clean :
- rm -f $(OBJS)
+ rm -f $(OBJ)
#
# include the Rules
diff --git a/test/memtool/memtool.c b/test/memtool/memtool.c
index 875a71b..21a9531 100644
--- a/test/memtool/memtool.c
+++ b/test/memtool/memtool.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2006-2013 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -235,8 +235,10 @@ void parse_module(char *module, char *reg, char *field, int iswrite)
char *rev;
fd = open("/proc/cpuinfo", O_RDONLY);
+#ifndef YOCTO_BUILD
if (fd < 0)
die("can't open file /proc/cpuinfo\n");
+#endif
n = read(fd, g_buffer, 4095);
if ((rev = strstr(g_buffer, "Revision"))) {
diff --git a/test/mxc_als_test/Makefile b/test/mxc_als_test/Makefile
index 56aaf8a..ece8207 100644
--- a/test/mxc_als_test/Makefile
+++ b/test/mxc_als_test/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:=
+EXCLUDE_LIST:= IMX6Q
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS = $(OBJDIR)/mxc_isl29023.out
diff --git a/test/mxc_mmc_test/Makefile b/test/mxc_mmc_test/Makefile
index 02e5b21..5587b58 100644
--- a/test/mxc_mmc_test/Makefile
+++ b/test/mxc_mmc_test/Makefile
@@ -2,7 +2,7 @@
EXCLUDE_LIST:=
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
-OBJS = $(OBJDIR)/autorun-mmc.sh $(OBJDIR)/autorun-mmc-blockrw.sh $(OBJDIR)/autorun-mmc-fdisk.sh $(OBJDIR)/autorun-mmc-mkfs.sh $(OBJDIR)/autorun-mmc-fs.sh $(OBJDIR)/autorun-mmc-pm.sh
+OBJS = $(OBJDIR)/autorun-mmc.sh $(OBJDIR)/autorun-mmc-blockrw.sh $(OBJDIR)/autorun-mmc-fdisk.sh $(OBJDIR)/autorun-mmc-mkfs.sh $(OBJDIR)/autorun-mmc-fs.sh
else
OBJS =
endif
diff --git a/test/mxc_pf_test/Makefile b/test/mxc_pf_test/Makefile
index 625f9d7..276689c 100644
--- a/test/mxc_pf_test/Makefile
+++ b/test/mxc_pf_test/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX27ADS IMX37_3STACK IMX51 IMX25_3STACK"
+EXCLUDE_LIST:="IMX27ADS IMX37_3STACK IMX51 IMX25_3STACK IMX6Q"
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS = $(OBJDIR)/autorun-pf.sh $(OBJDIR)/mxc_pf_test.out
diff --git a/test/mxc_pmic_test/Makefile b/test/mxc_pmic_test/Makefile
index 062cc9c..47fc1a7 100644
--- a/test/mxc_pmic_test/Makefile
+++ b/test/mxc_pmic_test/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX37_3STACK IMX35_3STACK IMX51"
+EXCLUDE_LIST:="IMX37_3STACK IMX35_3STACK IMX51 IMX6Q"
LTP_DIR = ../
LOADLIBES+= -L$(LTP_DIR)lib -lltp -lpthread -lm
diff --git a/test/mxc_rng_test/Makefile b/test/mxc_rng_test/Makefile
index 3d8b73e..0300a05 100644
--- a/test/mxc_rng_test/Makefile
+++ b/test/mxc_rng_test/Makefile
@@ -5,7 +5,7 @@
#****************************************************************************/
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX27ADS IMX51"
+EXCLUDE_LIST:="IMX27ADS IMX51 IMX6Q"
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS = apitest rng_test move
@@ -51,8 +51,11 @@ CFLAGS += $(OPTFLAGS) -DARM_LINUX -Wall $(INCLUDEDIR)
# In absence of kernel CONFIG flags, set API library to build on
# 'unknown' platform which has an RNGA.
CFLAGS += $(TARGET_ARCH)
+
+ifeq ($(YOCTO_BUILD),0)
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
+endif
all: $(OBJS)
diff --git a/test/mxc_sahara_test/Makefile b/test/mxc_sahara_test/Makefile
index d8bbb2c..5760cfb 100644
--- a/test/mxc_sahara_test/Makefile
+++ b/test/mxc_sahara_test/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:= IMX21ADS IMX31ADS IMX31_3STACK IMX35_3STACK IMX37_3STACK IMX25_3STACK IMX50
+EXCLUDE_LIST:= IMX21ADS IMX31ADS IMX31_3STACK IMX35_3STACK IMX37_3STACK IMX25_3STACK IMX50 IMX6Q
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS= apitest
diff --git a/test/mxc_scc/Makefile b/test/mxc_scc/Makefile
index b2e6cb4..c08037b 100644
--- a/test/mxc_scc/Makefile
+++ b/test/mxc_scc/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX21ADS MXC30031ADS IMX233 IMX37_3STACK IMX51 IMX50"
+EXCLUDE_LIST:="IMX21ADS MXC30031ADS IMX233 IMX37_3STACK IMX51 IMX50 IMX6Q"
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS = $(OBJDIR)/scc_test
diff --git a/test/mxc_scc2/Makefile b/test/mxc_scc2/Makefile
index f3b74e6..6982257 100644
--- a/test/mxc_scc2/Makefile
+++ b/test/mxc_scc2/Makefile
@@ -1,5 +1,5 @@
# list of platforms which did not want this test case
-EXCLUDE_LIST:="IMX21ADS IMX27ADS IMX31ADS IMX31_3STACK IMX35_3STACK IMX25_3STACK IMX233 IMX50"
+EXCLUDE_LIST:="IMX21ADS IMX27ADS IMX31ADS IMX31_3STACK IMX35_3STACK IMX25_3STACK IMX233 IMX50 IMX6Q"
ifeq (,$(findstring $(PLATFORM), $(EXCLUDE_LIST)))
OBJS = $(OBJDIR)/scc2_test.out
diff --git a/test/mxc_vpu_test/Makefile b/test/mxc_vpu_test/Makefile
index a3a38c9..a644711 100644
--- a/test/mxc_vpu_test/Makefile
+++ b/test/mxc_vpu_test/Makefile
@@ -1,5 +1,7 @@
+ifeq ($(YOCTO_BUILD),0)
CC=$(CROSS_COMPILE)gcc
LINK=$(CROSS_COMPILE)gcc
+endif
OBJ = main.o \
dec.o \
@@ -23,7 +25,11 @@ endif
all: $(TARGET)
$(TARGET): $(OBJ)
+ifeq ($(YOCTO_BUILD),1)
+ $(VERBOSE) $(CC) -o $(TARGET) $(OBJ) ${LIBS} -lvpu -lipu -lrt -lpthread
+else
$(LINK) -o $(TARGET) $(OBJ) ${LIBS} -lvpu -lipu -lrt -lpthread
+endif
mkdir -p $(OBJDIR)
mv $(TARGET) $(OBJDIR)
cp autorun-vpu.sh $(OBJDIR)
--
1.7.9.5

View File

@ -0,0 +1,29 @@
#!/bin/bash
# This script is taken directly from the section 5.10 of the Freescale Application Note
# AN4509 and it simple prints the CPU clocks in a nice format
saved_path=$PWD
if ! mount|grep -sq '/sys/kernel/debug'; then
mount -t debugfs none /sys/kernel/debug
fi
printf "%-24s %-20s %3s %9s\n" "clock" "parent" "use" "flags" "rate"
for foo in $(find /sys/kernel/debug/clock -type d); do
if [ "$foo" = '/sys/kernel/debug/clock' ]; then
continue
fi
cd $foo
ec="$(cat usecount)"
rate="$(cat rate)"
flag="$(cat flags)"
clk="$(basename $foo)"
cd ..
parent="$(basename $PWD)"
if [ "$parent" = 'clock' ]; then
parent=" ---"
fi
printf "%-24s %-24s %2d %2d %10d\n" "$clk" "$parent" "$ec" "$flag" "$rate"
cd $saved_path
done

View File

@ -0,0 +1,13 @@
# Copyright (C) 2013 Freescale Semiconductor
require recipes-bsp/imx-test/imx-test.inc
SRC_URI = "${FSL_MIRROR}/imx-test-${PV}-1.0.0.tar.gz \
file://clocks.sh \
file://0001-ENGR00268211-imx-test-fixes-for-breaks-in-Yocto-buil.patch"
SRC_URI[md5sum] = "1c2dc20419acba21064b65096c892ac6"
SRC_URI[sha256sum] = "be9d539eacd16f95438d04a9aa352dca58d7166e113c2fe68c2487e860063001"
S = "${WORKDIR}/${PN}-${PV}-1.0.0"
COMPATIBLE_MACHINE = "(mx6)"