RE: [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files

2009-10-05 Thread Nayak, Rajendra

>-Original Message-
>From: Kevin Hilman [mailto:khil...@deeprootsystems.com] 
>Sent: Thursday, October 01, 2009 12:44 AM
>To: Nayak, Rajendra
>Cc: linux-omap@vger.kernel.org
>Subject: Re: [PATCH 1/2] OMAP3: PM: Configure PRM setup times 
>from board files
>
>Rajendra Nayak  writes:
>
>> The setup times to be programmed in the PRM module on OMAP
>> (for clksetup, voltsetup etc) are board specific.
>> They depend heavily on the PMIC used and even on different boards
>> with the same PMIC, they vary based on the sleep/wake
>> sequence used, system clock speed et al.
>>
>> This patch makes it possible for these setup values to be
>> configured from different board files.
>>
>> Signed-off-by: Rajendra Nayak 
>
>Hi Rajendra,
>
>Sorry about this, but your series slipped through cracks on my side.
>
>I like this approach, but it needs to be rebased against current PM
>branch since lots of the code that it touches has been reworked.
>
>Also, instead of continuing to overload init_common_hw, how about
>adding something like omap_pm_register() which takes the various rate
>tables and setup times, or possibly adding the rate tables and setup
>times as arguments to omap3_pm_earlly_init() and making it explicitly
>called by board code instead of an arch_initcall().

Hi Kevin,

Yes, I will rework this patch and repost in a couple days.

regards,
Rajendra

>
>Kevin
>
>> ---
>>  arch/arm/mach-omap2/board-3430sdp.c |   20 +++-
>>  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/board-rx51.c|2 +-
>>  arch/arm/mach-omap2/board-zoom2.c   |2 +-
>>  arch/arm/mach-omap2/io.c|5 -
>>  arch/arm/mach-omap2/pm.c|7 +++
>>  arch/arm/mach-omap2/pm.h|   16 +---
>>  arch/arm/mach-omap2/pm34xx.c|   10 ++
>>  arch/arm/plat-omap/include/mach/io.h|4 +++-
>>  15 files changed, 61 insertions(+), 19 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
>b/arch/arm/mach-omap2/board-3430sdp.c
>> index e9a4d10..b43cf94 100644
>> --- a/arch/arm/mach-omap2/board-3430sdp.c
>> +++ b/arch/arm/mach-omap2/board-3430sdp.c
>> @@ -58,6 +58,23 @@
>>  
>>  #define TWL4030_MSECURE_GPIO 22
>>  
>> +/* FIXME: These are not the optimal setup values to be used 
>on 3430sdp*/
>> +static struct prm_setup_vc omap3_setuptime_table = {
>> +.clksetup = 0xff,
>> +.voltsetup_time1 = 0xfff,
>> +.voltsetup_time2 = 0xfff,
>> +.voltoffset = 0xff,
>> +.voltsetup2 = 0xff,
>> +.vdd0_on = 0x30,
>> +.vdd0_onlp = 0x20,
>> +.vdd0_ret = 0x1e,
>> +.vdd0_off = 0x00,
>> +.vdd1_on = 0x2c,
>> +.vdd1_onlp = 0x20,
>> +.vdd1_ret = 0x1e,
>> +.vdd1_off = 0x00,
>> +};
>> +
>>  static int sdp3430_keymap[] = {
>>  KEY(0, 0, KEY_LEFT),
>>  KEY(0, 1, KEY_RIGHT),
>> @@ -174,7 +191,8 @@ static struct platform_device 
>*sdp3430_devices[] __initdata = {
>>  static void __init omap_3430sdp_init_irq(void)
>>  {
>>  omap2_init_common_hw(hyb18m512160af6_sdrc_params, 
>omap3_mpu_rate_table,
>> - omap3_dsp_rate_table, omap3_l3_rate_table);
>> + omap3_dsp_rate_table, omap3_l3_rate_table,
>> + &omap3_setuptime_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 1a7fb81..293a9b2 100644
>> --- a/arch/arm/mach-omap2/board-apollon.c
>> +++ b/arch/arm/mach-omap2/board-apollon.c
>> @@ -250,7 +250,7 @@ out:
>>  
>>  static void __init omap_apollon_init_irq(void)
>>  {
>> -omap2_init_common_hw(NULL, NULL, 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 23583da..dfc1b49 100644
>> --- a/arch/arm/mach-omap2/board-generic.c
>> +++ b/arch/arm/mach-omap2/board-generic.c

Re: [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files

2009-09-30 Thread Kevin Hilman
Rajendra Nayak  writes:

> The setup times to be programmed in the PRM module on OMAP
> (for clksetup, voltsetup etc) are board specific.
> They depend heavily on the PMIC used and even on different boards
> with the same PMIC, they vary based on the sleep/wake
> sequence used, system clock speed et al.
>
> This patch makes it possible for these setup values to be
> configured from different board files.
>
> Signed-off-by: Rajendra Nayak 

Hi Rajendra,

Sorry about this, but your series slipped through cracks on my side.

I like this approach, but it needs to be rebased against current PM
branch since lots of the code that it touches has been reworked.

Also, instead of continuing to overload init_common_hw, how about
adding something like omap_pm_register() which takes the various rate
tables and setup times, or possibly adding the rate tables and setup
times as arguments to omap3_pm_earlly_init() and making it explicitly
called by board code instead of an arch_initcall().

Kevin

> ---
>  arch/arm/mach-omap2/board-3430sdp.c |   20 +++-
>  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/board-rx51.c|2 +-
>  arch/arm/mach-omap2/board-zoom2.c   |2 +-
>  arch/arm/mach-omap2/io.c|5 -
>  arch/arm/mach-omap2/pm.c|7 +++
>  arch/arm/mach-omap2/pm.h|   16 +---
>  arch/arm/mach-omap2/pm34xx.c|   10 ++
>  arch/arm/plat-omap/include/mach/io.h|4 +++-
>  15 files changed, 61 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
> b/arch/arm/mach-omap2/board-3430sdp.c
> index e9a4d10..b43cf94 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -58,6 +58,23 @@
>  
>  #define TWL4030_MSECURE_GPIO 22
>  
> +/* FIXME: These are not the optimal setup values to be used on 3430sdp*/
> +static struct prm_setup_vc omap3_setuptime_table = {
> + .clksetup = 0xff,
> + .voltsetup_time1 = 0xfff,
> + .voltsetup_time2 = 0xfff,
> + .voltoffset = 0xff,
> + .voltsetup2 = 0xff,
> + .vdd0_on = 0x30,
> + .vdd0_onlp = 0x20,
> + .vdd0_ret = 0x1e,
> + .vdd0_off = 0x00,
> + .vdd1_on = 0x2c,
> + .vdd1_onlp = 0x20,
> + .vdd1_ret = 0x1e,
> + .vdd1_off = 0x00,
> +};
> +
>  static int sdp3430_keymap[] = {
>   KEY(0, 0, KEY_LEFT),
>   KEY(0, 1, KEY_RIGHT),
> @@ -174,7 +191,8 @@ static struct platform_device *sdp3430_devices[] 
> __initdata = {
>  static void __init omap_3430sdp_init_irq(void)
>  {
>   omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table,
> -  omap3_dsp_rate_table, omap3_l3_rate_table);
> +  omap3_dsp_rate_table, omap3_l3_rate_table,
> +  &omap3_setuptime_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 1a7fb81..293a9b2 100644
> --- a/arch/arm/mach-omap2/board-apollon.c
> +++ b/arch/arm/mach-omap2/board-apollon.c
> @@ -250,7 +250,7 @@ out:
>  
>  static void __init omap_apollon_init_irq(void)
>  {
> - omap2_init_common_hw(NULL, NULL, 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 23583da..dfc1b49 100644
> --- a/arch/arm/mach-omap2/board-generic.c
> +++ b/arch/arm/mach-omap2/board-generic.c
> @@ -33,7 +33,7 @@
>  
>  static void __init omap_generic_init_irq(void)
>  {
> - omap2_init_common_hw(NULL, NULL, 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 de6adf7..af0ebaf 100644
> --- a/arch/arm/mach-omap2/board-h4.c
> +++ b/arch/arm/mach-omap2/board-h4.c
> @@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
>  
>  static void __init omap_h4_init_irq(void)
>  {
> - omap2_init_common_hw(NULL, NULL, 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 3b662ff..eb5e2e0 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
>  
>  static void __init omap_ldp_init_irq(void)
>