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