Пример #1
0
void init_dtc2278 (void)
{
	unsigned long flags;

	save_flags(flags);
	cli();
	/*
	 * This enables the second interface
	 */
	outb_p(4,0xb0);
	inb(0x3f6);
	outb_p(0x20,0xb4);
	inb(0x3f6);
#ifdef ALWAYS_SET_DTC2278_PIO_MODE
	/*
	 * This enables PIO mode4 (3?) on the first interface
	 * and may solve start-up problems for some people.
	 */
	sub22(1,0xc3);
	sub22(0,0xa0);
#endif
	restore_flags(flags);

	ide_hwifs[0].serialized = 1;
	ide_hwifs[1].serialized = 1;
	ide_hwifs[0].chipset = ide_dtc2278;
	ide_hwifs[1].chipset = ide_dtc2278;
	ide_hwifs[0].tuneproc = &tune_dtc2278;
	ide_hwifs[0].no_unmask = 1;
	ide_hwifs[1].no_unmask = 1;
}
Пример #2
0
static void tune_dtc2278 (ide_drive_t *drive, byte pio)
{
	unsigned long flags;

	if (pio == 255)
		pio = ide_get_best_pio_mode(drive);

	if (pio >= 3) {
		save_flags(flags);
		cli();
		/*
		 * This enables PIO mode4 (3?) on the first interface
		 */
		sub22(1,0xc3);
		sub22(0,0xa0);
		restore_flags(flags);
	} else {
		/* we don't know how to set it back again.. */
	}

	/*
	 * 32bit I/O has to be enabled for *both* drives at the same time.
	 */
	drive->io_32bit = 1;
	HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
}
Пример #3
0
static int __init dtc2278_probe(void)
{
	unsigned long flags;
	ide_hwif_t *hwif, *mate;

	hwif = &ide_hwifs[0];
	mate = &ide_hwifs[1];

	if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown)
		return 1;

	local_irq_save(flags);
	/*
	 * This enables the second interface
	 */
	outb_p(4,0xb0);
	inb(0x3f6);
	outb_p(0x20,0xb4);
	inb(0x3f6);
#ifdef ALWAYS_SET_DTC2278_PIO_MODE
	/*
	 * This enables PIO mode4 (3?) on the first interface
	 * and may solve start-up problems for some people.
	 */
	sub22(1,0xc3);
	sub22(0,0xa0);
#endif
	local_irq_restore(flags);

	hwif->serialized = 1;
	hwif->chipset = ide_dtc2278;
	hwif->tuneproc = &tune_dtc2278;
	hwif->drives[0].no_unmask = 1;
	hwif->drives[1].no_unmask = 1;
	hwif->mate = mate;

	mate->serialized = 1;
	mate->chipset = ide_dtc2278;
	mate->drives[0].no_unmask = 1;
	mate->drives[1].no_unmask = 1;
	mate->mate = hwif;
	mate->channel = 1;

	probe_hwif_init(hwif);
	probe_hwif_init(mate);

	create_proc_ide_interfaces();

	return 0;
}
Пример #4
0
static int __init dtc2278_probe(void)
{
	unsigned long flags;
	ide_hwif_t *hwif, *mate;
	static u8 idx[4] = { 0, 1, 0xff, 0xff };

	hwif = &ide_hwifs[0];
	mate = &ide_hwifs[1];

	if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown)
		return 1;

	local_irq_save(flags);
	/*
	 * This enables the second interface
	 */
	outb_p(4,0xb0);
	inb(0x3f6);
	outb_p(0x20,0xb4);
	inb(0x3f6);
#ifdef ALWAYS_SET_DTC2278_PIO_MODE
	/*
	 * This enables PIO mode4 (3?) on the first interface
	 * and may solve start-up problems for some people.
	 */
	sub22(1,0xc3);
	sub22(0,0xa0);
#endif
	local_irq_restore(flags);

	hwif->serialized = 1;
	hwif->chipset = ide_dtc2278;
	hwif->pio_mask = ATA_PIO4;
	hwif->set_pio_mode = &dtc2278_set_pio_mode;
	hwif->drives[0].no_unmask = 1;
	hwif->drives[1].no_unmask = 1;
	hwif->mate = mate;

	mate->serialized = 1;
	mate->chipset = ide_dtc2278;
	mate->pio_mask = ATA_PIO4;
	mate->drives[0].no_unmask = 1;
	mate->drives[1].no_unmask = 1;
	mate->mate = hwif;
	mate->channel = 1;

	ide_device_add(idx);

	return 0;
}
Пример #5
0
TEST(Tag2Sub22, read_write) {
    const std::string raw = pca;

    OpenPGP::Subpacket::Tag2::Sub22 sub22(raw);
    TAG2_SUB22_EQ(sub22);
    EXPECT_EQ(sub22.raw(), raw);
}
Пример #6
0
void __init probe_dtc2278 (void)
{
	unsigned long flags;

	local_irq_save(flags);
	/*
	 * This enables the second interface
	 */
	outb_p(4,0xb0);
	inb(0x3f6);
	outb_p(0x20,0xb4);
	inb(0x3f6);
#ifdef ALWAYS_SET_DTC2278_PIO_MODE
	/*
	 * This enables PIO mode4 (3?) on the first interface
	 * and may solve start-up problems for some people.
	 */
	sub22(1,0xc3);
	sub22(0,0xa0);
#endif
	local_irq_restore(flags);

	ide_hwifs[0].serialized = 1;
	ide_hwifs[1].serialized = 1;
	ide_hwifs[0].chipset = ide_dtc2278;
	ide_hwifs[1].chipset = ide_dtc2278;
	ide_hwifs[0].tuneproc = &tune_dtc2278;
	ide_hwifs[0].drives[0].no_unmask = 1;
	ide_hwifs[0].drives[1].no_unmask = 1;
	ide_hwifs[1].drives[0].no_unmask = 1;
	ide_hwifs[1].drives[1].no_unmask = 1;
	ide_hwifs[0].mate = &ide_hwifs[1];
	ide_hwifs[1].mate = &ide_hwifs[0];
	ide_hwifs[1].channel = 1;

#ifndef HWIF_PROBE_CLASSIC_METHOD
	probe_hwif_init(&ide_hwifs[0]);
	probe_hwif_init(&ide_hwifs[1]);
#endif /* HWIF_PROBE_CLASSIC_METHOD */

}
Пример #7
0
static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
{
	unsigned long flags;

	pio = ide_get_best_pio_mode(drive, pio, 4, NULL);

	if (pio >= 3) {
		spin_lock_irqsave(&ide_lock, flags);
		/*
		 * This enables PIO mode4 (3?) on the first interface
		 */
		sub22(1,0xc3);
		sub22(0,0xa0);
		spin_unlock_irqrestore(&ide_lock, flags);
	} else {
		/* we don't know how to set it back again.. */
	}

	/*
	 * 32bit I/O has to be enabled for *both* drives at the same time.
	 */
	drive->io_32bit = 1;
	HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
}
Пример #8
0
static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
{
	unsigned long flags;

	if (pio >= 3) {
		spin_lock_irqsave(&dtc2278_lock, flags);
		/*
		 * This enables PIO mode4 (3?) on the first interface
		 */
		sub22(1,0xc3);
		sub22(0,0xa0);
		spin_unlock_irqrestore(&dtc2278_lock, flags);
	} else {
		/* we don't know how to set it back again.. */
		/* Actually we do - there is a data sheet available for the
		   Winbond but does anyone actually care */
	}

	/*
	 * 32bit I/O has to be enabled for *both* drives at the same time.
	 */
	drive->io_32bit = 1;
	HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
}