aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/pdpt.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2018-04-18 01:05:25 -0600
committerAaron Durbin <adurbin@chromium.org>2018-04-27 18:48:10 +0000
commit5c9df70031b7d14c01b8bf261510cc9a8828eabc (patch)
treedd995f67f6551026a5591377dcf19edf7a79dbc0 /src/soc/intel/apollolake/pdpt.c
parent9b41bae92129e579f2fbd003aa7e5e7b971cb881 (diff)
soc/intel/apollolake: enable cache-as-ram paging for glk
Add support and enalbe cache-as-ram paging for glk to work around a cache-as-ram corruption issue. glk executes verstage, romstage, and FSP-M directly out of cache-as-ram (just like apl). However, the front end on glk is very agressive about pulling cache lines into L1I for potential execution. When the snoops hit in the L1D and the cache lines are dirty the processor writes the line back. However, there is no backing store for the dirty lines to go. As such when the line is pulled back in the value is all 0xff's, corrupting cache-as-ram. To fix the issue one needs to enable paging with NX (no execute) permissions which prevents the above actions from happening because the TLB will indicate that shouldn't be fetched into the instruction cache since data will be marked no execute. The generated page tables are added to cbfs and only added to the COREBOOT cbfs as they are only consumed in the early cache-as-ram stages. The page tables generated with: $ go run util/x86/x86_page_tables.go \ --iomap_file=src/soc/intel/apollolake/glk_page_map.txt \ --metadata_base_address=0xfef00000 \ --pdpt_output_c_file=src/soc/intel/apollolake/pdpt.c \ --pt_output_c_file=src/soc/intel/apollolake/pt.c Merged address space: 00000000d0000000 -- 00000000fef00000 UC NX : 375 big 256 small 00000000fef00000 -- 00000000fef20000 WB NX : 0 big 32 small 00000000fef20000 -- 00000000fefc0000 WB : 0 big 160 small 00000000fefc0000 -- 00000000ff000000 WB NX : 0 big 64 small 00000000ff000000 -- 0000000100000000 WP : 8 big 0 small Total Pages of page tables: 5 Pages linked using base address of 0xfef00000. BUG=b:72728953 Change-Id: Icde9cc0bf5079bb5821f4e59eb61e939c13d7062 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/25719 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/apollolake/pdpt.c')
-rw-r--r--src/soc/intel/apollolake/pdpt.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/pdpt.c b/src/soc/intel/apollolake/pdpt.c
new file mode 100644
index 0000000000..38852f1365
--- /dev/null
+++ b/src/soc/intel/apollolake/pdpt.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2018 Generated Code
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/* Generated by:
+ util/x86/x86_page_tables --iomap_file=src/soc/intel/apollolake/glk_page_map.txt --metadata_base_address=0xfef00000 --pdpt_output_c_file=src/soc/intel/apollolake/pdpt.c --pt_output_c_file=src/soc/intel/apollolake/pt.c
+ */
+#include <stdint.h>
+uint64_t pdptes[] = {
+ /* Page 0 */
+ [0] = 0x00000000fef00001ULL,
+ [1] = 0x00000000fef01001ULL,
+ [2] = 0x00000000fef02001ULL,
+ [3] = 0x00000000fef03001ULL,
+};