Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
T Michael Turney | 7a3e46d | 2019-03-21 14:21:26 -0700 | [diff] [blame] | 2 | |
| 3 | #include <arch/mmu.h> |
| 4 | #include <soc/mmu.h> |
| 5 | #include <soc/mmu_common.h> |
Ravi Kumar Bokka | 64f7eaa | 2021-10-15 23:02:41 +0530 | [diff] [blame] | 6 | #include <soc/symbols_common.h> |
T Michael Turney | 7a3e46d | 2019-03-21 14:21:26 -0700 | [diff] [blame] | 7 | |
mkurumel | a9d225b | 2020-09-14 23:28:53 +0530 | [diff] [blame] | 8 | __weak bool soc_modem_carve_out(void **start, void **end) { return false; } |
T Michael Turney | 7a3e46d | 2019-03-21 14:21:26 -0700 | [diff] [blame] | 9 | |
| 10 | void qc_mmu_dram_config_post_dram_init(void *ddr_base, size_t ddr_size) |
| 11 | { |
mkurumel | a9d225b | 2020-09-14 23:28:53 +0530 | [diff] [blame] | 12 | void *start = NULL; |
| 13 | void *end = NULL; |
| 14 | |
| 15 | if (!soc_modem_carve_out(&start, &end)) { |
| 16 | mmu_config_range((void *)ddr_base, ddr_size, CACHED_RAM); |
| 17 | } else { |
| 18 | mmu_config_range(ddr_base, start - ddr_base, CACHED_RAM); |
| 19 | mmu_config_range(end, ddr_base + ddr_size - end, CACHED_RAM); |
| 20 | } |
Ravi Kumar Bokka | 64f7eaa | 2021-10-15 23:02:41 +0530 | [diff] [blame] | 21 | |
| 22 | mmu_config_range((void *)_aop_code_ram, REGION_SIZE(aop_code_ram), |
| 23 | CACHED_RAM); |
| 24 | mmu_config_range((void *)_aop_data_ram, REGION_SIZE(aop_data_ram), |
| 25 | CACHED_RAM); |
T Michael Turney | 7a3e46d | 2019-03-21 14:21:26 -0700 | [diff] [blame] | 26 | } |