On Tuesday 14 July 2009 00:34:12 Tom Sylla wrote:
On Mon, Jul 13, 2009 at 4:14 PM, Harald Gutmannharald.gutmann@gmx.net
wrote:
[*] How to figure out the UDMA modes supported by the attached devices in coreboot? As this is according to IDE devices which can be changed at any time, it would be necessary to check for supported UDMA modes on run-time.
I am still confused by the more basic question of how you are detecting the presence of an 80 conductor cable.
The AMD74xx ide controller has the advantage that the presence of the 80 conductor cable is reflected in it's pci-registers. I determined that through the kernel driver source for this controller and verified it with replacing the 80 wire cable with a 40 wire cable. The bit 0x52 of the pci-registers from the AMD74xx controller changes to 04 when using a 40 wire cable.
You need a GPIO or one of the mechanisms described in the PATA spec from T13.
This shouldn't be necessary for the 80 wire cable, as this is reflected in the pci-register.
You need that in addition to knowing what the drives support. To know what the drives support you look in their identify device information (also specified by T13, but you can find examples in the kernel or Hale Landis' code)
This is ATM the interesting part which needs to be done. Figuring out which UDMA mode is supported by the attached drives, as the kernel driver sets the mode to a value which is also in the pci-registers of that controller. The value is at offset 0x62-0x63 for primary master & slave. My little previous attached patch does check if the 80 wire cable is used, and if it's used sets the 0x62-0x63 values to those which are needed by my connected devices. This part is right now hardcoded, and should be done via looking up the device information and set the value dynamically to work with every ide-device.
Regards, Harald