Angel Pons | 1ddb894 | 2020-04-04 18:51:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 2 | |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 3 | #include <arch/cache.h> |
Julius Werner | 80af442 | 2014-10-20 13:18:56 -0700 | [diff] [blame] | 4 | #include <bootblock_common.h> |
| 5 | #include <soc/clk.h> |
| 6 | #include <soc/wakeup.h> |
| 7 | #include <soc/cpu.h> |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 8 | |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 9 | /* convenient shorthand (in MB) */ |
Julius Werner | f0cd03c | 2013-09-19 20:15:45 -0700 | [diff] [blame] | 10 | #define SRAM_START (EXYNOS5_SRAM_BASE >> 20) |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 11 | #define SRAM_SIZE 1 |
| 12 | #define SRAM_END (SRAM_START + SRAM_SIZE) /* plus one... */ |
| 13 | |
Vadim Bendebury | 0b341b3 | 2014-04-23 11:09:44 -0700 | [diff] [blame] | 14 | void bootblock_soc_init(void) |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 15 | { |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 16 | if (get_wakeup_state() == WAKEUP_DIRECT) { |
| 17 | wakeup(); |
| 18 | /* Never returns. */ |
| 19 | } |
| 20 | |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 21 | /* set up dcache and MMU */ |
| 22 | mmu_init(); |
Julius Werner | f0cd03c | 2013-09-19 20:15:45 -0700 | [diff] [blame] | 23 | mmu_disable_range(0, SRAM_START); |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 24 | mmu_config_range(SRAM_START, SRAM_SIZE, DCACHE_WRITEBACK); |
| 25 | mmu_config_range(SRAM_END, 4096 - SRAM_END, DCACHE_OFF); |
Gabe Black | ee4bfbf | 2013-08-13 21:05:43 -0700 | [diff] [blame] | 26 | dcache_mmu_enable(); |
| 27 | |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 28 | /* For most ARM systems, we have to initialize firmware media source |
| 29 | * (ex, SPI, SD/MMC, or eMMC) now; but for Exynos platform, that is |
| 30 | * already handled by iROM so there's no need to setup again. |
| 31 | */ |
Gabe Black | 607c0b6 | 2013-05-16 05:45:57 -0700 | [diff] [blame] | 32 | } |