Edward O'Callaghan (eocallaghan@alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6554
-gerrit
commit eafd40b04690e4313b985044c72a3309137dc1dc Author: Edward O'Callaghan eocallaghan@alterapraxis.com Date: Sun Aug 10 00:12:30 2014 +1000
southbridge/amd/cs5536: Make cs5536_enable_smbus() a weak symbol
On some boards the SMBus is hardwired and so we need to override cs5536_enable_smbus() with a dummy function in the board support. Thus we make cs5536_enable_smbus() a weak symbol.
Fix boards to match by removing the .c include.
Change-Id: Iada97edf0591556b64eb8b63752379fdf0366ece Signed-off-by: Edward O'Callaghan eocallaghan@alterapraxis.com --- src/mainboard/aaeon/pfm-540i_revb/romstage.c | 2 +- src/mainboard/amd/db800/romstage.c | 2 +- src/mainboard/amd/norwich/romstage.c | 2 +- src/mainboard/amd/rumba/romstage.c | 2 +- src/mainboard/artecgroup/dbe61/romstage.c | 2 +- src/mainboard/bachmann/ot200/romstage.c | 2 +- src/mainboard/digitallogic/msm800sev/romstage.c | 2 +- src/mainboard/iei/pcisa-lx-800-r10/romstage.c | 2 +- src/mainboard/iei/pm-lx-800-r11/romstage.c | 2 +- src/mainboard/iei/pm-lx2-800-r10/romstage.c | 2 +- src/mainboard/lippert/hurricane-lx/romstage.c | 2 +- src/mainboard/lippert/literunner-lx/romstage.c | 2 +- src/mainboard/lippert/roadrunner-lx/romstage.c | 2 +- src/mainboard/lippert/spacerunner-lx/romstage.c | 2 +- src/mainboard/pcengines/alix1c/romstage.c | 2 +- src/mainboard/pcengines/alix2d/romstage.c | 2 +- src/mainboard/traverse/geos/romstage.c | 2 +- src/mainboard/winent/pl6064/romstage.c | 2 +- src/mainboard/wyse/s50/romstage.c | 2 +- src/southbridge/amd/cs5536/cs5536.h | 6 ++++ src/southbridge/amd/cs5536/early_setup.c | 10 +++++++ src/southbridge/amd/cs5536/early_smbus.c | 39 ------------------------- src/southbridge/amd/cs5536/smbus.h | 9 ++++++ 23 files changed, 44 insertions(+), 58 deletions(-)
diff --git a/src/mainboard/aaeon/pfm-540i_revb/romstage.c b/src/mainboard/aaeon/pfm-540i_revb/romstage.c index f80ef95..47c411a 100644 --- a/src/mainboard/aaeon/pfm-540i_revb/romstage.c +++ b/src/mainboard/aaeon/pfm-540i_revb/romstage.c @@ -33,7 +33,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/smsc/smscsuperio/smscsuperio.h> #include "northbridge/amd/lx/raminit.h" diff --git a/src/mainboard/amd/db800/romstage.c b/src/mainboard/amd/db800/romstage.c index 564380e..5db1d98 100644 --- a/src/mainboard/amd/db800/romstage.c +++ b/src/mainboard/amd/db800/romstage.c @@ -30,7 +30,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627hf/w83627hf.h> diff --git a/src/mainboard/amd/norwich/romstage.c b/src/mainboard/amd/norwich/romstage.c index 9322508..4f82db5 100644 --- a/src/mainboard/amd/norwich/romstage.c +++ b/src/mainboard/amd/norwich/romstage.c @@ -30,7 +30,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include "northbridge/amd/lx/raminit.h"
diff --git a/src/mainboard/amd/rumba/romstage.c b/src/mainboard/amd/rumba/romstage.c index c5a3fc3..5a0f8a4 100644 --- a/src/mainboard/amd/rumba/romstage.c +++ b/src/mainboard/amd/rumba/romstage.c @@ -10,7 +10,7 @@ #include "cpu/x86/msr.h" #include <cpu/amd/gx2def.h> #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c"
#define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1) diff --git a/src/mainboard/artecgroup/dbe61/romstage.c b/src/mainboard/artecgroup/dbe61/romstage.c index 7276b30..4631027 100644 --- a/src/mainboard/artecgroup/dbe61/romstage.c +++ b/src/mainboard/artecgroup/dbe61/romstage.c @@ -31,7 +31,7 @@ #include "southbridge/amd/cs5536/cs5536.h" #include "spd_table.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include "northbridge/amd/lx/raminit.h"
diff --git a/src/mainboard/bachmann/ot200/romstage.c b/src/mainboard/bachmann/ot200/romstage.c index 39385c7..684e0f9 100644 --- a/src/mainboard/bachmann/ot200/romstage.c +++ b/src/mainboard/bachmann/ot200/romstage.c @@ -31,7 +31,7 @@ #include "cpu/x86/msr.h" #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include "northbridge/amd/lx/raminit.h"
diff --git a/src/mainboard/digitallogic/msm800sev/romstage.c b/src/mainboard/digitallogic/msm800sev/romstage.c index 986e918..932e0aa 100644 --- a/src/mainboard/digitallogic/msm800sev/romstage.c +++ b/src/mainboard/digitallogic/msm800sev/romstage.c @@ -11,7 +11,7 @@ #include <cpu/amd/car.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627hf/w83627hf.h> diff --git a/src/mainboard/iei/pcisa-lx-800-r10/romstage.c b/src/mainboard/iei/pcisa-lx-800-r10/romstage.c index a75691c..7de802c 100644 --- a/src/mainboard/iei/pcisa-lx-800-r10/romstage.c +++ b/src/mainboard/iei/pcisa-lx-800-r10/romstage.c @@ -30,7 +30,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627hf/w83627hf.h> diff --git a/src/mainboard/iei/pm-lx-800-r11/romstage.c b/src/mainboard/iei/pm-lx-800-r11/romstage.c index bf34e9a..b591f0d 100644 --- a/src/mainboard/iei/pm-lx-800-r11/romstage.c +++ b/src/mainboard/iei/pm-lx-800-r11/romstage.c @@ -30,7 +30,7 @@ #include <cpu/x86/msr.h> #include <cpu/amd/lxdef.h> #include <southbridge/amd/cs5536/cs5536.h> -#include <southbridge/amd/cs5536/early_smbus.c> +#include <southbridge/amd/cs5536/smbus.h> #include <southbridge/amd/cs5536/early_setup.c> #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627ehg/w83627ehg.h> diff --git a/src/mainboard/iei/pm-lx2-800-r10/romstage.c b/src/mainboard/iei/pm-lx2-800-r10/romstage.c index b34bce4..ef62ce9 100644 --- a/src/mainboard/iei/pm-lx2-800-r10/romstage.c +++ b/src/mainboard/iei/pm-lx2-800-r10/romstage.c @@ -31,7 +31,7 @@ #include <cpu/x86/msr.h> #include <cpu/amd/lxdef.h> #include <southbridge/amd/cs5536/cs5536.h> -#include <southbridge/amd/cs5536/early_smbus.c> +#include <southbridge/amd/cs5536/smbus.h> #include <southbridge/amd/cs5536/early_setup.c> #include <superio/smsc/smscsuperio/smscsuperio.h> #include <northbridge/amd/lx/raminit.h> diff --git a/src/mainboard/lippert/hurricane-lx/romstage.c b/src/mainboard/lippert/hurricane-lx/romstage.c index 063721b..71da941 100644 --- a/src/mainboard/lippert/hurricane-lx/romstage.c +++ b/src/mainboard/lippert/hurricane-lx/romstage.c @@ -33,7 +33,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/ite/common/ite.h> #include <superio/ite/it8712f/it8712f.h> diff --git a/src/mainboard/lippert/literunner-lx/romstage.c b/src/mainboard/lippert/literunner-lx/romstage.c index 174620a..dc90053 100644 --- a/src/mainboard/lippert/literunner-lx/romstage.c +++ b/src/mainboard/lippert/literunner-lx/romstage.c @@ -33,7 +33,7 @@ #include "cpu/x86/msr.h" #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/ite/common/ite.h> #include <superio/ite/it8712f/it8712f.h> diff --git a/src/mainboard/lippert/roadrunner-lx/romstage.c b/src/mainboard/lippert/roadrunner-lx/romstage.c index 2642373..9d970b7 100644 --- a/src/mainboard/lippert/roadrunner-lx/romstage.c +++ b/src/mainboard/lippert/roadrunner-lx/romstage.c @@ -33,7 +33,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/ite/common/ite.h> #include <superio/ite/it8712f/it8712f.h> diff --git a/src/mainboard/lippert/spacerunner-lx/romstage.c b/src/mainboard/lippert/spacerunner-lx/romstage.c index 9d5539e..5964388 100644 --- a/src/mainboard/lippert/spacerunner-lx/romstage.c +++ b/src/mainboard/lippert/spacerunner-lx/romstage.c @@ -33,7 +33,7 @@ #include "cpu/x86/msr.h" #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/ite/common/ite.h> #include <superio/ite/it8712f/it8712f.h> diff --git a/src/mainboard/pcengines/alix1c/romstage.c b/src/mainboard/pcengines/alix1c/romstage.c index 204f0bd..080553b 100644 --- a/src/mainboard/pcengines/alix1c/romstage.c +++ b/src/mainboard/pcengines/alix1c/romstage.c @@ -36,7 +36,7 @@ #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
/* The ALIX1.C has no SMBus; the setup is hard-wired. */ -static void cs5536_enable_smbus(void) { } +void cs5536_enable_smbus(void) { }
#include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> diff --git a/src/mainboard/pcengines/alix2d/romstage.c b/src/mainboard/pcengines/alix2d/romstage.c index 18453ac..07bf77e 100644 --- a/src/mainboard/pcengines/alix2d/romstage.c +++ b/src/mainboard/pcengines/alix2d/romstage.c @@ -36,7 +36,7 @@ #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
/* The ALIX.2D has no SMBus; the setup is hard-wired. */ -static void cs5536_enable_smbus(void) { } +void cs5536_enable_smbus(void) { }
#include "southbridge/amd/cs5536/early_setup.c"
diff --git a/src/mainboard/traverse/geos/romstage.c b/src/mainboard/traverse/geos/romstage.c index 36d55a7..95ceffa 100644 --- a/src/mainboard/traverse/geos/romstage.c +++ b/src/mainboard/traverse/geos/romstage.c @@ -31,7 +31,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include "northbridge/amd/lx/raminit.h"
diff --git a/src/mainboard/winent/pl6064/romstage.c b/src/mainboard/winent/pl6064/romstage.c index 6a38355..9d1f631 100644 --- a/src/mainboard/winent/pl6064/romstage.c +++ b/src/mainboard/winent/pl6064/romstage.c @@ -32,7 +32,7 @@ #include <cpu/amd/lxdef.h> #include "southbridge/amd/cs5536/cs5536.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627hf/w83627hf.h> diff --git a/src/mainboard/wyse/s50/romstage.c b/src/mainboard/wyse/s50/romstage.c index 9e5dd53..deeeaf5 100644 --- a/src/mainboard/wyse/s50/romstage.c +++ b/src/mainboard/wyse/s50/romstage.c @@ -30,7 +30,7 @@ #include "cpu/x86/msr.h" #include <cpu/amd/gx2def.h> #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" +#include <southbridge/amd/cs5536/smbus.h> #include "southbridge/amd/cs5536/early_setup.c"
static inline int spd_read_byte(unsigned int device, unsigned int address) diff --git a/src/southbridge/amd/cs5536/cs5536.h b/src/southbridge/amd/cs5536/cs5536.h index b722560..530ab2e 100644 --- a/src/southbridge/amd/cs5536/cs5536.h +++ b/src/southbridge/amd/cs5536/cs5536.h @@ -451,4 +451,10 @@ void chipsetinit(void); #endif #endif
+/** + * Note: Some boards do not have SMBus and are hard-wired, so we leave this + * symbol weak as to be able to override it in 'romstage.c' of board support. + */ +void cs5536_enable_smbus(void) __attribute__((weak)); + #endif /* _CS5536_H */ diff --git a/src/southbridge/amd/cs5536/early_setup.c b/src/southbridge/amd/cs5536/early_setup.c index cff6512..02af392 100644 --- a/src/southbridge/amd/cs5536/early_setup.c +++ b/src/southbridge/amd/cs5536/early_setup.c @@ -249,6 +249,16 @@ void cs5536_setup_onchipuart(int uart) } }
+/* Initialization for SMBus Controller */ +void cs5536_enable_smbus(void) +{ + /* Set SCL freq and enable SMB controller */ + /*outb((0x20 << 1) | SMB_CTRL2_ENABLE, smbus_io_base + SMB_CTRL2); */ + outb((0x7F << 1) | SMB_CTRL2_ENABLE, SMBUS_IO_BASE + SMB_CTRL2); + + /* Setup SMBus host controller address to 0xEF */ + outb((0xEF | SMB_ADD_SAEN), SMBUS_IO_BASE + SMB_ADD); +}
/* note: you can't do prints in here in most cases, * and we don't want to hang on serial, so they are diff --git a/src/southbridge/amd/cs5536/early_smbus.c b/src/southbridge/amd/cs5536/early_smbus.c deleted file mode 100644 index d1483b1..0000000 --- a/src/southbridge/amd/cs5536/early_smbus.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007 Advanced Micro Devices, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "cs5536.h" -#include "smbus.h" - -/* initialization for SMBus Controller */ -static void cs5536_enable_smbus(void) -{ - - /* Set SCL freq and enable SMB controller */ - /*outb((0x20 << 1) | SMB_CTRL2_ENABLE, smbus_io_base + SMB_CTRL2); */ - outb((0x7F << 1) | SMB_CTRL2_ENABLE, SMBUS_IO_BASE + SMB_CTRL2); - - /* Setup SMBus host controller address to 0xEF */ - outb((0xEF | SMB_ADD_SAEN), SMBUS_IO_BASE + SMB_ADD); - -} - -static inline int smbus_read_byte(unsigned device, unsigned address) -{ - return do_smbus_read_byte(SMBUS_IO_BASE, device, address); -} diff --git a/src/southbridge/amd/cs5536/smbus.h b/src/southbridge/amd/cs5536/smbus.h index 3e72dad..30238e3 100644 --- a/src/southbridge/amd/cs5536/smbus.h +++ b/src/southbridge/amd/cs5536/smbus.h @@ -21,6 +21,7 @@ #define _CS5536_SMBUS_H
#include <device/smbus_def.h> +#include "cs5536.h"
int smbus_start_condition(unsigned smbus_io_base); int smbus_stop_condition(unsigned smbus_io_base); @@ -33,4 +34,12 @@ unsigned char do_smbus_read_byte(unsigned smbus_io_base, unsigned char device, unsigned char address);
+/* TODO: seems to be dead code?? */ +#if 0 +static inline int smbus_read_byte(unsigned device, unsigned address) +{ + return do_smbus_read_byte(SMBUS_IO_BASE, device, address); +} +#endif + #endif /* _CS5536_SMBUS_H */