Skip to contentSkip to conversation

IDE routines for the ENCM3 in 2.6

DISCUSSION Ashlesha Shintre 2 participants 4 messages Aug 10, 2006 – Aug 12, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,

I m trying to modify the 2.4 kernel board support files for the Encore M3 board with the AU 1500 MIPS processor, so that they will compile for the 2.6 kernel.

Now, the Encore M3 has a compact flash IDE device on the VIA Southbridge, which in turn is on a PCI bus.

In the ide.c file in the /mips/au1000/encm3/ directory, there are the following IDE routines:

1) encm3_ide_probe
2) encm3_ide_default_irq
3) encm3_ide_ops
etc.

Basically, all of these routines check if a base register has been assigned to the IDE device and if not,
i) call the encm3_ide_probe routine to probe for the device on the PCI bus using the pci_find_device function.
ii)assign an interrupt number and a base address to the device:

regbase = pdev->resource[0].start;
irq = pdev->irq;

I read the Documentation/pci.txt file which says that the pci_find_device is an obsolete function and has been superseded by the pci_get_device function.

Also, it says that probing for the device is taken care of during the execution of the pci_register_driver function. Am I confusing two things?

I dont think that just replacing the pci_find_device with the pci_get_device will work, as I m not still aware of the changed version of ide routines and interfaces in the 2.6 kernel.

Any pointers?

I m a linux newbie and apologise if my questions sound unclear -- please ask for clarification in that case.

Thank you,
Ashlesha.

#1 lore raw

Ar Iau, 2006-08-10 am 16:27 -0700, ysgrifennodd Ashlesha Shintre:

Quoted 3 lines

Also, it says that probing for the device is taken care of during the execution of the pci_register_driver function. Am I confusing two things?

The existing VIA ide/pci/via82cxxx driver should support any of the standard IDE components found on VIA southbridges up to and including the 8237 (8237A should make 2.6.18)

Depending on your MIPS board arrangement you may need your early boot up code to kick the chip into the right mode and allocate the PCI resources. You may need the VIA BIOS programmers guide for the relevant chip but if I remember rightly its all pretty trivial for the VIA.

Alan

#2 lore raw
Quoted 5 lines · Alan Cox

Ar Iau, 2006-08-10 am 16:27 -0700, ysgrifennodd Ashlesha Shintre:

Quoted 3 lines

Also, it says that probing for the device is taken care of during the execution of the pci_register_driver function. Am I confusing two things?

Quoted 9 lines

The existing VIA ide/pci/via82cxxx driver should support any of the standard IDE components found on VIA southbridges up to and including the 8237 (8237A should make 2.6.18)

Depending on your MIPS board arrangement you may need your early boot up code to kick the chip into the right mode and allocate the PCI resources. You may need the VIA BIOS programmers guide for the relevant chip but if I remember rightly its all pretty trivial for the VIA.

Thanks for your inputs Alan. I m still a bit confused though as to why its only the IDE routines which need to be written in a separate ide.c file. My point is that there are other devices such as serial ports and floppy disk drives on the Southbridge too, for which there dont seem to be separate routines in the arch/mips/encm3 directory.

Quoted 3 lines

Alan

#3 lore raw

Ar Gwe, 2006-08-11 am 17:33 -0700, ysgrifennodd Ashlesha Shintre:

Quoted 5 lines

Thanks for your inputs Alan. I m still a bit confused though as to why its only the IDE routines which need to be written in a separate ide.c file. My point is that there are other devices such as serial ports and floppy disk drives on the Southbridge too, for which there dont seem to be separate routines in the arch/mips/encm3 directory.

The IDE should not need seperate routines either, just any boot time set up of resources that the core IDE expects the BIOS or firmware to have done (if your boot firmware does not).