Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / include / console / btext.h
1 /*
2  * This file describes the structure passed from the BootX application
3  * (for MacOS) when it is used to boot Linux.
4  *
5  * Written by Benjamin Herrenschmidt.
6  *
7  * Move to coreboot by LYH  yhlu@tyan.com
8  *
9  */
10
11
12 #ifndef _BTEXT_H__
13 #define _BTEXT_H__
14
15 #define u32 uint32_t
16 #define u16 uint16_t
17 #define u8 uint8_t
18
19 /* Here are the boot informations that are passed to the bootstrap
20  * Note that the kernel arguments and the device tree are appended
21  * at the end of this structure. */
22 typedef struct boot_infos
23 {
24
25     /* NEW (vers. 2) this holds the current _logical_ base addr of
26        the frame buffer (for use by early boot message) */
27     u8*       logicalDisplayBase;
28
29
30     /* Some infos about the current MacOS display */
31     u32       dispDeviceRect[4];       /* left,top,right,bottom */
32     u32       dispDeviceDepth;         /* (8, 16 or 32) */
33     u8*       dispDeviceBase;          /* base address (physical) */
34     u32       dispDeviceRowBytes;      /* rowbytes (in bytes) */
35     u32       dispDeviceColorsOffset;  /* Colormap (8 bits only) or 0 (*) */
36
37
38     /* The framebuffer size (optional, currently 0) */
39     u32       frameBufferSize;         /* Represents a max size, can be 0. */
40
41
42 } boot_infos_t;
43
44 /* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index is represented
45  * by 3 short words containing a 16 bits (unsigned) color component.
46  * Later versions may contain the gamma table for direct-color devices here.
47  */
48 #define BOOTX_COLORTABLE_SIZE    (256UL*3UL*2UL)
49
50
51 /*
52  * Definitions for using the procedures in btext.c.
53  *
54  * Benjamin Herrenschmidt <benh@kernel.crashing.org>
55  */
56
57 extern void btext_clearscreen(void);
58
59 extern boot_infos_t disp_bi;
60 extern u32 boot_text_mapped;
61
62 void btext_setup_display(u32 width, u32 height, u32 depth, u32 pitch,
63                          unsigned long address);
64 void map_boot_text(void);
65 void btext_update_display(unsigned long phys, u32 width, u32 height,
66                           u32 depth, u32 pitch);
67
68 void btext_drawchar(char c);
69 void btext_drawstring(const char *str);
70 void btext_drawhex(u32 v);
71
72 #endif /* _BTEXT_H */