r4169 - trunk/src/target/u-boot/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Wed Mar 5 07:09:26 CET 2008


Author: werner
Date: 2008-03-05 07:09:22 +0100 (Wed, 05 Mar 2008)
New Revision: 4169

Modified:
   trunk/src/target/u-boot/patches/boot-menu.patch
   trunk/src/target/u-boot/patches/gta02-bootmenu.patch
   trunk/src/target/u-boot/patches/nor-bootmenu.patch
Log:
Add a visual indication for where we are booting from (NAND or NOR).

boot-menu.patch:
- include/bootmenu.h (struct bootmenu_setup): added field "comment" to set an
  optional comment to display in the boot menu header
- common/bootmenu.c (show_bootmenu): display a comment if specified

gta02-bootmenu.patch:
- board/neo1973/common/bootmenu.c (bootmenu_setup): changes from "static" to
  "extern", to allow platform to tweak it
- board/neo1973/gta02/gta02.c (board_late_init): add "NAND" comment to boot 
  menu if booting from NAND

nor-bootmenu.patch:
- board/neo1973/gta02/gta02.c (board_late_init): add "NOR" comment to boot
  menu if booting from NOR



Modified: trunk/src/target/u-boot/patches/boot-menu.patch
===================================================================
--- trunk/src/target/u-boot/patches/boot-menu.patch	2008-03-05 04:36:40 UTC (rev 4168)
+++ trunk/src/target/u-boot/patches/boot-menu.patch	2008-03-05 06:09:22 UTC (rev 4169)
@@ -142,7 +142,7 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/gta01/gta01.c
 +++ u-boot/board/neo1973/gta01/gta01.c
-@@ -230,10 +230,15 @@
+@@ -230,10 +230,15 @@ int board_late_init(void)
  	extern unsigned char booted_from_nand;
  	unsigned char tmp;
  	char buf[32];
@@ -158,7 +158,7 @@
  	if (!booted_from_nand)
  		goto woken_by_reset;
  
-@@ -243,45 +248,41 @@
+@@ -243,45 +248,41 @@ int board_late_init(void)
  	setenv("pcf50606_int1", buf);
  
  	if (tmp & PCF50606_INT1_ALARM) {
@@ -226,7 +226,7 @@
  
  continue_boot:
  	jbt6k74_init();
-@@ -305,6 +306,11 @@
+@@ -305,6 +306,11 @@ continue_boot:
  	}
  #endif
  
@@ -238,7 +238,7 @@
  	return 0;
  }
  
-@@ -433,7 +439,17 @@
+@@ -433,7 +439,17 @@ void neo1973_gps(int on)
  	printf("not implemented yet!\n");
  }
  
@@ -261,7 +261,7 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/gta01/Makefile
 +++ u-boot/board/neo1973/gta01/Makefile
-@@ -26,7 +26,7 @@
+@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
  LIB	= lib$(BOARD).a
  
  OBJS	:= gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o \
@@ -274,7 +274,7 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/common/neo1973.h
 +++ u-boot/board/neo1973/common/neo1973.h
-@@ -32,4 +32,10 @@
+@@ -32,4 +32,10 @@ int neo1973_911_key_pressed(void);
  const char *neo1973_get_charge_status(void);
  int neo1973_set_charge_mode(enum neo1973_charger_cmd cmd);
  
@@ -289,7 +289,7 @@
 ===================================================================
 --- u-boot.orig/common/console.c
 +++ u-boot/common/console.c
