3 * Copyright (C) 2007 Advanced Micro Devices
9 #include <cpu/amd/vr.h>
10 #include <console/console.h>
14 * This function mirrors the Graphics_Init routine in GeodeROM.
16 void graphics_init(void)
18 uint16_t wClassIndex, wData, res;
20 /* SoftVG initialization */
21 printk_debug("Graphics init...\n");
23 /* Call SoftVG with the main configuration parameters. */
24 /* NOTE: SoftVG expects the memory size to be given in 2MB blocks */
26 wClassIndex = (VRC_VG << 8) + VG_CONFIG;
29 * Graphics Driver Enabled (13) 0, NO (lets BIOS controls the GP)
30 * External Monochrome Card Support(12) 0, NO
31 * Controller Priority Select(11) 1, Primary
32 * Display Select(10:8) 0x0, CRT
33 * Graphics Memory Size(7:1) CONFIG_VIDEO_MB >> 1,
34 * defined in mainboard/../Options.lb
35 * PLL Reference Clock Bypass(0) 0, Default
38 /* Video RAM has to be given in 2MB chunks
39 * the value is read @ 7:1 (value in 7:0 looks like /2)
40 * so we can add the real value in megabytes
43 wData = VG_CFG_DRIVER | VG_CFG_PRIORITY | VG_CFG_DSCRT | (CONFIG_VIDEO_MB & VG_MEM_MASK);
44 vrWrite(wClassIndex, wData);
46 res = vrRead(wClassIndex);
47 printk_debug("VRC_VG value: 0x%04x\n", res);