mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace
@ 2013-06-10  7:13 Alexander Shiyan
  2013-06-10  7:13 ` [PATCH 2/3] ARM: ccmx51js: Add WP-pin definition for SDHC3 Alexander Shiyan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-06-10  7:13 UTC (permalink / raw)
  To: barebox

Patch will help to develop user devices connected to module, so
user can operate GPIOs in barebox console.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/ccxmx51/ccxmx51.c   | 24 ++++++++++++++++++++++++
 arch/arm/boards/ccxmx51/ccxmx51js.c |  1 -
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
index 7f92043..d34759a 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -176,6 +176,30 @@ static iomux_v3_cfg_t ccxmx51_pads[] = {
 	MX51_PAD_GPIO1_7__GPIO1_7,
 	/* MMA7455LR IRQ2 (GPIO1.6) */
 	MX51_PAD_GPIO1_6__GPIO1_6,
+	/* User GPIOs */
+	MX51_PAD_GPIO1_0__GPIO1_0,
+	MX51_PAD_GPIO1_1__GPIO1_1,
+	MX51_PAD_GPIO1_8__GPIO1_8,
+	MX51_PAD_DI1_PIN11__GPIO3_0,
+	MX51_PAD_DI1_PIN12__GPIO3_1,
+	MX51_PAD_DI1_PIN13__GPIO3_2,
+	MX51_PAD_DI1_D0_CS__GPIO3_3,
+	MX51_PAD_DI1_D1_CS__GPIO3_4,
+	MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
+	MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
+	MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
+	MX51_PAD_DISPB2_SER_RS__GPIO3_8,
+	MX51_PAD_NANDF_RB1__GPIO3_9,
+	MX51_PAD_NANDF_RB2__GPIO3_10,
+	MX51_PAD_NANDF_RB3__GPIO3_11,
+	MX51_PAD_CSI1_D8__GPIO3_12,
+	MX51_PAD_CSI1_D9__GPIO3_13,
+	MX51_PAD_NANDF_CS1__GPIO3_17,
+	MX51_PAD_NANDF_CS2__GPIO3_18,
+	MX51_PAD_NANDF_CS3__GPIO3_19,
+	MX51_PAD_NANDF_CS4__GPIO3_20,
+	MX51_PAD_NANDF_CS5__GPIO3_21,
+	MX51_PAD_NANDF_CS6__GPIO3_22,
 };
 
 #define CCXMX51_ECSPI1_CS0	IMX_GPIO_NR(4, 24)
diff --git a/arch/arm/boards/ccxmx51/ccxmx51js.c b/arch/arm/boards/ccxmx51/ccxmx51js.c
index ae31caf..7d269c3 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51js.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51js.c
@@ -63,7 +63,6 @@ static iomux_v3_cfg_t ccxmx51js_pads[] = {
 	MX51_PAD_USBH1_DATA5__USBH1_DATA5,
 	MX51_PAD_USBH1_DATA6__USBH1_DATA6,
 	MX51_PAD_USBH1_DATA7__USBH1_DATA7,
-	MX51_PAD_DISPB2_SER_RS__GPIO3_8,	/* Reset */
 };
 
 static struct esdhc_platform_data sdhc1_pdata = {
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/3] ARM: ccmx51js: Add WP-pin definition for SDHC3
  2013-06-10  7:13 [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Alexander Shiyan
@ 2013-06-10  7:13 ` Alexander Shiyan
  2013-06-10  7:13 ` [PATCH 3/3] ARM: ccmx51: Return error if module is not detected Alexander Shiyan
  2013-06-11 15:33 ` [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-06-10  7:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/ccxmx51/ccxmx51js.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51js.c b/arch/arm/boards/ccxmx51/ccxmx51js.c
index 7d269c3..1cf7d53 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51js.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51js.c
@@ -29,7 +29,8 @@
 
 #include "ccxmx51.h"
 
-#define CCXMX51JS_USBHOST1_RESET	IMX_GPIO_NR(3, 8)
+#define CCXMX51JS_USBH1_RESET	IMX_GPIO_NR(3, 8)
+#define CCXMX51JS_SD3_WP	IMX_GPIO_NR(3, 17)
 
 static iomux_v3_cfg_t ccxmx51js_pads[] = {
 	/* SD1 */
@@ -73,7 +74,8 @@ static struct esdhc_platform_data sdhc1_pdata = {
 
 static struct esdhc_platform_data sdhc3_pdata = {
 	.cd_type	= ESDHC_CD_NONE,
-	.wp_type	= ESDHC_WP_NONE,
+	.wp_type	= ESDHC_WP_GPIO,
+	.wp_gpio	= CCXMX51JS_SD3_WP,
 	.caps		= MMC_MODE_4BIT | MMC_MODE_8BIT,
 };
 
@@ -91,9 +93,9 @@ static int ccxmx51js_init(void)
 		imx51_add_mmc2(&sdhc3_pdata);
 	}
 
-	gpio_direction_output(CCXMX51JS_USBHOST1_RESET, 0);
+	gpio_direction_output(CCXMX51JS_USBH1_RESET, 0);
 	mdelay(10);
-	gpio_set_value(CCXMX51JS_USBHOST1_RESET, 1);
+	gpio_set_value(CCXMX51JS_USBH1_RESET, 1);
 	mdelay(10);
 	imx51_add_usbh1(&ccxmx51js_usbhost1_pdata);
 
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/3] ARM: ccmx51: Return error if module is not detected
  2013-06-10  7:13 [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Alexander Shiyan
  2013-06-10  7:13 ` [PATCH 2/3] ARM: ccmx51js: Add WP-pin definition for SDHC3 Alexander Shiyan
@ 2013-06-10  7:13 ` Alexander Shiyan
  2013-06-11 15:33 ` [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-06-10  7:13 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/ccxmx51/ccxmx51.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
index d34759a..e60a101 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -415,7 +415,8 @@ static int ccxmx51_devices_init(void)
 		printf("Module Serial : %c%d\n", manloc, ((hwid[2] & 0x3f) << 24) | (hwid[3] << 16) | (hwid[4] << 8) | hwid[5]);
 		if ((ccxmx51_id->mem_sz - SZ_128M) > 0)
 			arm_add_mem_device("ram1", MX51_CSD0_BASE_ADDR + SZ_128M, ccxmx51_id->mem_sz - SZ_128M);
-	}
+	} else
+		return -ENOSYS;
 
 	imx51_add_uart1();
 	imx51_add_uart2();
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace
  2013-06-10  7:13 [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Alexander Shiyan
  2013-06-10  7:13 ` [PATCH 2/3] ARM: ccmx51js: Add WP-pin definition for SDHC3 Alexander Shiyan
  2013-06-10  7:13 ` [PATCH 3/3] ARM: ccmx51: Return error if module is not detected Alexander Shiyan
@ 2013-06-11 15:33 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-06-11 15:33 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Mon, Jun 10, 2013 at 11:13:18AM +0400, Alexander Shiyan wrote:
> Patch will help to develop user devices connected to module, so
> user can operate GPIOs in barebox console.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied, thanks

Sascha

> ---
>  arch/arm/boards/ccxmx51/ccxmx51.c   | 24 ++++++++++++++++++++++++
>  arch/arm/boards/ccxmx51/ccxmx51js.c |  1 -
>  2 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
> index 7f92043..d34759a 100644
> --- a/arch/arm/boards/ccxmx51/ccxmx51.c
> +++ b/arch/arm/boards/ccxmx51/ccxmx51.c
> @@ -176,6 +176,30 @@ static iomux_v3_cfg_t ccxmx51_pads[] = {
>  	MX51_PAD_GPIO1_7__GPIO1_7,
>  	/* MMA7455LR IRQ2 (GPIO1.6) */
>  	MX51_PAD_GPIO1_6__GPIO1_6,
> +	/* User GPIOs */
> +	MX51_PAD_GPIO1_0__GPIO1_0,
> +	MX51_PAD_GPIO1_1__GPIO1_1,
> +	MX51_PAD_GPIO1_8__GPIO1_8,
> +	MX51_PAD_DI1_PIN11__GPIO3_0,
> +	MX51_PAD_DI1_PIN12__GPIO3_1,
> +	MX51_PAD_DI1_PIN13__GPIO3_2,
> +	MX51_PAD_DI1_D0_CS__GPIO3_3,
> +	MX51_PAD_DI1_D1_CS__GPIO3_4,
> +	MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
> +	MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
> +	MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
> +	MX51_PAD_DISPB2_SER_RS__GPIO3_8,
> +	MX51_PAD_NANDF_RB1__GPIO3_9,
> +	MX51_PAD_NANDF_RB2__GPIO3_10,
> +	MX51_PAD_NANDF_RB3__GPIO3_11,
> +	MX51_PAD_CSI1_D8__GPIO3_12,
> +	MX51_PAD_CSI1_D9__GPIO3_13,
> +	MX51_PAD_NANDF_CS1__GPIO3_17,
> +	MX51_PAD_NANDF_CS2__GPIO3_18,
> +	MX51_PAD_NANDF_CS3__GPIO3_19,
> +	MX51_PAD_NANDF_CS4__GPIO3_20,
> +	MX51_PAD_NANDF_CS5__GPIO3_21,
> +	MX51_PAD_NANDF_CS6__GPIO3_22,
>  };
>  
>  #define CCXMX51_ECSPI1_CS0	IMX_GPIO_NR(4, 24)
> diff --git a/arch/arm/boards/ccxmx51/ccxmx51js.c b/arch/arm/boards/ccxmx51/ccxmx51js.c
> index ae31caf..7d269c3 100644
> --- a/arch/arm/boards/ccxmx51/ccxmx51js.c
> +++ b/arch/arm/boards/ccxmx51/ccxmx51js.c
> @@ -63,7 +63,6 @@ static iomux_v3_cfg_t ccxmx51js_pads[] = {
>  	MX51_PAD_USBH1_DATA5__USBH1_DATA5,
>  	MX51_PAD_USBH1_DATA6__USBH1_DATA6,
>  	MX51_PAD_USBH1_DATA7__USBH1_DATA7,
> -	MX51_PAD_DISPB2_SER_RS__GPIO3_8,	/* Reset */
>  };
>  
>  static struct esdhc_platform_data sdhc1_pdata = {
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2013-06-11 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10  7:13 [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Alexander Shiyan
2013-06-10  7:13 ` [PATCH 2/3] ARM: ccmx51js: Add WP-pin definition for SDHC3 Alexander Shiyan
2013-06-10  7:13 ` [PATCH 3/3] ARM: ccmx51: Return error if module is not detected Alexander Shiyan
2013-06-11 15:33 ` [PATCH 1/3] ARM: ccmx51: Export available module GPIOs to barebox userspace Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox