From owner-freebsd-mobile Thu Dec 18 16:24:37 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA05868 for mobile-outgoing; Thu, 18 Dec 1997 16:24:37 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from tnt.isi.edu (tnt.isi.edu [128.9.128.128]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA05854 for ; Thu, 18 Dec 1997 16:24:30 -0800 (PST) (envelope-from faber@ISI.EDU) Received: from ISI.EDU (vex-s.isi.edu [128.9.192.240]) by tnt.isi.edu (8.8.7/8.8.6) with ESMTP id PAA24716; Thu, 18 Dec 1997 15:55:49 -0800 (PST) Message-Id: <199712182355.PAA24716@tnt.isi.edu> To: Nate Williams cc: ambrisko@whistle.com, freebsd-mobile@FreeBSD.ORG In-reply-to: Your message of "Thu, 18 Dec 1997 16:35:00 MST." <199712182335.QAA18248@mt.sri.com> X-Url: http://www.isi.edu/~faber Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 18 Dec 1997 15:55:49 -0800 From: Ted Faber Sender: owner-freebsd-mobile@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Nate Williams wrote: >> Nate, here's a patch to -current that addresses the issue Doug raised >> of CL-PD6832's that are initialized to odd ports and also allows users >> to specify a port for their pcic other than the bios default port. > >Ugh. I really dislike adding 'yet another' config option. > >> Right now, this added flexibility isn't worth much, because >> /sys/pccard/pcic.c has its ports essentially hardwired at 0x3e0, but >> it seems cleaner to me anyway. It should provide a way for users with >> chips initialized to standard CArdBus operation to switch to 16-bit >> legacy mode. > >So, wouldn't it be 'easier' to just hard-code the port to 0x3e0, since >that's where the code expects to find it? > >> Doug and I (mostly Doug, since I don't see the same problems in my >> setup) are still poking around with his interrupts so there may be >> some more fixes to come, but this seems solid (and works fine on my >> box with PCIC_PCI_PORT defined or not (defining it to other than 0x3e0 >> boots, but the pcic driver doesn't find the chip). > >Then why allow the user to set it? Why not just hard-code it to 0x3e0 >*always*? What would that break? Well, it doesn't *break* anything, but it's icky. :-) I just have a preference for configurable systems. I agree however that making a parameter configurable that no one con configure isn't worth much (other than as incentive to change the unconfigurable stuff). This version always maps the 6832 to the port where the pcic driver expects it to be listening. So if we ever make the port in the pcic driver configurable the PCI driver will follow it. (The new dependency is to find where the pcic driver expects the card to be). Here's the patch: *** pcic_p.c.orig Thu Dec 18 15:07:59 1997 --- pcic_p.c Thu Dec 18 15:45:22 1997 *************** *** 37,42 **** --- 37,43 ---- #include #include #include + #include #include #include *************** *** 135,140 **** --- 136,150 ---- u_long bcr; /* to set interrupts */ u_short io_port; /* the io_port to map this slot on */ + /* + * Some BIOS leave the legacy address uninitialized. This + * insures that the PD6832 puts itself where the driver will + * look + */ + + io_port = PCIC_INDEX_0; + pci_conf_write(tag, CLPD6832_LEGACY_16BIT_IOADDR, + io_port & ~PCI_MAP_IO); /* * I think this should be a call to pci_map_port, but that * routine won't map regiaters above 0x28, and the register we