blob: 5b6f21577f107e05137e51fc3137b1caea54d802 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Heiko Stübner0b3c26a2017-02-18 19:46:38 +01002/*
3 * (C) Copyright 2015 Google, Inc
Heiko Stübner0b3c26a2017-02-18 19:46:38 +01004 */
5
6#include <common.h>
7#include <clk.h>
8#include <dm.h>
9#include <ram.h>
Simon Glassf473eba2019-01-21 14:53:31 -070010#include <asm/gpio.h>
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010011#include <asm/io.h>
Kever Yang9fbe17c2019-03-28 11:01:23 +080012#include <asm/arch-rockchip/periph.h>
Kever Yang9fbe17c2019-03-28 11:01:23 +080013#include <asm/arch-rockchip/boot_mode.h>
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010014
Alexander Kochetkova546c562018-02-26 15:37:42 +030015__weak int rk_board_late_init(void)
16{
17 return 0;
18}
19
Heiko Stübner015f69a2017-04-06 00:19:36 +020020int board_late_init(void)
21{
Andy Yan70378cb2017-10-11 15:00:16 +080022 setup_boot_mode();
Heiko Stübner015f69a2017-04-06 00:19:36 +020023
Alexander Kochetkova546c562018-02-26 15:37:42 +030024 return rk_board_late_init();
Heiko Stübner015f69a2017-04-06 00:19:36 +020025}
26
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010027int board_init(void)
28{
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010029 return 0;
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010030}
31
Trevor Woerner43ec7e02019-05-03 09:41:00 -040032#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
Heiko Stübner0b3c26a2017-02-18 19:46:38 +010033void enable_caches(void)
34{
35 /* Enable D-cache. I-cache is already enabled in start.S */
36 dcache_enable();
37}
38#endif