aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2016-10-18 03:55:27 -0400
committerTony Lindgren <tony@atomide.com>2016-11-09 17:39:41 -0500
commitd88d30e7b55df8f2bee91c1afe27f052a3128bb8 (patch)
tree16dcb9b88108cfa6c22aa6b8512f18e15a6a99ed
parentd7e4c12856efe3fc60a33cce7bbeedf27cec45f7 (diff)
ARM: AMx3xx: hwmod: Add data for RNG
Hardware random number generator is present in both AM33xx and AM43xx SoC's. So moving the hwmod data to common data. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c8
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c29
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c35
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_43xx_data.c1
-rw-r--r--arch/arm/mach-omap2/prcm43xx.h1
6 files changed, 41 insertions, 35 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
index d3e61d1a02d7..434bd1a77229 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
@@ -68,6 +68,7 @@ extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart6;
68extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc; 68extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc;
69extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0; 69extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0;
70extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0; 70extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0;
71extern struct omap_hwmod_ocp_if am33xx_l4_per__rng;
71 72
72extern struct omap_hwmod am33xx_l3_main_hwmod; 73extern struct omap_hwmod am33xx_l3_main_hwmod;
73extern struct omap_hwmod am33xx_l3_s_hwmod; 74extern struct omap_hwmod am33xx_l3_s_hwmod;
@@ -80,6 +81,7 @@ extern struct omap_hwmod am33xx_gfx_hwmod;
80extern struct omap_hwmod am33xx_prcm_hwmod; 81extern struct omap_hwmod am33xx_prcm_hwmod;
81extern struct omap_hwmod am33xx_aes0_hwmod; 82extern struct omap_hwmod am33xx_aes0_hwmod;
82extern struct omap_hwmod am33xx_sha0_hwmod; 83extern struct omap_hwmod am33xx_sha0_hwmod;
84extern struct omap_hwmod am33xx_rng_hwmod;
83extern struct omap_hwmod am33xx_ocmcram_hwmod; 85extern struct omap_hwmod am33xx_ocmcram_hwmod;
84extern struct omap_hwmod am33xx_smartreflex0_hwmod; 86extern struct omap_hwmod am33xx_smartreflex0_hwmod;
85extern struct omap_hwmod am33xx_smartreflex1_hwmod; 87extern struct omap_hwmod am33xx_smartreflex1_hwmod;
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
index 10dff2f0086a..8236e5c49ec3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
@@ -547,3 +547,11 @@ struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
547 .addr = am33xx_aes0_addrs, 547 .addr = am33xx_aes0_addrs,
548 .user = OCP_USER_MPU | OCP_USER_SDMA, 548 .user = OCP_USER_MPU | OCP_USER_SDMA,
549}; 549};
550
551/* l4 per -> rng */
552struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
553 .master = &am33xx_l4_ls_hwmod,
554 .slave = &am33xx_rng_hwmod,
555 .clk = "rng_fck",
556 .user = OCP_USER_MPU,
557};
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index e2d84aa7f595..de06a1d5ffab 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -268,6 +268,33 @@ struct omap_hwmod am33xx_sha0_hwmod = {
268 }, 268 },
269}; 269};
270 270
271/* rng */
272static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
273 .rev_offs = 0x1fe0,
274 .sysc_offs = 0x1fe4,
275 .sysc_flags = SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
276 .idlemodes = SIDLE_FORCE | SIDLE_NO,
277 .sysc_fields = &omap_hwmod_sysc_type1,
278};
279
280static struct omap_hwmod_class am33xx_rng_hwmod_class = {
281 .name = "rng",
282 .sysc = &am33xx_rng_sysc,
283};
284
285struct omap_hwmod am33xx_rng_hwmod = {
286 .name = "rng",
287 .class = &am33xx_rng_hwmod_class,
288 .clkdm_name = "l4ls_clkdm",
289 .flags = HWMOD_SWSUP_SIDLE,
290 .main_clk = "rng_fck",
291 .prcm = {
292 .omap4 = {
293 .modulemode = MODULEMODE_SWCTRL,
294 },
295 },
296};
297
271/* ocmcram */ 298/* ocmcram */
272static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = { 299static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
273 .name = "ocmcram", 300 .name = "ocmcram",
@@ -1315,6 +1342,7 @@ static void omap_hwmod_am33xx_clkctrl(void)
1315 CLKCTRL(am33xx_ocmcram_hwmod , AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET); 1342 CLKCTRL(am33xx_ocmcram_hwmod , AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
1316 CLKCTRL(am33xx_sha0_hwmod , AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET); 1343 CLKCTRL(am33xx_sha0_hwmod , AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET);
1317 CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET); 1344 CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET);
1345 CLKCTRL(am33xx_rng_hwmod, AM33XX_CM_PER_RNG_CLKCTRL_OFFSET);
1318} 1346}
1319 1347
1320static void omap_hwmod_am33xx_rst(void) 1348static void omap_hwmod_am33xx_rst(void)
@@ -1388,6 +1416,7 @@ static void omap_hwmod_am43xx_clkctrl(void)
1388 CLKCTRL(am33xx_ocmcram_hwmod , AM43XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET); 1416 CLKCTRL(am33xx_ocmcram_hwmod , AM43XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
1389 CLKCTRL(am33xx_sha0_hwmod , AM43XX_CM_PER_SHA0_CLKCTRL_OFFSET); 1417 CLKCTRL(am33xx_sha0_hwmod , AM43XX_CM_PER_SHA0_CLKCTRL_OFFSET);
1390 CLKCTRL(am33xx_aes0_hwmod , AM43XX_CM_PER_AES0_CLKCTRL_OFFSET); 1418 CLKCTRL(am33xx_aes0_hwmod , AM43XX_CM_PER_AES0_CLKCTRL_OFFSET);
1419 CLKCTRL(am33xx_rng_hwmod, AM43XX_CM_PER_RNG_CLKCTRL_OFFSET);
1391} 1420}
1392 1421
1393static void omap_hwmod_am43xx_rst(void) 1422static void omap_hwmod_am43xx_rst(void)
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index e1c2025d6d3e..6dc51a774a26 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -503,41 +503,6 @@ static struct omap_hwmod_ocp_if am33xx_l3_s__usbss = {
503 .flags = OCPIF_SWSUP_IDLE, 503 .flags = OCPIF_SWSUP_IDLE,
504}; 504};
505 505
506/* rng */
507static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
508 .rev_offs = 0x1fe0,
509 .sysc_offs = 0x1fe4,
510 .sysc_flags = SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
511 .idlemodes = SIDLE_FORCE | SIDLE_NO,
512 .sysc_fields = &omap_hwmod_sysc_type1,
513};
514
515static struct omap_hwmod_class am33xx_rng_hwmod_class = {
516 .name = "rng",
517 .sysc = &am33xx_rng_sysc,
518};
519
520static struct omap_hwmod am33xx_rng_hwmod = {
521 .name = "rng",
522 .class = &am33xx_rng_hwmod_class,
523 .clkdm_name = "l4ls_clkdm",
524 .flags = HWMOD_SWSUP_SIDLE,
525 .main_clk = "rng_fck",
526 .prcm = {
527 .omap4 = {
528 .clkctrl_offs = AM33XX_CM_PER_RNG_CLKCTRL_OFFSET,
529 .modulemode = MODULEMODE_SWCTRL,
530 },
531 },
532};
533
534static struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
535 .master = &am33xx_l4_ls_hwmod,
536 .slave = &am33xx_rng_hwmod,
537 .clk = "rng_fck",
538 .user = OCP_USER_MPU,
539};
540
541static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { 506static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
542 &am33xx_l3_main__emif, 507 &am33xx_l3_main__emif,
543 &am33xx_mpu__l3_main, 508 &am33xx_mpu__l3_main,
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index 3f7dac067897..afbce1f6f641 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -949,6 +949,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
949 &am33xx_l4_per__i2c2, 949 &am33xx_l4_per__i2c2,
950 &am33xx_l4_per__i2c3, 950 &am33xx_l4_per__i2c3,
951 &am33xx_l4_per__mailbox, 951 &am33xx_l4_per__mailbox,
952 &am33xx_l4_per__rng,
952 &am33xx_l4_ls__mcasp0, 953 &am33xx_l4_ls__mcasp0,
953 &am33xx_l4_ls__mcasp1, 954 &am33xx_l4_ls__mcasp1,
954 &am33xx_l4_ls__mmc0, 955 &am33xx_l4_ls__mmc0,
diff --git a/arch/arm/mach-omap2/prcm43xx.h b/arch/arm/mach-omap2/prcm43xx.h
index 416968545e89..e2ad14e77064 100644
--- a/arch/arm/mach-omap2/prcm43xx.h
+++ b/arch/arm/mach-omap2/prcm43xx.h
@@ -92,6 +92,7 @@
92#define AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET 0x04b8 92#define AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET 0x04b8
93#define AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET 0x04c0 93#define AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET 0x04c0
94#define AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET 0x04c8 94#define AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET 0x04c8
95#define AM43XX_CM_PER_RNG_CLKCTRL_OFFSET 0x04e0
95#define AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET 0x0500 96#define AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET 0x0500
96#define AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET 0x0508 97#define AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET 0x0508
97#define AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET 0x0528 98#define AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET 0x0528