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
29 /* NOTE: for every new tag added, a new entry needs to be added to the tag
30 * buffer size struct in rpi.c
33 struct rpi_prop_header {
39 uint32_t id, size, res;
43 #define RPI_PROP_NEXT(p) \
44 ((struct rpi_prop*)((char*)((p) + 1) + ((p)->size - sizeof (p)->data)))
47 extern uint32_t rpi_iobase;
48 extern uint32_t rpi_mem_base, rpi_mem_size, rpi_vmem_base, rpi_vmem_size;
51 void rpi_reboot(void) __attribute__((noreturn));
53 void rpi_mbox_send(int chan, uint32_t msg);
54 uint32_t rpi_mbox_recv(int chan);
55 int rpi_mbox_pending(int chan);
58 * rpi_prop(RPI_TAG_WHATEVER, foo, bar);
59 * rpi_prop(RPI_TAG_XYZZY, 42);
60 * if(rpi_prop_send() != -1) {
61 * struct rpi_prop *prop;
62 * while((prop = rpi_prop_next())) {
63 * ... process response tags ...
67 void rpi_prop(int id, ...);
68 int rpi_prop_send(void);
69 struct rpi_prop *rpi_prop_next(void);
70 /* find specific tag in response */
71 struct rpi_prop *rpi_prop_find(int id);