aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c7
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c29
2 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 1532b508c814..00c0a78fc12c 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -54,6 +54,11 @@ static struct clk pioDE_clk = {
54 .pmc_mask = 1 << AT91SAM9G45_ID_PIODE, 54 .pmc_mask = 1 << AT91SAM9G45_ID_PIODE,
55 .type = CLK_TYPE_PERIPHERAL, 55 .type = CLK_TYPE_PERIPHERAL,
56}; 56};
57static struct clk trng_clk = {
58 .name = "trng_clk",
59 .pmc_mask = 1 << AT91SAM9G45_ID_TRNG,
60 .type = CLK_TYPE_PERIPHERAL,
61};
57static struct clk usart0_clk = { 62static struct clk usart0_clk = {
58 .name = "usart0_clk", 63 .name = "usart0_clk",
59 .pmc_mask = 1 << AT91SAM9G45_ID_US0, 64 .pmc_mask = 1 << AT91SAM9G45_ID_US0,
@@ -177,6 +182,7 @@ static struct clk *periph_clocks[] __initdata = {
177 &pioB_clk, 182 &pioB_clk,
178 &pioC_clk, 183 &pioC_clk,
179 &pioDE_clk, 184 &pioDE_clk,
185 &trng_clk,
180 &usart0_clk, 186 &usart0_clk,
181 &usart1_clk, 187 &usart1_clk,
182 &usart2_clk, 188 &usart2_clk,
@@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
216 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), 222 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
217 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 223 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
218 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 224 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
225 CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
219}; 226};
220 227
221static struct clk_lookup usart_clocks_lookups[] = { 228static 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 c3dfb1b3b1e3..2d6d57f7ba8a 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;