// SPDX-License-Identifier: GPL-2.0-or-later /* ------------------------------------------------------------------------- */ /* i2c-elektor.c i2c-hw access for PCF8584 style isa bus adaptes */ /* ------------------------------------------------------------------------- */ /* Copyright (C) 1995-97 Simon G. Vogl 1998-99 Hans Berglund
/* vdovikin: removed static struct i2c_pcf_isa gpi; code - this module in real supports only one device, due to missing arguments in some functions, called from the algo-pcf module. Sometimes it's
need to be rewriten - but for now just remove this for simpler reading */
/* ------------------------------------------------------------------------ * Encapsulate the above functions in the correct operations structure. * This is only done when more than one hardware adapter is supported.
*/ staticstruct i2c_algo_pcf_data pcf_isa_data = {
.setpcf = pcf_isa_setbyte,
.getpcf = pcf_isa_getbyte,
.getown = pcf_isa_getown,
.getclock = pcf_isa_getclock,
.waitforpin = pcf_isa_waitforpin,
};
staticint elektor_match(struct device *dev, unsignedint id)
{ #ifdef __alpha__ /* check to see we have memory mapped PCF8584 connected to the
Cypress cy82c693 PCI-ISA bridge as on UP2000 board */ if (base == 0) { struct pci_dev *cy693_dev;
cy693_dev = pci_get_device(PCI_VENDOR_ID_CONTAQ,
PCI_DEVICE_ID_CONTAQ_82C693, NULL); if (cy693_dev) { unsignedchar config; /* yeap, we've found cypress, let's check config */ if (!pci_read_config_byte(cy693_dev, 0x47, &config)) {
/* UP2000 board has this register set to 0xe1, but the most significant bit as seems can be reset during the proper initialisation sequence if guys from API decides to do that (so, we can even enable Tsunami Pchip
window for the upper 1 Gb) */
/* so just check for ROMCS at 0xe0000, ROMCS enabled for writes
and external XD Bus buffer in use. */ if ((config & 0x7f) == 0x61) { /* seems to be UP2000 like board */
base = 0xe0000;
mmapped = 1; /* UP2000 drives ISA with 8.25 MHz (PCI/4) clock
(this can be read from cypress) */
clock = I2C_PCF_CLK | I2C_PCF_TRNS90;
dev_info(dev, "found API UP2000 like " "board, will probe PCF8584 " "later\n");
}
}
pci_dev_put(cy693_dev);
}
} #endif
/* sanity checks for mmapped I/O */ if (mmapped && base < 0xc8000) {
dev_err(dev, "incorrect base address (%#x) specified " "for mmapped I/O\n", base); return 0;
}
if (base == 0) {
base = DEFAULT_BASE;
} return 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.