From: John Hodge (sonata) Date: Sun, 20 Jan 2013 06:32:14 +0000 (+0800) Subject: Modules/RPiDisplay - Commiting non-compiled code X-Git-Tag: rel0.15~598^2~15 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=700377afe01dab774d82c2fa7d121d76fb347d12;p=tpg%2Facess2.git Modules/RPiDisplay - Commiting non-compiled code --- diff --git a/KernelLand/Modules/Display/RPi/main.c b/KernelLand/Modules/Display/RPi/main.c new file mode 100644 index 00000000..a0df9031 --- /dev/null +++ b/KernelLand/Modules/Display/RPi/main.c @@ -0,0 +1,61 @@ +/** + * Acess2 Raspberry Pi (BCM2835) + * - By John Hodge (thePowersGang) + * + * main.c + * - Driver core + * + * http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/screen01.html + */ +#define DEBUG 0 +#define VERSION ((0<<8)|1) +#include +#include +#include +#include +#include +#include +#include + +// === PROTOCOLS === + int RPiVid_Install(const char **Arguments); +// - GPU Communication + int RPiVid_int_MBoxCheck(Uint8 Box); +Uint32 RPiVid_int_MBoxRecv(Uint8 Box); +void RPiVid_int_MBoxSend(Uint8 Box, Uint32 Message); + +// === GLOBALS === +MODULE_DEFINE(0, VERSION, RPiVid, RPiVid_Install, NULL, NULL); + +// === CODE === +int RPiVid_Install(const char **Arguments) +{ + return 0; +} + + +// --- GPU Comms --- +int RPiVid_int_MBoxCheck(Uint8 Box) +{ + return 0; +} + +Uint32 RPiVid_int_MBoxRecv(Uint8 Box) +{ + Uint32 val; + do { + while( gRPiVid_Mbox->Status & (1 << 30) ) + ; + val = gRPiVid_Mbox->Read; + } while( (val & 0xF) != Box ); + + return 0; +} + +void RPiVid_int_MBoxSend(Uint8 Box, Uint32 Message) +{ + while( gRPiVid_Mbox.Status & (1 << 31) ) + ; + gRPiVid_Mbox.Write = (Message << 4) | (Box & 0xF); +} +