Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: ZuMMy on May 27, 2015, 03:20:20 pm

Title: LCD-OLinuXino-4.3TS with mainline u-boot and mainline kernel
Post by: ZuMMy on May 27, 2015, 03:20:20 pm
Hello, Everyone

    I try the manual build my A13-OLinuXino-WIFI evaluation board with LCD+Touchscreen using mainline u-boot and linux-sunxi http://linux-sunxi.org/Linux_Kernel#Compilation (http://linux-sunxi.org/Linux_Kernel#Compilation) but I stuck at the GPIO initial state when board is booting. It seems like the script.bin doesn't initial the GPIO as I configure in .fex file. I configure the pins as an output but it is the input at the beginning.

    I used to build the embedded linux system for BeagleBone Black and I think maybe the Device Tree things could help me. So, I switch to the mainline kernel (sunxi-next) as descript in http://linux-sunxi.org/Mainline_Kernel_Howto (http://linux-sunxi.org/Mainline_Kernel_Howto). The result is that I stuck with making 4.3" LCD touchscreen work with the mainline kernel. Below is the details.


u-boot menuconfig
CONFIG_FDTFILE=sun5i-a13-olinuxino.dtb

CONFIG_VIDEO=y
CONFIG_VIDEO_HDMI=n
CONFIG_VIDEO_VGA_VIA_LCD=y
CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y

