Changeset 3393 for trunk/util/flashrom/chipset_enable.c
- Timestamp:
- 06/27/08 18:28:34 (5 months ago)
- Files:
-
- 1 modified
-
trunk/util/flashrom/chipset_enable.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/util/flashrom/chipset_enable.c
r3348 r3393 190 190 static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name, unsigned long spibar) 191 191 { 192 uint8_t old, new, bbs ;192 uint8_t old, new, bbs, buc; 193 193 uint32_t tmp, gcs; 194 194 void *rcrb; … … 196 196 /* Read the Root Complex Base Address Register (RCBA) */ 197 197 tmp = pci_read_long(dev, 0xf0); 198 198 199 /* Calculate the Root Complex Register Block address */ 199 200 tmp &= 0xffffc000; 200 printf_debug(" Root Complex Register Block address = 0x%x\n", tmp);201 printf_debug("\nRoot Complex Register Block address = 0x%x\n", tmp); 201 202 rcrb = mmap(0, 0x4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd_mem, (off_t)tmp); 202 203 if (rcrb == MAP_FAILED) { … … 213 214 (bbs == 0x3) ? "LPC" : ((bbs == 0x2) ? "PCI" : "SPI")); 214 215 216 buc = *(volatile uint8_t *)(rcrb + 0x3414); 217 printf_debug("Top Swap : %s\n", (buc & 1)?"enabled (A16 inverted)":"not enabled"); 218 215 219 /* SPIBAR is at RCRB+0x3020 for ICH[78] and RCRB+0x3800 for ICH9. */ 216 printf_debug("SPIBAR = 0x%lx\n", tmp + spibar); 217 /* TODO: Dump the SPI config regs */ 220 printf_debug("SPIBAR = 0x%x + 0x%04x\n", tmp, (uint16_t)spibar); 221 222 // Assign Virtual Address 218 223 ich_spibar = rcrb + spibar; 224 225 if (ich7_detected) { 226 int i; 227 printf_debug("0x00: 0x%04x (SPIS)\n", *(uint16_t *)(ich_spibar + 0)); 228 printf_debug("0x02: 0x%04x (SPIC)\n", *(uint16_t *)(ich_spibar + 2)); 229 printf_debug("0x04: 0x%08x (SPIA)\n", *(uint32_t *)(ich_spibar + 4)); 230 for (i=0; i < 8; i++) { 231 int offs; 232 offs = 8 + (i * 8); 233 printf_debug("0x%02x: 0x%08x (SPID%d)\n", offs, *(uint32_t *)(ich_spibar + offs), i); 234 printf_debug("0x%02x: 0x%08x (SPID%d+4)\n", offs+4, *(uint32_t *)(ich_spibar + offs +4), i); 235 } 236 printf_debug("0x50: 0x%08x (BBAR)\n", *(uint32_t *)(ich_spibar + 0x50)); 237 printf_debug("0x54: 0x%04x (PREOP)\n", *(uint16_t *)(ich_spibar + 0x54)); 238 printf_debug("0x56: 0x%04x (OPTYPE)\n", *(uint16_t *)(ich_spibar + 0x56)); 239 printf_debug("0x58: 0x%08x (OPMENU)\n", *(uint32_t *)(ich_spibar + 0x58)); 240 printf_debug("0x5c: 0x%08x (OPMENU+4)\n", *(uint32_t *)(ich_spibar + 0x5c)); 241 for (i=0; i < 4; i++) { 242 int offs; 243 offs = 0x60 + (i * 4); 244 printf_debug("0x%02x: 0x%08x (PBR%d)\n", offs, *(uint32_t *)(ich_spibar + offs), i); 245 } 246 printf_debug("\n"); 247 if ( (*(uint16_t *)ich_spibar) & (1 << 15)) { 248 printf("WARNING: SPI Configuration Lockdown activated.\n"); 249 } 250 } 219 251 220 252 old = pci_read_byte(dev, 0xdc); … … 235 267 } 236 268 269 /* Flag for ICH7 SPI register block */ 270 int ich7_detected = 0; 271 237 272 static int enable_flash_ich7(struct pci_dev *dev, const char *name) 238 273 { 274 ich7_detected = 1; 239 275 return enable_flash_ich_dc_spi(dev, name, 0x3020); 240 276 } 241 277 278 /* Flag for ICH8/ICH9 SPI register block */ 242 279 int ich9_detected = 0; 243 280
