blob: 860bf3240d01a4ab86a8e5e5e7e8f447a054fec3 [file] [log] [blame]
Eric Biederman34cadde2003-07-12 01:40:54 +00001struct mem_param {
2 unsigned char cycle_time;
3 unsigned char divisor;
4 unsigned char tRC;
5 unsigned char tRFC;
Eric Biederman83b991a2003-10-11 06:20:25 +00006 unsigned dch_memclk;
Eric Biederman34cadde2003-07-12 01:40:54 +00007 unsigned short dch_tref4k, dch_tref8k;
8 unsigned char dtl_twr;
9 char name[9];
10};
11
12static void test(void)
13{
14 static const struct mem_param param0 = {
15 .name = "166Mhz\r\n",
16 .cycle_time = 0x60,
17 .divisor = (6<<1),
18 .tRC = 0x3C,
19 .tRFC = 0x48,
20 .dch_memclk = 5 << 20,
21 .dch_tref4k = 0x02,
22 .dch_tref8k = 0x0A,
23 .dtl_twr = 3,
24 };
25 int value;
26 unsigned clocks;
27 const struct mem_param *param;
28 param = &param0;
29 value = 0x48;
Eric Biederman90089602004-05-28 14:11:54 +000030#warning "this generated word loads instead of byte loads"
Eric Biederman34cadde2003-07-12 01:40:54 +000031 clocks = (value + (param->divisor << 1) - 1)/(param->divisor << 1);
32}