Re: Cannot set GPIOs in barebox

2018-07-30 Thread Andrey Smirnov
On Mon, Jul 30, 2018 at 12:28 PM Aleksander Morgado
 wrote:
>
> Hey,
>
> >
> > This topic could be ignored. GPIO set/get value functions from
> > barebox are working fine BUT gpioinfo function has some bug it reports
> > unchanged status for gpios value.
> >
>
> Not that I got into much detail, but when I saw that same issue (I
> have some WIP patches to manage GPIOs via RATP) I just assumed that we
> can reliably gpio_get_value() on input GPIOs, and gpio_set_value() on
> output GPIOs. Trying to "read" the output GPIO value with
> gpio_get_value() may not be reliable or even supported at all. Is that
> assumption correct?

AFAIK/IMHO this would really depend on the hardware platform. On
i.MX(also depending on IOMUX IP used as well) appropriate IOMUX
configuration is necessary in order to be able to "sense" the actual
logical level of a GPIO configured as . If I recall things correctly,
i.MX51/6/8, would require a SION bit set and i.MX7/VF610 would require
input buffer to be enabled, otherwise output GPIOs would always report
the same value via gpio_get_value().

Thanks,
Andrey Smirnov

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


Re: Cannot set GPIOs in barebox

2018-07-30 Thread Aleksander Morgado
Hey,

>
> This topic could be ignored. GPIO set/get value functions from
> barebox are working fine BUT gpioinfo function has some bug it reports
> unchanged status for gpios value.
>

Not that I got into much detail, but when I saw that same issue (I
have some WIP patches to manage GPIOs via RATP) I just assumed that we
can reliably gpio_get_value() on input GPIOs, and gpio_set_value() on
output GPIOs. Trying to "read" the output GPIO value with
gpio_get_value() may not be reliable or even supported at all. Is that
assumption correct?

-- 
Aleksander
https://aleksander.es

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


Re: [PATCH] ARM: i.MX: HAB: fix missing include

2018-07-30 Thread Roland Hieber
Resent this patch with a better message in the other patch queue (see
[0]), so this one can be dropped.

[0]: https://www.mail-archive.com/barebox@lists.infradead.org/msg27250.html

 - Roland

On Fri, Jul 27, 2018 at 03:45:55PM +0200, Roland Hieber wrote:
> The code below uses EPERM, which is defined in errno.h.
> 
> Signed-off-by: Roland Hieber 
> ---
>  include/hab.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/hab.h b/include/hab.h
> index fb7149ef53..78c2b865ba 100644
> --- a/include/hab.h
> +++ b/include/hab.h
> @@ -18,6 +18,8 @@
>  #ifndef __HABV4_H
>  #define __HABV4_H
>  
> +#include 
> +
>  #ifdef CONFIG_HABV4
>  int imx28_hab_get_status(void);
>  int imx6_hab_get_status(void);
> -- 
> 2.18.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber | r.hie...@pengutronix.de |
Pengutronix e.K.  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917- |

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


[PATCH 2/4] ARM: i.MX: OCOTP: fix missing include for uint32_t etc.

2018-07-30 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 arch/arm/mach-imx/include/mach/ocotp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/include/mach/ocotp.h 
b/arch/arm/mach-imx/include/mach/ocotp.h
index 76a6da53de..e758238cb9 100644
--- a/arch/arm/mach-imx/include/mach/ocotp.h
+++ b/arch/arm/mach-imx/include/mach/ocotp.h
@@ -2,6 +2,7 @@
 #define __MACH_IMX_OCOTP_H
 
 #include 
+#include 
 
 #define OCOTP_SHADOW_OFFSET0x400
 #define OCOTP_SHADOW_SPACING   0x10
-- 
2.18.0


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


[PATCH 4/4] linux/types.h: fix missing include for BITS_TO_LONGS()

2018-07-30 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 include/linux/types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/types.h b/include/linux/types.h
index f64ec4a814..44d8238d53 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -2,6 +2,7 @@
 #define _LINUX_TYPES_H
 
 #include 
+#include 
 #include 
 
 #define DECLARE_BITMAP(name,bits) \
-- 
2.18.0


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


[PATCH 3/4] gpio: fix missing includes for bool and struct list_head

2018-07-30 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 include/gpio.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/gpio.h b/include/gpio.h
index f5262aac42..e42fa23383 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -1,6 +1,9 @@
 #ifndef __GPIO_H
 #define __GPIO_H
 
+#include 
+#include 
+
 #ifdef CONFIG_GENERIC_GPIO
 void gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
-- 
2.18.0


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


[PATCH 1/4] ARM: i.MX: HAB: fix missing include for EPERM

2018-07-30 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 include/hab.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/hab.h b/include/hab.h
index fb7149ef53..78c2b865ba 100644
--- a/include/hab.h
+++ b/include/hab.h
@@ -18,6 +18,8 @@
 #ifndef __HABV4_H
 #define __HABV4_H
 
+#include 
+
 #ifdef CONFIG_HABV4
 int imx28_hab_get_status(void);
 int imx6_hab_get_status(void);
-- 
2.18.0


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