Hi all,
I’m trying to get the board model accessing
the model register. The problem is that I’m getting the same value (zero)
for both ts7200 and ts7400 models. Is that correct ? Shouldn’t the values
be different. What are the values for ts7300, ts7200, ts7400, ts7800 and ts7260
?
This code is returning 0 (zero) on both
ts7200 and ts7400 boards :
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define MODELBASE 0x22000000
volatile unsigned int *model_ptr;
unsigned int model;
main()
{
int fd = open("/dev/mem",
O_RDWR|O_SYNC);
model_ptr = (unsigned int *)mmap(0,
getpagesize(),
PROT_READ|PROT_WRITE, MAP_SHARED,
fd, MODELBASE);
model = *model_ptr & 0x03;
printf("model =
%d\n",model);
}