diff options
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/intel/kunimitsu/pei_data.c | 18 | ||||
-rw-r--r-- | src/mainboard/intel/kunimitsu/romstage.c | 12 | ||||
-rw-r--r-- | src/mainboard/intel/kunimitsu/spd/spd.c | 11 |
3 files changed, 27 insertions, 14 deletions
diff --git a/src/mainboard/intel/kunimitsu/pei_data.c b/src/mainboard/intel/kunimitsu/pei_data.c index f7525daf2e..4bfc2f3bea 100644 --- a/src/mainboard/intel/kunimitsu/pei_data.c +++ b/src/mainboard/intel/kunimitsu/pei_data.c @@ -22,6 +22,11 @@ #include <string.h> #include <soc/pei_data.h> #include <soc/pei_wrapper.h> +#include "boardid.h" + +/* PCH_MEM_CFG[3:0] */ +#define MAX_MEMORY_CONFIG 0x10 +#define RCOMP_TARGET_PARAMS 0x5 void mainboard_fill_pei_data(struct pei_data *pei_data) { @@ -40,12 +45,19 @@ void mainboard_fill_pei_data(struct pei_data *pei_data) const u16 RcompResistor[3] = { 200, 81, 162 }; /* Rcomp target */ - const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 }; + static const u16 RcompTarget[MAX_MEMORY_CONFIG][RCOMP_TARGET_PARAMS] = { + { 100, 40, 40, 23, 40 }, + { 100, 40, 40, 23, 40 }, + { 100, 40, 40, 23, 40 }, + /*Strengthen the Rcomp Target Ctrl for 8GB K4E6E304EE -EGCF*/ + { 100, 40, 40, 21, 40 }, }; + memcpy(pei_data->dq_map, dq_map, sizeof(dq_map)); memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map)); memcpy(pei_data->RcompResistor, RcompResistor, sizeof(RcompResistor)); - memcpy(pei_data->RcompTarget, RcompTarget, - sizeof(RcompTarget)); + memcpy(pei_data->RcompTarget, &RcompTarget[pei_data->mem_cfg_id][0], + sizeof(RcompTarget[pei_data->mem_cfg_id])); + } diff --git a/src/mainboard/intel/kunimitsu/romstage.c b/src/mainboard/intel/kunimitsu/romstage.c index a0eeafc9a5..cd855d681d 100644 --- a/src/mainboard/intel/kunimitsu/romstage.c +++ b/src/mainboard/intel/kunimitsu/romstage.c @@ -23,7 +23,7 @@ #include <console/console.h> #include <string.h> #include <ec/google/chromeec/ec.h> -#include <soc/gpio.h> +#include <gpio.h> #include <soc/pei_data.h> #include <soc/pei_wrapper.h> #include <soc/romstage.h> @@ -40,11 +40,21 @@ static void early_config_gpio(void) void mainboard_romstage_entry(struct romstage_params *params) { + /* PCH_MEM_CFG[3:0] */ + gpio_t spd_gpios[] = { + GPIO_MEM_CONFIG_0, + GPIO_MEM_CONFIG_1, + GPIO_MEM_CONFIG_2, + GPIO_MEM_CONFIG_3, + }; + /* Ensure the EC and PD are in the right mode for recovery */ google_chromeec_early_init(); early_config_gpio(); + params->pei_data->mem_cfg_id = gpio_base2_value(spd_gpios, + ARRAY_SIZE(spd_gpios)); /* Fill out PEI DATA */ mainboard_fill_pei_data(params->pei_data); mainboard_fill_spd_data(params->pei_data); diff --git a/src/mainboard/intel/kunimitsu/spd/spd.c b/src/mainboard/intel/kunimitsu/spd/spd.c index b8e0be6545..0deac2fe8c 100644 --- a/src/mainboard/intel/kunimitsu/spd/spd.c +++ b/src/mainboard/intel/kunimitsu/spd/spd.c @@ -22,14 +22,11 @@ #include <boardid.h> #include <cbfs.h> #include <console/console.h> -#include <gpio.h> -#include <soc/gpio.h> #include <soc/pei_data.h> #include <soc/romstage.h> #include <string.h> #include "../boardid.h" -#include "../gpio.h" #include "spd.h" static void mainboard_print_spd_info(uint8_t spd[]) @@ -90,14 +87,8 @@ void mainboard_fill_spd_data(struct pei_data *pei_data) size_t spd_file_len; int spd_index, sku_id; - gpio_t spd_gpios[] = { - GPIO_MEM_CONFIG_0, - GPIO_MEM_CONFIG_1, - GPIO_MEM_CONFIG_2, - GPIO_MEM_CONFIG_3, - }; - spd_index = gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)); + spd_index = pei_data->mem_cfg_id; /* * XXX: This is incorrect usage.The Board ID should be the revision ID * and not SKU ID but on SCRD it indicates SKU. |