From 2bee8cf898007687c58ddb29eb119b461704f18a Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 10 Nov 2010 15:25:18 +0000 Subject: Revert PCI config space writes on shutdown This means all chipset enables etc. will be undone on shutdown. Reversible PCI config space writes now use rpci_write_*(). PCI config space writes which are one-shot (e.g. communication via config space) should continue to use the permanent pci_write_* variants. Extend the number of available register_shutdown slots to 32. Corresponding to flashrom svn r1232. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Michael Karcher --- atahpt.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'atahpt.c') diff --git a/atahpt.c b/atahpt.c index 2552697..eac056e 100644 --- a/atahpt.c +++ b/atahpt.c @@ -50,7 +50,7 @@ int atahpt_init(void) /* Enable flash access. */ reg32 = pci_read_long(pcidev_dev, REG_FLASH_ACCESS); reg32 |= (1 << 24); - pci_write_long(pcidev_dev, REG_FLASH_ACCESS, reg32); + rpci_write_long(pcidev_dev, REG_FLASH_ACCESS, reg32); buses_supported = CHIP_BUSTYPE_PARALLEL; @@ -59,13 +59,7 @@ int atahpt_init(void) int atahpt_shutdown(void) { - uint32_t reg32; - - /* Disable flash access again. */ - reg32 = pci_read_long(pcidev_dev, REG_FLASH_ACCESS); - reg32 &= ~(1 << 24); - pci_write_long(pcidev_dev, REG_FLASH_ACCESS, reg32); - + /* Flash access is disabled automatically by PCI restore. */ pci_cleanup(pacc); release_io_perms(); return 0; -- cgit v1.1