aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/lx/grphinit.c
diff options
context:
space:
mode:
authorMarc Jones <marc.jones@amd.com>2007-05-04 18:58:42 +0000
committerStefan Reinauer <stepan@openbios.org>2007-05-04 18:58:42 +0000
commit734daf699ceb8603f53003ab36eb85b8a76e3cf9 (patch)
tree6294b9cb835aeb77b304fe021a7b6c5926d24ea7 /src/northbridge/amd/lx/grphinit.c
parent9c9083ba4a1cd280fe70c0eec78e562d714a2dc7 (diff)
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 <marc.jones@amd.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2630 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd/lx/grphinit.c')
-rw-r--r--src/northbridge/amd/lx/grphinit.c35
1 files changed, 9 insertions, 26 deletions
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 <arch/io.h>
#include <stdint.h>
#include <cpu/amd/vr.h>
#include <console/console.h>
-/*
- * 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);