Get rid of the unnecessary indirection by 'struct mem_controller' for the
[coreboot.git] / src / northbridge / intel / i82810 / raminit.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Corey Osgood <corey@slightlyhackish.com>
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; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 #ifndef NORTHBRIDGE_INTEL_I82810_RAMINIT_H
22 #define NORTHBRIDGE_INTEL_I82810_RAMINIT_H
23
24 /* The 82810 supports max. 2 dual-sided DIMMs. */
25 #define DIMM_SOCKETS    2
26
27 /* DIMM0 is at 0x50, DIMM1 is at 0x51. */
28 #define DIMM_SPD_BASE 0x50
29
30 /* The following table has been bumped over to this header to avoid clutter in 
31  * raminit.c. It's used to translate the value read from SPD Byte 31 to a value
32  * the northbridge can understand in DRP, aka Rx52[7:4], [3:0]. Where most
33  * northbridges have some sort of simple calculation that can be done for this,
34  * I haven't yet figured out one for this northbridge. Until someone does,
35  * this table is necessary.
36  */
37
38 /* TODO: Find a better way of doing this. */
39
40 static const uint8_t translate_spd_to_i82810[] = {
41         /* Note: 4MB sizes are not supported, so dual-sided DIMMs with a 4MB 
42          * side can't be either, at least for now.
43          */
44         /* TODO: For above case, only use the other side if > 4MB, and get some
45          * of these DIMMs to test it with. Same for unsupported 128/x sizes.
46          */
47
48                 /*   SPD Byte 31        Memory Size [Side 1/2]  */
49         0xff,   /*      0x01            No memory       */
50         0xff,   /*      0x01             4/0            */
51         0x01,   /*      0x02             8/0            */
52         0xff,   /*      0x03             8/4            */
53         0x04,   /*      0x04            16/0 or 16      */
54         0xff,   /*      0x05            16/4            */
55         0x05,   /*      0x06            16/8            */
56         0xff,   /*      0x07            Invalid         */
57         0x07,   /*      0x08            32/0 or 32      */
58         0xff,   /*      0x09            32/4            */
59         0xff,   /*      0x0A            32/8            */
60         0xff,   /*      0x0B            Invalid         */
61         0x08,   /*      0x0C            32/16           */
62         0xff, 0xff, 0xff, /* 0x0D-0F    Invalid         */
63         0x0a,   /*      0x10            64/0 or 64      */
64         0xff,   /*      0x11            64/4            */
65         0xff,   /*      0x12            64/8            */
66         0xff,   /*      0x13            Invalid         */
67         0xff,   /*      0x14            64/16           */
68         0xff, 0xff, 0xff, /* 0x15-17    Invalid         */
69         0x0b,   /*      0x18            64/32           */
70         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x19-1f Invalid */
71         0x0d,   /*      0x20            128/0 or 128    */
72         /* These configurations are not supported by the i810 */
73         0xff,   /*      0x21            128/4           */
74         0xff,   /*      0x22            128/8           */
75         0xff,   /*      0x23            Invalid         */
76         0xff,   /*      0x24            128/16          */
77         0xff, 0xff, 0xff, /* 0x25-27    Invalid         */
78         0xff,   /*      0x28            128/32          */
79         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x29-2f Invalid */
80         0x0e,   /*      0x30            128/64          */
81         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
82         0xff, 0xff, 0xff, /* 0x31-3f    Invalid         */
83         0x0f,   /*      0x40            256/0 or 256    */
84         /* Anything larger is not supported by the 82810. */
85 };
86
87 #endif                          /* NORTHBRIDGE_INTEL_I82810_RAMINIT_H */