From b0161fd2d8679882a50d1f3ce55cdf69278aa32f Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 3 Apr 2017 15:35:09 +0200 Subject: southbridge/via/vt8237r: Get rid of #include early_smbus.c Use linker instead of '#include *.c'. The smbus_fixup() was changed not to use a structure that's defined by a northbridge since multiple different northbridges can be used. Instead the caller now directly passed the memory slot details. Change-Id: Ia369ece6365accbc531736fc463c713bbc134807 Signed-off-by: Lubomir Rintel Reviewed-on: https://review.coreboot.org/19082 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Paul Menzel --- src/southbridge/via/k8t890/early_car.c | 1 + src/southbridge/via/vt8237r/Makefile.inc | 1 + src/southbridge/via/vt8237r/early_smbus.c | 10 ++++++---- src/southbridge/via/vt8237r/vt8237r.h | 3 +-- 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/southbridge/via') diff --git a/src/southbridge/via/k8t890/early_car.c b/src/southbridge/via/k8t890/early_car.c index efb6860045..22a6a47ab4 100644 --- a/src/southbridge/via/k8t890/early_car.c +++ b/src/southbridge/via/k8t890/early_car.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "k8x8xx.h" /* The 256 bytes of NVRAM for S3 storage, 256B aligned */ diff --git a/src/southbridge/via/vt8237r/Makefile.inc b/src/southbridge/via/vt8237r/Makefile.inc index 6c62dbc20c..e8946a5d61 100644 --- a/src/southbridge/via/vt8237r/Makefile.inc +++ b/src/southbridge/via/vt8237r/Makefile.inc @@ -24,6 +24,7 @@ ramstage-y += usb.c ramstage-$(CONFIG_PIRQ_ROUTE) += pirq.c ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c +romstage-y += early_smbus.c smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c endif diff --git a/src/southbridge/via/vt8237r/early_smbus.c b/src/southbridge/via/vt8237r/early_smbus.c index 96a5c1b49d..3257cc241d 100644 --- a/src/southbridge/via/vt8237r/early_smbus.c +++ b/src/southbridge/via/vt8237r/early_smbus.c @@ -18,6 +18,9 @@ #if !defined(__ROMCC__) #include #endif +#include +#include +#include #include #include #include @@ -218,12 +221,11 @@ void enable_smbus(void) * * @param ctrl The memory controller and SMBus addresses. */ -void smbus_fixup(const struct mem_controller *ctrl) +void smbus_fixup(const u8 channel0[], int ram_slots) { - int i, ram_slots, current_slot = 0; + int i, current_slot = 0; u8 result = 0; - ram_slots = ARRAY_SIZE(ctrl->channel0); if (!ram_slots) { printk(BIOS_ERR, "smbus_fixup() thinks there are no RAM slots!\n"); return; @@ -242,7 +244,7 @@ void smbus_fixup(const struct mem_controller *ctrl) if (current_slot > ram_slots) current_slot = 0; - result = smbus_read_byte(ctrl->channel0[current_slot], + result = smbus_read_byte(channel0[current_slot], SPD_MEMORY_TYPE); current_slot++; PRINT_DEBUG("."); diff --git a/src/southbridge/via/vt8237r/vt8237r.h b/src/southbridge/via/vt8237r/vt8237r.h index d745b49af2..95f9750a40 100644 --- a/src/southbridge/via/vt8237r/vt8237r.h +++ b/src/southbridge/via/vt8237r/vt8237r.h @@ -136,8 +136,7 @@ struct vt8237_network_rom { u8 smbus_read_byte(u8 dimm, u8 offset); void smbus_write_byte(u8 dimm, u8 offset, u8 data); void enable_smbus(void); -void smbus_fixup(const struct mem_controller *ctrl); -// these are in vt8237_early_smbus.c - do they really belong there? +void smbus_fixup(const u8 channel0[], int ram_slots); void vt8237_sb_enable_fid_vid(void); void enable_rom_decode(void); void vt8237_early_spi_init(void); -- cgit v1.2.3