aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-09-23 19:28:25 -0400
committerPaul Walmsley <paul@pwsan.com>2012-09-23 19:28:25 -0400
commite9b0a2fb0af562092aab1b56abf9d13f1abc7381 (patch)
tree788f8f4ade57572f43208d695e6d5a9657d847ec /arch
parentda496873970c57c4b31e186d967933da0ffa0d7c (diff)
ARM: OMAP2xxx: hwmod/CM: add RNG integration data
Add integration data for the hardware random number generator IP block on some OMAP SoCs. This appears to be present on at least OMAP2xxx and OMAP3xxx SoCs, although it is not so easy to tell. It may also be present on other OMAP2+ SoCs. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c2
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c17
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c44
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.h5
7 files changed, 68 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index a911e76b4ecf..7f07ab02a5b3 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -35,7 +35,7 @@
35#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3 35#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
36 36
37static const u8 cm_idlest_offs[] = { 37static const u8 cm_idlest_offs[] = {
38 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 38 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3, OMAP24XX_CM_IDLEST4
39}; 39};
40 40
41u32 omap2_cm_read_mod_reg(s16 module, u16 idx) 41u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 088bbad73db5..57b2f3c2fbf3 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -71,6 +71,7 @@
71#define OMAP24XX_CM_FCLKEN2 0x0004 71#define OMAP24XX_CM_FCLKEN2 0x0004
72#define OMAP24XX_CM_ICLKEN4 0x001c 72#define OMAP24XX_CM_ICLKEN4 0x001c
73#define OMAP24XX_CM_AUTOIDLE4 0x003c 73#define OMAP24XX_CM_AUTOIDLE4 0x003c
74#define OMAP24XX_CM_IDLEST4 0x002c
74 75
75#define OMAP2430_CM_IDLEST3 0x0028 76#define OMAP2430_CM_IDLEST3 0x0028
76 77
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 5fcd225d207e..e778ff4e1887 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -601,6 +601,7 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
601 &omap2420_l4_core__mcbsp1, 601 &omap2420_l4_core__mcbsp1,
602 &omap2420_l4_core__mcbsp2, 602 &omap2420_l4_core__mcbsp2,
603 &omap2420_l4_core__msdi1, 603 &omap2420_l4_core__msdi1,
604 &omap2xxx_l4_core__rng,
604 &omap2420_l4_core__hdq1w, 605 &omap2420_l4_core__hdq1w,
605 &omap2420_l4_wkup__counter_32k, 606 &omap2420_l4_wkup__counter_32k,
606 &omap2420_l3__gpmc, 607 &omap2420_l3__gpmc,
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index a560563daf58..cc4ed9024372 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -961,6 +961,7 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
961 &omap2430_l4_core__mcbsp4, 961 &omap2430_l4_core__mcbsp4,
962 &omap2430_l4_core__mcbsp5, 962 &omap2430_l4_core__mcbsp5,
963 &omap2430_l4_core__hdq1w, 963 &omap2430_l4_core__hdq1w,
964 &omap2xxx_l4_core__rng,
964 &omap2430_l4_wkup__counter_32k, 965 &omap2430_l4_wkup__counter_32k,
965 &omap2430_l3__gpmc, 966 &omap2430_l3__gpmc,
966 NULL, 967 NULL,
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
index 5178e40e84f9..c83d6c517be4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
@@ -129,6 +129,15 @@ struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[] = {
129 { } 129 { }
130}; 130};
131 131
132static struct omap_hwmod_addr_space omap2_rng_addr_space[] = {
133 {
134 .pa_start = 0x480a0000,
135 .pa_end = 0x480a004f,
136 .flags = ADDR_TYPE_RT
137 },
138 { }
139};
140
132/* 141/*
133 * Common interconnect data 142 * Common interconnect data
134 */ 143 */
@@ -372,3 +381,11 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc = {
372 .user = OCP_USER_MPU | OCP_USER_SDMA, 381 .user = OCP_USER_MPU | OCP_USER_SDMA,
373}; 382};
374 383
384/* l4_core -> rng */
385struct omap_hwmod_ocp_if omap2xxx_l4_core__rng = {
386 .master = &omap2xxx_l4_core_hwmod,
387 .slave = &omap2xxx_rng_hwmod,
388 .clk = "rng_ick",
389 .addr = omap2_rng_addr_space,
390 .user = OCP_USER_MPU | OCP_USER_SDMA,
391};
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
index 3c009069f2f2..32c778bf8f08 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -792,3 +792,47 @@ struct omap_hwmod omap2xxx_gpmc_hwmod = {
792 }, 792 },
793 }, 793 },
794}; 794};
795
796/* RNG */
797
798static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
799 .rev_offs = 0x3c,
800 .sysc_offs = 0x40,
801 .syss_offs = 0x44,
802 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
803 SYSS_HAS_RESET_STATUS),
804 .sysc_fields = &omap_hwmod_sysc_type1,
805};
806
807static struct omap_hwmod_class omap2_rng_hwmod_class = {
808 .name = "rng",
809 .sysc = &omap2_rng_sysc,
810};
811
812static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
813 { .irq = 52 },
814 { .irq = -1 }
815};
816
817struct omap_hwmod omap2xxx_rng_hwmod = {
818 .name = "rng",
819 .mpu_irqs = omap2_rng_mpu_irqs,
820 .main_clk = "l4_ck",
821 .prcm = {
822 .omap2 = {
823 .module_offs = CORE_MOD,
824 .prcm_reg_id = 4,
825 .module_bit = OMAP24XX_EN_RNG_SHIFT,
826 .idlest_reg_id = 4,
827 .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
828 },
829 },
830 /*
831 * XXX The first read from the SYSSTATUS register of the RNG
832 * after the SYSCONFIG SOFTRESET bit is set triggers an
833 * imprecise external abort. It's unclear why this happens.
834 * Until this is analyzed, skip the IP block reset.
835 */
836 .flags = HWMOD_INIT_NO_RESET,
837 .class = &omap2_rng_hwmod_class,
838};
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h
index 6a033b878359..2bc8f1705d4a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h
@@ -2,9 +2,8 @@
2 * omap_hwmod_common_data.h - OMAP hwmod common macros and declarations 2 * omap_hwmod_common_data.h - OMAP hwmod common macros and declarations
3 * 3 *
4 * Copyright (C) 2010-2011 Nokia Corporation 4 * Copyright (C) 2010-2011 Nokia Corporation
5 * Copyright (C) 2010-2012 Texas Instruments, Inc.
5 * Paul Walmsley 6 * Paul Walmsley
6 *
7 * Copyright (C) 2010-2011 Texas Instruments, Inc.
8 * Benoît Cousson 7 * Benoît Cousson
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -78,6 +77,7 @@ extern struct omap_hwmod omap2xxx_mcspi1_hwmod;
78extern struct omap_hwmod omap2xxx_mcspi2_hwmod; 77extern struct omap_hwmod omap2xxx_mcspi2_hwmod;
79extern struct omap_hwmod omap2xxx_counter_32k_hwmod; 78extern struct omap_hwmod omap2xxx_counter_32k_hwmod;
80extern struct omap_hwmod omap2xxx_gpmc_hwmod; 79extern struct omap_hwmod omap2xxx_gpmc_hwmod;
80extern struct omap_hwmod omap2xxx_rng_hwmod;
81 81
82/* Common interface data across OMAP2xxx */ 82/* Common interface data across OMAP2xxx */
83extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core; 83extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core;
@@ -104,6 +104,7 @@ extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss;
104extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc; 104extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc;
105extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi; 105extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi;
106extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc; 106extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc;
107extern struct omap_hwmod_ocp_if omap2xxx_l4_core__rng;
107 108
108/* Common IP block data */ 109/* Common IP block data */
109extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[]; 110extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[];