Alan Cox escreveu:
So you're saying I should support all PIO modes? If so, I would have to
make conditional code, checking perhaps a module param to sort which PIO
mode to use.
If you advertise PIO0-PIO4 as supported the core IDE code will do all the
work on figuring which modes are supported by the attached devices. You
just need to be able to set them.
Alan
Ok, so I've been studying that (I was quite lost for a time, I confess,
I'm not that much familiar with the IDE subsystem, so please bear with
me ;-) ).
So I need to set up a hook for 'set_pio_mode()', so that when the IDE
subsystem detects a device and figures the most suitable PIO mode for
the device, it will call the 'set_pio_mode' routine provided by the
driver in order to configure the host controller for that PIO mode.
This also means that my host controller driver should always default to
PIO Mode 0, as the initial host controller setup that is carried out by
the 'init_hwif' routine, allowing devices to be detected. Afterwards,
the IDE subsystem detects the most suitable PIO mode and calls
'set_pio_mode' to change that configuration.
Am I correct on this?
There's just only one issue; normally, I would setup the specific
timings (t0, t1, t2, t2i, etc) in the 'pio_set_mode' hook. However, if
you look further in the driver, those timings aren't defined through a
memory controller but instead manually enforced by 'ndelay' calls (arghhh).
This means that in my low-level procedures for reading and writing, I
need to have access to the timings (or the struct ide_timing)
corresponding to the PIO mode selected, in order to use the correct delays.
My question is: which is the best way to accomplish this? Declaring a
global struct ide_timing variable pointer that always holds the correct
ide_timing struct to the selected PIO mode? Or should I always check (in
some manner) what is the current PIO mode and then select the adequate
delays?
Best regards,
João
--
************************************************************************
João Ramos <joao.ramos@xxxxxxx>
INOV INESC Inovação - ESTG Leiria
Escola Superior de Tecnologia e Gestão de Leiria
Edíficio C1, Campus 2
Morro do Lena, Alto do Vieiro
Leiria
2411-901 Leiria
Portugal
Tel: +351244843424
Fax: +351244843424
************************************************************************
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html