From: Patrick Delaunay Date: Tue, 3 Nov 2020 12:01:11 +0100 Subject: [PATCH 2/4] arm: cache-cp15: simplify trace support for LPAE In-Reply-To: <20201103120047.1.I30ef60ea8b13322a6ec7b675dc2de5f63f336fc3@changeid> References: <20201103120047.1.I30ef60ea8b13322a6ec7b675dc2de5f63f336fc3@changeid> Message-ID: <20201103110115.12875-1-patrick.delaunay@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add a new define OPTIONF to handle enum dcache_option option size. This patch avoid one #ifdef CONFIG_ARMV7_LPAE in mmu_set_region_dcache_behaviour_phys code. Signed-off-by: Patrick Delaunay --- arch/arm/lib/cache-cp15.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c index e2efe6f244..6f154de4c3 100644 --- a/arch/arm/lib/cache-cp15.c +++ b/arch/arm/lib/cache-cp15.c @@ -12,6 +12,13 @@ #include #include +/* for LPAE : enum dcache_option option is ULL*/ +#ifdef CONFIG_ARMV7_LPAE +#define OPTIONF "%llx" +#else +#define OPTIONF "%x" +#endif + #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) DECLARE_GLOBAL_DATA_PTR; @@ -78,13 +85,9 @@ void mmu_set_region_dcache_behaviour_phys(phys_addr_t start, phys_addr_t phys, >> (MMU_SECTION_SHIFT - 1); start = start >> MMU_SECTION_SHIFT; -#ifdef CONFIG_ARMV7_LPAE - debug("%s: start=%pa, size=%zu, option=%llx\n", __func__, &start, size, - option); -#else - debug("%s: start=%pa, size=%zu, option=0x%x\n", __func__, &start, size, - option); -#endif + debug("%s: start=%pa, size=%zu, option=0x" OPTIONF "\n", + __func__, &start, size, option); + for (upto = start; upto < end; upto++, phys += MMU_SECTION_SIZE) set_section_phys(upto, phys, option); -- 2.17.1