<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="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 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@SimSun";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:Arial;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
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=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Hi List,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Can anyone point me at any examples or documentation which might help
me configure the IDE/ATA driver for our custom board ?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Our board has an MPC8315E which interfaces to a compact flash card in
true IDE mode via an FPGA on the peripheral bus. The CF registers will be
memory mapped as part of the FPGA address space, but how do I tell the IDE
driver where this is ?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>The legacy board, (runs a 2.4 kernel ) which this new board is
replacing had a file in drivers/ide/ which setup these addresses & IRQ with
a couple of functions :-<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>void nonpci_ide_init_hwif_ports( hw_regs_t *hw, ide_ioreg_t data_port,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> ide_ioreg_t ctrl_port, int *irq )<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>{<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> int i;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> static ide_ioreg_t mapped = 0;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> if( data_port == 0 ) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> /* Clear this array if no data_port supplied */<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i )<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw->io_ports[ i ] = data_port;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw->io_ports[ IDE_CONTROL_OFFSET ] = 0;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> else {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> /* Only configure if base address (data_port) is supplied */<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> if( mapped == 0 )<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> mapped = (ide_ioreg_t)( ioremap(data_port, 64) );<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> for( i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i )<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw->io_ports[ i ] = mapped + (i*4);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw->io_ports[ IDE_CONTROL_OFFSET ] = mapped + 0x38; <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>int nonpci_ide_default_irq( ide_ioreg_t base ) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> return base == FPGA_IDE ? IDE_IRQ : 0;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>ide_ioreg_t nonpci_ide_default_io_base( int index ) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> return index == 0 ? FPGA_IDE : 0;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>But the closest thing to this I can find in the kernel I'm using for
the new board (2.6.29.6) is ide_arm.c (see below), but this appears to be
setting up io ports. Can I just hack a copy of this file & replace the IO
port numbers with the physical FPGA addresses ?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>#define IDE_ARM_IO 0x1f0<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>#define IDE_ARM_IRQ IRQ_HARDDISK<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>static int __init ide_arm_init(void)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>{<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> if (!request_region(base, 8, DRV_NAME)) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not
free.\n",<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> DRV_NAME, base, base + 7);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> return -EBUSY;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> if (!request_region(ctl, 1, DRV_NAME)) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> printk(KERN_ERR "%s: I/O resource 0x%lX not
free.\n",<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> DRV_NAME, ctl);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> release_region(base, 8);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> return -EBUSY;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> memset(&hw, 0, sizeof(hw));<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> ide_std_init_ports(&hw, base, ctl);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw.irq = IDE_ARM_IRQ;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> hw.chipset = ide_generic;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> return ide_host_add(NULL, hws, NULL);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Surely I can't be the first person to connect a compact flash to a
powerquicc processor in this way : does a suitable driver exist somewhere
already ?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>Kind Regards,</span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'> </span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>BELCHAM, Rob</span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>Principal Engineer, DSP</span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>MIDAS KLARK TEKNIK LIMITED</span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>Tel: +44 1562 741515 ext 345</span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>Email: <a
href="mailto:IMPLSoft3UK@music-group.com">IMPLSoft3UK@music-group.com</a></span></font><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><font size=2 color=black face=Arial><span
style='font-size:10.0pt;color:black'>Web: <a
href="http://www.midasconsoles.com">www.midasconsoles.com</a> | <a
href="http://www.klarkteknik.com">www.klarkteknik.com</a> | <a
href="http://www.ktsquareone.com">www.ktsquareone.com</a></span></font><o:p></o:p></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=1 color=navy face=Arial><span style='font-size:
9.0pt;color:navy'><br>
</span></font><font size=2 color=navy face=Wingdings><span style='font-size:
10.0pt;font-family:Wingdings;color:navy'>J</span></font><font size=1
color=navy><span style='font-size:9.0pt;color:navy'> Build
Teamwork </span></font><font size=2 color=navy face=Wingdings><span
style='font-size:10.0pt;font-family:Wingdings;color:navy'>J</span></font><font
size=1 color=navy><span style='font-size:9.0pt;color:navy'> Take
Ownership </span></font><font size=2 color=navy face=Wingdings><span
style='font-size:10.0pt;font-family:Wingdings;color:navy'>J</span></font><font
size=1 color=navy><span style='font-size:9.0pt;color:navy'> Don’t
Waste Resources </span></font><font size=2 color=navy
face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings;color:navy'>J</span></font><font
size=1 color=navy><span style='font-size:9.0pt;color:navy'> Clean
Workplace = Clean Mind </span></font><font size=2 color=navy
face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings;color:navy'>J</span></font><font
size=1 color=navy><span style='font-size:9.0pt;color:navy'> Respect
Guidelines and Policies </span></font><font size=2 color=navy
face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings;color:navy'>J</span></font><font
size=1 color=navy><span style='font-size:9.0pt;color:navy'> Improve
Yourself and Help Others </span></font><font size=2
color=navy face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings;
color:navy'>J</span></font><font size=1 color=navy><span style='font-size:9.0pt;
color:navy'> Don’t Forget to Smile and Say Thank You <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#595959" face=Arial><span
style='font-size:7.5pt;color:#595959'><br>
This email is intended exclusively for the addressee(s) named above and may
contain privileged and confidential information. If you are not (among) the
intended recipient(s), you may not copy, utilize or distribute any of the
information contained herein. If you have received this email in error, please
notify us immediately via return email and delete the original from your
mailbox. Thank you.</span></font><font size=1 color=navy><span
style='font-size:9.0pt;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face=Arial><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>