VersatilePB board problem PL110 LCD display

Microcontroller, DSP and FPGA Topics

VersatilePB board problem PL110 LCD display

Postby SemiconductorCat » Fri Feb 21, 2014 9:56 am

Hi all, I've just downloaded QEMU 1.7.0 version and make set the target as 'arm-softmmu' and build 'qemu-system-arm'.
Bellow is the commands that I've invoked.
Code: Select all
#cd /root/qemu-1.7.0/
# ./configure --target-list=arm-softmmu --enable-sdl
#make all
#make install


This is the configure script output.
Code: Select all
Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
library directory /usr/local/lib
libexec directory /usr/local/libexec
include directory /usr/local/include
config directory  /usr/local/etc
local state directory   /usr/local/var
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /root/qemu-1.7.0
C compiler        cc
Host C compiler   cc
C++ compiler      c++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS       -fPIE -DPIE -m32 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -I/usr/include/p11-kit-1    -I/usr/include/libpng12     -I/usr/include/pixman-1   -I$(SRC_PATH)/dtc/libfdt
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m32 -g
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
host CPU          i386
host big endian   no
target list       arm-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
-Werror enabled   no
pixman            system
SDL support       yes
GTK support       no
curses support    yes
curl support      yes
mingw32 support   no
Audio drivers     oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support    no
VNC support       yes
VNC TLS support   yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
VNC WS support    yes
xen support       no
brlapi support    no
bluez  support    yes
Documentation     yes
GUEST_BASE        yes
PIE               yes
vde support       no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
sigev_thread_id   yes
uuid support      no
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
Trace backend     nop
Trace output file trace-<pid>
spice support     no (/)
rbd support       no
xfsctl support    no
nss used          no
libusb            no
usb net redir     no
GLX support       yes
libiscsi support  no
build guest agent yes
QGA VSS support   no
seccomp support   no
coroutine backend ucontext
coroutine pool    yes
GlusterFS support no
virtio-blk-data-plane no
gcov              gcov
gcov enabled      no
TPM support       no
libssh2 support   yes
TPM passthrough   no
QOM debugging     yes
vhdx              no


Then I just wrote this simple kernel, as described in this text.
wiki.osdev.org/ARM_Integrator-CP_PL110_Dirty

Code: Select all
typedef int(*PFN)(void);

void start(void);


void __attribute__((naked)) entry()
{
   __asm__("mov   sp, #0x60 << 8");
   __asm__("bl   start");
}

#define PL110_CR_EN      0x001
#define PL110_CR_PWR      0x800
#define PL110_IOBASE      0xc0000000
#define PL110_PALBASE      (PL110_IOBASE + 0x200)

typedef unsigned int      uint32;
typedef unsigned char      uint8;
typedef unsigned short      uint16;

typedef struct _PL110MMIO
{
   uint32      volatile tim0;      //0
   uint32      volatile tim1;      //4
   uint32      volatile tim2;      //8
   uint32      volatile d;      //c
   uint32      volatile upbase;   //10
   uint32      volatile f;      //14
   uint32      volatile g;      //18
   uint32      volatile control;   //1c
} PL110MMIO;

void start(void)
{
   PFN      fn;
   PL110MMIO   *plio;
   int      x;
   uint16      volatile *fb;

   plio = (PL110MMIO*)PL110_IOBASE;

   /* 640x480 pixels */
   plio->tim0 = 0x3f1f3f9c;
   plio->tim1 = 0x080b61df;
   plio->upbase = 0x200000;
   /* 16-bit color */
   plio->control = 0x1829;
   fb = (uint16*)0x200000;
   for (x = 0; x < (640 * 480) - 10; ++x)
      fb[x] = 0x1f << (5 + 6) | 0xf << 5;

   /* uncomment this and the function pointer should crash QEMU if you set it for 8MB of ram or less */
   for(;;);
   fn = (PFN)0x800f20;
   fn();
   return;
}



Followed the on compiling it and making the kerenl. Like bellow.

Code: Select all
#     ./gcc-arm test.c -nostdlib -o test.o
#   ./objcopy-arm -j .text -O binary test.o test.bin
#   qemu-system-arm -m 8 -kernel test.bin
#


The graphics screen is started, but nothing is happening or screen is getting light blue at all.
Could somebody kindly please review where had gone wrong.

Image


I've also run with the '-M verstailepb' option too, where giving the softmmu specific board.But nothing happens either. Is that PL110 controller is emulating there or is that old cypress PCI vga card still there? Is anyway to verify that?

I've run that UASRT example with --no-graphics option and it works fine. But the problem is using the graphics LCD display.
Image


Could somebody who have experience in real-versatilepb ? could you kindly run this code on it? Or any suggestion where it gone wrong?
User avatar
SemiconductorCat
 
Posts: 462
Joined: Mon Aug 22, 2011 3:12 pm
Cash on hand: 23,861.30
Location: currently in hyperspace

Invitations sent: 0
Registered friends: 0
Reputation point: 9
Corporal

Return to Embedded Processors & Programming

Who is online

Users browsing this forum: No registered users and 2 guests