armv7/snow: Move clock initialization from bootblock to romstage.
Exynos system clock can be initialized before RAM init, not necessary to be in the very beginning (boot block). This helps reducing bootblock dependency. Verified to boot on armv7/snow. Note: this patch was originally introduced in 2308, but there were some ordering issues so it was reverted. Change-Id: Ibc91c0e26ea8881751fc088754f5c6161d011b68 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/2320 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
b868d40830
commit
87d6550c1f
|
@ -17,10 +17,6 @@
|
||||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
##
|
##
|
||||||
|
|
||||||
# needed for system_clock_init()
|
|
||||||
bootblock-y += mainboard.c
|
|
||||||
bootblock-y += memory.c
|
|
||||||
|
|
||||||
romstage-y += mainboard.c
|
romstage-y += mainboard.c
|
||||||
romstage-y += memory.c
|
romstage-y += memory.c
|
||||||
romstage-y += romstage.c
|
romstage-y += romstage.c
|
||||||
|
|
|
@ -19,28 +19,20 @@
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#include <device/i2c.h>
|
#include <cbfs.h>
|
||||||
#include <cpu/samsung/exynos5250/clk.h>
|
#include <uart.h>
|
||||||
#include <cpu/samsung/exynos5250/dmc.h>
|
|
||||||
#include <cpu/samsung/exynos5250/periph.h>
|
|
||||||
#include <cpu/samsung/exynos5250/clock_init.h>
|
|
||||||
#include <src/cpu/samsung/exynos5250/power.h>
|
|
||||||
#include <drivers/maxim/max77686/max77686.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
#include <cpu/samsung/exynos5250/periph.h>
|
||||||
|
#include <cpu/samsung/exynos5250/pinmux.h>
|
||||||
|
|
||||||
#define I2C0_BASE 0x12c60000
|
#define I2C0_BASE 0x12c60000
|
||||||
|
|
||||||
void bootblock_mainboard_init(void);
|
void bootblock_mainboard_init(void);
|
||||||
void bootblock_mainboard_init(void)
|
void bootblock_mainboard_init(void)
|
||||||
{
|
{
|
||||||
struct mem_timings *mem;
|
#if CONFIG_EARLY_CONSOLE
|
||||||
struct arm_clk_ratios *arm_ratios;
|
|
||||||
|
|
||||||
mem = get_mem_timings();
|
|
||||||
arm_ratios = get_arm_clk_ratios();
|
|
||||||
system_clock_init(mem, arm_ratios);
|
|
||||||
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
|
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
|
||||||
|
|
||||||
console_init();
|
console_init();
|
||||||
printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__);
|
printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <cpu/samsung/exynos5250/dmc.h>
|
#include <cpu/samsung/exynos5250/dmc.h>
|
||||||
#include <cpu/samsung/exynos5250/setup.h>
|
#include <cpu/samsung/exynos5250/setup.h>
|
||||||
|
#include <cpu/samsung/exynos5250/clock_init.h>
|
||||||
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <arch/stages.h>
|
#include <arch/stages.h>
|
||||||
|
@ -48,13 +49,19 @@ static int board_wakeup_permitted(void)
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
struct mem_timings *mem;
|
struct mem_timings *mem;
|
||||||
|
struct arm_clk_ratios *arm_ratios;
|
||||||
int ret;
|
int ret;
|
||||||
void *entry;
|
void *entry;
|
||||||
|
|
||||||
|
/* Clock must be initialized before console_init, otherwise you may need
|
||||||
|
* to re-initialize serial console drivers again. */
|
||||||
|
mem = get_mem_timings();
|
||||||
|
arm_ratios = get_arm_clk_ratios();
|
||||||
|
system_clock_init(mem, arm_ratios);
|
||||||
|
|
||||||
console_init();
|
console_init();
|
||||||
printk(BIOS_INFO, "hello from romstage\n");
|
printk(BIOS_INFO, "hello from romstage\n");
|
||||||
|
|
||||||
mem = get_mem_timings();
|
|
||||||
if (!mem) {
|
if (!mem) {
|
||||||
printk(BIOS_CRIT, "Unable to auto-detect memory timings\n");
|
printk(BIOS_CRIT, "Unable to auto-detect memory timings\n");
|
||||||
while(1);
|
while(1);
|
||||||
|
|
Loading…
Reference in New Issue