aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-04-18 18:37:38 -0400
committerMike Frysinger <vapier@gentoo.org>2011-05-25 08:13:43 -0400
commit00b5c50e47dacd4d288c6b265e00f85711b9ac64 (patch)
tree817e6662c5c91b5e3a8a4130a3af4a287782fe91
parent8c0541035007bd8bbacfc5d71c696cdf37696794 (diff)
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: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--arch/blackfin/kernel/setup.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 904a25d5e992..2f48f03c634e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -853,6 +853,7 @@ void __init native_machine_early_platform_add_devices(void)
853 853
854void __init setup_arch(char **cmdline_p) 854void __init setup_arch(char **cmdline_p)
855{ 855{
856 u32 mmr;
856 unsigned long sclk, cclk; 857 unsigned long sclk, cclk;
857 858
858 native_machine_early_platform_add_devices(); 859 native_machine_early_platform_add_devices();
@@ -923,17 +924,14 @@ void __init setup_arch(char **cmdline_p)
923 bfin_read_IMDMA_D1_IRQ_STATUS(); 924 bfin_read_IMDMA_D1_IRQ_STATUS();
924 } 925 }
925#endif 926#endif
926 printk(KERN_INFO "Hardware Trace ");
927 if (bfin_read_TBUFCTL() & 0x1)
928 printk(KERN_CONT "Active ");
929 else
930 printk(KERN_CONT "Off ");
931 if (bfin_read_TBUFCTL() & 0x2)
932 printk(KERN_CONT "and Enabled\n");
933 else
934 printk(KERN_CONT "and Disabled\n");
935 927
936 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 928 mmr = bfin_read_TBUFCTL();
929 printk(KERN_INFO "Hardware Trace %s and %sabled\n",
930 (mmr & 0x1) ? "active" : "off",
931 (mmr & 0x2) ? "en" : "dis");
932
933 mmr = bfin_read_SYSCR();
934 printk(KERN_INFO "Boot Mode: %i\n", mmr & 0xF);
937 935
938 /* Newer parts mirror SWRST bits in SYSCR */ 936 /* Newer parts mirror SWRST bits in SYSCR */
939#if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \ 937#if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \
@@ -941,7 +939,7 @@ void __init setup_arch(char **cmdline_p)
941 _bfin_swrst = bfin_read_SWRST(); 939 _bfin_swrst = bfin_read_SWRST();
942#else 940#else
943 /* Clear boot mode field */ 941 /* Clear boot mode field */
944 _bfin_swrst = bfin_read_SYSCR() & ~0xf; 942 _bfin_swrst = mmr & ~0xf;
945#endif 943#endif
946 944
947#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 945#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT