Arthur Heymans has uploaded a new change for review. ( https://review.coreboot.org/19027 )
Change subject: nb/amd/amdk8/exit_from_self.c: Use linker instead of include ......................................................................
nb/amd/amdk8/exit_from_self.c: Use linker instead of include
Don't #include *. but use linker.
Change-Id: I716b37e71ab3a4409709357f50f79e3149ede2b6 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/northbridge/amd/amdk8/Makefile.inc M src/northbridge/amd/amdk8/exit_from_self.c M src/northbridge/amd/amdk8/f.h M src/northbridge/amd/amdk8/raminit.c M src/northbridge/amd/amdk8/raminit.h M src/northbridge/amd/amdk8/raminit_f.c M src/northbridge/amd/amdk8/raminit_f_dqs.c 7 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/19027/1
diff --git a/src/northbridge/amd/amdk8/Makefile.inc b/src/northbridge/amd/amdk8/Makefile.inc index 29274f4..7497a07 100644 --- a/src/northbridge/amd/amdk8/Makefile.inc +++ b/src/northbridge/amd/amdk8/Makefile.inc @@ -4,6 +4,9 @@ ramstage-y += misc_control.c ramstage-y += get_sblk_pci1234.c ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c +ifeq ($(CONFIG_K8_REV_F_SUPPORT),y) +romstage-$(CONFIG_HAVE_ACPI_RESUME) += exit_from_self.c +endif
# Enable this if you want to check the values of the PCI routing registers. # Call show_all_routes() anywhere amdk8.h is included. diff --git a/src/northbridge/amd/amdk8/exit_from_self.c b/src/northbridge/amd/amdk8/exit_from_self.c index 6da042f..4b6f4e2 100644 --- a/src/northbridge/amd/amdk8/exit_from_self.c +++ b/src/northbridge/amd/amdk8/exit_from_self.c @@ -13,7 +13,13 @@ * GNU General Public License for more details. */
+#include <arch/io.h> +#include <console/console.h> +#include <cpu/x86/lapic.h> +#include <delay.h> +#include <cpu/amd/mtrr.h> #include "raminit.h" +#include "f.h"
void exit_from_self(int controllers, const struct mem_controller *ctrl, struct sys_info *sysinfo) diff --git a/src/northbridge/amd/amdk8/f.h b/src/northbridge/amd/amdk8/f.h index 359a1d6..c14b1c8 100644 --- a/src/northbridge/amd/amdk8/f.h +++ b/src/northbridge/amd/amdk8/f.h @@ -584,4 +584,6 @@ } #endif
+void dqs_restore_MC_NVRAM(unsigned int dev); + #endif /* AMDK8_F_H */ diff --git a/src/northbridge/amd/amdk8/raminit.c b/src/northbridge/amd/amdk8/raminit.c index 9f333fd..e4071d7 100644 --- a/src/northbridge/amd/amdk8/raminit.c +++ b/src/northbridge/amd/amdk8/raminit.c @@ -2263,7 +2263,7 @@ return carry_over; }
-static void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl) +void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl) {
uint32_t hole_startk; @@ -2322,7 +2322,6 @@
#endif
-#define TIMEOUT_LOOPS 300000 #if CONFIG_RAMINIT_SYSINFO static void sdram_enable(int controllers, const struct mem_controller *ctrl, struct sys_info *sysinfo) #else diff --git a/src/northbridge/amd/amdk8/raminit.h b/src/northbridge/amd/amdk8/raminit.h index 610d7d3..95a99b0 100644 --- a/src/northbridge/amd/amdk8/raminit.h +++ b/src/northbridge/amd/amdk8/raminit.h @@ -14,6 +14,9 @@ struct sys_info; void exit_from_self(int controllers, const struct mem_controller *ctrl, struct sys_info *sysinfo); void setup_resource_map(const unsigned int *register_values, int max); +void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl); + +#define TIMEOUT_LOOPS 300000
#if defined(__PRE_RAM__) && CONFIG_RAMINIT_SYSINFO void sdram_initialize(int controllers, const struct mem_controller *ctrl, void *sysinfo); diff --git a/src/northbridge/amd/amdk8/raminit_f.c b/src/northbridge/amd/amdk8/raminit_f.c index aa2349d..6665df9 100644 --- a/src/northbridge/amd/amdk8/raminit_f.c +++ b/src/northbridge/amd/amdk8/raminit_f.c @@ -2859,8 +2859,6 @@ return; }
-#define TIMEOUT_LOOPS 300000 - #include "raminit_f_dqs.c"
#if CONFIG_HW_MEM_HOLE_SIZEK != 0 @@ -2918,7 +2916,7 @@ return carry_over; }
-static void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl) +void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl) {
uint32_t hole_startk; @@ -2970,9 +2968,6 @@ }
} -#endif -#if CONFIG_HAVE_ACPI_RESUME -#include "exit_from_self.c" #endif
static void sdram_enable(int controllers, const struct mem_controller *ctrl, diff --git a/src/northbridge/amd/amdk8/raminit_f_dqs.c b/src/northbridge/amd/amdk8/raminit_f_dqs.c index 204339c..1e99f33 100644 --- a/src/northbridge/amd/amdk8/raminit_f_dqs.c +++ b/src/northbridge/amd/amdk8/raminit_f_dqs.c @@ -1848,7 +1848,7 @@ } #endif
-static void dqs_restore_MC_NVRAM(unsigned int dev) +void dqs_restore_MC_NVRAM(unsigned int dev) { int pos = 0; u32 reg;