summaryrefslogtreecommitdiffstats
path: root/meta-crystalforest/recipes-extended/qat/qat.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-crystalforest/recipes-extended/qat/qat.inc')
-rw-r--r--meta-crystalforest/recipes-extended/qat/qat.inc200
1 files changed, 200 insertions, 0 deletions
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 @@
1SUMMARY = "Intel QuickAssist Technology Driver"
2DESCRIPTION = "Intel QuickAssist Technology for packet processing acceleration for both Intel Coleto Creek & Cave Creek platforms \
3Software Package. "
4
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
7COMPATIBLE_MACHINE = "crystalforest"
8DEPENDS += "cryptodev-linux pkgconfig zlib"
9
10MODULE_DIR = "${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers"
11ICP_TOOLS = "accelcomp"
12
13S = "${WORKDIR}/${ICP_DRIVER_TYPE}"
14B = "${S}/build"
15SAMPLE_CODE_DIR = "${S}/quickassist/lookaside/access_layer/src/sample_code"
16
17export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}"
18export ICP_ROOT = "${S}"
19export ICP_BUILD_OUTPUT = "${B}"
20export ICP_BUILDSYSTEM_PATH = "${S}/quickassist/build_system"
21export ICP_TOOLS_TARGET = "${ICP_TOOLS}"
22export ICP_ENV_DIR = "${S}/quickassist/build_system/build_files/env_files"
23export FUNC_PATH = "${ICP_ROOT}/quickassist/lookaside/access_layer/src/sample_code/functional"
24
25HOST[unexport] = "1"
26HOST[unexport] = "includedir"
27
28inherit update-rc.d
29INITSCRIPT_NAME = "qat_service"
30
31inherit module
32DEPENDS += "openssl"
33PARALLEL_MAKE = ""
34
35# The list of binary built by QAT package.
36
37LIBS = "\
38 libadf_proxy.a \
39 libosal.a \
40 libicp_qa_al.a \
41 libicp_qa_al_s.so \
42 "
43
44FUNC_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
62FUNC_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
83do_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
90addtask unpack2 after do_unpack before do_patch
91
92do_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
108do_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
173pkg_postinst_${PN}_append () {
174 if [ -z "$D" ]; then
175 depmod -a
176 update-modules || true
177 fi
178}
179
180PACKAGES += "${PN}-app"
181
182FILES_${PN} += "\
183 ${base_libdir}/firmware/ \
184 ${sysconfdir}/ \
185 ${sysconfdir}/ \
186 ${sysconfdir}/udev/rules.d/ \
187 ${sysconfdir}/init.d/ \
188 ${libdir}/ \
189 ${includedir}/ \
190 "
191
192FILES_${PN}-dbg += " \
193 ${sysconfdir}/init.d/.debug \
194 "
195
196FILES_${PN}-app += " \
197 ${bindir}/* \
198 "
199
200FILES_${PN}-staticdev += "${libdir}/*.a"