summaryrefslogtreecommitdiff
path: root/util/flashrom/chipset_enable.c
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2008-06-30 21:38:30 +0000
committerRudolf Marek <r.marek@assembler.cz>2008-06-30 21:38:30 +0000
commit4a17e02003f40495b37393b017e7c9ea4bb85638 (patch)
tree469840e1fa670fced0e7a9f4793d64de7dd2c3a3 /util/flashrom/chipset_enable.c
parent7b425c1c1115f258107bad368a1b1f7345a7254b (diff)
This patch adds support for VIA SPI controller on VT8237S. It is similar with
few documented exceptions to ICH7 SPI controller. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3398 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/chipset_enable.c')
-rw-r--r--util/flashrom/chipset_enable.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/flashrom/chipset_enable.c b/util/flashrom/chipset_enable.c
index dc6d8bc180..1d0c006444 100644
--- a/util/flashrom/chipset_enable.c
+++ b/util/flashrom/chipset_enable.c
@@ -187,6 +187,24 @@ static int enable_flash_ich_dc(struct pci_dev *dev, const char *name)
void *ich_spibar = NULL;
+static int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name) {
+ uint32_t mmio_base;
+
+ mmio_base = (pci_read_long(dev, 0xbc)) << 8;
+ printf_debug("MMIO base at = 0x%x\n", mmio_base);
+ ich_spibar = mmap(NULL, 0x70, PROT_READ | PROT_WRITE, MAP_SHARED,
+ fd_mem, mmio_base);
+
+ if (ich_spibar == MAP_FAILED) {
+ perror("Can't mmap memory using " MEM_DEV);
+ exit(1);
+ }
+
+ printf_debug("0x6c: 0x%04x (CLOCK/DEBUG)\n", *(uint16_t *)(ich_spibar + 0x6c));
+ viaspi_detected = 1;
+ return 0;
+}
+
static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, unsigned long spibar)
{
uint8_t old, new, bbs, buc;
@@ -270,6 +288,7 @@ static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, unsign
/* Flag for ICH7 SPI register block */
int ich7_detected = 0;
+int viaspi_detected = 0;
static int enable_flash_ich7(struct pci_dev *dev, const char *name)
{
@@ -660,6 +679,7 @@ static const FLASH_ENABLE enables[] = {
{0x1106, 0x8231, "VIA VT8231", enable_flash_vt823x},
{0x1106, 0x3177, "VIA VT8235", enable_flash_vt823x},
{0x1106, 0x3227, "VIA VT8237", enable_flash_vt823x},
+ {0x1106, 0x3372, "VIA VT8237S", enable_flash_vt8237s_spi},
{0x1106, 0x8324, "VIA CX700", enable_flash_vt823x},
{0x1106, 0x0686, "VIA VT82C686", enable_flash_amd8111},
{0x1078, 0x0100, "AMD CS5530(A)", enable_flash_cs5530},