All of lore.kernel.org
 help / color / mirror / Atom feed
* speed of /dev/i2c-2 in imx6q sabre-lite
@ 2013-08-13 18:03 Thanassis Silis
  2013-08-13 18:30 ` Eric Nelson
  0 siblings, 1 reply; 7+ messages in thread
From: Thanassis Silis @ 2013-08-13 18:03 UTC (permalink / raw)
  To: meta-freescale

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

Hello everyone, 
I am unaware as to who sets clock speed on the i2c bus and specifically on the /dev/i2c-2 which is exposed on the board so as to drive external equipment.
I am looking into the linux-boundary kernel files in yocto (dylan) build dir, but I cannot figure out where that is set.
To be honest I don't even know if i'll find that info there, but it seems like the right place to start (after googling about it of course).

So who determined the speed (standard mode, fast mode, etc) for the external i2c? if it is a driver , which one should I be looking for?

The reason is I am trying to drive some TMC222 low-power stepper motor control ICs, but they do not respond.
Note I have successfully connected a number of other i2c ICs (among others the pca9505x).

An answer is not necessary. Any pointers as to how to go about it , so I can learn about this is more than welcome.
Thank you for your help.
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 1179 bytes --]

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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-13 18:03 speed of /dev/i2c-2 in imx6q sabre-lite Thanassis Silis
@ 2013-08-13 18:30 ` Eric Nelson
  2013-08-14 12:25   ` Thanassis Silis
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Nelson @ 2013-08-13 18:30 UTC (permalink / raw)
  To: Thanassis Silis; +Cc: meta-freescale

Hi Thanassis,

On 08/13/2013 11:03 AM, Thanassis Silis wrote:
> Hello everyone,
> I am unaware as to who sets clock speed on the i2c bus and specifically
> on the /dev/i2c-2 which is exposed on the board so as to drive external
> equipment.
 >
> I am looking into the linux-boundary kernel files in yocto (dylan) build
> dir, but I cannot figure out where that is set.
> To be honest I don't even know if i'll find that info there, but it
> seems like the right place to start (after googling about it of course).
>
> So who determined the speed (standard mode, fast mode, etc) for the
> external i2c? if it is a driver , which one should I be looking for?
>

This structure defines the speed of the I2C bus:
	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/mach-mx6/board-mx6_nitrogen6x.c#L434

To change it for i2c-2 by itself, you'll need to make a copy of
that, change the speed value and pass the copy to the routine
imx6q_add_imx_i2c():
	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/mach-mx6/board-mx6_nitrogen6x.c#L1320

> The reason is I am trying to drive some TMC222 low-power stepper motor
> control ICs, but they do not respond.
> Note I have successfully connected a number of other i2c ICs (among
> others the pca9505x).
>
> An answer is not necessary. Any pointers as to how to go about it , so I
> can learn about this is more than welcome.
> Thank you for your help.
>

This should be straightforward.

Let me know if you have any trouble.

Regards,


Eric




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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-13 18:30 ` Eric Nelson
@ 2013-08-14 12:25   ` Thanassis Silis
  2013-08-14 14:28     ` Eric Nelson
  0 siblings, 1 reply; 7+ messages in thread
From: Thanassis Silis @ 2013-08-14 12:25 UTC (permalink / raw)
  To: Eric Nelson; +Cc: meta-freescale

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

Eric,
thank you very much for the answer (I have compiled kernel 3.0.35_1.1.0 by the way, but the code hasn't changed since then).
I do have a question (in my limited kernel knowledge) :)
https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/drivers/i2c/busses/i2c-imx.c#L63

this looks like a module, but as I see in my sabrelite's  /lib/modules/3.0.35-1.1.0+g2dc5560
modules.builtin:92:kernel/drivers/i2c/busses/i2c-imx.ko
it is built in the kernel.

What is the purpose of i2c-imx and how does it relate to imx* boards?

Thank you for your help!

