aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/memmap.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-08-05 14:51:48 -0500
committerAaron Durbin <adurbin@chromium.org>2015-08-14 15:19:31 +0200
commitc43d417039ad8f1d207c15ba0e9fb407d2091c94 (patch)
tree05c882471203974aeeb448665ff29433f70ea5db /src/soc/intel/common/memmap.h
parentd452b6edd6b42c5314785ae5271d7dce28a55365 (diff)
intel/common: fix stage_cache_external_region()
The stage_cache_external_region() calculation is actually dependennt on the properties of the chipset. The reason is that certain regions within the SMRAM are used for chipset-specific features. Therefore, provide an API for abstracting the querying of subregions within the SMRAM. The 3 subregions introduced are: SMM_SUBREGION_HANDLER - SMM handler area SMM_SUBREGION_CACHE - SMM cache region SMM_SUBREGION_CHIPSET - Chipset specific area. The subregions can be queried using the newly added smm_subregion() function. Now stage_cache_external_region() uses smm_subregion() to query the external stage cache in SMRAM, and this patch also eliminates 2 separate implementations of stage_cache_external_region() between romstage and ramstage. BUG=chrome-os-partner:43636 BRANCH=None TEST=Built, booted, suspended, resumed on glados. Original-Change-Id: Id669326ba9647117193aa604038b38b364ff0f82 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/290833 Original-Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com> Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Change-Id: Idb1a75d93c9b87053a7dedb82e85afc7df6334e0 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11197 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/soc/intel/common/memmap.h')
-rw-r--r--src/soc/intel/common/memmap.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/soc/intel/common/memmap.h b/src/soc/intel/common/memmap.h
index d94f0add7f..3d51539f55 100644
--- a/src/soc/intel/common/memmap.h
+++ b/src/soc/intel/common/memmap.h
@@ -28,6 +28,24 @@
* this value should be set to 8 MiB.
*/
size_t mmap_region_granluarity(void);
+
+/* Fills in the arguments for the entire SMM region covered by chipset
+ * protections. e.g. TSEG. */
void smm_region(void **start, size_t *size);
+enum {
+ /* SMM handler area. */
+ SMM_SUBREGION_HANDLER,
+ /* SMM cache region. */
+ SMM_SUBREGION_CACHE,
+ /* Chipset specific area. */
+ SMM_SUBREGION_CHIPSET,
+ /* Total sub regions supported. */
+ SMM_SUBREGION_NUM,
+};
+
+/* Fills in the start and size for the requested SMM subregion. Returns
+ * 0 on susccess, < 0 on failure. */
+int smm_subregion(int sub, void **start, size_t *size);
+
#endif /* _COMMON_MEMMAP_H_ */