Show
Ignore:
Timestamp:
06/30/08 23:38:30 (5 months ago)
Author:
ruik
Message:

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@…>
Acked-by: Peter Stuge <peter@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/util/flashrom/chipset_enable.c

    r3395 r3398  
    188188void *ich_spibar = NULL; 
    189189 
     190static int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name) { 
     191        uint32_t mmio_base; 
     192 
     193        mmio_base = (pci_read_long(dev, 0xbc)) << 8; 
     194        printf_debug("MMIO base at = 0x%x\n", mmio_base); 
     195        ich_spibar =  mmap(NULL, 0x70, PROT_READ | PROT_WRITE, MAP_SHARED, 
     196                                fd_mem, mmio_base); 
     197 
     198        if (ich_spibar == MAP_FAILED) { 
     199                perror("Can't mmap memory using " MEM_DEV); 
     200                exit(1); 
     201        } 
     202 
     203        printf_debug("0x6c: 0x%04x     (CLOCK/DEBUG)\n", *(uint16_t *)(ich_spibar + 0x6c)); 
     204        viaspi_detected = 1; 
     205        return 0; 
     206} 
     207 
    190208static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, unsigned long spibar) 
    191209{ 
     
    271289/* Flag for ICH7 SPI register block */ 
    272290int ich7_detected = 0; 
     291int viaspi_detected = 0; 
    273292 
    274293static int enable_flash_ich7(struct pci_dev *dev, const char *name) 
     
    661680        {0x1106, 0x3177, "VIA VT8235",          enable_flash_vt823x}, 
    662681        {0x1106, 0x3227, "VIA VT8237",          enable_flash_vt823x}, 
     682        {0x1106, 0x3372, "VIA VT8237S",         enable_flash_vt8237s_spi}, 
    663683        {0x1106, 0x8324, "VIA CX700",           enable_flash_vt823x}, 
    664684        {0x1106, 0x0686, "VIA VT82C686",        enable_flash_amd8111},