Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / util / romcc / tests / simple_test3.c
1 static void spd_set_drb(void)
2 {
3         /*
4          * Effects:     Uses serial presence detect to set the
5          *              DRB registers which holds the ending memory address assigned
6          *              to each DIMM.
7          */
8         unsigned end_of_memory;
9         unsigned device;
10
11         end_of_memory = 0; /* in multiples of 8MiB */
12         device = 0x50;
13         while (device <= 0x53) {
14                 unsigned side1_bits, side2_bits;
15                 int byte, byte2;
16
17                 side1_bits = side2_bits = -1;
18
19                 /* rows */
20                 byte = -1;
21                 if (1) {
22                         /* now I have the ram size in bits as a power of two (less 1) */
23                         /* Make it mulitples of 8MB */
24                         side1_bits -= 25;
25                 }
26
27                 /* Compute the end address for the DRB register */
28                 /* Only process dimms < 2GB (2^8 * 8MB) */
29                 if (1) {
30                         end_of_memory += side1_bits;
31                 }
32                 __builtin_outl(end_of_memory, 0x1234);
33
34                 if (1) {
35                         end_of_memory += side2_bits;
36                 }
37         }
38 }