aboutsummaryrefslogtreecommitdiff
path: root/util/romcc/tests/linux_test8.c
blob: dfd377635d7f4bf993d4fd39651f2d60046f22e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "linux_syscall.h"
#include "linux_console.h"

struct mem_param {
	unsigned char cycle_time;
	unsigned char divisor;
	unsigned char tRC;
	unsigned char tRFC;
	unsigned dch_memclk;
	unsigned short dch_tref4k, dch_tref8k;
	unsigned char dtl_twr;
	char name[8];
};

static void test(void)
{
	static const struct mem_param param0 = {
		.name = "166Mhz\n",
		.cycle_time = 0x60,
		.divisor = (6<<1),
		.tRC = 0x3C,
		.tRFC = 0x48,
		.dch_memclk = 5 << 20,
		.dch_tref4k = 0x02,
		.dch_tref8k = 0x0A,
		.dtl_twr = 3,
	};
	int value;
	unsigned clocks;
	const struct mem_param *param;
	param = &param0;
	value = 0x48;
	/* This used to generate 32bit loads instead of 8 bit loads */
	clocks = (value + (param->divisor << 1) - 1)/(param->divisor << 1);
	print_debug("clocks: ");
	print_debug_hex32(clocks);
	print_debug("\n");
	_exit(0);
}