linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch v2 0/2] Get watchdog reboot working on efika smartbook
@ 2011-03-02 18:45 Arnaud Patard (Rtp)
  2011-03-02 18:45 ` [patch v2 1/2] mc13892: reboot on wdi event Arnaud Patard (Rtp)
  2011-03-02 18:45 ` [patch v2 2/2] efika mx/sb: enable watchdog Arnaud Patard (Rtp)
  0 siblings, 2 replies; 7+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-03-02 18:45 UTC (permalink / raw)
  To: linux-arm-kernel


Hi,

With current patches in Sascha Hauer's tree, the efika smartbook is powering
off when rebooting. The cause of this bug is the default behaviour of the
mc13892 pmic. This patchset allows to configure the mc13892 to reboot the
system as expected by imx system.c throught platform_data and enables the
watchdog on the efika mx/sb systems.

Arnaud

v2:
- make the mc13892 behaviour configurable
- modify main mc13xxx driver instead of mc13892 regulator
- reorder Kconfig entry.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 1/2] mc13892: reboot on wdi event
  2011-03-02 18:45 [patch v2 0/2] Get watchdog reboot working on efika smartbook Arnaud Patard (Rtp)
@ 2011-03-02 18:45 ` Arnaud Patard (Rtp)
  2011-03-02 19:47   ` Uwe Kleine-König
  2011-03-03 12:22   ` Sergei Shtylyov
  2011-03-02 18:45 ` [patch v2 2/2] efika mx/sb: enable watchdog Arnaud Patard (Rtp)
  1 sibling, 2 replies; 7+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-03-02 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: mc13892_wdog_reboot.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110302/91e77fbc/attachment.ksh>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 2/2] efika mx/sb: enable watchdog
  2011-03-02 18:45 [patch v2 0/2] Get watchdog reboot working on efika smartbook Arnaud Patard (Rtp)
  2011-03-02 18:45 ` [patch v2 1/2] mc13892: reboot on wdi event Arnaud Patard (Rtp)
@ 2011-03-02 18:45 ` Arnaud Patard (Rtp)
  2011-03-03 12:54   ` Sascha Hauer
  1 sibling, 1 reply; 7+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-03-02 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: wdt.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110302/2afe7697/attachment.ksh>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 1/2] mc13892: reboot on wdi event
  2011-03-02 18:45 ` [patch v2 1/2] mc13892: reboot on wdi event Arnaud Patard (Rtp)
@ 2011-03-02 19:47   ` Uwe Kleine-König
  2011-03-02 19:58     ` Arnaud Patard (Rtp)
  2011-03-03 12:22   ` Sergei Shtylyov
  1 sibling, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2011-03-02 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Arnaud,

On Wed, Mar 02, 2011 at 07:45:13PM +0100, Arnaud Patard wrote:
> By default, on wdi (watchdog input) event the mc13892 is powering off.
> This patch allows to change this behaviour throught platform_data.
> 
> v2:
> - move to mc13xxx-core
> - make it configurable
> 
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> 
> Index: linux-2.6-submit/drivers/mfd/mc13xxx-core.c
> ===================================================================
> --- linux-2.6-submit.orig/drivers/mfd/mc13xxx-core.c	2011-03-01 22:26:40.000000000 +0100
> +++ linux-2.6-submit/drivers/mfd/mc13xxx-core.c	2011-03-02 12:24:30.000000000 +0100
> @@ -136,6 +136,9 @@
>  #define MC13XXX_REVISION_FAB		(0x03 << 11)
>  #define MC13XXX_REVISION_ICIDCODE	(0x3f << 13)
>  
> +#define MC13892_POWERCTL2		15
> +#define MC13892_POWERCTL2_WDIRESET	(1<<12)
> +
>  #define MC13783_ADC1		44
>  #define MC13783_ADC1_ADEN		(1 << 0)
>  #define MC13783_ADC1_RAND		(1 << 1)
> @@ -715,6 +718,7 @@
>  	struct mc13xxx_platform_data *pdata = dev_get_platdata(&spi->dev);
>  	enum mc13xxx_id id;
>  	int ret;
> +	unsigned int val;
>  
>  	mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
>  	if (!mc13xxx)
> @@ -734,6 +738,15 @@
>  	if (ret || id == MC13XXX_ID_INVALID)
>  		goto err_revision;
>  
> +	if ((id == MC13XXX_ID_MC13892) && pdata->wdi_reboot) {
> +		/* allows to reboot on wdi event */
> +		ret = mc13xxx_reg_read(mc13xxx, MC13892_POWERCTL2, &val);
> +		if (!ret) {
> +			val |= MC13892_POWERCTL2_WDIRESET;
> +			mc13xxx_reg_write(mc13xxx, MC13892_POWERCTL2, val);
> +		}
> +	}
> +
>  	/* mask all irqs */
>  	ret = mc13xxx_reg_write(mc13xxx, MC13XXX_IRQMASK0, 0x00ffffff);
>  	if (ret)
> Index: linux-2.6-submit/include/linux/mfd/mc13xxx.h
> ===================================================================
> --- linux-2.6-submit.orig/include/linux/mfd/mc13xxx.h	2011-03-01 22:30:59.000000000 +0100
> +++ linux-2.6-submit/include/linux/mfd/mc13xxx.h	2011-03-01 22:31:27.000000000 +0100
> @@ -149,6 +149,8 @@
git diff provide some info about the context after the @@ hunk header.
I consider this really useful.  GNU diff is able to do this, too (option
-p).

>  	int num_regulators;
>  	struct mc13xxx_regulator_init_data *regulators;
>  	struct mc13xxx_leds_platform_data *leds;
> +
> +	unsigned int wdi_reboot;
there is already a member .flags.  What about defining another bit for
that?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 1/2] mc13892: reboot on wdi event
  2011-03-02 19:47   ` Uwe Kleine-König
