xref: /OK3568_Linux_fs/u-boot/cmd/ddr_tool/memtester/sizes.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Very simple but very effective user-space memory tester.
4  * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
5  * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
6  * Version 3 not publicly released.
7  * Version 4 rewrite:
8  * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
9  * Licensed under the terms of the GNU General Public License version 2 (only).
10  * See the file COPYING for details.
11  *
12  * This file contains some macro definitions for handling 32/64 bit platforms.
13  *
14  */
15 #ifndef __CMD_DDR_TOOL_MEMTESTER_SIZES_H
16 #define __CMD_DDR_TOOL_MEMTESTER_SIZES_H
17 
18 #include <common.h>
19 
20 #define rand32() ((unsigned int)rand() | ((unsigned int)rand() << 16))
21 
22 #define rand_ul() rand32()
23 #define UL_ONEBITS 0xffffffff
24 #define UL_LEN 32
25 #define CHECKERBOARD1 0x55555555
26 #define CHECKERBOARD2 0xaaaaaaaa
27 #define UL_BYTE(x) ((x | x << 8 | x << 16 | x << 24))
28 
29 #endif /* __CMD_DDR_TOOL_MEMTESTER_SIZES_H */
30