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: <Parallel port> 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: <Printer> on ppbus0
> lpt0: Polled port ppi0: <Parallel I/O> on ppbus0
>
> When I added the last two lines (smbus, intpm), I did get the following:
> intpm0: <Intel 82371AB Power management controller> port 0x5000-0x500f irq 9
> at device 7.3 on pci0
> intpm0: I/O mapped 5000
> intpm0: intr IRQ 9 enabled revision 0
> smbus0: <System Management Bus> 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 [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
--
[EMAIL PROTECTED]
Alcôve - Open Source Software Engineer - http://www.alcove.com
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message