aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
authorAndreas Westin <andreas.westin@stericsson.com>2012-05-10 04:14:06 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2012-05-15 03:25:32 -0400
commit585d188f8072aa3722d5c1ec1f0f2ea82e474778 (patch)
tree6b988ce236ed31fec51099458e23190737ac3218 /arch/arm/mach-ux500/board-mop500.c
parentb29e2679d0da91c60d3ac190d9c3bd65ac2f68c5 (diff)
mach-ux500: crypto - core support for CRYP/HASH module.
This adds the required platform data and calls to enable the CRYP/HASH driver. Signed-off-by: Andreas Westin <andreas.westin@stericsson.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 29d330374994..67e657e24b1d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -44,6 +44,7 @@
44#include <mach/setup.h> 44#include <mach/setup.h>
45#include <mach/devices.h> 45#include <mach/devices.h>
46#include <mach/irqs.h> 46#include <mach/irqs.h>
47#include <mach/crypto-ux500.h>
47 48
48#include "pins-db8500.h" 49#include "pins-db8500.h"
49#include "ste-dma40-db8500.h" 50#include "ste-dma40-db8500.h"
@@ -414,6 +415,45 @@ static void mop500_prox_deactivate(struct device *dev)
414 regulator_put(prox_regulator); 415 regulator_put(prox_regulator);
415} 416}
416 417
418static struct cryp_platform_data u8500_cryp1_platform_data = {
419 .mem_to_engine = {
420 .dir = STEDMA40_MEM_TO_PERIPH,
421 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
422 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
423 .src_info.data_width = STEDMA40_WORD_WIDTH,
424 .dst_info.data_width = STEDMA40_WORD_WIDTH,
425 .mode = STEDMA40_MODE_LOGICAL,
426 .src_info.psize = STEDMA40_PSIZE_LOG_4,
427 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
428 },
429 .engine_to_mem = {
430 .dir = STEDMA40_PERIPH_TO_MEM,
431 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
432 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
433 .src_info.data_width = STEDMA40_WORD_WIDTH,
434 .dst_info.data_width = STEDMA40_WORD_WIDTH,
435 .mode = STEDMA40_MODE_LOGICAL,
436 .src_info.psize = STEDMA40_PSIZE_LOG_4,
437 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
438 }
439};
440
441static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
442 .dir = STEDMA40_MEM_TO_PERIPH,
443 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
444 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
445 .src_info.data_width = STEDMA40_WORD_WIDTH,
446 .dst_info.data_width = STEDMA40_WORD_WIDTH,
447 .mode = STEDMA40_MODE_LOGICAL,
448 .src_info.psize = STEDMA40_PSIZE_LOG_16,
449 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
450};
451
452static struct hash_platform_data u8500_hash1_platform_data = {
453 .mem_to_engine = &u8500_hash_dma_cfg_tx,
454 .dma_filter = stedma40_filter,
455};
456
417/* add any platform devices here - TODO */ 457/* add any platform devices here - TODO */
418static struct platform_device *mop500_platform_devs[] __initdata = { 458static struct platform_device *mop500_platform_devs[] __initdata = {
419 &mop500_gpio_keys_device, 459 &mop500_gpio_keys_device,
@@ -599,6 +639,12 @@ static void __init mop500_uart_init(struct device *parent)
599 db8500_add_uart2(parent, &uart2_plat); 639 db8500_add_uart2(parent, &uart2_plat);
600} 640}
601 641
642static void __init u8500_cryp1_hash1_init(struct device *parent)
643{
644 db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
645 db8500_add_hash1(parent, &u8500_hash1_platform_data);
646}
647
602static struct platform_device *snowball_platform_devs[] __initdata = { 648static struct platform_device *snowball_platform_devs[] __initdata = {
603 &snowball_led_dev, 649 &snowball_led_dev,
604 &snowball_key_dev, 650 &snowball_key_dev,
@@ -629,6 +675,8 @@ static void __init mop500_init_machine(void)
629 mop500_spi_init(parent); 675 mop500_spi_init(parent);
630 mop500_uart_init(parent); 676 mop500_uart_init(parent);
631 677
678 u8500_cryp1_hash1_init(parent);
679
632 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 680 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
633 681
634 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 682 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);