Nico Huber has uploaded this change for review. ( https://review.coreboot.org/25128
Change subject: Cleanup ichspi opcode settings on shutdown
......................................................................
Cleanup ichspi opcode settings on shutdown
curopcodes in ichspi.c reflects the state of the related chipset
registers. Those are reset on shutdown but curopcodes is left
initialized. This prevented further runs with the same libflashrom
instance.
Change-Id: Ifd7f2693103ea4608c5e412fd856ebd5c6e33e19
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
M ichspi.c
1 file changed, 14 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/28/25128/1
diff --git a/ichspi.c b/ichspi.c
index 12f4584..ceb9b6e 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -711,6 +711,12 @@
return 0;
}
}
+static int ich_shutdown_opcodes(void *const _opcodes)
+{
+ OPCODES **const opcodes = (OPCODES **const)_opcodes;
+ *opcodes = NULL;
+ return 0;
+}
static int ich7_run_opcode(OPCODE op, uint32_t offset,
uint8_t datalength, uint8_t * data, int maxdata)
@@ -1811,6 +1817,10 @@
}
break;
}
+ /* FIXME: This has to be called only in the last related programmer
+ shutdown. Since we shutdown all programmers at once, it's
+ ok for now. */
+ register_shutdown(ich_shutdown_opcodes, &curopcodes);
old = pci_read_byte(dev, 0xdc);
msg_pdbg("SPI Read Configuration: ");
@@ -1852,6 +1862,10 @@
internal_buses_supported = BUS_LPC | BUS_FWH;
ich_generation = CHIPSET_ICH7;
register_spi_programmer(&spi_programmer_via);
+ /* FIXME: This has to be called only in the last related programmer
+ shutdown. Since we shutdown all programmers at once, it's
+ ok for now. */
+ register_shutdown(ich_shutdown_opcodes, &curopcodes);
msg_pdbg("0x00: 0x%04x (SPIS)\n", mmio_readw(ich_spibar + 0));
msg_pdbg("0x02: 0x%04x (SPIC)\n", mmio_readw(ich_spibar + 2));
--
To view, visit https://review.coreboot.org/25128
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd7f2693103ea4608c5e412fd856ebd5c6e33e19
Gerrit-Change-Number: 25128
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Hello Carl-Daniel Hailfinger,
I'd like you to do a code review. Please visit
https://review.coreboot.org/25127
to review the following change.
Change subject: CONFIG_DEFAULT setting
......................................................................
CONFIG_DEFAULT setting
Allow easy disabling of all programmers except selected ones by setting
CONFIG_DEFAULT=no.
Setting CONFIG_DEFAULT=yes has no effect.
Usage example:
This will disable all programmers except dummy and nic3com.
Change-Id: Iccbe614c8dbee750ef88f7a53f70a23f5e5ab079
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
---
M Makefile
1 file changed, 21 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/27/25127/1
diff --git a/Makefile b/Makefile
index b948996..2799eef 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,10 @@
# Compilation will fail for unspecified values.
CONFIG_DEFAULT_PROGRAMMER ?= PROGRAMMER_INVALID
+# This parameter picks the default setting for CONFIG_ variables of programmers not specified explicitly
+# on the command line.
+CONFIG_DEFAULT ?= yes
+
# If your compiler spits out excessive warnings, run make WARNERROR=no
# You shouldn't have to change this flag.
WARNERROR ?= yes
@@ -322,65 +326,65 @@
SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
# Always enable internal/onboard support for now.
-CONFIG_INTERNAL ?= yes
+CONFIG_INTERNAL ?= $(CONFIG_DEFAULT)
# Always enable serprog for now. Needs to be disabled on Windows.
-CONFIG_SERPROG ?= yes
+CONFIG_SERPROG ?= $(CONFIG_DEFAULT)
# RayeR SPIPGM hardware support
-CONFIG_RAYER_SPI ?= yes
+CONFIG_RAYER_SPI ?= $(CONFIG_DEFAULT)
# PonyProg2000 SPI hardware support
-CONFIG_PONY_SPI ?= yes
+CONFIG_PONY_SPI ?= $(CONFIG_DEFAULT)
# Always enable 3Com NICs for now.
-CONFIG_NIC3COM ?= yes
+CONFIG_NIC3COM ?= $(CONFIG_DEFAULT)
# Enable NVIDIA graphics cards. Note: write and erase do not work properly.
-CONFIG_GFXNVIDIA ?= yes
+CONFIG_GFXNVIDIA ?= $(CONFIG_DEFAULT)
# Always enable SiI SATA controllers for now.
-CONFIG_SATASII ?= yes
+CONFIG_SATASII ?= $(CONFIG_DEFAULT)
# Highpoint (HPT) ATA/RAID controller support.
# IMPORTANT: This code is not yet working!
CONFIG_ATAHPT ?= no
# Always enable FT2232 SPI dongles for now.
-CONFIG_FT2232_SPI ?= yes
+CONFIG_FT2232_SPI ?= $(CONFIG_DEFAULT)
# Always enable dummy tracing for now.
-CONFIG_DUMMY ?= yes
+CONFIG_DUMMY ?= $(CONFIG_DEFAULT)
# Always enable Dr. Kaiser for now.
-CONFIG_DRKAISER ?= yes
+CONFIG_DRKAISER ?= $(CONFIG_DEFAULT)
# Always enable Realtek NICs for now.
-CONFIG_NICREALTEK ?= yes
+CONFIG_NICREALTEK ?= $(CONFIG_DEFAULT)
# Disable National Semiconductor NICs until support is complete and tested.
CONFIG_NICNATSEMI ?= no
# Always enable Intel NICs for now.
-CONFIG_NICINTEL ?= yes
+CONFIG_NICINTEL ?= $(CONFIG_DEFAULT)
# Always enable SPI on Intel NICs for now.
-CONFIG_NICINTEL_SPI ?= yes
+CONFIG_NICINTEL_SPI ?= $(CONFIG_DEFAULT)
# Always enable SPI on OGP cards for now.
-CONFIG_OGP_SPI ?= yes
+CONFIG_OGP_SPI ?= $(CONFIG_DEFAULT)
# Always enable Bus Pirate SPI for now.
-CONFIG_BUSPIRATE_SPI ?= yes
+CONFIG_BUSPIRATE_SPI ?= $(CONFIG_DEFAULT)
# Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no
# Always enable Marvell SATA controllers for now.
-CONFIG_SATAMV ?= yes
+CONFIG_SATAMV ?= $(CONFIG_DEFAULT)
# Enable Linux spidev interface by default. We disable it on non-Linux targets.
-CONFIG_LINUX_SPI ?= yes
+CONFIG_LINUX_SPI ?= $(CONFIG_DEFAULT)
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
--
To view, visit https://review.coreboot.org/25127
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccbe614c8dbee750ef88f7a53f70a23f5e5ab079
Gerrit-Change-Number: 25127
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/25125
Change subject: [NOTFORMERGE] WRDI before RDID for AAI chips.
......................................................................
[NOTFORMERGE] WRDI before RDID for AAI chips.
Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
---
This is not for merge but just a reminder to not forget about this:
AAI uses a stateful process for writes that will only reset on reception
of WRDI or reset. In this state the chip will not react to other opcodes
than AAI write and WRDI. Now when a chip gets interrupted while in this
state, flashrom is not able to detect and use the chip, because it won't
reply to the probes.
TODO: either add WRDI to the generic RDID command after checking that
this is safe, or add the probe_spi_rdid_wrdi command instead of
probe_spi_rdid to all AAI-capable chips. Thanks to Denis 'GNUtoo' Carikli
for reporting the problem.
Change-Id: I197bafd64b96604afc8b1355a1a24e58f291536e
---
M chipdrivers.h
M flashchips.c
M spi25.c
3 files changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/25/25125/1
diff --git a/chipdrivers.h b/chipdrivers.h
index f0223ae..909cdda 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -34,6 +34,7 @@
/* spi25.c */
int probe_spi_rdid(struct flashctx *flash);
+int probe_spi_rdid_wrdi(struct flashctx *flash);
int probe_spi_rdid4(struct flashctx *flash);
int probe_spi_rems(struct flashctx *flash);
int probe_spi_res1(struct flashctx *flash);
diff --git a/flashchips.c b/flashchips.c
index 1c28cb5..4bc494d 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -7037,7 +7037,7 @@
.page_size = 256,
.feature_bits = FEATURE_WRSR_EWSR,
.tested = TEST_OK_PREW,
- .probe = probe_spi_rdid,
+ .probe = probe_spi_rdid_wrdi,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
diff --git a/spi25.c b/spi25.c
index 911dc4e..84f3db9 100644
--- a/spi25.c
+++ b/spi25.c
@@ -167,6 +167,12 @@
return probe_spi_rdid_generic(flash, 3);
}
+int probe_spi_rdid_wrdi(struct flashctx *flash)
+{
+ spi_write_disable(flash);
+ return probe_spi_rdid_generic(flash, 3);
+}
+
int probe_spi_rdid4(struct flashctx *flash)
{
/* Some SPI controllers do not support commands with writecnt=1 and
--
To view, visit https://review.coreboot.org/25125
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I197bafd64b96604afc8b1355a1a24e58f291536e
Gerrit-Change-Number: 25125
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>