public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: arnaud.patard@rtp-net•org (Arnaud Patard (Rtp))
To: linux-arm-kernel@lists•infradead.org
Subject: [patch v3 10/10] efikamx: add reset
Date: Wed, 27 Oct 2010 11:59:17 +0200	[thread overview]
Message-ID: <87hbg87y8a.fsf@lechat.rtp-net.org> (raw)
In-Reply-To: <20101027073629.GZ8554@pengutronix.de> ("Uwe Kleine-König"'s message of "Wed, 27 Oct 2010 09:36:29 +0200")

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

> On Tue, Oct 26, 2010 at 10:07:33PM +0200, Arnaud Patard wrote:
>> The efikamx board is using a gpio to reset the board so add support
>> for it
>> 
>> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net•org>
>> Index: linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
>> ===================================================================
>> --- linux-2.6-submit.orig/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-20 18:30:58.000000000 +0200
>> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-20 18:31:00.000000000 +0200
>> @@ -57,6 +57,9 @@
>>  #define EFIKAMX_SPI_CS0		(3*32 + 24)
>>  #define EFIKAMX_SPI_CS1		(3*32 + 25)
>>  
>> +#define EFIKAMX_RESET1_1	(2*32 + 2)
>> +#define EFIKAMX_RESET		(0*32 + 4)
> Maybe add a comment here about the difference.  When I first read that
> it looked strange.


ok

>
>> +
>>  /* the pci ids pin have pull up. they're driven low according to board id */
>>  #define MX51_PAD_PCBID0	IOMUX_PAD(0x518, 0x130, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
>>  #define MX51_PAD_PCBID1	IOMUX_PAD(0x51C, 0x134, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
>> @@ -112,6 +115,10 @@
>>  	MX51_PAD_CSPI1_SS1__GPIO_4_25,
>>  	MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
>>  	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
>> +
>> +	/* reset */
>> +	MX51_PAD_DI1_PIN13__GPIO_3_2,
>> +	MX51_PAD_GPIO_1_4__GPIO_1_4,
>>  };
>>  
>>  /* Serial ports */
>> @@ -306,6 +313,14 @@
>>  	.num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs),
>>  };
>>  
>> +void mx51_efikamx_reset(void)
>> +{
>> +	if (system_rev == 0x11)
>> +		gpio_direction_output(EFIKAMX_RESET1_1, 0);
>> +	else
>> +		gpio_direction_output(EFIKAMX_RESET, 0);
>> +}
>> +
>>  static void __init mxc_board_init(void)
>>  {
>>  	mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
>> @@ -327,6 +342,11 @@
>>  	spi_register_board_info(mx51_efikamx_spi_board_info,
>>  		ARRAY_SIZE(mx51_efikamx_spi_board_info));
>>  	imx51_add_ecspi(0, &mx51_efikamx_spi_pdata);
>> +
>> +	if (system_rev == 0x11)
>> +		gpio_request(EFIKAMX_RESET1_1, "reset");
>> +	else
>> +		gpio_request(EFIKAMX_RESET, "reset");
> gpio_direction_output(..., 1)?

default setting is fine but adding this will not harm. Will change.


>
>>  }
>>  
>>  static void __init mx51_efikamx_timer_init(void)
>> Index: linux-2.6-submit/arch/arm/plat-mxc/include/mach/common.h
>> ===================================================================
>> --- linux-2.6-submit.orig/arch/arm/plat-mxc/include/mach/common.h	2010-10-20 18:30:27.000000000 +0200
>> +++ linux-2.6-submit/arch/arm/plat-mxc/include/mach/common.h	2010-10-20 18:31:00.000000000 +0200
>> @@ -50,5 +50,5 @@
>>  extern void mxc91231_power_off(void);
>>  extern void mxc91231_arch_reset(int, const char *);
>>  extern void mxc91231_prepare_idle(void);
>> -
>> +extern void mx51_efikamx_reset(void);
>>  #endif
>> Index: linux-2.6-submit/arch/arm/plat-mxc/system.c
>> ===================================================================
>> --- linux-2.6-submit.orig/arch/arm/plat-mxc/system.c	2010-10-20 18:30:27.000000000 +0200
>> +++ linux-2.6-submit/arch/arm/plat-mxc/system.c	2010-10-20 18:31:00.000000000 +0200
>> @@ -26,6 +26,7 @@
>>  #include <mach/common.h>
>>  #include <asm/proc-fns.h>
>>  #include <asm/system.h>
>> +#include <asm/mach-types.h>
>>  
>>  static void __iomem *wdog_base;
>>  
>> @@ -42,6 +43,11 @@
>>  		return;
>>  	}
>>  #endif
>> +#ifdef CONFIG_MACH_MX51_EFIKAMX
>> +	if (machine_is_mx51_efikamx())
>> +		mx51_efikamx_reset();
>> +#endif
> Depending on how fast the reset occurs mx51_efikamx_reset returns and
> the processor continues to execute the watchdog reset.  Is this
> intended?

hmm... sticking to the original code, a return is needed. As the system
was rebooting fine, I didn't notice that. I'm going to test if it's
still working without the watchdog reset and update my patch
accordingly.

Arnaud

      reply	other threads:[~2010-10-27  9:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 01/10] efikamx: read board id Arnaud Patard (Rtp)
2010-11-01 15:24   ` Nguyen Dinh-R00091
2010-11-01 20:05     ` Matt Sealey
2010-11-02  9:35     ` Arnaud Patard (Rtp)
2010-11-02 10:47       ` Uwe Kleine-König
2010-11-02 17:29         ` Sascha Hauer
2010-10-26 20:07 ` [patch v3 02/10] imx51: fix iomux configuration Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 03/10] imx51: enhance iomux configuration for esdhc support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 04/10] efikamx: add mmc support Arnaud Patard (Rtp)
2010-10-27  7:37   ` Uwe Kleine-König
2010-10-26 20:07 ` [patch v3 05/10] imx51: add gpio mode for csi1 {h,v}sync Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 06/10] efikamx: add leds support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 07/10] efikamx: add support for power key Arnaud Patard (Rtp)
2010-10-27  7:30   ` Uwe Kleine-König
2010-10-27  9:51     ` Arnaud Patard (Rtp)
2010-10-27 10:04       ` Uwe Kleine-König
2010-10-26 20:07 ` [patch v3 08/10] imx51: fix gpio_4_24 and gpio_4_25 pad configuration Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 09/10] efikamx: add spi nor support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 10/10] efikamx: add reset Arnaud Patard (Rtp)
2010-10-27  7:36   ` Uwe Kleine-König
2010-10-27  9:59     ` Arnaud Patard (Rtp) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hbg87y8a.fsf@lechat.rtp-net.org \
    --to=arnaud.patard@rtp-net$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox