source: trunk/package/kernel/modules/crypto.mk @ 17906

Last change on this file since 17906 was 17906, checked in by agb, 7 years ago

[kernel] modules/crypto: package AMCC ppc4xx hardware crypto driver

  • Property svn:copyright set to Copyright (C) 2007 OpenWrt.org
File size: 10.0 KB
Line 
1#
2# Copyright (C) 2006-2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8CRYPTO_MENU:=Cryptographic API modules
9
10# XXX: added workarounds for modules renamed in 2.6 series:
11#  - aes > aes_generic (2.6.24)
12#  - blkcipher -> crypto_blkcipher (2.6.25)
13#  - des > des_generic (2.6.24)
14#  - sha1 > sha1_generic (2.6.24)
15#  - sha256 > sha256_generic (2.6.24)
16#  - sha512 > sha512_generic (2.6.26)
17ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.24)),1)
18  CRYPTO_GENERIC:=_generic
19  AES_SUFFIX:=$(CRYPTO_GENERIC)
20  DES_SUFFIX:=$(CRYPTO_GENERIC)
21  SHA1_SUFFIX:=$(CRYPTO_GENERIC)
22  SHA256_SUFFIX:=$(CRYPTO_GENERIC)
23endif
24ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.25)),1)
25  CRYPTO_PREFIX:=crypto_
26  BLKCIPHER_PREFIX:=$(CRYPTO_PREFIX)
27endif
28ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.26)),1)
29  SHA512_SUFFIX:=$(CRYPTO_GENERIC)
30endif
31AEAD_CONF:=AEAD
32MANAGER_CONF:=MANAGER
33BLKCIPHER_CONF:=BLKCIPHER
34HASH_CONF:=HASH
35ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.30)),1)
36  CRYPTO_MODULE_PCOMPRESS:=PCOMP=pcompress
37  AEAD_CONF:=AEAD2
38  MANAGER_CONF:=MANAGER2
39  BLKCIPHER_CONF:=BLKCIPHER2
40  HASH_CONF:=HASH2
41endif
42
43CRYPTO_MODULES = \
44        ALGAPI=crypto_algapi \
45        $(AEAD_CONF)=aead \
46        $(CRYPTO_MODULE_PCOMPRESS) \
47        $(BLKCIPHER_CONF)=$(BLKCIPHER_PREFIX)blkcipher \
48        $(HASH_CONF)=crypto_hash \
49        $(MANAGER_CONF)=cryptomgr \
50        CBC=cbc \
51        ECB=ecb \
52        DEFLATE=deflate
53
54crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
55crypto_file=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).$(LINUX_KMOD_SUFFIX))
56crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1))))
57
58# XXX: added CONFIG_CRYPTO_HMAC to KCONFIG so that CONFIG_CRYPTO_HASH is
59# always set, even if no hash modules are selected
60define KernelPackage/crypto-core
61  SUBMENU:=$(CRYPTO_MENU)
62  TITLE:=Core CryptoAPI modules
63  KCONFIG:=CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
64  FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
65  AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))))
66endef
67
68define KernelPackage/crypto-core/2.4
69  FILES:=$(LINUX_DIR)/crypto/deflate.$(LINUX_KMOD_SUFFIX)
70  AUTOLOAD:=$(call AutoLoad,01, deflate)
71endef
72
73$(eval $(call KernelPackage,crypto-core))
74
75
76define KernelPackage/crypto-hw-padlock
77  SUBMENU:=$(CRYPTO_MENU)
78  TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
79  DEPENDS:=+kmod-crypto-core
80  KCONFIG:= \
81        CONFIG_CRYPTO_HW=y \
82        CONFIG_CRYPTO_DEV_PADLOCK \
83        CONFIG_CRYPTO_DEV_PADLOCK_AES \
84        CONFIG_CRYPTO_DEV_PADLOCK_SHA
85  FILES:= \
86        $(LINUX_DIR)/drivers/crypto/padlock-aes.$(LINUX_KMOD_SUFFIX) \
87        $(LINUX_DIR)/drivers/crypto/padlock-sha.$(LINUX_KMOD_SUFFIX)
88  AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha)
89endef
90
91$(eval $(call KernelPackage,crypto-hw-padlock))
92
93
94define KernelPackage/crypto-hw-geode
95  SUBMENU:=$(CRYPTO_MENU)
96  TITLE:=AMD Geode hardware crypto module
97  DEPENDS:=+kmod-crypto-core
98  KCONFIG:= \
99        CONFIG_CRYPTO_HW=y \
100        CONFIG_CRYPTO_DEV_GEODE
101  FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.$(LINUX_KMOD_SUFFIX)
102  AUTOLOAD:=$(call AutoLoad,09,geode-aes)
103endef
104
105$(eval $(call KernelPackage,crypto-hw-geode))
106
107
108define KernelPackage/crypto-hw-hifn-795x
109  SUBMENU:=$(CRYPTO_MENU)
110  TITLE:=HIFN 795x crypto accelerator
111  DEPENDS:=+kmod-crypto-core +kmod-crypto-des
112  KCONFIG:= \
113        CONFIG_CRYPTO_HW=y \
114        CONFIG_CRYPTO_DEV_HIFN_795X \
115        CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
116  FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.$(LINUX_KMOD_SUFFIX)
117  AUTOLOAD:=$(call AutoLoad,09,hifn_795x)
118endef
119
120$(eval $(call KernelPackage,crypto-hw-hifn-795x))
121
122
123define KernelPackage/crypto-hw-ixp4xx
124  SUBMENU:=$(CRYPTO_MENU)
125  TITLE:=Intel IXP4xx hardware crypto module
126  DEPENDS:= \
127        @TARGET_ixp4xx +kmod-crypto-core +kmod-crypto-des +kmod-crypto-authenc
128  KCONFIG:= \
129        CONFIG_CRYPTO_HW=y \
130        CONFIG_CRYPTO_DEV_IXP4XX
131  FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.$(LINUX_KMOD_SUFFIX)
132  AUTOLOAD:=$(call AutoLoad,90,ixp4xx_crypto)
133endef
134
135define KernelPackage/crypto-hw-ixp4xx/description
136  Kernel support for the Intel IXP4xx HW crypto engine.
137endef
138
139$(eval $(call KernelPackage,crypto-hw-ixp4xx))
140
141
142define KernelPackage/crypto-hw-ppc4xx
143  SUBMENU:=$(CRYPTO_MENU)
144  TITLE:=AMCC PPC4xx hardware crypto module
145  DEPENDS:= \
146        @TARGET_ppc40x||TARGET_ppc44x +kmod-crypto-core
147  KCONFIG:= \
148        CONFIG_CRYPTO_HW=y \
149        CONFIG_CRYPTO_DEV_PPC4XX
150  FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.$(LINUX_KMOD_SUFFIX)
151  AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
152endef
153
154define KernelPackage/crypto-hw-ppc4xx/description
155  Kernel support for the AMCC PPC4xx HW crypto engine.
156endef
157
158$(eval $(call KernelPackage,crypto-hw-ppc4xx))
159
160
161define KernelPackage/crypto-aes
162  SUBMENU:=$(CRYPTO_MENU)
163  TITLE:=AES cipher CryptoAPI module
164  DEPENDS:=+kmod-crypto-core
165  KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
166  FILES:=$(LINUX_DIR)/crypto/aes$(AES_SUFFIX).$(LINUX_KMOD_SUFFIX)
167  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX))
168endef
169
170define KernelPackage/crypto-aes/x86-2.6
171  FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX)
172  AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586)
173endef
174
175$(eval $(call KernelPackage,crypto-aes))
176
177
178define KernelPackage/crypto-arc4
179  SUBMENU:=$(CRYPTO_MENU)
180  TITLE:=ARC4 (RC4) cipher CryptoAPI module
181  DEPENDS:=+kmod-crypto-core
182  KCONFIG:=CONFIG_CRYPTO_ARC4
183  FILES:=$(LINUX_DIR)/crypto/arc4.$(LINUX_KMOD_SUFFIX)
184  AUTOLOAD:=$(call AutoLoad,09,arc4)
185endef
186
187$(eval $(call KernelPackage,crypto-arc4))
188
189
190define KernelPackage/crypto-authenc
191  SUBMENU:=$(CRYPTO_MENU)
192  TITLE:=Combined mode wrapper for IPsec
193  DEPENDS:=+kmod-crypto-core
194  KCONFIG:=CONFIG_CRYPTO_AUTHENC
195  FILES:=$(LINUX_DIR)/crypto/authenc.$(LINUX_KMOD_SUFFIX)
196  AUTOLOAD:=$(call AutoLoad,09,authenc)
197endef
198
199$(eval $(call KernelPackage,crypto-authenc))
200
201define KernelPackage/crypto-des
202  SUBMENU:=$(CRYPTO_MENU)
203  TITLE:=DES/3DES cipher CryptoAPI module
204  DEPENDS:=+kmod-crypto-core
205  KCONFIG:=CONFIG_CRYPTO_DES
206  FILES:=$(LINUX_DIR)/crypto/des$(DES_SUFFIX).$(LINUX_KMOD_SUFFIX)
207  AUTOLOAD:=$(call AutoLoad,09,des$(DES_SUFFIX))
208endef
209
210$(eval $(call KernelPackage,crypto-des))
211
212
213define KernelPackage/crypto-hmac
214  SUBMENU:=$(CRYPTO_MENU)
215  TITLE:=HMAC digest CryptoAPI module
216  DEPENDS:=+kmod-crypto-core
217  KCONFIG:=CONFIG_CRYPTO_HMAC
218  FILES:=$(LINUX_DIR)/crypto/hmac.$(LINUX_KMOD_SUFFIX)
219  AUTOLOAD:=$(call AutoLoad,09,hmac)
220endef
221
222$(eval $(call KernelPackage,crypto-hmac))
223
224
225define KernelPackage/crypto-md5
226  SUBMENU:=$(CRYPTO_MENU)
227  TITLE:=MD5 digest CryptoAPI module
228  DEPENDS:=+kmod-crypto-core
229  KCONFIG:=CONFIG_CRYPTO_MD5
230  FILES:=$(LINUX_DIR)/crypto/md5.$(LINUX_KMOD_SUFFIX)
231  AUTOLOAD:=$(call AutoLoad,09,md5)
232endef
233
234$(eval $(call KernelPackage,crypto-md5))
235
236
237define KernelPackage/crypto-michael-mic
238  SUBMENU:=$(CRYPTO_MENU)
239  TITLE:=Michael MIC keyed digest CryptoAPI module
240  DEPENDS:=+kmod-crypto-core
241  KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC
242  FILES:=$(LINUX_DIR)/crypto/michael_mic.$(LINUX_KMOD_SUFFIX)
243  AUTOLOAD:=$(call AutoLoad,09,michael_mic)
244endef
245
246$(eval $(call KernelPackage,crypto-michael-mic))
247
248
249define KernelPackage/crypto-sha1
250  SUBMENU:=$(CRYPTO_MENU)
251  TITLE:=SHA1 digest CryptoAPI module
252  DEPENDS:=+kmod-crypto-core
253  KCONFIG:=CONFIG_CRYPTO_SHA1
254  FILES:=$(LINUX_DIR)/crypto/sha1$(SHA1_SUFFIX).$(LINUX_KMOD_SUFFIX)
255  AUTOLOAD:=$(call AutoLoad,09,sha1$(SHA1_SUFFIX))
256endef
257
258$(eval $(call KernelPackage,crypto-sha1))
259
260
261define KernelPackage/crypto-misc
262  SUBMENU:=$(CRYPTO_MENU)
263  TITLE:=Other CryptoAPI modules
264  DEPENDS:=+kmod-crypto-core
265  KCONFIG:= \
266        CONFIG_CRYPTO_ANUBIS \
267        CONFIG_CRYPTO_BLOWFISH \
268        CONFIG_CRYPTO_CAMELLIA \
269        CONFIG_CRYPTO_CAST5 \
270        CONFIG_CRYPTO_CAST6 \
271        CONFIG_CRYPTO_CRC32C \
272        CONFIG_CRYPTO_FCRYPT \
273        CONFIG_CRYPTO_KHAZAD \
274        CONFIG_CRYPTO_MD4 \
275        CONFIG_CRYPTO_SERPENT \
276        CONFIG_CRYPTO_SHA256 \
277        CONFIG_CRYPTO_SHA512 \
278        CONFIG_CRYPTO_TEA \
279        CONFIG_CRYPTO_TGR192 \
280        CONFIG_CRYPTO_TWOFISH \
281        CONFIG_CRYPTO_TWOFISH_586 \
282        CONFIG_CRYPTO_WP512
283  FILES:= \
284        $(LINUX_DIR)/crypto/anubis.$(LINUX_KMOD_SUFFIX) \
285        $(LINUX_DIR)/crypto/blowfish.$(LINUX_KMOD_SUFFIX) \
286        $(LINUX_DIR)/crypto/cast5.$(LINUX_KMOD_SUFFIX) \
287        $(LINUX_DIR)/crypto/cast6.$(LINUX_KMOD_SUFFIX) \
288        $(LINUX_DIR)/crypto/khazad.$(LINUX_KMOD_SUFFIX) \
289        $(LINUX_DIR)/crypto/md4.$(LINUX_KMOD_SUFFIX) \
290        $(LINUX_DIR)/crypto/serpent.$(LINUX_KMOD_SUFFIX) \
291        $(LINUX_DIR)/crypto/sha256$(SHA256_SUFFIX).$(LINUX_KMOD_SUFFIX) \
292        $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \
293        $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \
294        $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \
295        $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX)
296endef
297
298define KernelPackage/crypto-misc/2.6
299  FILES+= \
300        $(LINUX_DIR)/crypto/camellia.$(LINUX_KMOD_SUFFIX) \
301        $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \
302        $(LINUX_DIR)/crypto/fcrypt.$(LINUX_KMOD_SUFFIX) \
303        $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX)
304endef
305
306$(eval $(call KernelPackage,crypto-misc))
307
308define KernelPackage/crypto-ocf
309  SUBMENU:=$(CRYPTO_MENU)
310  TITLE:=OCF modules
311  DEPENDS:=+kmod-crypto-core @!TARGET_uml
312  KCONFIG:= \
313        CONFIG_OCF_OCF \
314        CONFIG_OCF_CRYPTODEV \
315        CONFIG_OCF_CRYPTOSOFT \
316        CONFIG_OCF_FIPS=y \
317        CONFIG_OCF_RANDOMHARVEST=y
318  FILES:= \
319        $(LINUX_DIR)/crypto/ocf/ocf.$(LINUX_KMOD_SUFFIX) \
320        $(LINUX_DIR)/crypto/ocf/cryptodev.$(LINUX_KMOD_SUFFIX) \
321        $(LINUX_DIR)/crypto/ocf/cryptosoft.$(LINUX_KMOD_SUFFIX)
322  AUTOLOAD:=$(call AutoLoad,09, \
323        ocf \
324        cryptodev \
325        cryptosoft \
326  )
327endef
328
329$(eval $(call KernelPackage,crypto-ocf))
330
331
332define KernelPackage/crypto-null
333  SUBMENU:=$(CRYPTO_MENU)
334  TITLE:=Null CryptoAPI module
335  DEPENDS:=+kmod-crypto-core
336  KCONFIG:=CONFIG_CRYPTO_NULL
337  FILES:=$(LINUX_DIR)/crypto/crypto_null.$(LINUX_KMOD_SUFFIX)
338  AUTOLOAD:=$(call AutoLoad,09,crypto_null)
339endef
340
341$(eval $(call KernelPackage,crypto-null))
342
343
344define KernelPackage/crypto-test
345  SUBMENU:=$(CRYPTO_MENU)
346  TITLE:=Test CryptoAPI module
347  DEPENDS:=+kmod-crypto-core
348  KCONFIG:=CONFIG_CRYPTO_TEST
349  FILES:=$(LINUX_DIR)/crypto/tcrypt.$(LINUX_KMOD_SUFFIX)
350endef
351
352$(eval $(call KernelPackage,crypto-test))
353
Note: See TracBrowser for help on using the repository browser.