@ 2011-03-02 19:58     ` Arnaud Patard (Rtp)
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-03-02 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> writes:

Hi,
> Hello Arnaud,
>
> On Wed, Mar 02, 2011 at 07:45:13PM +0100, Arnaud Patard wrote:
>> By default, on wdi (watchdog input) event the mc13892 is powering off.
>> This patch allows to change this behaviour throught platform_data.
>> 
>> v2:
>> - move to mc13xxx-core
>> - make it configurable
>> 
>> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
>> 
>> Index: linux-2.6-submit/drivers/mfd/mc13xxx-core.c
>> ===================================================================
>> --- linux-2.6-submit.orig/drivers/mfd/mc13xxx-core.c	2011-03-01 22:26:40.000000000 +0100
>> +++ linux-2.6-submit/drivers/mfd/mc13xxx-core.c	2011-03-02 12:24:30.000000000 +0100
>> @@ -136,6 +136,9 @@
>>  #define MC13XXX_REVISION_FAB		(0x03 << 11)
>>  #define MC13XXX_REVISION_ICIDCODE	(0x3f << 13)
>>  
>> +#define MC13892_POWERCTL2		15
>> +#define MC13892_POWERCTL2_WDIRESET	(1<<12)
>> +
>>  #define MC13783_ADC1		44
>>  #define MC13783_ADC1_ADEN		(1 << 0)
>>  #define MC13783_ADC1_RAND		(1 << 1)
>> @@ -715,6 +718,7 @@
>>  	struct mc13xxx_platform_data *pdata = dev_get_platdata(&spi->dev);
>>  	enum mc13xxx_id id;
>>  	int ret;
>> +	unsigned int val;
>>  
>>  	mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
>>  	if (!mc13xxx)
>> @@ -734,6 +738,15 @@
>>  	if (ret || id == MC13XXX_ID_INVALID)
>>  		goto err_revision;
>>  
>> +	if ((id == MC13XXX_ID_MC13892) && pdata->wdi_reboot) {
>> +		/* allows to reboot on wdi event */
>> +		ret = mc13xxx_reg_read(mc13xxx, MC13892_POWERCTL2, &val);
>> +		if (!ret) {
>> +			val |= MC13892_POWERCTL2_WDIRESET;
>> +			mc13xxx_reg_write(mc13xxx, MC13892_POWERCTL2, val);
>> +		}
>> +	}
>> +
>>  	/* mask all irqs */
>>  	ret = mc13xxx_reg_write(mc13xxx, MC13XXX_IRQMASK0, 0x00ffffff);
>>  	if (ret)
>> Index: linux-2.6-submit/include/linux/mfd/mc13xxx.h
>> ===================================================================
>> --- linux-2.6-submit.orig/include/linux/mfd/mc13xxx.h	2011-03-01 22:30:59.000000000 +0100
>> +++ linux-2.6-submit/include/linux/mfd/mc13xxx.h	2011-03-01 22:31:27.000000000 +0100
>> @@ -149,6 +149,8 @@
> git diff provide some info about the context after the @@ hunk header.
> I consider this really useful.  GNU diff is able to do this, too (option
> -p).
>

hmm... I forgot to configure quilt to do that. sorry.

>>  	int num_regulators;
>>  	struct mc13xxx_regulator_init_data *regulators;
>>  	struct mc13xxx_leds_platform_data *leds;
>> +
>> +	unsigned int wdi_reboot;
> there is already a member .flags.  What about defining another bit for
> that?
>

I thought that using the .flags member for that was kind of misusing it
as for now, it's only used to enable or disable some mc13xxx sub device.

Arnaud

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 1/2] mc13892: reboot on wdi event
  2011-03-02 18:45 ` [patch v2 1/2] mc13892: reboot on wdi event Arnaud Patard (Rtp)
  2011-03-02 19:47   ` Uwe Kleine-König
@ 2011-03-03 12:22   ` Sergei Shtylyov
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2011-03-03 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 02-03-2011 21:45, Arnaud Patard (Rtp) wrote:

