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 | |
Patrick Rudolph | 792fd51 | 2020-01-23 14:10:07 +0100 | [diff] [blame] | 7 | extern u8 _secram[], _esecram[]; |
| 8 | |
Patrick Rudolph | 977b8e8 | 2020-01-23 13:32:08 +0100 | [diff] [blame] | 9 | void bootblock_mainboard_init(void) |
| 10 | { |
| 11 | mmu_init(); |
| 12 | |
| 13 | /* Everything below DRAM is device memory */ |
| 14 | mmu_config_range((void *)0, (uintptr_t)_dram, MA_DEV | MA_RW); |
| 15 | /* Set a dummy value for DRAM. ramstage should update the mapping. */ |
| 16 | mmu_config_range(_dram, 1 * GiB, MA_MEM | MA_RW); |
| 17 | |
| 18 | mmu_config_range(_ttb, REGION_SIZE(ttb), MA_MEM | MA_S | MA_RW); |
| 19 | mmu_config_range(_bootblock, REGION_SIZE(bootblock), MA_MEM | MA_S | MA_RW); |
| 20 | mmu_config_range(_romstage, REGION_SIZE(romstage), MA_MEM | MA_S | MA_RW); |
| 21 | mmu_config_range(_ramstage, REGION_SIZE(ramstage), MA_MEM | MA_S | MA_RW); |
| 22 | |
Patrick Rudolph | 792fd51 | 2020-01-23 14:10:07 +0100 | [diff] [blame] | 23 | mmu_config_range(_secram, REGION_SIZE(secram), MA_MEM | MA_S | MA_RW); |
| 24 | |
Patrick Rudolph | 977b8e8 | 2020-01-23 13:32:08 +0100 | [diff] [blame] | 25 | mmu_enable(); |
| 26 | } |