blob: 9bc80eac7dbe69fb2010a06b4c0914ec7d70e2c0 [file] [log] [blame]
Eric Biederman90089602004-05-28 14:11:54 +00001#include "linux_syscall.h"
2#include "linux_console.h"
3
4struct mem_controller {
5 unsigned short channel0[4];
6};
7
8static unsigned int spd_detect_dimms(const struct mem_controller *ctrl)
9{
10 unsigned dimm_mask;
11 int i;
12
13 print_debug("1\n");
14 dimm_mask = 0;
15 for(i = 0; i < 4; i++) {
16 int byte;
17 unsigned device;
18
19 print_debug("2\n");
20 device = ctrl->channel0[i];
21 if (device) {
22 print_debug("3\n");
23 byte = ctrl->channel0[i] + 2;
24 if (byte == 7) {
25 dimm_mask |= (1 << i);
26 }
27 }
28 print_debug("4\n");
29 }
30 print_debug("5\n");
31 return dimm_mask;
32}
33
34
35static void main(void)
36{
37 static const struct mem_controller cpu[] = {
38 {
39 .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
40 },
41 };
42 long dimm_mask;
43 print_debug("A\n");
44 dimm_mask = spd_detect_dimms(cpu);
45 print_debug("B\n");
Stefan Reinauer14e22772010-04-27 06:56:47 +000046 _exit(0);
Eric Biederman90089602004-05-28 14:11:54 +000047}