Eric Biederman | 5ade04a | 2003-10-22 04:03:46 +0000 | [diff] [blame^] | 1 | #include "linux_syscall.h" |
| 2 | #include "linux_console.h" |
| 3 | |
| 4 | struct mem_param { |
| 5 | unsigned char cycle_time; |
| 6 | unsigned char divisor; |
| 7 | unsigned char tRC; |
| 8 | unsigned char tRFC; |
| 9 | unsigned dch_memclk; |
| 10 | unsigned short dch_tref4k, dch_tref8k; |
| 11 | unsigned char dtl_twr; |
| 12 | char name[9]; |
| 13 | }; |
| 14 | |
| 15 | static void test(void) |
| 16 | { |
| 17 | static const struct mem_param param0 = { |
| 18 | .name = "166Mhz\r\n", |
| 19 | .cycle_time = 0x60, |
| 20 | .divisor = (6<<1), |
| 21 | .tRC = 0x3C, |
| 22 | .tRFC = 0x48, |
| 23 | .dch_memclk = 5 << 20, |
| 24 | .dch_tref4k = 0x02, |
| 25 | .dch_tref8k = 0x0A, |
| 26 | .dtl_twr = 3, |
| 27 | }; |
| 28 | int value; |
| 29 | unsigned clocks; |
| 30 | const struct mem_param *param; |
| 31 | param = ¶m0; |
| 32 | value = 0x48; |
| 33 | /* This used to generate 32bit loads instead of 8 bit loads */ |
| 34 | clocks = (value + (param->divisor << 1) - 1)/(param->divisor << 1); |
| 35 | print_debug("clocks: "); |
| 36 | print_debug_hex32(clocks); |
| 37 | print_debug("\r\n"); |
| 38 | _exit(0); |
| 39 | } |