]> git.baikalelectronics.ru Git - uboot.git/commit
arm: caches: protect dram_bank_mmu_setup access to bi_dram
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 24 Apr 2020 18:20:15 +0000 (20:20 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 1 May 2020 15:34:01 +0000 (11:34 -0400)
commit3692f51067d1b36233c00003c4e00c68e0c3b7be
tree4d2ef0c85dc9683c2fbbe98cb2f60a0d4ab020b2
parent65be8d7314b08cfab1aa157b9f039a2bc5c0488c
arm: caches: protect dram_bank_mmu_setup access to bi_dram

Add protection in dram_bank_mmu_setup() to avoid access to bd->bi_dram
before relocation.

This patch allow to use the generic weak function dram_bank_mmu_setup
to activate the MMU and the data cache in SPL or in U-Boot before
relocation, when bd->bi_dram is not yet initialized.

In this cases, the MMU must be initialized explicitly with
mmu_set_region_dcache_behaviour function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
arch/arm/lib/cache-cp15.c