All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch v3 00/10] efikamx support improvements - take 3
@ 2010-10-26 20:07 Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 01/10] efikamx: read board id Arnaud Patard (Rtp)
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel



Hi,

This patchset aims at improving current efikamx support. It adds support for :
- board id detection
- sdhc
- leds
- power button
- spi nor
- reset

I also had to fix/improve some imx51 iomux header so there are patches for
iomux-mx51.h.

v3:
- use imx51_add_gpio_keys
- fix patch description for power key patch

v2:
- split iomux patch 3 into 2 patches
- reorder patches
- fix space comment
- fix Amit's comments
- decrease board id msleep

Arnaud

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

* [patch v3 01/10] efikamx: read board id
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-11-01 15:24   ` Nguyen Dinh-R00091
  2010-10-26 20:07 ` [patch v3 02/10] imx51: fix iomux configuration Arnaud Patard (Rtp)
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [patch v3 02/10] imx51: fix iomux configuration
  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-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 03/10] imx51: enhance iomux configuration for esdhc support Arnaud Patard (Rtp)
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: imx51_fix_iomux_gpio_1_x.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/48ff3352/attachment.ksh>

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

* [patch v3 03/10] imx51: enhance iomux configuration for esdhc support
  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-10-26 20:07 ` [patch v3 02/10] imx51: fix iomux configuration Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 04/10] efikamx: add mmc support Arnaud Patard (Rtp)
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [patch v3 04/10] efikamx: add mmc support
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (2 preceding siblings ...)
  2010-10-26 20:07 ` [patch v3 03/10] imx51: enhance iomux configuration for esdhc support Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` 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)
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [patch v3 05/10] imx51: add gpio mode for csi1 {h,v}sync
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (3 preceding siblings ...)
  2010-10-26 20:07 ` [patch v3 04/10] efikamx: add mmc support Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 06/10] efikamx: add leds support Arnaud Patard (Rtp)
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: imx51_add_csi1_hvsync_gpio.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/6519658e/attachment.ksh>

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

