diff options
author | David Barksdale <amatus@amatus.name> | 2014-08-13 16:29:15 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-08-13 16:29:15 -0500 |
commit | 205ac4d83fc388c1e2d0bb590a2a36e9a4c2fd78 (patch) | |
tree | 1dbd529848c396058dfc9c8a4f402dcbe3546317 | |
parent | ace6c6d243016e272050787c14e27a83ecd94a25 (diff) |
gpl-source-mybooklive-010203-update.zipgpl-source-mybooklive-010303-update.zipgpl-source-mybooklive-010203-update.zip
-rwxr-xr-x | arch/powerpc/boot/dts/beech.dts | 9 | ||||
-rw-r--r-- | arch/powerpc/include/asm/apm82181-adma.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/dma.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/Kconfig | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/ppc44x_simple.c | 1 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_pci.c | 3 | ||||
-rwxr-xr-x | build.sh | 48 | ||||
-rw-r--r-- | crypto/tcrypt.c | 10 | ||||
-rw-r--r-- | crypto/testmgr.c | 38 | ||||
-rw-r--r-- | crypto/testmgr.h | 125 | ||||
-rwxr-xr-x | drivers/ata/sata_dwc_pmp.c | 16 | ||||
-rw-r--r-- | drivers/char/hw_random/trng4xx.c | 2 | ||||
-rw-r--r-- | drivers/crypto/amcc/crypto4xx_alg.c | 50 | ||||
-rw-r--r-- | drivers/crypto/amcc/crypto4xx_core.c | 47 | ||||
-rw-r--r-- | drivers/crypto/amcc/crypto4xx_core.h | 44 | ||||
-rw-r--r-- | drivers/md/raid0.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 31 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 9 | ||||
-rw-r--r-- | drivers/mtd/nand/ndfc.c | 2 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 23 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/phy.c | 26 | ||||
-rw-r--r-- | fs/splice.c | 255 | ||||
-rw-r--r-- | include/linux/leds.h | 10 | ||||
-rw-r--r-- | net/core/sock.c | 36 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 84 |
26 files changed, 716 insertions, 179 deletions
diff --git a/arch/powerpc/boot/dts/beech.dts b/arch/powerpc/boot/dts/beech.dts index 0e64ec4e365..341fb2cf0af 100755 --- a/arch/powerpc/boot/dts/beech.dts +++ b/arch/powerpc/boot/dts/beech.dts @@ -102,13 +102,11 @@ reg = <4 0x00040000 0x8000>; /* 32K */ }; - /* TODO: Check this for Maui */ SDR0: sdr { compatible = "ibm,sdr-460ex"; dcr-reg = <0x00e 0x002>; }; - /* TODO: Change for Maui */ CPR0: cpr { compatible = "ibm,cpr-460ex"; dcr-reg = <0x00c 0x002>; @@ -167,7 +165,7 @@ compatible = "ppc4xx-pka", "amcc, ppc4xx-pka"; reg = <4 0x00114000 0x4000>; interrupt-parent = <&UIC0>; - interrupts = <0x14 0x2>; + interrupts = <0x14 0x1>; }; TRNG: trng@110000 { @@ -175,7 +173,7 @@ compatible = "ppc4xx-trng", "amcc, ppc4xx-trng"; reg = <4 0x00110000 0x100>; interrupt-parent = <&UIC1>; - interrupts = <0x3 0x2>; + interrupts = <0x3 0x4>; }; RTC: rtc { @@ -205,7 +203,6 @@ /*RX1 COAL 0xd 0x2*/>; }; - /* TODO: Check for Maui */ USBOTG0: usbotg@bff80000 { compatible = "amcc,usb-otg-405ex"; reg = <4 0xbff80000 0x10000>; @@ -311,7 +308,6 @@ interrupts = <0x6 0x4>; interrupt-parent = <&UIC1>; - /* TODO: Change for Beech platform . 4M Nor Flash */ nor_flash@0,0 { compatible = "amd,s29gl512n", "cfi-flash"; bank-width = <1>; @@ -423,7 +419,6 @@ reg = <0xef601350 0x00000030>; }; - /* TODO: Change for Maui */ EMAC0: ethernet@ef600c00 { device_type = "network"; compatible = "ibm,emac-405ex", "ibm,emac4sync"; diff --git a/arch/powerpc/include/asm/apm82181-adma.h b/arch/powerpc/include/asm/apm82181-adma.h index b16014b8c07..bfc7803c3fa 100644 --- a/arch/powerpc/include/asm/apm82181-adma.h +++ b/arch/powerpc/include/asm/apm82181-adma.h @@ -203,6 +203,8 @@ typedef struct apm82181_adma_plb_desc_slot { unsigned long flags; unsigned long reverse_flags[8]; #define APM82181_DESC_INT 0 /* generate interrupt on complete */ +#define APM82181_DESC_FENCE 1 /* Other tx will use its result */ + /* This tx needs to be polled to complete */ }apm82181_desc_t; diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 6215062caf8..868b5fd5f1e 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c @@ -132,6 +132,14 @@ static inline void dma_direct_sync_single_range(struct device *dev, { __dma_sync(bus_to_virt(dma_handle+offset), size, direction); } + +static inline void dma_direct_sync_single(struct device *dev, + dma_addr_t dma_handle, size_t size, + enum dma_data_direction direction) +{ + __dma_sync(bus_to_virt(dma_handle), size, direction); +} + #endif struct dma_map_ops dma_direct_ops = { @@ -143,6 +151,8 @@ struct dma_map_ops dma_direct_ops = { .map_page = dma_direct_map_page, .unmap_page = dma_direct_unmap_page, #ifdef CONFIG_NOT_COHERENT_CACHE + .sync_single_for_cpu = dma_direct_sync_single, + .sync_single_for_device = dma_direct_sync_single, .sync_single_range_for_cpu = dma_direct_sync_single_range, .sync_single_range_for_device = dma_direct_sync_single_range, .sync_sg_for_cpu = dma_direct_sync_sg, diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index 642036461cd..0551086e350 100644 --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig @@ -115,6 +115,17 @@ config APOLLO3G help This option enables support for the WDC Apollo3G NAS. +config BLUESTONE + bool "Bluestone" + depends on 44x + default n + select PPC44x_SIMPLE + select APM82181 + select PPC4xx_PCI_EXPRESS + select IBM_NEW_EMAC_RGMII + help + This option enables support for the AMCC APM82181 evaluation board. + config CANYONLANDS bool "Canyonlands" depends on 44x diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile index fd5583c8e86..084f9b0561a 100644 --- a/arch/powerpc/platforms/44x/Makefile +++ b/arch/powerpc/platforms/44x/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o obj-$(CONFIG_BEECH) += beech-usb.o obj-$(CONFIG_APOLLO3G) += apollo3g-gpio.o +obj-$(CONFIG_BLUESTONE) += bluestone-usb.o diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c index 2c78cc8bc59..5f4a4548c6b 100644 --- a/arch/powerpc/platforms/44x/ppc44x_simple.c +++ b/arch/powerpc/platforms/44x/ppc44x_simple.c @@ -54,6 +54,7 @@ static char *board[] __initdata = { "amcc,bamboo", "amcc,beech", "amcc,apollo3g", + "amcc,bluestone", "amcc,canyonlands", "amcc,glacier", "ibm,ebony", diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 716b57f1e03..94ff12e0bac 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c @@ -1960,7 +1960,8 @@ static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port) port->index); } #if defined (CONFIG_APM82181) && defined(CONFIG_PCIE_MAX_PAYLOAD_SIZE_256) - ppc440_config_pcie_mps(hose); + if(port->link) + ppc440_config_pcie_mps(hose); #endif return; fail: @@ -1,44 +1,44 @@ #!/bin/sh - # -# build support for apollo3g +# kernel build script for apollo3g # -local _CROSS_COMPILE=${1:-"ppc_4xxFP-"} -local _ARCH=${2:-"powerpc"} - -if [ ! -z ${3} ]; then - if [ ! -d ${3} ]; then - mkdir -p "${3}" - fi - OUTPREFIX="${3}/" - OUTLOC="O=${3}" +# Usage: 'sh build.sh' to just use defaults (need to have the ELDK installed) +# 'sh build.sh CROSS_COMPILE ARCH OUTLOC' to specifiy all parameters +# +_CROSS_COMPILE=${1:-ppc_4xxFP-} +_ARCH=${2:-powerpc} +OUTLOC=${3:-_BuildOutput} +if [ ! -d ${OUTLOC} ]; then + mkdir -p "${OUTLOC}" fi -#echo "CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} OUTLOC=${OUTLOC}" - echo =========== Building Linux =============== make distclean make mrproper -make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} 44x/apollo_3G_nas_defconfig -make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 uImage +make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} 44x/apollo_3G_nas_defconfig +make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 uImage echo echo =========== Building device tree =========== -make ${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 apollo3g.dtb +make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 apollo3g.dtb echo -echo =========== Combining images =============== -dd if=/dev/zero of=apollo3g_boot.img bs=1 count=5M -dd if=${OUTPREFIX}arch/powerpc/boot/uImage of=apollo3g_boot.img conv=notrunc bs=1 -dd if=${OUTPREFIX}arch/powerpc/boot/apollo3g.dtb of=apollo3g_boot.img conv=notrunc bs=1 seek=4M +echo "=========== Copying images to directory $(pwd) ===============" +cp -v ${OUTLOC}/arch/powerpc/boot/uImage . +cp -v ${OUTLOC}/arch/powerpc/boot/apollo3g.dtb . +ls -ll *.dtb uImage + +# We don't use the combined image +#echo +#echo =========== Combining images =============== +#dd if=/dev/zero of=apollo3g_boot.img bs=1 count=5M +#dd if=${OUTLOC}/arch/powerpc/boot/uImage of=apollo3g_boot.img conv=notrunc bs=1 +#dd if=${OUTLOC}/arch/powerpc/boot/apollo3g.dtb of=apollo3g_boot.img conv=notrunc bs=1 seek=4M -echo -ls -ll apollo3g_boot.img # -# beech ? +# original beech script... # - #echo =========== Building Linux =============== #make distclean #make 44x/beech_nas_optimized_defconfig diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index aa3f84ccc78..3092728bf4c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -883,7 +883,15 @@ static int do_test(int m) case 399: break; - + case 400: + tcrypt_test("f8(kasumi)"); + break; + case 401: + tcrypt_test("kasumi"); + break; + case 402: + tcrypt_test("f9(kasumi)"); + break; case 1000: test_available(); break; diff --git a/crypto/testmgr.c b/crypto/testmgr.c index deacec764fb..01f3f79de7e 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -1498,6 +1498,22 @@ static const struct alg_test_desc alg_test_descs_k[] = { .count = 1 }, .dec = { + .vecs = kasumi_f8_dec_template, + .count = 1 + } + } + } + }, + { + .alg = "kasumi", + .test = alg_test_skcipher, + .suite = { + .cipher = { + .enc = { + .vecs = kasumi_enc_template, + .count = 1 + }, + .dec = { .vecs = kasumi_dec_template, .count = 1 } @@ -1577,7 +1593,7 @@ static const struct alg_test_desc alg_test_descs_k[] = { /* Currently disabled all the DTLS testing since, * the DTLS enc test cases fail due to Random IV generation */ -#if 0 +#if 1 { .alg = "dtls(aes-sha1)", .test = alg_test_aead, @@ -2408,7 +2424,18 @@ static const struct alg_test_desc alg_test_descs[] = { .count = MD4_TEST_VECTORS } } - }, { + }, + { + .alg = "f9(kasumi)", + .test = alg_test_hash, + .suite = { + .hash = { + .vecs = kasumi_f9_tv_template, + .count = 1 + } + } + }, + { .alg = "md5", .test = alg_test_hash, .suite = { @@ -2709,6 +2736,10 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) int j; int rc; + //printk("Testing alg = %s, driver name: %s\n", alg, driver); + if ((strcmp(alg, "kasumi") == 0) || (strcmp(alg, "f8(kasumi)") == 0)){ + printk("Testing kasumi now\n"); + } if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) { char nalg[CRYPTO_MAX_ALG_NAME]; @@ -2727,9 +2758,12 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) goto test_done; } + /* Enable these if want to test DTLS, SSL, TLS and TLSV11 and Kasumi */ + #if 1 for ( i = 0; i < 15; i++) { + //printk("Testing special alg = %s, driver = %s\n", alg, driver); if (strcmp(alg, alg_test_descs_k[i].alg) == 0) { rc = alg_test_descs_k[i].test(alg_test_descs_k + i, driver, type, mask); diff --git a/crypto/testmgr.h b/crypto/testmgr.h index ade892af4c2..4de793d4bdf 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -2863,53 +2863,106 @@ static struct cipher_testvec cast6_dec_tv_template[] = { .rlen = 16, }, }; - - -static struct cipher_testvec kasumi_dec_template[] = { +static struct cipher_testvec kasumi_f8_dec_template[] = { { - .key = "\x01\x02\x03\x04\x05\x06\x07" - "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", - .klen = 16, - .input = "\xec\xa7\xdb\xe8\xd9\xf4\x93\x2e", - .ilen = 8, - .result = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8", - .rlen = 8, + .key = "\x96\x18\xae\x46\x89\x1f\x86\x57\x8e\xeb\xe9\x0e\xf7\xa1\x20\x2e", + .iv = "\xc6\x75\xa6\x4b\x64\x00\x00\x00", + + .result = "\x8d\xaa\x17\xb1\xae\x05\x05\x29\xc6\x82\x7f\x28\xc0\xef\x6a\x12" + "\x42\xe9\x3f\x8b\x31\x4f\xb1\x8a\x77\xf7\x90\xae\x04\x9f\xed\xd6" + "\x12\x26\x7f\xec\xae\xfc\x45\x01\x74\xd7\x6d\x9f\x9a\xa7\x75\x5a" + "\x30\xcd\x90\xa9\xa5\x87\x4b\xf4\x8e\xaf\x70\xee\xa3\xa6\x2a\x25" + "\x0a\x8b\x6b\xd8\xd9\xb0\x8b\x08\xd6\x4e\x32\xd1\x81\x77\x77\xfb" + "\x54\x4d\x49\xcd\x49\x72\x0e\x21\x9d\xbf\x8b\xbe\xd3\x39\x04\xe1" + "\xfd\x40\xa4\x1d\x37\x0a\x1f\x65\x74\x50\x95\x68\x7d\x47\xba\x1d" + "\x36\xd2\x34\x9e\x23\xf6\x44\x39\x2c\x8e\xa9\xc4\x9d\x40\xc1\x32" + "\x71\xaf\xf2\x64\xd0\xf2\x48\x41\xd6\x46\x5f\x09\x96\xff\x84\xe6" + "\x5f\xc5\x17\xc5\x3e\xfc\x33\x63\xc3\x84\x92\xa8", + .klen = 16, + .ilen = 156, + .input = "\xaa\xf8\xe8\xb3\x49\xfb\xab\xb9\x5c\x62\x1d\xe6\xfb\x51\x67\x44" + "\x60\x54\xae\x7c\xfa\x94\x6f\x99\x6c\x26\x00\x53\x45\xa1\xa2\xaf" + "\x44\xee\xa6\x88\xb7\x59\xff\xe3\xe2\x2d\x6e\x17\xbd\x9e\x70\x79" + "\xcc\x54\xe8\xd4\x92\xdb\xfd\xe7\x9e\x84\x04\x38\x49\x82\x1a\x24" + "\x7a\x67\xd3\x50\x9b\xa1\x6b\x49\x15\xfd\xdd\xd6\x38\xe2\x52\xf4" + "\x37\x1e\x47\x1d\x1b\x39\xb4\x15\x8b\x47\xf1\x4d\x03\x7b\xbd\x28" + "\x37\x80\x41\x34\xad\x49\x3b\xfc\x14\x0e\x43\x7f\x5e\xbf\x9c\x29" + "\xd5\xd8\xa5\x81\x6f\x92\x6a\xa2\x76\xe9\xa7\x43\xa6\x21\x41\xad" + "\xeb\x65\x3b\xd2\x96\x3c\x9f\x54\x1f\x5e\x13\x34\xb7\x75\x92\xb1" + "\xad\xed\x44\x36\x72\x28\x28\x01\x32\xa7\x47\xde", + .rlen = 156, }, }; static struct cipher_testvec kasumi_f8_enc_template[] ={ - - { - + { .key = "\x2b\xd6\x45\x9f\x82\xc5\xb3\x00" - "\x95\x2c\x49\x10" - "\x48\x81\xff\x48", - + "\x95\x2c\x49\x10\x48\x81\xff\x48", .klen = 16, - .iv = "\x72\xa4\xf2\x0f\x64\x00\x00\x00", - .input = "\x7e\xc6\x12\x72\x74\x3b\xf1\x61" - "\x47\x26\x44\x6a\x6c\x38\xce\xd1" - "\x66, \xf6, \xca, \x76, \xeb, \x54, \x30, \x04" - "\x42, \x86, \x34, \x6c, \xef, \x13, \x0f, \x92" - "\x92, \x2b, \x03, \x45, \x0d, \x3a, \x99, \x75, \xe5, \xbd, \x2e, \xa0" - "\xeb, \x55, \xad, \x8e, \x1b, \x19, \x9e, \x3e, \xc4, \x31, \x60, \x20" - "\xe9, \xa1, \xb2, \x85, \xe7, \x62, \x79, \x53, \x59, \xb7, \xbd, \xfd, \x39, \xbe, \xf4, \xb2" - "\x48, \x45, \x83, \xd5,\xaf, \xe0, \x82, \xae,\xe6, \x38, \xbf, \x5f, \xd5, \xa6, \x06, \x19" - "\x39, \x01, \xa0, \x8f, \x4a, \xb4, \x1a, \xab, \x9b, \x13, \x48, \x80", - + "\x47\x26\x44\x6a\x6c\x38\xce\xd1", .ilen = 16, - .result = "\xd1, \xe2, \xde, \x70, \xee, \xf8, \x6c, \x69, \x64, \xfb, \x54, \x2b, \xc2, \xd4, \x60, \xaa" - "\xbf, \xaa, \x10, \xa4, \xa0, \x93, \x26, \x2b, \x7d, \x19, \x9e, \x70, \x6f, \xc2, \xd4, \x89" - "\x15, \x53, \x29, \x69, \x10, \xf3, \xa9, \x73, \x01, \x26, \x82, \xe4, \x1c, \x4e, \x2b, \x02" - "\xbe, \x20, \x17, \xb7, \x25, \x3b, \xbf, \x93, \x09, \xde, \x58, \x19, \xcb, \x42, \xe8, \x19" - "\x56, \xf4, \xc9, \x9b, \xc9, \x76, \x5c, \xaf, \x53, \xb1, \xd0, \xbb, \x82, \x79, \x82, \x6a" - "\xdb, \xbc, \x55, \x22, \xe9, \x15, \xc1, \x20, \xa6, \x18, \xa5, \xa7, \xf5, \xe8, \x97, \x08" - "\x93, \x39, \x65, \x0f", - .rlen = 10, - }, + .result = "\xd1\xe2\xde\x70\xee\xf8\x6c\x69" + "\x64\xfb\x54\x2b\xc2\xd4\x60\xaa", + .rlen = 16, + }, +}; + +static struct cipher_testvec kasumi_enc_template[] = { + { + .key = "\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + .klen = 16, + .input = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8", + .ilen = 8, + .result = "\xed\xa7\xdb\xe8\xd9\xf4\x93\x2e", + .rlen = 8, + }, +}; + +static struct cipher_testvec kasumi_dec_template[] = { + { + .key = "\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10", + .klen = 16, + .input = "\xec\xa7\xdb\xe8\xd9\xf4\x93\x2e", + .ilen = 8, + .result = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8", + .rlen = 8, + }, }; + +static struct hash_testvec kasumi_f9_tv_template[] = { + { + .key = "\x5d\x0a\x80\xd8\x13\x4a\xe1\x96\x77\x82\x4b\x67\x1e\x83\x8a\xf4", + .ksize = 16, + .plaintext = "\x78\x27\xfa\xb2\xa5\x6c\x6c\xa2\x01\x00\x00\x00\x00\x00\x00\x00" + "\x70\xde\xdf\x2d\xc4\x2c\x5c\xbd\x3a\x96\xf8\xa0\xb1\x14\x18\xb3" + "\x60\x8d\x57\x33\x60\x4a\x2c\xd3\x6a\xab\xc7\x0c\xe3\x19\x3b\xb5" + "\x15\x3b\xe2\xd3\xc0\x6d\xfd\xb2\xd1\x6e\x9c\x35\x71\x58\xbe\x6a" + "\x41\xd6\xb8\x61\xe4\x91\xdb\x3f\xbf\xeb\x51\x8e\xfc\xf0\x48\xd7" + "\xd5\x89\x53\x73\x0f\xf3\x0c\x9e\xc4\x70\xff\xcd\x66\x3d\xc3\x42" + "\x01\xc3\x6a\xdd\xc0\x11\x1c\x35\xb3\x8a\xfe\xe7\xcf\xdb\x58\x2e" + "\x37\x31\xf8\xb4\xba\xa8\xd1\xa8\x9c\x06\xe8\x11\x99\xa9\x71\x62" + "\x27\xbe\x34\x4e\xfc\xb4\x36\xdd\xd0\xf0\x96\xc0\x64\xc3\xb5\xe2" + "\xc3\x99\x99\x3f\xc7\x73\x94\xf9\xe0\x97\x20\xa8\x11\x85\x0e\xf2" + "\x3b\x2e\xe0\x5d\x9e\x61\x73\x60\x9d\x86\xe1\xc0\xc1\x8e\xa5\x1a" + "\x01\x2a\x00\xbb\x41\x3b\x9c\xb8\x18\x8a\x70\x3c\xd6\xba\xe3\x1c" + "\xc6\x7b\x34\xb1\xb0\x00\x19\xe6\xa2\xb2\xa6\x90\xf0\x26\x71\xfe" + "\x7c\x9e\xf8\xde\xc0\x09\x4e\x53\x37\x63\x47\x8d\x58\xd2\xc5\xf5" + "\xb8\x27\xa0\x14\x8c\x59\x48\xa9\x69\x31\xac\xf8\x4f\x46\x5a\x64" + "\xe6\x2c\xe7\x40\x07\xe9\x91\xe3\x7e\xa8\x23\xfa\x0f\xb2\x19\x23" + "\xb7\x99\x05\xb7\x33\xb6\x31\xe6\xc7\xd6\x86\x0a\x38\x31\xac\x35" + "\x1a\x9c\x73\x0c\x52\xff\x72\xd9\xd3\x08\xee\xdb\xab\x21\xfd\xe1" + "\x43\xa0\xea\x17\xe2\x3e\xdc\x1f\x74\xcb\xb3\x63\x8a\x20\x33\xaa" + "\xa1\x54\x64\xea\xa7\x33\x38\x5d\xbb\xeb\x6f\xd7\x35\x09\xb8\x57" + "\xe6\xa4\x19\xdc\xa1\xd8\x90\x7a\xf9\x77\xfb\xac\x4d\xfa\x35\xec", + .psize = 336, + .digest = "\x04\x91\x20\x48\x82\x37\xc4\x1a", + }, +}; + /* * AES test vectors. */ diff --git a/drivers/ata/sata_dwc_pmp.c b/drivers/ata/sata_dwc_pmp.c index c1b0cff6ae6..df3b490f86e 100755 --- a/drivers/ata/sata_dwc_pmp.c +++ b/drivers/ata/sata_dwc_pmp.c @@ -104,8 +104,8 @@ #define AHB_DMA_BRST_DFLT 64 /* 16 data items burst length */ #endif -#if defined(CONFIG_APM82181) - extern void signal_hdd_led(int, int); +#if defined(CONFIG_APOLLO3G) +extern void signal_hdd_led(int, int); #endif struct dmareg { u32 low; /* Low bits 0-31 */ @@ -1033,8 +1033,8 @@ static void dma_dwc_xfer_start(int dma_ch) #endif -#if defined(CONFIG_APM82181) - signal_hdd_led(1 /*blink=yes*/, 2 /* _3G_LED_GREEN */); +#if defined(CONFIG_APOLLO3G) + signal_hdd_led(1 /*blink=yes*/, 2 /* _3G_LED_GREEN */); #endif } @@ -1742,7 +1742,9 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance) if (intpr & SATA_DWC_INTPR_ERR) { sata_dwc_error_intr(ap, hsdev, intpr); handled = 1; - signal_hdd_led(0 /*off blink*/, 1 /*red color*/); +#if defined(CONFIG_APOLLO3G) + signal_hdd_led(0 /*off blink*/, 1 /*red color*/); +#endif goto done_irqrestore; } @@ -1928,8 +1930,8 @@ still_busy: done_irqrestore: spin_unlock_irqrestore(&host->lock, flags); -#if defined(CONFIG_APM82181) - signal_hdd_led(0 /*off blink*/, -1 /* no color */); +#if defined(CONFIG_APOLLO3G) + signal_hdd_led(0 /*off blink*/, -1 /* no color */); #endif return IRQ_RETVAL(handled); } diff --git a/drivers/char/hw_random/trng4xx.c b/drivers/char/hw_random/trng4xx.c index ece45e74aa1..ae62cc20693 100644 --- a/drivers/char/hw_random/trng4xx.c +++ b/drivers/char/hw_random/trng4xx.c @@ -162,7 +162,7 @@ static void trng4xx_chk_overflow(void) } __attribute__((packed)); - rc = trng4xx_hw_write32(TRNG4XX_ALARMCNT_ADDR, val); + rc = trng4xx_hw_read32(TRNG4XX_ALARMCNT_ADDR, &val); if (rc != 0) return; diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c index 9d81d8f7571..79fe7ec3306 100644 --- a/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c @@ -366,7 +366,6 @@ int crypto4xx_compute_gcm_hash_key_sw(struct crypto4xx_ctx *ctx, goto out; crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_inner_digest(ctx), src, 16); - out: crypto_free_blkcipher(aes_tfm); return rc; @@ -471,6 +470,7 @@ static int crypto4xx_setkey_3des(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -516,6 +516,8 @@ int crypto4xx_encrypt(struct ablkcipher_request *req) ctx->is_hash = 0; ctx->pd_ctl = 0x1; + CRYPTO4XX_TXLOG("encrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->nbytes); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, NULL, 0, req->info, get_dynamic_sa_iv_size(ctx)); @@ -530,6 +532,8 @@ int crypto4xx_decrypt(struct ablkcipher_request *req) ctx->pd_ctl = 0x1; ctx->direction = DIR_INBOUND; + CRYPTO4XX_TXLOG("decrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->nbytes); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, NULL, 0, req->info, get_dynamic_sa_iv_size(ctx)); @@ -545,6 +549,8 @@ int crypto4xx_encrypt_ctr(struct ablkcipher_request *req) ctx->pd_ctl = 0x1; ctx->direction = DIR_OUTBOUND; + CRYPTO4XX_TXLOG("encrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->nbytes); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, NULL, 0, req->info, @@ -561,6 +567,8 @@ int crypto4xx_decrypt_ctr(struct ablkcipher_request *req) ctx->pd_ctl = 0x1; ctx->direction = DIR_INBOUND; + CRYPTO4XX_TXLOG("decrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->nbytes); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, NULL, 0, req->info, @@ -637,6 +645,7 @@ static int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -728,6 +737,7 @@ int crypto4xx_setkey_aes_ctr(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -856,7 +866,8 @@ int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT_HASH; - + + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err: crypto4xx_free_sa(ctx); @@ -871,6 +882,8 @@ int crypto4xx_encrypt_aes_gcm(struct aead_request *req) ctx->direction = DIR_OUTBOUND; ctx->append_icv = 1; + CRYPTO4XX_TXLOG("encrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->cryptlen); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->cryptlen, req->assoc, req->assoclen, req->iv, crypto_aead_ivsize(aead)); @@ -882,6 +895,8 @@ int crypto4xx_decrypt_aes_gcm(struct aead_request *req) struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); int len = req->cryptlen - crypto_aead_authsize(aead); + CRYPTO4XX_TXLOG("decrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->cryptlen); ctx->direction = DIR_INBOUND; ctx->append_icv = 0; return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, @@ -993,7 +1008,7 @@ int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, const u8 *key, SA_SEQ_MASK_OFF, SA_MC_ENABLE, SA_NOT_COPY_PAD, SA_COPY_PAYLOAD, SA_NOT_COPY_HDR); - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -1153,6 +1168,7 @@ int crypto4xx_setkey_kasumi(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -1185,6 +1201,8 @@ int crypto4xx_encrypt_kasumi(struct ablkcipher_request *req) ctx->direction = DIR_OUTBOUND; ctx->pd_ctl = 0x1; + CRYPTO4XX_TXLOG("encrypt %s nbytes %d", + req->base.tfm->__crt_alg->cra_name, req->nbytes); return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, NULL, 0, NULL, 0); } @@ -1315,7 +1333,7 @@ int crypto4xx_setkey_arc4(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -1460,6 +1478,11 @@ int crypto4xx_hash_digest(struct ahash_request *req) ctx->pd_ctl = 0x11; ctx->direction = DIR_INBOUND; +#if 0 + ESP_PHD(KERN_CONT, "", DUMP_PREFIX_OFFSET, + 16, 1, + (void*)req, sizeof(struct ahash_request), false); +#endif return crypto4xx_build_pd(&req->base, ctx, req->src, (struct scatterlist *) req->result, req->nbytes, NULL, 0, NULL, 0); @@ -1550,7 +1573,8 @@ int crypto4xx_hash_hmac_setkey(struct crypto_ahash *hash, memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; - + + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err: crypto4xx_free_sa(ctx); @@ -1799,7 +1823,7 @@ int crypto4xx_xcbc_setkey(struct crypto_ahash *hash, memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa->sa_command_0.bf.dir = DIR_OUTBOUND; - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err: crypto4xx_free_sa(ctx); @@ -1872,7 +1896,7 @@ int crypto4xx_kasumi_f9_setkey(struct crypto_ahash *hash, ctx->hash_final = 1; ctx->pd_ctl = 0x11; ctx->bypass = 4; - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; } @@ -2093,7 +2117,7 @@ int crypto4xx_setkey_esp_tunnel(struct crypto_aead *cipher, ctx->is_hash = 0; ctx->pad_ctl = param->pad_block_size/4; ctx->append_icv = 0; - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_sr: @@ -3021,7 +3045,7 @@ int crypto4xx_setkey_macsec_gcm(struct crypto_aead *cipher, ctx->hash_final = 1; ctx->is_hash = 0; ctx->bypass = 0; - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_sr: @@ -3177,6 +3201,7 @@ static int crypto4xx_setkey_dtls(struct crypto_aead *cipher, CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_ON, SA_SEQ_MASK_OFF, SA_MC_ENABLE, SA_COPY_PAD, SA_COPY_PAYLOAD, SA_COPY_HDR); + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_sr: @@ -3413,7 +3438,7 @@ static int crypto4xx_setkey_ssl_tls(struct crypto_aead *cipher, SA_COPY_PAD, SA_COPY_PAYLOAD, SA_COPY_HDR); - + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_sr: @@ -3617,7 +3642,8 @@ int crypto4xx_setkey_ssl_tls_arc4(struct crypto_aead *cipher, sa->sa_command_1.bf.arc4_stateful = 1; sa->sa_command_1.bf.save_arc4_state = 1; - + + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_arc4: @@ -4070,11 +4096,11 @@ int crypto4xx_setkey_transport_esp_rfc4106_gcm(struct crypto_aead *cipher, ctx->authenc = 0; ctx->hash_final = 1; ctx->is_hash = 0; - printk("param->pad_block_size = %d\n", param->pad_block_size); //ctx->pad_ctl = param->pad_block_size / 4; ctx->pad_ctl = 0x08; ctx->append_icv = 0; + CRYPTO4XX_DEBUG("alg %s setkey", crypto_tfm_alg_name(tfm)); return 0; err_nomem_sr: diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 8c00e30e9e6..f1721e85770 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1279,9 +1279,10 @@ u32 crypto4xx_build_pd(struct crypto_async_request *req, */ crypto4xx_memcpy_le(pd_uinfo->sr_va + CTR_RFC3686_NONCE_SIZE, iv, iv_len); - } else + } else { crypto4xx_memcpy_le(pd_uinfo->sr_va, iv, iv_len); + } } if (ctx->is_gcm || ctx->ctr_aes) { u32 seq = 1; @@ -1444,14 +1445,15 @@ u32 crypto4xx_build_pd(struct crypto_async_request *req, pd_uinfo->state = PD_ENTRY_INUSE; wmb(); /* write any value to push engine to read a pd */ + if (dev->core_dev->revb_ver == 1) { #ifndef CONFIG_SEC_HW_POLL writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); #endif - } else + } else { writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); + } - dev->pkt_cnt++; return -EINPROGRESS; } @@ -1596,14 +1598,16 @@ static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data) { struct device *dev = (struct device *)data; struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); - //u32 int_status; + u32 int_status, dev_status; if (core_dev->dev->ce_base == 0) return 0; - //int_status = readl(core_dev->dev->ce_base + CRYPTO4XX_INT_UNMASK_STAT); - //printk("Interrupt status = 0x%08x\n", int_status); + int_status = readl(core_dev->dev->ce_base + CRYPTO4XX_INT_UNMASK_STA |