⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot-from-ram-and-nand.patch

📁 Uboot常用的移植patches, 方便定制移植到s3c2440
💻 PATCH
字号:
Auto-detect whether we're booting from RAM or NAND, and act accordingly. Thisallows us to use the same u-boot binary for all boot modes.include/configs/neo1973.h: introduced new config option  CONFIG_LL_INIT_NAND_ONLY to perform low-level initialization only when  booting from NANDinclude/configs/neo1973.h: got rid of BUILD_FOR_RAMcpu/arm920t/start.S: detect if we need to boot from NAND at run time (i.e., if  we're running at address 0)- Werner Almesberger <werner@openmoko.org>Index: u-boot/cpu/arm920t/start.S===================================================================--- u-boot.orig/cpu/arm920t/start.S+++ u-boot/cpu/arm920t/start.S@@ -222,13 +222,11 @@ 	str	r1, [r0] #endif	/* CONFIG_S3C2400 || CONFIG_S3C2410 */ -	/*-	 * we do sys-critical inits only at reboot,-	 * not when booting from ram!-	 */ #ifndef CONFIG_SKIP_LOWLEVEL_INIT+#ifndef CONFIG_LL_INIT_NAND_ONLY 	bl	cpu_init_crit #endif+#endif  #ifdef	CONFIG_AT91RM9200 #ifdef CONFIG_BOOTBINFUNC@@ -251,9 +249,19 @@ #endif /* CONFIG_BOOTBINFUNC */ #else #ifndef CONFIG_SKIP_RELOCATE_UBOOT-#ifndef CONFIG_S3C2410_NAND_BOOT-relocate:				/* relocate U-Boot to RAM	    */ 	adr	r0, _start		/* r0 <- current position of code   */++#ifdef CONFIG_S3C2410_NAND_BOOT+					/* are we running from NAND ?	    */+#define	BWSCON	0x48000000+	ldr	r1, =BWSCON		/* Z = CPU booted from NAND	    */+	ldr	r1, [r1]+	tst	r1, #6			/* BWSCON[2:1] = OM[1:0]	    */+	teqeq	r0, #0			/* Z &= running at address 0	    */+	beq	nand_load+#endif /* CONFIG_S3C2410_NAND_BOOT */++relocate:				/* relocate U-Boot to RAM	    */ 	ldr	r1, _TEXT_BASE		/* test if we run from flash or RAM */ 	cmp     r0, r1                  /* don't reloc during debug         */ 	beq     done_relocate@@ -273,10 +281,13 @@ 	ldr	pc, _done_relocate	/* jump to relocated code */ _done_relocate: 	.word	done_relocate-done_relocate:-#else /* NAND_BOOT */-relocate:-copy_myself:++#ifdef CONFIG_S3C2410_NAND_BOOT+nand_load:+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY)+	bl	cpu_init_crit+#endif+ 	/* mov	r10, lr */  	@ reset NAND@@ -360,7 +371,8 @@ #endif 1:	b	1b done_nand_read:-#endif /* NAND_BOOT */+#endif /* CONFIG_S3C2410_NAND_BOOT */+done_relocate: #endif /* CONFIG_SKIP_RELOCATE_UBOOT */ #endif 	/* Set up the stack						    */Index: u-boot/include/configs/neo1973_gta01.h===================================================================--- u-boot.orig/include/configs/neo1973_gta01.h+++ u-boot/include/configs/neo1973_gta01.h@@ -26,14 +26,10 @@ #ifndef __CONFIG_H #define __CONFIG_H -#if defined(BUILD_FOR_RAM)-/* If we want to start u-boot from inside RAM */-#define CONFIG_SKIP_LOWLEVEL_INIT	1-#else-/* we want to start u-boot directly from within NAND flash */+/* we want to be able to start u-boot directly from within NAND flash */+#define CONFIG_LL_INIT_NAND_ONLY #define CONFIG_S3C2410_NAND_BOOT	1 #define CONFIG_S3C2410_NAND_SKIP_BAD	1-#endif  #define CFG_UBOOT_SIZE		0x40000 /* size of u-boot, for NAND loading */ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -