kernel: move BLKCIPHER into crypto-core to avoid pulling in crypto-manager for arc4...
[openwrt.git] / package / kernel / linux / modules / crypto.mk
index 32332ef..dbeffa7 100644 (file)
@@ -7,12 +7,13 @@
 
 CRYPTO_MENU:=Cryptographic API modules
 
-CRYPTO_MODULES = ALGAPI2=crypto_algapi
+CRYPTO_MODULES = \
+       ALGAPI2=crypto_algapi \
+       BLKCIPHER2=crypto_blkcipher
 
 CRYPTOMGR_MODULES = \
        AEAD2=aead \
        MANAGER2=cryptomgr \
-       BLKCIPHER2=crypto_blkcipher
 
 crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1)))
 crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko
@@ -24,11 +25,12 @@ define KernelPackage/crypto-core
   KCONFIG:= \
        CONFIG_CRYPTO=y \
        CONFIG_CRYPTO_HW=y \
+       CONFIG_CRYPTO_BLKCIPHER \
        CONFIG_CRYPTO_ALGAPI \
        $(foreach mod,$(CRYPTO_MODULES),$(call crypto_confvar,$(mod)))
   FILES:=$(foreach mod,$(CRYPTO_MODULES),$(call crypto_file,$(mod)))
-  AUTOLOAD:=$(call AutoLoad,01,$(foreach mod,$(CRYPTO_MODULES),$(call crypto_name,$(mod))),1)
 endef
+
 $(eval $(call KernelPackage,crypto-core))
 
 
@@ -39,27 +41,29 @@ endef
 
 define KernelPackage/crypto-hash
   TITLE:=CryptoAPI hash support
-  KCONFIG:=CONFIG_CRYPTO_HASH2
+  KCONFIG:=CONFIG_CRYPTO_HASH
   FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko
   AUTOLOAD:=$(call AutoLoad,02,crypto_hash,1)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-hash))
 
+
 define KernelPackage/crypto-manager
   TITLE:=CryptoAPI algorithm manager
-  DEPENDS:=+kmod-crypto-hash
+  DEPENDS:=+kmod-crypto-hash +kmod-crypto-pcompress
   KCONFIG:= \
        CONFIG_CRYPTO_AEAD \
-       CONFIG_CRYPTO_BLKCIPHER \
        CONFIG_CRYPTO_MANAGER \
        $(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
   FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
-  AUTOLOAD:=$(call AutoLoad,03,$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_name,$(mod))))
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-manager))
 
+
 define KernelPackage/crypto-pcompress
   TITLE:=CryptoAPI Partial (de)compression operations
   KCONFIG:= \
@@ -69,8 +73,10 @@ define KernelPackage/crypto-pcompress
   AUTOLOAD:=$(call AutoLoad,09,pcompress)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-pcompress))
 
+
 define KernelPackage/crypto-user
   TITLE:=CryptoAPI userspace interface
   DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager
@@ -85,8 +91,10 @@ define KernelPackage/crypto-user
   AUTOLOAD:=$(call AutoLoad,09,af_alg algif_hash algif_skcipher)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-user))
 
+
 define KernelPackage/crypto-wq
   TITLE:=CryptoAPI work queue handling
   KCONFIG:=CONFIG_CRYPTO_WORKQUEUE
@@ -105,8 +113,10 @@ define KernelPackage/crypto-rng
   AUTOLOAD:=$(call AutoLoad,09,rng krng)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-rng))
 
+
 define KernelPackage/crypto-iv
   TITLE:=CryptoAPI initialization vectors
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
@@ -117,11 +127,13 @@ define KernelPackage/crypto-iv
   AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
   $(call AddDepends/crypto)
 endef
+
 $(eval $(call KernelPackage,crypto-iv))
 
+
 define KernelPackage/crypto-hw-talitos
   TITLE:=Freescale integrated security engine (SEC) driver
-  DEPENDS:=+kmod-crypto-aes
+  DEPENDS:=+kmod-crypto-aes +kmod-crypto-manager +kmod-crypto-hash +kmod-random-core
   KCONFIG:= \
        CONFIG_CRYPTO_DEV_TALITOS
   FILES:= \
@@ -184,7 +196,7 @@ define KernelPackage/crypto-hw-ppc4xx
        CONFIG_CRYPTO_DEV_PPC4XX
   FILES:=$(LINUX_DIR)/drivers/crypto/amcc/crypto4xx.ko
   AUTOLOAD:=$(call AutoLoad,90,crypto4xx)
