diff mbox

[U-Boot,2/5] devkit8000 nand_spl: omap3 support nand_spl boot

Message ID 1309270480-31918-3-git-send-email-schwarz@corscience.de
State Superseded
Headers show

Commit Message

Simon Schwarz June 28, 2011, 2:14 p.m. UTC
Deactivates caching in SPL. Add call to preloader_console_init for early console output.

Signed-off-by: Simon Schwarz <schwarz@corscience.de>
--

Comments

Andreas Bießmann June 29, 2011, 8:43 a.m. UTC | #1
Dear Simon Schwarz,


Am 28.06.2011 16:14, schrieb simonschwarzcor@googlemail.com:
> Deactivates caching in SPL. Add call to preloader_console_init for early console output.

well, deactivating caches make the process much slower. I recommend
don't disabeling it!

BTW, this patch also add preloader_console_init() to s_init() .. please
honor this in commit message (or split off in two patches)

regards

Andreas Bießmann
Simon Schwarz June 30, 2011, 9:06 a.m. UTC | #2
Dear Andreas,

thanks for the input!

> well, deactivating caches make the process much slower. I recommend
> don't disabeling it!
Sure, this was for debugging puposes - just forgot to undo. will change

> BTW, this patch also add preloader_console_init() to s_init() .. please
> honor this in commit message (or split off in two patches)
will do.

Regards
Simon
Aneesh V June 30, 2011, 10:38 a.m. UTC | #3
On Tuesday 28 June 2011 07:44 PM, simonschwarzcor@googlemail.com wrote:
> Deactivates caching in SPL. Add call to preloader_console_init for early console output.
>
> Signed-off-by: Simon Schwarz<schwarz@corscience.de>
> --
>
> diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
> index 6c2a132..bb38289 100644
> --- a/arch/arm/cpu/armv7/omap3/board.c
> +++ b/arch/arm/cpu/armv7/omap3/board.c
> @@ -37,6 +37,7 @@
>   #include<asm/arch/sys_proto.h>
>   #include<asm/arch/mem.h>
>   #include<asm/cache.h>
> +#include<asm/omap_common.h>
>
>   extern omap3_sysinfo sysinfo;
>
> @@ -166,10 +167,15 @@ void s_init(void)
>
>   	try_unlock_memory();
>
> +#ifdef CONFIG_PRELOADER
> +	v7_flush_cache_all();
> +#endif
> +

Flush is not needed for initialization. Invalidation is enough. Indeed
flush could be dangerous.

>   	/*
>   	 * Right now flushing at low MPU speed.
>   	 * Need to move after clock init
>   	 */
> +#ifndef CONFIG_PRELOADER
>   	invalidate_dcache(get_device_type());
>   #ifndef CONFIG_ICACHE_OFF

Unless you are enabling d-cache invalidate is also not needed. Please
note that enabling d-cache in SPL has some complexities.

Please see this thread for details:
http://lists.denx.de/pipermail/u-boot/2011-May/092865.html


>   	icache_enable();

With my armv7 cache maintenance series that is now available at u-boot-
arm/master, I-cache will be invalidated and enabled in start.S itself
unless CONFIG_SYS_I_CACHE_OFF is set.

best regards,
Aneesh
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 6c2a132..bb38289 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -37,6 +37,7 @@ 
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mem.h>
 #include <asm/cache.h>
+#include <asm/omap_common.h>
 
 extern omap3_sysinfo sysinfo;
 
@@ -166,10 +167,15 @@  void s_init(void)
 
 	try_unlock_memory();
 
+#ifdef CONFIG_PRELOADER
+	v7_flush_cache_all();
+#endif
+
 	/*
 	 * Right now flushing at low MPU speed.
 	 * Need to move after clock init
 	 */
+#ifndef CONFIG_PRELOADER
 	invalidate_dcache(get_device_type());
 #ifndef CONFIG_ICACHE_OFF
 	icache_enable();
@@ -187,13 +193,15 @@  void s_init(void)
 	 */
 	if (get_device_type() == GP_DEVICE)
 		setup_auxcr();
-
+#endif /*CONFIG_PRELOADER*/
 	set_muxconf_regs();
 	delay(100);
 
 	prcm_init();
-
 	per_clocks_enable();
+#ifdef CONFIG_PRELOADER
+	preloader_console_init();
+#endif
 
 	if (!in_sdram)
 		mem_init();
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
new file mode 100644
index 0000000..375938b
--- /dev/null
+++ b/arch/arm/include/asm/omap_common.h
@@ -0,0 +1,30 @@ 
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Aneesh V <aneesh@ti.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef	_OMAP_COMMON_H_
+#define	_OMAP_COMMON_H_
+
+void preloader_console_init(void);
+
+#endif /* _OMAP_COMMON_H_ */