blob: 60ac2a7010e7707e8c1e055696e01f698e3ebc7a [file] [log] [blame]
Kyösti Mälkki191d2212014-06-15 12:06:12 +03001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Vladimir Serbinenko.
5 *
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.
9 *
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.
Kyösti Mälkki191d2212014-06-15 12:06:12 +030014 */
15
16#define __SIMPLE_DEVICE__
17
18#include <arch/io.h>
19#include <cbmem.h>
20#include "nehalem.h"
21
Kyösti Mälkkif1e3c762014-12-22 12:28:07 +020022static uintptr_t smm_region_start(void)
Kyösti Mälkki191d2212014-06-15 12:06:12 +030023{
24 /* Base of TSEG is top of usable DRAM */
Kyösti Mälkkif1e3c762014-12-22 12:28:07 +020025 uintptr_t tom = pci_read_config32(PCI_DEV(0,0,0), TSEG);
26 return tom;
27}
28
29void *cbmem_top(void)
30{
31 return (void *) smm_region_start();
Kyösti Mälkki191d2212014-06-15 12:06:12 +030032}