Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jan 2012 13:48:35 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        aconnolly08@yahoo.co.jp
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: atkbc not loaded with ACPI enabled in 9.0
Message-ID:  <201201271348.35731.jhb@freebsd.org>
In-Reply-To: <639642.41300.qm@web100410.mail.kks.yahoo.co.jp>
References:  <639642.41300.qm@web100410.mail.kks.yahoo.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, January 21, 2012 12:11:54 am aconnolly08@yahoo.co.jp wrote:
> 
> --- On Wed, 2012/1/18, John Baldwin <jhb@freebsd.org> wrote:
> 
> On Friday, January 13, 2012 10:27:13 pm aconnolly08@yahoo.co.jp wrote:
> > Please try this patch:
> > 
> > Index: sys/dev/atkbdc/atkbdc_isa.c
> > ===================================================================
> > --- atkbdc_isa.c    (revision 230009)
> > +++ atkbdc_isa.c    (working copy)
> > @@ -87,6 +87,7 @@ static driver_t atkbdc_isa_driver = {
> >  
> >  static struct isa_pnp_id atkbdc_ids[] = {
> >      { 0x0303d041, "Keyboard controller (i8042)" },    /* PNP0303 */
> > +    { 0x0320d041, "Keyboard controller (i8042)" },    /* PNP0320 */
> >      { 0 }
> >  };
> >  
> > 
> > -- 
> > John Baldwin
> > _______________________________________________
> > freebsd-current@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org
> > John,
> > Thanks for your help, but that patch doesn't appear to address the problem. 
> I edited the atkbdc_isa.c file as you instructed, rebuilt and installed my 
> kernel, but my integrated keyboard remains unresponsive with ACPI enabled.
> > Here's the new output of dmesg -a http://pastebin.com/h6ahmD2ddevinfo -ur 
> http://pastebin.com/sdNcNEJUdevinfo -vr http://pastebin.com/P2yqQBLY
> > Perhaps I was supposed to remove PNP0303 support?
> 
> No, the goal was to get atkbdc to try to attach to PNP0320 devices since those 
> have your keyboard I/O ports.  Can you add some printfs to atkbdc_isa_probe() 
> to see how many times it is getting past the ID check, and how far along it 
> gets in each cases (i.e. which failure case causes the probe routine to return 
> an error)?
> 
> -- 
> John Baldwin
> 
> 
> John,
> 
> I added some printfs to the isa_probe() function to see how far it was getting. The function is called many times as you can see in the dmesg, 
but mostly it exits at the PnP ID check with ENXIO.
> 
> At one point it gets further, but still exits with ENXIO when port0 is found to be NULL.
> 
> Any suggestions for further investigation?
> 
> edited function http://pastebin.com/uUsVLiz2
> dmesg -a http://pastebin.com/kDtC9gvM

Hmm, so this looks like it is only getting past the ID check once and is not
probing the 0320 device at all.  Please try this patch with some different
debugging printfs and let me know what you get as output during boot:

Index: atkbdc_isa.c
===================================================================
--- atkbdc_isa.c	(revision 230585)
+++ atkbdc_isa.c	(working copy)
@@ -87,6 +87,7 @@ static driver_t atkbdc_isa_driver = {
 
 static struct isa_pnp_id atkbdc_ids[] = {
 	{ 0x0303d041, "Keyboard controller (i8042)" },	/* PNP0303 */
+	{ 0x0320d041, "Keyboard controller (i8042)" },	/* PNP0320 */
 	{ 0 }
 };
 
@@ -111,6 +112,9 @@ atkbdc_isa_probe(device_t dev)
 		return ENXIO;
 
 	device_set_desc(dev, "Keyboard controller (i8042)");
+	if (isa_get_logicalid(dev) != 0)
+		device_printf(dev, "has PNP ID %s\n",
+		    pnp_eisaformat(isa_get_logicalid(dev)));
 
 	/*
 	 * Adjust I/O port resources.
@@ -125,17 +129,25 @@ atkbdc_isa_probe(device_t dev)
 	 */
 	device_quiet(dev);
 	rid = 0;
-	if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count) != 0)
+	if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count) != 0) {
+		device_printf(dev, "no I/O port resources\n");
 		return ENXIO;
+	}
+	device_printf(dev, "initial I/O port 0 is %x-%x\n", start,
+	    start + count - 1);
 	if (start == IO_KBD + KBD_STATUS_PORT) {
 		start = IO_KBD;
 		count++;
 	}
-	if (count > 1)	/* adjust the count and/or start port */
+	if (count > 1)	/* adjust the count and/or start port */ {
+		device_printf(dev, "setting rid 0 to %x-%x\n", start, start);
 		bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1);
+	}
 	port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-	if (port0 == NULL)
+	if (port0 == NULL) {
+		device_printf(dev, "Failed to allocate I/O port rid 0\n");
 		return ENXIO;
+	}
 	rid = 1;
 	if (bus_get_resource(dev, SYS_RES_IOPORT, rid, NULL, NULL) != 0)
 		bus_set_resource(dev, SYS_RES_IOPORT, 1,


-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201271348.35731.jhb>