> By default, on wdi (watchdog input) event the mc13892 is powering off.
> This patch allows to change this behaviour throught platform_data.

    Er, for some reason, this patch was in attachment...

> v2:
> - move to mc13xxx-core
> - make it configurable

> Signed-off-by: Arnaud Patard<arnaud.patard@rtp-net.org>

> Index: linux-2.6-submit/drivers/mfd/mc13xxx-core.c
> ===================================================================
> --- linux-2.6-submit.orig/drivers/mfd/mc13xxx-core.c	2011-03-01 22:26:40.000000000 +0100
> +++ linux-2.6-submit/drivers/mfd/mc13xxx-core.c	2011-03-02 12:24:30.000000000 +0100
> @@ -136,6 +136,9 @@
>   #define MC13XXX_REVISION_FAB		(0x03 << 11)
>   #define MC13XXX_REVISION_ICIDCODE	(0x3f << 13)
>
> +#define MC13892_POWERCTL2		15
> +#define MC13892_POWERCTL2_WDIRESET	(1<<12)

    Please add spaces around << to@least be consistent with the code above 
and below.

> +
>   #define MC13783_ADC1		44
>   #define MC13783_ADC1_ADEN		(1 << 0)
>   #define MC13783_ADC1_RAND		(1 << 1)
[...]
> @@ -734,6 +738,15 @@
>   	if (ret || id == MC13XXX_ID_INVALID)
>   		goto err_revision;
>
> +	if ((id == MC13XXX_ID_MC13892) && pdata->wdi_reboot) {

    Parens around == not necessary.

WBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v2 2/2] efika mx/sb: enable watchdog
  2011-03-02 18:45 ` [patch v2 2/2] efika mx/sb: enable watchdog Arnaud Patard (Rtp)
@ 2011-03-03 12:54   ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2011-03-03 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

Arnaud,

On Wed, Mar 02, 2011 at 07:45:14PM +0100, Arnaud Patard wrote:
> Register watchdog for efika mx and sb systems.

I promised myself to keep a better eye on patches I can't take because
they have dependencies to other subsystems. This patch is one of those
as it depends on the wdi_reboot field in the platform data.
Can you please resend this once the other patches have hit mainline?

Sascha

> 
> v2:
> - reorder Kconfig entry
> - set wdi_reboot in mc13xxx platform data
> 
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> 
> Index: linux-2.6-submit/arch/arm/mach-mx5/mx51_efika.c
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/mach-mx5/mx51_efika.c	2011-03-01 22:24:31.000000000 +0100
> +++ linux-2.6-submit/arch/arm/mach-mx5/mx51_efika.c	2011-03-01 22:36:35.000000000 +0100
> @@ -574,6 +574,7 @@
>  	.flags = MC13XXX_USE_RTC | MC13XXX_USE_REGULATOR,
>  	.num_regulators = ARRAY_SIZE(mx51_efika_regulators),
>  	.regulators = mx51_efika_regulators,
> +	.wdi_reboot = 1,
>  };
>  
>  static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
> @@ -611,6 +612,7 @@
>  					ARRAY_SIZE(mx51efika_pads));
>  	imx51_add_imx_uart(0, &uart_pdata);
>  	mx51_efika_usb();
> +	imx51_add_imx2_wdt(0, NULL);
>  	imx51_add_sdhci_esdhc_imx(0, NULL);
>  
>  	/* FIXME: comes from original code. check this. */
> Index: linux-2.6-submit/arch/arm/mach-mx5/Kconfig
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/mach-mx5/Kconfig	2011-03-01 22:24:31.000000000 +0100
> +++ linux-2.6-submit/arch/arm/mach-mx5/Kconfig	2011-03-01 22:35:47.000000000 +0100
> @@ -116,6 +116,7 @@
>  config MX51_EFIKA_COMMON
>  	bool
>  	select SOC_IMX51
> +	select IMX_HAVE_PLATFORM_IMX2_WDT
>  	select IMX_HAVE_PLATFORM_IMX_UART
>  	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
>  	select IMX_HAVE_PLATFORM_SPI_IMX
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-03 12:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 18:45 [patch v2 0/2] Get watchdog reboot working on efika smartbook Arnaud Patard (Rtp)
2011-03-02 18:45 ` [patch v2 1/2] mc13892: reboot on wdi event Arnaud Patard (Rtp)
2011-03-02 19:47   ` Uwe Kleine-König
2011-03-02 19:58     ` Arnaud Patard (Rtp)
2011-03-03 12:22   ` Sergei Shtylyov
2011-03-02 18:45 ` [patch v2 2/2] efika mx/sb: enable watchdog Arnaud Patard (Rtp)
2011-03-03 12:54   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).