summaryrefslogtreecommitdiffstats
path: root/mainboard/artecgroup/dbe63/stage1.c
blob: 46864be41a0ee37418a4d7fd429ce9108e3ac52a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * This file is part of the coreboot project.
 *
 * Copyright (C) 2007 Advanced Micro Devices, Inc.
 * Copyright (C) 2008 Ronald G. Minnich <rminnich@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#include <types.h>
#include <lib.h>
#include <console.h>
#include <device/device.h>
#include <device/pci.h>
#include <string.h>
#include <msr.h>
#include <io.h>
#include <amd_geodelx.h>
#include <southbridge/amd/cs5536/cs5536.h>
#include <northbridge/amd/geodelx/raminit.h>
#include <arch/x86/msr.h>

static const struct msrinit dbe62_msr[] = {
	{.msrnum = 0x10000020, {.lo = 0x00fff80, .hi = 0x20000000}},
	{.msrnum = 0x10000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
	{.msrnum = 0x40000020, {.lo = 0x00fff80, .hi = 0x20000000}},
	{.msrnum = 0x40000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
};

static void dbe62_msr_init(void)
{
	int i;
	for (i = 0; i < ARRAY_SIZE(dbe62_msr); i++)
		wrmsr(dbe62_msr[i].msrnum, dbe62_msr[i].msr);
}

void hardware_stage1(void)
{
	post_code(POST_START_OF_MAIN);

	dbe62_msr_init();

	cs5536_stage1();

	/*
	 * NOTE: Must do this AFTER the early_setup! It is counting on some
	 * early MSR setup for the CS5536.
	 */
	cs5536_setup_onchipuart(2);

	/* Set up 4MB mode for Artec LPC Dongle (this should be a no-op when not booting from the dongle) */
	outb(0xf4,0x88);
}

void mainboard_pre_payload(void)
{
	geode_pre_payload();
	banner(BIOS_DEBUG, "mainboard_pre_payload: done");
}