> Date: Tue, 13 Aug 2013 11:30:00 -0700
> From: eric.nelson@boundarydevices.com
> To: djnass_18@hotmail.com
> CC: meta-freescale@yoctoproject.org
> Subject: Re: [meta-freescale] speed of /dev/i2c-2 in imx6q sabre-lite
> 
> Hi Thanassis,
> 
> On 08/13/2013 11:03 AM, Thanassis Silis wrote:
> > Hello everyone,
> > I am unaware as to who sets clock speed on the i2c bus and specifically
> > on the /dev/i2c-2 which is exposed on the board so as to drive external
> > equipment.
>  >
> > I am looking into the linux-boundary kernel files in yocto (dylan) build
> > dir, but I cannot figure out where that is set.
> > To be honest I don't even know if i'll find that info there, but it
> > seems like the right place to start (after googling about it of course).
> >
> > So who determined the speed (standard mode, fast mode, etc) for the
> > external i2c? if it is a driver , which one should I be looking for?
> >
> 
> This structure defines the speed of the I2C bus:
> 	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/mach-mx6/board-mx6_nitrogen6x.c#L434
> 
> To change it for i2c-2 by itself, you'll need to make a copy of
> that, change the speed value and pass the copy to the routine
> imx6q_add_imx_i2c():
> 	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/mach-mx6/board-mx6_nitrogen6x.c#L1320
> 
> > The reason is I am trying to drive some TMC222 low-power stepper motor
> > control ICs, but they do not respond.
> > Note I have successfully connected a number of other i2c ICs (among
> > others the pca9505x).
> >
> > An answer is not necessary. Any pointers as to how to go about it , so I
> > can learn about this is more than welcome.
> > Thank you for your help.
> >
> 
> This should be straightforward.
> 
> Let me know if you have any trouble.
> 
> Regards,
> 
> 
> Eric
> 
> 
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 3095 bytes --]

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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-14 12:25   ` Thanassis Silis
@ 2013-08-14 14:28     ` Eric Nelson
  2013-08-14 15:40       ` Thanassis Silis
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Nelson @ 2013-08-14 14:28 UTC (permalink / raw)
  To: Thanassis Silis; +Cc: meta-freescale

Hi Thanassis,

On 08/14/2013 05:25 AM, Thanassis Silis wrote:
> Eric,
> thank you very much for the answer (I have compiled kernel 3.0.35_1.1.0
> by the way, but the code hasn't changed since then).
> I do have a question (in my limited kernel knowledge) :)
> https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/drivers/i2c/busses/i2c-imx.c#L63
>
> this looks like a module, but as I see in my sabrelite's
> /lib/modules/3.0.35-1.1.0+g2dc5560
> modules.builtin:92:kernel/drivers/i2c/busses/i2c-imx.ko
> it is built in the kernel.
>
> What is the purpose of i2c-imx and how does it relate to imx* boards?
>
i2c-imx is the device driver for the i2c part on many i.MX
processors, including i.MX6.

Because it's needed for many internal operations, we compile it
into the kernel, instead of as a separately loadable module.

This is a bit of "kernel configuration 101", but when you configure
drivers into the Linux kernel, you can generally choose either
"*" or "M", shown as "y" or "m" in the .config file:
	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/configs/nitrogen6x_defconfig#L144

When you choose '*' or 'y', the driver is included in the
kernel itself (uImage on our normal usage).

If you choose 'm', the external .ko file is built.

This is mostly important at startup, since you have to have
a working filesystem and utilities like 'modprobe' or 'insmod'
to load a .ko file.

Regards,


Eric


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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-14 14:28     ` Eric Nelson
@ 2013-08-14 15:40       ` Thanassis Silis
  2013-08-14 16:12         ` Eric Nelson
  0 siblings, 1 reply; 7+ messages in thread
From: Thanassis Silis @ 2013-08-14 15:40 UTC (permalink / raw)
  To: Eric Nelson; +Cc: meta-freescale

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

Hi Eric,
kernel configuration is no stranger to me as I am a longtime slackware user, but thank you for the info. It is always nice to know I have not understood something the wrong way.

What I do not know is how the IMX_I2C_BIT_RATE (which is 100kHz) is related to the imxi2c_platform_data structure.
The file drivers/i2c/busses/i2c_imx.c doesn't include arch/arm/mach-mx6/board_nitrogen6x.c (or _sabrelite.c for that matter) or vice-versa. So is it correct to say that i2c-imx.c sets the bitrate earlier in the boot process and then the platform specific code, overwrites/alters that value to what is set in board_nitrogen6x.c ?

Thank you!

