nb/intel/*/gma.c: Use macros for GMBUS numbers
Change-Id: I885b6bd9f5be6b4e3696a530016123a3e81c4b10
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/20889
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
index 2404671..00b3fa0 100644
--- a/src/northbridge/intel/gm45/gma.c
+++ b/src/northbridge/intel/gm45/gma.c
@@ -588,8 +588,8 @@
mmio = res2mmio(gtt_res, 0, 0);
printk(BIOS_DEBUG, "VGA EDID\n");
- intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, edid_data_vga,
- sizeof(edid_data_vga));
+ intel_gmbus_read_edid(mmio + GMBUS0, GMBUS_PORT_VGADDC, 0x50,
+ edid_data_vga, sizeof(edid_data_vga));
intel_gmbus_stop(mmio + GMBUS0);
vga_edid_status = decode_edid(edid_data_vga,
sizeof(edid_data_vga), &edid_vga);
@@ -748,8 +748,8 @@
}
printk(BIOS_DEBUG, "LVDS EDID\n");
- intel_gmbus_read_edid(mmio + GMBUS0, 3, 0x50, edid_data_lvds,
- sizeof(edid_data_lvds));
+ intel_gmbus_read_edid(mmio + GMBUS0, GMBUS_PORT_PANEL, 0x50,
+ edid_data_lvds, sizeof(edid_data_lvds));
intel_gmbus_stop(mmio + GMBUS0);
decode_edid(edid_data_lvds, sizeof(edid_data_lvds), &edid_lvds);
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index cba2860..37f73ed 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -104,8 +104,8 @@
"i915lightup: graphics %p mmio %p addrport %04x physbase %08x\n",
(void *)pgfx, mmiobase, piobase, pphysbase);
- intel_gmbus_read_edid(mmiobase + GMBUS0, 3, 0x50, edid_data,
- sizeof(edid_data));
+ intel_gmbus_read_edid(mmiobase + GMBUS0, GMBUS_PORT_PANEL, 0x50,
+ edid_data, sizeof(edid_data));
decode_edid(edid_data, sizeof(edid_data), &edid);
mode = &edid.mode;
@@ -663,7 +663,8 @@
/* probe if VGA is connected and always run */
/* VGA init if no LVDS is connected */
- if (!probe_edid(mmiobase, 3) || probe_edid(mmiobase, 2))
+ if (!probe_edid(mmiobase, GMBUS_PORT_PANEL) ||
+ probe_edid(mmiobase, GMBUS_PORT_VGADDC))
err = intel_gma_init_vga(conf,
pci_read_config32(dev, 0x5c) & ~0xf,
iobase, mmiobase, graphics_base);
diff --git a/src/northbridge/intel/nehalem/gma.c b/src/northbridge/intel/nehalem/gma.c
index 0607f34..56d8523 100644
--- a/src/northbridge/intel/nehalem/gma.c
+++ b/src/northbridge/intel/nehalem/gma.c
@@ -712,8 +712,8 @@
power_port(mmio);
- intel_gmbus_read_edid(mmio + PCH_GMBUS0, 3, 0x50, edid_data,
- sizeof(edid_data));
+ intel_gmbus_read_edid(mmio + PCH_GMBUS0, GMBUS_PORT_PANEL, 0x50,
+ edid_data, sizeof(edid_data));
intel_gmbus_stop(mmio + PCH_GMBUS0);
decode_edid(edid_data,
sizeof(edid_data), &edid);
diff --git a/src/northbridge/intel/sandybridge/gma_ivybridge_lvds.c b/src/northbridge/intel/sandybridge/gma_ivybridge_lvds.c
index cad5078..23ecd44 100644
--- a/src/northbridge/intel/sandybridge/gma_ivybridge_lvds.c
+++ b/src/northbridge/intel/sandybridge/gma_ivybridge_lvds.c
@@ -182,8 +182,8 @@
enable_port(mmio);
- intel_gmbus_read_edid(mmio + PCH_GMBUS0, 3, 0x50, edid_data,
- sizeof(edid_data));
+ intel_gmbus_read_edid(mmio + PCH_GMBUS0, GMBUS_PORT_PANEL, 0x50,
+ edid_data, sizeof(edid_data));
intel_gmbus_stop(mmio + PCH_GMBUS0);
decode_edid(edid_data,
sizeof(edid_data), &edid);
diff --git a/src/northbridge/intel/sandybridge/gma_sandybridge_lvds.c b/src/northbridge/intel/sandybridge/gma_sandybridge_lvds.c
index c3139a9..5e8c188 100644
--- a/src/northbridge/intel/sandybridge/gma_sandybridge_lvds.c
+++ b/src/northbridge/intel/sandybridge/gma_sandybridge_lvds.c
@@ -176,8 +176,8 @@
power_port(mmio);
- intel_gmbus_read_edid(mmio + PCH_GMBUS0, 3, 0x50, edid_data,
- sizeof(edid_data));
+ intel_gmbus_read_edid(mmio + PCH_GMBUS0, GMBUS_PORT_PANEL, 0x50,
+ edid_data, sizeof(edid_data));
decode_edid(edid_data, sizeof(edid_data), &edid);
mode = &edid.mode;
diff --git a/src/northbridge/intel/x4x/gma.c b/src/northbridge/intel/x4x/gma.c
index 561e776..e91d778 100644
--- a/src/northbridge/intel/x4x/gma.c
+++ b/src/northbridge/intel/x4x/gma.c
@@ -113,7 +113,7 @@
udelay(1);
- intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, edid_data,
+ intel_gmbus_read_edid(mmio + GMBUS0, GMBUS_PORT_VGADDC, 0x50, edid_data,
sizeof(edid_data));
intel_gmbus_stop(mmio + GMBUS0);
decode_edid(edid_data,