jinkun.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 1 | /* |
| 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.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
Julius Werner | dae15a6 | 2014-10-15 18:50:45 -0700 | [diff] [blame] | 16 | #include <arch/cache.h> |
huang lin | 817e455 | 2014-08-26 17:31:28 +0800 | [diff] [blame] | 17 | #include <arch/io.h> |
jinkun.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 18 | #include <bootblock_common.h> |
David Hendricks | 3b63161 | 2014-09-29 13:37:51 -0700 | [diff] [blame] | 19 | #include <console/console.h> |
Julius Werner | 7a453eb | 2014-10-20 13:14:55 -0700 | [diff] [blame] | 20 | #include <soc/addressmap.h> |
| 21 | #include <soc/clock.h> |
| 22 | #include <soc/grf.h> |
| 23 | #include <soc/timer.h> |
Julius Werner | dae15a6 | 2014-10-15 18:50:45 -0700 | [diff] [blame] | 24 | #include <symbols.h> |
Furquan Shaikh | d17a862 | 2014-11-03 14:39:11 -0800 | [diff] [blame] | 25 | #include <timestamp.h> |
jinkun.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 26 | |
Patrick Georgi | 20864c1 | 2015-07-01 20:29:42 +0200 | [diff] [blame] | 27 | void bootblock_soc_init(void) |
jinkun.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 28 | { |
Furquan Shaikh | d17a862 | 2014-11-03 14:39:11 -0800 | [diff] [blame] | 29 | timestamp_init(timestamp_get()); |
| 30 | |
David Hendricks | 3b63161 | 2014-09-29 13:37:51 -0700 | [diff] [blame] | 31 | rkclk_init(); |
Julius Werner | dae15a6 | 2014-10-15 18:50:45 -0700 | [diff] [blame] | 32 | |
| 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 Werner | 33df495 | 2014-12-16 22:48:26 -0800 | [diff] [blame] | 41 | |
| 42 | rkclk_configure_crypto(148500*KHz); |
jinkun.hong | ac490b8 | 2014-06-22 20:40:39 -0700 | [diff] [blame] | 43 | } |