Author Topic: embedded linux board, problems with Matrox G450  (Read 2089 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
embedded linux board, problems with Matrox G450
« on: December 18, 2017, 09:03:20 pm »
Code: [Select]
matroxfb: Matrox G450 detected
matroxfb: cannot determine memory size
matroxfb: probe of 0000:01:00.0 failed with error -1

Kernel 4.11

So, I need to use an embedded PowerPC machine with a PCI bus loaded with a Matrox G450 video card. It's a dual head video card, 2xVGA with 32MByte of video ram.

I got the above error, and I wonder ... do you remember any special flag to make it working?

In the same board, matrox millenniumI and II are perfectly working  :-//


Tips? Advice? Let me know! Thanks  :D
« Last Edit: December 19, 2017, 02:51:47 pm by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problem with Matrox G450
« Reply #1 on: December 18, 2017, 10:00:05 pm »
Code: [Select]
        err = -ENXIO;
        matroxfb_read_pins(minfo);
        if (minfo->hw_switch->preinit(minfo))
        {
                goto failVideoIO;
        }

        err = -ENOMEM;
        if (!matroxfb_getmemory(minfo, memsize, &minfo->video.len) || !minfo->video.len)
        {
                printk(KERN_ERR "matroxfb: cannot determine memory size\n");
                goto failVideoIO;
        }
        minfo->devflags.ydstorg = 0;
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #2 on: December 18, 2017, 10:26:15 pm »
Code: [Select]
        //myhack
        err = -ENOMEM;
        if (!matroxfb_getmemory(minfo, memsize, &minfo->video.len) || !minfo->video.len)
        {
                printk(KERN_ERR "matroxfb: minfo->video.len_max=%lu\n",minfo->video.len_maximum);
                printk(KERN_ERR "matroxfb: minfo->video.len=%lu\n",minfo->video.len);
                printk(KERN_ERR "matroxfb: matroxfb_getmemory=%d\n",matroxfb_getmemory(minfo, memsize, &minfo->video.len)$
                printk(KERN_ERR "matroxfb: cannot determine memory size\n");
                //goto failVideoIO;
                minfo->video.len=minfo->video.len_maximum; //myhack force it
        }
drivers/video/fbdev/matrox/matroxfb_base.c




Code: [Select]
matroxfb: Matrox G450 detected
PInS data found at offset 31936
PInS memtype = 4
matroxfb: minfo->video.len_max=33554432
matroxfb: minfo->video.len=0
matroxfb: matroxfb_getmemory=1
matroxfb: cannot determine memory size
matroxfb: 640x480x8bpp (virtual: 640x26214)
matroxfb: framebuffer at 0x80000000, mapped to 0xc4080000, size 33554432
Console: switching to colour frame buffer device 80x30
fb0: Matrox frame buffer device
matroxfb_crtc2: secondary head of fb0 was registered as fb1

ugly hack, but it seems a good workaround; X11 is loaded and working, but ... still have to understand why minfo->video.len returns 0  :-// :-// :-// :-//


« Last Edit: December 19, 2017, 02:52:01 pm by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #3 on: December 18, 2017, 10:27:58 pm »
Code: [Select]
0008:01:00.0 Class 0300: Device 102b:0525 (rev 85)
        Subsystem: Device 102b:0d41
        Flags: bus master, medium devsel, latency 128, IRQ 30
        Memory at 80000000 (32-bit, prefetchable) [size=32M]
        Memory at 82820000 (32-bit, non-prefetchable) [size=16K]
        Memory at 82000000 (32-bit, non-prefetchable) [size=8M]
        Expansion ROM at 82800000 [disabled] [size=128K]
        Capabilities: [dc] Power Management version 2
        Capabilities: [f0] AGP version 2.0
        Kernel driver in use: matroxfb

videoram @ 0x80000000,32Mbyte
« Last Edit: December 19, 2017, 02:52:14 pm by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #4 on: December 19, 2017, 02:36:58 pm »
Quote
[I'm not on linux-mips, so cc me if needed]

On 30 Aug 01 at 6:25, Fuxin Zhang wrote:
>     I have touble to make matroxfb work,could you be so kind to help me out?
>
>     My configuration:
>      Algorithmics P6032 evaluation board + idt64474 mipsel CPU
>        (with pci slot,no AGP)
>      Millennium G450 (PCI),16M DDR mem,Dual head.

>      2. memory cannot be autodetected. getmemory exit with realSize=0
>      3. if i set video.len mannually to 0x1000000(16M),then all seems
>          to work,but the screen shows only some regular vertical lines
>          and a real BIG cursor(about 2cm x 2cm!). There is about
>          0.5cm between two vertical lines.

Unfortunately, you are out of luck, matroxfb can initialize only
old Millenniums/Mysqtiques and G200 from scratch. If you have some
PC around, you can try either reading PCI registers from initialized
hardware, and set them by this during initialization in G100_preinit.
You must also initialize G450->video memory interface, and as this inteface
differs from G400, and G450 datasheet is still unavailable, it
can be tricky.

You can try contacting 'hollis@austin.ibm.com' (I hope that he wont mind),
he asked about 3 weeks ago same question, but for their PPC hardware.
So maybe that he already has some initialization code ready.

>       2. try all kind of options: novga,nobios,noaccel,nohwcursor etc
>          but nothing seems to really help(with nohwcursor,the big
>          cursor disappears)(of course,I may have left out the
>          correct combination:,it is impossible to try all)

You can try 'init' together with different 'memtype' values.

>     One thing that may be useful is that pci initialization may have
>    problems because my firmware (pmon from algor) has some bugs which
>    prevent it from recognize and initialize the matrox card correctly.

It is not enough. You must also execute x86 initialization code to
bring chip to live, otherwise couple of parts of chip are powered
off (second head...), and uninitialized (memory interface, AGP), and
matroxfb does not care because of these init sequences and values are
undocumented (and on PC it requires two videocards in the box, and it
is currently impossible for me as all 6 PCI/AGP slots are used in my
testbox).

I'm currently (and will for at least several next weeks) overloaded
with work I'm doing for my employer, so I cannot reverse engineer this
myself.

So, the article was written in 2001, but ... it is what I am observing in a modern linux kernel v4.1 running on the top of an embedded PowerPC machine ....   :palm: :palm: :palm: :palm:

In short: forget Matrox G2xx, G4xx, you can only use MilleniumI/II as MGA framebuffer.
« Last Edit: December 19, 2017, 02:52:26 pm by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #5 on: December 19, 2017, 02:46:53 pm »
plus this

Quote
It is not enough. You must also execute x86 initialization code to bring chip to live, otherwise couple of parts of chip are powered off (second head...), and uninitialized (memory interface, AGP), and matroxfb does not care because of these init sequences and values are undocumented

Jezz,  how a crazy world  :palm: :palm: :palm: :palm:
« Last Edit: December 19, 2017, 02:51:31 pm by legacy »
 

Online rsjsouza

  • Super Contributor
  • ***
  • Posts: 5985
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: embedded linux board, problems with Matrox G450
« Reply #6 on: December 19, 2017, 07:02:37 pm »
legacy, I had a Matrox Millenium G400 back when it was new, and as I remember its support was very flaky. To me it seemed they were about to give up on the video graphics cards for consumer - it was a pain to configure it with Solaris and Linux, while Windows had ok drivers for 2D but were never quite good for 3D.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #7 on: December 19, 2017, 07:15:12 pm »
its support was very flaky

Yes, it's a mess! I need two heads for a project I am working on; it's an X11 terminal made with an embedded powerpc board, the login is by a SMART CARD (embedded with people's badge), and it requires two screens. The board has only two PCI slots, no built-in USB, so one slot is used by a PCI-PS/2 adapter (for both mouse and keyboard), while the second slot is used by the video card.

And here we have the problem. G450-pci comes with two vga connectors, it allows two framebuffer (fb0, fb1), it has enough video ram for both (32MB), but .. the kernel-driver is a mess, the documentation is poor (tons of features unknown, tons of details of the init process is unknown), and the BIOS is written in x86 code  :palm: :palm: :palm:

 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: embedded linux board, problems with Matrox G450
« Reply #8 on: December 20, 2017, 01:37:12 am »
Code: [Select]
0008:01:00.0 Class 0300: Device 102b:0525 (rev 85)


Code: [Select]
matroxfb: probe of 0000:01:00.0 failed with error -1



 minfo->video.vbase is wrong, but judging by those old messages it shouldnt work at all without x86 vga bios being somehow executed in emulator on powerpc
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: embedded linux board, problems with Matrox G450
« Reply #9 on: December 21, 2017, 12:29:14 pm »
it shouldnt work at all without x86 vga bios being somehow executed in emulator on powerpc

the solution was
- adding the x86 emulator on powerpc
- adding "matroxfb:init,bios" to cmdline

the MGA chip was not initialized at all
not it's working!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf