summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuotao Fu <l.fu@pengutronix.de>2010-01-12 10:25:14 +0100
committerLuotao Fu <l.fu@pengutronix.de>2010-01-12 10:25:14 +0100
commit807c54488b9e02c9c32c769376bc4cbf79f3586d (patch)
treec794d617bda25fd885a0bfdaf16ee40f18ed67bd
parente2d88d2b37e27026cbd9b20ccd57b258d51c88ec (diff)
downloadlibfsl-vpu-807c54488b9e02c9c32c769376bc4cbf79f3586d.tar.gz
libfsl-vpu-807c54488b9e02c9c32c769376bc4cbf79f3586d.tar.xz
fixed up sytem revsion to mx27
original fsl code used to look into /proc/cpuinfo for cpu version and revison. It doesn't work on a mainline mxc kernel though. For now we fix the system revision to mx27 rev. 0x20 since we only have the microcode for mx27 anyway. Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
-rw-r--r--src/vpu_io.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/vpu_io.c b/src/vpu_io.c
index fa0067f..7bafc02 100644
--- a/src/vpu_io.c
+++ b/src/vpu_io.c
@@ -52,38 +52,8 @@ int isVpuInitialized(void)
static int get_system_rev()
{
- FILE *fp;
- char buf[1024];
- int nread;
- char *tmp, *rev;
- int ret = -1;
-
- fp = fopen("/proc/cpuinfo", "r");
- if (fp == NULL) {
- perror("/proc/cpuinfo\n");
- return ret;
- }
-
- nread = fread(buf, 1, sizeof(buf), fp);
- fclose(fp);
- if ((nread == 0) || (nread == sizeof(buf))) {
- fclose(fp);
- return ret;
- }
-
- buf[nread] = '\0';
-
- tmp = strstr(buf, "Revision");
- if (tmp != NULL) {
- rev = index(tmp, ':');
- if (rev != NULL) {
- rev++;
- system_rev = strtoul(rev, NULL, 16);
- ret = 0;
- }
- }
-
- return ret;
+ system_rev = 0x27020;
+ return 0;
}
/* make consideration for both register and physical mem access */