Patchwork [carFl,mem] Reduce memory buffers v2

login
register
about
Submitter Tadas Slotkus
Date 2011-08-22 17:09:39
Message ID <1314032979.2850.68.camel@ts-laptop>
Download mbox | patch
Permalink /patch/3389/
State Bitrotted
Headers show

Comments

Tadas Slotkus - 2011-08-22 17:09:39
Hi all,

Sending version two of patches, which reduce memory usage for flashrom
in coreboot and deals with globals. 1-9 patches are the same as I sent
before (two header lines have changed automatically in each patchfile).

Now you may look at all patches. It should work with internal and dummy
programmers in normal OS. To work in coreboot ramstage/romstage requires
a lot of cleanups and workarounds as much features used in the code
aren't there supported (unless you are running it as a payload). Any
comments are apreciated.

Thanks,
Tadas

Patch

From 64d62f5afb973d42cfdbe8d35f0b11885e525ef9 Mon Sep 17 00:00:00 2001
From: Tadas Slotkus <devtadas@gmail.com>
Date: Mon, 22 Aug 2011 16:29:37 +0300
Subject: [carFl mem 65/65] Kill exit() in enable_flash_ich_dc

Replace it by newly created return mechanism.

This patch is proposed for mainline:
http://www.flashrom.org/pipermail/flashrom/2011-August/007691.html

Signed-off-by: Tadas Slotkus <devtadas@gmail.com>
---
 chipset_enable.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/chipset_enable.c b/chipset_enable.c
index b00dd14..b461061 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -342,10 +342,7 @@  static int enable_flash_ich_dc(globals *g, struct pci_dev *dev, const char *name
 		msg_perr("Error: fwh_idsel= specified, but no value given.\n");
 idsel_garbage_out:	
 		//free(idsel);
-		/* FIXME: Return failure here once internal_init() starts
-		 * to care about the return value of the chipset enable.
-		 */
-		exit(1);
+		return ERROR_FATAL;
 	}
 	//free(idsel);
 
@@ -467,6 +464,8 @@  static int enable_flash_ich_dc_spi(globals *g, struct pci_dev *dev, const char *
 
 	/* Enable Flash Writes */
 	ret = enable_flash_ich_dc(g, dev, name);
+	if (ret == ERROR_FATAL)
+		return ret;
 
 	/* Get physical address of Root Complex Register Block */
 	tmp = pci_read_long(dev, 0xf0) & 0xffffc000;
-- 
1.7.6