display works sortof
[rpikern] / src / rpi.h
index 1ae7636..57a1cf7 100644 (file)
--- a/src/rpi.h
+++ b/src/rpi.h
@@ -12,6 +12,7 @@
 #define RPI_MBOX_PROP          8
 
 #define RPI_TAG_GETMODEL       0x010001
+#define RPI_TAG_GETREV         0x010002
 #define RPI_TAG_GETRAM         0x010005
 #define RPI_TAG_GETVRAM                0x010006
 #define RPI_TAG_SETCLOCK       0x038002
@@ -22,6 +23,9 @@
 #define RPI_TAG_SETFBPHYS      0x048003
 #define RPI_TAG_SETFBVIRT      0x048004
 #define RPI_TAG_SETFBDEPTH     0x048005
+#define RPI_TAG_GETFBPITCH     0x040008
+#define RPI_TAG_SETFBOFFS      0x048009
+#define RPI_TAG_GETFBOFFS      0x040009
 
 struct rpi_prop_header {
        uint32_t size;
@@ -38,7 +42,7 @@ struct rpi_prop {
 
 extern int rpi_model;
 extern uint32_t rpi_iobase;
-extern uint32_t rpi_memsize, rpi_vc_memsize;
+extern uint32_t rpi_mem_base, rpi_mem_size, rpi_vmem_base, rpi_vmem_size;
 
 void rpi_init(void);
 void rpi_reboot(void) __attribute__((noreturn));
@@ -47,4 +51,20 @@ void rpi_mbox_send(int chan, uint32_t msg);
 uint32_t rpi_mbox_recv(int chan);
 int rpi_mbox_pending(int chan);
 
+/* usage:
+ * rpi_prop(RPI_TAG_WHATEVER, foo, bar);
+ * rpi_prop(RPI_TAG_XYZZY, 42);
+ * if(rpi_prop_send() != -1) {
+ *     struct rpi_prop *prop;
+ *     while((prop = rpi_prop_next())) {
+ *         ... process response tags ...
+ *     }
+ * }
+ */
+void rpi_prop(int id, ...);
+int rpi_prop_send(void);
+struct rpi_prop *rpi_prop_next(void);
+/* find specific tag in response */
+struct rpi_prop *rpi_prop_find(int id);
+
 #endif /* RPI_H_ */