* [patch v3 06/10] efikamx: add leds support
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (4 preceding siblings ...)
  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 ` Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 07/10] efikamx: add support for power key Arnaud Patard (Rtp)
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: efikamx_add_leds.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/48cc0f20/attachment.ksh>

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

* [patch v3 07/10] efikamx: add support for power key
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (5 preceding siblings ...)
  2010-10-26 20:07 ` [patch v3 06/10] efikamx: add leds support Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-10-27  7:30   ` 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)
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: efikamx_add_powerkey.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/0e2eda6d/attachment.ksh>

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

* [patch v3 08/10] imx51: fix gpio_4_24 and gpio_4_25 pad configuration
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (6 preceding siblings ...)
  2010-10-26 20:07 ` [patch v3 07/10] efikamx: add support for power key Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` 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)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: imx51_fix_iomux_gpio_4_24_25.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/13272d7a/attachment.ksh>

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

* [patch v3 09/10] efikamx: add spi nor support
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (7 preceding siblings ...)
  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 ` Arnaud Patard (Rtp)
  2010-10-26 20:07 ` [patch v3 10/10] efikamx: add reset Arnaud Patard (Rtp)
  9 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: efikamx_add_nor.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/22a98384/attachment.ksh>

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

* [patch v3 10/10] efikamx: add reset
  2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
                   ` (8 preceding siblings ...)
  2010-10-26 20:07 ` [patch v3 09/10] efikamx: add spi nor support Arnaud Patard (Rtp)
@ 2010-10-26 20:07 ` Arnaud Patard (Rtp)
  2010-10-27  7:36   ` Uwe Kleine-König
  9 siblings, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-26 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: efikamx_reset.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101026/060ceaf2/attachment.ksh>

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

* [patch v3 07/10] efikamx: add support for power key
  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)
  0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2010-10-27  7:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 26, 2010 at 10:07:30PM +0200, Arnaud Patard wrote:
> This patch adds support for power key button of the efika mx. It's connected
> on  GPIO 2 31.
> 
> 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-26 19:57:16.000000000 +0200
> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-26 19:59:16.000000000 +0200
> @@ -19,6 +19,8 @@
>  #include <linux/i2c.h>
>  #include <linux/gpio.h>
>  #include <linux/leds.h>
> +#include <linux/input.h>
Do you really need linux/input.h?

> +#include <linux/gpio_keys.h>
this is included by devices-common.h (which is included by
devices-imx51.h).  So you can drop this.

>  #include <linux/delay.h>
>  #include <linux/io.h>
>  #include <linux/fsl_devices.h>
> @@ -48,10 +50,13 @@
>  #define EFIKAMX_GREEN_LED	(2*32 + 14)
>  #define EFIKAMX_RED_LED		(2*32 + 15)
>  
> +#define EFIKAMX_POWER_KEY	(1*32 + 31)
> +
>  /* 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)
>  #define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
> +#define MX51_PAD_PWRKEY	IOMUX_PAD(0x48c, 0x0f8, 1, 0x0,   0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
>  
>  static struct pad_desc mx51efikamx_pads[] = {
>  	/* UART1 */
> @@ -91,6 +96,9 @@
>  	MX51_PAD_CSI1_D9__GPIO_3_13,
>  	MX51_PAD_CSI1_VSYNC__GPIO_3_14,
>  	MX51_PAD_CSI1_HSYNC__GPIO_3_15,
> +
> +	/* power key */
> +	MX51_PAD_PWRKEY,
>  };
>  
>  /* Serial ports */
> @@ -220,6 +228,22 @@
>  	},
>  };
>  
> +static struct gpio_keys_button mx51_efikamx_powerkey[] = {
this should be const and __initconst

> +	{
> +		.code   = KEY_POWER,
> +		.gpio   = EFIKAMX_POWER_KEY,
> +		.type   = EV_PWR,
> +		.desc   = "Power Button (CM)",
> +		.wakeup = 1,
> +		.debounce_interval = 10, /* ms */
> +	},
> +};
I'd prefer s/ *=/ =/ here.  The equal signs are not aligned anyhow
because of the last line.

> +
> +static struct gpio_keys_platform_data mx51_efikamx_powerkey_data = {
> +	.buttons = mx51_efikamx_powerkey,
> +	.nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
> +};
> +
>  static void __init mxc_board_init(void)
>  {
>  	mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
> @@ -236,6 +260,7 @@
>  	}
>  
>  	platform_device_register(&mx51_efikamx_leds_device);
> +	imx51_add_gpio_keys(&mx51_efikamx_powerkey_data);
>  }
>  
>  static void __init mx51_efikamx_timer_init(void)
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

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

* [patch v3 10/10] efikamx: add reset
  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)
  0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2010-10-27  7:36 UTC (permalink / raw)
  To: linux-arm-kernel

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.

> +
>  /* 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)?

>  }
>  
>  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?

> +
>  	if (cpu_is_mx1()) {
>  		wcr_enable = (1 << 0);
>  	} else {

Best regards
Uwe

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

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

* [patch v3 04/10] efikamx: add mmc support
  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
  0 siblings, 0 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2010-10-27  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 26, 2010 at 10:07:27PM +0200, Arnaud Patard wrote:
> The efika mx is using a esdhc host for mmc support. Now that the sdhci
> has support for it, enable 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:40.000000000 +0200
> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-20 18:30:46.000000000 +0200
> @@ -59,6 +59,28 @@
>  	MX51_PAD_PCBID0,
>  	MX51_PAD_PCBID1,
>  	MX51_PAD_PCBID2,
> +
> +	/* SD 1 */
> +	MX51_PAD_SD1_CMD__SD1_CMD,
> +	MX51_PAD_SD1_CLK__SD1_CLK,
> +	MX51_PAD_SD1_DATA0__SD1_DATA0,
> +	MX51_PAD_SD1_DATA1__SD1_DATA1,
> +	MX51_PAD_SD1_DATA2__SD1_DATA2,
> +	MX51_PAD_SD1_DATA3__SD1_DATA3,
> +
> +	/* SD 2 */
> +	MX51_PAD_SD2_CMD__SD2_CMD,
> +	MX51_PAD_SD2_CLK__SD2_CLK,
> +	MX51_PAD_SD2_DATA0__SD2_DATA0,
> +	MX51_PAD_SD2_DATA1__SD2_DATA1,
> +	MX51_PAD_SD2_DATA2__SD2_DATA2,
> +	MX51_PAD_SD2_DATA3__SD2_DATA3,
> +
> +	/* SD/MMC WP/CD */
> +	MX51_PAD_GPIO_1_0__ESDHC1_CD,
> +	MX51_PAD_GPIO_1_1__ESDHC1_WP,
> +	MX51_PAD_GPIO_1_7__ESDHC2_WP,
> +	MX51_PAD_GPIO_1_8__ESDHC2_CD,
>  };
>  
>  /* Serial ports */
> @@ -164,6 +186,11 @@
>  	mx51_efikamx_board_id();
>  	mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
>  	mxc_init_imx_uart();
> +	imx51_add_esdhc(0, NULL);
> +
> +	/* on < 1.2 boards the 2 SD controller are used */
s/the 2/both/ ?

> +	if (system_rev < 0x12)
> +		imx51_add_esdhc(1, NULL);
>  }
>  
>  static void __init mx51_efikamx_timer_init(void)
> Index: linux-2.6-submit/arch/arm/mach-mx5/Kconfig
> ===================================================================
> --- linux-2.6-submit.orig/arch/arm/mach-mx5/Kconfig	2010-10-20 18:30:29.000000000 +0200
> +++ linux-2.6-submit/arch/arm/mach-mx5/Kconfig	2010-10-20 18:30:46.000000000 +0200
> @@ -80,6 +80,7 @@
>  config MACH_MX51_EFIKAMX
>  	bool "Support MX51 Genesi Efika MX nettop"
>  	select IMX_HAVE_PLATFORM_IMX_UART
> +	select IMX_HAVE_PLATFORM_ESDHC
Can you keep these flags sorted alphabetically please?

>  	help
>  	  Include support for Genesi Efika MX nettop. This includes specific
>  	  configurations for the board and its peripherals.
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

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

* [patch v3 07/10] efikamx: add support for power key
  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
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-27  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

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

> On Tue, Oct 26, 2010 at 10:07:30PM +0200, Arnaud Patard wrote:
>> This patch adds support for power key button of the efika mx. It's connected
>> on  GPIO 2 31.
>> 
>> 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-26 19:57:16.000000000 +0200
>> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-26 19:59:16.000000000 +0200
>> @@ -19,6 +19,8 @@
>>  #include <linux/i2c.h>
>>  #include <linux/gpio.h>
>>  #include <linux/leds.h>
>> +#include <linux/input.h>
> Do you really need linux/input.h?
>

You need it if you want to have KEY_POWER and EV_POWER definitions

>> +#include <linux/gpio_keys.h>
> this is included by devices-common.h (which is included by
> devices-imx51.h).  So you can drop this.
>
>>  #include <linux/delay.h>
>>  #include <linux/io.h>
>>  #include <linux/fsl_devices.h>
>> @@ -48,10 +50,13 @@
>>  #define EFIKAMX_GREEN_LED	(2*32 + 14)
>>  #define EFIKAMX_RED_LED		(2*32 + 15)
>>  
>> +#define EFIKAMX_POWER_KEY	(1*32 + 31)
>> +
>>  /* 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)
>>  #define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
>> +#define MX51_PAD_PWRKEY	IOMUX_PAD(0x48c, 0x0f8, 1, 0x0,   0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
>>  
>>  static struct pad_desc mx51efikamx_pads[] = {
>>  	/* UART1 */
>> @@ -91,6 +96,9 @@
>>  	MX51_PAD_CSI1_D9__GPIO_3_13,
>>  	MX51_PAD_CSI1_VSYNC__GPIO_3_14,
>>  	MX51_PAD_CSI1_HSYNC__GPIO_3_15,
>> +
>> +	/* power key */
>> +	MX51_PAD_PWRKEY,
>>  };
>>  
>>  /* Serial ports */
>> @@ -220,6 +228,22 @@
>>  	},
>>  };
>>  
>> +static struct gpio_keys_button mx51_efikamx_powerkey[] = {
> this should be const and __initconst

I guess you meant this for the gpio_keys_platform_data struct instead of
this one ?

>
>> +	{
>> +		.code   = KEY_POWER,
>> +		.gpio   = EFIKAMX_POWER_KEY,
>> +		.type   = EV_PWR,
>> +		.desc   = "Power Button (CM)",
>> +		.wakeup = 1,
>> +		.debounce_interval = 10, /* ms */
>> +	},
>> +};
> I'd prefer s/ *=/ =/ here.  The equal signs are not aligned anyhow
> because of the last line.
>

I find this more readable but I've no strong pref. Will change.


Arnaud

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

* [patch v3 10/10] efikamx: add reset
  2010-10-27  7:36   ` Uwe Kleine-König
