Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Dec 1997 15:55:49 -0800
From:      Ted Faber <faber@ISI.EDU>
To:        Nate Williams <nate@mt.sri.com>
Cc:        ambrisko@whistle.com, freebsd-mobile@FreeBSD.ORG
Message-ID:  <199712182355.PAA24716@tnt.isi.edu>
In-Reply-To: Your message of "Thu, 18 Dec 1997 16:35:00 MST." <199712182335.QAA18248@mt.sri.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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 <pci/pcireg.h>
  #include <pci/pcivar.h>
  #include <pci/pcic_p.h>
+ #include <pccard/i82365.h>
  #include <vm/vm.h>
  #include <vm/pmap.h>
  
***************
*** 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







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