Skip to content

Commit 44a6b84

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: - Fixed algorithm construction hang when self-test fails. - Added SHA variants to talitos AEAD list. - New driver for Exynos random number generator. - Performance enhancements for arc4. - Added hwrng support to caam. - Added ahash support to caam. - Fixed bad kfree in aesni-intel. - Allow aesni-intel in FIPS mode. - Added atmel driver with support for AES/3DES/SHA. - Bug fixes for mv_cesa. - CRC hardware driver for BF60x family processors. * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (66 commits) crypto: twofish-avx - remove useless instruction crypto: testmgr - add aead cbc aes hmac sha1,256,512 test vectors crypto: talitos - add sha224, sha384 and sha512 to existing AEAD algorithms crypto: talitos - export the talitos_submit function crypto: talitos - move talitos structures to header file crypto: atmel - add new tests to tcrypt crypto: atmel - add Atmel SHA1/SHA256 driver crypto: atmel - add Atmel DES/TDES driver crypto: atmel - add Atmel AES driver ARM: AT91SAM9G45: add crypto peripherals crypto: testmgr - allow aesni-intel and ghash_clmulni-intel in fips mode hwrng: exynos - Add support for Exynos random number generator crypto: aesni-intel - fix wrong kfree pointer crypto: caam - ERA retrieval and printing for SEC device crypto: caam - Using alloc_coherent for caam job rings crypto: algapi - Fix hang on crypto allocation crypto: arc4 - now arc needs blockcipher support crypto: caam - one tasklet per job ring crypto: caam - consolidate memory barriers from job ring en/dequeue crypto: caam - only query h/w in job ring dequeue path ...
2 parents 945c40c + a434788 commit 44a6b84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+14289
-1842
lines changed

arch/arm/mach-at91/at91sam9g45.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ static struct clk adc_op_clk = {
183183
.rate_hz = 13200000,
184184
};
185185

