diff options
author | Luotao Fu <l.fu@pengutronix.de> | 2009-10-08 11:45:38 +0200 |
---|---|---|
committer | Luotao Fu <l.fu@pengutronix.de> | 2009-10-08 11:51:59 +0200 |
commit | cbae532eff2b9594dc22091a41cb5edfb5d538c5 (patch) | |
tree | a5bfac309a67c5c82707cd3d4936b0dbfa3a3cd5 | |
parent | f48407d946a902d4169b2ed7ed29be6e66b1e8fa (diff) | |
download | libfsl-vpu-cbae532eff2b9594dc22091a41cb5edfb5d538c5.tar.gz libfsl-vpu-cbae532eff2b9594dc22091a41cb5edfb5d538c5.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.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/src/vpu_io.c b/src/vpu_io.c index 5c8765c..d462106 100644 --- a/src/vpu_io.c +++ b/src/vpu_io.c @@ -54,38 +54,13 @@ 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; + /* FIXME: incredibly ugly hack. 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. */ + system_rev = 0x27020; + return 0; } /* make consideration for both register and physical mem access */ |