/* for LCD-OLinuXino-7TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0

/* for LCD-OLinuXino-4.3TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0

CONFIG_VIDEO_LCD_DCLK_PHASE=1


This is the boot log When I 1st boot it:
Quote
U-Boot SPL 2015.04 (May 27 2015 - 18:12:18)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2


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

CPU:   Allwinner A13 (SUN5I)
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
Setting up a 1024x768 vga console
In:    serial
Out:   vga
Err:   vga
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 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 19 ms (14.6 KiB/s)
## Executing script at 43100000
reading zImage
3604104 bytes read in 274 ms (12.5 MiB/s)
reading sun5i-a13-olinuxino.dtb
16148 bytes read in 31 ms (507.8 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
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] PERCPU: Embedded 11 pages/cpu @df8dd000 s15360 r8192 d21504 u45056
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129286
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 509216K/521216K available (4966K kernel code, 205K rwdata, 1636K rodata, 276K init, 247K bss, 12000K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0000000 - 0xff000000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfd00000   ( 509 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc067ab60   (6603 kB)
[    0.000000]       .init : 0xc067b000 - 0xc06c0000   ( 276 kB)
[    0.000000]       .data : 0xc06c0000 - 0xc06f34c0   ( 206 kB)
[    0.000000]        .bss : 0xc06f6000 - 0xc0733e8c   ( 248 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000023] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.007946] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.017208] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.026453] Console: colour dummy device 80x30
[    0.031065] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
[    0.069973] pid_max: default: 32768 minimum: 301
...
...


    the board was display using VGA port. So, I set some environment variable like shown below.
sunxi> setenv video-mode sunxi:800x480-18@60,monitor=lcd
sunxi> setenv lcd-mode x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0
sunxi> setenv machid 102a
sunxi> setenv stderr serial,lcd
sunxi> setenv stdout serial,lcd
sunxi> saveenv
sunxi> reset


    Then, I have the boot logo (small rectangle with Tux image) shown on the 7" LCD but the vga screen still show the display, too (but some part clipped but I don't want to use it anyway). Once the booting is completed, The 7" LCD screen show the login prompt. The boot log is:
Quote
U-Boot SPL 2015.04 (May 27 2015 - 18:12:18)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2


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

CPU:   Allwinner A13 (SUN5I)
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
video-mode 800x480-18@60 not available, falling back to 1024x768-24@60
Setting up a 800x480 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 277 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
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] PERCPU: Embedded 11 pages/cpu @df9dc000 s15360 r8192 d21504 u45056
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129677
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 510784K/522788K available (4966K kernel code, 205K rwdata, 1636K rodata, 276K init, 247K bss, 12004K reserved, 0K cma-reserved, 548K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0000000 - 0xff000000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfe89000   ( 510 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc067ab60   (6603 kB)
[    0.000000]       .init : 0xc067b000 - 0xc06c0000   ( 276 kB)
[    0.000000]       .data : 0xc06c0000 - 0xc06f34c0   ( 206 kB)
[    0.000000]        .bss : 0xc06f6000 - 0xc0733e8c   ( 248 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000020] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.007943] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.017203] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.026438] Console: colour dummy device 80x30
[    0.031049] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
[    0.069970] pid_max: default: 32768 minimum: 301


  Why it's saying "video-mode 800x480-18@60 not available, falling back to 1024x768-24@60"? and how could I disable displaying on VGA screen?


  My goal is to use OLinuXino with 4.3" LCD touchscreen. So, I try to change to LCD-OLinuXino-4.3TS.
for the u-boot menuconfig what I change is :

CONFIG_VIDEO_LCD_MODE=x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0


for the environment variable is change this:

sunxi> setenv video-mode sunxi:480x272-18@60,monitor=lcd
sunxi> setenv lcd-mode x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0
sunxi> setenv machid 102a
sunxi> setenv stderr serial,lcd
sunxi> setenv stdout serial,lcd
sunxi> saveenv
sunxi> reset


  The result is :
Quote
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


THE BOARD STUCK HERE..!!! Nothing I can do except reboot the board




  It still saying, "video-mode 480x272-18@60 not available, falling back to 1024x768-24@60. Setting up a 480x272 lcd console" but this time the board hang as in the boot log shown above. I have no idea why?

Could you please, point me some way out what I've done wrong?

Thank you in advance and sorry for my English,
ZuMMy
Title: Re: LCD-OLinuXino-4.3TS with mainline u-boot and mainline kernel
Post by: pawnies20 on June 14, 2015, 11:37:31 pm
Hi, i don't understand.
Can you rapidly explain me how to make this:
Thanx

u-boot menuconfig
Code: [Select]
CONFIG_FDTFILE=sun5i-a13-olinuxino.dtb

CONFIG_VIDEO=y
CONFIG_VIDEO_HDMI=n
CONFIG_VIDEO_VGA_VIA_LCD=y
CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y

/* for LCD-OLinuXino-7TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0

/* for LCD-OLinuXino-4.3TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0

CONFIG_VIDEO_LCD_DCLK_PHASE=1
Title: Re: LCD-OLinuXino-4.3TS with mainline u-boot and mainline kernel
Post by: ZuMMy on June 15, 2015, 04:52:51 am
Quote from: pawnies20 on June 14, 2015, 11:37:31 pm
Hi, i don't understand.
Can you rapidly explain me how to make this:
Thanx

u-boot menuconfig
Code: [Select]
CONFIG_FDTFILE=sun5i-a13-olinuxino.dtb

CONFIG_VIDEO=y
CONFIG_VIDEO_HDMI=n
CONFIG_VIDEO_VGA_VIA_LCD=y
CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y

/* for LCD-OLinuXino-7TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0

/* for LCD-OLinuXino-4.3TS, I used this */
CONFIG_VIDEO_LCD_MODE=x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0

CONFIG_VIDEO_LCD_DCLK_PHASE=1


Hello pawnies20,
Do you mean where to set these config?
I've followed the instruction shown in this link http://linux-sunxi.org/Mainline_U-Boot (http://linux-sunxi.org/Mainline_U-Boot)

1. checkout v2015.04

$git clone git://git.denx.de/u-boot.git
$cd u-boot/
$git checkout v2015.04 -b tmp


2. set default config

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_defconfig


3. Now, you can set those setting by issue this command

make ARCH=arm CROSS_COMPAILE=arm-linux-gnueabihf- menuconfig


Hope this help.  :)
Title: Re: LCD-OLinuXino-4.3TS with mainline u-boot and mainline kernel
Post by: pawnies20 on June 15, 2015, 10:30:26 am
Many thanx