mb: Use fixed value in RcompTarget structure
[coreboot.git] / src / mainboard / intel / kunimitsu / spd / spd.h
blobad6453e7b8dd54f24407fbe70997ac9d034c905a
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2014 Google Inc.
5 * Copyright (C) 2015 Intel Corporation.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef MAINBOARD_SPD_H
19 #include <fsp/soc_binding.h>
20 #include <gpio.h>
21 #include "../gpio.h"
23 #define MAINBOARD_SPD_H
25 #define SPD_LEN 256
27 #define SPD_DRAM_TYPE 2
28 #define SPD_DRAM_DDR3 0x0b
29 #define SPD_DRAM_LPDDR3 0xf1
30 #define SPD_DENSITY_BANKS 4
31 #define SPD_ADDRESSING 5
32 #define SPD_ORGANIZATION 7
33 #define SPD_BUS_DEV_WIDTH 8
34 #define SPD_PART_OFF 128
35 #define SPD_PART_LEN 18
36 #define SPD_MANU_OFF 148
38 #define HYNIX_SINGLE_CHAN 0x1
39 #define SAMSUNG_SINGLE_CHAN 0x4
40 #define MIC_SINGLE_CHAN 0x5
42 /* PCH_MEM_CFG[3:0] */
43 #define MAX_MEMORY_CONFIG 0x10
44 #define K4E6E304EE_MEM_ID 0x3
46 static inline int get_spd_index(void) {
47 /* PCH_MEM_CFG[3:0] */
48 gpio_t spd_gpios[] = {
49 GPIO_MEM_CONFIG_0,
50 GPIO_MEM_CONFIG_1,
51 GPIO_MEM_CONFIG_2,
52 GPIO_MEM_CONFIG_3,
54 return (gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)));
56 void mainboard_fill_dq_map_data(void *dq_map_ch0, void *dq_map_ch1);
57 void mainboard_fill_dqs_map_data(void *dqs_map_ch0, void *dqs_map_ch1);
58 void mainboard_fill_rcomp_res_data(void *rcomp_ptr);
59 void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr);
60 uintptr_t mainboard_get_spd_data(void);
61 int mainboard_has_dual_channel_mem(void);
62 #endif