SETTING A13 GPIO INIT/BOOT VALUE

Started by mobirider, February 18, 2015, 09:01:26 AM

Previous topic - Next topic

mobirider

Hi

We have trouble setting GPIO boot state on our A13 board from Olimex.
We use the following lines in a FEX to generate script.bin before moving it to the SD card (kernel derived from the Olimex's .config) :

[gpio_para]
...snip...
gpio_pin_13 = port:PG10<1><default><default><0>
[gpio_init]
pin_13 = port:PG10<1><default><default><0>

It seems that the final <0> does not have any effect. I understand the [gpio_init] section might be ignored by the kernel.
What I observe is that after uboot has finished the GPIO will go to HIGH, when I want it to stay low. I can use sysfs when the boot is finished, but that's too late for my application.

Do you have any idea on how to improve this behaviour ?

ZuMMy

I'm also facing this problem. Are there any update? or Someone could help?

Thank you

JohnS

Try a more recent kernel with DT (device tree)?

Set what you want inside uboot?

John

ZuMMy

Quote from: JohnS on May 27, 2015, 04:06:06 PM
Try a more recent kernel with DT (device tree)?

Set what you want inside uboot?

John

Hi, John

   I switched to use Mainline Kernel 4.1 (sunxi-next) using this:
git clone git://github.com/mripard/linux.git -b sunxi-next
as describe in http://linux-sunxi.org/Mainline_Kernel_Howto

I managed to deal with GPIO as expected but the 4.3" LCD Touchscreen seems doesn't work while 7" LCD does work.

I've created the new post here https://www.olimex.com/forum/index.php?topic=4463.0

Do you have any idea?
Please, help me.

Thank you

JohnS


ZuMMy

Quote from: JohnS on May 27, 2015, 08:29:45 PM
Ignore fex then.

John

What I understand is: In mainline kernel, it doesn't use the FEX file for initial and doing pinmux. These are done by using Device Tree. Am I right?

The problem I'm facing right now is: when the board is boot up with the mainline kernel 4.1 (sunxi-next) and the mainline u-boot (2015.04) with 4.3 inch LCD Touchscreen. The kernel HANG as shown below.

U-Boot SPL 2015.04 (May 27 2015 - 18:46:25)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2


U-Boot 2015.04 (May 27 2015 - 18:46:25) Allwinner Technology

CPU:   Allwinner A13 (SUN5I)
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
video-mode 480x272-18@60 not available, falling back to 1024x768-24@60
Setting up a 480x272 lcd console
In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
292 bytes read in 16 ms (17.6 KiB/s)
## Executing script at 43100000
reading zImage
3604104 bytes read in 278 ms (12.4 MiB/s)
reading sun5i-a13-olinuxino.dtb
16148 bytes read in 29 ms (543 KiB/s)
Kernel image @ 0x46000000 [ 0x000000 - 0x36fe88 ]
## Flattened Device Tree blob at 49000000
   Booting using the fdt blob at 0x49000000
   Loading Device Tree to 4eff9000, end 4effff13 ... OK
Using machid 0x102a from environment

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.1.0-rc2-68976-g33da8d2-dirty (dev@ptc-kb) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP Wed May 27 17:20:33 ICT 2015
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Olimex A13-Olinuxino
[    0.000000] earlycon: no match for ttyS0,115200
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback


[color=red]THE BOARD STUCK HERE..!!! Nothing I can do except reboot the board[/color]


Do you have any suggestion, John?

Thank you.

JohnS

Different kernel / different config / add printk / etc

John

Gediz

Sorry for necro-bumping but using following

echo high > "/sys/class/gpio/gpio1_pb17/direction"
instead of using

echo out > "/sys/class/gpio/gpio1_pb17/direction"
did the trick for me. You can replace "high" with low, if you want.

Search for "direction" in this file.