<html 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" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[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 Definitions */
 @font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@Batang";
        panose-1:2 3 6 0 0 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 link=blue vlink=purple>

<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>&nbsp;</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'>&nbsp;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>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[root@freescale
chips]# insmod dis_fpc.ko<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 177.808848]
i2c 0-0068: uevent<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 498.528032]
In dis_fpc_init<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 498.531851]
i2c-core: driver [dis_fpc] registered<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 498.532446]
In dis_fpc_attach_adapter<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 498.539770]
I2C: No RXAK<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 498.540970]
In dis_fpc_attach_adapter<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 498.556785]
I2C: MAL<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 498.557476]
In dis_fpc_attach_adapter<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 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:10.0pt;color:#1F497D'>[&nbsp; 498.568240]
I2C: No RXAK<o:p></o:p></span></p>

<div>

<p class=MsoNormal><span style='font-size:12.0pt;color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;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:12.0pt;color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;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:12.0pt;color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;color:#1F497D'>Thanks &amp;
Regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;color:#1F497D'>Uma</span><span
style='font-size:12.0pt;color:#1F497D'><o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;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>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>One I2C driver has been included in 0603 bsp, you can refer to it.</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>It has no&nbsp;specific driver for GPIO, but you can find some
initializing&nbsp;code for GPIO in arch/powerpc/platforms/512x/mpc5125_ads.c.
and mpc512x_pm_test.c.</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>

<blockquote style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p>&nbsp;</o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
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:
12.0pt;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>-&gt; 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>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></p>

<p class=MsoNormal>-&gt; 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>&nbsp;</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>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:12.0pt'>Thanks &amp; Regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt'>Uma<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</blockquote>

</div>

</body>

</html>