📄 nor-bootmenu.patch
字号:
This patch makes u-boot on GTA02 always enter the bootmenu when booting fromNOR. This de-complexifies interaction with the user and is actually also needed for correctly handling the exception vectors.- cpu/arm920t/start.S (booted_from_nor): set this flag if booting from NOR- board/neo1973/gta02/gta02.c (board_late_init): always enter the boot menu if booting from NOR- board/neo1973/gta02/gta02.c (board_late_init): used the opportunity to place the "extern"s at a more prominent locationIndex: u-boot/board/neo1973/gta02/gta02.c===================================================================--- u-boot.orig/board/neo1973/gta02/gta02.c+++ u-boot/board/neo1973/gta02/gta02.c@@ -216,8 +216,10 @@ int board_init(void) int board_late_init(void) {- S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); extern unsigned char booted_from_nand;+ extern unsigned char booted_from_nor;++ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); uint8_t int1, int2; char buf[32]; int menu_vote = 0; /* <= 0: no, > 0: yes */@@ -250,7 +252,7 @@ int board_late_init(void) /* if there's no other reason, must be regular reset */ neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; - if (!booted_from_nand)+ if (!booted_from_nand && !booted_from_nor) goto woken_by_reset; /* save wake-up reason in environment */@@ -310,11 +312,13 @@ continue_boot: } #endif - if (menu_vote > 0) {+ if (menu_vote > 0 || booted_from_nor) { extern struct bootmenu_setup bootmenu_setup; if (booted_from_nand) bootmenu_setup.comment = "NAND";+ if (booted_from_nor)+ bootmenu_setup.comment = "NOR"; neo1973_bootmenu(); nobootdelay = 1; }Index: u-boot/cpu/arm920t/start.S===================================================================--- u-boot.orig/cpu/arm920t/start.S+++ u-boot/cpu/arm920t/start.S@@ -106,6 +106,16 @@ _booted_from_nand: .word booted_from_nand #endif /* CONFIG_S3C2410_NAND_BOOT */ +#ifndef CFG_NO_FLASH+.globl booted_from_nor+booted_from_nor:+ .word 0+_booted_from_nor:+ .word booted_from_nor+_end_if_0:+ .word __bss_start-_start+#endif /* !CFG_NO_FLASH */+ _TEXT_BASE: .word TEXT_BASE @@ -387,6 +397,15 @@ copy_loop: stmia r1!, {r3-r10} /* copy to target address [r1] */ cmp r0, r2 /* until source end address [r2] */ ble copy_loop++#ifndef CFG_NO_FLASH+ ldr r0, _end_if_0 /* are we booting from NOR ? */+ cmp r0, r2+ ldreq r0, _booted_from_nor /* remember that we've booted from */+ moveq r1, #1 /* NOR */+ streqb r1, [r0]+#endif /* !CFG_NO_FLASH */+ mov r0, #0 /* flush v3/v4 cache */ mcr p15, 0, r0, c7, c7, 0 ldr pc, _done_relocate /* jump to relocated code */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -