linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IBM ocp I2C
@ 2002-04-24  3:01 andrew may
  2002-04-24  3:01 ` andrew may
  2002-04-26 20:48 ` Armin
  0 siblings, 2 replies; 14+ messages in thread
From: andrew may @ 2002-04-24  3:01 UTC (permalink / raw)
  To: linuxppc-embedded


Would anyone be heartbroken if "struct i2c_algo_iic_data" went
away completely?

In this patch I dump getown and getclock because they aren't
used and I am sure there is a better way to do things.

Also calculate the I2C div value from the clock rate. I am
not sure if that will work on all 4xx types but it does the
right thing for my 405's.

I also fixed a few C++ style comments.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24  3:01 [PATCH] IBM ocp I2C andrew may
@ 2002-04-24  3:01 ` andrew may
  2002-04-24  4:36   ` Armin
  2002-04-24 18:26   ` andrew may
  2002-04-26 20:48 ` Armin
  1 sibling, 2 replies; 14+ messages in thread
From: andrew may @ 2002-04-24  3:01 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On Tue, Apr 23, 2002 at 08:01:27PM -0700, andrew may wrote:
> Would anyone be heartbroken if "struct i2c_algo_iic_data" went
> away completely?
>
> In this patch I dump getown and getclock because they aren't
> used and I am sure there is a better way to do things.
>
> Also calculate the I2C div value from the clock rate. I am
> not sure if that will work on all 4xx types but it does the
> right thing for my 405's.
>
> I also fixed a few C++ style comments.
>
and the patch