-  $(call AddDepends/crypto)
+  $(call AddDepends/crypto,+kmod-crypto-manager +kmod-crypto-hash)
 endef
 
 define KernelPackage/crypto-hw-ppc4xx/description
@@ -194,6 +206,28 @@ endef
 $(eval $(call KernelPackage,crypto-hw-ppc4xx))
 
 
+define KernelPackage/crypto-hw-omap
+  TITLE:=TI OMAP hardware crypto modules
+  DEPENDS:=@TARGET_omap
+  KCONFIG:= \
+       CONFIG_CRYPTO_DEV_OMAP_AES \
+       CONFIG_CRYPTO_DEV_OMAP_DES \
+       CONFIG_CRYPTO_DEV_OMAP_SHAM
+  FILES:= \
+       $(LINUX_DIR)/drivers/crypto/omap-aes.ko \
+       $(LINUX_DIR)/drivers/crypto/omap-des.ko \
+       $(LINUX_DIR)/drivers/crypto/omap-sham.ko
+  AUTOLOAD:=$(call AutoLoad,90,omap-aes omap-des omap-sham)
+  $(call AddDepends/crypto,+kmod-crypto-manager +kmod-crypto-hash)
+endef
+
+define KernelPackage/crypto-hw-omap/description
+  Kernel support for the TI OMAP HW crypto engine.
+endef
+
+$(eval $(call KernelPackage,crypto-hw-omap))
+
+
 define KernelPackage/crypto-aes
   TITLE:=AES cipher CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_AES CONFIG_CRYPTO_AES_586
@@ -204,7 +238,7 @@ endef
 
 define KernelPackage/crypto-aes/x86
   FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.ko
-  AUTOLOAD:=$(call AutoLoad,09,aes_generic aes-i586)
+  AUTOLOAD:=$(call AutoLoad,09,aes-i586)
 endef
 
 $(eval $(call KernelPackage,crypto-aes))
@@ -215,7 +249,7 @@ define KernelPackage/crypto-arc4
   KCONFIG:=CONFIG_CRYPTO_ARC4
   FILES:=$(LINUX_DIR)/crypto/arc4.ko
   AUTOLOAD:=$(call AutoLoad,09,arc4)
-  $(call AddDepends/crypto,+!LINUX_3_3:kmod-crypto-manager)
+  $(call AddDepends/crypto)
 endef
 
 $(eval $(call KernelPackage,crypto-arc4))
@@ -254,6 +288,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-crc32c))
 
+
 define KernelPackage/crypto-des
   TITLE:=DES/3DES cipher CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_DES
@@ -264,6 +299,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-des))
 
+
 define KernelPackage/crypto-deflate
   TITLE:=Deflate compression CryptoAPI module
   DEPENDS:=+kmod-lib-zlib
@@ -275,6 +311,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-deflate))
 
+
 define KernelPackage/crypto-ecb
   TITLE:=Electronic CodeBook CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -347,6 +384,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-sha1))
 
+
 define KernelPackage/crypto-sha256
   TITLE:=SHA224 SHA256 digest CryptoAPI module
   DEPENDS:=+kmod-crypto-hash
@@ -358,6 +396,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-sha256))
 
+
 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.6.0)),1)
 camellia_mod_suffix=_generic
 endif
@@ -397,15 +436,13 @@ define KernelPackage/crypto-misc
        $(LINUX_DIR)/crypto/tgr192.ko \
        $(LINUX_DIR)/crypto/twofish_common.ko \
        $(LINUX_DIR)/crypto/wp512.ko \
-    $(LINUX_DIR)/crypto/twofish_generic.ko
-  FILES += \
+       $(LINUX_DIR)/crypto/twofish_generic.ko \
        $(LINUX_DIR)/crypto/blowfish_common.ko \
        $(LINUX_DIR)/crypto/blowfish_generic.ko \
-    $(LINUX_DIR)/crypto/serpent_generic.ko
+       $(LINUX_DIR)/crypto/serpent_generic.ko
   $(call AddDepends/crypto)
 endef
 
-
 define KernelPackage/crypto-misc/x86
   FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko
 endef
@@ -500,6 +537,7 @@ endef
 
 $(eval $(call KernelPackage,crypto-xts))
 
+
 define KernelPackage/crypto-mv-cesa
   TITLE:=Marvell crypto engine
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-aes @TARGET_kirkwood||TARGET_orion||TARGET_mvebu