Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Unified Diff: ichspi.c

Issue 6877037: Revert MMIO space writes on shutdown as needed. (Closed) Base URL: ssh://gitrw.chromium.org:9222/flashrom.git@master
Patch Set: remove meaningless comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « hwaccess.c ('k') | programmer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ichspi.c
diff --git a/ichspi.c b/ichspi.c
index 6e1ef05cd884580366c66f2da19e9d93c4199d36..13d3913d1ab68f979a10b491b37724803356fbfa 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -382,16 +382,16 @@ int program_opcodes(OPCODES * op)
switch (spi_controller) {
case SPI_CONTROLLER_ICH7:
case SPI_CONTROLLER_VIA:
- REGWRITE16(ICH7_REG_PREOP, preop);
- REGWRITE16(ICH7_REG_OPTYPE, optype);
- REGWRITE32(ICH7_REG_OPMENU, opmenu[0]);
- REGWRITE32(ICH7_REG_OPMENU + 4, opmenu[1]);
+ rmmio_writew(preop, ich_spibar + ICH7_REG_PREOP);
+ rmmio_writew(optype, ich_spibar + ICH7_REG_OPTYPE);
+ rmmio_writel(opmenu[0], ich_spibar + ICH7_REG_OPMENU);
+ rmmio_writel(opmenu[1], ich_spibar + ICH7_REG_OPMENU + 4);
break;
case SPI_CONTROLLER_ICH9:
- REGWRITE16(ICH9_REG_PREOP, preop);
- REGWRITE16(ICH9_REG_OPTYPE, optype);
- REGWRITE32(ICH9_REG_OPMENU, opmenu[0]);
- REGWRITE32(ICH9_REG_OPMENU + 4, opmenu[1]);
+ rmmio_writew(preop, ich_spibar + ICH9_REG_PREOP);
+ rmmio_writew(optype, ich_spibar + ICH9_REG_OPTYPE);
+ rmmio_writel(opmenu[0], ich_spibar + ICH9_REG_OPMENU);
+ rmmio_writel(opmenu[1], ich_spibar + ICH9_REG_OPMENU + 4);
break;
default:
msg_perr("%s: unsupported chipset\n", __func__);
@@ -417,9 +417,12 @@ void ich_set_bbar(uint32_t minaddr)
msg_pdbg("Reserved bits in BBAR not zero: 0x%04x",
ichspi_bbar);
ichspi_bbar |= minaddr;
- mmio_writel(ichspi_bbar, ich_spibar + 0x50);
+ rmmio_writel(ichspi_bbar, ich_spibar + 0x50);
ichspi_bbar = mmio_readl(ich_spibar + 0x50);
- /* We don't have any option except complaining. */
+ /* We don't have any option except complaining. And if the write
+ * failed, the restore will fail as well, so no problem there.
+ */
+
if (ichspi_bbar != minaddr)
msg_perr("Setting BBAR failed!\n");
break;
@@ -429,9 +432,12 @@ void ich_set_bbar(uint32_t minaddr)
msg_pdbg("Reserved bits in BBAR not zero: 0x%04x",
ichspi_bbar);
ichspi_bbar |= minaddr;
- mmio_writel(ichspi_bbar, ich_spibar + 0xA0);
+ rmmio_writel(ichspi_bbar, ich_spibar + 0xA0);
ichspi_bbar = mmio_readl(ich_spibar + 0xA0);
- /* We don't have any option except complaining. */
+ /* We don't have any option except complaining. And if the write
+ * failed, the restore will fail as well, so no problem there.
+ */
+
if (ichspi_bbar != minaddr)
msg_perr("Setting BBAR failed!\n");
break;
« no previous file with comments | « hwaccess.c ('k') | programmer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698