[-- Attachment #2: i2c-clock.patch.gz --]
[-- Type: application/octet-stream, Size: 2809 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24  3:01 ` andrew may
@ 2002-04-24  4:36   ` Armin
  2002-04-24 15:18     ` andrew may
  2002-04-24 18:26   ` andrew may
  1 sibling, 1 reply; 14+ messages in thread
From: Armin @ 2002-04-24  4:36 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded


andrew may wrote:
> On Tue, Apr 23, 2002 at 08:01:27PM -0700, andrew may wrote:
>
>>Would anyone be heartbroken if "struct i2c_algo_iic_data" went
>>away completely?
>>
>>In this patch I dump getown and getclock because they aren't
>>used and I am sure there is a better way to do things.
>>
>>Also calculate the I2C div value from the clock rate. I am
>>not sure if that will work on all 4xx types but it does the
>>right thing for my 405's.
>>
>>I also fixed a few C++ style comments.
>>
>>
> and the patch
>

Andrew,


could you provide a single patch that would be applied on top of the
*devel.  I appreciate the changes and I will get back to you in on
"struct i2c_algo_iic_data".  I will need to try the div changes on the
redwoods (stb03 & stb04 cpus).

armin


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24  4:36   ` Armin
@ 2002-04-24 15:18     ` andrew may
  0 siblings, 0 replies; 14+ messages in thread
From: andrew may @ 2002-04-24 15:18 UTC (permalink / raw)
  To: Armin; +Cc: andrew may, linuxppc-embedded


On Tue, Apr 23, 2002 at 09:36:37PM -0700, Armin wrote:
> andrew may wrote:
> > On Tue, Apr 23, 2002 at 08:01:27PM -0700, andrew may wrote:
> >
> >>Would anyone be heartbroken if "struct i2c_algo_iic_data" went
> >>away completely?
> >>
> >>In this patch I dump getown and getclock because they aren't
> >>used and I am sure there is a better way to do things.
> >>
> >>Also calculate the I2C div value from the clock rate. I am
> >>not sure if that will work on all 4xx types but it does the
> >>right thing for my 405's.
> >>
> >>I also fixed a few C++ style comments.
> >>
> >>
> > and the patch
> >
>
> Andrew,
>
>
> could you provide a single patch that would be applied on top of the
> *devel.  I appreciate the changes and I will get back to you in on
> "struct i2c_algo_iic_data".  I will need to try the div changes on the
> redwoods (stb03 & stb04 cpus).

This is a single patch, and you should be able to apply it without the
other patches I sent.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24  3:01 ` andrew may
  2002-04-24  4:36   ` Armin
@ 2002-04-24 18:26   ` andrew may
  2002-04-24 18:45     ` Armin
  2002-05-01 17:05     ` Armin
  1 sibling, 2 replies; 14+ messages in thread
From: andrew may @ 2002-04-24 18:26 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

This patch is also needed to get it to compile. I forgot
to check things after I removed the stuff from the headers.

[-- Attachment #2: i2c-clock2.patch --]
[-- Type: text/plain, Size: 1167 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.966   -> 1.967
#	drivers/i2c/i2c-adap-ibm_ocp.c	1.2     -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/24	amay@infosec-server.infosec	1.967
# remove dead code
# --------------------------------------------
#
diff -Nru a/drivers/i2c/i2c-adap-ibm_ocp.c b/drivers/i2c/i2c-adap-ibm_ocp.c
--- a/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
+++ b/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
@@ -304,8 +304,6 @@
       iic_ibmocp_data[i]->data = (struct iic_regs *)iic_ibmocp_adaps[i];
       iic_ibmocp_data[i]->setiic = iic_ibmocp_setbyte;
       iic_ibmocp_data[i]->getiic = iic_ibmocp_getbyte;
-      iic_ibmocp_data[i]->getown = 0;
-      iic_ibmocp_data[i]->getclock = 0;
       iic_ibmocp_data[i]->waitforpin = iic_ibmocp_waitforpin;
       iic_ibmocp_data[i]->udelay = 80;
       iic_ibmocp_data[i]->mdelay = 80;

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24 18:26   ` andrew may
@ 2002-04-24 18:45     ` Armin
  2002-05-01 17:05     ` Armin
  1 sibling, 0 replies; 14+ messages in thread
From: Armin @ 2002-04-24 18:45 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded


andrew may wrote:
> This patch is also needed to get it to compile. I forgot
> to check things after I removed the stuff from the headers.

>


Andrew,

Thanks,  the clock changes are on hold until I can validate on the other
40x boards I have that support i2c.

armin


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24  3:01 [PATCH] IBM ocp I2C andrew may
  2002-04-24  3:01 ` andrew may
@ 2002-04-26 20:48 ` Armin
  2002-04-27  3:35   ` andrew may
  1 sibling, 1 reply; 14+ messages in thread
From: Armin @ 2002-04-26 20:48 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded


andrew may wrote:
> Would anyone be heartbroken if "struct i2c_algo_iic_data" went
> away completely?
It might with the us of ocp_driver struct.  still working on it

>
> In this patch I dump getown and getclock because they aren't
> used and I am sure there is a better way to do things.

this does not work on Walnut since "procfreq" is not part of openbios
and the PLLMR does not exsist on the stb03 or 03  so this changes wont
go in.

>
> Also calculate the I2C div value from the clock rate. I am
> not sure if that will work on all 4xx types but it does the
> right thing for my 405's.
>
> I also fixed a few C++ style comments.
  thanks


armin


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-26 20:48 ` Armin
@ 2002-04-27  3:35   ` andrew may
  2002-04-28  4:09     ` Armin
  0 siblings, 1 reply; 14+ messages in thread
From: andrew may @ 2002-04-27  3:35 UTC (permalink / raw)
  To: Armin; +Cc: andrew may, linuxppc-embedded


On Fri, Apr 26, 2002 at 01:48:48PM -0700, Armin wrote:
> > In this patch I dump getown and getclock because they aren't
> > used and I am sure there is a better way to do things.
>
> this does not work on Walnut since "procfreq" is not part of openbios
> and the PLLMR does not exsist on the stb03 or 03  so this changes wont
> go in.

I don't have a stb03 or even know what chip it uses, so I have
no idea what to do about it. We should have some generic 4xx
functions to get the CPU/PLB/OPB clocks so we can calculate what
the I2C div should be. We could always try trusing what the BIOS
sets the divider to as well.


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-27  3:35   ` andrew may
@ 2002-04-28  4:09     ` Armin
  0 siblings, 0 replies; 14+ messages in thread
From: Armin @ 2002-04-28  4:09 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded


andrew may wrote:
> On Fri, Apr 26, 2002 at 01:48:48PM -0700, Armin wrote:
>
>>>In this patch I dump getown and getclock because they aren't
>>>used and I am sure there is a better way to do things.
>>>
>>this does not work on Walnut since "procfreq" is not part of openbios
>>and the PLLMR does not exsist on the stb03 or 03  so this changes wont
>>go in.
>>
>
> I don't have a stb03 or even know what chip it uses, so I have
> no idea what to do about it. We should have some generic 4xx
> functions to get the CPU/PLB/OPB clocks so we can calculate what
> the I2C div should be. We could always try trusing what the BIOS
> sets the divider to as well.
>
>
>
Andrew,


I agree, the issue I have is that the clock solution was too arch/bios
specific and should reside somewhere outside the driver in the form of a
fuction or variable (as you suggest) that can take into accout the
differences in arch and possibly bios.

Thanks

armin


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH]IBM OCP I2C
@ 2002-04-29 21:40 andrew may
       [not found] ` <3CCDE113.5000700@pacbell.net>
  0 siblings, 1 reply; 14+ messages in thread
From: andrew may @ 2002-04-29 21:40 UTC (permalink / raw)
  To: linuxppc-embedded


This is incremental to the other patches I posted. It gets the
iic_xfer that is based of the ppcboot code working. The return
values are still not correct but the data is transfered ok for
what I have tested. I do not try to do a Repeated Start for
anything yet either.

If anyone has any comments or more test conditions I would like
to hear them.

I pulled some defines from the PPCBoot code and I am not sure the
correct header file for them.

I would like to dump the iic_outb/inb as well. In the iic_xfer I
use readb/writeb directly without problems.

I put this comment in there about the driver. Does any see anything
wrong with this?
/*
 * Limits of the IBM OCP I2C driver.
 * There is no way to do lenght 0 transfers since iic->cntl TCT==00 means 1 byte
 * We can not handle I2C_M_NOSTART since there is no way to put just one bit
 * on the bus after a NA.
 * We can not handle I2C_M_REV_DIR_ADDR since the Rd/Wr bit is not
 * set directly in the address register and the controller uses the
 * Rd/Wr bit in the CNTL reg to know what to do.
 *
 * If you need to get around any of these I suggest you setup i2c-adap-ibm...
 * to use the algo-bit and provide functions to use the DirectControl Reg of
 * the IBM OCP hardware.
 */

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]IBM OCP I2C
       [not found] ` <3CCDE113.5000700@pacbell.net>
@ 2002-04-30  0:05   ` andrew may
  0 siblings, 0 replies; 14+ messages in thread
From: andrew may @ 2002-04-30  0:05 UTC (permalink / raw)
  To: Armin; +Cc: andrew may, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

On Mon, Apr 29, 2002 at 05:10:59PM -0700, Armin wrote:
> Please send me that patch,  I am in the middle of a major restructuring
> and any suggestions from you are welcome.  As soon as I am comfortable
> with what i have , I will send you a preview.  The other patchs I have
> put on hold until I get what I have working.

Always forget the attachments, sorry.

[-- Attachment #2: i2c-xfer2.patch.gz --]
[-- Type: application/octet-stream, Size: 6397 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] IBM ocp I2C
  2002-04-24 18:26   ` andrew may
  2002-04-24 18:45     ` Armin
@ 2002-05-01 17:05     ` Armin
  1 sibling, 0 replies; 14+ messages in thread
From: Armin @ 2002-05-01 17:05 UTC (permalink / raw)
  To: andrew may; +Cc: linuxppc-embedded


andrew may wrote:
> This patch is also needed to get it to compile. I forgot
> to check things after I removed the stuff from the headers.
>
>
> ------------------------------------------------------------------------
>
> # This is a BitKeeper generated patch for the following project:
> # Project Name: Linux 2.4 for PowerPC development tree
> # This patch format is intended for GNU patch command version 2.5 or higher.
> # This patch includes the following deltas:
> #	           ChangeSet	1.966   -> 1.967
> #	drivers/i2c/i2c-adap-ibm_ocp.c	1.2     -> 1.3
> #
> # The following is the BitKeeper ChangeSet Log
> # --------------------------------------------
> # 02/04/24	amay@infosec-server.infosec	1.967
> # remove dead code
> # --------------------------------------------
> #
> diff -Nru a/drivers/i2c/i2c-adap-ibm_ocp.c b/drivers/i2c/i2c-adap-ibm_ocp.c
> --- a/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
> +++ b/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
> @@ -304,8 +304,6 @@
>        iic_ibmocp_data[i]->data = (struct iic_regs *)iic_ibmocp_adaps[i];
>        iic_ibmocp_data[i]->setiic = iic_ibmocp_setbyte;
>        iic_ibmocp_data[i]->getiic = iic_ibmocp_getbyte;
> -      iic_ibmocp_data[i]->getown = 0;
> -      iic_ibmocp_data[i]->getclock = 0;
>        iic_ibmocp_data[i]->waitforpin = iic_ibmocp_waitforpin;
>        iic_ibmocp_data[i]->udelay = 80;
>        iic_ibmocp_data[i]->mdelay = 80;
>

Andrew,

the entier ibm_ibmocp_data has beeen removed, found other ways arround it


Armin


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH]IBM OCP I2C
@ 2002-05-07 18:33 andrew may
  2002-05-07 19:54 ` andrew may
  0 siblings, 1 reply; 14+ messages in thread
From: andrew may @ 2002-05-07 18:33 UTC (permalink / raw)
  To: Armin; +Cc: linuxppc-embedded


Here is a patch that provides a new iic_xfer function. It is
inside of a #if 1 and all the code it should replace is in the
#else clause.

I have not been gotten to test the stuff from user space and I have
not checked the return values of the function yet. I don't know
how I can test failure conditions on the bus itself either.

I have been sucked into doing some other stuff recently but seeing
how others are starting to play with this now I though I should get
this out there again.

There is also a fix in iic_ibmocp_init for some unused/unitilized
vars.

I also removed some unneeded #if MODULE's.

I did not pull out my clk div stuff so that part of the patch
can be dropped.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]IBM OCP I2C
  2002-05-07 18:33 andrew may
@ 2002-05-07 19:54 ` andrew may
  0 siblings, 0 replies; 14+ messages in thread
From: andrew may @ 2002-05-07 19:54 UTC (permalink / raw)
  To: andrew may; +Cc: Armin, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 14 bytes --]

And the patch

[-- Attachment #2: i2c-new.gz --]
[-- Type: application/octet-stream, Size: 6060 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-05-07 19:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-24  3:01 [PATCH] IBM ocp I2C andrew may
2002-04-24  3:01 ` andrew may
2002-04-24  4:36   ` Armin
2002-04-24 15:18     ` andrew may
2002-04-24 18:26   ` andrew may
2002-04-24 18:45     ` Armin
2002-05-01 17:05     ` Armin
2002-04-26 20:48 ` Armin
2002-04-27  3:35   ` andrew may
2002-04-28  4:09     ` Armin
  -- strict thread matches above, loose matches on Subject: below --
2002-04-29 21:40 [PATCH]IBM OCP I2C andrew may
     [not found] ` <3CCDE113.5000700@pacbell.net>
2002-04-30  0:05   ` andrew may
2002-05-07 18:33 andrew may
2002-05-07 19:54 ` andrew may

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).