[Linux-parport] Problem with ECP+EPP

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Wed Oct 13 04:11:56 EDT 2004


I set up my port for ECP+EPP under bios. Linux detect nor ECP nor EPP. I
have a NVIDIA+Athlon setup. I have also the same problem with a Intel
(pentium 4, hp d530 product).
I realize that this code 

/* Check for Intel bug. */
if (priv->ecr) {
	unsigned char i;
	for (i = 0x00; i < 0x80; i += 0x20) {
		ECR_WRITE (pb, i);
		if (clear_epp_timeout (pb)) {
			/* Phony EPP in ECP. */
			return 0;
		}
	}
}

cause the misdetection. Removing it fix half the problem (it see EPP but
not ECP). I don't understand why above of this I have 

/* If EPP timeout bit clear then EPP available */
if (!clear_epp_timeout(pb)) {
	return 0;  /* No way to clear timeout */
}

before you check if clear_epp_timeout returns == 0 and after this you
check if clear_epp_timeout != 0. If EPP it's enabled the port should
behave the same... or not?

Below

static int __devinit parport_ECPEPP_supported(struct parport *pb)
{
	struct parport_pc_private *priv = pb->private_data;
	int result;
	unsigned char oecr;

	if (!priv->ecr) {
		return 0;
	}

	oecr = inb (ECONTROL (pb));
	/* Search for SMC style EPP+ECP mode */
	ECR_WRITE (pb, 0x80);
	outb (0x04, CONTROL (pb));
	result = parport_EPP_supported(pb);

	ECR_WRITE (pb, oecr);

	if (result) {
		/* Set up access functions to use ECP+EPP hardware. */
		pb->ops->epp_read_data = parport_pc_ecpepp_read_data;
		pb->ops->epp_write_data = parport_pc_ecpepp_write_data;
		pb->ops->epp_read_addr = parport_pc_ecpepp_read_addr;
		pb->ops->epp_write_addr = parport_pc_ecpepp_write_addr;
	}

	return result;
}

why you detect ECP+EPP but not set the mode ?? in parport_EPP_supported
you have

pb->modes |= PARPORT_MODE_EPP;

so in parport_ECPEPP_supported we should have

pb->modes |= PARPORT_MODE_EPP | PARPORT_MODE_ECP;

More over

if (base != 0x3bc) {
	EPP_res = request_region(base+0x3, 5, p->name);
	if (EPP_res)
		if (!parport_EPP_supported(p))
			parport_ECPEPP_supported(p);
}

so if EPP it's not supported you don't test for EPP+ECP. Perhaps should
be

if (base != 0x3bc) {
	EPP_res = request_region(base+0x3, 5, p->name);
	if (EPP_res)
		if (!parport_ECPEPP_supported(p))
			parport_EPP_supported(p);
}

???

removed intel check bug and reverse check and I got correctly EPP,ECP in
modes. Note also that on my machine parport_pc detect correctly irq
however /proc/sys/dev/parport/parport0/irq it's still -1. If I set dma
(modprobe parport_pc io=0x378 io_hi=0x778 irq=7 dma=3) but parport_pc do
not detect ECP, I can read dma in /proc/sys/dev/parport/parport0/dma and
when unloaded parport_pc try to free dma (IMHO it shouldn't free it).

freddy77



More information about the Linux-parport mailing list