Eric Biederman | f7a0ba8 | 2003-06-19 15:14:52 +0000 | [diff] [blame] | 1 | static void order_dimms(void) |
| 2 | { |
| 3 | unsigned long tom; |
| 4 | |
| 5 | tom = 0; |
| 6 | for(;;) { |
| 7 | |
| 8 | unsigned csbase, csmask; |
| 9 | unsigned size; |
| 10 | unsigned index; |
| 11 | csbase = 0; |
| 12 | |
| 13 | for(index = 0; index < 1; index++) { |
| 14 | csbase = __builtin_inl(0x40); |
| 15 | } |
| 16 | if (csbase == 0) { |
| 17 | break; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | size = csbase; |
| 22 | |
| 23 | csbase = (tom << 21); |
| 24 | |
| 25 | tom += size; |
| 26 | |
| 27 | |
| 28 | csmask = size; |
| 29 | csmask |= 0xfe00; |
| 30 | |
| 31 | |
| 32 | __builtin_outl(csbase, 0xCFC); |
| 33 | |
| 34 | __builtin_outl(0xc260, 0xCF8); |
| 35 | __builtin_outl(csmask, 0xCFC); |
| 36 | } |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 37 | |
Eric Biederman | f7a0ba8 | 2003-06-19 15:14:52 +0000 | [diff] [blame] | 38 | tom &= ~0xff000000; |
| 39 | |
| 40 | __builtin_outl(tom, 0x1234); |
| 41 | } |