]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: AMx3xx: hwmod: Add data for RNG
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 18 Oct 2016 07:55:27 +0000 (10:55 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 9 Nov 2016 22:39:41 +0000 (15:39 -0700)
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>
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
arch/arm/mach-omap2/prcm43xx.h

index d3e61d1a02d77270596c08b64388fcf683d0d483..434bd1a7722948a0e109ffda8b60aad71e5f1000 100644 (file)
@@ -68,6 +68,7 @@ extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart6;
 extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc;
 extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0;
 extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0;
+extern struct omap_hwmod_ocp_if am33xx_l4_per__rng;
 
 extern struct omap_hwmod am33xx_l3_main_hwmod;
 extern struct omap_hwmod am33xx_l3_s_hwmod;
@@ -80,6 +81,7 @@ extern struct omap_hwmod am33xx_gfx_hwmod;
 extern struct omap_hwmod am33xx_prcm_hwmod;
 extern struct omap_hwmod am33xx_aes0_hwmod;
 extern struct omap_hwmod am33xx_sha0_hwmod;
+extern struct omap_hwmod am33xx_rng_hwmod;
 extern struct omap_hwmod am33xx_ocmcram_hwmod;
 extern struct omap_hwmod am33xx_smartreflex0_hwmod;
 extern struct omap_hwmod am33xx_smartreflex1_hwmod;
index 10dff2f0086a2d3edff2cef53342224a484a1f99..8236e5c49ec3e4ec54a4e695e0c4a46e4f8f869e 100644 (file)
@@ -547,3 +547,11 @@ struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
        .addr           = am33xx_aes0_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
+
+/* l4 per -> rng */
+struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
+       .master         = &am33xx_l4_ls_hwmod,
+       .slave          = &am33xx_rng_hwmod,
+       .clk            = "rng_fck",
+       .user           = OCP_USER_MPU,
+};
index e2d84aa7f595ff3fa8672a3c6f87412a13b3e095..de06a1d5ffab5a15e418e560e24a8dde6bf3818d 100644 (file)
@@ -268,6 +268,33 @@ struct omap_hwmod am33xx_sha0_hwmod = {
        },
 };
 
+/* rng */
+static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
+       .rev_offs       = 0x1fe0,
+       .sysc_offs      = 0x1fe4,
+       .sysc_flags     = SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
+       .idlemodes      = SIDLE_FORCE | SIDLE_NO,
+       .sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class am33xx_rng_hwmod_class = {
+       .name           = "rng",
+       .sysc           = &am33xx_rng_sysc,
+};
+
+struct omap_hwmod am33xx_rng_hwmod = {
+       .name           = "rng",
+       .class          = &am33xx_rng_hwmod_class,
+       .clkdm_name     = "l4ls_clkdm",
+       .flags          = HWMOD_SWSUP_SIDLE,
+       .main_clk       = "rng_fck",
+       .prcm           = {
+               .omap4  = {
+                       .modulemode     = MODULEMODE_SWCTRL,
+               },
+       },
+};
+
 /* ocmcram */
 static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
        .name = "ocmcram",
@@ -1315,6 +1342,7 @@ static void omap_hwmod_am33xx_clkctrl(void)
        CLKCTRL(am33xx_ocmcram_hwmod , AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
        CLKCTRL(am33xx_sha0_hwmod , AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET);
        CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET);
+       CLKCTRL(am33xx_rng_hwmod, AM33XX_CM_PER_RNG_CLKCTRL_OFFSET);
 }
 
 static void omap_hwmod_am33xx_rst(void)
@@ -1388,6 +1416,7 @@ static void omap_hwmod_am43xx_clkctrl(void)
        CLKCTRL(am33xx_ocmcram_hwmod , AM43XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
        CLKCTRL(am33xx_sha0_hwmod , AM43XX_CM_PER_SHA0_CLKCTRL_OFFSET);
        CLKCTRL(am33xx_aes0_hwmod , AM43XX_CM_PER_AES0_CLKCTRL_OFFSET);
+       CLKCTRL(am33xx_rng_hwmod, AM43XX_CM_PER_RNG_CLKCTRL_OFFSET);
 }
 
 static void omap_hwmod_am43xx_rst(void)
index e1c2025d6d3e6de6235c0b3ec2dd30538df152ee..6dc51a774a269737cd677b59c3b915131c38b6f5 100644 (file)
@@ -503,41 +503,6 @@ static struct omap_hwmod_ocp_if am33xx_l3_s__usbss = {
        .flags          = OCPIF_SWSUP_IDLE,
 };
 
-/* rng */
-static struct omap_hwmod_class_sysconfig am33xx_rng_sysc = {
-       .rev_offs       = 0x1fe0,
-       .sysc_offs      = 0x1fe4,
-       .sysc_flags     = SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE,
-       .idlemodes      = SIDLE_FORCE | SIDLE_NO,
-       .sysc_fields    = &omap_hwmod_sysc_type1,
-};
-
-static struct omap_hwmod_class am33xx_rng_hwmod_class = {
-       .name           = "rng",
-       .sysc           = &am33xx_rng_sysc,
-};
-
-static struct omap_hwmod am33xx_rng_hwmod = {
-       .name           = "rng",
-       .class          = &am33xx_rng_hwmod_class,
-       .clkdm_name     = "l4ls_clkdm",
-       .flags          = HWMOD_SWSUP_SIDLE,
-       .main_clk       = "rng_fck",
-       .prcm           = {
-               .omap4  = {
-                       .clkctrl_offs   = AM33XX_CM_PER_RNG_CLKCTRL_OFFSET,
-                       .modulemode     = MODULEMODE_SWCTRL,
-               },
-       },
-};
-
-static struct omap_hwmod_ocp_if am33xx_l4_per__rng = {
-       .master         = &am33xx_l4_ls_hwmod,
-       .slave          = &am33xx_rng_hwmod,
-       .clk            = "rng_fck",
-       .user           = OCP_USER_MPU,
-};
-
 static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
        &am33xx_l3_main__emif,
        &am33xx_mpu__l3_main,
index 3f7dac067897b5aa20cddf3232ff9f2358a3aa8a..afbce1f6f641efb3b36363d66cbc2b5569e71f31 100644 (file)
@@ -949,6 +949,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
        &am33xx_l4_per__i2c2,
        &am33xx_l4_per__i2c3,
        &am33xx_l4_per__mailbox,
+       &am33xx_l4_per__rng,
        &am33xx_l4_ls__mcasp0,
        &am33xx_l4_ls__mcasp1,
        &am33xx_l4_ls__mmc0,
index 416968545e894c518adbf98f566e199519da4a43..e2ad14e77064ccd6cb15fd3140b9a274b9042cde 100644 (file)
@@ -92,6 +92,7 @@
 #define AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET          0x04b8
 #define AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET              0x04c0
 #define AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET              0x04c8
+#define AM43XX_CM_PER_RNG_CLKCTRL_OFFSET               0x04e0
 #define AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET              0x0500
 #define AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET              0x0508
 #define AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET          0x0528