Add lm32 cpu and milkymist port
[mw/micromonitor-lm32.git] / umon_ports / milkymist / vgafb.c
1 /*
2  * Author: Michael Walle <michael@walle.cc>
3  * License: Lucent Public License 1.02
4  */
5
6 #include "cpuio.h"
7 #include "config.h"
8 #include "stddefs.h"
9
10 #if INCLUDE_FBI
11
12 #define BPP 2
13 #define FB_SIZE (PIXELS_PER_COL * PIXELS_PER_ROW * BPP)
14
15 /* double buffering */
16 uchar vgafb_framebuffer[FB_SIZE*2] __attribute__((aligned(32)));
17
18 void fbdev_init(void) {
19         VGAFB_BASEADDRESS = (unsigned int)vgafb_framebuffer;
20         VGAFB_HRES = PIXELS_PER_ROW;
21         VGAFB_VRES = PIXELS_PER_COL;
22         VGAFB_CONTROL = 0;
23 }
24
25 void fbdev_setstart(long addr) {
26         /* The baseaddress has to be 32 byte aligned. For common screen
27          * resolutions this requirement is met if the addr points to the
28          * beginning of a row. */
29         VGAFB_BASEADDRESS = (unsigned int)addr;
30 }
31
32 #endif