Merge tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[muen/linux.git] / arch / arm / crypto / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Arch-specific CryptoAPI modules.
4 #
5
6 obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o
7 obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o
8 obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o
9 obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o
10 obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o
11 obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o
12 obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
13 obj-$(CONFIG_CRYPTO_NHPOLY1305_NEON) += nhpoly1305-neon.o
14
15 ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o
16 ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o
17 ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o
18 ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o
19 ce-obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o
20 crc-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o
21
22 ifneq ($(crc-obj-y)$(crc-obj-m),)
23 ifeq ($(call as-instr,.arch armv8-a\n.arch_extension crc,y,n),y)
24 ce-obj-y += $(crc-obj-y)
25 ce-obj-m += $(crc-obj-m)
26 else
27 $(warning These CRC Extensions modules need binutils 2.23 or higher)
28 $(warning $(crc-obj-y) $(crc-obj-m))
29 endif
30 endif
31
32 ifneq ($(ce-obj-y)$(ce-obj-m),)
33 ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y)
34 obj-y += $(ce-obj-y)
35 obj-m += $(ce-obj-m)
36 else
37 $(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher)
38 $(warning $(ce-obj-y) $(ce-obj-m))
39 endif
40 endif
41
42 aes-arm-y       := aes-cipher-core.o aes-cipher-glue.o
43 aes-arm-bs-y    := aes-neonbs-core.o aes-neonbs-glue.o
44 sha1-arm-y      := sha1-armv4-large.o sha1_glue.o
45 sha1-arm-neon-y := sha1-armv7-neon.o sha1_neon_glue.o
46 sha256-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha256_neon_glue.o
47 sha256-arm-y    := sha256-core.o sha256_glue.o $(sha256-arm-neon-y)
48 sha512-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha512-neon-glue.o
49 sha512-arm-y    := sha512-core.o sha512-glue.o $(sha512-arm-neon-y)
50 sha1-arm-ce-y   := sha1-ce-core.o sha1-ce-glue.o
51 sha2-arm-ce-y   := sha2-ce-core.o sha2-ce-glue.o
52 aes-arm-ce-y    := aes-ce-core.o aes-ce-glue.o
53 ghash-arm-ce-y  := ghash-ce-core.o ghash-ce-glue.o
54 crct10dif-arm-ce-y      := crct10dif-ce-core.o crct10dif-ce-glue.o
55 crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o
56 chacha-neon-y := chacha-neon-core.o chacha-neon-glue.o
57 nhpoly1305-neon-y := nh-neon-core.o nhpoly1305-neon-glue.o
58
59 ifdef REGENERATE_ARM_CRYPTO
60 quiet_cmd_perl = PERL    $@
61       cmd_perl = $(PERL) $(<) > $(@)
62
63 $(src)/sha256-core.S_shipped: $(src)/sha256-armv4.pl
64         $(call cmd,perl)
65
66 $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
67         $(call cmd,perl)
68 endif
69
70 clean-files += sha256-core.S sha512-core.S