Commit 00b5c50e authored by Mike Frysinger's avatar Mike Frysinger

Blackfin: optimize MMR reads during startup a bit

Since the value of these MMRs aren't changing, store the value in a local
variable and work off of that.  This avoids multiple MMR reads which are
implicitly forced by the volatile markings.
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 8c054103
...@@ -853,6 +853,7 @@ void __init native_machine_early_platform_add_devices(void) ...@@ -853,6 +853,7 @@ void __init native_machine_early_platform_add_devices(void)
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)
{ {
u32 mmr;
unsigned long sclk, cclk; unsigned long sclk, cclk;
native_machine_early_platform_add_devices(); native_machine_early_platform_add_devices();
...@@ -923,17 +924,14 @@ void __init setup_arch(char **cmdline_p) ...@@ -923,17 +924,14 @@ void __init setup_arch(char **cmdline_p)
bfin_read_IMDMA_D1_IRQ_STATUS(); bfin_read_IMDMA_D1_IRQ_STATUS();
} }
#endif #endif
printk(KERN_INFO "Hardware Trace ");
if (bfin_read_TBUFCTL() & 0x1)
printk(KERN_CONT "Active ");
else
printk(KERN_CONT "Off ");
if (bfin_read_TBUFCTL() & 0x2)
printk(KERN_CONT "and Enabled\n");
else
printk(KERN_CONT "and Disabled\n");
printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); mmr = bfin_read_TBUFCTL();
printk(KERN_INFO "Hardware Trace %s and %sabled\n",
(mmr & 0x1) ? "active" : "off",
(mmr & 0x2) ? "en" : "dis");
mmr = bfin_read_SYSCR();
printk(KERN_INFO "Boot Mode: %i\n", mmr & 0xF);
/* Newer parts mirror SWRST bits in SYSCR */ /* Newer parts mirror SWRST bits in SYSCR */
#if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \ #if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \
...@@ -941,7 +939,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -941,7 +939,7 @@ void __init setup_arch(char **cmdline_p)
_bfin_swrst = bfin_read_SWRST(); _bfin_swrst = bfin_read_SWRST();
#else #else
/* Clear boot mode field */ /* Clear boot mode field */
_bfin_swrst = bfin_read_SYSCR() & ~0xf; _bfin_swrst = mmr & ~0xf;
#endif #endif
#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment