On Saturday 24 September 2005 12:26, Stefan Lucke wrote:

> [snip]
>
> With this program I get
> bodega2 root # ./via-revision
> Revision = 0xb7fe0a03
>
> When "val" is initialized to 0 I get:
> bodega2 root # ./via-revision
> Revision = 0x3

DOH!!!! I removed the val = 0 line to tidy it up! For me, it still works 
without doing so. Here's a new version which should zero-pad the revision 
number so it's more readable:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

void main ()
{
    char  *filename = "/proc/bus/pci/00/00.0";
    int   fd;
    int   val = 0;
    unsigned char reg = 0xf6;

    fd = open( filename, O_RDONLY );
    if (fd < 0) {
        printf( "DirectFB/Unichrome: Error opening `%s'!\n", filename );
        exit(0);
    }

    if (lseek( fd, reg, SEEK_SET ) == reg) {
        if (read( fd, &val, 1 ) == 1) {
            close( fd );
            printf("Revision = 0x%02x\n", val);
            exit(0);
        } else {
            printf("Error reading revision number\n");
        }
    }

    close( fd );
}


> And that translates to which chip version ?

I _think_ it is the revision of the north bridge chip (I grabbed it from bits 
of DirectFB/gfxdrivers/unichrome/unichrome.c).

> bodega2 root # cat /proc/cpuinfo
> processor       : 0
> vendor_id       : CentaurHauls
> cpu family      : 6
> model           : 9
> model name      : VIA Nehemiah
> stepping        : 1
> cpu MHz         : 999.553
> cache size      : 64 KB

For me: 
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 9
model name      : VIA Nehemiah
stepping        : 8
cpu MHz         : 1199.925
cache size      : 64 KB

Which looks very similar to what you get! My board is an Epia MII 12000.

Cheers,

Laz

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to