summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2017-03-28 11:06:29 +0200
committerMartin Roth <martinroth@google.com>2017-04-17 17:22:41 +0200
commit1f8a28cbaea7bbebef4f4c626d1f0d094b76b151 (patch)
tree368c01bbd12387ff6325525c35621a387aabaee6 /src/northbridge/amd/amdk8
parent4c40229b4c242b0d699e0bf2adba7d7d95cceca3 (diff)
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> Reviewed-on: https://review.coreboot.org/19027 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/northbridge/amd/amdk8')
-rw-r--r--src/northbridge/amd/amdk8/Makefile.inc3
-rw-r--r--src/northbridge/amd/amdk8/exit_from_self.c6
-rw-r--r--src/northbridge/amd/amdk8/f.h2
-rw-r--r--src/northbridge/amd/amdk8/raminit.c3
-rw-r--r--src/northbridge/amd/amdk8/raminit.h3
-rw-r--r--src/northbridge/amd/amdk8/raminit_f.c7
-rw-r--r--src/northbridge/amd/amdk8/raminit_f_dqs.c2
7 files changed, 17 insertions, 9 deletions
diff --git a/src/northbridge/amd/amdk8/Makefile.inc b/src/northbridge/amd/amdk8/Makefile.inc
index 29274f48ec..7497a07437 100644
--- a/src/northbridge/amd/amdk8/Makefile.inc
+++ b/src/northbridge/amd/amdk8/Makefile.inc
@@ -4,6 +4,9 @@ ramstage-y += northbridge.c
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 6da042f673..4b6f4e2a57 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 db79fbf8d0..506a44970c 100644
--- a/src/northbridge/amd/amdk8/f.h
+++ b/src/northbridge/amd/amdk8/f.h
@@ -584,4 +584,6 @@ static inline void wait_all_core0_mem_trained(struct sys_info *sysinfo)
}
#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 48e2bb93bd..b10cd0ef43 100644
--- a/src/northbridge/amd/amdk8/raminit.c
+++ b/src/northbridge/amd/amdk8/raminit.c
@@ -2266,7 +2266,7 @@ static uint32_t hoist_memory(int controllers, const struct mem_controller *ctrl,
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;
@@ -2325,7 +2325,6 @@ static void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl)
#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 610d7d3d74..95a99b0d7f 100644
--- a/src/northbridge/amd/amdk8/raminit.h
+++ b/src/northbridge/amd/amdk8/raminit.h
@@ -14,6 +14,9 @@ struct mem_controller {
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 e7a14ec454..d6632bbef5 100644
--- a/src/northbridge/amd/amdk8/raminit_f.c
+++ b/src/northbridge/amd/amdk8/raminit_f.c
@@ -2860,8 +2860,6 @@ static void sdram_set_spd_registers(const struct mem_controller *ctrl,
return;
}
-#define TIMEOUT_LOOPS 300000
-
#include "raminit_f_dqs.c"
#if CONFIG_HW_MEM_HOLE_SIZEK != 0
@@ -2919,7 +2917,7 @@ static uint32_t hoist_memory(int controllers, const struct mem_controller *ctrl,
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;
@@ -2972,9 +2970,6 @@ static void set_hw_mem_hole(int controllers, const struct mem_controller *ctrl)
}
#endif
-#if CONFIG_HAVE_ACPI_RESUME
-#include "exit_from_self.c"
-#endif
static void sdram_enable(int controllers, const struct mem_controller *ctrl,
struct sys_info *sysinfo)
diff --git a/src/northbridge/amd/amdk8/raminit_f_dqs.c b/src/northbridge/amd/amdk8/raminit_f_dqs.c
index 204339cdb0..1e99f338c7 100644
--- a/src/northbridge/amd/amdk8/raminit_f_dqs.c
+++ b/src/northbridge/amd/amdk8/raminit_f_dqs.c
@@ -1848,7 +1848,7 @@ static void dqs_save_MC_NVRAM(unsigned int dev)
}
#endif
-static void dqs_restore_MC_NVRAM(unsigned int dev)
+void dqs_restore_MC_NVRAM(unsigned int dev)
{
int pos = 0;
u32 reg;