1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /******************************************************************************
3 * Copyright (c) 2004, 2008 IBM Corporation
4 * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
8 * IBM Corporation - initial implementation
9 *****************************************************************************/
13 /* these structs are for input from and output to OF */
14 struct __packed vbe_screen_info {
15 u8 display_type; /* 0=NONE, 1= analog, 2=digital */
18 /* bytes per line in framebuffer, may be more than screen_width */
20 u8 color_depth; /* color depth in bits per pixel */
21 u32 framebuffer_address;
22 u8 edid_block_zero[128];
25 struct __packed vbe_screen_info_input {
33 /* these structs only store the required a subset of the VBE-defined fields */
34 struct __packed vbe_info {
47 struct __packed vesa_mode_info {
48 u16 mode_attributes; /* 00 */
49 u8 win_a_attributes; /* 02 */
50 u8 win_b_attributes; /* 03 */
51 u16 win_granularity; /* 04 */
52 u16 win_size; /* 06 */
53 u16 win_a_segment; /* 08 */
54 u16 win_b_segment; /* 0a */
55 u32 win_func_ptr; /* 0c */
56 u16 bytes_per_scanline; /* 10 */
57 u16 x_resolution; /* 12 */
58 u16 y_resolution; /* 14 */
59 u8 x_charsize; /* 16 */
60 u8 y_charsize; /* 17 */
61 u8 number_of_planes; /* 18 */
62 u8 bits_per_pixel; /* 19 */
63 u8 number_of_banks; /* 20 */
64 u8 memory_model; /* 21 */
65 u8 bank_size; /* 22 */
66 u8 number_of_image_pages; /* 23 */
74 u8 reserved_mask_size;
76 u8 direct_color_mode_info;
78 u32 offscreen_mem_offset;
79 u16 offscreen_mem_size;
83 struct vbe_mode_info {
87 struct vesa_mode_info vesa;
88 u8 mode_info_block[256];
93 u8 port_number; /* i.e. monitor number */
94 u8 edid_transfer_time;
96 u8 edid_block_zero[128];
99 #define VESA_GET_INFO 0x4f00
100 #define VESA_GET_MODE_INFO 0x4f01
101 #define VESA_SET_MODE 0x4f02
102 #define VESA_GET_CUR_MODE 0x4f03
104 extern struct vbe_mode_info mode_info;
107 struct video_uc_plat;
108 int vbe_setup_video_priv(struct vesa_mode_info *vesa,
109 struct video_priv *uc_priv,
110 struct video_uc_plat *plat);
111 int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void));