7 #define RPI_MEM_BUS_COHERENT(addr) (((uint32_t)addr) | 0x40000000)
8 #define RPI_MEM_BUS_UNCACHED(addr) (((uint32_t)addr) | 0xc0000000)
11 #define RPI_MBOX_FRAMEBUF 1
12 #define RPI_MBOX_PROP 8
14 #define RPI_TAG_GETMODEL 0x010001
15 #define RPI_TAG_GETREV 0x010002
16 #define RPI_TAG_GETRAM 0x010005
17 #define RPI_TAG_GETVRAM 0x010006
18 #define RPI_TAG_SETCLOCK 0x038002
20 #define RPI_TAG_ALLOCFB 0x040001
21 #define RPI_TAG_RELEASEFB 0x048001
22 #define RPI_TAG_BLANKSCR 0x040002
23 #define RPI_TAG_SETFBPHYS 0x048003
24 #define RPI_TAG_SETFBVIRT 0x048004
25 #define RPI_TAG_SETFBDEPTH 0x048005
26 #define RPI_TAG_GETFBPITCH 0x040008
27 #define RPI_TAG_SETFBOFFS 0x048009
28 #define RPI_TAG_GETFBOFFS 0x040009
30 struct rpi_prop_header {
36 uint32_t id, size, res;
40 #define RPI_PROP_NEXT(p) \
41 ((struct rpi_prop*)((char*)((p) + 1) + ((p)->size - sizeof (p)->data)))
44 extern uint32_t rpi_iobase;
45 extern uint32_t rpi_mem_base, rpi_mem_size, rpi_vmem_base, rpi_vmem_size;
48 void rpi_reboot(void) __attribute__((noreturn));
50 void rpi_mbox_send(int chan, uint32_t msg);
51 uint32_t rpi_mbox_recv(int chan);
52 int rpi_mbox_pending(int chan);
55 * rpi_prop(RPI_TAG_WHATEVER, foo, bar);
56 * rpi_prop(RPI_TAG_XYZZY, 42);
57 * if(rpi_prop_send() != -1) {
58 * struct rpi_prop *prop;
59 * while((prop = rpi_prop_next())) {
60 * ... process response tags ...
64 void rpi_prop(int id, ...);
65 int rpi_prop_send(void);
66 struct rpi_prop *rpi_prop_next(void);
67 /* find specific tag in response */
68 struct rpi_prop *rpi_prop_find(int id);