Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Apr 1999 08:54:34 -0700
From:      Ted Faber <faber@ISI.EDU>
To:        NAKAGAWA Yoshihisa <y-nakaga@nwsl.mesh.ad.jp>
Cc:        Nate Williams <nate@mt.sri.com>, Nick Sayer <nsayer@quack.kfu.com>, freebsd-mobile@FreeBSD.ORG
Subject:   Re: Any success with CirrusLogic 6729/6730??? 
Message-ID:  <199904051554.IAA25536@boreas.isi.edu>
In-Reply-To: Your message of "Sat, 03 Apr 1999 11:43:25 %2B0900." <199904030243.LAA06995@chandra.eatell.msr.prug.or.jp> 

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----


NAKAGAWA Yoshihisa wrote:
>> Someone with a 6729 try applying this patch to pcic_p.[ch] (i.e., cd
>
>Probably same initialize code is working with O2 micro OZ6729/6730.
>
>> + 	io_port = PCIC_INDEX_0 + num6729 * CLPD6729_NUM_REGS;
>
>Cirrus chip has 4byte boundary. First chip is 0x3e0, second chip
>is 0x3e4, ...

Thanks.  Corrected.

>
>Using hard code PCIC_INDEX_0 is dirty.
>
>This code is always re-setup ioports, if BIOS setup it, it should
>be use. Because, BIOS is resource management for the machine.

It's a dirty world.  How can I tell the difference between an
uninitialized chip and one that the BIOS has initialized?
I would be happy to use the BIOS values if I could identify them.

Also the 3.1 pcic code seems to always look for the card at
PCIC_INDEX_0 (Nate, Nick, did I read that right?).  I agree that it
would be better to be more general, but I don't want to rewrite pcic.c.

>
>> + 	if (unit == 1)
>> + 		num6729++;
>
>What's ? CL-PD6729 is not multi-function.

That's actually supposed to look for a second card, but it's in the
wrong place.  Thanks for catching it.

>
>>   		printf("CardBus: Legacy PC-card 16bit I/O address [0x%x]\n",
>
>CL-PD6729 is not CardBus controller. :-)

Can you tell I cut and pasted some of this code :-)  Changed.

Here's an updated patch.  Has anyone other than Chung-Kie Tung tried
this?  He had some problems with it that I'm running down, and I'm
interested to see if others have the same ones.

*** pcic_p.c.orig	Sun Dec 13 22:32:57 1998
- --- pcic_p.c	Mon Apr  5 07:51:13 1999
***************
*** 48,53 ****
- --- 48,54 ----
  static void  pcic_pci_attach(pcici_t, int);
  
  static void  pd6832_legacy_init(pcici_t tag, int unit);
+ static void  pd6729_init(pcici_t tag, int unit);
  
  static struct pci_device pcic_pci_driver = {
  	"pcic",
***************
*** 97,102 ****
- --- 98,106 ----
  	case PCI_DEVICE_ID_PCIC_CLPD6832:
  		pd6832_legacy_init(config_id, unit);
  		break;
+ 	case PCI_DEVICE_ID_PCIC_CLPD6729:
+ 		pd6729_init(config_id, unit);
+ 		break;
  	}
  
  	if (bootverbose) { 		
***************
*** 191,196 ****
- --- 195,236 ----
  
  	if (bootverbose)
  		printf("CardBus: Legacy PC-card 16bit I/O address [0x%x]\n",
+ 		       io_port);
+ }
+ /*
+  * Set up the CL-PD6729 This routine is called once per PCMCIA socket.
+  */
+ static void
+ pd6729_init(pcici_t tag, int unit)
+ {
+ 	u_short io_port;	/* the io_port to map this slot on */
+ 	static int num6729 = 0; /* The number of 6832s initialized */
+ 
+ 	if (unit == 1)
+ 		num6729++;
+ 
+ 	/*
+ 	 * Some BIOS leave the i/o address uninitialized.  This
+ 	 * insures that the PD6729 puts itself where the driver will
+ 	 * look.  We assume that multiple 6829's should be laid out
+ 	 * sequentially.  (the extra 2 is because each register is 2
+ 	 * bytes wide)
+ 	 */
+ 	io_port = PCIC_INDEX_0 + num6729 * CLPD6729_NUM_REGS *2; 
+ 
+ 	/*
+ 	 * Configure the I/O window to contain CLPD6832_NUM_REGS
+ 	 * words.
+ 	 */
+ 	pci_conf_write(tag, CLPD6729_BASE0, io_port | 1);
+ 
+ 	/*
+ 	 * Set default operating mode (I/O port space) 
+ 	 */
+ 	pci_conf_write(tag, PCI_COMMAND_STATUS_REG, CLPD6729_COMMAND_DEFAULTS );
+ 
+ 	if (bootverbose)
+ 		printf("PC-card 16bit I/O address [0x%x]\n",
  		       io_port);
  }
  #endif /* NPCI > 0 */
*** pcic_p.h.orig	Tue Jan 20 13:11:03 1998
- --- pcic_p.h	Fri Apr  2 10:56:24 1999
***************
*** 52,54 ****
- --- 52,62 ----
  #define	CLPD6832_NUM_REGS		2
  
  /* End of CL-PD6832 defines */
+ /* CL-PD6729 defines */
+ #define	CLPD6729_BASE0			0x0010
+ 
+ /* Configuration constants */
+ #define	CLPD6729_COMMAND_DEFAULTS	0x00000041
+ #define	CLPD6729_NUM_REGS		2
+ 
+ /* End of CL-PD6832 defines */


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNwjcuYb4eisfQ5rpAQGX/AP/WAzPDpT+K/7D5vPwN+lImNb76Mc11oeY
OrQ9lJ4nQ6DWQz9Ogo99iGARD+H3fQxb+e8dj9x24yb37GECdY8FIHTYB+RL3ZFW
VXUScrrTJHDtIWM+QDjzt/yM+uyXICbU0uWVFU5jt6vu7/vEP3HzYs5pGxyIKguW
iDFmlUymHbQ=
=ObxD
-----END PGP SIGNATURE-----



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




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