Re: reboot command fails with low frequency

2015-03-05 Thread Michael Trimarchi
Hi

On Thu, Mar 5, 2015 at 9:46 AM, Ran Shalit ransha...@gmail.com wrote:
 I added power support to kernel menuconfig, such as cpuidle, and it
 seems to work fine. I also validated in counter that cpu gets into
 retention.

 We observer that with highest available frequency (60) reboot
 command is OK, but when frequency is changed to lower value, the
 reboot command fails.
 Has anyone observed such behaviour ?

I remember some commit for this problem. What version of the linux are
you running?

Michael


 Regards,
 Ran
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: reboot command fails with low frequency

2015-03-05 Thread Ran Shalit
 I added power support to kernel menuconfig, such as cpuidle, and it
 seems to work fine. I also validated in counter that cpu gets into
 retention.

We observer that with highest available frequency (60) reboot
command is OK, but when frequency is changed to lower value, the
reboot command fails.
Has anyone observed such behaviour ?

Regards,
Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: reboot command fails with low frequency

2015-03-05 Thread Ran Shalit
 We observer that with highest available frequency (60) reboot
 command is OK, but when frequency is changed to lower value, the
 reboot command fails.
 Has anyone observed such behaviour ?

 I remember some commit for this problem. What version of the linux are
 you running?

I use Linux version 2.6.37 #36 PREEMPT Thu Mar 5 10:56:04 IST 2015
armv7l GNU/Linux

Do you know how I can find this fix ?

Thanks!
Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: reboot command fails with low frequency

2015-03-05 Thread Michael Trimarchi
Hi

You should find the twl4030 power script and you should have something like this

static struct twl4030_ins wrst_seq[] __initdata = {
{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
};

static struct twl4030_script wrst_script __initdata = {
.script = wrst_seq,
.size   = ARRAY_SIZE(wrst_seq),
.flags  = TWL4030_WRST_SCRIPT,
};

static struct twl4030_script *omap3_power_scripts[] __initdata = {
wrst_script,
};

If I remember it was solved by some change here. In my old kernel I
have this commit

 Fix the reboot at lower frequency

Signed-off-by: Michael Trimarchi mich...@amarulasolutions.com

diff --git a/arch/arm/mach-omap2/board-panther.c
b/arch/arm/mach-omap2/board-panther.c
index ad2adf3..c71fdd9 100644
--- a/arch/arm/mach-omap2/board-panther.c
+++ b/arch/arm/mach-omap2/board-panther.c
@@ -368,7 +368,7 @@ static int __init panther_i2c_init(void)
 {
omap3_pmic_get_config(panther_twldata,
TWL_COMMON_PDATA_MADC |
-   TWL_COMMON_PDATA_AUDIO,
+   TWL_COMMON_PDATA_AUDIO | TWL_COMMON_PDATA_POWER,
TWL_COMMON_REGULATOR_VDAC);

omap3_pmic_init(twl4030, panther_twldata);

But this apply on an old device with a newer kernel and I don't
remember now the reason ;) Sorry.

Is this an android device? (2.6.37??? is really old)

Michael

On Thu, Mar 5, 2015 at 10:29 AM, Ran Shalit ransha...@gmail.com wrote:
 We observer that with highest available frequency (60) reboot
 command is OK, but when frequency is changed to lower value, the
 reboot command fails.
 Has anyone observed such behaviour ?

 I remember some commit for this problem. What version of the linux are
 you running?

 I use Linux version 2.6.37 #36 PREEMPT Thu Mar 5 10:56:04 IST 2015
 armv7l GNU/Linux

 Do you know how I can find this fix ?

 Thanks!
 Ran



-- 
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO  -  Founder  Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
|  [`as] http://www.amarulasolutions.com   |
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: reboot command fails with low frequency

2015-03-05 Thread Ran Shalit
On Thu, Mar 5, 2015 at 12:58 PM, Michael Trimarchi
mich...@amarulasolutions.com wrote:
 Hi

 You should find the twl4030 power script and you should have something like 
 this

 static struct twl4030_ins wrst_seq[] __initdata = {
 {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
 {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
 {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
 {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
 {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
 {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
 };

 static struct twl4030_script wrst_script __initdata = {
 .script = wrst_seq,
 .size   = ARRAY_SIZE(wrst_seq),
 .flags  = TWL4030_WRST_SCRIPT,
 };

 static struct twl4030_script *omap3_power_scripts[] __initdata = {
 wrst_script,
 };

 If I remember it was solved by some change here. In my old kernel I
 have this commit

  Fix the reboot at lower frequency

 Signed-off-by: Michael Trimarchi mich...@amarulasolutions.com

 diff --git a/arch/arm/mach-omap2/board-panther.c
 b/arch/arm/mach-omap2/board-panther.c
 index ad2adf3..c71fdd9 100644
 --- a/arch/arm/mach-omap2/board-panther.c
 +++ b/arch/arm/mach-omap2/board-panther.c
 @@ -368,7 +368,7 @@ static int __init panther_i2c_init(void)
  {
 omap3_pmic_get_config(panther_twldata,
 TWL_COMMON_PDATA_MADC |
 -   TWL_COMMON_PDATA_AUDIO,
 +   TWL_COMMON_PDATA_AUDIO | TWL_COMMON_PDATA_POWER,
 TWL_COMMON_REGULATOR_VDAC);

 omap3_pmic_init(twl4030, panther_twldata);

 But this apply on an old device with a newer kernel and I don't
 remember now the reason ;) Sorry.

 Is this an android device? (2.6.37??? is really old)

I have something quite different in my code:

static int __init twl4030_config_warmreset_sequence(u8 address)
{
int err;
u8 rd_data;

/* Set WARM RESET SEQ address for P1 */
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
R_SEQ_ADD_WARM);
if (err)
goto out;

/* P1/P2/P3 enable WARMRESET */
err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P1_SW_EVENTS);
if (err)
goto out;

rd_data |= ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P1_SW_EVENTS);
if (err)
goto out;

err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P2_SW_EVENTS);
if (err)
goto out;

rd_data |= ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P2_SW_EVENTS);
if (err)
goto out;

err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P3_SW_EVENTS);
if (err)
goto out;

rd_data |= ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
R_P3_SW_EVENTS);
out:
if (err)
pr_err(TWL4030 warmreset seq config error\n);
return err;
}

And the board is TI's board_omap3evm.c.

Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: reboot command fails with low frequency

2015-03-05 Thread Ran Shalit
I think I can also do some workaround if I set the frequency to the
highest level just before doing reset. The thing is that I mustn't use
sysfs in my system. Is there some way to set frequency without using
sysfs ?
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html