Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 1 | void outl(unsigned int value, unsigned short port) |
| 2 | { |
| 3 | __builtin_outl(value, port); |
| 4 | } |
| 5 | |
| 6 | #define PIIX4_DEVFN 0x90 |
| 7 | #define SMBUS_MEM_DEVICE_START 0x50 |
| 8 | #define SMBUS_MEM_DEVICE_END 0x53 |
| 9 | #define SMBUS_MEM_DEVICE_INC 1 |
| 10 | |
| 11 | |
| 12 | static void spd_set_drb(void) |
| 13 | { |
| 14 | /* |
| 15 | * Effects: Uses serial presence detect to set the |
| 16 | * DRB registers which holds the ending memory address assigned |
| 17 | * to each DIMM. |
| 18 | */ |
| 19 | unsigned end_of_memory; |
| 20 | unsigned device; |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame^] | 21 | |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 22 | end_of_memory = 0; /* in multiples of 8MiB */ |
| 23 | device = SMBUS_MEM_DEVICE_START; |
| 24 | while (device <= SMBUS_MEM_DEVICE_END) { |
| 25 | unsigned side1_bits; |
| 26 | |
| 27 | side1_bits = -1; |
| 28 | |
| 29 | /* Compute the end address for the DRB register */ |
| 30 | /* Only process dimms < 2GB (2^8 * 8MB) */ |
| 31 | if (side1_bits < 8) { |
| 32 | end_of_memory += (1 << side1_bits); |
| 33 | } |
| 34 | outl(end_of_memory, 0x1234); |
| 35 | } |
| 36 | } |