From 8ff6c215a1c759ed4506a0bdbe4aa6a2fe9bd74f Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sat, 6 Sep 2014 01:07:41 -0500 Subject: [PATCH] arm64: remove printk() before console_init() printk() shouldn't be called until the consoles have been initialized. This just so happened to work by luck. Once CONFIG_SMP is enabled that breaks because of spinlock usage in uncached memory. BUG=chrome-os-partner:31761 BRANCH=None TEST=Built with CONFIG_SMP and ramstage doesn't hang early. Change-Id: I54231db3c811c0d19c5c7fbaa406cacd1ff019ec Signed-off-by: Patrick Georgi Original-Commit-Id: 31c3f972ac5c89472009b5b2cb7dbc0f02cfd9a0 Original-Change-Id: I6091b1e949e648b3435231946e5924260bf1807f Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/216920 Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/9037 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/arm64/armv8/mmu.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c index 8045cc0e54..2c1555c808 100644 --- a/src/arch/arm64/armv8/mmu.c +++ b/src/arch/arm64/armv8/mmu.c @@ -31,9 +31,6 @@ #include #include -#include -#include - #include #include #include @@ -110,7 +107,6 @@ static uint64_t *get_new_table(void) uint64_t *new; if (free_idx >= max_tables) { - printk(BIOS_ERR,"ARM64 MMU: No free table\n"); return NULL; } @@ -233,7 +229,6 @@ static void init_mmap_entry(struct range_entry *r) uint64_t ret; if (sanity_check(base_addr,temp_size)) { - printk(BIOS_ERR, "ARM64 MMU: sanity check failed\n"); return; } @@ -259,7 +254,6 @@ void mmu_init(struct memranges *mmap_ranges, struct range_entry *mmap_entry; if (sanity_check((uint64_t)ttb_buffer, ttb_size)) { - printk(BIOS_ERR, "ARM64: Sanity failed for ttb\n"); return; } @@ -267,22 +261,9 @@ void mmu_init(struct memranges *mmap_ranges, max_tables = (ttb_size >> GRANULE_SIZE_SHIFT); xlat_addr = ttb_buffer; - printk(BIOS_DEBUG, "ARM64: TTB_BUFFER: 0x%p Max Tables: %d\n", - (void*)xlat_addr, max_tables); - memranges_each_entry(mmap_entry, mmap_ranges) { init_mmap_entry(mmap_entry); } - printk(BIOS_DEBUG, "ARM64: MMU init done\n"); -} - -static uint32_t is_mmu_enabled(void) -{ - uint32_t sctlr; - - sctlr = raw_read_sctlr_el3(); - - return (sctlr & SCTLR_M); } void mmu_enable(void) @@ -313,9 +294,4 @@ void mmu_enable(void) raw_write_sctlr_el3(sctlr); isb(); - - if (is_mmu_enabled()) - printk(BIOS_DEBUG, "ARM64: MMU enable done\n"); - else - printk(BIOS_DEBUG, "ARM64: MMU enable failed\n"); }