coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spd.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef MAINBOARD_SPD_H
4 
5 #include <fsp/soc_binding.h>
6 #include <gpio.h>
7 #include "../gpio.h"
8 
9 #define MAINBOARD_SPD_H
10 
11 #define SPD_LEN 256
12 
13 #define SPD_DRAM_TYPE 2
14 #define SPD_DRAM_DDR3 0x0b
15 #define SPD_DRAM_LPDDR3 0xf1
16 #define SPD_DENSITY_BANKS 4
17 #define SPD_ADDRESSING 5
18 #define SPD_ORGANIZATION 7
19 #define SPD_BUS_DEV_WIDTH 8
20 #define SPD_PART_OFF 128
21 #define SPD_PART_LEN 18
22 #define SPD_MANU_OFF 148
23 
24 #define HYNIX_SINGLE_CHAN 0x1
25 #define SAMSUNG_SINGLE_CHAN 0x4
26 #define MIC_SINGLE_CHAN 0x5
27 
28 /* PCH_MEM_CFG[3:0] */
29 #define MAX_MEMORY_CONFIG 0x10
30 #define K4E6E304EE_MEM_ID 0x3
31 
32 static inline int get_spd_index(void) {
33  /* PCH_MEM_CFG[3:0] */
34  gpio_t spd_gpios[] = {
39  };
40  return (gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)));
41 }
42 void mainboard_fill_dq_map_data(void *dq_map_ch0, void *dq_map_ch1);
43 void mainboard_fill_dqs_map_data(void *dqs_map_ch0, void *dqs_map_ch1);
44 void mainboard_fill_rcomp_res_data(void *rcomp_ptr);
45 void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr);
48 #endif
#define ARRAY_SIZE(a)
Definition: helpers.h:12
uint32_t gpio_base2_value(const gpio_t gpio[], int num_gpio)
Definition: gpio.c:30
void mainboard_fill_dq_map_data(void *dq_map_ptr)
Definition: spd_util.c:8
void mainboard_fill_dqs_map_data(void *dqs_map_ptr)
Definition: spd_util.c:19
void mainboard_fill_rcomp_res_data(void *rcomp_ptr)
Definition: spd_util.c:28
void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
Definition: spd_util.c:36
#define GPIO_MEM_CONFIG_3
Definition: gpio.h:27
#define GPIO_MEM_CONFIG_0
Definition: gpio.h:24
#define GPIO_MEM_CONFIG_2
Definition: gpio.h:26
#define GPIO_MEM_CONFIG_1
Definition: gpio.h:25
uintptr_t mainboard_get_spd_data(void)
Definition: spd.c:75
static int get_spd_index(void)
Definition: spd.h:32
int mainboard_has_dual_channel_mem(void)
Definition: spd_util.c:89
unsigned long uintptr_t
Definition: stdint.h:21