aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-10-20 12:30:25 -0400
committerArnd Bergmann <arnd@arndb.de>2011-10-20 12:30:25 -0400
commit995a0605a6665858d73f9e80053414909be33f27 (patch)
treefcc66a6a77acdaae492f77c0c58c0233db74a2b4 /arch/arm/mach-at91
parenta32750c2ca6f697903b19063fc86f4272865e3a1 (diff)
parent677d3e2f07d1b3d6d2f76fd5552d16a53b9236a0 (diff)
Merge branch 'at91/trng' into next/driver
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c7
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c29
3 files changed, 37 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index d522b47e30b5..6c8e3b5f669f 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -157,7 +157,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
157 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 157 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
158 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), 158 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
159 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), 159 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
160 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc1_clk), 160 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
161 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 161 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
162 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 162 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
163 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 163 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index e04c5fb6f1ee..06910598819a 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -53,6 +53,11 @@ static struct clk pioDE_clk = {
53 .pmc_mask = 1 << AT91SAM9G45_ID_PIODE, 53 .pmc_mask = 1 << AT91SAM9G45_ID_PIODE,
54 .type = CLK_TYPE_PERIPHERAL, 54 .type = CLK_TYPE_PERIPHERAL,
55}; 55};
56static struct clk trng_clk = {
57 .name = "trng_clk",
58 .pmc_mask = 1 << AT91SAM9G45_ID_TRNG,
59 .type = CLK_TYPE_PERIPHERAL,
60};
56static struct clk usart0_clk = { 61static struct clk usart0_clk = {
57 .name = "usart0_clk", 62 .name = "usart0_clk",
58 .pmc_mask = 1 << AT91SAM9G45_ID_US0, 63 .pmc_mask = 1 << AT91SAM9G45_ID_US0,
@@ -176,6 +181,7 @@ static struct clk *periph_clocks[] __initdata = {
176 &pioB_clk, 181 &pioB_clk,
177 &pioC_clk, 182 &pioC_clk,
178 &pioDE_clk, 183 &pioDE_clk,
184 &trng_clk,
179 &usart0_clk, 185 &usart0_clk,
180 &usart1_clk, 186 &usart1_clk,
181 &usart2_clk, 187 &usart2_clk,
@@ -215,6 +221,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
215 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), 221 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
216 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 222 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
217 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 223 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
224 CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
218}; 225};
219 226
220static struct clk_lookup usart_clocks_lookups[] = { 227static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 600bffb01edb..ee1efa4f8807 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1095,6 +1095,34 @@ static void __init at91_add_device_rtt(void)
1095 1095
1096 1096
1097/* -------------------------------------------------------------------- 1097/* --------------------------------------------------------------------
1098 * TRNG
1099 * -------------------------------------------------------------------- */
1100
1101#if defined(CONFIG_HW_RANDOM_ATMEL) || defined(CONFIG_HW_RANDOM_ATMEL_MODULE)
1102static struct resource trng_resources[] = {
1103 {
1104 .start = AT91SAM9G45_BASE_TRNG,
1105 .end = AT91SAM9G45_BASE_TRNG + SZ_16K - 1,
1106 .flags = IORESOURCE_MEM,
1107 },
1108};
1109
1110static struct platform_device at91sam9g45_trng_device = {
1111 .name = "atmel-trng",
1112 .id = -1,
1113 .resource = trng_resources,
1114 .num_resources = ARRAY_SIZE(trng_resources),
1115};
1116
1117static void __init at91_add_device_trng(void)
1118{
1119 platform_device_register(&at91sam9g45_trng_device);
1120}
1121#else
1122static void __init at91_add_device_trng(void) {}
1123#endif
1124
1125/* --------------------------------------------------------------------
1098 * Watchdog 1126 * Watchdog
1099 * -------------------------------------------------------------------- */ 1127 * -------------------------------------------------------------------- */
1100 1128
@@ -1583,6 +1611,7 @@ static int __init at91_add_standard_devices(void)
1583 at91_add_device_hdmac(); 1611 at91_add_device_hdmac();
1584 at91_add_device_rtc(); 1612 at91_add_device_rtc();
1585 at91_add_device_rtt(); 1613 at91_add_device_rtt();
1614 at91_add_device_trng();
1586 at91_add_device_watchdog(); 1615 at91_add_device_watchdog();
1587 at91_add_device_tc(); 1616 at91_add_device_tc();
1588 return 0; 1617 return 0;