Angel Pons | 585495e | 2020-04-03 01:21:38 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Rudolph | 977b8e8 | 2020-01-23 13:32:08 +0100 | [diff] [blame] | 2 | |
| 3 | #include <arch/mmu.h> |
| 4 | #include <bootblock_common.h> |
| 5 | #include <symbols.h> |
| 6 | |
| 7 | void bootblock_mainboard_init(void) |
| 8 | { |
| 9 | mmu_init(); |
| 10 | |
| 11 | /* Everything below DRAM is device memory */ |
| 12 | mmu_config_range((void *)0, (uintptr_t)_dram, MA_DEV | MA_RW); |
| 13 | /* Set a dummy value for DRAM. ramstage should update the mapping. */ |
| 14 | mmu_config_range(_dram, 1 * GiB, MA_MEM | MA_RW); |
| 15 | |
| 16 | mmu_config_range(_ttb, REGION_SIZE(ttb), MA_MEM | MA_S | MA_RW); |
| 17 | mmu_config_range(_bootblock, REGION_SIZE(bootblock), MA_MEM | MA_S | MA_RW); |
| 18 | mmu_config_range(_romstage, REGION_SIZE(romstage), MA_MEM | MA_S | MA_RW); |
| 19 | mmu_config_range(_ramstage, REGION_SIZE(ramstage), MA_MEM | MA_S | MA_RW); |
| 20 | |
Julius Werner | 82d16b1 | 2020-12-30 15:51:10 -0800 | [diff] [blame] | 21 | mmu_config_range(_bl31, REGION_SIZE(bl31), MA_MEM | MA_S | MA_RW); |
Patrick Rudolph | 792fd51 | 2020-01-23 14:10:07 +0100 | [diff] [blame] | 22 | |
Patrick Rudolph | 977b8e8 | 2020-01-23 13:32:08 +0100 | [diff] [blame] | 23 | mmu_enable(); |
| 24 | } |