2011-10-12 23:25:07 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (c) 2004, 2008 IBM Corporation
|
|
|
|
* Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
|
|
|
|
* All rights reserved.
|
|
|
|
* This program and the accompanying materials
|
|
|
|
* are made available under the terms of the BSD License
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.opensource.org/licenses/bsd-license.php
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial implementation
|
|
|
|
*****************************************************************************/
|
2013-04-23 19:59:11 +02:00
|
|
|
#ifndef VBE_H
|
|
|
|
#define VBE_H
|
2011-10-12 23:25:07 +02:00
|
|
|
|
2013-04-23 19:59:11 +02:00
|
|
|
#include <boot/coreboot_tables.h>
|
2011-10-12 23:25:07 +02:00
|
|
|
// these structs are for input from and output to OF
|
|
|
|
typedef struct {
|
2016-09-16 20:17:40 +02:00
|
|
|
u8 display_type; // 0 = NONE, 1 = analog, 2 = digital
|
2011-10-12 23:25:07 +02:00
|
|
|
u16 screen_width;
|
|
|
|
u16 screen_height;
|
|
|
|
u16 screen_linebytes; // bytes per line in framebuffer, may be more than screen_width
|
intel/gma: Clarify code and use dedicated init for Google Peppy
Peppy had some issues with FUI. We decided it was time to create
peppy-specific gma.c and i915io.c files. Using yabel and the i915tool,
we generated a replay attack, then interpolated against the slippy
i915io.c to get something working.
Also, in preparation for moving code out of the mainboard gma.c to
generic driver code, we got rid of some hardcodes in the mainboard
gma.c that have no business being there. The worst were the
computation of gmch_[m,n] and it turns out that we had some
long-standing bugs related to confusion about 'bpp'. I've killed the
word bpp everywhere I could because there are at least 3 things that
correspond to bpp. We now have framebuffer, pipe, and panel bpp. The
names are long because I want to avoid all the mistakes we've all been
making in the last year :-) Sadly, that means a lot of changes not just
peppy-related, but they are simple and in a good cause.
The test pattern generation is driven by a global variable in
mainboard/peppy/gma.c. I've found in the past that it's very useful
to have a function like this available, as one can activate it while
using a jtag debugger: halt at the right place in ramstage, set the
variable to 1, continue. It's not enough code to worry about always
including.
The last hard-codes for M and N registers are gone, and the function
to set from generic intel_dp.c code works. To avoid screen trash on a
dev mode boot, which we liked but nobody else did :-), we now take the
time to put a pleasing background color that sort of doubles as a
power LED.
Rough timing is ramstage start is at 2.2, and dev setup is done at
3.3. These new platforms are depressingly slow to boot. Rom init alone
is taking 1.9 seconds. 13 years ago it was 3 seconds from power on to bash
prompt. These CPUs are at least 10x faster and take much longer to get going.
Future work, once we get this through, is to move more functions to the
intel driver, and combine the mainboard i915io.c into the mainboard gma.c.
That separation only existed because i915io.c was generated by a tool, and it
had lots of ugliness. Most ugliness is gone.
Old-Change-Id: I6a6295b423a41e263f82cef33eacb92a14163321
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/170013
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-by: Furquan Shaikh <furquan.m.shaikh@gmail.com>
(cherry picked from commit 8cdaf73e3602e15925859866714db4d5ec6c947d)
snow: Fix a typo in devicetree.cb that was breaking the snow build.
A typo in a recent change broke the snow build.
Old-Change-Id: I93074e68eb3d21510d974fd8e9c63b3947285afd
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/171014
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
(cherry picked from commit 154876c126a6690930141df178485658533096d2)
Squashed a fix into the initial patch and updated nehalem/gma.c
to have a non-static gtt_poll.
Change-Id: I2f4342c610d87335411da1d6d405171dc80c1f14
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6657
Tested-by: build bot (Jenkins)
2013-09-20 01:45:22 +02:00
|
|
|
u8 color_depth; // color depth in bits per pixel
|
2011-10-12 23:25:07 +02:00
|
|
|
u32 framebuffer_address;
|
|
|
|
u8 edid_block_zero[128];
|
|
|
|
} __attribute__ ((__packed__)) screen_info_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u8 signature[4];
|
|
|
|
u16 size_reserved;
|
|
|
|
u8 monitor_number;
|
|
|
|
u16 max_screen_width;
|
|
|
|
u8 color_depth;
|
|
|
|
} __attribute__ ((__packed__)) screen_info_input_t;
|
|
|
|
|
|
|
|
// these structs only store a subset of the VBE defined fields
|
|
|
|
// only those needed.
|
|
|
|
typedef struct {
|
|
|
|
char signature[4];
|
|
|
|
u16 version;
|
|
|
|
u8 *oem_string_ptr;
|
|
|
|
u32 capabilities;
|
|
|
|
u16 video_mode_list[256]; // lets hope we never have more than 256 video modes...
|
|
|
|
u16 total_memory;
|
|
|
|
} vbe_info_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u16 mode_attributes; // 00
|
|
|
|
u8 win_a_attributes; // 02
|
|
|
|
u8 win_b_attributes; // 03
|
|
|
|
u16 win_granularity; // 04
|
|
|
|
u16 win_size; // 06
|
|
|
|
u16 win_a_segment; // 08
|
|
|
|
u16 win_b_segment; // 0a
|
|
|
|
u32 win_func_ptr; // 0c
|
|
|
|
u16 bytes_per_scanline; // 10
|
|
|
|
u16 x_resolution; // 12
|
|
|
|
u16 y_resolution; // 14
|
|
|
|
u8 x_charsize; // 16
|
|
|
|
u8 y_charsize; // 17
|
|
|
|
u8 number_of_planes; // 18
|
|
|
|
u8 bits_per_pixel; // 19
|
|
|
|
u8 number_of_banks; // 20
|
|
|
|
u8 memory_model; // 21
|
|
|
|
u8 bank_size; // 22
|
|
|
|
u8 number_of_image_pages; // 23
|
|
|
|
u8 reserved_page;
|
|
|
|
u8 red_mask_size;
|
|
|
|
u8 red_mask_pos;
|
|
|
|
u8 green_mask_size;
|
|
|
|
u8 green_mask_pos;
|
|
|
|
u8 blue_mask_size;
|
|
|
|
u8 blue_mask_pos;
|
|
|
|
u8 reserved_mask_size;
|
|
|
|
u8 reserved_mask_pos;
|
|
|
|
u8 direct_color_mode_info;
|
|
|
|
u32 phys_base_ptr;
|
|
|
|
u32 offscreen_mem_offset;
|
|
|
|
u16 offscreen_mem_size;
|
|
|
|
u8 reserved[206];
|
|
|
|
} __attribute__ ((__packed__)) vesa_mode_info_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u16 video_mode;
|
|
|
|
union {
|
|
|
|
vesa_mode_info_t vesa;
|
|
|
|
u8 mode_info_block[256];
|
|
|
|
};
|
|
|
|
// our crap
|
|
|
|
//u16 attributes;
|
|
|
|
//u16 linebytes;
|
|
|
|
//u16 x_resolution;
|
|
|
|
//u16 y_resolution;
|
|
|
|
//u8 x_charsize;
|
|
|
|
//u8 y_charsize;
|
|
|
|
//u8 bits_per_pixel;
|
|
|
|
//u8 memory_model;
|
|
|
|
//u32 framebuffer_address;
|
|
|
|
} vbe_mode_info_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u8 port_number; // i.e. monitor number
|
|
|
|
u8 edid_transfer_time;
|
|
|
|
u8 ddc_level;
|
|
|
|
u8 edid_block_zero[128];
|
|
|
|
} vbe_ddc_info_t;
|
|
|
|
|
2011-10-12 23:30:59 +02:00
|
|
|
#define VESA_GET_INFO 0x4f00
|
|
|
|
#define VESA_GET_MODE_INFO 0x4f01
|
|
|
|
#define VESA_SET_MODE 0x4f02
|
2011-10-12 23:25:07 +02:00
|
|
|
|
2013-04-23 19:59:11 +02:00
|
|
|
int vbe_mode_info_valid(void);
|
|
|
|
void fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
|
|
|
|
void vbe_set_graphics(void);
|
|
|
|
void vbe_textmode_console(void);
|
|
|
|
|
|
|
|
#endif // VBE_H
|