On 05/23/2011 11:52 AM, Stefan Tauner wrote:
On Mon, 23 May 2011 11:18:30 -0400
Joshua Roys<roysj...@gmail.com>  wrote:

Hello,

This patch will fix incorrect output from my original patch:
0x64: 0x00000fff (FREG4: Platform Data)
0x00fff000-0x00000fff is locked

-       if (base == 0x1fff&&  limit == 0) {
+       if ((base&  0x0fff) == 0x0fff&&  limit == 0) {

hey!

i am quoting from the ibex peak spi programming guide:

general description of the freg section:
• If a particular region is not using SPI Flash, the particular region should 
be disabled
by setting the Region Base to all 1's, and the Region Limit to all 0's (base is 
higher
than the limit)
• For each region except FLREG0, the Flash Controller must have a default Region
Base of FFFh and the Region Limit to 000h within the Flash Controller in case 
the
Number of Regions specifies that a region is not used.

FREG1.limit:
Must be set to 0000h if BIOS region is unused (on Firmware hub)
FREG1.base:
If the BIOS region is not used, the Region Base must be programmed to 1FFFh
and equivalent for the GbE and platform data section (ME is required in
ibex peak...).

is this a contradiction (one time 0xfff, other time 0x1fff)?
in any case: would checking for limit<  base be the better alternative?

Hello,

Good idea Stefan. May as well handle all the invalid cases in one fell swoop.

New patch attached.

Josh

From ffb44cbfdac72b42448bb6801ff3dc331d0e018f Mon Sep 17 00:00:00 2001
From: Joshua Roys <roysj...@gmail.com>
Date: Mon, 23 May 2011 11:13:11 -0400
Subject: [PATCH] ichspi: fix unused FREG detection

Signed-off-by: Joshua Roys <roysj...@gmail.com>
---
 ichspi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ichspi.c b/ichspi.c
index 6370fb6..31945de 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1045,7 +1045,7 @@ static void do_ich9_spi_frap(uint32_t frap, int i)
 
        base  = ICH_FREG_BASE(freg);
        limit = ICH_FREG_LIMIT(freg);
-       if (base == 0x1fff && limit == 0) {
+       if (base > limit) {
                /* this FREG is disabled */
                msg_pdbg("%s region is unused.\n", region_names[i]);
                return;
-- 
1.7.3.4

_______________________________________________
flashrom mailing list
flashrom@flashrom.org
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to