From 43dcbfd85581de4f173953282a4917c1ee9a5922 Mon Sep 17 00:00:00 2001 From: Harry Pan Date: Thu, 11 Aug 2016 14:35:04 +0800 Subject: soc/braswell: fix ACPI table by recollecting TOLM cherry-pick from Chromium, commit 8fbe1e7 On Braswell and Baytrail devices, by userland 'perf top', observed demanding clocks on __vdso_clock_gettime() since chromeos_3.18 kernel; besides, evaluated massive calling of clock_gettime() cost, up to 700 ns in average. It turns out that Linux kernel of map_vdso() first call of remap_pfn_range() does not fall into reserve_pfn_range() due to size parameter, instead it relies on lookup_memtype() and potentially be failed to be identified as eligible RAM resource because the function of pat_pagerange_is_ram() actually walks through root's sibling. Meanwhile, on current BSW (and BYT) firmware implementation makes System RAM resources located on child leaf, combining all of these factors makes the kernel treat the vvar page of vdso as a uncached-minus one leading slow access in result. This patch recollects TOLM accessing; as Aaron recalled some core_msr_script turns off access to TOLM register, he suggests to store tolm to avoid getting back a zero while setting acpi nvs space. Original-Change-Id: Iad4ffa542b22073cb087100a95169e2d2a52efcd Original-Signed-off-by: Harry Pan Original-Reviewed-on: https://chromium-review.googlesource.com/368585 Original-Reviewed-by: Aaron Durbin Change-Id: Idc9765ec5c0920dc98baeb9267a89bec5cadd5a0 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/20060 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/braswell/northcluster.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/soc/intel/braswell/northcluster.c b/src/soc/intel/braswell/northcluster.c index 404a8f18c1..dc72a46d94 100644 --- a/src/soc/intel/braswell/northcluster.c +++ b/src/soc/intel/braswell/northcluster.c @@ -29,6 +29,7 @@ #include #include #include +#include /* * Host Memory Map: @@ -70,7 +71,14 @@ uint32_t nc_read_top_of_low_memory(void) { - return iosf_bunit_read(BUNIT_BMBOUND) & ~((1 << 27) - 1); + MAYBE_STATIC uint32_t tolm = 0; + + if (tolm) + return tolm; + + tolm = iosf_bunit_read(BUNIT_BMBOUND) & ~((1 << 27) - 1); + + return tolm; } static void nc_read_resources(device_t dev) -- cgit v1.2.3