From dcff95dc32744a930831b33311b4afb09463789d Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Mon, 10 Nov 2008 16:58:11 +0530 Subject: [PATCH] OMAP3 SRF: Add VDD1/VDD2 rate tables for 3430SDP This patch adds the MPU/DSP/CORE rate tables for OMAP3430 SDP board and registers them with the OMAP-PM layer using the omap_pm_if_init API. Signed-off-by: Rajendra Nayak --- arch/arm/mach-omap2/board-3430sdp.c | 62 ++++++++++++++++++++++++++++++++- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-generic.c | 2 +- arch/arm/mach-omap2/board-h4.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/io.c | 5 ++- arch/arm/mach-omap2/pm.h | 17 +++++++++ arch/arm/plat-omap/include/plat/io.h | 6 +++- 11 files changed, 94 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 710b2586106..60e324906b2 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -37,12 +37,71 @@ #include #include #include +#include #include #include +#include #include "sdram-qimonda-hyb18m512160af-6.h" #include "mmc-twl4030.h" +#include "pm.h" + +/* MPU speeds */ +#define S600M 600000000 +#define S550M 550000000 +#define S500M 500000000 +#define S250M 250000000 +#define S125M 125000000 + +/* DSP speeds */ +#define S430M 430000000 +#define S400M 400000000 +#define S360M 360000000 +#define S180M 180000000 +#define S90M 90000000 + +/* L3 speeds */ +#define S83M 83000000 +#define S166M 166000000 + +static struct omap_opp mpu_rate_table[] = { + {0, 0, 0}, + /*OPP1*/ + {S125M, VDD1_OPP1, 0}, + /*OPP2*/ + {S250M, VDD1_OPP2, 0}, + /*OPP3*/ + {S500M, VDD1_OPP3, 0}, + /*OPP4*/ + {S550M, VDD1_OPP4, 0}, + /*OPP5*/ + {S600M, VDD1_OPP5, 0}, +}; + +static struct omap_opp l3_rate_table[] = { + {0, 0, 0}, + /*OPP1*/ + {0, VDD2_OPP1, 0}, + /*OPP2*/ + {S83M, VDD2_OPP2, 0}, + /*OPP3*/ + {S166M, VDD2_OPP3, 0}, +}; + +struct omap_opp dsp_rate_table[] = { + {0, 0, 0}, + /*OPP1*/ + {S90M, VDD1_OPP1, 0}, + /*OPP2*/ + {S180M, VDD1_OPP2, 0}, + /*OPP3*/ + {S360M, VDD1_OPP3, 0}, + /*OPP4*/ + {S400M, VDD1_OPP4, 0}, + /*OPP5*/ + {S430M, VDD1_OPP5, 0}, +}; #define SDP3430_TS_GPIO_IRQ_SDPV1 3 #define SDP3430_TS_GPIO_IRQ_SDPV2 2 @@ -181,7 +240,8 @@ static void __init omap_3430sdp_init_irq(void) { omap_board_config = sdp3430_config; omap_board_config_size = ARRAY_SIZE(sdp3430_config); - omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); + omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, mpu_rate_table, + dsp_rate_table, l3_rate_table); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 8a2ce77a02e..5bbb72ff8cf 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -267,7 +267,7 @@ static void __init omap_apollon_init_irq(void) { omap_board_config = apollon_config; omap_board_config_size = ARRAY_SIZE(apollon_config); - omap2_init_common_hw(NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); apollon_init_smc91x(); diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 7e6e6ca88be..fd23535e946 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -38,7 +38,7 @@ static void __init omap_generic_init_irq(void) { omap_board_config = generic_config; omap_board_config_size = ARRAY_SIZE(generic_config); - omap2_init_common_hw(NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); } diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index cfb7f1257d2..3cdb9ea521f 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -313,7 +313,7 @@ static void __init omap_h4_init_irq(void) { omap_board_config = h4_config; omap_board_config_size = ARRAY_SIZE(h4_config); - omap2_init_common_hw(NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); h4_init_flash(); diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index c062238fe88..3b96811c075 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -289,7 +289,7 @@ static void __init omap_ldp_init_irq(void) { omap_board_config = ldp_config; omap_board_config_size = ARRAY_SIZE(ldp_config); - omap2_init_common_hw(NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); ldp_init_smsc911x(); diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6cb99f6e835..eaa2771da16 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -348,7 +348,7 @@ static void __init omap3_beagle_init_irq(void) omap_board_config = omap3_beagle_config; omap_board_config_size = ARRAY_SIZE(omap3_beagle_config); omap2_init_common_hw(mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params); + mt46h32m32lf6_sdrc_params, NULL, NULL, NULL); omap_init_irq(); #ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer(12); diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index b9b0f4c5203..756ee5f4211 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -332,7 +332,7 @@ static void __init omap3_evm_init_irq(void) { omap_board_config = omap3_evm_config; omap_board_config_size = ARRAY_SIZE(omap3_evm_config); - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); omap3evm_init_smc911x(); diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 92f3f3aad46..75f5d098498 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -375,7 +375,7 @@ static void __init overo_init_irq(void) omap_board_config = overo_config; omap_board_config_size = ARRAY_SIZE(overo_config); omap2_init_common_hw(mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params); + mt46h32m32lf6_sdrc_params, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 59d28b2fd8c..91bcfbfe372 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -301,7 +301,10 @@ static int __init _omap2_init_reprogram_sdrc(void) } void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, - struct omap_sdrc_params *sdrc_cs1) + struct omap_sdrc_params *sdrc_cs1, + struct omap_opp *mpu_opps, + struct omap_opp *dsp_opps, + struct omap_opp *l3_opps) { struct omap_hwmod **hwmods = NULL; diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 9d7779b1d55..f057bbf6480 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -30,6 +30,23 @@ extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); extern u32 wakeup_timer_seconds; extern struct omap_dm_timer *gptimer_wakeup; +/* VDD1 OPPS */ +#define VDD1_OPP1 0x1 +#define VDD1_OPP2 0x2 +#define VDD1_OPP3 0x3 +#define VDD1_OPP4 0x4 +#define VDD1_OPP5 0x5 + +/* VDD2 OPPS */ +#define VDD2_OPP1 0x1 +#define VDD2_OPP2 0x2 +#define VDD2_OPP3 0x3 + +#define MIN_VDD1_OPP VDD1_OPP1 +#define MAX_VDD1_OPP VDD1_OPP5 +#define MIN_VDD2_OPP VDD2_OPP1 +#define MAX_VDD2_OPP VDD2_OPP3 + #ifdef CONFIG_PM_DEBUG extern void omap2_pm_dump(int mode, int resume, unsigned int us); extern int omap2_pm_debug; diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index 7e5319f907d..b455433d944 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h @@ -268,13 +268,17 @@ extern void omap_writew(u16 v, u32 pa); extern void omap_writel(u32 v, u32 pa); struct omap_sdrc_params; +struct omap_opp; extern void omap1_map_common_io(void); extern void omap1_init_common_hw(void); extern void omap2_map_common_io(void); extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, - struct omap_sdrc_params *sdrc_cs1); + struct omap_sdrc_params *sdrc_cs1, + struct omap_opp *mpu_opps, + struct omap_opp *dsp_opps, + struct omap_opp *l3_opps); #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) #define __arch_iounmap(v) omap_iounmap(v) -- 2.11.4.GIT