From owner-freebsd-hackers Fri Feb 16 8:27:58 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp.alcove.fr (smtp.alcove.fr [212.155.209.139]) by hub.freebsd.org (Postfix) with ESMTP id 4630B37B401 for ; Fri, 16 Feb 2001 08:27:50 -0800 (PST) Received: from nsouch by smtp.alcove.fr with local (Exim 3.12 #1 (Debian)) id 14TnjI-0008Qh-00; Fri, 16 Feb 2001 17:27:32 +0100 Date: Fri, 16 Feb 2001 17:27:32 +0100 From: Nicolas Souchu To: Mike Nowlin Cc: freebsd-hackers@freebsd.org Subject: Re: can't get iicbus working - ARRGH! Message-ID: <20010216172732.A29074@ontario.alcove-int> References: <20010214022625.A26122@jason.argos.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.4i In-Reply-To: <20010214022625.A26122@jason.argos.org>; from mike@jason.argos.org on Wed, Feb 14, 2001 at 02:26:25AM -0500 Organization: =?iso-8859-1?Q?Alc=F4ve=2C_http:=2F=2Fwww=2Ealcove=2Ecom?= Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Feb 14, 2001 at 02:26:25AM -0500, Mike Nowlin wrote: > I messed around with this about a year ago, and now I'm messing around with > it again. > > In a nutshell, I can NOT figure out how to get iic with lpbb working. I > have tried all sorts of combinations of config file parameters from LINT, > man pages, etc. Is your parallel port peripheral 100% compatible with the one described in lpbb(4)? > > My current config file has something like: > # Parallel port > device ppc0 at isa? port 0x3bc flags 0x28 irq 7 drq 3 > #device ppc0 at isa? port 0x3bc flags 0x20 irq 7 > device ppbus # Parallel port bus (required) > device lpt # Printer > device ppi # Parallel port interface device > #device vpo # Requires scbus and da > #device plip # TCP/IP over parallel > # I2C stuff > device iicbus > device iic > #device ic > #device iicsmb > device iicbb > device lpbb > # > device smbus > device intpm > > The only boot messages I get that are related to this section are: > ppc0: at port 0x3bc-0x3bf irq 7 drq 3 flags 0x20 on isa0 > ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE mode > ppc0: FIFO with 16/16/16 bytes threshold > lpt0: on ppbus0 > lpt0: Polled port ppi0: on ppbus0 > > When I added the last two lines (smbus, intpm), I did get the following: > intpm0: port 0x5000-0x500f irq 9 > at device 7.3 on pci0 > intpm0: I/O mapped 5000 > intpm0: intr IRQ 9 enabled revision 0 > smbus0: on intsmb0 > intpm0: PM I/O mapped 4000 > > ...which is closer to any I2C or SMB references I've gotten to date. Without smb(4) in your config, you'll do nothing with this. intpm is only smbus compatible. There's some detection process in the lpbb driver. You should first check if your parallel i2c interface is correctly detected. #define ALIM 0x20 #define I2CKEY 0x50 static int lpbb_detect(device_t dev) { device_t ppbus = device_get_parent(dev); if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { device_printf(dev, "can't allocate ppbus\n"); return (0); } /* reset bus */ setSDA(ppbus, 1); setSCL(ppbus, 1); if ((ppb_rstr(ppbus) & I2CKEY) || ((ppb_rstr(ppbus) & ALIM) != ALIM)) { ppb_release_bus(ppbus, dev); return (0); } [...] Your interface must be compliant with this. > > Does anyone have this working? I did. > If so, could you send me your config file to look through? device ppc0 at... device ppbus device lpbb device iicbb device iicbus device iic Should do the job. Then if you want SMBus over parallel I2C, add device iicsmb device smb > > Thanks - Mike > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Nicolas.Souchu@fr.alcove.com Alcôve - Open Source Software Engineer - http://www.alcove.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message