From 734daf699ceb8603f53003ab36eb85b8a76e3cf9 Mon Sep 17 00:00:00 2001 From: Marc Jones Date: Fri, 4 May 2007 18:58:42 +0000 Subject: This patch adds support for the northbridge integrated into the AMD Geode LX platform, including memory and graphics. (rediffed for whitespace) Signed-off-by: Marc Jones Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2630 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/lx/grphinit.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'src/northbridge/amd/lx/grphinit.c') diff --git a/src/northbridge/amd/lx/grphinit.c b/src/northbridge/amd/lx/grphinit.c index af9e9fef42..038ee8d532 100644 --- a/src/northbridge/amd/lx/grphinit.c +++ b/src/northbridge/amd/lx/grphinit.c @@ -1,33 +1,16 @@ +/* +* +* Copyright (C) 2007 Advanced Micro Devices +* +*/ + #include #include #include #include -/* - * Write to a Virtual Register - * AX = Class/Index - * CX = data to write - */ -void vrWrite(uint16_t wClassIndex, uint16_t wData) -{ - outl(((uint32_t) VR_UNLOCK << 16) | wClassIndex, VRC_INDEX); - outw(wData, VRC_DATA); -} /* - * Read from a Virtual Register - * AX = Class/Index - * Returns a 16-bit word of data - */ -uint16_t vrRead(uint16_t wClassIndex) -{ - uint16_t wData; - outl(((uint32_t) VR_UNLOCK << 16) | wClassIndex, VRC_INDEX); - wData = inw(VRC_DATA); - return wData; -} - -/* * This function mirrors the Graphics_Init routine in GeodeROM. */ void graphics_init(void) @@ -40,7 +23,7 @@ void graphics_init(void) /* Call SoftVG with the main configuration parameters. */ /* NOTE: SoftVG expects the memory size to be given in 2MB blocks */ - wClassIndex = (VRC_VG << 8) + VG_MEM_SIZE; + wClassIndex = (VRC_VG << 8) + VG_CONFIG; /* * Graphics Driver Enabled (13) 0, NO (lets BIOS controls the GP) @@ -52,12 +35,12 @@ void graphics_init(void) * PLL Reference Clock Bypass(0) 0, Default */ - /* video RAM has to be given in 2MB chunks + /* Video RAM has to be given in 2MB chunks * the value is read @ 7:1 (value in 7:0 looks like /2) * so we can add the real value in megabytes */ - wData = 0x0800 | (CONFIG_VIDEO_MB & VG_MEM_MASK); + wData = VG_CFG_DRIVER | VG_CFG_PRIORITY | VG_CFG_DSCRT | (CONFIG_VIDEO_MB & VG_MEM_MASK); vrWrite(wClassIndex, wData); res = vrRead(wClassIndex); -- cgit v1.2.3