summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm/vcore.c
diff options
context:
space:
mode:
authorMatthew Veety <mveety@gmail.com>2014-05-16 10:56:23 -0400
committerMatthew Veety <mveety@gmail.com>2014-05-16 10:56:23 -0400
commiteb687adecd365876d6b6918a9ee4f8e8e7f205f6 (patch)
treea8fd746c6a889841a955e166224fc247b4e077d1 /sys/src/9/bcm/vcore.c
parent88c998b2650d684086faca8e65f9b2f67c764b47 (diff)
added devgpio (thanks Krystian!). Also added getrevision() to vcore which allows you to get the raspberry pi board revision. I kept in the segment that allows direct access to the gpio memory
Diffstat (limited to 'sys/src/9/bcm/vcore.c')
-rw-r--r--sys/src/9/bcm/vcore.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/src/9/bcm/vcore.c b/sys/src/9/bcm/vcore.c
index d4d52d6dc..2b82db238 100644
--- a/sys/src/9/bcm/vcore.c
+++ b/sys/src/9/bcm/vcore.c
@@ -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
*/