From owner-freebsd-mobile Mon Apr 5 8:56:47 1999 Delivered-To: freebsd-mobile@freebsd.org Received: from boreas.isi.edu (boreas.isi.edu [128.9.160.161]) by hub.freebsd.org (Postfix) with ESMTP id 9108314BE7 for ; Mon, 5 Apr 1999 08:56:40 -0700 (PDT) (envelope-from faber@ISI.EDU) Received: from ISI.EDU (vex-e.isi.edu [128.9.160.240]) by boreas.isi.edu (8.8.7/8.8.6) with ESMTP id IAA25536; Mon, 5 Apr 1999 08:54:34 -0700 (PDT) Message-Id: <199904051554.IAA25536@boreas.isi.edu> X-Mailer: exmh version 2.0.2 2/24/98 To: NAKAGAWA Yoshihisa Cc: Nate Williams , Nick Sayer , freebsd-mobile@FreeBSD.ORG Subject: Re: Any success with CirrusLogic 6729/6730??? In-Reply-To: Your message of "Sat, 03 Apr 1999 11:43:25 +0900." <199904030243.LAA06995@chandra.eatell.msr.prug.or.jp> X-Url: http://www.isi.edu/~faber Date: Mon, 05 Apr 1999 08:54:34 -0700 From: Ted Faber Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org -----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