2 * This file is part of the coreboot project.
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <console/console.h>
21 #include <device/device.h>
23 #include <boot/coreboot_tables.h>
24 #include <cpu/x86/msr.h>
25 #include <cpu/amd/mtrr.h>
28 /********************************************************
29 * dbm690t uses a BCM5789 as on-board NIC.
30 * It has a pin named LOW_POWER to enable it into LOW POWER state.
31 * In order to run NIC, we should let it out of Low power state. This pin
32 * is controlled by sb600 GPM3.
33 * RRG4.2.3 GPM as GPIO
34 * GPM pins can be used as GPIO. The GPM I/O functions is controlled by three registers:
35 * I/O C50, C51, C52, PM I/O94, 95, 96.
36 * RRG4.2.3.1 GPM pins as Input
37 * RRG4.2.3.2 GPM pins as Output
38 ********************************************************/
39 static void enable_onboard_nic()
43 printk_info("enable_onboard_nic.\n");
58 byte |= 0x80; /* 7:6=10 */
66 /*************************************************
67 * enable the dedicated function in dbm690t board.
68 * This function called early than rs690_enable.
69 *************************************************/
70 void dbm690t_enable(device_t dev)
72 struct mainboard_amd_dbm690t_config *mainboard =
73 (struct mainboard_amd_dbm690t_config *)dev->chip_info;
75 #if (CONFIG_GFXUMA == 1)
78 /* TOP_MEM: the top of DRAM below 4G */
80 printk_info("dbm690t_enable, TOP MEM: msr.lo = 0x%08x, msr.hi = 0x%08x\n", msr.lo, msr.hi);
82 /* TOP_MEM2: the top of DRAM above 4G */
83 msr2 = rdmsr(TOP_MEM2);
84 printk_info("dbm690t_enable, TOP MEM2: msr2.lo = 0x%08x, msr2.hi = 0x%08x\n", msr2.lo, msr2.hi);
87 case 0x10000000: /* 256M system memory */
88 uma_memory_size = 0x2000000; /* 32M recommended UMA */
91 case 0x18000000: /* 384M system memory */
92 uma_memory_size = 0x4000000; /* 64M recommended UMA */
95 case 0x20000000: /* 512M system memory */
96 uma_memory_size = 0x4000000; /* 64M recommended UMA */
99 default: /* 1GB and above system memory */
100 uma_memory_size = 0x8000000; /* 128M recommended UMA */
104 uma_memory_start = msr.lo - uma_memory_size;/* TOP_MEM1 */
105 printk_info("dbm690t_enable: uma size 0x%08x, memory start 0x%08x\n", uma_memory_size, uma_memory_start);
109 uma_memory_size = 0x8000000; /* 128M recommended UMA */
110 uma_memory_start = 0x38000000; /* 1GB system memory supposed */
113 printk_info("dbm690t_enable. dev=0x%x\n", dev);
115 enable_onboard_nic();
119 * CONFIG_CHIP_NAME defined in Option.lb.
121 struct chip_operations mainboard_amd_dbm690t_ops = {
122 #if CONFIG_CHIP_NAME == 1
123 CHIP_NAME("AMD Dbm690t Mainboard")
125 .enable_dev = dbm690t_enable,