blob: 60ead64785764808c313b6e1ef38137e2eebd62a [file] [log] [blame]
Angel Ponsbbc99cf2020-04-04 18:51:23 +02001/* SPDX-License-Identifier: GPL-2.0-only */
jinkun.hongac490b82014-06-22 20:40:39 -07002
Julius Wernerdae15a62014-10-15 18:50:45 -07003#include <arch/cache.h>
jinkun.hongac490b82014-06-22 20:40:39 -07004#include <bootblock_common.h>
Julius Werner7a453eb2014-10-20 13:14:55 -07005#include <soc/addressmap.h>
6#include <soc/clock.h>
7#include <soc/grf.h>
8#include <soc/timer.h>
Julius Wernerdae15a62014-10-15 18:50:45 -07009#include <symbols.h>
jinkun.hongac490b82014-06-22 20:40:39 -070010
Patrick Georgi20864c12015-07-01 20:29:42 +020011void bootblock_soc_init(void)
jinkun.hongac490b82014-06-22 20:40:39 -070012{
David Hendricks3b631612014-09-29 13:37:51 -070013 rkclk_init();
Julius Wernerdae15a62014-10-15 18:50:45 -070014
15 mmu_init();
16 /* Start with a clean slate. */
17 mmu_config_range(0, 4096, DCACHE_OFF);
18 /* SRAM is tightly wedged between registers, need to use subtables. Map
19 * write-through as equivalent for non-cacheable without XN on A17. */
20 mmu_config_range_kb((uintptr_t)_sram/KiB,
Julius Werner7e0dea62019-02-20 18:39:22 -080021 REGION_SIZE(sram)/KiB, DCACHE_WRITETHROUGH);
Julius Wernerdae15a62014-10-15 18:50:45 -070022 dcache_mmu_enable();
Julius Werner33df4952014-12-16 22:48:26 -080023
24 rkclk_configure_crypto(148500*KHz);
jinkun.hongac490b82014-06-22 20:40:39 -070025}