Skip to contentSkip to conversation

Segmentation fault with X.org and Coral-P drivers

DISCUSSION Matthias Transier 2 participants 6 messages Jan 4, 2006

lore
Share & tools
lore
#0 lore raw

Hello everybody,

I have been trying to get X.org running on a board called "Embedded Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and succesfully installed gentoo-ppc on nfs. The framebuffer works, I get a login prompt on the monitor.

Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from denx.de. Unfortunately, it does not work and I get a segmentation fault when trying to startx. strace produces the output attached below.

Can anybody give me a hint how to proceed?

Regards,
Matthias

[...]
mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0) =3D 0x30042000 ioctl(6, FBIOGET_VSCREENINFO, 0x105dfa58) =3D 0
ioctl(6, FBIOPUT_VSCREENINFO, 0x105df9b8) =3D 0
ioctl(6, FBIOGET_FSCREENINFO, 0x105df974) =3D 0
ioctl(6, FBIOGET_VSCREENINFO, 0x105df9b8) =3D 0
ioctl(6, FBIOBLANK, 0x1) =3D 0
ioctl(6, FBIOPAN_DISPLAY, 0x105df9b8) =3D 0
write(0, "(=3D=3D) MB86290(0): Backing store d"..., 40) =3D 40 write(0, "(II) MB86290(0): Using XFree86 A"..., 63) =3D 63 write(0, "\tScreen to screen bit blits\n", 28) =3D 28
write(0, "\tSolid filled rectangles\n", 25) =3D 25
write(0, "\t8x8 mono pattern filled rectang"..., 36) =3D 36 write(0, "\tIndirect CPU to Screen color ex"..., 40) =3D 40
write(0, "\tSolid Lines\n", 13) =3D 13
write(0, "\tDashed Lines\n", 14) =3D 14
write(0, "(II) MB86290(0): Acceleration en"..., 38) =3D 38

ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930)       =3D 0

--- SIGSEGV (Segmentation fault) @ 0 (0) --- rt_sigaction(SIGSEGV, {SIG_IGN}, {0x100424d0, [SEGV], SA_RESTART}, 8) =3D 0
write(2, "\n *** If unresolved symbols we"..., 112
[...]

#1 lore raw

Dear Matthias,

Quoted 3 lines · in message <[email protected]> you wrote:

I have been trying to get X.org running on a board called "Embedded Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu

Umm... no. Embedded Plaet and Freescale are two different companies, and EP5200 and Lite5200 are two different boards.

Quoted 1 line

Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and

Our kernel does not include any support for the EP5200 board.

Quoted 7 lines

succesfully installed gentoo-ppc on nfs. The framebuffer works, I get a login prompt on the monitor.

Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from denx.de. Unfortunately, it does not work and I get a segmentation fault when trying to startx. strace produces the output attached below.

Please read the documentation that comes with the driver:
ftp://ftp.denx.de/pub/fujitsu/Coral-P/README.html

Note that the driver was built and tested against xfree86-4.3.0; don't expect the binary to work in a completely different X11 release. You wil have to rebuild (and eventually adapt) the driver for your environment.

Feel free to contact me if you need help.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
What can it profit a man to gain the whole world and to come  to  his
property with a gastric ulcer, a blown prostate, and bifocals?
                                     -- John Steinbeck, _Cannery Row_
#2 lore raw

Hi Wolfgang,

thanks for the quick response.

2006/1/4, Wolfgang Denk <[email protected]>:

Quoted 5 lines
Quoted 2 lines

I have been trying to get X.org running on a board called "Embedded Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu

Umm... no. Embedded Plaet and Freescale are two different companies, and EP5200 and Lite5200 are two different boards.

Ok, my fault. I saw a Lite5200 on a picture somewhere and it looked pretty much like my EP board :-). But what I can tell for sure is:
when I remove the "Embedded Planet" sticker on the board, there is a Freescale logo and a print (directly on the board): "IceCube Version 103"

Quoted 3 lines
Quoted 1 line

Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and

Our kernel does not include any support for the EP5200 board.

I checked it out from CVS, configured it, and it works (besides the X11 thi= ng).

Quoted 10 lines
Quoted 7 lines

succesfully installed gentoo-ppc on nfs. The framebuffer works, I get a login prompt on the monitor.

Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from denx.de. Unfortunately, it does not work and I get a segmentation fault when trying to startx. strace produces the output attached below.

Please read the documentation that comes with the driver:
ftp://ftp.denx.de/pub/fujitsu/Coral-P/README.html

That is what I already read in order to compile the driver.

Quoted 4 lines

Note that the driver was built and tested against xfree86-4.3.0; don't expect the binary to work in a completely different X11 release. You wil have to rebuild (and eventually adapt) the driver for your environment.

