Skip to content

Commit

Permalink
arm64: versal: Disable DDR cache mapping if DDR is not enabled
Browse files Browse the repository at this point in the history
Similar change was done in past by commit 3b644a3
("arm64: zynqmp: Provide a config to not map DDR region in MMU table").

Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
Michal Simek committed Apr 6, 2020
1 parent b8c3d3f commit 98da866
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-versal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ config DEFINE_TCM_OCM_MMAP
This option if enabled defines the TCM and OCM memory and its
memory attributes in MMU table entry.

config VERSAL_NO_DDR
bool "Disable DDR MMU mapping"
help
This option configures MMU with no DDR to avoid speculative
access to DDR memory where DDR is not present.

endif
9 changes: 9 additions & 0 deletions arch/arm/mach-versal/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ void mem_map_fill(void)
if (!gd->bd->bi_dram[i].size)
break;

#if defined(CONFIG_VERSAL_NO_DDR)
if (gd->bd->bi_dram[i].start < 0x80000000UL ||
gd->bd->bi_dram[i].start > 0x100000000UL) {
printf("Ignore caches over %llx/%llx\n",
gd->bd->bi_dram[i].start,
gd->bd->bi_dram[i].size);
continue;
}
#endif
versal_mem_map[banks].virt = gd->bd->bi_dram[i].start;
versal_mem_map[banks].phys = gd->bd->bi_dram[i].start;
versal_mem_map[banks].size = gd->bd->bi_dram[i].size;
Expand Down

0 comments on commit 98da866

Please sign in to comment.