[coreboot-gerrit] Change in coreboot[master]: nb/amd/amdk8/exit_from_self.c: Use linker instead of include

Martin Roth (Code Review) gerrit at coreboot.org
Mon Apr 17 17:22:42 CEST 2017


Martin Roth has submitted this change and it was merged. ( 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 at aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19027
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
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(-)

Approvals:
  Kyösti Mälkki: Looks good to me, approved
  build bot (Jenkins): Verified



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 db79fbf..506a449 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 48e2bb9..b10cd0e 100644
--- a/src/northbridge/amd/amdk8/raminit.c
+++ b/src/northbridge/amd/amdk8/raminit.c
@@ -2266,7 +2266,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;
@@ -2325,7 +2325,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 e7a14ec..d6632bb 100644
--- a/src/northbridge/amd/amdk8/raminit_f.c
+++ b/src/northbridge/amd/amdk8/raminit_f.c
@@ -2860,8 +2860,6 @@
 	return;
 }
 
-#define TIMEOUT_LOOPS 300000
-
 #include "raminit_f_dqs.c"
 
 #if CONFIG_HW_MEM_HOLE_SIZEK != 0
@@ -2919,7 +2917,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;
@@ -2971,9 +2969,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;

-- 
To view, visit https://review.coreboot.org/19027
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I716b37e71ab3a4409709357f50f79e3149ede2b6
Gerrit-PatchSet: 7
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki at gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list