Hi Pablo,
there should be another 'probe' function where is done all the driver initialization such as the memory reservation and framebuffer registration. Try to follow step-by-step this function.
Regards,
Inaki
-----Mensaje original-----
De: owner-microblaze-uclinux@xxxxxxxxxxxxxx en nombre de pcolodron@xxxxxxxx
Enviado el: mié 25/03/2009 10:36
Para: microblaze-uclinux@xxxxxxxxxxxxxx
Asunto: Re: [microblaze-uclinux] VGA controller in Microblaze
Hi Inaki,
I have used printk to follow the initialization steps. Here you can
see the code of xilinxfb.c in which I wrote the printk:
/* ---------------------------------------------------------------------
* Module setup and teardown
*/
static int __init
xilinxfb_init(void)
{
int rc;
printk("paso 1\n");
rc = xilinxfb_of_register();
printk("paso 2\n");
if (rc)
return rc;
printk("paso 3\n");
rc = platform_driver_register(&xilinxfb_platform_driver);
printk("paso 4\n");
if (rc)
xilinxfb_of_unregister();
printk("paso 5\n");
return rc;
}
static void __exit
xilinxfb_cleanup(void)
{
platform_driver_unregister(&xilinxfb_platform_driver);
xilinxfb_of_unregister();
}
module_init(xilinxfb_init);
module_exit(xilinxfb_cleanup);
MODULE_AUTHOR("MontaVista Software, Inc. <source@xxxxxxxxxx>");
As I expected, when booting the kernel I could see all printk written
on the console:
io scheduler deadline registered
io scheduler cfq registered (default)
paso 1
paso 2
paso 3
paso 4
paso 5
xgpio0 #0 at 0x81400000 mapped to 0x81400000 device: 10,185 not using IRQ
xgpio1 #1 at 0x81420000 mapped to 0x81420000 device: 10,186 not using IRQ
uartlite.0: ttyS0 at MMIO 0x84000000 (irq = 1) is a uartlite
It is rather weird because, when the uClinux system is booted, I tried
to see if the drivers were where they sould be. I could see the
following:
# ls sys/bus/platform/drivers/
i8042 uartlite xilinx_gpio xilinxfb
# ls sys/bus/platform/devices/
i8042 uartlite.0 xilinx_gpio.0 xilinx_gpio.1
So the driver is in the correct place. However, there are no devices
related to the xilinxfb driver...
I have also tried to use another framebuffer driver, just to see if
the framebuffer device was detected. I used the driver Epson S1D13
which can be found in menuconfig and the results were the same. The
framebuffer was not detected (did not appear in .../platform/devices)
but the driver was in .../platform/drivers.
Does this tell you anything about where the error could be?
Thanks again for your patience Inaki. You are being really helful.
Kind regards,
Pablo Colodron
Val Inaki escribió:
> Hi Pablo,
>
> use 'printk' in the xilinxfb driver to follow the initialization
> steps, because I'm not sure but I think the driver doesn't print
> nothing.
>
> Regards,
>
> Inaki
>
>
> -----Mensaje original-----
> De: owner-microblaze-uclinux@xxxxxxxxxxxxxx en nombre de pcolodron@xxxxxxxx
> Enviado el: mar 24/03/2009 9:25
> Para: microblaze-uclinux@xxxxxxxxxxxxxx
> Asunto: Re: [microblaze-uclinux] VGA controller in Microblaze
> Hi Inaki,
>
> I've tested the TFT IP and it works. I've created a software
> application in EDK using the library 'xtft.h' which plots on the
> screen the typical color bars. At least, now I know that the EDK
> project is ok so thank you very much Inaki.
>
> What I should do now is to figure out what is wrong in my kernel. As
> I told you I've created the kernel with framebuffer support and
> using the driver 'xilinxfb.c' (I checked that the driver is
> compiled with the kernel and it is). However, the boot log shows
> that the framebuffer is not recognised. It can be seen how the
> uartlite is assigned to ttyS0 and how xgpio1 and xgpio2 are
> recognised as well.
>
> Do you have any idea of what could be the problem? Probably it is a
> basic step that I am not taking. Sorry about being so annoying
> with too many questions...
>
> Thanks a lot Inaki.
>
> Regards,
>
> Pablo Colodron
>
> Val Inaki escribió:
>> Hi Pablo,
>>
>> I think you should first check that the TFT IP works. Connect the
>> MPLB port to the PLB bus in order to read the framebuffer memory,
>> which must be within the DDR space memory. To program the TFT
>> configuration registers connect the SPLB port to the PLB bus, and
>> in this way EDK will compile the TFT library for peripheral testing.
>>
>> Regards,
>>
>> Inaki
>>
>>
>> -----Mensaje original-----
>> De: owner-microblaze-uclinux@xxxxxxxxxxxxxx en nombre de pcolodron@xxxxxxxx
>> Enviado el: mié 18/03/2009 16:41
>> Para: microblaze-uclinux@xxxxxxxxxxxxxx
>> Asunto: Re: [microblaze-uclinux] VGA controller in Microblaze
>> Hi Inaki,
>>
>> I've tried to dump the file to /dev/fb0 (with cat /bin/busybox
>> /dev/fb0) but I got the next message: '/dev/fb0: cannot create".
>>
>> Unfortunately I couldn't test the TFT peripheral because the only
>> tests which are available in my project in EDK are for uartlite, gpio,
>> iic and sysace. Do you know where I could find one?
>>
>> I will tell you the steps that I have followed to create my system
>> such that you may see if there is something wrong:
>>
>> - I have created a project for my Spartan3 Starter kit using the
>> tool Base System Builder in EDK.
>> - Then I have followed the Petalinux tutorial to add fs-boot, etc.
>> Moreover, I've added one PS/2 peripheral and one TFT peripheral.
>>
>> Here I have some doubts. In the TFT IP Core, there is a parameter
>> called 'Base Address of PLB Attached Video Memory'. I supose that the
>> framebuffer should be in the DDR memory, so in that parameter I wrote
>> an address which is inside the DDR. I don't know if this is the
>> appropriate way of setting up the framebuffer. Another thing is
>> that in my TFT IP Core, the parameter 'Select Controller Register
>> Access Interface' is selected and 'Select TFT Interface' is
>> unselected. It is connected to PLB bus using a SPLB interface.
>>
>> Moreover, I am not sure about which is the suitable way of configuring
>> my DDR. In this IP Core, PORT0 is configured as PLBV46, and this is
>> the only thing that I have configured. However, I don't know if some
>> other port must ve activated in mode VFBC (Virtual Frame Buffer Controller).
>>
>> -Once I created EDK project, I compiled the kernel with
>> 'xilinxfb', as you had told me (with framebuffer support and so
>> on). Then I loaded the kernel into the board and I got the
>> following boot log:
>>
>> ## Booting image at 858c0000 ...
>> Image Name: PetaLinux Kernel 2.6
>> Image Type: Microblaze Linux Kernel Image (uncompressed)
>> Data Size: 2379812 Bytes = 2.3 MB
>> Load Address: 88000000
>> Entry Point: 88000000
>> Verifying Checksum ... OK
>> OK
>> Linux version 2.6.20-uc0 (root@xxxxxxxxxxxxxxxxxxxxx) (gcc version
>> 3.4.1 ( PetaL
>> inux 0.20 Build -rc1 050607 )) #47 Wed Mar 18 15:59:38 CET 2009
>> setup_cpuinfo: initialising
>> setup_cpuinfo: No PVR support in CPU. Using static compile-time info
>> set_cpuinfo_static: Using static CPU info.
>> setup_memory: max_mapnr: 0x8ffff
>> setup_memory: min_low_pfn: 0x88000
>> setup_memory: max_low_pfn: 0x8000
>> On node 0 totalpages: 32768
>> DMA zone: 256 pages used for memmap
>> DMA zone: 0 pages reserved
>> DMA zone: 32512 pages, LIFO batch:7
>> Normal zone: 0 pages used for memmap
>> Built 1 zonelists. Total pages: 32512
>> Kernel command line:
>> mtdparts=physmap-flash.0:256K(boot),256K(bootenv),256K(conf
>> ig),5M(image),2M(spare) macaddr=00:0a:35:00:22:01 console=fb0
>> console=ttyS0,1152
>> 00
>> OPB INTC #0 at 0x81800000
>> PID hash table entries: 512 (order: 9, 2048 bytes)
>> Console: colour dummy device 80x25
>> Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
>> Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
>> Memory: 127388k/131072k available
>> Calibrating delay loop... 1.40 BogoMIPS (lpj=7040)
>> Mount-cache hash table entries: 512
>> io scheduler noop registered
>> io scheduler anticipatory registered
>> io scheduler deadline registered
>> io scheduler cfq registered (default)
>> xgpio0 #0 at 0x81420000 mapped to 0x81420000 device: 10,185 not using IRQ
>> xgpio1 #1 at 0x81400000 mapped to 0x81400000 device: 10,186 not using IRQ
>> uartlite.0: ttyS0 at MMIO 0x84000000 (irq = 1) is a uartlite
>> RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
>> uclinux[mtd]: RAM probe address=0x8816ed8c size=0xe9000
>> Creating 1 MTD partitions on "RAM":
>> 0x00000000-0x000e9000 : "ROMfs"
>> uclinux[mtd]: set ROMfs to be root filesystem index=0
>> i8042.c: i8042 controller self test timeout.
>> mice: PS/2 mouse device common for all mice
>> VFS: Mounted root (cramfs filesystem) readonly.
>> Freeing unused kernel memory: 88k freed
>> Mounting proc:
>> Mounting var:
>> Populating /var:
>> Running local start scripts.
>> Mounting /etc/config:
>> Populating /etc/config:
>> flatfsd: Nonexistent or bad flatfs (-48), creating new one...
>> flatfsd: Failed to write flatfs (-48): No such device
>> flatfsd: Created 3 configuration files (117 bytes)
>> Mounting sysfs:
>> Setting hostname:
>> uclinux login:
>>
>>
>> As you can see, there are no references to fb0 or any framebuffer
>> parameter and I think that those kind of parameters should be
>> mentioned, shouldn't they?
>>
>> Thanks a lot for your advices, they are being very helpful.
>>
>> Kind regars,
>>
>> Pablo Colodron
>>
>>
>>
>> Val Inaki escribió:
>>> Hi Pablo,
>>>
>>> this xilinx framebuffer driver is just for Linux kernel, U-boot
>>> uses its own framebuffer driver. So, having the device
>>> /dev/fb0, could you try to dump something (dummy file) to
>>> /dev/fb0?
>>>
>>> > cat /bin/busybox > /dev/fb0
>>>
>>> you should see something in the screen.
>>>
>>> Have you tried the TFT peripheral test from EDK to see if the TFT IP works?
>>>
>>> Regards,
>>>
>>> Inaki
>>>
>>>
>>> -----Mensaje original-----
>>> De: owner-microblaze-uclinux@xxxxxxxxxxxxxx en nombre de pcolodron@xxxxxxxx
>>> Enviado el: mié 18/03/2009 13:07
>>> Para: microblaze-uclinux@xxxxxxxxxxxxxx
>>> Asunto: Re: [microblaze-uclinux] VGA controller in Microblaze
>>> Hi Inaki,
>>>
>>> In order to set up the framebuffer for my Spartan3 board, I've
>>> done what you told me. I added xilinxfb.c and xilinxfb.h to
>>> the petalinux tree. I've also modified the 'Kconfig' and
>>> 'Makefile' files which are in .../drivers/video. Then, in
>>> 'menuconfig' I have selected the framebuffer such that the
>>> compiler uses xilinxfb.c as framebuffer.
>>>
>>> I've compiled the kernel and everything seemed to be ok. However,
>>> my uClinux system doesn't recognize the framebuffer. If I
>>> execute 'fbset --show' it says that there are no devices
>>> (although in folder /dev I can see 'fb0'). I have also tried to
>>> check if U-boot recognized the device using the command
>>> 'coninfo', but the list of available devices was empty.
>>>
>>> I think I am missing some steps when trying to set up the
>>> framebuffer. Do you know if U-boot needs an extra configuration
>>> to add the framebuffer? I've been tried to figure this out for
>>> many days but I couldn't do it.
>>>
>>> Please if anybody has any hint it would be very appreciated.
>>>
>>> Thank you very much.
>>>
>>> Regards,
>>>
>>> Pablo Colodron
>>>
>>>
>>>
>>> Val Inaki escribió:
>>>> Hi,
>>>>
>>>> you also need the headers file 'xilinxfb.h' and modify the
>>>> 'Kconfig' and 'Makefile' files from the /drivers/video folder.
>>>> There is another issue with this driver because you need to
>>>> add the code for registering the device with its resources,
>>>> which are the address space for accesing the SPLB registers.
>>>>
>>>> The graphical libraries can use the framebuffer driver, so they
>>>> will use '/dev/fb0'.
>>>>
>>>> Best regards,
>>>>
>>>> Inaki
>>>>
>>>>
>>>> -----Mensaje original-----
>>>> De: owner-microblaze-uclinux@xxxxxxxxxxxxxx en nombre de
>>>> pcolodron@xxxxxxxx
>>>> Enviado el: mar 20/01/2009 10:31
>>>> Para: microblaze-uclinux@xxxxxxxxxxxxxx
>>>> Asunto: RE: [microblaze-uclinux] VGA controller in Microblaze
>>>> Hi Inaki,
>>>>
>>>> It is nice to have your help, thanks a lot. As you have guessed,
>>>> I am thinking of using a LDC display and I have configured
>>>> the IP core to 25MHz.
>>>>
>>>> So, according to your mail, the only thing that I should do is to
>>>> copy the driver 'xilinxfb.c' in the directory
>>>> .../linux-2.6.x/drivers/video and after that rebuild the kernel.
>>>> Is that right?
>>>>
>>>> Once the kernel is built, one should start with the graphical
>>>> library but in this step, which is the video device that you
>>>> use (I mean the device in romfs/dev/)? fb0? console?
>>>>
>>>> Thank you very much for your help Inaki.
>>>>
>>>> Kind regards,
>>>>
>>>> Pablo
>>>>
>>>>
>>>> Val Inaki escribió:
>>>>> Hi,
>>>>>
>>>>> We are also using the Xilinx TFT IP with a Spartan3A FPGA and
>>>>> Petalinux/MicroblazeMMU. In our Petalinux distribution there was not any
>>>>> TFT driver, so we had to add it manually in the kernel tree:
>>>>>
>>>>> http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/drivers/video/xilinxfb.c
>>>>>
>>>>> You also need to activate the framebuffer support in order to access de
>>>>> video memory. After everything is working you can use any graphical
>>>>> library, in our case we have started working with the supplied version
>>>>> of microwindows in the Petalinux distribution.
>>>>>
>>>>> Remember that the Xilinx TFT IP is for a hardcoded 640x480 resolution,
>>>>> but clocking the IP to 25MHz, you can connect a LCD display through the
>>>>> VGA connector.
>>>>>
>>>>> I hope this information would be helpful.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Inaki
>>>>>
>>>>> -----Mensaje original-----
>>>>> De: owner-microblaze-uclinux@xxxxxxxxxxxxxx
>>>>> [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] En nombre de
>>>>> pcolodron@xxxxxxxx
>>>>> Enviado el: lunes, 19 de enero de 2009 9:57
>>>>> Para: microblaze-uclinux@xxxxxxxxxxxxxx
>>>>> Asunto: Re: [microblaze-uclinux] VGA controller in Microblaze
>>>>>
>>>>> Hi John,
>>>>>
>>>>> Thanks a lot for your answer. I am using the XPS TFT ip core
>>>>> (which is available in IP Catalog -> IO Modules, in EDK 10.1).
>>>>>
>>>>> I will take a look to the framebuffer drivers that you told me.
>>>>> Anyway, I think I will have to activate the 'framebuffer
>>>>> support' in the Petalinux configuration, is that right?
>>>>>
>>>>> In addition to this, I will try to figure out which is the most
>>>>> suitable graphics engine for my system because I am using
>>>>> fbcon and I don't know if it is very common in embedded
>>>>> systems.
>>>>>
>>>>> I could find this framebuffer in the directory
>>>>> /linux-2.6.x/drivers/video/console/fbcon.c. However, when I
>>>>> create the petalinux kernel and I explore the directory
>>>>> /romfs/dev/, it seems that the only frammebuffers that I
>>>>> have are '@console,c,5,1' and '@fb0,c,29,0' (is the fbcon
>>>>> framebuffer really activated?). I have not tested it yet,
>>>>> but, before doing this, it would be great to know if my
>>>>> kernel is properly configured.
>>>>>
>>>>> Thank you very much for your help John.
>>>>>
>>>>> Kind regards
>>>>>
>>>>>> Hi Pablo,
>>>>>>
>>>>>> On Fri, Jan 9, 2009 at 8:22 PM, <pcolodron@xxxxxxxx> wrote:
>>>>>>
>>>>>>
>>>>>> I am actually trying to work with the latest version of
>>>>>> Petalinux in my >Xilinx Spartan3 development kit. I am quite
>>>>>> unexperienced in this sense but I >have already solved
>>>>>> some problems concerning EDK and building the Petalinux
>>>>>> >kernel.
>>>>>>
>>>>>> What I would like to do now is to develop a graphical user
>>>>>> interface in >Petalinux (to do this, I will use a graphic
>>>>>> library called MiniGUI). This >software is basically a
>>>>>> C-written program which shows the GUI by means of the
>>>>>>> framebuffer fbcon. However, I have some doubts about how
>>>>>> to do it.
>>>>>>
>>>>>> My problems are related to the EDK project. I don't really
>>>>>> know if >Petalinux will work with any type of VGA IP
>>>>>> Core. I mean, will petalinux >detect that I have a VGA
>>>>>> IP core? That will be enough if I want to use a LCD >or
>>>>>> a monitor? Because of my lack of knowledge in this
>>>>>> sense I don't really get >to understand how to do this.
>>>>>>
>>>>>> Please if you know any place where some cores are avaliable
>>>>>> (or some >information about how to build a VGA
>>>>>> controller which works in Petalinux) it >would be nice
>>>>>> of you to tell me.
>>>>>>
>>>>>>
>>>>>> You will require a framebuffer device driver - they are quite
>>>>>> simple to write, >with many examples in
>>>>>> linux-2.6.x/drivers/video
>>>>>>
>>>>>> Which VGA IP core are you using?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> John
>>>>> ___________________________
>>>>> microblaze-uclinux mailing list
>>>>> microblaze-uclinux@xxxxxxxxxxxxxx
>>>>> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
>>>>> Mailing List Archive :
>>>>> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>>>>>
>>>>>
>>>>> ___________________________
>>>>> microblaze-uclinux mailing list
>>>>> microblaze-uclinux@xxxxxxxxxxxxxx
>>>>> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
>>>>> Mailing List Archive :
>>>>> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>>>>>
>>>>>
>>>> ___________________________
>>>> microblaze-uclinux mailing list
>>>> microblaze-uclinux@xxxxxxxxxxxxxx
>>>> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
>>>> Mailing List Archive :
>>>> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>>>>
>>>>
>>>
>>> ___________________________
>>> microblaze-uclinux mailing list
>>> microblaze-uclinux@xxxxxxxxxxxxxx
>>> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
>>> Mailing List Archive :
>>> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>>>
>>>
>>
>>
>>
>> ___________________________
>> microblaze-uclinux mailing list
>> microblaze-uclinux@xxxxxxxxxxxxxx
>> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
>> Mailing List Archive :
>> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>>
>>
>
>
>
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive :
> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>
>
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
<<winmail.dat>>