-@@ -160,8 +160,12 @@
+@@ -160,8 +160,12 @@ void fprintf (int file, const char *fmt,
  
  /** U-Boot INITIAL CONSOLE-COMPATIBLE FUNCTION *****************************/
  
@@ -302,7 +302,7 @@
  	if (gd->flags & GD_FLG_DEVINIT) {
  		/* Get from the standard input */
  		return fgetc (stdin);
-@@ -171,7 +175,7 @@
+@@ -171,7 +175,7 @@ int getc (void)
  	return serial_getc ();
  }
  
@@ -311,7 +311,7 @@
  {
  	if (gd->flags & GD_FLG_DEVINIT) {
  		/* Test the standard input */
-@@ -182,6 +186,16 @@
+@@ -182,6 +186,16 @@ int tstc (void)
  	return serial_tstc ();
  }
  
@@ -345,7 +345,7 @@
 ===================================================================
 --- u-boot.orig/common/Makefile
 +++ u-boot/common/Makefile
-@@ -31,6 +31,7 @@
+@@ -31,6 +31,7 @@ COBJS-y += main.o
  COBJS-y += ACEX1K.o
  COBJS-y += altera.o
  COBJS-y += bedbug.o
@@ -357,7 +357,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/common/bootmenu.c
-@@ -0,0 +1,312 @@
+@@ -0,0 +1,316 @@
 +/*
 + * bootmenu.c - Boot menu
 + *
@@ -483,7 +483,11 @@
 +	const struct option *option;
 +
 +	bm_printf(ANSI_CLEAR ANSI_GOTOYX "%s", TOP_ROW, 1, version_string);
-+	bm_printf(ANSI_GOTOYX "*** BOOT MENU ***", TOP_ROW+3, 1);
++	if (setup->comment)
++		bm_printf(ANSI_GOTOYX "*** BOOT MENU (%s) ***",
++		    TOP_ROW+3, 1, setup->comment);
++	else
++		bm_printf(ANSI_GOTOYX "*** BOOT MENU ***", TOP_ROW+3, 1);
 +	bm_printf(ANSI_GOTOYX, MENU_0_ROW, 1);
 +
 +	for (option = options; option != options+num_options; option++)
@@ -674,11 +678,11 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/include/bootmenu.h
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,82 @@
 +/*
 + * bootmenu.h - Boot menu
 + *
-+ * Copyright (C) 2006-2007 by OpenMoko, Inc.
++ * Copyright (C) 2006-2008 by OpenMoko, Inc.
 + * Written by Werner Almesberger <werner at openmoko.org>
 + * All Rights Reserved
 + *
@@ -707,6 +711,9 @@
 +
 +
 +struct bootmenu_setup {
++	/* title comment, NULL if none */
++	const char *comment;
++
 +	/* non-zero while the "next" key is being pressed */
 +	int (*next_key)(void *user);
 +

Modified: trunk/src/target/u-boot/patches/gta02-bootmenu.patch
===================================================================
--- trunk/src/target/u-boot/patches/gta02-bootmenu.patch	2008-03-05 04:36:40 UTC (rev 4168)
+++ trunk/src/target/u-boot/patches/gta02-bootmenu.patch	2008-03-05 06:09:22 UTC (rev 4169)
@@ -2,7 +2,15 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/gta02/gta02.c
 +++ u-boot/board/neo1973/gta02/gta02.c
-@@ -306,12 +306,12 @@ continue_boot:
+@@ -33,6 +33,7 @@
+ #include <common.h>
+ #include <s3c2440.h>
+ #include <i2c.h>
++#include <bootmenu.h>
+ 
+ #include "../common/neo1973.h"
+ #include "../common/jbt6k74.h"
+@@ -308,12 +309,16 @@ continue_boot:
  		if (!(gpio->GPFDAT & (1 << 5)))
  			gpio->GPBDAT &= ~(1 << 2);
  	}
@@ -10,6 +18,10 @@
  
  	if (menu_vote > 0) {
 -		bootmenu();
++		extern struct bootmenu_setup bootmenu_setup;
++
++		if (booted_from_nand)
++			bootmenu_setup.comment = "NAND";
 +		neo1973_bootmenu();
  		nobootdelay = 1;
  	}
@@ -17,7 +29,7 @@
  
  	return 0;
  }
-@@ -408,13 +408,11 @@ int neo1973_on_key_pressed(void)
+@@ -410,13 +415,11 @@ int neo1973_on_key_pressed(void)
  						& PCF50633_OOCSTAT_ONKEY);
  }
  
@@ -33,3 +45,18 @@
  }
  
  /* The sum of all part_size[]s must equal to or greater than the NAND size,
+Index: u-boot/board/neo1973/common/bootmenu.c
+===================================================================
+--- u-boot.orig/board/neo1973/common/bootmenu.c
++++ u-boot/board/neo1973/common/bootmenu.c
+@@ -95,7 +95,9 @@ static void poweroff_if_idle(void *user)
+ }
+ 
+ 
+-static struct bootmenu_setup bootmenu_setup = {
++/* "bootmenu_setup" is extern, so platform can tweak it */
++
++struct bootmenu_setup bootmenu_setup = {
+ 	.next_key = aux_key,
+ 	.enter_key = on_key,
+ 	.seconds = seconds,

Modified: trunk/src/target/u-boot/patches/nor-bootmenu.patch
===================================================================
--- trunk/src/target/u-boot/patches/nor-bootmenu.patch	2008-03-05 04:36:40 UTC (rev 4168)
+++ trunk/src/target/u-boot/patches/nor-bootmenu.patch	2008-03-05 06:09:22 UTC (rev 4169)
@@ -24,7 +24,7 @@
  	uint8_t int1, int2;
  	char buf[32];
  	int menu_vote = 0; /* <= 0: no, > 0: yes */
-@@ -246,7 +248,7 @@ int board_late_init(void)
+@@ -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;
  
@@ -32,13 +32,19 @@
 +	if (!booted_from_nand && !booted_from_nor)
  		goto woken_by_reset;
  
- 	/* obtain wake-up reason, save INT1 in environment */
-@@ -308,7 +310,7 @@ continue_boot:
+ 	/* 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;
  	}





More information about the commitlog mailing list