Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google Inc. |
| 5 | * Copyright (C) 2015 Intel Corporation. |
| 6 | * |
| 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. |
| 10 | * |
| 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. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
Lee Leahy | b993d2f | 2015-07-17 11:07:54 -0700 | [diff] [blame] | 18 | * Foundation, Inc. |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #include <stdint.h> |
| 22 | #include <string.h> |
| 23 | #include <soc/pei_data.h> |
| 24 | #include <soc/pei_wrapper.h> |
pchandri | e57e726 | 2015-09-14 14:11:38 -0700 | [diff] [blame^] | 25 | #include "boardid.h" |
| 26 | |
| 27 | /* PCH_MEM_CFG[3:0] */ |
| 28 | #define MAX_MEMORY_CONFIG 0x10 |
| 29 | #define RCOMP_TARGET_PARAMS 0x5 |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 30 | |
| 31 | void mainboard_fill_pei_data(struct pei_data *pei_data) |
| 32 | { |
Duncan Laurie | 74b964e | 2015-09-04 10:41:02 -0700 | [diff] [blame] | 33 | /* DQ byte map */ |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 34 | const u8 dq_map[2][12] = { |
Duncan Laurie | 74b964e | 2015-09-04 10:41:02 -0700 | [diff] [blame] | 35 | { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0 , |
| 36 | 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 }, |
| 37 | { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0 , |
| 38 | 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 } }; |
| 39 | /* DQS CPU<>DRAM map */ |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 40 | const u8 dqs_map[2][8] = { |
Duncan Laurie | 74b964e | 2015-09-04 10:41:02 -0700 | [diff] [blame] | 41 | { 0, 1, 3, 2, 6, 5, 4, 7 }, |
| 42 | { 2, 3, 0, 1, 6, 7, 4, 5 } }; |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 43 | |
Duncan Laurie | 74b964e | 2015-09-04 10:41:02 -0700 | [diff] [blame] | 44 | /* Rcomp resistor */ |
| 45 | const u16 RcompResistor[3] = { 200, 81, 162 }; |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 46 | |
Duncan Laurie | 74b964e | 2015-09-04 10:41:02 -0700 | [diff] [blame] | 47 | /* Rcomp target */ |
pchandri | e57e726 | 2015-09-14 14:11:38 -0700 | [diff] [blame^] | 48 | static const u16 RcompTarget[MAX_MEMORY_CONFIG][RCOMP_TARGET_PARAMS] = { |
| 49 | { 100, 40, 40, 23, 40 }, |
| 50 | { 100, 40, 40, 23, 40 }, |
| 51 | { 100, 40, 40, 23, 40 }, |
| 52 | /*Strengthen the Rcomp Target Ctrl for 8GB K4E6E304EE -EGCF*/ |
| 53 | { 100, 40, 40, 21, 40 }, }; |
| 54 | |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 55 | |
| 56 | memcpy(pei_data->dq_map, dq_map, sizeof(dq_map)); |
| 57 | memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map)); |
| 58 | memcpy(pei_data->RcompResistor, RcompResistor, |
| 59 | sizeof(RcompResistor)); |
pchandri | e57e726 | 2015-09-14 14:11:38 -0700 | [diff] [blame^] | 60 | memcpy(pei_data->RcompTarget, &RcompTarget[pei_data->mem_cfg_id][0], |
| 61 | sizeof(RcompTarget[pei_data->mem_cfg_id])); |
| 62 | |
Lee Leahy | c421041 | 2015-06-29 11:37:56 -0700 | [diff] [blame] | 63 | } |