Debian Codegraph @

src/mainboard/google/glados/variants/chell/variant.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <baseboard/variant.h>
4 #include <fsp/soc_binding.h>
5 #include <gpio.h>
6 #include <stdint.h>
7 #include <string.h>
8 #include <variant/gpio.h>
9
10 void variant_memory_init_params(FSPM_UPD *mupd, const int spd_index)
11 {
12 FSP_M_CONFIG *mem_cfg;
13 mem_cfg = &mupd->FspmConfig;
14
15 /* DQ byte map */
16 const u8 dq_map[2][12] = {
17 { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
18 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
19 { 0x33, 0xCC, 0x00, 0xCC, 0x33, 0xCC,
20 0x33, 0x00, 0xFF, 0x00, 0xFF, 0x00 } };
21
22 /* DQS CPU<>DRAM map */
23 const u8 dqs_map[2][8] = {
24 { 0, 3, 1, 2, 4, 5, 6, 7 },
25 { 1, 0, 4, 5, 2, 3, 6, 7 } };
26
27 /* Rcomp resistor */
28 const u16 RcompResistor[3] = { 200, 81, 162 };
29
30 /* Rcomp target */
31 const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
32
33 memcpy(mem_cfg->DqByteMapCh0, dq_map[0], sizeof(mem_cfg->DqByteMapCh0));
34 memcpy(mem_cfg->DqByteMapCh1, dq_map[1], sizeof(mem_cfg->DqByteMapCh1));
35 memcpy(mem_cfg->DqsMapCpu2DramCh0, dqs_map[0], sizeof(mem_cfg->DqsMapCpu2DramCh0));
36 memcpy(mem_cfg->DqsMapCpu2DramCh1, dqs_map[1], sizeof(mem_cfg->DqsMapCpu2DramCh1));
37 memcpy(mem_cfg->RcompResistor, RcompResistor, sizeof(mem_cfg->RcompResistor));
38 memcpy(mem_cfg->RcompTarget, RcompTarget, sizeof(mem_cfg->RcompTarget));
39 }
40
41 void mainboard_gpio_smi_sleep(void)
42 {
43 int i;
44
45 /* Power down the rails on any sleep type. */
46 gpio_t active_high_signals[] = {
47 EN_PP3300_KEPLER,
48 EN_PP3300_DX_TOUCH,
49 EN_PP3300_DX_EMMC,
50 EN_PP1800_DX_EMMC,
51 EN_PP3300_DX_CAM,
52 };
53
54 for (i = 0; i < ARRAY_SIZE(active_high_signals); i++)
55 gpio_set(active_high_signals[i], 0);
56 }