Eric Biederman | 34cadde | 2003-07-12 01:40:54 +0000 | [diff] [blame] | 1 | struct mem_param { |
| 2 | unsigned char cycle_time; |
| 3 | unsigned char divisor; |
| 4 | unsigned char tRC; |
| 5 | unsigned char tRFC; |
Eric Biederman | 83b991a | 2003-10-11 06:20:25 +0000 | [diff] [blame] | 6 | unsigned dch_memclk; |
Eric Biederman | 34cadde | 2003-07-12 01:40:54 +0000 | [diff] [blame] | 7 | unsigned short dch_tref4k, dch_tref8k; |
| 8 | unsigned char dtl_twr; |
| 9 | char name[9]; |
| 10 | }; |
| 11 | |
| 12 | static 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 = ¶m0; |
| 29 | value = 0x48; |
Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame^] | 30 | #warning "this generated word loads instead of byte loads" |
Eric Biederman | 34cadde | 2003-07-12 01:40:54 +0000 | [diff] [blame] | 31 | clocks = (value + (param->divisor << 1) - 1)/(param->divisor << 1); |
| 32 | } |