superio/smscsuperio: Fix chip detection
There was dereference of NULL dev->ops in pnp_enter/exit_conf_mode() as those calls were made before pnp_enable_devices() was run. Since hardware did not enter configuration mode, detection failed with ID and REV read as 0xff. Change-Id: If13086707cd86e392890ccf4f717e13a87f3317f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5949 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
afc8d98769
commit
33eaf3a715
|
@ -231,11 +231,12 @@ static void enable_dev(device_t dev)
|
||||||
u8 test7;
|
u8 test7;
|
||||||
|
|
||||||
if (first_time) {
|
if (first_time) {
|
||||||
|
|
||||||
|
pnp_enter_conf_mode_55(dev);
|
||||||
|
|
||||||
/* Read the device ID and revision of the Super I/O chip. */
|
/* Read the device ID and revision of the Super I/O chip. */
|
||||||
pnp_enter_conf_mode(dev);
|
|
||||||
superio_id = pnp_read_config(dev, DEVICE_ID_REG);
|
superio_id = pnp_read_config(dev, DEVICE_ID_REG);
|
||||||
superio_rev = pnp_read_config(dev, DEVICE_REV_REG);
|
superio_rev = pnp_read_config(dev, DEVICE_REV_REG);
|
||||||
pnp_exit_conf_mode(dev);
|
|
||||||
|
|
||||||
/* TODO: Error handling? */
|
/* TODO: Error handling? */
|
||||||
|
|
||||||
|
@ -257,6 +258,8 @@ static void enable_dev(device_t dev)
|
||||||
test7 |= (1 << 0);
|
test7 |= (1 << 0);
|
||||||
pnp_write_config(dev, DEVICE_TEST7_REG, test7);
|
pnp_write_config(dev, DEVICE_TEST7_REG, test7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pnp_exit_conf_mode_aa(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the correct Super I/O. */
|
/* Find the correct Super I/O. */
|
||||||
|
|
Loading…
Reference in New Issue