Author: ruik Date: Sat Feb 19 15:51:31 2011 New Revision: 6373 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6373
Log: 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
Modified: trunk/src/superio/fintek/f71805f/superio.c trunk/src/superio/fintek/f71859/superio.c trunk/src/superio/fintek/f71863fg/superio.c trunk/src/superio/fintek/f71872/superio.c trunk/src/superio/fintek/f71889/superio.c trunk/src/superio/intel/i3100/superio.c trunk/src/superio/ite/it8712f/superio.c trunk/src/superio/ite/it8716f/superio.c trunk/src/superio/smsc/lpc47b272/superio.c trunk/src/superio/smsc/lpc47b397/superio.c trunk/src/superio/smsc/lpc47m10x/superio.c trunk/src/superio/smsc/lpc47m15x/superio.c trunk/src/superio/smsc/lpc47n217/superio.c trunk/src/superio/smsc/lpc47n227/superio.c trunk/src/superio/smsc/smscsuperio/superio.c trunk/src/superio/via/vt1211/vt1211.c trunk/src/superio/winbond/w83627dhg/superio.c trunk/src/superio/winbond/w83627ehg/superio.c trunk/src/superio/winbond/w83627hf/superio.c trunk/src/superio/winbond/w83697hf/superio.c
Modified: trunk/src/superio/fintek/f71805f/superio.c ============================================================================== --- trunk/src/superio/fintek/f71805f/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/fintek/f71805f/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -77,7 +77,7 @@ { 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); }
Modified: trunk/src/superio/fintek/f71859/superio.c ============================================================================== --- trunk/src/superio/fintek/f71859/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/fintek/f71859/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -74,7 +74,7 @@ { 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); }
Modified: trunk/src/superio/fintek/f71863fg/superio.c ============================================================================== --- trunk/src/superio/fintek/f71863fg/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/fintek/f71863fg/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -81,7 +81,7 @@ { 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); }
Modified: trunk/src/superio/fintek/f71872/superio.c ============================================================================== --- trunk/src/superio/fintek/f71872/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/fintek/f71872/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -79,7 +79,7 @@ { 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); }
Modified: trunk/src/superio/fintek/f71889/superio.c ============================================================================== --- trunk/src/superio/fintek/f71889/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/fintek/f71889/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -80,7 +80,7 @@ { 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); }
Modified: trunk/src/superio/intel/i3100/superio.c ============================================================================== --- trunk/src/superio/intel/i3100/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/intel/i3100/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -78,7 +78,7 @@ { 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); }
Modified: trunk/src/superio/ite/it8712f/superio.c ============================================================================== --- trunk/src/superio/ite/it8712f/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/ite/it8712f/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -99,7 +99,7 @@ { 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); }
Modified: trunk/src/superio/ite/it8716f/superio.c ============================================================================== --- trunk/src/superio/ite/it8716f/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/ite/it8716f/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -122,7 +122,7 @@ { 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); }
Modified: trunk/src/superio/smsc/lpc47b272/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47b272/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47b272/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -105,7 +105,7 @@ { 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); }
Modified: trunk/src/superio/smsc/lpc47b397/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47b397/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47b397/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -116,7 +116,7 @@ { 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); }
Modified: trunk/src/superio/smsc/lpc47m10x/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47m10x/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47m10x/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -103,7 +103,7 @@ { 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); }
Modified: trunk/src/superio/smsc/lpc47m15x/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47m15x/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47m15x/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -87,7 +87,7 @@ { 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); }
Modified: trunk/src/superio/smsc/lpc47n217/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47n217/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47n217/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -119,7 +119,7 @@ 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); }
Modified: trunk/src/superio/smsc/lpc47n227/superio.c ============================================================================== --- trunk/src/superio/smsc/lpc47n227/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47n227/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -116,7 +116,7 @@ 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); }
Modified: trunk/src/superio/smsc/smscsuperio/superio.c ============================================================================== --- trunk/src/superio/smsc/smscsuperio/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/smscsuperio/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -193,7 +193,7 @@ { 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); }
Modified: trunk/src/superio/via/vt1211/vt1211.c ============================================================================== --- trunk/src/superio/via/vt1211/vt1211.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/via/vt1211/vt1211.c Sat Feb 19 15:51:31 2011 (r6373) @@ -186,12 +186,9 @@
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); }
Modified: trunk/src/superio/winbond/w83627dhg/superio.c ============================================================================== --- trunk/src/superio/winbond/w83627dhg/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/winbond/w83627dhg/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -76,12 +76,9 @@
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); }
Modified: trunk/src/superio/winbond/w83627ehg/superio.c ============================================================================== --- trunk/src/superio/winbond/w83627ehg/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/winbond/w83627ehg/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -160,12 +160,9 @@
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); }
Modified: trunk/src/superio/winbond/w83627hf/superio.c ============================================================================== --- trunk/src/superio/winbond/w83627hf/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/winbond/w83627hf/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -179,12 +179,9 @@
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); }
Modified: trunk/src/superio/winbond/w83697hf/superio.c ============================================================================== --- trunk/src/superio/winbond/w83697hf/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/winbond/w83697hf/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -70,12 +70,9 @@
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); }
On 2/19/11 6:51 AM, repository service wrote:
Modified: trunk/src/superio/smsc/lpc47n227/superio.c
--- trunk/src/superio/smsc/lpc47n227/superio.c Thu Feb 17 21:48:45 2011 (r6372) +++ trunk/src/superio/smsc/lpc47n227/superio.c Sat Feb 19 15:51:31 2011 (r6373) @@ -116,7 +116,7 @@ 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); }
How's this different? I like the ?: notion more than the :: notion.
Stefan Reinauer wrote:
+++ trunk/src/superio/smsc/lpc47n227/superio.c Sat Feb 19 15:51:31 2011 (r6373)
..
- lpc47n227_pnp_set_enable(dev, (dev->enabled) ? 1 : 0);
- lpc47n227_pnp_set_enable(dev, !!dev->enabled);
How's this different?
This particular file did not have a functional change, but others did.
I like the ?: notion more than the :: notion.
I also like !! and I guess this file was changed to make this code look the same everywhere.
Maybe it could even be moved to a common function.
//Peter