186+
/* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */
187+
static struct clk aestdessha_clk = {
188+
.name = "aestdessha_clk",
189+
.pmc_mask = 1 << AT91SAM9G45_ID_AESTDESSHA,
190+
.type = CLK_TYPE_PERIPHERAL,
191+
};
192+
186193
static struct clk *periph_clocks[] __initdata = {
187194
&pioA_clk,
188195
&pioB_clk,
@@ -212,6 +219,7 @@ static struct clk *periph_clocks[] __initdata = {
212219
&udphs_clk,
213220
&mmc1_clk,
214221
&adc_op_clk,
222+
&aestdessha_clk,
215223
// irq0
216224
};
217225

@@ -232,6 +240,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
232240
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
233241
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
234242
CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
243+
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
244+
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),
245+
CLKDEV_CON_DEV_ID(NULL, "atmel_aes", &aestdessha_clk),
235246
/* more usart lookup table for DT entries */
236247
CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck),
237248
CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk),
@@ -388,7 +399,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {
388399
3, /* Ethernet */
389400
0, /* Image Sensor Interface */
390401
2, /* USB Device High speed port */
391-
0,
402+
0, /* AESTDESSHA Crypto HW Accelerators */
392403
0, /* Multimedia Card Interface 1 */
393404
0,
394405
0, /* Advanced Interrupt Controller (IRQ0) */

arch/arm/mach-at91/at91sam9g45_devices.c

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/platform_device.h>
1919
#include <linux/i2c-gpio.h>
2020
#include <linux/atmel-mci.h>
21+
#include <linux/platform_data/atmel-aes.h>
2122

2223
#include <linux/platform_data/at91_adc.h>
2324

@@ -1830,6 +1831,130 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
18301831
void __init at91_add_device_serial(void) {}
18311832
#endif
18321833

1834+
/* --------------------------------------------------------------------
1835+
* SHA1/SHA256
1836+
* -------------------------------------------------------------------- */
1837+
1838+
#if defined(CONFIG_CRYPTO_DEV_ATMEL_SHA) || defined(CONFIG_CRYPTO_DEV_ATMEL_SHA_MODULE)
1839+
static struct resource sha_resources[] = {
1840+
{
1841+
.start = AT91SAM9G45_BASE_SHA,
1842+
.end = AT91SAM9G45_BASE_SHA + SZ_16K - 1,
1843+
.flags = IORESOURCE_MEM,
1844+
},
1845+
[1] = {
1846+
.start = AT91SAM9G45_ID_AESTDESSHA,
1847+
.end = AT91SAM9G45_ID_AESTDESSHA,
1848+
.flags = IORESOURCE_IRQ,
1849+
},
1850+
};
1851+
1852+
static struct platform_device at91sam9g45_sha_device = {
1853+
.name = "atmel_sha",
1854+
.id = -1,
1855+
.resource = sha_resources,
1856+
.num_resources = ARRAY_SIZE(sha_resources),
1857+
};
1858+
1859+
static void __init at91_add_device_sha(void)
1860+
{
1861+
platform_device_register(&at91sam9g45_sha_device);
1862+
}
1863+
#else
1864+
static void __init at91_add_device_sha(void) {}
1865+
#endif
1866+
1867+
/* --------------------------------------------------------------------
1868+
* DES/TDES
1869+
* -------------------------------------------------------------------- */
1870+
1871+
#if defined(CONFIG_CRYPTO_DEV_ATMEL_TDES) || defined(CONFIG_CRYPTO_DEV_ATMEL_TDES_MODULE)
1872+
static struct resource tdes_resources[] = {
1873+
[0] = {
1874+
.start = AT91SAM9G45_BASE_TDES,
1875+
.end = AT91SAM9G45_BASE_TDES + SZ_16K - 1,
1876+
.flags = IORESOURCE_MEM,
1877+
},
1878+
[1] = {
1879+
.start = AT91SAM9G45_ID_AESTDESSHA,
1880+
.end = AT91SAM9G45_ID_AESTDESSHA,
1881+
.flags = IORESOURCE_IRQ,
1882+
},
1883+
};
1884+
1885+
static struct platform_device at91sam9g45_tdes_device = {
1886+
.name = "atmel_tdes",
1887+
.id = -1,
1888+
.resource = tdes_resources,
1889+
.num_resources = ARRAY_SIZE(tdes_resources),
1890+
};
1891+
1892+
static void __init at91_add_device_tdes(void)
1893+
{
1894+
platform_device_register(&at91sam9g45_tdes_device);
1895+
}
1896+
#else
1897+
static void __init at91_add_device_tdes(void) {}
1898+
#endif
1899+
1900+
/* --------------------------------------------------------------------
1901+
* AES
1902+
* -------------------------------------------------------------------- */
1903+
1904+
#if defined(CONFIG_CRYPTO_DEV_ATMEL_AES) || defined(CONFIG_CRYPTO_DEV_ATMEL_AES_MODULE)
1905+
static struct aes_platform_data aes_data;
1906+
static u64 aes_dmamask = DMA_BIT_MASK(32);
1907+
1908+
static struct resource aes_resources[] = {
1909+
[0] = {
1910+
.start = AT91SAM9G45_BASE_AES,
1911+
.end = AT91SAM9G45_BASE_AES + SZ_16K - 1,
1912+
.flags = IORESOURCE_MEM,
1913+
},
1914+
[1] = {
1915+
.start = AT91SAM9G45_ID_AESTDESSHA,
1916+
.end = AT91SAM9G45_ID_AESTDESSHA,
1917+
.flags = IORESOURCE_IRQ,
1918+
},
1919+
};
1920+
1921+
static struct platform_device at91sam9g45_aes_device = {
1922+
.name = "atmel_aes",
1923+
.id = -1,
1924+
.dev = {
1925+
.dma_mask = &aes_dmamask,
1926+
.coherent_dma_mask = DMA_BIT_MASK(32),
1927+
.platform_data = &aes_data,
1928+
},
1929+
.resource = aes_resources,
1930+
.num_resources = ARRAY_SIZE(aes_resources),
1931+
};
1932+
1933+
static void __init at91_add_device_aes(void)
1934+
{
1935+
struct at_dma_slave *atslave;
1936+
struct aes_dma_data *alt_atslave;
1937+
1938+
alt_atslave = kzalloc(sizeof(struct aes_dma_data), GFP_KERNEL);
1939+
1940+
/* DMA TX slave channel configuration */
1941+
atslave = &alt_atslave->txdata;
1942+
atslave->dma_dev = &at_hdmac_device.dev;
1943+
atslave->cfg = ATC_FIFOCFG_ENOUGHSPACE | ATC_SRC_H2SEL_HW |
1944+
ATC_SRC_PER(AT_DMA_ID_AES_RX);
1945+
1946+
/* DMA RX slave channel configuration */
1947+
atslave = &alt_atslave->rxdata;
1948+
atslave->dma_dev = &at_hdmac_device.dev;
1949+
atslave->cfg = ATC_FIFOCFG_ENOUGHSPACE | ATC_DST_H2SEL_HW |
1950+
ATC_DST_PER(AT_DMA_ID_AES_TX);
1951+
1952+
aes_data.dma_slave = alt_atslave;
1953+
platform_device_register(&at91sam9g45_aes_device);
1954+
}
1955+
#else
1956+
static void __init at91_add_device_aes(void) {}
1957+
#endif
18331958

18341959
/* -------------------------------------------------------------------- */
18351960
/*
@@ -1847,6 +1972,9 @@ static int __init at91_add_standard_devices(void)
18471972
at91_add_device_trng();
18481973
at91_add_device_watchdog();
18491974
at91_add_device_tc();
1975+
at91_add_device_sha();
1976+
at91_add_device_tdes();
1977+
at91_add_device_aes();
18501978
return 0;
18511979
}
18521980

arch/arm/mach-at91/include/mach/at91sam9g45.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
#define AT_DMA_ID_SSC1_RX 8
137137
#define AT_DMA_ID_AC97_TX 9
138138
#define AT_DMA_ID_AC97_RX 10
139+
#define AT_DMA_ID_AES_TX 11
140+
#define AT_DMA_ID_AES_RX 12
139141
#define AT_DMA_ID_MCI1 13
140142

141143
#endif

arch/powerpc/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ core-$(CONFIG_KVM) += arch/powerpc/kvm/
149149
core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/
150150

151151
drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
152-
drivers-$(CONFIG_CRYPTO_DEV_NX) += drivers/crypto/nx/
153152

154153
# Default to zImage, override when needed
155154
all: zImage

arch/s390/crypto/crypto_des.h

Lines changed: 0 additions & 18 deletions
This file was deleted.

arch/x86/crypto/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Arch-specific CryptoAPI modules.
33
#
44

5+
obj-$(CONFIG_CRYPTO_ABLK_HELPER_X86) += ablk_helper.o
6+
obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o
7+
58
obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o
69
obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
710
obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
@@ -12,8 +15,10 @@ obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
1215
obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
1316
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
1417
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
18+
obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
1519
obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o
1620
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
21+
obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
1722
obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
1823
obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
1924

@@ -30,16 +35,11 @@ camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
3035
blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o
3136
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
3237
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
38+
twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o
3339
salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o
3440
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
41+
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
3542

3643
aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o
37-
3844
ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
39-
40-
# enable AVX support only when $(AS) can actually assemble the instructions
41-
ifeq ($(call as-instr,vpxor %xmm0$(comma)%xmm1$(comma)%xmm2,yes,no),yes)
42-
AFLAGS_sha1_ssse3_asm.o += -DSHA1_ENABLE_AVX_SUPPORT
43-
CFLAGS_sha1_ssse3_glue.o += -DSHA1_ENABLE_AVX_SUPPORT
44-
endif
4545
sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o

0 commit comments

Comments
 (0)