diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-06-24 13:35:46 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-06-24 14:40:39 +0200 |
commit | 020bc4fc5ce93107c8e1bc731b9802cee56a123e (patch) | |
tree | 837b57abde1a80363f367166e52a2da8e4b03d52 | |
parent | af573dceef7b9a45d13192ec5abf29b73c78540e (diff) | |
download | seabios-020bc4fc5ce93107c8e1bc731b9802cee56a123e.tar.gz |
ati-vga: add rage128 edid support
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | vgasrc/atiext.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vgasrc/atiext.c b/vgasrc/atiext.c index 71dfa859..69dfd46e 100644 --- a/vgasrc/atiext.c +++ b/vgasrc/atiext.c @@ -21,6 +21,7 @@ #define CRTC_EXT_CNTL 0x0054 #define GPIO_VGA_DDC 0x0060 #define GPIO_DVI_DDC 0x0064 +#define GPIO_MONID 0x0068 #define CRTC_H_TOTAL_DISP 0x0200 #define CRTC_V_TOTAL_DISP 0x0208 #define CRTC_OFFSET 0x0224 @@ -47,6 +48,7 @@ static u32 ati_i2c_reg VAR16; static u32 ati_i2c_bit_scl_out VAR16; static u32 ati_i2c_bit_sda_out VAR16; static u32 ati_i2c_bit_sda_in VAR16; +static u32 ati_i2c_bit_enable VAR16 = -1; int @@ -208,8 +210,11 @@ ati_set_mode(struct vgamode_s *vmode_g, int flags) static void ati_i2c_set_scl_sda(int scl, int sda) { + u32 enable = GET_GLOBAL(ati_i2c_bit_enable); u32 data = 0; + if (enable != -1) + data |= (1 << enable); if (!scl) data |= (1 << GET_GLOBAL(ati_i2c_bit_scl_out)); if (!sda) @@ -316,6 +321,23 @@ static void ati_i2c_edid_radeon(void) dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid"); } +static void ati_i2c_edid_rage128(void) +{ + int valid; + + SET_VGA(ati_i2c_bit_enable, 25); + SET_VGA(ati_i2c_bit_scl_out, 18); + SET_VGA(ati_i2c_bit_sda_out, 17); + SET_VGA(ati_i2c_bit_sda_in, 9); + SET_VGA(ati_i2c_reg, GPIO_MONID); + + dprintf(1, "ati: reading edid blob (rage128) ... \n"); + ati_i2c_edid(); + valid = (GET_GLOBAL(VBE_edid[0]) == 0x00 && + GET_GLOBAL(VBE_edid[1]) == 0xff); + dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid"); +} + /**************************************************************** * init ****************************************************************/ @@ -379,6 +401,9 @@ ati_setup(void) u16 device = pci_config_readw(bdf, PCI_DEVICE_ID); switch (device) { + case 0x5046: + ati_i2c_edid_rage128(); + break; case 0x5159: ati_i2c_edid_radeon(); break; |