// SPDX-License-Identifier: GPL-2.0-or-later /* * Technologic Systems TS-5500 Single Board Computer support * * Copyright (C) 2013-2014 Savoir-faire Linux Inc. * Vivien Didelot <vivien.didelot@savoirfairelinux.com> * * This driver registers the Technologic Systems TS-5500 Single Board Computer * (SBC) and its devices, and exposes information to userspace such as jumpers' * state or available options. For further information about sysfs entries, see * Documentation/ABI/testing/sysfs-platform-ts5500. * * This code may be extended to support similar x86-based platforms. * Actually, the TS-5500 and TS-5400 are supported.
*/
staticint __init ts5500_check_signature(void)
{ void __iomem *bios; int i, ret = -ENODEV;
bios = ioremap(0xf0000, 0x10000); if (!bios) return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(ts5500_signatures); i++) { if (check_signature(bios + ts5500_signatures[i].offset,
ts5500_signatures[i].string,
strlen(ts5500_signatures[i].string))) {
ret = 0; break;
}
}
iounmap(bios); return ret;
}
staticint __init ts5500_detect_config(struct ts5500_sbc *sbc)
{
u8 tmp; int ret = 0;
if (!request_region(TS5500_PRODUCT_CODE_ADDR, 4, "ts5500")) return -EBUSY;
/* Start conversion (ensure the 3 MSB are set to 0) */
outb(ctrl & 0x1f, TS5500_ADC_CONV_INIT_LSB_ADDR);
/* * The platform has CPLD logic driving the A/D converter. * The conversion must complete within 11 microseconds, * otherwise we have to re-initiate a conversion.
*/
udelay(TS5500_ADC_CONV_DELAY); if (inb(TS5500_ADC_CONV_BUSY_ADDR) & TS5500_ADC_CONV_BUSY) return -EBUSY;
/* Read the raw data */
lsb = inb(TS5500_ADC_CONV_INIT_LSB_ADDR);
msb = inb(TS5500_ADC_CONV_MSB_ADDR);
/* * There is no DMI available or PCI bridge subvendor info, * only the BIOS provides a 16-bit identification call. * It is safer to find a signature in the BIOS shadow RAM.
*/
err = ts5500_check_signature(); if (err) return err;
pdev = platform_device_register_simple("ts5500", -1, NULL, 0); if (IS_ERR(pdev)) return PTR_ERR(pdev);
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.