]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/vcore.c
devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround (thanks...
[plan9front.git] / sys / src / 9 / bcm / vcore.c
index 8ee811f8bd22443b4f743a956b0821d51fd683bf..2b82db238a73d791a1b6f1c4a4a19d2ad0335eb9 100644 (file)
@@ -33,6 +33,7 @@ enum {
        TagResp         = 1<<31,
 
        TagGetfwrev     = 0x00000001,
+       TagGetbrdrev    = 0x00010002,
        TagGetmac       = 0x00010003,
        TagGetram       = 0x00010005,
        TagGetpower     = 0x00020001,
@@ -261,6 +262,15 @@ getfirmware(void)
        return buf[0];
 }
 
+uint
+getrevision(void)
+{
+       u32int buf[1];
+       if(vcreq(TagGetbrdrev, buf, 0, sizeof buf) != sizeof buf)
+               return 0;
+       return buf[0];
+}
+
 /*
  * Get ARM ram
  */
@@ -288,3 +298,14 @@ getclkrate(int clkid)
                return 0;
        return buf[1];
 }
+
+uint
+gettemp(int tempid)
+{
+       u32int buf[2];
+       buf[0] = tempid;
+       if(vcreq(0x00030006, buf, sizeof(buf[0]), sizeof(buf)) != sizeof buf)
+               return 0;
+
+       return buf[1];
+}