Dear flashrom list,
This patch tries to fix comp1/2_density issues on Rangeley/Baytrail platforms with "dual flash dev installed".
Patch is based on r1850, guess it might work as well for r1844 or later rev.
Signed-off-by: T.H.Wu Type thwu@lunartoday.com
From: "Type T.H.Wu" thwu@lunartoday.com Date: Wed, 10 Sep 2014 14:20:54 +0800 Subject: [PATCH] Rangeley/Baytrail comp1/2_density fix
--- ich_descriptors.c | 11 +++++------ ich_descriptors.h | 9 ++++++++- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ich_descriptors.c b/ich_descriptors.c index 1966f66..d041149 100644 --- a/ich_descriptors.c +++ b/ich_descriptors.c @@ -127,7 +127,8 @@ static const char *pprint_density(enum ich_chipset cs, const struct ich_descript case CHIPSET_ICH10: case CHIPSET_5_SERIES_IBEX_PEAK: case CHIPSET_6_SERIES_COUGAR_POINT: - case CHIPSET_7_SERIES_PANTHER_POINT: { + case CHIPSET_7_SERIES_PANTHER_POINT: + case CHIPSET_BAYTRAIL: { uint8_t size_enc; if (idx == 0) { size_enc = desc->component.old.comp1_density; @@ -139,7 +140,6 @@ static const char *pprint_density(enum ich_chipset cs, const struct ich_descript return size_str[size_enc]; } case CHIPSET_8_SERIES_LYNX_POINT: - case CHIPSET_BAYTRAIL: case CHIPSET_8_SERIES_LYNX_POINT_LP: case CHIPSET_8_SERIES_WELLSBURG: case CHIPSET_9_SERIES_WILDCAT_POINT: { @@ -216,7 +216,7 @@ void prettyprint_ich_descriptor_component(enum ich_chipset cs, const struct ich_ pprint_freq(cs, desc->component.common.freq_fastread)); if (cs > CHIPSET_6_SERIES_COUGAR_POINT) msg_pdbg2("Dual Output Fast Read Support: %sabled\n", - desc->component.new.dual_output ? "dis" : "en"); + (cs == CHIPSET_BAYTRAIL ? desc->component.old.dual_output : desc->component.new.dual_output) ? "dis" : "en"); if (desc->component.FLILL == 0) msg_pdbg2("No forbidden opcodes.\n"); else { @@ -802,7 +802,6 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors msg_perr("Only ICH SPI component index 0 or 1 are supported yet.\n"); return -1; } - if (desc->content.NC == 0 && idx > 0) return 0;
@@ -816,6 +815,7 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors case CHIPSET_5_SERIES_IBEX_PEAK: case CHIPSET_6_SERIES_COUGAR_POINT: case CHIPSET_7_SERIES_PANTHER_POINT: + case CHIPSET_BAYTRAIL: if (idx == 0) { size_enc = desc->component.old.comp1_density; } else { @@ -824,7 +824,6 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors size_max = 5; break; case CHIPSET_8_SERIES_LYNX_POINT: - case CHIPSET_BAYTRAIL: case CHIPSET_8_SERIES_LYNX_POINT_LP: case CHIPSET_8_SERIES_WELLSBURG: case CHIPSET_9_SERIES_WILDCAT_POINT: @@ -842,7 +841,7 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors }
if (size_enc > size_max) { - msg_perr("Density of ICH SPI component with index %d is invalid." + msg_perr("Density of ICH SPI component with index %d is invalid.\n" "Encoded density is 0x%x while maximum allowed is 0x%x.\n", idx, size_enc, size_max); return -1; diff --git a/ich_descriptors.h b/ich_descriptors.h index c41f9d9..572ee60 100644 --- a/ich_descriptors.h +++ b/ich_descriptors.h @@ -130,7 +130,14 @@ struct ich_desc_component { comp2_density :3, :11, :13, - :2; + /* + * @ Baytrail & Rangeley FLCOMP: + * (1) Comp[1|2]_desnity := [0:2] | [3:5] + * Max 16MB*2 SPI devices, ie. max value := 101101b + * (2) Daul_output supported as well + */ + dual_output :1, + :1; } old; struct { uint32_t comp1_density :4, /* new since Lynx Point/8 */