diff options
3 files changed, 247 insertions, 0 deletions
diff --git a/meta-crystalforest/recipes-extended/qat/files/00-qat_qa.rules b/meta-crystalforest/recipes-extended/qat/files/00-qat_qa.rules new file mode 100644 index 00000000..7b5b60e6 --- /dev/null +++ b/meta-crystalforest/recipes-extended/qat/files/00-qat_qa.rules | |||
@@ -0,0 +1,3 @@ | |||
1 | KERNEL=="icp_adf_ctl" MODE="0600" | ||
2 | KERNEL=="icp_dev[0-9]*" MODE="0600" | ||
3 | KERNEL=="icp_dev_mem?" MODE="0600" | ||
diff --git a/meta-crystalforest/recipes-extended/qat/files/0001-Fix-for-cross-compilation-issue.patch b/meta-crystalforest/recipes-extended/qat/files/0001-Fix-for-cross-compilation-issue.patch new file mode 100644 index 00000000..6a88b9b3 --- /dev/null +++ b/meta-crystalforest/recipes-extended/qat/files/0001-Fix-for-cross-compilation-issue.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 4b82cbb94e96d0bc982e98149ce971d886c7a937 Mon Sep 17 00:00:00 2001 | ||
2 | From: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> | ||
3 | Date: Mon, 6 Jul 2015 15:57:20 +0800 | ||
4 | Subject: [PATCH] Fix for cross-compilation issue | ||
5 | |||
6 | This patch is used to fix the cross compilation issue. | ||
7 | |||
8 | When compiling the stateless_multi_op_checksum_sample by default it takes | ||
9 | the gcc compiler from host machine. Since we are working on the yocto recipe | ||
10 | implementation we changed the path of the compiler from default gcc | ||
11 | to cross-compiler. | ||
12 | |||
13 | Upstream Status: Inappropriate | ||
14 | |||
15 | Signed-off-by: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> | ||
16 | --- | ||
17 | .../functional/dc/stateless_multi_op_checksum_sample/Makefile | 4 ++-- | ||
18 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/Makefile b/quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/Makefile | ||
21 | index c5cb7bb..c69ce08 100644 | ||
22 | --- a/quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/Makefile | ||
23 | +++ b/quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/Makefile | ||
24 | @@ -98,7 +98,7 @@ else | ||
25 | ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libicp_qa_al_s.so | ||
26 | endif | ||
27 | |||
28 | -ADDITIONAL_OBJECTS += -L/usr/Lib -lpthread -lcrypto | ||
29 | +ADDITIONAL_OBJECTS += -lpthread -lcrypto | ||
30 | |||
31 | USER_SOURCE_FILES = ../../common/cpa_sample_utils.c cpa_dc_stateless_multi_op_checksum_sample.c | ||
32 | USER_SOURCE_FILES += ../../../performance/qae/linux/user_space/qae_mem_utils.c | ||
33 | @@ -108,7 +108,7 @@ USER_INCLUDES= $(INCLUDES) | ||
34 | USER_INCLUDES+= -I../../../performance/qae/ | ||
35 | |||
36 | default: clean | ||
37 | - gcc -Wall -O1 $(USER_INCLUDES) -DUSER_SPACE \ | ||
38 | + $(CC) -Wall -O1 $(USER_INCLUDES) -DUSER_SPACE \ | ||
39 | $(USER_SOURCE_FILES) $(ADDITIONAL_OBJECTS) -o $(OUTPUT_NAME) | ||
40 | |||
41 | clean: | ||
42 | -- | ||
43 | 1.9.1 | ||
44 | |||
diff --git a/meta-crystalforest/recipes-extended/qat/qat.inc b/meta-crystalforest/recipes-extended/qat/qat.inc new file mode 100644 index 00000000..00532042 --- /dev/null +++ b/meta-crystalforest/recipes-extended/qat/qat.inc | |||
@@ -0,0 +1,200 @@ | |||
1 | SUMMARY = "Intel QuickAssist Technology Driver" | ||
2 | DESCRIPTION = "Intel QuickAssist Technology for packet processing acceleration for both Intel Coleto Creek & Cave Creek platforms \ | ||
3 | Software Package. " | ||
4 | |||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
7 | COMPATIBLE_MACHINE = "crystalforest" | ||
8 | DEPENDS += "cryptodev-linux pkgconfig zlib" | ||
9 | |||
10 | MODULE_DIR = "${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers" | ||
11 | ICP_TOOLS = "accelcomp" | ||
12 | |||
13 | S = "${WORKDIR}/${ICP_DRIVER_TYPE}" | ||
14 | B = "${S}/build" | ||
15 | SAMPLE_CODE_DIR = "${S}/quickassist/lookaside/access_layer/src/sample_code" | ||
16 | |||
17 | export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}" | ||
18 | export ICP_ROOT = "${S}" | ||
19 | export ICP_BUILD_OUTPUT = "${B}" | ||
20 | export ICP_BUILDSYSTEM_PATH = "${S}/quickassist/build_system" | ||
21 | export ICP_TOOLS_TARGET = "${ICP_TOOLS}" | ||
22 | export ICP_ENV_DIR = "${S}/quickassist/build_system/build_files/env_files" | ||
23 | export FUNC_PATH = "${ICP_ROOT}/quickassist/lookaside/access_layer/src/sample_code/functional" | ||
24 | |||
25 | HOST[unexport] = "1" | ||
26 | HOST[unexport] = "includedir" | ||
27 | |||
28 | inherit update-rc.d | ||
29 | INITSCRIPT_NAME = "qat_service" | ||
30 | |||
31 | inherit module | ||
32 | DEPENDS += "openssl" | ||
33 | PARALLEL_MAKE = "" | ||
34 | |||
35 | # The list of binary built by QAT package. | ||
36 | |||
37 | LIBS = "\ | ||
38 | libadf_proxy.a \ | ||
39 | libosal.a \ | ||
40 | libicp_qa_al.a \ | ||
41 | libicp_qa_al_s.so \ | ||
42 | " | ||
43 | |||
44 | FUNC_KERNEL_OBJ_LIST = "\ | ||
45 | algchaining_sample.ko \ | ||
46 | ccm_sample.ko \ | ||
47 | cipher_sample.ko \ | ||
48 | dc_dp_sample.ko \ | ||
49 | dc_stateless_multi_op_sample.ko \ | ||
50 | dc_stateless_sample.ko \ | ||
51 | dh_sample.ko \ | ||
52 | drbg_sample.ko \ | ||
53 | gcm_sample.ko \ | ||
54 | hash_sample.ko \ | ||
55 | ipsec_sample.ko \ | ||
56 | nrbg_sample.ko \ | ||
57 | prime_sample.ko \ | ||
58 | ssl_sample.ko \ | ||
59 | sym_dp_sample.ko \ | ||
60 | " | ||
61 | |||
62 | FUNC_USER_APP_LIST = "\ | ||
63 | dh_sample \ | ||
64 | dc_stateful_sample \ | ||
65 | dc_dp_sample \ | ||
66 | cipher_sample \ | ||
67 | sym_dp_sample \ | ||
68 | nrbg_sample \ | ||
69 | drbg_sample \ | ||
70 | dc_stateless_multi_op_sample \ | ||
71 | paper4 \ | ||
72 | hash_file_sample \ | ||
73 | ccm_sample \ | ||
74 | ipsec_sample \ | ||
75 | algchaining_sample \ | ||
76 | ssl_sample \ | ||
77 | dc_stateless_sample \ | ||
78 | hash_sample \ | ||
79 | gcm_sample \ | ||
80 | prime_sample \ | ||
81 | " | ||
82 | |||
83 | do_unpack2() { | ||
84 | cd ${WORKDIR} | ||
85 | tar xvf qatmux.l.${PV}.tar_ | ||
86 | cd ${S}/ | ||
87 | tar xzvf ${ICP_DRIVER_TYPE}.L.${QAT_VERSION}.tar.gz | ||
88 | } | ||
89 | |||
90 | addtask unpack2 after do_unpack before do_patch | ||
91 | |||
92 | do_compile() { | ||
93 | export LD="${LD} --hash-style=gnu" | ||
94 | export MACHINE="${TARGET_ARCH}" | ||
95 | cd ${S}/quickassist | ||
96 | oe_runmake EXTRA_OEMAKE="'CFLAGS=${CFLAGS} -fPIC'" | ||
97 | |||
98 | cd ${SAMPLE_CODE_DIR} | ||
99 | touch ${SAMPLE_CODE_DIR}/performance/compression/calgary | ||
100 | touch ${SAMPLE_CODE_DIR}/performance/compression/canterbury | ||
101 | # build the whole sample code: fips, functional, performance | ||
102 | oe_runmake 'all' | ||
103 | oe_runmake 'fips_user_code' | ||
104 | } | ||
105 | |||
106 | # Overriding do_install() of yocto module.bbclass so that we | ||
107 | # specially handle the ingredients built by QAT | ||
108 | do_install() { | ||
109 | install -d ${D}${base_libdir}/${ICP_FIRMWARE_DIR} \ | ||
110 | ${MODULE_DIR} \ | ||
111 | ${D}${libdir} \ | ||
112 | ${D}${includedir} \ | ||
113 | ${D}${includedir}/dc \ | ||
114 | ${D}${includedir}/lac \ | ||
115 | ${D}${sysconfdir} \ | ||
116 | ${D}${sysconfdir}/init.d \ | ||
117 | ${D}${sysconfdir}/udev/rules.d \ | ||
118 | |||
119 | for i in ${LIBS} | ||
120 | do | ||
121 | install -m 644 ${B}/$i ${D}${libdir}/ | ||
122 | done | ||
123 | |||
124 | install -m 640 ${B}/mof_firmware.bin ${D}${base_libdir}/${ICP_FIRMWARE_DIR}/ | ||
125 | install -m 640 ${B}/mmp_firmware.bin ${D}${base_libdir}/${ICP_FIRMWARE_DIR}/ | ||
126 | install -m 640 ${B}/icp_qa_al.ko ${MODULE_DIR}/ | ||
127 | install -m 660 ${S}/quickassist/config/dh* ${D}${sysconfdir}/ | ||
128 | install -m 0750 ${B}/qat_service ${D}${sysconfdir}/init.d/ | ||
129 | install -m 0750 ${B}/adf_ctl ${D}${sysconfdir}/init.d/ | ||
130 | install -m 0600 ${WORKDIR}/00-qat_qa.rules ${D}${sysconfdir}/udev/rules.d | ||
131 | |||
132 | # QAT include headers are required by intel-dpdk to be built properly | ||
133 | install -m 0766 ${S}/quickassist/include/*.h ${D}${includedir}/ | ||
134 | install -m 0766 ${S}/quickassist/include/dc/*.h ${D}${includedir}/dc/ | ||
135 | install -m 0766 ${S}/quickassist/include/lac/*.h ${D}${includedir}/lac/ | ||
136 | |||
137 | # QAT LAC include headers are required by intel-dpdk to be built properly | ||
138 | install -m 0766 ${S}/quickassist/lookaside/access_layer/include/*.h ${D}${includedir}/ | ||
139 | |||
140 | # Install QAT test application | ||
141 | # Create the destination folder to contain the package content before it is split | ||
142 | install -m 0755 -d ${D}${base_libdir}/firmware \ | ||
143 | ${D}${bindir} \ | ||
144 | |||
145 | # Start putting package ingredient into each file system location | ||
146 | # sample_code/performance | ||
147 | install -m 640 ${SAMPLE_CODE_DIR}/build/*.ko ${MODULE_DIR}/ | ||
148 | install -m 0755 ${SAMPLE_CODE_DIR}/build/cpa_sample_code ${D}${bindir}/ | ||
149 | install -m 640 ${SAMPLE_CODE_DIR}/build/cpa_sample_code_s.so ${D}${libdir}/ | ||
150 | install -m 640 ${SAMPLE_CODE_DIR}/performance/build/linux_2.6/kernel_space/cpa_sample_code.a ${D}${libdir} | ||
151 | |||
152 | # sample_code/fips | ||
153 | install -m 640 ${SAMPLE_CODE_DIR}/fips/build/linux_2.6/kernel_space/fips_sample.ko ${MODULE_DIR}/ | ||
154 | install -m 640 ${SAMPLE_CODE_DIR}/fips/build/linux_2.6/user_space/fips_sample.a ${D}${libdir}/ | ||
155 | install -m 640 ${SAMPLE_CODE_DIR}/fips/build/linux_2.6/user_space/fips_sample_s.so ${D}${libdir}/ | ||
156 | |||
157 | # sample_code/functional | ||
158 | for i in ${FUNC_KERNEL_OBJ_LIST} | ||
159 | do | ||
160 | install -m 640 ${SAMPLE_CODE_DIR}/functional/build/$i ${MODULE_DIR}/ | ||
161 | done | ||
162 | |||
163 | for i in ${FUNC_USER_APP_LIST} | ||
164 | do | ||
165 | install -m 0755 ${SAMPLE_CODE_DIR}/functional/build/$i ${D}/${bindir}/ | ||
166 | done | ||
167 | |||
168 | # Compression Calgary & Canterbury Corpus | ||
169 | install -m 0755 ${SAMPLE_CODE_DIR}/performance/compression/calgary ${D}${base_libdir}/firmware | ||
170 | install -m 0755 ${SAMPLE_CODE_DIR}/performance/compression/canterbury ${D}${base_libdir}/firmware | ||
171 | } | ||
172 | |||
173 | pkg_postinst_${PN}_append () { | ||
174 | if [ -z "$D" ]; then | ||
175 | depmod -a | ||
176 | update-modules || true | ||
177 | fi | ||
178 | } | ||
179 | |||
180 | PACKAGES += "${PN}-app" | ||
181 | |||
182 | FILES_${PN} += "\ | ||
183 | ${base_libdir}/firmware/ \ | ||
184 | ${sysconfdir}/ \ | ||
185 | ${sysconfdir}/ \ | ||
186 | ${sysconfdir}/udev/rules.d/ \ | ||
187 | ${sysconfdir}/init.d/ \ | ||
188 | ${libdir}/ \ | ||
189 | ${includedir}/ \ | ||
190 | " | ||
191 | |||
192 | FILES_${PN}-dbg += " \ | ||
193 | ${sysconfdir}/init.d/.debug \ | ||
194 | " | ||
195 | |||
196 | FILES_${PN}-app += " \ | ||
197 | ${bindir}/* \ | ||
198 | " | ||
199 | |||
200 | FILES_${PN}-staticdev += "${libdir}/*.a" | ||