summaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp/cpx
diff options
context:
space:
mode:
authorMarc Jones <marcjones@sysproconsulting.com>2020-10-28 17:08:54 -0600
committerMarc Jones <marc@marcjonesconsulting.com>2020-11-03 17:18:52 +0000
commit995a7e25a1b84f01a07dacca043ec8cd17a5efd3 (patch)
tree0693918ae92c026c057fc2624e3f534cfd5d6b8e /src/soc/intel/xeon_sp/cpx
parent3dea2b63eeb8f97b31571f6f0eb37f38f9967b6b (diff)
soc/intel/xeon_sp; Use soc specific stack-port function
Separate the get_stack_for_port into soc specific functions. This removes a #if in common code. Change-Id: Ib38a7d66947ded9b56193a9163e5128b2523e99c Signed-off-by: Marc Jones <marcjones@sysproconsulting.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46971 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/intel/xeon_sp/cpx')
-rw-r--r--src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h1
-rw-r--r--src/soc/intel/xeon_sp/cpx/soc_util.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h b/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h
index f0c257508a..5f4a6f9e2f 100644
--- a/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h
+++ b/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h
@@ -26,5 +26,6 @@ int get_threads_per_package(void);
const struct SystemMemoryMapHob *get_system_memory_map(void);
void set_bios_init_completion(void);
+int soc_get_stack_for_port(int port);
#endif /* _SOC_UTIL_H_ */
diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c
index bc4a1e15b1..de6d8525c2 100644
--- a/src/soc/intel/xeon_sp/cpx/soc_util.c
+++ b/src/soc/intel/xeon_sp/cpx/soc_util.c
@@ -319,3 +319,25 @@ void set_bios_init_completion(void)
/* And finally, take care of the SBSP */
set_bios_init_completion_for_package(sbsp_socket_id);
}
+/*
+ * EX: CPX-SP
+ * Ports Stack Stack(HOB) IioConfigIou
+ * ==========================================
+ * 0 CSTACK stack 0 IOU0
+ * 1A..1D PSTACKZ stack 1 IOU1
+ * 2A..2D PSTACK1 stack 2 IOU2
+ * 3A..3D PSTACK2 stack 4 IOU3
+ */
+int soc_get_stack_for_port(int port)
+{
+ if (port == PORT_0)
+ return CSTACK;
+ else if (port >= PORT_1A && port <= PORT_1D)
+ return PSTACK0;
+ else if (port >= PORT_2A && port <= PORT_2D)
+ return PSTACK1;
+ else if (port >= PORT_3A && port <= PORT_3D)
+ return PSTACK2;
+ else
+ return -1;
+}