@ 2010-10-27  9:59     ` Arnaud Patard (Rtp)
  0 siblings, 0 replies; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-27  9:59 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [patch v3 07/10] efikamx: add support for power key
  2010-10-27  9:51     ` Arnaud Patard (Rtp)
@ 2010-10-27 10:04       ` Uwe Kleine-König
  0 siblings, 0 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2010-10-27 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 27, 2010 at 11:51:06AM +0200, Arnaud Patard wrote:
> Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> writes:
> 
> > On Tue, Oct 26, 2010 at 10:07:30PM +0200, Arnaud Patard wrote:
> >> This patch adds support for power key button of the efika mx. It's connected
> >> on  GPIO 2 31.
> >> 
> >> 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-26 19:57:16.000000000 +0200
> >> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-26 19:59:16.000000000 +0200
> >> @@ -19,6 +19,8 @@
> >>  #include <linux/i2c.h>
> >>  #include <linux/gpio.h>
> >>  #include <linux/leds.h>
> >> +#include <linux/input.h>
> > Do you really need linux/input.h?
> >
> 
> You need it if you want to have KEY_POWER and EV_POWER definitions
ah, I see.
 
> >> +#include <linux/gpio_keys.h>
> > this is included by devices-common.h (which is included by
> > devices-imx51.h).  So you can drop this.
> >
> >>  #include <linux/delay.h>
> >>  #include <linux/io.h>
> >>  #include <linux/fsl_devices.h>
> >> @@ -48,10 +50,13 @@
> >>  #define EFIKAMX_GREEN_LED	(2*32 + 14)
> >>  #define EFIKAMX_RED_LED		(2*32 + 15)
> >>  
> >> +#define EFIKAMX_POWER_KEY	(1*32 + 31)
> >> +
> >>  /* 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)
> >>  #define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
> >> +#define MX51_PAD_PWRKEY	IOMUX_PAD(0x48c, 0x0f8, 1, 0x0,   0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
> >>  
> >>  static struct pad_desc mx51efikamx_pads[] = {
> >>  	/* UART1 */
> >> @@ -91,6 +96,9 @@
> >>  	MX51_PAD_CSI1_D9__GPIO_3_13,
> >>  	MX51_PAD_CSI1_VSYNC__GPIO_3_14,
> >>  	MX51_PAD_CSI1_HSYNC__GPIO_3_15,
> >> +
> >> +	/* power key */
> >> +	MX51_PAD_PWRKEY,
> >>  };
> >>  
> >>  /* Serial ports */
> >> @@ -220,6 +228,22 @@
> >>  	},
> >>  };
> >>  
> >> +static struct gpio_keys_button mx51_efikamx_powerkey[] = {
> > this should be const and __initconst
> 
> I guess you meant this for the gpio_keys_platform_data struct instead of
> this one ?
oh, you're right.  Conceptually mx51_efikamx_powerkey should be const,
but probably marking it accordingly generates a compiler warning.

I assume there are no other keys on your machine?  If there are, you
might want to rename mx51_efikamx_powerkey_data and
mx51_efikamx_powerkey to something that doesn't include "power".
 
Best regards
Uwe

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

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

* [patch v3 01/10] efikamx: read board id
  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)
  0 siblings, 2 replies; 22+ messages in thread
From: Nguyen Dinh-R00091 @ 2010-11-01 15:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

>-----Original Message-----
From: linux-arm-kernel-bounces@lists.infradead.org
[mailto:linux-arm-kernel-
>bounces at lists.infradead.org] On Behalf Of Arnaud Patard
>Sent: Tuesday, October 26, 2010 3:07 PM
>To: linux-arm-kernel at lists.infradead.org
>Cc: matt at genesi-usa.com; Sascha Hauer; Arnaud Patard; Amit Kucheria
>Subject: [patch v3 01/10] efikamx: read board id
>
>read board id value from the GPIO3_16/17/11
>
>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-21 08:29:23.000000000 +0200
>+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
2010-10-21 08:29:46.000000000 +0200
>@@ -39,12 +39,26 @@
>
> #define	MX51_USB_PLL_DIV_24_MHZ	0x01
>
>+#define EFIKAMX_PCBID0		(2*32 + 16)
>+#define EFIKAMX_PCBID1		(2*32 + 17)
>+#define EFIKAMX_PCBID2		(2*32 + 11)
>+
>+/* 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)
>+#define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0,
PAD_CTL_PUS_100K_UP)
>+

Seems a bit wasteful to redefine the IOMUX definitions. Couldn't you
just do something like this?

static struct pad_desc mx51efikamx_board_id[] = {
	MX51_PAD_NANDF_CS0__GPIO_3_16,
	MX51_PAD_NANDF_CS1__GPIO_3_17,
	MX51_PAD_NANDF_RB3__GPIO_3_11
}


> static struct pad_desc mx51efikamx_pads[] = {
> 	/* UART1 */
> 	MX51_PAD_UART1_RXD__UART1_RXD,
> 	MX51_PAD_UART1_TXD__UART1_TXD,
> 	MX51_PAD_UART1_RTS__UART1_RTS,
> 	MX51_PAD_UART1_CTS__UART1_CTS,
>+
>+	/* board id */
>+	MX51_PAD_PCBID0,
>+	MX51_PAD_PCBID1,
>+	MX51_PAD_PCBID2,
> };
>
> /* Serial ports */
>@@ -92,10 +106,62 @@
> 	.flags  = MXC_EHCI_INTERNAL_PHY,
> };
>
>+/*   PCBID2  PCBID1 PCBID0  STATE
>+	1       1      1    ER1:rev1.1
>+	1       1      0    ER2:rev1.2
>+	1       0      1    ER3:rev1.3
>+	1       0      0    ER4:rev1.4
>+*/
>+static void __init mx51_efikamx_board_id(void)
>+{
>+	int id;
>+
>+	/* things are taking time to settle */
>+	msleep(150);
>+
>+	gpio_request(EFIKAMX_PCBID0, "pcbid0");
>+	gpio_direction_input(EFIKAMX_PCBID0);
>+	gpio_request(EFIKAMX_PCBID1, "pcbid1");
>+	gpio_direction_input(EFIKAMX_PCBID1);
>+	gpio_request(EFIKAMX_PCBID2, "pcbid2");
>+	gpio_direction_input(EFIKAMX_PCBID2);
>+
>+	id = gpio_get_value(EFIKAMX_PCBID0);
>+	id |= gpio_get_value(EFIKAMX_PCBID1) << 1;
>+	id |= gpio_get_value(EFIKAMX_PCBID2) << 2;
>+
>+	switch (id) {
>+	case 7:
>+		system_rev = 0x11;
>+		break;
>+	case 6:
>+		system_rev = 0x12;
>+		break;
>+	case 5:
>+		system_rev = 0x13;
>+		break;
>+	case 4:
>+		system_rev = 0x14;
>+		break;
>+	default:
>+		system_rev = 0x10;
>+		break;
>+	}
>+
>+	if ((system_rev == 0x10)
>+		|| (system_rev == 0x12)
>+		|| (system_rev == 0x14)) {
>+		printk(KERN_WARNING
>+			"EfikaMX: Unsupported board revision 1.%u!\n",
>+			system_rev & 0xf);
>+	}
>+}
>+
> static void __init mxc_board_init(void)
> {
> 	mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
> 					ARRAY_SIZE(mx51efikamx_pads));

	for(i=0;i < ARRAY_SIZE(mx51efikamx_board_id);i++)
                mx51efikamx_board_id [i].pad_ctrl = PAD_CTL_PUS_100K_UP;
	mxc_iomux_v3_setup_multiple_pads(mx51efikamx_board_id,
	
ARRAY_SIZE(mx51efikamx_board_id));

>+	mx51_efikamx_board_id();
> 	mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
> 	mxc_init_imx_uart();
> }
>
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Thanks,
Dinh

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

* [patch v3 01/10] efikamx: read board id
  2010-11-01 15:24   ` Nguyen Dinh-R00091
