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 32518e825cfee458628409a14ce8c105251b330a Author: Edward O'Callaghan eocallaghan@alterapraxis.com Date: Sat Aug 9 20:22:22 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 | 1 - src/mainboard/amd/db800/romstage.c | 1 - src/mainboard/amd/norwich/romstage.c | 1 - src/mainboard/amd/rumba/romstage.c | 1 - src/mainboard/artecgroup/dbe61/romstage.c | 1 - src/mainboard/bachmann/ot200/romstage.c | 1 - src/mainboard/digitallogic/msm800sev/romstage.c | 1 - src/mainboard/iei/pcisa-lx-800-r10/romstage.c | 1 - src/mainboard/iei/pm-lx-800-r11/romstage.c | 1 - src/mainboard/iei/pm-lx2-800-r10/romstage.c | 1 - src/mainboard/lippert/hurricane-lx/romstage.c | 1 - src/mainboard/lippert/literunner-lx/romstage.c | 1 - src/mainboard/lippert/roadrunner-lx/romstage.c | 1 - src/mainboard/lippert/spacerunner-lx/romstage.c | 1 - src/mainboard/pcengines/alix1c/romstage.c | 2 +- src/mainboard/pcengines/alix2d/romstage.c | 2 +- src/mainboard/traverse/geos/romstage.c | 1 - src/mainboard/winent/pl6064/romstage.c | 1 - src/mainboard/wyse/s50/romstage.c | 1 - src/southbridge/amd/cs5536/Makefile.inc | 3 ++- src/southbridge/amd/cs5536/cs5536.h | 6 ++++++ src/southbridge/amd/cs5536/early_setup.c | 1 + src/southbridge/amd/cs5536/early_smbus.c | 7 ++++--- 23 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/src/mainboard/aaeon/pfm-540i_revb/romstage.c b/src/mainboard/aaeon/pfm-540i_revb/romstage.c index f80ef95..6ab4662 100644 --- a/src/mainboard/aaeon/pfm-540i_revb/romstage.c +++ b/src/mainboard/aaeon/pfm-540i_revb/romstage.c @@ -33,7 +33,6 @@ #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/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..7c73903 100644 --- a/src/mainboard/amd/db800/romstage.c +++ b/src/mainboard/amd/db800/romstage.c @@ -30,7 +30,6 @@ #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/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..0180229 100644 --- a/src/mainboard/amd/norwich/romstage.c +++ b/src/mainboard/amd/norwich/romstage.c @@ -30,7 +30,6 @@ #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/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..557d394 100644 --- a/src/mainboard/amd/rumba/romstage.c +++ b/src/mainboard/amd/rumba/romstage.c @@ -10,7 +10,6 @@ #include "cpu/x86/msr.h" #include <cpu/amd/gx2def.h> #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" #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..fdbb700 100644 --- a/src/mainboard/artecgroup/dbe61/romstage.c +++ b/src/mainboard/artecgroup/dbe61/romstage.c @@ -31,7 +31,6 @@ #include "southbridge/amd/cs5536/cs5536.h" #include "spd_table.h" #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" #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..16f4329 100644 --- a/src/mainboard/bachmann/ot200/romstage.c +++ b/src/mainboard/bachmann/ot200/romstage.c @@ -31,7 +31,6 @@ #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/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..2170677 100644 --- a/src/mainboard/digitallogic/msm800sev/romstage.c +++ b/src/mainboard/digitallogic/msm800sev/romstage.c @@ -11,7 +11,6 @@ #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/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..3e71432 100644 --- a/src/mainboard/iei/pcisa-lx-800-r10/romstage.c +++ b/src/mainboard/iei/pcisa-lx-800-r10/romstage.c @@ -30,7 +30,6 @@ #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/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..855a55b 100644 --- a/src/mainboard/iei/pm-lx-800-r11/romstage.c +++ b/src/mainboard/iei/pm-lx-800-r11/romstage.c @@ -30,7 +30,6 @@ #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/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..dafb2bd 100644 --- a/src/mainboard/iei/pm-lx2-800-r10/romstage.c +++ b/src/mainboard/iei/pm-lx2-800-r10/romstage.c @@ -31,7 +31,6 @@ #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/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..f9f7435 100644 --- a/src/mainboard/lippert/hurricane-lx/romstage.c +++ b/src/mainboard/lippert/hurricane-lx/romstage.c @@ -33,7 +33,6 @@ #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/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..3b6d496 100644 --- a/src/mainboard/lippert/literunner-lx/romstage.c +++ b/src/mainboard/lippert/literunner-lx/romstage.c @@ -33,7 +33,6 @@ #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/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..15bfa07 100644 --- a/src/mainboard/lippert/roadrunner-lx/romstage.c +++ b/src/mainboard/lippert/roadrunner-lx/romstage.c @@ -33,7 +33,6 @@ #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/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..d24a067 100644 --- a/src/mainboard/lippert/spacerunner-lx/romstage.c +++ b/src/mainboard/lippert/spacerunner-lx/romstage.c @@ -33,7 +33,6 @@ #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/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..e7f782b 100644 --- a/src/mainboard/traverse/geos/romstage.c +++ b/src/mainboard/traverse/geos/romstage.c @@ -31,7 +31,6 @@ #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/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..4bf213d 100644 --- a/src/mainboard/winent/pl6064/romstage.c +++ b/src/mainboard/winent/pl6064/romstage.c @@ -32,7 +32,6 @@ #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/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..73a143e 100644 --- a/src/mainboard/wyse/s50/romstage.c +++ b/src/mainboard/wyse/s50/romstage.c @@ -30,7 +30,6 @@ #include "cpu/x86/msr.h" #include <cpu/amd/gx2def.h> #include <spd.h> -#include "southbridge/amd/cs5536/early_smbus.c" #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/Makefile.inc b/src/southbridge/amd/cs5536/Makefile.inc index f36dcc5..9e159c5 100644 --- a/src/southbridge/amd/cs5536/Makefile.inc +++ b/src/southbridge/amd/cs5536/Makefile.inc @@ -21,4 +21,5 @@ ramstage-y += cs5536.c ramstage-y += ide.c ramstage-y += pirq.c ramstage-y += smbus.c -romstage-y += smbus.c \ No newline at end of file +romstage-y += smbus.c +romstage-y += early_smbus.c 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 e6ef8ad..d9a042a 100644 --- a/src/southbridge/amd/cs5536/early_setup.c +++ b/src/southbridge/amd/cs5536/early_setup.c @@ -22,6 +22,7 @@ * This file implements the initialization sequence documented in section 4.2 of * AMD Geode GX Processor CS5536 Companion Device GeodeROM Porting Guide. */ +#include "cs5536.h"
/** * @brief Setup PCI IDSEL for CS5536 diff --git a/src/southbridge/amd/cs5536/early_smbus.c b/src/southbridge/amd/cs5536/early_smbus.c index d1483b1..e80cc0e 100644 --- a/src/southbridge/amd/cs5536/early_smbus.c +++ b/src/southbridge/amd/cs5536/early_smbus.c @@ -17,20 +17,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <arch/io.h> +#include <stdint.h> + #include "cs5536.h" #include "smbus.h"
/* initialization for SMBus Controller */ -static void cs5536_enable_smbus(void) +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)