Re: [meta-freescale] [meta-fsl-arm-extra][PATCH] 2/3] qmx6-addons-gpio: Add gpio.sh configuration script

2015-02-03 Thread Alejandro . de-cabo-Garcia
Hi Otavio,
 
> It seems for me this could be better if documented in the Congatec's
> documentation or even in the Release Notes (adding Daiane on Cc so she
> can comment if she thinks this applies or not).
> 
> The biggest problem I see with this kind of script is that it will
> always be changed by the user and end not being tracked.
> 
> What do you think?


I see your point and I agree, we cannot track the changes, so I will 
include the script in the Congatec's documentation.
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] [meta-fsl-arm-extra][PATCH] 2/3] qmx6-addons-gpio: Add gpio.sh configuration script

2015-02-02 Thread Otavio Salvador
Hello Alex,

On Wed, Jan 28, 2015 at 10:10 AM, Alex de Cabo
 wrote:
> This patch adds the gpio.sh script to the rootfs, and the
> needed links to make the listed GPIOs accesible via the
> /sys/class/gpio interface.
>
> The GPIOs [0..3] [5..7] are currently mapped as inputs, in
> order to define them as output, uncomment the
> "echo "out" ... direction" statement
> underneath the related pin export statement
>
> Pin mapping (Q7 GPIO vs. GPIO nr)
>
> Q7, GPIO 0 <--> gpio130
> Q7, GPIO 1 <--> gpio86 (disabled)
> Q7, GPIO 2 <--> gpio122
> Q7, GPIO 3 <--> gpio123
> Q7, GPIO 5 <--> gpio111
> Q7, GPIO 6 <--> gpio203
> Q7, GPIO 7 <--> gpio110
>
> This patch needs the 4571a17 commit.
>
> Signed-off-by: Alex de Cabo 

I understand this is for convenience but do you think it is worth
adding such a script inside the layer?

It seems for me this could be better if documented in the Congatec's
documentation or even in the Release Notes (adding Daiane on Cc so she
can comment if she thinks this applies or not).

The biggest problem I see with this kind of script is that it will
always be changed by the user and end not being tracked.

What do you think?

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


[meta-freescale] [meta-fsl-arm-extra][PATCH] 2/3] qmx6-addons-gpio: Add gpio.sh configuration script

2015-01-28 Thread Alex de Cabo
This patch adds the gpio.sh script to the rootfs, and the
needed links to make the listed GPIOs accesible via the
/sys/class/gpio interface.

The GPIOs [0..3] [5..7] are currently mapped as inputs, in
order to define them as output, uncomment the
"echo "out" ... direction" statement
underneath the related pin export statement

Pin mapping (Q7 GPIO vs. GPIO nr)

Q7, GPIO 0 <--> gpio130
Q7, GPIO 1 <--> gpio86 (disabled)
Q7, GPIO 2 <--> gpio122
Q7, GPIO 3 <--> gpio123
Q7, GPIO 5 <--> gpio111
Q7, GPIO 6 <--> gpio203
Q7, GPIO 7 <--> gpio110

This patch needs the 4571a17 commit.

Signed-off-by: Alex de Cabo 
---
 .../qmx6-addons/qmx6-addons-gpio-1.0/gpio.sh   | 88 ++
 recipes-bsp/qmx6-addons/qmx6-addons-gpio_1.0.bb| 38 ++
 2 files changed, 126 insertions(+)
 create mode 100644 recipes-bsp/qmx6-addons/qmx6-addons-gpio-1.0/gpio.sh
 create mode 100644 recipes-bsp/qmx6-addons/qmx6-addons-gpio_1.0.bb