@ 2010-11-01 20:05     ` Matt Sealey
  2010-11-02  9:35     ` Arnaud Patard (Rtp)
  1 sibling, 0 replies; 22+ messages in thread
From: Matt Sealey @ 2010-11-01 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

I agree wholeheartedly with this.

-- 
Matt Sealey <matt@genesi-usa.com>
Product Development Analyst, Genesi USA, Inc.



On Mon, Nov 1, 2010 at 10:24 AM, Nguyen Dinh-R00091
<R00091@freescale.com> wrote:
> Hi,
>
>>-----Original Message-----
>>From: linux-arm-kernel-bounces at lists.infradead.org
> [mailto:linux-arm-kernel-
>>bounces at lists.infradead.org] On Behalf Of Arnaud Patard
>>Sent: Tuesday, October 26, 2010 3:07 PM
>>To: linux-arm-kernel at lists.infradead.org
>>Cc: matt at genesi-usa.com; Sascha Hauer; Arnaud Patard; Amit Kucheria
>>Subject: [patch v3 01/10] efikamx: read board id
>>
>>read board id value from the GPIO3_16/17/11
>>
>>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-21 08:29:23.000000000 +0200
>>+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
> 2010-10-21 08:29:46.000000000 +0200
>>@@ -39,12 +39,26 @@
>>
>> #define ? ? ? MX51_USB_PLL_DIV_24_MHZ 0x01
>>
>>+#define EFIKAMX_PCBID0 ? ? ? ? ? ? ? ?(2*32 + 16)
>>+#define EFIKAMX_PCBID1 ? ? ? ? ? ? ? ?(2*32 + 17)
>>+#define EFIKAMX_PCBID2 ? ? ? ? ? ? ? ?(2*32 + 11)
>>+
>>+/* 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)
>>+#define MX51_PAD_PCBID2 ? ? ? IOMUX_PAD(0x504, 0x128, 3, 0x0, ? 0,
> PAD_CTL_PUS_100K_UP)
>>+
>
> Seems a bit wasteful to redefine the IOMUX definitions. Couldn't you
> just do something like this?
>
> static struct pad_desc mx51efikamx_board_id[] = {
> ? ? ? ?MX51_PAD_NANDF_CS0__GPIO_3_16,
> ? ? ? ?MX51_PAD_NANDF_CS1__GPIO_3_17,
> ? ? ? ?MX51_PAD_NANDF_RB3__GPIO_3_11
> }
>
>
>> static struct pad_desc mx51efikamx_pads[] = {
>> ? ? ? /* UART1 */
>> ? ? ? MX51_PAD_UART1_RXD__UART1_RXD,
>> ? ? ? MX51_PAD_UART1_TXD__UART1_TXD,
>> ? ? ? MX51_PAD_UART1_RTS__UART1_RTS,
>> ? ? ? MX51_PAD_UART1_CTS__UART1_CTS,
>>+
>>+ ? ? ?/* board id */
>>+ ? ? ?MX51_PAD_PCBID0,
>>+ ? ? ?MX51_PAD_PCBID1,
>>+ ? ? ?MX51_PAD_PCBID2,
>> };
>>
>> /* Serial ports */
>>@@ -92,10 +106,62 @@
>> ? ? ? .flags ?= MXC_EHCI_INTERNAL_PHY,
>> };
>>
>>+/* ? PCBID2 ?PCBID1 PCBID0 ?STATE
>>+ ? ? ?1 ? ? ? 1 ? ? ?1 ? ?ER1:rev1.1
>>+ ? ? ?1 ? ? ? 1 ? ? ?0 ? ?ER2:rev1.2
>>+ ? ? ?1 ? ? ? 0 ? ? ?1 ? ?ER3:rev1.3
>>+ ? ? ?1 ? ? ? 0 ? ? ?0 ? ?ER4:rev1.4
>>+*/
>>+static void __init mx51_efikamx_board_id(void)
>>+{
>>+ ? ? ?int id;
>>+
>>+ ? ? ?/* things are taking time to settle */
>>+ ? ? ?msleep(150);
>>+
>>+ ? ? ?gpio_request(EFIKAMX_PCBID0, "pcbid0");
>>+ ? ? ?gpio_direction_input(EFIKAMX_PCBID0);
>>+ ? ? ?gpio_request(EFIKAMX_PCBID1, "pcbid1");
>>+ ? ? ?gpio_direction_input(EFIKAMX_PCBID1);
>>+ ? ? ?gpio_request(EFIKAMX_PCBID2, "pcbid2");
>>+ ? ? ?gpio_direction_input(EFIKAMX_PCBID2);
>>+
>>+ ? ? ?id = gpio_get_value(EFIKAMX_PCBID0);
>>+ ? ? ?id |= gpio_get_value(EFIKAMX_PCBID1) << 1;
>>+ ? ? ?id |= gpio_get_value(EFIKAMX_PCBID2) << 2;
>>+
>>+ ? ? ?switch (id) {
>>+ ? ? ?case 7:
>>+ ? ? ? ? ? ? ?system_rev = 0x11;
>>+ ? ? ? ? ? ? ?break;
>>+ ? ? ?case 6:
>>+ ? ? ? ? ? ? ?system_rev = 0x12;
>>+ ? ? ? ? ? ? ?break;
>>+ ? ? ?case 5:
>>+ ? ? ? ? ? ? ?system_rev = 0x13;
>>+ ? ? ? ? ? ? ?break;
>>+ ? ? ?case 4:
>>+ ? ? ? ? ? ? ?system_rev = 0x14;
>>+ ? ? ? ? ? ? ?break;
>>+ ? ? ?default:
>>+ ? ? ? ? ? ? ?system_rev = 0x10;
>>+ ? ? ? ? ? ? ?break;
>>+ ? ? ?}
>>+
>>+ ? ? ?if ((system_rev == 0x10)
>>+ ? ? ? ? ? ? ?|| (system_rev == 0x12)
>>+ ? ? ? ? ? ? ?|| (system_rev == 0x14)) {
>>+ ? ? ? ? ? ? ?printk(KERN_WARNING
>>+ ? ? ? ? ? ? ? ? ? ? ?"EfikaMX: Unsupported board revision 1.%u!\n",
>>+ ? ? ? ? ? ? ? ? ? ? ?system_rev & 0xf);
>>+ ? ? ?}
>>+}
>>+
>> static void __init mxc_board_init(void)
>> {
>> ? ? ? mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(mx51efikamx_pads));
>
> ? ? ? ?for(i=0;i < ARRAY_SIZE(mx51efikamx_board_id);i++)
> ? ? ? ? ? ? ? ?mx51efikamx_board_id [i].pad_ctrl = PAD_CTL_PUS_100K_UP;
> ? ? ? ?mxc_iomux_v3_setup_multiple_pads(mx51efikamx_board_id,
>
> ARRAY_SIZE(mx51efikamx_board_id));
>
>>+ ? ? ?mx51_efikamx_board_id();
>> ? ? ? mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
>> ? ? ? mxc_init_imx_uart();
>> }
>>
>>
>>
>>_______________________________________________
>>linux-arm-kernel mailing list
>>linux-arm-kernel at lists.infradead.org
>>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
> Thanks,
> Dinh
>
>
>

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

