On 30.06.2010 14:48, Michael Karcher wrote:
Am Mittwoch, den 30.06.2010, 14:12 +0200 schrieb
-static const struct winbond_chip *
+uint8_t probe_id_winbond(uint16_t port)
+ chipid = sio_read(port, 0x20);
+ return chipid;
If this code is to be run on any board, I would like some more checking
in it. For example, you could check that sio_read(port, 0x20) returns
0xFF after the w836xx_ext_leave(). There are ECs that don't need any
enables, so they will respond after the Winbond enable although they are
not Winbond chips. But they still respond after the disable, so they can
be told apart.
That's a good idea, but my goal for this patch was to have a quick hack
for discussion. We want to use the discovery code from superiotool or
the Linux kernel to avoid a maintenance headache.
I think the kernel has Super I/O detection in the
Maybe one could also peek there for safe detection code that has been
tested on thousands of boxes.
I'm not sure if that code is still tested at all. AFAIK most modern
systems offer Parport discovery via ACPI.
struct winbond_chip *winbond_superio_chipdef(void)
const struct winbond_chip * chip = NULL;
- chipid = sio_read(base, 0x20);
for (i = 0; i < ARRAY_SIZE(winbond_chips); i++)
- if (winbond_chips[i].device_id == chipid)
+ if (winbond_chips[i].device_id == superio.model)
chip = &winbond_chips[i];
Hmm. Shouldn't you check that superio.vendor is in fact
Yes, thanks for pointing this out.
We should try to decide which exernal superio detection code we want
before we proceed.