blob: e98c7ef41d93420bd546437d82bc20092f62c768 [file] [log] [blame]
Bin Menge159cdf2015-02-05 23:42:23 +08001/*
2 * Copyright (C) 2013, Intel Corporation
3 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
4 *
5 * Ported from Intel released Quark UEFI BIOS
6 * QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei
7 *
8 * SPDX-License-Identifier: Intel
9 */
10
11#ifndef _HTE_H_
12#define _HTE_H_
13
14enum {
15 MRC_MEM_INIT,
16 MRC_MEM_TEST
17};
18
19enum {
20 READ_TRAIN,
21 WRITE_TRAIN
22};
23
24/*
25 * EXP_LOOP_CNT field of HTE_CMD_CTL
26 *
27 * This CANNOT be less than 4!
28 */
29#define HTE_LOOP_CNT 5
30
31/* random seed for victim */
Bin Meng15e3f282015-03-10 18:31:20 +080032#define HTE_LFSR_VICTIM_SEED 0xf294ba21
Bin Menge159cdf2015-02-05 23:42:23 +080033
34/* random seed for aggressor */
Bin Meng15e3f282015-03-10 18:31:20 +080035#define HTE_LFSR_AGRESSOR_SEED 0xeba7492d
Bin Menge159cdf2015-02-05 23:42:23 +080036
37u32 hte_mem_init(struct mrc_params *mrc_params, u8 flag);
38u16 hte_basic_write_read(struct mrc_params *mrc_params, u32 addr,
39 u8 first_run, u8 mode);
40u16 hte_write_stress_bit_lanes(struct mrc_params *mrc_params,
41 u32 addr, u8 first_run);
42void hte_mem_op(u32 addr, u8 first_run, u8 is_write);
43
44#endif /* _HTE_H_ */