(unknown)
Subject: [PATCH] MFD: TWL4030: changes for TRITON glitch fix.
Fix for TWL5030 Silicon Errata 27 & 28:
27 - VDD1, VDD2, may have glitches when their output value is updated. 28 - VDD1 and / or VDD2 DCDC clock may stop working when internal clock is switched from internal to external.
Workaround requires the TWL DCDCs to use HFCLK instead of internal oscillator. Also enable TWL watchdog before switching the osc to recover
if the VDD1/VDD2 stop working.
Fix is required for TWL5030 Silicon version less than or equal to ES1.1 Changes are done under the macro CONFIG_TWL5030_GLITCH_FIX, since the IDCODE register on TWL5030 Si is not updated correctly.
Updated the TWL resource settings and volt, clock setuptime.
Changes taken from Nishanth Menons gaia glitch fix patch.
---
This patch has dependency on:
SmartReflex patch series from Thara.
Update TRITON power scripts from Lesly.
This patch series is based off Kevin's tree origin/pm branch.
This changes are tested on OMAP3430 SDP board with:
enable_off_mode
voltage_off_while_idle
sleep_while_idle (VDD1/VDD2 voltage scaling to 0v) enabled in cpuidle and suspned path.
Also tested for reboot and dvfs.
arch/arm/mach-omap2/board-3430sdp.c | 40 +++++++++ arch/arm/mach-omap2/board-zoom-peripherals.c | 40 +++++++++ arch/arm/mach-omap2/include/mach/board-sdp.h | 4 + arch/arm/mach-omap2/include/mach/board-zoom.h | 4 + arch/arm/mach-omap2/twl4030-script.c | 84 +++++++++++++++++++ arch/arm/mach-omap2/twl4030-script.h | 9 ++ arch/arm/mach-omap2/voltage.c | 10 +++ arch/arm/mach-omap2/voltage.h | 4 + arch/arm/plat-omap/Kconfig | 7 ++ drivers/mfd/twl4030-power.c | 106 +++++++++++++++++++++++++ 10 files changed, 308 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +40 -0
@@ -475,6 +475,36 @@ static struct twl4030_resconfig twl4030_rconfig[] = { { 0, 0}, }; +#ifdef CONFIG_TWL5030_GLITCH_FIX +static struct twl4030_resconfig twl4030_rconfig_glitchfix[] = { + { .resource =RES_VPLL1 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =3 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_VINTANA1 , .devgroup =DEV_GRP_ALL , .type =1 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VINTANA2 , .devgroup =DEV_GRP_ALL , .type =0 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VINTDIG , .devgroup =DEV_GRP_ALL , .type =1 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VIO , .devgroup =DEV_GRP_ALL , .type =2 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VDD1 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =4 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_VDD2 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =3 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_REGEN , .devgroup =DEV_GRP_ALL , .type =2 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_NRES_PWRON , .devgroup =DEV_GRP_ALL , .type =0 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_CLKEN , .devgroup =DEV_GRP_ALL , .type =3 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_SYSEN , .devgroup =DEV_GRP_ALL , .type =6 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_HFCLKOUT , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =0 , .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + {0 ,0 }, +}; +#endif +static struct twl4030_power_data sdp3430_t2scripts_data__initdata = { .resource_config = twl4030_rconfig, };
@@ -840,6 +870,16 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +#ifdef CONFIG_TWL5030_GLITCH_FIX +void twl5030_glitchfix_changes_3430sdp (void ) +{ + sdp3430_t2scripts_data.resource_config = twl4030_rconfig_glitchfix; +use_twl4030_script_glitchfix (&sdp3430_t2scripts_data); +omap_voltage_twl5030_glitchfix (); +} +EXPORT_SYMBOL (twl5030_glitchfix_changes_3430sdp); +#endif +static void __init omap_3430sdp_init (void ) {twl4030_get_scripts (&sdp3430_t2scripts_data);
arch/arm/mach-omap2/board-zoom-peripherals.c +40 -0
@@ -125,6 +125,36 @@ static struct twl4030_resconfig twl4030_rconfig[] = { { 0, 0}, }; +#ifdef CONFIG_TWL5030_GLITCH_FIX +static struct twl4030_resconfig twl4030_rconfig_glitchfix[] = { + { .resource =RES_VPLL1 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =3 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_VINTANA1 , .devgroup =DEV_GRP_ALL , .type =1 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VINTANA2 , .devgroup =DEV_GRP_ALL , .type =0 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VINTDIG , .devgroup =DEV_GRP_ALL , .type =1 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VIO , .devgroup =DEV_GRP_ALL , .type =2 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_VDD1 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =4 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_VDD2 , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =3 , .type2 =1 , .remap_sleep =RES_STATE_OFF }, + { .resource =RES_REGEN , .devgroup =DEV_GRP_ALL , .type =2 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_NRES_PWRON , .devgroup =DEV_GRP_ALL , .type =0 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_CLKEN , .devgroup =DEV_GRP_ALL , .type =3 , + .type2 =2 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_SYSEN , .devgroup =DEV_GRP_ALL , .type =6 , + .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + { .resource =RES_HFCLKOUT , .devgroup =DEV_GRP_P1 |DEV_GRP_P3 , + .type =0 , .type2 =1 , .remap_sleep =RES_STATE_SLEEP }, + {0 ,0 }, +}; +#endif +static struct twl4030_power_data zoom_t2scripts_data__initdata = { .resource_config = twl4030_rconfig, };
@@ -313,6 +343,16 @@ static void enable_board_wakeup_source(void) OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); } +#ifdef CONFIG_TWL5030_GLITCH_FIX +void twl5030_glitchfix_changes_zoom (void ) +{ + zoom_t2scripts_data.resource_config = twl4030_rconfig_glitchfix; +use_twl4030_script_glitchfix (&zoom_t2scripts_data); +omap_voltage_twl5030_glitchfix (); +} +EXPORT_SYMBOL (twl5030_glitchfix_changes_zoom); +#endif +void __init zoom_peripherals_init (void *peripheral_data) { struct prm_setup_vc *omap3_setuptime =
arch/arm/mach-omap2/include/mach/board-sdp.h +4 -0
@@ -19,3 +19,7 @@ struct flash_partitions { };extern void sdp_flash_init (struct flash_partitions []); + +#ifdef CONFIG_TWL5030_GLITCH_FIX +extern void twl5030_glitchfix_changes_3430sdp (void ); +#endif
arch/arm/mach-omap2/include/mach/board-zoom.h +4 -0
@@ -3,3 +3,7 @@*/ extern int __init zoom_debugboard_init (void );extern void __init zoom_peripherals_init (void *); + +#ifdef CONFIG_TWL5030_GLITCH_FIX +extern void twl5030_glitchfix_changes_zoom (void ); +#endif
arch/arm/mach-omap2/twl4030-script.c +84 -0
94 lines not on this page · raw message
arch/arm/mach-omap2/twl4030-script.h +9 -0
@@ -7,9 +7,18 @@#ifdef CONFIG_TWL4030_POWER extern void twl4030_get_scripts (struct twl4030_power_data *t2scripts_data);extern void twl4030_get_vc_timings (struct prm_setup_vc *setup_vc); +#ifdef CONFIG_TWL5030_GLITCH_FIX +void use_twl4030_script_glitchfix ( +struct twl4030_power_data *t2scripts_data); +#endif +#else extern void twl4030_get_scripts (struct twl4030_power_data *t2scripts_data) {}extern void twl4030_get_vc_timings (struct prm_setup_vc *setup_vc) {} +#ifdef CONFIG_TWL5030_GLITCH_FIX +void use_twl4030_script_glitchfix ( +struct twl4030_power_data *t2scripts_data) {} +#endif #endif #endif
arch/arm/mach-omap2/voltage.c +10 -0
@@ -525,6 +525,16 @@ void __init omap_voltage_init_vc(struct prm_setup_vc *setup_vc) vc_config.vdd2_off = setup_vc->vdd2_off; } +#ifdef CONFIG_TWL5030_GLITCH_FIX +void omap_voltage_twl5030_glitchfix (void ) +{ + vc_config.clksetup_off =0x17B ; + + vc_config.voltoffset =0x10 ; + vc_config.voltsetup2 =0x16B ; +} +#endif +void update_voltsetup_time (int core_next_state) {/* update voltsetup time */
arch/arm/mach-omap2/voltage.h +4 -0
@@ -74,6 +74,10 @@ void omap_voltageprocessor_enable(int vp_id);void omap_voltageprocessor_disable (int vp_id);void omap_voltage_init_vc (struct prm_setup_vc *setup_vc);void update_voltsetup_time (int core_next_state); +#ifdef CONFIG_TWL5030_GLITCH_FIX +void omap_voltage_twl5030_glitchfix (void ); +#endif +void omap_voltage_init (void );int omap_voltage_scale (int vdd,u8 target_vsel,u8 current_vsel);void omap_reset_voltage (int vdd);
arch/arm/plat-omap/Kconfig +7 -0
@@ -84,6 +84,13 @@ config OMAP_SMARTREFLEX_TESTING WARNING: Enabling this option may cause your device to hang! +config TWL5030_GLITCH_FIX + bool "TWL5030 glitch fix" + depends on TWL4030_CORE + default n + help + Say Y if you want to enable TWL5030 glitch fix. + config OMAP_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_OMAP
drivers/mfd/twl4030-power.c +106 -0
132 lines not on this page · raw message
Signature · 1 line
1.6.0.4