aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c48
-rw-r--r--arch/arm/mach-ux500/clock.c18
-rw-r--r--arch/arm/mach-ux500/devices-common.h50
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c3
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h4
-rw-r--r--arch/arm/mach-ux500/include/mach/crypto-ux500.h22
-rw-r--r--arch/arm/mach-ux500/include/mach/devices.h3
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h3
8 files changed, 143 insertions, 8 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 4bc0cbc5f07..f943687acaf 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -47,6 +47,7 @@
47#include <mach/setup.h> 47#include <mach/setup.h>
48#include <mach/devices.h> 48#include <mach/devices.h>
49#include <mach/irqs.h> 49#include <mach/irqs.h>
50#include <mach/crypto-ux500.h>
50 51
51#include "ste-dma40-db8500.h" 52#include "ste-dma40-db8500.h"
52#include "devices-db8500.h" 53#include "devices-db8500.h"
@@ -417,6 +418,45 @@ static void mop500_prox_deactivate(struct device *dev)
417 regulator_put(prox_regulator); 418 regulator_put(prox_regulator);
418} 419}
419 420
421static struct cryp_platform_data u8500_cryp1_platform_data = {
422 .mem_to_engine = {
423 .dir = STEDMA40_MEM_TO_PERIPH,
424 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
425 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
426 .src_info.data_width = STEDMA40_WORD_WIDTH,
427 .dst_info.data_width = STEDMA40_WORD_WIDTH,
428 .mode = STEDMA40_MODE_LOGICAL,
429 .src_info.psize = STEDMA40_PSIZE_LOG_4,
430 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
431 },
432 .engine_to_mem = {
433 .dir = STEDMA40_PERIPH_TO_MEM,
434 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
435 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
436 .src_info.data_width = STEDMA40_WORD_WIDTH,
437 .dst_info.data_width = STEDMA40_WORD_WIDTH,
438 .mode = STEDMA40_MODE_LOGICAL,
439 .src_info.psize = STEDMA40_PSIZE_LOG_4,
440 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
441 }
442};
443
444static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
445 .dir = STEDMA40_MEM_TO_PERIPH,
446 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
447 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
448 .src_info.data_width = STEDMA40_WORD_WIDTH,
449 .dst_info.data_width = STEDMA40_WORD_WIDTH,
450 .mode = STEDMA40_MODE_LOGICAL,
451 .src_info.psize = STEDMA40_PSIZE_LOG_16,
452 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
453};
454
455static struct hash_platform_data u8500_hash1_platform_data = {
456 .mem_to_engine = &u8500_hash_dma_cfg_tx,
457 .dma_filter = stedma40_filter,
458};
459
420/* add any platform devices here - TODO */ 460/* add any platform devices here - TODO */
421static struct platform_device *mop500_platform_devs[] __initdata = { 461static struct platform_device *mop500_platform_devs[] __initdata = {
422 &mop500_gpio_keys_device, 462 &mop500_gpio_keys_device,
@@ -624,6 +664,12 @@ static void __init mop500_uart_init(struct device *parent)
624 db8500_add_uart2(parent, &uart2_plat); 664 db8500_add_uart2(parent, &uart2_plat);
625} 665}
626 666
667static void __init u8500_cryp1_hash1_init(struct device *parent)
668{
669 db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
670 db8500_add_hash1(parent, &u8500_hash1_platform_data);
671}
672
627static struct platform_device *snowball_platform_devs[] __initdata = { 673static struct platform_device *snowball_platform_devs[] __initdata = {
628 &snowball_led_dev, 674 &snowball_led_dev,
629 &snowball_key_dev, 675 &snowball_key_dev,
@@ -654,6 +700,8 @@ static void __init mop500_init_machine(void)
654 mop500_msp_init(parent); 700 mop500_msp_init(parent);
655 mop500_uart_init(parent); 701 mop500_uart_init(parent);
656 702
703 u8500_cryp1_hash1_init(parent);
704
657 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 705 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
658 706
659 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 707 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index a121cb472dd..1762c4728f1 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -381,14 +381,15 @@ static DEFINE_PRCC_CLK(5, usb, 0, 0, NULL);
381/* Peripheral Cluster #6 */ 381/* Peripheral Cluster #6 */
382 382
383/* MTU ID in data */ 383/* MTU ID in data */
384static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 8, -1, NULL, clk_mtu_get_rate, 1); 384static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 9, -1, NULL, clk_mtu_get_rate, 1);
385static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 7, -1, NULL, clk_mtu_get_rate, 0); 385static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 8, -1, NULL, clk_mtu_get_rate, 0);
386static DEFINE_PRCC_CLK(6, cfgreg, 6, 6, NULL); 386static DEFINE_PRCC_CLK(6, cfgreg, 7, 7, NULL);
387static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); 387static DEFINE_PRCC_CLK(6, hash1, 6, -1, NULL);
388static DEFINE_PRCC_CLK(6, unipro, 4, 1, &clk_uniproclk); 388static DEFINE_PRCC_CLK(6, unipro, 5, 1, &clk_uniproclk);
389static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); 389static DEFINE_PRCC_CLK(6, pka, 4, -1, NULL);
390static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); 390static DEFINE_PRCC_CLK(6, hash0, 3, -1, NULL);
391static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); 391static DEFINE_PRCC_CLK(6, cryp0, 2, -1, NULL);
392static DEFINE_PRCC_CLK(6, cryp1, 1, -1, NULL);
392static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk); 393static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk);
393 394
394static struct clk clk_dummy_apb_pclk = { 395static struct clk clk_dummy_apb_pclk = {
@@ -430,6 +431,7 @@ static struct clk_lookup u8500_clks[] = {
430 CLK(pka, "pka", NULL), 431 CLK(pka, "pka", NULL),
431 CLK(hash0, "hash0", NULL), 432 CLK(hash0, "hash0", NULL),
432 CLK(cryp0, "cryp0", NULL), 433 CLK(cryp0, "cryp0", NULL),
434 CLK(cryp1, "cryp1", NULL),
433 435
434 /* PRCMU level clock gating */ 436 /* PRCMU level clock gating */
435 437
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index 7cbccfd9e15..6e470656026 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -13,6 +13,7 @@
13#include <linux/sys_soc.h> 13#include <linux/sys_soc.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <plat/i2c.h> 15#include <plat/i2c.h>
16#include <mach/crypto-ux500.h>
16 17
17struct spi_master_cntlr; 18struct spi_master_cntlr;
18 19
@@ -85,6 +86,55 @@ dbx500_add_rtc(struct device *parent, resource_size_t base, int irq)
85 0, NULL, 0); 86 0, NULL, 0);
86} 87}
87 88
89struct cryp_platform_data;
90
91static inline struct platform_device *
92dbx500_add_cryp1(struct device *parent, int id, resource_size_t base, int irq,
93 struct cryp_platform_data *pdata)
94{
95 struct resource res[] = {
96 DEFINE_RES_MEM(base, SZ_4K),
97 DEFINE_RES_IRQ(irq),
98 };
99
100 struct platform_device_info pdevinfo = {
101 .parent = parent,
102 .name = "cryp1",
103 .id = id,
104 .res = res,
105 .num_res = ARRAY_SIZE(res),
106 .data = pdata,
107 .size_data = sizeof(*pdata),
108 .dma_mask = DMA_BIT_MASK(32),
109 };
110
111 return platform_device_register_full(&pdevinfo);
112}
113
114struct hash_platform_data;
115
116static inline struct platform_device *
117dbx500_add_hash1(struct device *parent, int id, resource_size_t base,
118 struct hash_platform_data *pdata)
119{
120 struct resource res[] = {
121 DEFINE_RES_MEM(base, SZ_4K),
122 };
123
124 struct platform_device_info pdevinfo = {
125 .parent = parent,
126 .name = "hash1",
127 .id = id,
128 .res = res,
129 .num_res = ARRAY_SIZE(res),
130 .data = pdata,
131 .size_data = sizeof(*pdata),
132 .dma_mask = DMA_BIT_MASK(32),
133 };
134
135 return platform_device_register_full(&pdevinfo);
136}
137
88struct nmk_gpio_platform_data; 138struct nmk_gpio_platform_data;
89 139
90void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, 140void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num,
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index 6e66d3777ed..91754a8a0d4 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -104,6 +104,8 @@ static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = {
104 [DB8500_DMA_DEV14_MSP2_TX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, 104 [DB8500_DMA_DEV14_MSP2_TX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET,
105 [DB8500_DMA_DEV30_MSP1_TX] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET, 105 [DB8500_DMA_DEV30_MSP1_TX] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET,
106 [DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, 106 [DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET,
107 [DB8500_DMA_DEV48_CAC1_TX] = U8500_CRYP1_BASE + CRYP1_TX_REG_OFFSET,
108 [DB8500_DMA_DEV50_HAC1_TX] = U8500_HASH1_BASE + HASH1_TX_REG_OFFSET,
107}; 109};
108 110
109/* Mapping between source event lines and physical device address */ 111/* Mapping between source event lines and physical device address */
@@ -139,6 +141,7 @@ static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = {
139 [DB8500_DMA_DEV14_MSP2_RX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, 141 [DB8500_DMA_DEV14_MSP2_RX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET,
140 [DB8500_DMA_DEV30_MSP3_RX] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET, 142 [DB8500_DMA_DEV30_MSP3_RX] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET,
141 [DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, 143 [DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET,
144 [DB8500_DMA_DEV48_CAC1_RX] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET,
142}; 145};
143 146
144/* Reserved event lines for memcpy only */ 147/* Reserved event lines for memcpy only */
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index 0b9677a95bb..3c8010f4fb3 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -114,4 +114,8 @@ db8500_add_ssp(struct device *parent, const char *name, resource_size_t base,
114 dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \ 114 dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \
115 IRQ_DB8500_UART2, pdata) 115 IRQ_DB8500_UART2, pdata)
116 116
117#define db8500_add_cryp1(parent, pdata) \
118 dbx500_add_cryp1(parent, -1, U8500_CRYP1_BASE, IRQ_DB8500_CRYP1, pdata)
119#define db8500_add_hash1(parent, pdata) \
120 dbx500_add_hash1(parent, -1, U8500_HASH1_BASE, pdata)
117#endif 121#endif
diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/arch/arm/mach-ux500/include/mach/crypto-ux500.h
new file mode 100644
index 00000000000..5b2d0817e26
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/crypto-ux500.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef _CRYPTO_UX500_H
8#define _CRYPTO_UX500_H
9#include <linux/dmaengine.h>
10#include <plat/ste_dma40.h>
11
12struct hash_platform_data {
13 void *mem_to_engine;
14 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
15};
16
17struct cryp_platform_data {
18 struct stedma40_chan_cfg mem_to_engine;
19 struct stedma40_chan_cfg engine_to_mem;
20};
21
22#endif
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h
index 9b5eb69a015..cbc6f1e4104 100644
--- a/arch/arm/mach-ux500/include/mach/devices.h
+++ b/arch/arm/mach-ux500/include/mach/devices.h
@@ -14,6 +14,9 @@ extern struct platform_device u8500_gpio_devs[];
14 14
15extern struct amba_device ux500_pl031_device; 15extern struct amba_device ux500_pl031_device;
16 16
17extern struct platform_device ux500_hash1_device;
18extern struct platform_device ux500_cryp1_device;
19
17extern struct platform_device u8500_dma40_device; 20extern struct platform_device u8500_dma40_device;
18extern struct platform_device ux500_ske_keypad_device; 21extern struct platform_device ux500_ske_keypad_device;
19 22
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index 808c1d6601c..28d16e744bf 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -33,6 +33,9 @@
33#include <mach/db8500-regs.h> 33#include <mach/db8500-regs.h>
34 34
35#define MSP_TX_RX_REG_OFFSET 0 35#define MSP_TX_RX_REG_OFFSET 0
36#define CRYP1_RX_REG_OFFSET 0x10
37#define CRYP1_TX_REG_OFFSET 0x8
38#define HASH1_TX_REG_OFFSET 0x4
36 39
37#ifndef __ASSEMBLY__ 40#ifndef __ASSEMBLY__
38 41