diff options
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 48 | ||||
-rw-r--r-- | arch/arm/mach-ux500/clock.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-common.h | 54 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-db8500.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-db8500.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/crypto-ux500.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/hardware.h | 3 |
8 files changed, 126 insertions, 8 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 | ||
418 | static 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 | |||
441 | static 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 | |||
452 | static 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 */ |
418 | static struct platform_device *mop500_platform_devs[] __initdata = { | 458 | static 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 | ||
642 | static 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 | |||
602 | static struct platform_device *snowball_platform_devs[] __initdata = { | 648 | static 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); |
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index ec35f0aa5665..2efc1fe236c3 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
@@ -382,14 +382,15 @@ static DEFINE_PRCC_CLK(5, usb, 0, 0, NULL); | |||
382 | /* Peripheral Cluster #6 */ | 382 | /* Peripheral Cluster #6 */ |
383 | 383 | ||
384 | /* MTU ID in data */ | 384 | /* MTU ID in data */ |
385 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 8, -1, NULL, clk_mtu_get_rate, 1); | 385 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 9, -1, NULL, clk_mtu_get_rate, 1); |
386 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 7, -1, NULL, clk_mtu_get_rate, 0); | 386 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 8, -1, NULL, clk_mtu_get_rate, 0); |
387 | static DEFINE_PRCC_CLK(6, cfgreg, 6, 6, NULL); | 387 | static DEFINE_PRCC_CLK(6, cfgreg, 7, 7, NULL); |
388 | static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); | 388 | static DEFINE_PRCC_CLK(6, hash1, 6, -1, NULL); |
389 | static DEFINE_PRCC_CLK(6, unipro, 4, 1, &clk_uniproclk); | 389 | static DEFINE_PRCC_CLK(6, unipro, 5, 1, &clk_uniproclk); |
390 | static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); | 390 | static DEFINE_PRCC_CLK(6, pka, 4, -1, NULL); |
391 | static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); | 391 | static DEFINE_PRCC_CLK(6, hash0, 3, -1, NULL); |
392 | static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); | 392 | static DEFINE_PRCC_CLK(6, cryp0, 2, -1, NULL); |
393 | static DEFINE_PRCC_CLK(6, cryp1, 1, -1, NULL); | ||
393 | static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk); | 394 | static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk); |
394 | 395 | ||
395 | static struct clk clk_dummy_apb_pclk = { | 396 | static struct clk clk_dummy_apb_pclk = { |
@@ -431,6 +432,7 @@ static struct clk_lookup u8500_clks[] = { | |||
431 | CLK(pka, "pka", NULL), | 432 | CLK(pka, "pka", NULL), |
432 | CLK(hash0, "hash0", NULL), | 433 | CLK(hash0, "hash0", NULL), |
433 | CLK(cryp0, "cryp0", NULL), | 434 | CLK(cryp0, "cryp0", NULL), |
435 | CLK(cryp1, "cryp1", NULL), | ||
434 | 436 | ||
435 | /* PRCMU level clock gating */ | 437 | /* PRCMU level clock gating */ |
436 | 438 | ||
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h index 39c74ec82add..89c5a59b3295 100644 --- a/arch/arm/mach-ux500/devices-common.h +++ b/arch/arm/mach-ux500/devices-common.h | |||
@@ -12,12 +12,17 @@ | |||
12 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
13 | #include <linux/sys_soc.h> | 13 | #include <linux/sys_soc.h> |
14 | #include <plat/i2c.h> | 14 | #include <plat/i2c.h> |
15 | #include <mach/crypto-ux500.h> | ||
15 | 16 | ||
16 | extern struct amba_device * | 17 | extern struct amba_device * |
17 | dbx500_add_amba_device(struct device *parent, const char *name, | 18 | dbx500_add_amba_device(struct device *parent, const char *name, |
18 | resource_size_t base, int irq, void *pdata, | 19 | resource_size_t base, int irq, void *pdata, |
19 | unsigned int periphid); | 20 | unsigned int periphid); |
20 | 21 | ||
22 | extern struct platform_device * | ||
23 | dbx500_add_platform_device_noirq(const char *name, int id, | ||
24 | resource_size_t base, void *pdata); | ||
25 | |||
21 | struct spi_master_cntlr; | 26 | struct spi_master_cntlr; |
22 | 27 | ||
23 | static inline struct amba_device * | 28 | static inline struct amba_device * |
@@ -88,6 +93,55 @@ dbx500_add_rtc(struct device *parent, resource_size_t base, int irq) | |||
88 | return dbx500_add_amba_device(parent, "rtc-pl031", base, irq, NULL, 0); | 93 | return dbx500_add_amba_device(parent, "rtc-pl031", base, irq, NULL, 0); |
89 | } | 94 | } |
90 | 95 | ||
96 | struct cryp_platform_data; | ||
97 | |||
98 | static inline struct platform_device * | ||
99 | dbx500_add_cryp1(struct device *parent, int id, resource_size_t base, int irq, | ||
100 | struct cryp_platform_data *pdata) | ||
101 | { | ||
102 | struct resource res[] = { | ||
103 | DEFINE_RES_MEM(base, SZ_4K), | ||
104 | DEFINE_RES_IRQ(irq), | ||
105 | }; | ||
106 | |||
107 | struct platform_device_info pdevinfo = { | ||
108 | .parent = parent, | ||
109 | .name = "cryp1", | ||
110 | .id = id, | ||
111 | .res = res, | ||
112 | .num_res = ARRAY_SIZE(res), | ||
113 | .data = pdata, | ||
114 | .size_data = sizeof(*pdata), | ||
115 | .dma_mask = DMA_BIT_MASK(32), | ||
116 | }; | ||
117 | |||
118 | return platform_device_register_full(&pdevinfo); | ||
119 | } | ||
120 | |||
121 | struct hash_platform_data; | ||
122 | |||
123 | static inline struct platform_device * | ||
124 | dbx500_add_hash1(struct device *parent, int id, resource_size_t base, | ||
125 | struct hash_platform_data *pdata) | ||
126 | { | ||
127 | struct resource res[] = { | ||
128 | DEFINE_RES_MEM(base, SZ_4K), | ||
129 | }; | ||
130 | |||
131 | struct platform_device_info pdevinfo = { | ||
132 | .parent = parent, | ||
133 | .name = "hash1", | ||
134 | .id = id, | ||
135 | .res = res, | ||
136 | .num_res = ARRAY_SIZE(res), | ||
137 | .data = pdata, | ||
138 | .size_data = sizeof(*pdata), | ||
139 | .dma_mask = DMA_BIT_MASK(32), | ||
140 | }; | ||
141 | |||
142 | return platform_device_register_full(&pdevinfo); | ||
143 | } | ||
144 | |||
91 | struct nmk_gpio_platform_data; | 145 | struct nmk_gpio_platform_data; |
92 | 146 | ||
93 | void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, | 147 | void 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 6e66d3777ed5..91754a8a0d49 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 9fd93e9da529..cdf5ca8ce588 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h | |||
@@ -124,4 +124,8 @@ db8500_add_ssp(struct device *parent, const char *name, resource_size_t base, | |||
124 | dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \ | 124 | dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \ |
125 | IRQ_DB8500_UART2, pdata) | 125 | IRQ_DB8500_UART2, pdata) |
126 | 126 | ||
127 | #define db8500_add_cryp1(parent, pdata) \ | ||
128 | dbx500_add_cryp1(parent, -1, U8500_CRYP1_BASE, IRQ_DB8500_CRYP1, pdata) | ||
129 | #define db8500_add_hash1(parent, pdata) \ | ||
130 | dbx500_add_hash1(parent, -1, U8500_HASH1_BASE, pdata) | ||
127 | #endif | 131 | #endif |
diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/arch/arm/mach-ux500/include/mach/crypto-ux500.h index de40add19166..5b2d0817e26a 100644 --- a/arch/arm/mach-ux500/include/mach/crypto-ux500.h +++ b/arch/arm/mach-ux500/include/mach/crypto-ux500.h | |||
@@ -5,6 +5,7 @@ | |||
5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
6 | */ | 6 | */ |
7 | #ifndef _CRYPTO_UX500_H | 7 | #ifndef _CRYPTO_UX500_H |
8 | #define _CRYPTO_UX500_H | ||
8 | #include <linux/dmaengine.h> | 9 | #include <linux/dmaengine.h> |
9 | #include <plat/ste_dma40.h> | 10 | #include <plat/ste_dma40.h> |
10 | 11 | ||
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h index 5f6cb71fc62d..a55454a5b21e 100644 --- a/arch/arm/mach-ux500/include/mach/devices.h +++ b/arch/arm/mach-ux500/include/mach/devices.h | |||
@@ -15,6 +15,9 @@ extern struct platform_device u8500_gpio_devs[]; | |||
15 | 15 | ||
16 | extern struct amba_device ux500_pl031_device; | 16 | extern struct amba_device ux500_pl031_device; |
17 | 17 | ||
18 | extern struct platform_device ux500_hash1_device; | ||
19 | extern struct platform_device ux500_cryp1_device; | ||
20 | |||
18 | extern struct platform_device u8500_dma40_device; | 21 | extern struct platform_device u8500_dma40_device; |
19 | extern struct platform_device ux500_ske_keypad_device; | 22 | extern struct platform_device ux500_ske_keypad_device; |
20 | 23 | ||
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h index d93d6dbef25b..1451f58158bf 100644 --- a/arch/arm/mach-ux500/include/mach/hardware.h +++ b/arch/arm/mach-ux500/include/mach/hardware.h | |||
@@ -31,6 +31,9 @@ | |||
31 | #include <mach/db5500-regs.h> | 31 | #include <mach/db5500-regs.h> |
32 | 32 | ||
33 | #define MSP_TX_RX_REG_OFFSET 0 | 33 | #define MSP_TX_RX_REG_OFFSET 0 |
34 | #define CRYP1_RX_REG_OFFSET 0x10 | ||
35 | #define CRYP1_TX_REG_OFFSET 0x8 | ||
36 | #define HASH1_TX_REG_OFFSET 0x4 | ||
34 | 37 | ||
35 | #ifndef __ASSEMBLY__ | 38 | #ifndef __ASSEMBLY__ |
36 | 39 | ||