cpu/intel/common: Split get_ia32_fsb()

It is desireable to not have printk() inside a
function body that can be used for udelay().
This avoids potential infinite recursion.

Change-Id: Ie67fc2a8da8351f22794e4d36c55b887c298e8ca
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/31338
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
This commit is contained in:
Kyösti Mälkki 2019-02-11 10:12:35 +02:00 committed by Patrick Georgi
parent 61e18ebdf1
commit 1a8387eaba
1 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,7 @@
#include <console/console.h>
#include <commonlib/helpers.h>
int get_ia32_fsb(void)
static int get_fsb(void)
{
struct cpuinfo_x86 c;
static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 };
@ -60,6 +60,14 @@ int get_ia32_fsb(void)
break;
}
}
return ret;
}
int get_ia32_fsb(void)
{
int ret;
ret = get_fsb();
if (ret == -1)
printk(BIOS_ERR, "FSB not found\n");
if (ret == -2)