Help configuring CF / IDE on 8315E

IMPL Soft3 UK (Implementation Software Design: BELCHAM Rob +44 1562 741515 ext 345) IMPLSoft3UK at
Fri Sep 10 22:20:53 EST 2010

Hi List,


Can anyone point me at any examples or documentation which might help me
configure the IDE/ATA driver for our custom board ?


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 ?


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 :-



void nonpci_ide_init_hwif_ports( hw_regs_t *hw, ide_ioreg_t data_port,

  ide_ioreg_t ctrl_port, int *irq )


  int i;

  static ide_ioreg_t mapped = 0;


  if( data_port == 0 ) {

    /* Clear this array if no data_port supplied */

    for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i )

      hw->io_ports[ i ] = data_port;

    hw->io_ports[ IDE_CONTROL_OFFSET ] = 0;


  else {

    /* Only configure if base address (data_port) is supplied */

    if( mapped == 0 )

      mapped = (ide_ioreg_t)( ioremap(data_port, 64) );

    for( i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i )

      hw->io_ports[ i ] = mapped + (i*4);


    hw->io_ports[ IDE_CONTROL_OFFSET ] = mapped + 0x38;    




int nonpci_ide_default_irq( ide_ioreg_t base ) {

  return base == FPGA_IDE ? IDE_IRQ : 0;



ide_ioreg_t nonpci_ide_default_io_base( int index ) {

  return index == 0 ? FPGA_IDE : 0;



But the closest thing to this I can find in the kernel I'm using for the
new board ( 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 ?


#define IDE_ARM_IO      0x1f0



static int __init ide_arm_init(void)


      unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;

      hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };


      if (!request_region(base, 8, DRV_NAME)) {

            printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",

                        DRV_NAME, base, base + 7);

            return -EBUSY;



      if (!request_region(ctl, 1, DRV_NAME)) {

            printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",

                        DRV_NAME, ctl);

            release_region(base, 8);

            return -EBUSY;



      memset(&hw, 0, sizeof(hw));

      ide_std_init_ports(&hw, base, ctl);

      hw.irq = IDE_ARM_IRQ;

      hw.chipset = ide_generic;


      return ide_host_add(NULL, hws, NULL);



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 ?



Kind Regards,



Principal Engineer, DSP


Tel: +44 1562 741515 ext 345

Email: IMPLSoft3UK at

Web: | |

:-) Build Teamwork   :-) Take Ownership   :-) Don't Waste Resources
:-) Clean Workplace = Clean Mind   :-) Respect Guidelines and Policies
:-) Improve Yourself and Help Others   :-) Don't Forget to Smile and Say
Thank You  

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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Linuxppc-dev mailing list