<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3562" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Batang;
}
@font-face {
        font-family: Batang;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: @Batang;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal
}
SPAN.EmailStyle18 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=736185200-10092009><FONT face=Arial
color=#0000ff size=2>From the following error message, I2C controller can't
receive ACK from I2C client, so please make sure that the pins of I2C have been
initialized properly, or you can measure the tx signal and rx signal on the
right pins.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=736185200-10092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=736185200-10092009><FONT face=Arial
color=#0000ff size=2>B.R,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=736185200-10092009><FONT face=Arial
color=#0000ff size=2>Hongjun</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Uma Kanta Patro
[mailto:upatro@implantaire.com] <BR><B>Sent:</B> Wednesday, September 09, 2009
9:13 PM<BR><B>To:</B> Chen Hongjun-R66092;
linuxppc-dev@lists.ozlabs.org<BR><B>Subject:</B> RE: Queries regarding I2C and
GPIO driver for Freescale MPC5121e in Linux2.6.24 of BSP:
MPC512xADS_20090603-ltib.iso<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Hi Chen
Hongjun-R66092,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Thanks for your
response.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Actually for the GPIO driver I
am having some success and it is in progress.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">But regarding the I2C
chip(client) driver I am running witout any progress.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Actually I followed the
existing driver $(LINUX)\drivers\rtc\rtc-m41t80.c (for the RTC M41T62 existing
on the ADS5121Rev4.1 board).<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"> I made a legacy style
driver with attach_adapter and detach_client functions
defined.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">For testing purpose I geve the
chip address as 0x68(address of M41T62 existing on the board). But when I
tried ot insert my driver I get the error message as:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: #1f497d">[root@freescale chips]# insmod
dis_fpc.ko<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
177.808848] i2c 0-0068: uevent<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.528032] In dis_fpc_init<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.531851] i2c-core: driver [dis_fpc] registered<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.532446] In dis_fpc_attach_adapter<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.536827] i2c-adapter i2c-0: found normal entry for adapter 0, addr
0x55<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.537730] i2c-adapter i2c-0: master_xfer[0] W, addr=0x55,
len=0<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.538533] Doing write 0 bytes to 0x55 - 1 of 1
messages<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.539770] I2C: No RXAK<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.540970] In dis_fpc_attach_adapter<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.554500] i2c-adapter i2c-1: found normal entry for adapter 1, addr
0x55<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.555166] i2c-adapter i2c-1: master_xfer[0] W, addr=0x55,
len=0<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.555872] Doing write 0 bytes to 0x55 - 1 of 1
messages<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.556785] I2C: MAL<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.557476] In dis_fpc_attach_adapter<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.565733] i2c-adapter i2c-2: found normal entry for adapter 2, addr
0x55<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.566377] i2c-adapter i2c-2: master_xfer[0] W, addr=0x55,
len=0<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.567082] Doing write 0 bytes to 0x55 - 1 of 1
messages<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d">[
498.568240] I2C: No RXAK<o:p></o:p></SPAN></P>
<DIV>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d">So can you
tell me what other places do I need to change the configurations( like
i2c_platform_data definition, linking the chip to the specific I2C
module(0/1/2) with the adapter, configuring the speed of I2C communication
etc).<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d">I would like
to get any suggestion on making the I2C chip driver inpowerpc
platform.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d">Thanks &
Regards,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; COLOR: #1f497d">Uma</SPAN><SPAN
style="FONT-SIZE: 12pt; COLOR: #1f497d"><o:p></o:p></SPAN></P></DIV>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> Chen
Hongjun-R66092 [mailto:hong-jun.chen@freescale.com] <BR><B>Sent:</B>
Wednesday, September 09, 2009 5:39 AM<BR><B>To:</B> Uma Kanta Patro;
linuxppc-dev@lists.ozlabs.org<BR><B>Subject:</B> RE: Queries regarding I2C and
GPIO driver for Freescale MPC5121e in Linux2.6.24 of BSP:
MPC512xADS_20090603-ltib.iso<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">One
I2C driver has been included in 0603 bsp, you can refer to it.</SPAN><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">It has
no specific driver for GPIO, but you can find some initializing code
for GPIO in arch/powerpc/platforms/512x/mpc5125_ads.c. and
mpc512x_pm_test.c.</SPAN><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; MARGIN: 5pt 0in 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<P class=MsoNormal><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p> </o:p></SPAN></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">
<HR align=center width="100%" SIZE=2>
</SPAN></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
linuxppc-dev-bounces+hong-jun.chen=freescale.com@lists.ozlabs.org
[mailto:linuxppc-dev-bounces+hong-jun.chen=freescale.com@lists.ozlabs.org]
<B>On Behalf Of </B>Uma Kanta Patro<BR><B>Sent:</B> Tuesday, September 08,
2009 6:56 PM<BR><B>To:</B> linuxppc-dev@lists.ozlabs.org<BR><B>Subject:</B>
Queries regarding I2C and GPIO driver for Freescale MPC5121e in Linux2.6.24
of BSP: MPC512xADS_20090603-ltib.iso</SPAN><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal>Hi all,<o:p></o:p></P>
<P
class=MsoNormal>
I am a newbie to the powerpc linux kernel, but I have worked on some drivers
in arm architecture. I am finding powerpc architecture to be fully different
than that.<o:p></o:p></P>
<P class=MsoNormal>I am working on Freescale MPC5121e with the BSP
MPC512xADS_20090603-ltib.iso running in it on the ADS512101 Rev4.1
development kit.<o:p></o:p></P>
<P class=MsoNormal>Can anyone help me in finding some documentation for
understanding and working on the powerpc kernel. Any links to the powerpc
forums will also be appreciable.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>-> Currently I am going to develop an I2C client
driver for one slave microcontroller of our project.<o:p></o:p></P>
<P class=MsoNormal>I have some knowledge in the I2C client driver
making(legacy style and new style).<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I made a basic I2C client driver to probe for the chip
address and for testing I gave it the chip address 0x68(I2C chip address of
the M4T162 RTC, present on the board).<o:p></o:p></P>
<P class=MsoNormal>But while inserting my driver I am getting failure
message for the detection of my chip.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>So I would like to know what other formalities am I
lagging in my I2C chip driver.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>-> Also I am in a need for the GPIO driver for my
controller ot get interrupt on ht estate change. When I searched in the
kernel code I could not find any procedure to do that, also I could not find
out the procedure to access either any GPIO pin macros or any register to
remap with ioremap(). So please guide me in finding the proper way to do the
GPIO accessing and interrupt registration.<o:p></o:p></P>
<P class=MsoNormal>Will the ioremap() work on powerpc arch? If yes where can
I find the memory mapping(register definitions) to use for my GPIO driver
making.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Thanks for patience in reading my queries.<o:p></o:p></P>
<P class=MsoNormal>Any help is appreciable.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 12pt">Thanks &
Regards,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 12pt">Uma<o:p></o:p></SPAN></P>
<P
class=MsoNormal><o:p> </o:p></P></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>