[U-Boot] [PATCH] Blackfin: initcode: mark uncommon code paths as unlikely

Mike Frysinger vapier at gentoo.org
Tue Jul 31 11:45:46 CEST 2012


Putting memory into self refresh only happens when doing development, not
during the normal course of things, so mark those code paths as unlikely.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 arch/blackfin/cpu/initcode.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c
index fb3a101..243f4f3 100644
--- a/arch/blackfin/cpu/initcode.c
+++ b/arch/blackfin/cpu/initcode.c
@@ -337,13 +337,13 @@ maybe_self_refresh(ADI_BOOT_DATA *bs)
 
 	/* If external memory is enabled, put it into self refresh first. */
 #if defined(EBIU_RSTCTL)
-	if (bfin_read_EBIU_RSTCTL() & DDR_SRESET) {
+	if (unlikely(bfin_read_EBIU_RSTCTL() & DDR_SRESET)) {
 		serial_putc('b');
 		bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | SRREQ);
 		return true;
 	}
 #elif defined(EBIU_SDGCTL)
-	if (bfin_read_EBIU_SDBCTL() & EBE) {
+	if (unlikely(bfin_read_EBIU_SDBCTL() & EBE)) {
 		serial_putc('b');
 		bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() | SRFS);
 		return true;
@@ -367,7 +367,7 @@ program_clocks(ADI_BOOT_DATA *bs, bool put_into_srfs)
 	serial_putc('b');
 
 	/* If we're entering self refresh, make sure it has happened. */
-	if (put_into_srfs)
+	if (unlikely(put_into_srfs))
 #if defined(EBIU_RSTCTL)
 		while (!(bfin_read_EBIU_RSTCTL() & SRACK))
 			continue;
@@ -549,7 +549,7 @@ program_memory_controller(ADI_BOOT_DATA *bs, bool put_into_srfs)
 	serial_putc('c');
 
 	/* Now that we've reprogrammed, take things out of self refresh. */
-	if (put_into_srfs)
+	if (unlikely(put_into_srfs))
 #if defined(EBIU_RSTCTL)
 		bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() & ~(SRREQ));
 #elif defined(EBIU_SDGCTL)
@@ -604,7 +604,7 @@ check_hibernation(ADI_BOOT_DATA *bs, u16 vr_ctl, bool put_into_srfs)
 	 *
 	 * SCKELOW is unreliable on older parts (anomaly 307)
 	 */
-	if (ANOMALY_05000307 || vr_ctl & 0x8000) {
+	if (unlikely(ANOMALY_05000307 || vr_ctl & 0x8000)) {
 		uint32_t *hibernate_magic = 0;
 		__builtin_bfin_ssync(); /* make sure memory controller is done */
 		if (hibernate_magic[0] == 0xDEADBEEF) {
-- 
1.7.9.7



More information about the U-Boot mailing list