summaryrefslogtreecommitdiff
path: root/atahpt.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-09 23:40:00 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-09 23:40:00 +0000
commit8d6093845b3a37b5a4465235d243fa04747f7323 (patch)
tree5e023363074cbe351bc6ded9f20c3f116e6c6f1c /atahpt.c
parent3dd854d6160414325faa041ccc023f23abaedd39 (diff)
downloadflashrom-8d6093845b3a37b5a4465235d243fa04747f7323.tar.gz
Register Parallel/LPC/FWH programmers the same way SPI programmers are registered.
All programmers are now calling programmer registration functions and direct manipulations of buses_supported are not needed/possible anymore. Note: Programmers without parallel/LPC/FWH chip support should not call register_par_programmer(). Additional fixes: Set max_rom_decode.parallel for drkaiser. Remove abuse of programmer_map_flash_region in it85spi. Annotate several FIXMEs in it85spi. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-By: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1463 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'atahpt.c')
-rw-r--r--atahpt.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/atahpt.c b/atahpt.c
index 3451342..6252865 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -40,6 +40,17 @@ const struct pcidev_status ata_hpt[] = {
{},
};
+static const struct par_programmer par_programmer_atahpt = {
+ .chip_readb = atahpt_chip_readb,
+ .chip_readw = fallback_chip_readw,
+ .chip_readl = fallback_chip_readl,
+ .chip_readn = fallback_chip_readn,
+ .chip_writeb = atahpt_chip_writeb,
+ .chip_writew = fallback_chip_writew,
+ .chip_writel = fallback_chip_writel,
+ .chip_writen = fallback_chip_writen,
+};
+
static int atahpt_shutdown(void *data)
{
/* Flash access is disabled automatically by PCI restore. */
@@ -61,10 +72,11 @@ int atahpt_init(void)
reg32 |= (1 << 24);
rpci_write_long(pcidev_dev, REG_FLASH_ACCESS, reg32);
- buses_supported = BUS_PARALLEL;
-
if (register_shutdown(atahpt_shutdown, NULL))
return 1;
+
+ register_par_programmer(&par_programmer_atahpt, BUS_PARALLEL);
+
return 0;
}