summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvenkatasubramanian pattu <venkatasubramanianx.pattu@intel.com>2015-07-10 10:57:41 (GMT)
committerSaul Wold <sgw@linux.intel.com>2015-07-10 20:52:27 (GMT)
commit0a8aec830bacab002c61065d6ea708c3fd498d93 (patch)
treea6e7aae02e1f0cb57812718e874c323b87b6106a
parente9e51dc8928389cdb6a59e3969cf4d53aa9e8233 (diff)
downloadmeta-intel-0a8aec830bacab002c61065d6ea708c3fd498d93.tar.gz
meta-crystalforest: Zlib QAT_MEM MM Module
The zlib software library and the Intel QuickAssist Technology both implement the deflate algorithm as described in RFC 1951. This software accelerates the data compression algorithm in the zlib software library via the Intel QuickAssist Technology implemented on Intel Communications Chipsets. Signed-off-by: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> (Imported from meta-intel commit 3ee02a36e0d1126fda0c6ea6a1bef4db08b8be7a) Changed the kernel module build patch to align with fido to make sure that the kernel module compiles. Added KERNEL_BUILDDIR to point to kernel build. Signed-off-by: Anuj Mittal <anujx.mittal@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r--meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb111
-rw-r--r--meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch51
2 files changed, 162 insertions, 0 deletions
diff --git a/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb
new file mode 100644
index 0000000..514a15d
--- /dev/null
+++ b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb
@@ -0,0 +1,111 @@
1SUMMARY = "Zlib QAT_MEM Memory Management Module for Intel Quick Assist \
2Technology"
3
4DESCRIPTION = "This software acelerates the data compression algorithm \
5in the zlib software library via the Intel QuickAssist Technology \
6implemented on Intel Communications Chipset 89xx and 895x Series based platforms."
7
8HOMEPAGE = "http://zlib.net/"
9SECTION = "libs"
10LICENSE = "Zlib & GPLv2 & BSD"
11LIC_FILES_CHKSUM = "file://${WORKDIR}/zlib-${ZLIB_VERSION}/zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd \
12 file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
13 file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb"
14
15# For target side versions of openssl enable support for OCF Linux driver
16# if they are available.
17DEPENDS += "cryptodev-linux pkgconfig qat16"
18
19SRC_URI = "http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz;name=zlib \
20 https://01.org/sites/default/files/page/zlib_shim_0.4.7-002_withdocumentation.zip;name=zlibqat \
21 file://zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch \
22 "
23
24SRC_URI[zlib.md5sum] = "44d667c142d7cda120332623eab69f40"
25SRC_URI[zlib.sha256sum] = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d"
26
27SRC_URI[zlibqat.md5sum] = "dfde8618198aa8d35ecc00d10dcc7000"
28SRC_URI[zlibqat.sha256sum] = "8e5786400bbc2a879ae705c864ec63b53ae019b4f2d1c94524a97223847b6e46"
29
30ZLIB_VERSION = "1.2.8"
31ZLIB_QAT_VERSION = "0.4.7-002"
32
33S = "${WORKDIR}/zlib-${ZLIB_VERSION}"
34
35export ICP_ROOT = "${PKG_CONFIG_SYSROOT_DIR}"
36export ZLIB_ROOT = "${S}"
37export ICP_ZLIBQAT = "${S}"
38export ICP_BUILD_OUTPUT = "${ICP_ROOT}/lib"
39export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}"
40export KERNEL_BUILDDIR = "${STAGING_KERNEL_BUILDDIR}"
41
42CFLAGS += "\
43 -I${ICP_ROOT}/usr/include \
44 -I${ICP_ROOT}/usr/include/dc \
45 -I${ZLIB_ROOT}/ \
46 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -DUSE_QAT_MEM -I${ZLIB_ROOT}/contrib/qat/qat_mem -D_GNU_SOURCE \
47 -L${ZLIB_ROOT} -lz \
48 -L${ICP_ROOT}/usr/lib/ -lpthread -lcrypto -ldl -lrt \
49 -L${ICP_ROOT}/usr/lib/ -licp_qa_al -losal -ladf_proxy"
50
51inherit module
52MODULE_DIR = "${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers"
53MEM_PATH = "${S}/contrib/qat"
54
55do_unpack2(){
56 cd ${WORKDIR}/
57 unzip zlib_quickassist_patch_l.0.4.7_002_stable.zip
58 cd zlib_quickassist_patch_l.0.4.7_002_devbranch
59 tar -xvzf zlib-1.2.8-qat.L.0.4.7-002.tar.gz
60 cp zlib-1.2.8-qat.patch ${WORKDIR}
61}
62
63addtask unpack2 after do_unpack before do_patch
64
65do_patch() {
66 cd ${S}
67 patch -p1 < ${WORKDIR}/zlib-1.2.8-qat.patch
68 patch -p1 < ${WORKDIR}/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch
69}
70
71do_configure() {
72 cd ${S}
73 ./configure
74}
75
76do_compile() {
77 EXTRA_OEMAKE="'CFLAGS=${CFLAGS} -fPIC'"
78 cd ${MEM_PATH}/qat_mem/
79 oe_runmake
80 cd ${S}/
81 oe_runmake
82 cd ${MEM_PATH}/qat_zlib_test/
83 oe_runmake
84}
85
86do_install() {
87 chrpath -d ${MEM_PATH}/qat_zlib_test/comptestapp
88 install -m 0755 -d ${MODULE_DIR}/
89 install -m 0755 -d ${D}${bindir}/
90 install -m 0755 -d ${D}${sysconfdir}/zlib_conf/
91 install -m 640 ${MEM_PATH}/qat_mem/qat_mem.ko ${MODULE_DIR}/
92 install -m 0755 ${WORKDIR}/zlib-${ZLIB_VERSION}/zpipe ${D}${bindir}/
93 install -m 0755 ${WORKDIR}/zlib-${ZLIB_VERSION}/minigzip ${D}${bindir}/
94 install -m 0755 ${MEM_PATH}/qat_zlib_test/comptestapp ${D}${bindir}/
95 install -m 660 ${MEM_PATH}/config/dh895xcc/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/
96 install -m 660 ${MEM_PATH}/config/dh89xxcc/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/
97}
98
99PACKAGES += "${PN}-app"
100
101FILES_${PN} += " \
102 ${sysconfdir}/zlib_conf/ \
103 "
104
105FILES_${PN}-app += " \
106 ${bindir}/* \
107 "
108
109FILES_${PN}-dbg += " \
110 ${bindir}/.debug \
111 "
diff --git a/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch
new file mode 100644
index 0000000..9e774db
--- /dev/null
+++ b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.7-002-qat_mem-build-qat_mem-ko-against-yocto-kernel-src.patch
@@ -0,0 +1,51 @@
1From aa65d69632142d24ec44ed4c2d66371e1a1be7b4 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anujx.mittal@intel.com>
3Date: Thu, 18 Jun 2015 11:56:08 +0800
4Subject: [PATCH] qat_mem: build qat_mem ko against yocto kernel src
5
6Upstream-Status: Inappropriate [Configuration]
7
8This tweaks the kernel source and build path in the makefile
9to make sure the module is built against the right source.
10
11Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
12---
13 contrib/qat/qat_mem/Makefile | 13 +++++--------
14 1 file changed, 5 insertions(+), 8 deletions(-)
15
16diff --git a/contrib/qat/qat_mem/Makefile b/contrib/qat/qat_mem/Makefile
17index ddf5b59..ad6d4a4 100644
18--- a/contrib/qat/qat_mem/Makefile
19+++ b/contrib/qat/qat_mem/Makefile
20@@ -61,16 +61,10 @@
21 #########################################################################
22
23 MODULENAME := qat_mem
24-KDIR := /lib/modules/$(shell uname -r)/build
25+KDIR := $(KERNEL_SOURCE_ROOT)
26 PWD := $(shell pwd)
27
28-ifeq ($(shell uname -r|grep -c grsec-WR), 1)
29-AUTO_CONF=/lib/modules/$(shell uname -r)/build/include/generated/autoconf.h
30-else
31-AUTO_CONF=/usr/src/kernels/$(shell uname -r)/include/linux/autoconf.h
32-endif
33-
34-CC := gcc -Wall -imacros $(AUTO_CONF)
35+CC := ${CC} -Wall -imacros $(KERNEL_BUILDDIR)/include/generated/autoconf.h
36
37 ifeq ($(KERNELRELEASE),)
38 all: $(MODULENAME)_test
39@@ -80,6 +74,9 @@ else
40 obj-m := $(MODULENAME).o
41 endif
42
43+modules_install:
44+ $(MAKE) -C $(KDIR) M=$(PWD) modules_install
45+
46 $(MODULENAME)_test: $(MODULENAME)_test.c
47 $(CC) -g -o $(MODULENAME)_test $(MODULENAME)_test.c
48
49--
501.7.9.5
51