// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "geodevga.h" // geodevga_init
-#include "ioport.h" // outb
#include "farptr.h" // SET_FARVAR
#include "biosvar.h" // GET_BDA
#include "vgabios.h" // VGAREG_*
#include "util.h" // memset
#include "stdvga.h" // stdvga_crtc_write
+#include "pci.h" // pci_config_readl
+#include "pci_regs.h" // PCI_BASE_ADDRESS_0
/****************************************************************
/* read fb-bar from pci, then point dc to the fb base */
dc_fb = dc_read(seg,DC_GLIU0_MEM_OFFSET);
- outl(GEODE_PCI_FB,PORT_PCI_CMD);
- fb = inl(PORT_PCI_DATA);
+ fb = pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0);
if (fb!=dc_fb) {
dc_write(seg,DC_GLIU0_MEM_OFFSET,fb);
}
dprintf(2,"VP_SETUP\n");
/* set output to crt and RGB/YUV */
if (CONFIG_VGA_GEODEGX2)
- geode_msrWrite(VP_MSR_CONFIG_GX2,~0 ,~0xf8,0,0);
+ geode_msrWrite(VP_MSR_CONFIG_GX2, ~0, ~0xf8, 0, 0);
else
- geode_msrWrite(VP_MSR_CONFIG_LX,~0 ,~0xf8,0,0);
+ geode_msrWrite(VP_MSR_CONFIG_LX, ~0, ~0xf8, 0, 0);
/* get vp register base from pci */
- outl(GEODE_PCI_VP,PORT_PCI_CMD);
- vp = inl(PORT_PCI_DATA);
+ vp = pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_3);
/* Set mmio registers
* there may be some timing issues here, the reads seem
#define OEM_BAR2 0x58
#define OEM_BAR3 0x5C
-#define GEODE_PCI_ADDR 0x80000900
-#define GEODE_PCI_CMD (GEODE_PCI_ADDR + 0x04)
-#define GEODE_PCI_FB (GEODE_PCI_ADDR + 0x10)
-#define GEODE_PCI_DC (GEODE_PCI_ADDR + 0x18)
-#define GEODE_PCI_VP (GEODE_PCI_ADDR + 0x1c)
-
#define DC_LOCK_LOCK 0x00000000
#define DC_LOCK_UNLOCK 0x00004758