blob: 65ca7a9127bca46dafbede3c026e2efe61d28dcb [file] [log] [blame]
jinkun.hongac490b82014-06-22 20:40:39 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2014 Rockchip Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
jinkun.hongac490b82014-06-22 20:40:39 -070014 */
15
Julius Wernerdae15a62014-10-15 18:50:45 -070016#include <arch/cache.h>
huang lin817e4552014-08-26 17:31:28 +080017#include <arch/io.h>
jinkun.hongac490b82014-06-22 20:40:39 -070018#include <bootblock_common.h>
David Hendricks3b631612014-09-29 13:37:51 -070019#include <console/console.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070020#include <soc/addressmap.h>
21#include <soc/clock.h>
22#include <soc/grf.h>
23#include <soc/timer.h>
Julius Wernerdae15a62014-10-15 18:50:45 -070024#include <symbols.h>
Furquan Shaikhd17a8622014-11-03 14:39:11 -080025#include <timestamp.h>
jinkun.hongac490b82014-06-22 20:40:39 -070026
Patrick Georgi20864c12015-07-01 20:29:42 +020027void bootblock_soc_init(void)
jinkun.hongac490b82014-06-22 20:40:39 -070028{
Furquan Shaikhd17a8622014-11-03 14:39:11 -080029 timestamp_init(timestamp_get());
30
David Hendricks3b631612014-09-29 13:37:51 -070031 rkclk_init();
Julius Wernerdae15a62014-10-15 18:50:45 -070032
33 mmu_init();
34 /* Start with a clean slate. */
35 mmu_config_range(0, 4096, DCACHE_OFF);
36 /* SRAM is tightly wedged between registers, need to use subtables. Map
37 * write-through as equivalent for non-cacheable without XN on A17. */
38 mmu_config_range_kb((uintptr_t)_sram/KiB,
39 _sram_size/KiB, DCACHE_WRITETHROUGH);
40 dcache_mmu_enable();
Julius Werner33df4952014-12-16 22:48:26 -080041
42 rkclk_configure_crypto(148500*KHz);
jinkun.hongac490b82014-06-22 20:40:39 -070043}