This commit just simplifies some code.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 48 +++++++++--------------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 5c6caf0..4e3d912 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -52,37 +52,6 @@ static void geode_msrWrite(u32 msrAddr,u32 andhi, u32 andlo, u32 orhi, u32 orlo) ); }
-static u32 geode_memRead(u32 addr) -{ - u32 val; - asm __volatile__ ( - "movw $0x0AC1C, %%dx \n" - "movl $0xFC530001, %%eax \n" - "outl %%eax, %%dx \n" - "addb $2, %%dl \n" - "inw %%dx, %%ax \n" - : "=a" (val) - : "b"(addr) - : "cc" - ); - - return val; -} - -static void geode_memWrite(u32 addr, u32 and, u32 or ) -{ - asm __volatile__ ( - "movw $0x0AC1C, %%dx \n" - "movl $0xFC530001, %%eax \n" - "outl %%eax, %%dx \n" - "addb $2, %%dl \n" - "outw %%ax, %%dx \n" - : - : "b"(addr), "S" (and), "D" (or) - : "%eax","cc" - ); -} - static int legacyio_check(void) { int ret=0; @@ -249,7 +218,8 @@ static int dc_setup(void) */ int vp_setup(void) { - u32 reg,vp; + u32 reg; + void *vp;
dprintf(2,"VP_SETUP\n"); /* set output to crt and RGB/YUV */ @@ -259,23 +229,23 @@ int vp_setup(void) geode_msrWrite(VP_MSR_CONFIG_LX, ~0, ~0xf8, 0, 0);
/* get vp register base from pci */ - vp = pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_3); + vp = (void *)pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_3);
/* Set mmio registers * there may be some timing issues here, the reads seem * to slow things down enough work reliably */
- reg = geode_memRead(vp+VP_MISC); + reg = readl(vp+VP_MISC); dprintf(1,"VP_SETUP VP_MISC=0x%08x\n",reg); - geode_memWrite(vp+VP_MISC,0,VP_BYP_BOTH); - reg = geode_memRead(vp+VP_MISC); + writel(vp+VP_MISC,VP_BYP_BOTH); + reg = readl(vp+VP_MISC); dprintf(1,"VP_SETUP VP_MISC=0x%08x\n",reg);
- reg = geode_memRead(vp+VP_DCFG); + reg = readl(vp+VP_DCFG); dprintf(1,"VP_SETUP VP_DCFG=0x%08x\n",reg); - geode_memWrite(vp+VP_DCFG, ~0,VP_CRT_EN+VP_HSYNC_EN+VP_VSYNC_EN+VP_DAC_BL_EN+VP_CRT_SKEW); - reg = geode_memRead(vp+VP_DCFG); + writel(vp+VP_DCFG,VP_CRT_EN+VP_HSYNC_EN+VP_VSYNC_EN+VP_DAC_BL_EN+VP_CRT_SKEW); + reg = readl(vp+VP_DCFG); dprintf(1,"VP_SETUP VP_DCFG=0x%08x\n",reg);
return 0;