[patch v2 0/2] Get watchdog reboot working on efika smartbook

STALE5643d

6 messages, 4 authors, 2011-03-03 · open the first message on its own page

[patch v2 0/2] Get watchdog reboot working on efika smartbook

From: Arnaud Patard Rtp <hidden>
Date: 2011-03-02 18:45:12

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.

[patch v2 1/2] mc13892: reboot on wdi event

From: Arnaud Patard Rtp <hidden>
Date: 2011-03-02 18:45:13

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>

[patch v2 2/2] efika mx/sb: enable watchdog

From: Arnaud Patard Rtp <hidden>
Date: 2011-03-02 18:45:14

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>

[patch v2 1/2] mc13892: reboot on wdi event

From: Uwe Kleine-König <hidden>
Date: 2011-03-02 19:47:16

Hello Arnaud,

On Wed, Mar 02, 2011 at 07:45:13PM +0100, Arnaud Patard wrote:
quoted hunk
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 <redacted>

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/  |

[patch v2 1/2] mc13892: reboot on wdi event

From: Sergei Shtylyov <hidden>
Date: 2011-03-03 12:22:37

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<redacted>
quoted hunk
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)
[...]
quoted hunk
@@ -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

[patch v2 2/2] efika mx/sb: enable watchdog

From: s.hauer@pengutronix.de (Sascha Hauer)
Date: 2011-03-03 12:54:04

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
quoted hunk
v2:
- reorder Kconfig entry
- set wdi_reboot in mc13xxx platform data

Signed-off-by: Arnaud Patard <redacted>

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 |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help