> Date: Wed, 14 Aug 2013 07:28:04 -0700
> From: eric.nelson@boundarydevices.com
> To: djnass_18@hotmail.com
> CC: meta-freescale@yoctoproject.org
> Subject: Re: [meta-freescale] speed of /dev/i2c-2 in imx6q sabre-lite
> 
> Hi Thanassis,
> 
> On 08/14/2013 05:25 AM, Thanassis Silis wrote:
> > Eric,
> > thank you very much for the answer (I have compiled kernel 3.0.35_1.1.0
> > by the way, but the code hasn't changed since then).
> > I do have a question (in my limited kernel knowledge) :)
> > https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/drivers/i2c/busses/i2c-imx.c#L63
> >
> > this looks like a module, but as I see in my sabrelite's
> > /lib/modules/3.0.35-1.1.0+g2dc5560
> > modules.builtin:92:kernel/drivers/i2c/busses/i2c-imx.ko
> > it is built in the kernel.
> >
> > What is the purpose of i2c-imx and how does it relate to imx* boards?
> >
> i2c-imx is the device driver for the i2c part on many i.MX
> processors, including i.MX6.
> 
> Because it's needed for many internal operations, we compile it
> into the kernel, instead of as a separately loadable module.
> 
> This is a bit of "kernel configuration 101", but when you configure
> drivers into the Linux kernel, you can generally choose either
> "*" or "M", shown as "y" or "m" in the .config file:
> 	https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.0.0/arch/arm/configs/nitrogen6x_defconfig#L144
> 
> When you choose '*' or 'y', the driver is included in the
> kernel itself (uImage on our normal usage).
> 
> If you choose 'm', the external .ko file is built.
> 
> This is mostly important at startup, since you have to have
> a working filesystem and utilities like 'modprobe' or 'insmod'
> to load a .ko file.
> 
> Regards,
> 
> 
> Eric
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 3100 bytes --]

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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-14 15:40       ` Thanassis Silis
@ 2013-08-14 16:12         ` Eric Nelson
  2013-08-14 18:44           ` Thanassis Silis
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Nelson @ 2013-08-14 16:12 UTC (permalink / raw)
  To: Thanassis Silis; +Cc: meta-freescale

Hi Thanassis,

On 08/14/2013 08:40 AM, Thanassis Silis wrote:
> Hi Eric,
> kernel configuration is no stranger to me as I am a longtime slackware
> user, but thank you for the info. It is always nice to know I have not
> understood something the wrong way.
>

Sorry if I was being pedantic. I thought that's what you were asking
and folks come in with all kinds of background.

> What I do not know is how the IMX_I2C_BIT_RATE (which is 100kHz) is
> related to the imxi2c_platform_data structure.
> The file drivers/i2c/busses/i2c_imx.c doesn't include
> arch/arm/mach-mx6/board_nitrogen6x.c (or _sabrelite.c for that matter)
> or vice-versa. So is it correct to say that i2c-imx.c sets the bitrate
> earlier in the boot process and then the platform specific code,
> overwrites/alters that value to what is set in board_nitrogen6x.c ?

Nope. The driver's "probe" routine gets handed the imxi2c_platform_data
structure from the device registration procedure in
board-mx6_nitrogen.c.

IOW, there's a run-time path, not a compile-time path. Otherwise, every
driver would need to know about every board that used it.

If you look closely, all of the uses of IMX_I2C_BIT_RATE are conditional
on either missing "pdata" (platform data) or a zero value for bitrate.

Regards,


Eric


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

* Re: speed of /dev/i2c-2 in imx6q sabre-lite
  2013-08-14 16:12         ` Eric Nelson
@ 2013-08-14 18:44           ` Thanassis Silis
  0 siblings, 0 replies; 7+ messages in thread
From: Thanassis Silis @ 2013-08-14 18:44 UTC (permalink / raw)
  To: Eric Nelson; +Cc: meta-freescale

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

don;t worry about it. and thank you for all the info :)

> Date: Wed, 14 Aug 2013 09:12:52 -0700
> From: eric.nelson@boundarydevices.com
> To: djnass_18@hotmail.com
> CC: meta-freescale@yoctoproject.org
> Subject: Re: [meta-freescale] speed of /dev/i2c-2 in imx6q sabre-lite
> 
> Hi Thanassis,
> 
> On 08/14/2013 08:40 AM, Thanassis Silis wrote:
> > Hi Eric,
> > kernel configuration is no stranger to me as I am a longtime slackware
> > user, but thank you for the info. It is always nice to know I have not
> > understood something the wrong way.
> >
> 
> Sorry if I was being pedantic. I thought that's what you were asking
> and folks come in with all kinds of background.
> 
> > What I do not know is how the IMX_I2C_BIT_RATE (which is 100kHz) is
> > related to the imxi2c_platform_data structure.
> > The file drivers/i2c/busses/i2c_imx.c doesn't include
> > arch/arm/mach-mx6/board_nitrogen6x.c (or _sabrelite.c for that matter)
> > or vice-versa. So is it correct to say that i2c-imx.c sets the bitrate
> > earlier in the boot process and then the platform specific code,
> > overwrites/alters that value to what is set in board_nitrogen6x.c ?
> 
> Nope. The driver's "probe" routine gets handed the imxi2c_platform_data
> structure from the device registration procedure in
> board-mx6_nitrogen.c.
> 
> IOW, there's a run-time path, not a compile-time path. Otherwise, every
> driver would need to know about every board that used it.
> 
> If you look closely, all of the uses of IMX_I2C_BIT_RATE are conditional
> on either missing "pdata" (platform data) or a zero value for bitrate.
> 
> Regards,
> 
> 
> Eric
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 2144 bytes --]

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

end of thread, other threads:[~2013-08-14 18:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 18:03 speed of /dev/i2c-2 in imx6q sabre-lite Thanassis Silis
2013-08-13 18:30 ` Eric Nelson
2013-08-14 12:25   ` Thanassis Silis
2013-08-14 14:28     ` Eric Nelson
2013-08-14 15:40       ` Thanassis Silis
2013-08-14 16:12         ` Eric Nelson
2013-08-14 18:44           ` Thanassis Silis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.