[flashrom] [PATCH] Fix Rangeley/Baytrail ich_desc density issues (09/10)

Tai-Hong (Type) Wu thwu at lunartoday.com
Wed Sep 10 08:36:56 CEST 2014


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 at lunartoday.com>

From: "Type T.H.Wu" <thwu at 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 */
-- 
1.7.11.7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20140910/2b200efb/attachment.html>
-------------- next part --------------

-----------------------------------------------------------------------------
BEFORE PATCH: 101101b(0x2d) comp1/2_desnity[0:3/4:7] := 0xd / 0x2, INVALID
-----------------------------------------------------------------------------
Enabling hardware sequencing due to multiple flash chips detected.
Density of ICH SPI component with index 0 is invalid.Encoded density is 0xd while maximum allowed is 0x7.
Could not determine density of flash component 0.
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.



-----------------------------------------------------------------------------
AFTER PATCH:  101101b(0x2d) comp1/2_desnity[0:2/3:5] := 0x5 / 0x5,  valid
-----------------------------------------------------------------------------
Enabling hardware sequencing due to multiple flash chips detected.
OK.
Found Programmer flash chip "Opaque flash chip" (32768 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
No operations were specified.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Rangeley-Baytrail-comp1-2_density-fix.patch
Type: application/octet-stream
Size: 3436 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20140910/2b200efb/attachment.obj>


More information about the flashrom mailing list