It turns out that the code which enables specific LDN is somewhat buggy.

Instead of enable the device the device gets disabled. However after some time the serial line gets back, most likely some "enable resources" might fix it. 
I'm attaching patch which somewhat fixes the problem and changes the function to look same in all superio code. Some boards even did not convert the dev->enabled to 0,1 values. 


Signed-off-by: Rudolf Marek <r.marek@assembler.cz> 
Acked-by: Peter Stuge <peter@stuge.se>




git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6373 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Rudolf Marek 2011-02-19 14:51:31 +00:00
parent b8cdd9b450
commit 0c8e664713
20 changed files with 20 additions and 35 deletions

View File

@ -77,7 +77,7 @@ static void f71805f_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -74,7 +74,7 @@ static void f71859_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -81,7 +81,7 @@ static void f71863fg_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -79,7 +79,7 @@ static void f71872_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -80,7 +80,7 @@ static void f71889_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -78,7 +78,7 @@ static void i3100_pnp_enable(device_t dev)
{
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, dev->enabled);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -99,7 +99,7 @@ static void it8712f_pnp_enable(device_t dev)
{
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, dev->enabled);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -122,7 +122,7 @@ static void it8716f_pnp_enable(device_t dev)
{
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, dev->enabled);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -105,7 +105,7 @@ static void lpc47b272_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -116,7 +116,7 @@ static void lpc47b397_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -103,7 +103,7 @@ static void lpc47m10x_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -87,7 +87,7 @@ static void lpc47m15x_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -119,7 +119,7 @@ static void lpc47n217_pnp_enable_resources(device_t dev)
static void lpc47n217_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
lpc47n217_pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
lpc47n217_pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -116,7 +116,7 @@ void lpc47n227_pnp_enable_resources(device_t dev)
void lpc47n227_pnp_enable(device_t dev)
{
pnp_enter_conf_state(dev);
lpc47n227_pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
lpc47n227_pnp_set_enable(dev, !!dev->enabled);
pnp_exit_conf_state(dev);
}

View File

@ -193,7 +193,7 @@ static void smsc_pnp_enable(device_t dev)
{
smsc_pnp_enter_conf_state(dev);
pnp_set_logical_device(dev);
(dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
smsc_pnp_exit_conf_state(dev);
}

View File

@ -186,12 +186,9 @@ static void vt1211_pnp_set_resources(struct device *dev)
static void vt1211_pnp_enable(device_t dev)
{
if (dev->enabled)
return;
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -76,12 +76,9 @@ static void w83627dhg_pnp_enable_resources(device_t dev)
static void w83627dhg_pnp_enable(device_t dev)
{
if (!dev->enabled)
return;
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -160,12 +160,9 @@ static void w83627ehg_pnp_enable_resources(device_t dev)
static void w83627ehg_pnp_enable(device_t dev)
{
if (dev->enabled)
return;
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -179,12 +179,9 @@ static void w83627hf_pnp_enable_resources(device_t dev)
static void w83627hf_pnp_enable(device_t dev)
{
if (dev->enabled)
return;
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}

View File

@ -70,12 +70,9 @@ static void w83697hf_pnp_set_resources(device_t dev)
static void w83697hf_pnp_enable(device_t dev)
{
if (dev->enabled)
return;
pnp_enter_ext_func_mode(dev);
pnp_set_logical_device(dev);
pnp_set_enable(dev, 0);
pnp_set_enable(dev, !!dev->enabled);
pnp_exit_ext_func_mode(dev);
}