I did not use the prebuilt binaries, but I was able to compile the driver within my x.org tree. (I had to adapt the Imakefiles by myself, the provided ones were too different from the originals.)

In the meantime, I can provide you with further debugging information:
from Xorg.0.log:
=3D=3D=3D=3D=3D=3D
(II) MB86290(0): Using XFree86 Acceleration Architecture (XAA)
Screen to screen bit blits
Solid filled rectangles
8x8 mono pattern filled rectangles
Indirect CPU to Screen color expansion
Solid Lines
Dashed Lines
(II) MB86290(0): Acceleration enabled
fbdevHW: LoadPalette 0
(II) MB86290(0): fbdevHWLoadPalette succeeded =3D=3D=3D=3D=3D=3D

The last line is a message that I added. Since the output stops at that point, it must be the next call that fails (mb86290_driver.c:604):

        if (!xf86I2CProbeAddress(fPtr->I2C, I2C_SAA7113))
                return FALSE;

May that be a problem with the i2c driver in the kernel which does not exactly fit with my board?
The following message also appears in Xorg.0.log, some lines above:
(II) MB86290(0): I2C bus "MB86290 I2C bus" removed.

Thanks in advance for any hint that you can give me.

Best regards,
Matthias

#3 lore raw

Hi Wolfgang,

it finally works :-). I had to make a small modification to the x.org source code. The file xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c contains the initialization of the i2c bus. In function xf86I2CBusInit, I added the two lines near the beginning:

    if (b->I2CStart =3D=3D NULL)
            b->I2CStart =3D I2CStart;

which sets the start function to a default function. The problem was that mb86290_i2c.c does not provide a start function, whereas xf86I2CBusInit expects one under some circumstances.

Best regards,
Matthias

#5 lore raw
In reply to Matthias Transier

Dear Matthias,

Quoted 8 lines · in message <[email protected]> you wrote:
Quoted 2 lines

and EP5200 and Lite5200 are two different boards.

Ok, my fault. I saw a Lite5200 on a picture somewhere and it looked pretty much like my EP board :-). But what I can tell for sure is:
when I remove the "Embedded Planet" sticker on the board, there is a Freescale logo and a print (directly on the board): "IceCube Version 103"

Ouch. So far for marketing methods. I didn't know this.

Quoted 3 lines
Quoted 1 line

Our kernel does not include any support for the EP5200 board.

I checked it out from CVS, configured it, and it works (besides the X11 thing).

It should work on the Lite5200 board. I just expected different hardware ...

Quoted 1 line

I did not use the prebuilt binaries, but I was able to compile the

I see.

Quoted 2 lines

driver within my x.org tree. (I had to adapt the Imakefiles by myself, the provided ones were too different from the originals.)

If you want to send me your patches: they are welcome.

Quoted 9 lines

The last line is a message that I added. Since the output stops at that point, it must be the next call that fails (mb86290_driver.c:604):

        if (!xf86I2CProbeAddress(fPtr->I2C, I2C_SAA7113))
                return FALSE;

May that be a problem with the i2c driver in the kernel which does not exactly fit with my board?

This is not the kernel's (MPC5200) I2C driver; actually I2C is only needed for external video decoder chip that _may_ be connected to the CoralP chip. It is the CoralP itself that acts as an I2C "adapter" in this case. By writing to some CoralP registers, accessible from the host (CPU) via PCI, the driver manipulates external pins of the CoralP chip, which form the I2C bus. It is an external (relative to both CoralP and the CPU) device that is controlled through I2C; in your case the Philips SA71111 video decoder chip.

Quoted 4 lines

The following message also appears in Xorg.0.log, some lines above:
(II) MB86290(0): I2C bus "MB86290 I2C bus" removed.

Thanks in advance for any hint that you can give me.

You can disable video capture support, and thus the I2C, by setting option "Video" to "no" in the driver's X11 config file:

	Section "Device"
		 Identifier  "MB86290 card"
		 Driver      "mb86290"
		 Option     "Video" "no"
	EndSection

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Artificial Intelligence is the study of how to  make  real  computers
act like the ones in movies.
#4 lore raw
In reply to Matthias Transier

Dear Matthias,

Quoted 3 lines · in message <[email protected]> you wrote:

it finally works :-). I had to make a small modification to the x.org source code. The file xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c

Congrats!  To  make  it  perfect:  could  you  please  wrap  up  your
modifications  into  a  patch we can put on our FTP server, so others

can benefit from this, too?

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Even historians fail to learn from history -- they repeat the same
mistakes.
	-- John Gill, "Patterns of Force", stardate 2534.7