On Thu, Mar 29, 2007 at 06:26:16AM -0400, Corey Osgood wrote:
I'm still not entirely convinced that the previous version was flawed, but this one has more features, and covers some of what Uwe had marked as TODO anyways, with more that I'll fix up later.
My guess is that the problem was that the pnp_set_iobase(dev, PNP_IDX_IO0, iobase); was not done explicitly before. I think I'll be able to test some code this evening...
I'd prefer a less invasive patch, though. We should leave superio.c as is for now, until we can really test that part of the code. Let's just fix it8705f_early_serial.c for now.
+/*----------------------------------------------------------------------------------
- Function: pnp_enter_conf_state
- Parameters: dev - high 8 bits = Super I/O port
- Return Value: None
- Description: Enable access to the IT8705F's configuration registers.
- */
Please don't copy these code comments. We should use Doxygen-style comments for all new code we write (or "normal" code comments).
+static inline void pnp_enter_conf_state(device_t dev) {
- /* Port 0x2e is constant, no matter what */
Nope, I think for the IT8705F it can be 0x4e, too. The special address used for entering MB PnP mode is always 0x2e, though (if I'm reading the data sheet correctly). However, this is not the same as the configuration port which will be used later...
+static void pnp_exit_conf_state(device_t dev) {
- outb(0xaa, 0x2e);
}
I'm not sure this is correct. The datasheet suggests that the current version is correct. Is this a copy-n-paste error from the other Super I/O?
- pnp_enter_conf_state(dev);
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
- pnp_exit_conf_state(dev);
Ok, this looks good. Let's do it this way, if it's enough to make the Super I/O work...
See attached (untested, yet) patch for a new version which fixes several issues I was doing wrong in the ITE Super I/Os (the others need fixing, too; I'll post patches).
Does this patch work on your board?
Uwe.