intel i945: Fix native VGA initialization
Native VGA init no longer compiles from commit:
* 7dbf9c6
edid: Use edid_mode struct to reduce redundancy
Tested on a single X60 machine.
This patch basically copies 11491 which does
the same for north/intel/sandybridge.
Change-Id: I0663f3b423624c67c2388a9cc44ec41f370f4a17
Signed-off-by: Axel Holewa <mono-for-coreboot@donderklumpen.de>
Reviewed-on: http://review.coreboot.org/11585
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
parent
c241855240
commit
2e4f83b164
|
@ -85,6 +85,7 @@ static int intel_gma_init(struct northbridge_intel_i945_config *conf,
|
||||||
void *pmmio, unsigned int pgfx)
|
void *pmmio, unsigned int pgfx)
|
||||||
{
|
{
|
||||||
struct edid edid;
|
struct edid edid;
|
||||||
|
struct edid_mode *mode;
|
||||||
u8 edid_data[128];
|
u8 edid_data[128];
|
||||||
unsigned long temp;
|
unsigned long temp;
|
||||||
int hpolarity, vpolarity;
|
int hpolarity, vpolarity;
|
||||||
|
@ -107,19 +108,20 @@ static int intel_gma_init(struct northbridge_intel_i945_config *conf,
|
||||||
|
|
||||||
intel_gmbus_read_edid(pmmio + GMBUS0, 3, 0x50, edid_data, 128);
|
intel_gmbus_read_edid(pmmio + GMBUS0, 3, 0x50, edid_data, 128);
|
||||||
decode_edid(edid_data, sizeof(edid_data), &edid);
|
decode_edid(edid_data, sizeof(edid_data), &edid);
|
||||||
|
mode = &edid.mode;
|
||||||
|
|
||||||
hpolarity = (edid.phsync == '-');
|
hpolarity = (mode->phsync == '-');
|
||||||
vpolarity = (edid.pvsync == '-');
|
vpolarity = (mode->pvsync == '-');
|
||||||
hactive = edid.x_resolution;
|
hactive = edid.x_resolution;
|
||||||
vactive = edid.y_resolution;
|
vactive = edid.y_resolution;
|
||||||
right_border = edid.hborder;
|
right_border = mode->hborder;
|
||||||
bottom_border = edid.vborder;
|
bottom_border = mode->vborder;
|
||||||
vblank = edid.vbl;
|
vblank = mode->vbl;
|
||||||
hblank = edid.hbl;
|
hblank = mode->hbl;
|
||||||
vsync = edid.vspw;
|
vsync = mode->vspw;
|
||||||
hsync = edid.hspw;
|
hsync = mode->hspw;
|
||||||
hfront_porch = edid.hso;
|
hfront_porch = mode->hso;
|
||||||
vfront_porch = edid.vso;
|
vfront_porch = mode->vso;
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
for (j = 0; j < 0x100; j++)
|
for (j = 0; j < 0x100; j++)
|
||||||
|
@ -160,8 +162,8 @@ static int intel_gma_init(struct northbridge_intel_i945_config *conf,
|
||||||
write32(pmmio + PORT_HOTPLUG_EN, conf->gpu_hotplug);
|
write32(pmmio + PORT_HOTPLUG_EN, conf->gpu_hotplug);
|
||||||
write32(pmmio + INSTPM, 0x08000000 | INSTPM_AGPBUSY_DIS);
|
write32(pmmio + INSTPM, 0x08000000 | INSTPM_AGPBUSY_DIS);
|
||||||
|
|
||||||
target_frequency = conf->gpu_lvds_is_dual_channel ? edid.pixel_clock
|
target_frequency = conf->gpu_lvds_is_dual_channel ? mode->pixel_clock
|
||||||
: (2 * edid.pixel_clock);
|
: (2 * mode->pixel_clock);
|
||||||
|
|
||||||
/* Find suitable divisors. */
|
/* Find suitable divisors. */
|
||||||
for (candp1 = 1; candp1 <= 8; candp1++) {
|
for (candp1 = 1; candp1 <= 8; candp1++) {
|
||||||
|
|
Loading…
Reference in New Issue