diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2012-09-01 17:12:52 +0200 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-09-03 12:04:55 -0400 |
commit | c13c181a9d1a8095433471309410f01a80141966 (patch) | |
tree | a25d0a1a23e2a7a7fbfaaf349332fb50cb80a5b3 /vgasrc/geodevga.c | |
parent | 4540409d19a4baeec5006d925cfca19f8038a96e (diff) | |
download | seabios-hppa-c13c181a9d1a8095433471309410f01a80141966.zip seabios-hppa-c13c181a9d1a8095433471309410f01a80141966.tar.gz seabios-hppa-c13c181a9d1a8095433471309410f01a80141966.tar.bz2 |
Access DC registers via geode_mem[Read|Write]
There is no reason to access the DC registers via VGA
memory mapping if we could the access via memory.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'vgasrc/geodevga.c')
-rw-r--r-- | vgasrc/geodevga.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 5c6caf0..8ce9ed1 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -206,37 +206,33 @@ static void dc_unmap(void) ****************************************************************/ /* Set up the dc (display controller) portion of the geodelx -* The dc provides hardware support for VGA graphics -* for features not accessible from the VGA registers, -* the dc's pci bar can be mapped to a vga memory segment +* The dc provides hardware support for VGA graphics. */ static int dc_setup(void) { - u32 fb, dc_fb; - u16 seg; + u32 fb, dc_fb, dc_base; dprintf(2, "DC_SETUP\n"); - seg = dc_map(SEG_GRAPH); - dc_unlock(seg); + dc_base = pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_2); + geode_memWrite(dc_base + DC_UNLOCK, 0x0, DC_LOCK_UNLOCK); /* zero memory config */ - dc_write(seg,DC_FB_ST_OFFSET,0x0); - dc_write(seg,DC_CB_ST_OFFSET,0x0); - dc_write(seg,DC_CURS_ST_OFFSET,0x0); + geode_memWrite(dc_base + DC_FB_ST_OFFSET, 0x0, 0x0); + geode_memWrite(dc_base + DC_CB_ST_OFFSET, 0x0, 0x0); + geode_memWrite(dc_base + DC_CURS_ST_OFFSET, 0x0, 0x0); /* read fb-bar from pci, then point dc to the fb base */ - dc_fb = dc_read(seg,DC_GLIU0_MEM_OFFSET); + dc_fb = geode_memRead(dc_base + DC_GLIU0_MEM_OFFSET); fb = pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0); if (fb!=dc_fb) { - dc_write(seg,DC_GLIU0_MEM_OFFSET,fb); + geode_memWrite(dc_base + DC_GLIU0_MEM_OFFSET, 0x0, fb); } - dc_set(seg,DC_DISPLAY_CFG,DC_CFG_MSK,DC_GDEN+DC_TRUP); - dc_set(seg,DC_GENERAL_CFG,0,DC_VGAE); + geode_memWrite(dc_base + DC_DISPLAY_CFG, DC_CFG_MSK, DC_GDEN+DC_TRUP); + geode_memWrite(dc_base + DC_GENERAL_CFG, 0, DC_VGAE); - dc_lock(seg); - dc_unmap(); + geode_memWrite(dc_base + DC_UNLOCK, 0x0, DC_LOCK_LOCK); return 0; } |