From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= Date: Thu, 8 Jun 2017 09:48:41 +0200 Subject: [U-Boot] [PATCH] ARM: remove bogus cp_delay() function Message-ID: <1496908121-15028-1-git-send-email-LW@KARO-electronics.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de The cp_delay() function was introduced because of a missing 'volatile' attribute to the 'asm' statement in get_cr() which led to the 'mrc' instruction in get_cr() being optimised out eventually. This has been fixed in commit 53fd4b8c22bb ("arm: mmu: Add missing volatile= for reading SCTLR register") but the bogus cp_delay() function which was introduced as a workaround for the malfunctioning get_cr() was never removed. Signed-off-by: Lothar Wa=C3=9Fmann --- arch/arm/lib/cache-cp15.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c index e9bbcf5..2334edb 100644 --- a/arch/arm/lib/cache-cp15.c +++ b/arch/arm/lib/cache-cp15.c @@ -22,16 +22,6 @@ __weak void arm_init_domains(void) { } =20 -static void cp_delay (void) -{ - volatile int i; - - /* copro seems to need some delay between reading and writing */ - for (i =3D 0; i < 100; i++) - nop(); - asm volatile("" : : : "memory"); -} - void set_section_dcache(int section, enum dcache_option option) { #ifdef CONFIG_ARMV7_LPAE @@ -196,7 +186,6 @@ static inline void mmu_setup(void) =20 /* and enable the mmu */ reg =3D get_cr(); /* get control reg. */ - cp_delay(); set_cr(reg | CR_M); } =20 @@ -214,7 +203,6 @@ static void cache_enable(uint32_t cache_bit) if ((cache_bit =3D=3D CR_C) && !mmu_enabled()) mmu_setup(); reg =3D get_cr(); /* get control reg. */ - cp_delay(); set_cr(reg | cache_bit); } =20 @@ -224,7 +212,6 @@ static void cache_disable(uint32_t cache_bit) uint32_t reg; =20 reg =3D get_cr(); - cp_delay(); =20 if (cache_bit =3D=3D CR_C) { /* if cache isn;t enabled no need to disable */ @@ -234,7 +221,7 @@ static void cache_disable(uint32_t cache_bit) cache_bit |=3D CR_M; } reg =3D get_cr(); - cp_delay(); + if (cache_bit =3D=3D (CR_C | CR_M)) flush_dcache_all(); set_cr(reg & ~cache_bit); --=20 2.1.4