summaryrefslogtreecommitdiff
path: root/src/northbridge/via/vt8601/northbridge.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2003-10-02 22:48:28 +0000
committerRonald G. Minnich <rminnich@gmail.com>2003-10-02 22:48:28 +0000
commita70483b83bdc733e187ca6955b4edfa02a4d80e0 (patch)
treed07fe2c2d5f1e7369ac541671d1ab9a28b0890ef /src/northbridge/via/vt8601/northbridge.c
parentcb3f498296bad22b360796139bc454d141d7ccc9 (diff)
downloadcoreboot-a70483b83bdc733e187ca6955b4edfa02a4d80e0.tar.xz
First SPD code in and working!
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1177 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/via/vt8601/northbridge.c')
-rw-r--r--src/northbridge/via/vt8601/northbridge.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/northbridge/via/vt8601/northbridge.c b/src/northbridge/via/vt8601/northbridge.c
index 8ad94f01a5..e289a6c9d2 100644
--- a/src/northbridge/via/vt8601/northbridge.c
+++ b/src/northbridge/via/vt8601/northbridge.c
@@ -13,12 +13,16 @@
#include "chip.h"
#include "northbridge.h"
+static const uint8_t ramregs[] = {0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x56, 0x57};
+
struct mem_range *sizeram(void)
{
unsigned long mmio_basek;
static struct mem_range mem[10];
device_t dev;
int i, idx;
+ unsigned char rambits;
dev = dev_find_slot(0, 0);
if (!dev) {
@@ -33,7 +37,24 @@ struct mem_range *sizeram(void)
mem[idx].sizek = 0;
idx++;
}
+ for(rambits = 0, i = 0; i < sizeof(ramregs)/sizeof(ramregs[0]); i++) {
+ unsigned char reg;
+ reg = pci_read_config8(dev, ramregs[i]);
+ /* these are ENDING addresses, not sizes.
+ * if there is memory in this slot, then reg will be > rambits.
+ * So we just take the max, that gives us total.
+ * We take the highest one to cover for once and future linuxbios
+ * bugs. We warn about bugs.
+ */
+ if (reg > rambits)
+ rambits = reg;
+ if (reg < rambits)
+ printk_err("ERROR! register 0x%x is not set!\n",
+ ramregs[i]);
+ }
+ printk_err("I would set ram size to 0x%x Mbytes\n", (1 <<rambits)*8);
+
#if 1
for(i = 0; i < idx; i++) {
printk_debug("mem[%d].basek = %08x mem[%d].sizek = %08x\n",
@@ -58,7 +79,7 @@ static void enumerate(struct chip *chip)
*/
static void
random_fixup() {
- device_t *pcidev = dev_find_slot(0, 0);
+ device_t pcidev = dev_find_slot(0, 0);
printk_spew("VT8601 random fixup ...\n");
if (pcidev) {