Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v4)

2012-08-26 Thread Stefano Babic
On 25/08/2012 17:30, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes 
> ---
>  board/logicpd/imx27lite/imx27lite.c |5 ++---
>  include/configs/imx27lite-common.h  |5 +
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v4)

2012-08-26 Thread Stefano Babic
On 25/08/2012 17:30, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes 
> ---
>  board/logicpd/imx27lite/imx27lite.c |5 ++---
>  include/configs/imx27lite-common.h  |5 +
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/board/logicpd/imx27lite/imx27lite.c 
> b/board/logicpd/imx27lite/imx27lite.c
> index 8a5015c..b38e5ab 100644
> --- a/board/logicpd/imx27lite/imx27lite.c
> +++ b/board/logicpd/imx27lite/imx27lite.c
> @@ -23,12 +23,12 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  int board_init(void)
>  {
> - struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>   struct system_control_regs *sc_regs =
>   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
> @@ -43,8 +43,7 @@ int board_init(void)
>  #ifdef CONFIG_FEC_MXC
>   mx27_fec_init_pins();
>   imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
> - writel(readl(®s->port[PORTC].dr) | (1 << 31),
> - ®s->port[PORTC].dr);
> + gpio_set_value(GPIO_PORTC | 31, 1);
>  #endif
>  #ifdef CONFIG_MXC_MMC
>  #if defined(CONFIG_MAGNESIUM)
> diff --git a/include/configs/imx27lite-common.h 
> b/include/configs/imx27lite-common.h
> index 7d2876b..2e79a9e 100644
> --- a/include/configs/imx27lite-common.h
> +++ b/include/configs/imx27lite-common.h
> @@ -162,6 +162,11 @@
>  #define CONFIG_DOS_PARTITION
>  
>  /*
> + * GPIO
> + */
> +#define CONFIG_MXC_GPIO
> +
> +/*
>   * MTD partitions
>   */
>  #define CONFIG_CMD_MTDPARTS
> 

Acked-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v4)

2012-08-25 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |5 ++---
 include/configs/imx27lite-common.h  |5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..b38e5ab 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,12 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +43,7 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   gpio_set_value(GPIO_PORTC | 31, 1);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
diff --git a/include/configs/imx27lite-common.h 
b/include/configs/imx27lite-common.h
index 7d2876b..2e79a9e 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -162,6 +162,11 @@
 #define CONFIG_DOS_PARTITION
 
 /*
+ * GPIO
+ */
+#define CONFIG_MXC_GPIO
+
+/*
  * MTD partitions
  */
 #define CONFIG_CMD_MTDPARTS
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v3)

2012-08-24 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |5 ++---
 include/configs/imx27lite-common.h  |5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..b38e5ab 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,12 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +43,7 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   gpio_set_value(GPIO_PORTC | 31, 1);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
diff --git a/include/configs/imx27lite-common.h 
b/include/configs/imx27lite-common.h
index 7d2876b..2e79a9e 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -162,6 +162,11 @@
 #define CONFIG_DOS_PARTITION
 
 /*
+ * GPIO
+ */
+#define CONFIG_MXC_GPIO
+
+/*
  * MTD partitions
  */
 #define CONFIG_CMD_MTDPARTS
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Stefano Babic
On 06/08/2012 17:27, Philippe Reynes wrote:

> Oh, I understand. As I don't have this board, I've done the smallest
> change to fix the compilation.
> I add the driver mxc_gpio on imx27lite, remove this direct acces to gpio
> register,
>  and send the new version of the patch.

I think I can test it, at least the base functionality.

Best regards,
Stefano


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Philippe Reynes


>On 05/08/2012 12:00, Philippe Reynes wrote:
>> Signed-off-by: Philippe Reynes 
>> ---
>>  board/logicpd/imx27lite/imx27lite.c |    7 ---
>>  1 files changed, 4 insertions(+), 3 deletions(-)
>> 

>Hi Philippe,

Hi Stefano,


>>  {
>> -    struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
>> +    struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
>>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>>      struct system_control_regs *sc_regs =
>>          (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
>> @@ -43,8 +44,8 @@ int board_init(void)
>>  #ifdef CONFIG_FEC_MXC
>>      mx27_fec_init_pins();
>>      imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
>> -    writel(readl(®s->port[PORTC].dr) | (1 << 31),
>> -                ®s->port[PORTC].dr);
>> +    writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
>> +                ®s->port[PORTC].gpio_dr);

>This is not what I am expecting from the patch when it will move to
>generic GPIO API.

>The GPIO API uses really generic as in kernel functions, independently
>from the SOC where it is running. This hides the physical registers of
>the GPIOs.

>Instead of that, gpio_set_value(), gpio_get_value(),
>gpio_direction_input() and gpio_direction_output() should be used. You
>can take a look at other iMX (MX3, MX28, MX5, MX6), that are already
>using the generic API.

Oh, I understand. As I don't have this board, I've done the smallest change to 
fix the compilation.
I add the driver mxc_gpio on imx27lite, remove this direct acces to gpio 
register,
 and send the new version of the patch.

regards,
Philippe___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v3)

2012-08-06 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |5 ++---
 include/configs/imx27lite-common.h  |5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..b38e5ab 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,12 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +43,7 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   gpio_set_value(GPIO_PORTC | 31, 1);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
diff --git a/include/configs/imx27lite-common.h 
b/include/configs/imx27lite-common.h
index 7d2876b..2e79a9e 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -162,6 +162,11 @@
 #define CONFIG_DOS_PARTITION
 
 /*
+ * GPIO
+ */
+#define CONFIG_MXC_GPIO
+
+/*
  * MTD partitions
  */
 #define CONFIG_CMD_MTDPARTS
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Stefano Babic
On 05/08/2012 12:00, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes 
> ---
>  board/logicpd/imx27lite/imx27lite.c |7 ---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 

Hi Philippe,


>  {
> - struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
> + struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>   struct system_control_regs *sc_regs =
>   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
> @@ -43,8 +44,8 @@ int board_init(void)
>  #ifdef CONFIG_FEC_MXC
>   mx27_fec_init_pins();
>   imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
> - writel(readl(®s->port[PORTC].dr) | (1 << 31),
> - ®s->port[PORTC].dr);
> + writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
> + ®s->port[PORTC].gpio_dr);

This is not what I am expecting from the patch when it will move to
generic GPIO API.

The GPIO API uses really generic as in kernel functions, independently
from the SOC where it is running. This hides the physical registers of
the GPIOs.

Instead of that, gpio_set_value(), gpio_get_value(),
gpio_direction_input() and gpio_direction_output() should be used. You
can take a look at other iMX (MX3, MX28, MX5, MX6), that are already
using the generic API.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v2)

2012-08-05 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..5bd3b68 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,13 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
+   struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +44,8 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
+   ®s->port[PORTC].gpio_dr);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-05 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..5bd3b68 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,13 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
+   struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +44,8 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
+   ®s->port[PORTC].gpio_dr);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot