Changes in the MPC8xx I2C driver

6 messages, 4 authors, 2000-08-09 · open the first message on its own page

Changes in the MPC8xx I2C driver

From: Kim J�rgensen <hidden>
Date: 2000-06-09 10:19:32

Hi,
I have made some changes in the MPC8xx I2C driver, mainly adding write
support and making the driver re-entrant. This might have some ones interest
so I'll post the driver here.

I don't use the minor number for the device address, instead I added an
ioctl function to allow set up of the device address, internal address
length and bus frequency. The setup data is saved in a struct, which is
accessed by the private pointer in the file pointer.
This allows several processes to talk to several i2c devices with different
bus frequency at the (almost) same time. I had a need for this, that's why I
made is that way.

I have removed all of the microcode relocation code in the driver, as I
couldn't make the driver work with this code and I had no need for applying
the patch.

I added these defines in commproc.h:
#define BD_SC_NAK       ((ushort)0x0004)        /* No Acknowledge */
#define BD_SC_UN        ((ushort)0x0002)        /* Underrun */
#define BD_SC_CL        ((ushort)0x0001)        /* Collision */

I made some clumsy code for converting offset to internal address, maybe
some one can tell me how to make this in a simpler way?

Any suggestions and comments are welcome.

--
Kim Jorgensen

Re: Changes in the MPC8xx I2C driver

From: Dan Malek <hidden>
Date: 2000-06-09 17:13:00

Kim Jørgensen wrote:
I have made some changes in the MPC8xx I2C driver, mainly adding write
support and making the driver re-entrant.
Looks pretty good.  I will add it to kernel sources.
I don't use the minor number for the device address,
Did you investigate the Linux I2C implementation?  I never did, but
perhaps it would be worthwhile to make this look like that at least
to an application.
I have removed all of the microcode relocation code in the driver, as I
couldn't make the driver work with this code and I had no need for applying
the patch.
That is fine.  I could never make it work either.  I have had some
discussions with others about this, but no solution yet.

I made some clumsy code for converting offset to internal address, maybe
some one can tell me how to make this in a simpler way?
The challenge is some devices need this address, others don't.  What
you have seems fine.  After we use it for a while maybe we can find
something better.

Thanks.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

I2C,SPI and QMC

From: Frank Przybylski <hidden>
Date: 2000-08-07 16:39:14

Hi all,
I plan to use QMC on SCC1 plus SPI on a MPC855T / 860DT for an ISDN BRI
implementation. I also need I2C for other purposes.
Following the QMCSUPPLEMENT/AD manual from Motorola I found that one looses
either I2C using SCC1 for QMC/Ethernet or SPI using SCC2 for QMC/Ethernet.
I hoped that the I2C/SPI micro code patch would do the trick. But scanning this
mailing list archive I got aware of troubles with this, or even worse that the
patch has been removed from the kernel.
So my question goes like this:
 has anybody managed to use I2C, SPI and QMC on SCC1 altogether, or am I lost
without any hope?

TIA
      Frank

===============================================================================
Frank Przybylski,VAS GmbH,Gotenstr.6,20097 Hamburg,GERMANY,TEL:+49-40-238568-14
   mailto:Frank.Przybylski@vas-gmbh.de , visit us at http://www.vas-gmbh.de
===============================================================================

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: I2C,SPI and QMC

From: Matthew Locke <hidden>
Date: 2000-08-07 17:42:31

Frank Przybylski wrote:
Hi all,
I plan to use QMC on SCC1 plus SPI on a MPC855T / 860DT for an ISDN BRI
implementation. I also need I2C for other purposes.
Following the QMCSUPPLEMENT/AD manual from Motorola I found that one looses
either I2C using SCC1 for QMC/Ethernet or SPI using SCC2 for QMC/Ethernet.
I hoped that the I2C/SPI micro code patch would do the trick. But scanning this
mailing list archive I got aware of troubles with this, or even worse that the
patch has been removed from the kernel.
So my question goes like this:
 has anybody managed to use I2C, SPI and QMC on SCC1 altogether, or am I lost
without any hope?
I have successfully used SPI with ethernet on SCC2 with the microcode
patch. However, I did that on a 823, I haven't tried it on the 855/860.
I think I have used the i2c driver with the microcode patch on a 860,
but don't quote me.  This was all on the Embedded Planet boards.


Matthew Locke
Montavista Software
http://www.mvista.com

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: I2C,SPI and QMC

From: Dan Malek <hidden>
Date: 2000-08-08 19:27:04

Matthew Locke wrote:
I have successfully used SPI with ethernet on SCC2 with the microcode
patch.
Better than me :-)!  I left my attempt at microcode patches around
someplace, but was never able to make them work very well.

Depending upon your SPI or I2C requirements, you may just be able to
toggle the pins in software.  This is all I did.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: I2C,SPI and QMC

From: Frank Przybylski <hidden>
Date: 2000-08-09 08:40:29

Thank you for your answers. As this is going to be a new hardware I wanted to be
on the secure side. So I'm going to try the patch with the software option on
the very same pins as a fall back option.

    Frank

Dan Malek wrote:
Matthew Locke wrote:
quoted
I have successfully used SPI with ethernet on SCC2 with the microcode
patch.
Better than me :-)!  I left my attempt at microcode patches around
someplace, but was never able to make them work very well.

Depending upon your SPI or I2C requirements, you may just be able to
toggle the pins in software.  This is all I did.

        -- Dan
--
===============================================================================
Frank Przybylski,VAS GmbH,Gotenstr.6,20097 Hamburg,GERMANY,TEL:+49-40-238568-14
   mailto:Frank.Przybylski@vas-gmbh.de , visit us at http://www.vas-gmbh.de
===============================================================================

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help