diff --git a/recipes-bsp/qmx6-addons/qmx6-addons-gpio-1.0/gpio.sh 
b/recipes-bsp/qmx6-addons/qmx6-addons-gpio-1.0/gpio.sh
new file mode 100644
index 000..91caab7
--- /dev/null
+++ b/recipes-bsp/qmx6-addons/qmx6-addons-gpio-1.0/gpio.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:  gpios
+# Required-Start:$local_fs mountvirtfs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop:  0 6
+# Short-Description: export of Q7 GPIOs
+### END INIT INFO
+
+# script for exporting the GPIOs defined by the Q7 standard
+#
+# the GPIOs [0..3]  [5..7] are currently mapped as inputs
+# in order to define them as output, uncomment the "echo "out" ... direction" 
statement underneath the related pin export statement 
+#
+# Pin mapping (Q7 GPIO vs. GPIO nr)
+#
+# Q7, GPIO 0   <-->gpio130
+# Q7, GPIO 1   <-->gpio86  (disabled)
+# Q7, GPIO 2   <-->gpio122
+# Q7, GPIO 3   <-->gpio123
+# Q7, GPIO 5   <-->gpio111
+# Q7, GPIO 6   <-->gpio203
+# Q7, GPIO 7   <-->gpio110
+
+do_start() {
+   # Q7, Pin 185, GPIO 0
+   echo 130 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio130/direction
+
+   # Q7, Pin 186, GPIO 1
+   # disabled, because this pin is shared with OTG_PWR functionality
+   # in order to enable the pin as GPIO, the kernel's device tree 
configuration has to be changed
+   #echo 86 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio86/direction
+
+   # Q7, Pin 187, GPIO 2
+   echo 122 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio122/direction
+
+   # Q7, Pin 188, GPIO 3
+   echo 123 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio123/direction
+
+   # Q7, Pin 190, GPIO 5
+   # Attention: could lead to a conflict when specified as output and used 
along with a backplane which has a LPC device assembled
+   echo 111 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio111/direction
+
+   # Q7, Pin 191 GPIO 6
+   # Attention: could lead to a conflict when specified as output and used 
along with a backplane which has a LPC device assembled
+   echo 203 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio203/direction
+
+   # Q7, Pin 192, GPIO 7
+   # Attention: could lead to a conflict when specified as output and used 
along with a backplane which has a LPC device assembled
+   echo 110 > /sys/class/gpio/export
+   #echo "out" > /sys/class/gpio/gpio110/direction
+
+}
+
+do_stop() {
+   echo 110 > /sys/class/gpio/unexport
+   echo 203 > /sys/class/gpio/unexport
+   echo 111 > /sys/class/gpio/unexport
+   echo 123 > /sys/class/gpio/unexport
+   echo 122 > /sys/class/gpio/unexport
+   #echo 86 > /sys/class/gpio/unexport
+   echo 130 > /sys/class/gpio/unexport
+}
+
+case "$1" in
+   start)
+   do_start
+   ;;
+   restart|reload|force-reload)
+   echo "Error: argument '$1' not supported" >&2
+   exit 3
+   ;;
+   stop)
+   do_stop
+   ;;
+   *)
+   echo "Usage: $0 start|stop" >&2
+   exit 3
+   ;;
+esac
+
diff --git a/recipes-bsp/qmx6-addons/qmx6-addons-gpio_1.0.bb 
b/recipes-bsp/qmx6-addons/qmx6-addons-gpio_1.0.bb
new file mode 100644
index 000..000927e
--- /dev/null
+++ b/recipes-bsp/qmx6-addons/qmx6-addons-gpio_1.0.bb
@@ -0,0 +1,38 @@
+# Congatec QMX6 u-boot
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://gpio.sh;md5=06d9e2200bcd42ddefedbd26b72ce11c"
+
+SRC_URI_cgtqmx6 = " file://gpio.sh "
+S = "${WORKDIR}"
+
+
+do_configure() {
+:
+}
+
+do_compile() {
+:
+}
+
+do_install(){
+   install -d ${D}${sysconfdir}/init.d
+   install -m 0755 ${WORKDIR}/gpio.sh ${D}${sysconfdir}/init.d
+
+install -d ${D}${sysconfdir}/rc2.d
+install -d ${D}${sysconfdir}/rc3.d
+install -d ${D}${sysconfdir}/rc5.d
+
+