aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-04-04 08:52:01 -0400
committerTero Kristo <t-kristo@ti.com>2015-03-25 05:03:39 -0400
commite9f1ddcdec54d32892a0a749de017a39c6c84beb (patch)
tree9c1a97e0a2a724abddd1604e5f95234cdbd69653
parent9cb6d36371b0a9935de92bf250c7152f5b50fdc1 (diff)
ARM: OMAP3+: PRM: add common APIs for prm_vp_check/clear_txdone
PRM driver now only exports a generic API for clearing / checking VP txdone status. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--arch/arm/mach-omap2/prm.h14
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c6
-rw-r--r--arch/arm/mach-omap2/prm3xxx.h4
-rw-r--r--arch/arm/mach-omap2/prm44xx.c6
-rw-r--r--arch/arm/mach-omap2/prm44xx_54xx.h4
-rw-r--r--arch/arm/mach-omap2/prm_common.c34
-rw-r--r--arch/arm/mach-omap2/vp.h9
-rw-r--r--arch/arm/mach-omap2/vp3xxx_data.c4
-rw-r--r--arch/arm/mach-omap2/vp44xx_data.c4
9 files changed, 60 insertions, 25 deletions
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 2a01a5885c61..4e390ec0ed85 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -147,6 +147,8 @@ struct prm_ll_data {
147 u16 offset); 147 u16 offset);
148 void (*reset_system)(void); 148 void (*reset_system)(void);
149 int (*clear_mod_irqs)(s16 module, u8 regs, u32 wkst_mask); 149 int (*clear_mod_irqs)(s16 module, u8 regs, u32 wkst_mask);
150 u32 (*vp_check_txdone)(u8 vp_id);
151 void (*vp_clear_txdone)(u8 vp_id);
150}; 152};
151 153
152extern int prm_register(struct prm_ll_data *pld); 154extern int prm_register(struct prm_ll_data *pld);
@@ -164,6 +166,18 @@ void omap_prm_reset_system(void);
164void omap_prm_reconfigure_io_chain(void); 166void omap_prm_reconfigure_io_chain(void);
165int omap_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask); 167int omap_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask);
166 168
169/*
170 * Voltage Processor (VP) identifiers
171 */
172#define OMAP3_VP_VDD_MPU_ID 0
173#define OMAP3_VP_VDD_CORE_ID 1
174#define OMAP4_VP_VDD_CORE_ID 0
175#define OMAP4_VP_VDD_IVA_ID 1
176#define OMAP4_VP_VDD_MPU_ID 2
177
178u32 omap_prm_vp_check_txdone(u8 vp_id);
179void omap_prm_vp_clear_txdone(u8 vp_id);
180
167#endif 181#endif
168 182
169 183
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index a4443344affe..2b478adc337d 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -96,7 +96,7 @@ static struct omap3_vp omap3_vp[] = {
96 96
97#define MAX_VP_ID ARRAY_SIZE(omap3_vp); 97#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
98 98
99u32 omap3_prm_vp_check_txdone(u8 vp_id) 99static u32 omap3_prm_vp_check_txdone(u8 vp_id)
100{ 100{
101 struct omap3_vp *vp = &omap3_vp[vp_id]; 101 struct omap3_vp *vp = &omap3_vp[vp_id];
102 u32 irqstatus; 102 u32 irqstatus;
@@ -106,7 +106,7 @@ u32 omap3_prm_vp_check_txdone(u8 vp_id)
106 return irqstatus & vp->tranxdone_status; 106 return irqstatus & vp->tranxdone_status;
107} 107}
108 108
109void omap3_prm_vp_clear_txdone(u8 vp_id) 109static void omap3_prm_vp_clear_txdone(u8 vp_id)
110{ 110{
111 struct omap3_vp *vp = &omap3_vp[vp_id]; 111 struct omap3_vp *vp = &omap3_vp[vp_id];
112 112
@@ -665,6 +665,8 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
665 .is_hardreset_asserted = &omap2_prm_is_hardreset_asserted, 665 .is_hardreset_asserted = &omap2_prm_is_hardreset_asserted,
666 .reset_system = &omap3xxx_prm_dpll3_reset, 666 .reset_system = &omap3xxx_prm_dpll3_reset,
667 .clear_mod_irqs = &omap3xxx_prm_clear_mod_irqs, 667 .clear_mod_irqs = &omap3xxx_prm_clear_mod_irqs,
668 .vp_check_txdone = &omap3_prm_vp_check_txdone,
669 .vp_clear_txdone = &omap3_prm_vp_clear_txdone,
668}; 670};
669 671
670int __init omap3xxx_prm_init(void) 672int __init omap3xxx_prm_init(void)
diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h
index 5a09a74e7f8f..55e4c898ba25 100644
--- a/arch/arm/mach-omap2/prm3xxx.h
+++ b/arch/arm/mach-omap2/prm3xxx.h
@@ -132,10 +132,6 @@
132 132
133#ifndef __ASSEMBLER__ 133#ifndef __ASSEMBLER__
134 134
135/* OMAP3-specific VP functions */
136u32 omap3_prm_vp_check_txdone(u8 vp_id);
137void omap3_prm_vp_clear_txdone(u8 vp_id);
138
139/* 135/*
140 * OMAP3 access functions for voltage controller (VC) and 136 * OMAP3 access functions for voltage controller (VC) and
141 * voltage proccessor (VP) in the PRM. 137 * voltage proccessor (VP) in the PRM.
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index a08a617a6c11..1af0137e8283 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -138,7 +138,7 @@ static struct omap4_vp omap4_vp[] = {
138 }, 138 },
139}; 139};
140 140
141u32 omap4_prm_vp_check_txdone(u8 vp_id) 141static u32 omap4_prm_vp_check_txdone(u8 vp_id)
142{ 142{
143 struct omap4_vp *vp = &omap4_vp[vp_id]; 143 struct omap4_vp *vp = &omap4_vp[vp_id];
144 u32 irqstatus; 144 u32 irqstatus;
@@ -149,7 +149,7 @@ u32 omap4_prm_vp_check_txdone(u8 vp_id)
149 return irqstatus & vp->tranxdone_status; 149 return irqstatus & vp->tranxdone_status;
150} 150}
151 151
152void omap4_prm_vp_clear_txdone(u8 vp_id) 152static void omap4_prm_vp_clear_txdone(u8 vp_id)
153{ 153{
154 struct omap4_vp *vp = &omap4_vp[vp_id]; 154 struct omap4_vp *vp = &omap4_vp[vp_id];
155 155
@@ -699,6 +699,8 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
699 .deassert_hardreset = omap4_prminst_deassert_hardreset, 699 .deassert_hardreset = omap4_prminst_deassert_hardreset,
700 .is_hardreset_asserted = omap4_prminst_is_hardreset_asserted, 700 .is_hardreset_asserted = omap4_prminst_is_hardreset_asserted,
701 .reset_system = omap4_prminst_global_warm_sw_reset, 701 .reset_system = omap4_prminst_global_warm_sw_reset,
702 .vp_check_txdone = omap4_prm_vp_check_txdone,
703 .vp_clear_txdone = omap4_prm_vp_clear_txdone,
702}; 704};
703 705
704int __init omap44xx_prm_init(void) 706int __init omap44xx_prm_init(void)
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h
index 714329565b90..a470185d9ede 100644
--- a/arch/arm/mach-omap2/prm44xx_54xx.h
+++ b/arch/arm/mach-omap2/prm44xx_54xx.h
@@ -26,10 +26,6 @@
26/* Function prototypes */ 26/* Function prototypes */
27#ifndef __ASSEMBLER__ 27#ifndef __ASSEMBLER__
28 28
29/* OMAP4/OMAP5-specific VP functions */
30u32 omap4_prm_vp_check_txdone(u8 vp_id);
31void omap4_prm_vp_clear_txdone(u8 vp_id);
32
33/* 29/*
34 * OMAP4/OMAP5 access functions for voltage controller (VC) and 30 * OMAP4/OMAP5 access functions for voltage controller (VC) and
35 * voltage proccessor (VP) in the PRM. 31 * voltage proccessor (VP) in the PRM.
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 2c2e7ed1bc6c..79cee117f971 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -555,6 +555,40 @@ int omap_prm_clear_mod_irqs(s16 module, u8 regs, u32 wkst_mask)
555} 555}
556 556
557/** 557/**
558 * omap_prm_vp_check_txdone - check voltage processor TX done status
559 *
560 * Checks if voltage processor transmission has been completed.
561 * Returns non-zero if a transmission has completed, 0 otherwise.
562 */
563u32 omap_prm_vp_check_txdone(u8 vp_id)
564{
565 if (!prm_ll_data->vp_check_txdone) {
566 WARN_ONCE(1, "prm: %s: no mapping function defined\n",
567 __func__);
568 return 0;
569 }
570
571 return prm_ll_data->vp_check_txdone(vp_id);
572}
573
574/**
575 * omap_prm_vp_clear_txdone - clears voltage processor TX done status
576 *
577 * Clears the status bit for completed voltage processor transmission
578 * returned by prm_vp_check_txdone.
579 */
580void omap_prm_vp_clear_txdone(u8 vp_id)
581{
582 if (!prm_ll_data->vp_clear_txdone) {
583 WARN_ONCE(1, "prm: %s: no mapping function defined\n",
584 __func__);
585 return;
586 }
587
588 prm_ll_data->vp_clear_txdone(vp_id);
589}
590
591/**
558 * prm_register - register per-SoC low-level data with the PRM 592 * prm_register - register per-SoC low-level data with the PRM
559 * @pld: low-level per-SoC OMAP PRM data & function pointers to register 593 * @pld: low-level per-SoC OMAP PRM data & function pointers to register
560 * 594 *
diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h
index 0fdf7080e4a6..7e0829682bd0 100644
--- a/arch/arm/mach-omap2/vp.h
+++ b/arch/arm/mach-omap2/vp.h
@@ -21,15 +21,6 @@
21 21
22struct voltagedomain; 22struct voltagedomain;
23 23
24/*
25 * Voltage Processor (VP) identifiers
26 */
27#define OMAP3_VP_VDD_MPU_ID 0
28#define OMAP3_VP_VDD_CORE_ID 1
29#define OMAP4_VP_VDD_CORE_ID 0
30#define OMAP4_VP_VDD_IVA_ID 1
31#define OMAP4_VP_VDD_MPU_ID 2
32
33/* XXX document */ 24/* XXX document */
34#define VP_IDLE_TIMEOUT 200 25#define VP_IDLE_TIMEOUT 200
35#define VP_TRANXDONE_TIMEOUT 300 26#define VP_TRANXDONE_TIMEOUT 300
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c
index 1914e026245e..b0590fe6ab01 100644
--- a/arch/arm/mach-omap2/vp3xxx_data.c
+++ b/arch/arm/mach-omap2/vp3xxx_data.c
@@ -28,8 +28,8 @@
28#include "prm2xxx_3xxx.h" 28#include "prm2xxx_3xxx.h"
29 29
30static const struct omap_vp_ops omap3_vp_ops = { 30static const struct omap_vp_ops omap3_vp_ops = {
31 .check_txdone = omap3_prm_vp_check_txdone, 31 .check_txdone = omap_prm_vp_check_txdone,
32 .clear_txdone = omap3_prm_vp_clear_txdone, 32 .clear_txdone = omap_prm_vp_clear_txdone,
33}; 33};
34 34
35/* 35/*
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c
index e62f6b018beb..2448bb9a8716 100644
--- a/arch/arm/mach-omap2/vp44xx_data.c
+++ b/arch/arm/mach-omap2/vp44xx_data.c
@@ -28,8 +28,8 @@
28#include "vp.h" 28#include "vp.h"
29 29
30static const struct omap_vp_ops omap4_vp_ops = { 30static const struct omap_vp_ops omap4_vp_ops = {
31 .check_txdone = omap4_prm_vp_check_txdone, 31 .check_txdone = omap_prm_vp_check_txdone,
32 .clear_txdone = omap4_prm_vp_clear_txdone, 32 .clear_txdone = omap_prm_vp_clear_txdone,
33}; 33};
34 34
35/* 35/*