* [patch v3 01/10] efikamx: read board id
  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
  1 sibling, 1 reply; 22+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-11-02  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

Nguyen Dinh-R00091 <R00091@freescale.com> writes:

Hi,

> Hi,
>
>>-----Original Message-----
>>From: linux-arm-kernel-bounces at lists.infradead.org
> [mailto:linux-arm-kernel-
>>bounces at lists.infradead.org] On Behalf Of Arnaud Patard
>>Sent: Tuesday, October 26, 2010 3:07 PM
>>To: linux-arm-kernel at lists.infradead.org
>>Cc: matt at genesi-usa.com; Sascha Hauer; Arnaud Patard; Amit Kucheria
>>Subject: [patch v3 01/10] efikamx: read board id
>>
>>read board id value from the GPIO3_16/17/11
>>
>>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-21 08:29:23.000000000 +0200
>>+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
> 2010-10-21 08:29:46.000000000 +0200
>>@@ -39,12 +39,26 @@
>>
>> #define	MX51_USB_PLL_DIV_24_MHZ	0x01
>>
>>+#define EFIKAMX_PCBID0		(2*32 + 16)
>>+#define EFIKAMX_PCBID1		(2*32 + 17)
>>+#define EFIKAMX_PCBID2		(2*32 + 11)
>>+
>>+/* 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)
>>+#define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0,
> PAD_CTL_PUS_100K_UP)
>>+
>
> Seems a bit wasteful to redefine the IOMUX definitions. Couldn't you
> just do something like this?

With a define, you have only 1 place to look at when debugging and
configuring the pad requires only to put it in the list like any other
pad. With your approach, we need to change the pad control and then call
mxc_iomux_v3_setup_multiple_pads() separately. It's making extra-step in
the process.
Also, such a specific treatment for configuring theses GPIOs means for
me more errors/bugs possible.

Arnaud

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

* [patch v3 01/10] efikamx: read board id
  2010-11-02  9:35     ` Arnaud Patard (Rtp)
@ 2010-11-02 10:47       ` Uwe Kleine-König
  2010-11-02 17:29         ` Sascha Hauer
  0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2010-11-02 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Tue, Nov 02, 2010 at 10:35:15AM +0100, Arnaud Patard wrote:
> Nguyen Dinh-R00091 <R00091@freescale.com> writes:
> 
> Hi,
> 
> > Hi,
> >
> >>-----Original Message-----
> >>From: linux-arm-kernel-bounces at lists.infradead.org
> > [mailto:linux-arm-kernel-
> >>bounces at lists.infradead.org] On Behalf Of Arnaud Patard
> >>Sent: Tuesday, October 26, 2010 3:07 PM
> >>To: linux-arm-kernel at lists.infradead.org
> >>Cc: matt at genesi-usa.com; Sascha Hauer; Arnaud Patard; Amit Kucheria
> >>Subject: [patch v3 01/10] efikamx: read board id
> >>
> >>read board id value from the GPIO3_16/17/11
> >>
> >>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-21 08:29:23.000000000 +0200
> >>+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
> > 2010-10-21 08:29:46.000000000 +0200
> >>@@ -39,12 +39,26 @@
> >>
> >> #define	MX51_USB_PLL_DIV_24_MHZ	0x01
> >>
> >>+#define EFIKAMX_PCBID0		(2*32 + 16)
> >>+#define EFIKAMX_PCBID1		(2*32 + 17)
> >>+#define EFIKAMX_PCBID2		(2*32 + 11)
> >>+
> >>+/* 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)
> >>+#define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0,
> > PAD_CTL_PUS_100K_UP)
> >>+
> >
> > Seems a bit wasteful to redefine the IOMUX definitions. Couldn't you
> > just do something like this?
> 
> With a define, you have only 1 place to look at when debugging and
> configuring the pad requires only to put it in the list like any other
> pad. With your approach, we need to change the pad control and then call
> mxc_iomux_v3_setup_multiple_pads() separately. It's making extra-step in
> the process.
> Also, such a specific treatment for configuring theses GPIOs means for
> me more errors/bugs possible.
I suggest to just use one of the two possibilies for now (I don't have a
strong preference here).  Hopefully Lothar's patch that makes the pad
definitions use a bit field[1] is merged soon and then this can become:

	#define MX51_PAD_PCBID0	(MX51_PAD_GPIOXY | PAD_CTL_PUS_100K_UP)

which is pretty and easy.

Best regards
Uwe

[1] http://thread.gmane.org/gmane.linux.kernel/1052626/focus=94463
-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [patch v3 01/10] efikamx: read board id
  2010-11-02 10:47       ` Uwe Kleine-König
@ 2010-11-02 17:29         ` Sascha Hauer
  0 siblings, 0 replies; 22+ messages in thread
From: Sascha Hauer @ 2010-11-02 17:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 02, 2010 at 11:47:51AM +0100, Uwe Kleine-K?nig wrote:
> Hello,
> > Also, such a specific treatment for configuring theses GPIOs means for
> > me more errors/bugs possible.
> I suggest to just use one of the two possibilies for now (I don't have a
> strong preference here).  Hopefully Lothar's patch that makes the pad
> definitions use a bit field[1] is merged soon and then this can become:
> 
> 	#define MX51_PAD_PCBID0	(MX51_PAD_GPIOXY | PAD_CTL_PUS_100K_UP)

I just opened up a imx-for-2.6.38 branch which contains Lothars patch,
so give it a try.

Sascha


-- 
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] 22+ messages in thread

end of thread, other threads:[~2010-11-02 17:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.