Changeset 4169


Ignore:
Timestamp:
03/05/08 07:09:22 (5 years ago)
Author:
werner
Message:

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
Location:
trunk/src/target/u-boot/patches
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/u-boot/patches/boot-menu.patch

    r4070 r4169  
    143143--- u-boot.orig/board/neo1973/gta01/gta01.c 
    144144+++ u-boot/board/neo1973/gta01/gta01.c 
    145 @@ -230,10 +230,15 @@ 
     145@@ -230,10 +230,15 @@ int board_late_init(void) 
    146146        extern unsigned char booted_from_nand; 
    147147        unsigned char tmp; 
     
    159159                goto woken_by_reset; 
    160160  
    161 @@ -243,45 +248,41 @@ 
     161@@ -243,45 +248,41 @@ int board_late_init(void) 
    162162        setenv("pcf50606_int1", buf); 
    163163  
     
    227227 continue_boot: 
    228228        jbt6k74_init(); 
    229 @@ -305,6 +306,11 @@ 
     229@@ -305,6 +306,11 @@ continue_boot: 
    230230        } 
    231231 #endif 
     
    239239 } 
    240240  
    241 @@ -433,7 +439,17 @@ 
     241@@ -433,7 +439,17 @@ void neo1973_gps(int on) 
    242242        printf("not implemented yet!\n"); 
    243243 } 
     
    262262--- u-boot.orig/board/neo1973/gta01/Makefile 
    263263+++ u-boot/board/neo1973/gta01/Makefile 
    264 @@ -26,7 +26,7 @@ 
     264@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk 
    265265 LIB    = lib$(BOARD).a 
    266266  
     
    275275--- u-boot.orig/board/neo1973/common/neo1973.h 
    276276+++ u-boot/board/neo1973/common/neo1973.h 
    277 @@ -32,4 +32,10 @@ 
     277@@ -32,4 +32,10 @@ int neo1973_911_key_pressed(void); 
    278278 const char *neo1973_get_charge_status(void); 
    279279 int neo1973_set_charge_mode(enum neo1973_charger_cmd cmd); 
     
    290290--- u-boot.orig/common/console.c 
    291291+++ u-boot/common/console.c 
    292 @@ -160,8 +160,12 @@ 
     292@@ -160,8 +160,12 @@ void fprintf (int file, const char *fmt, 
    293293  
    294294 /** U-Boot INITIAL CONSOLE-COMPATIBLE FUNCTION *****************************/ 
     
    303303                /* Get from the standard input */ 
    304304                return fgetc (stdin); 
    305 @@ -171,7 +175,7 @@ 
     305@@ -171,7 +175,7 @@ int getc (void) 
    306306        return serial_getc (); 
    307307 } 
     
    312312        if (gd->flags & GD_FLG_DEVINIT) { 
    313313                /* Test the standard input */ 
    314 @@ -182,6 +186,16 @@ 
     314@@ -182,6 +186,16 @@ int tstc (void) 
    315315        return serial_tstc (); 
    316316 } 
     
    346346--- u-boot.orig/common/Makefile 
    347347+++ u-boot/common/Makefile 
    348 @@ -31,6 +31,7 @@ 
     348@@ -31,6 +31,7 @@ COBJS-y += main.o 
    349349 COBJS-y += ACEX1K.o 
    350350 COBJS-y += altera.o 
     
    358358--- /dev/null 
    359359+++ u-boot/common/bootmenu.c 
    360 @@ -0,0 +1,312 @@ 
     360@@ -0,0 +1,316 @@ 
    361361+/* 
    362362+ * bootmenu.c - Boot menu 
     
    484484+ 
    485485+       bm_printf(ANSI_CLEAR ANSI_GOTOYX "%s", TOP_ROW, 1, version_string); 
    486 +       bm_printf(ANSI_GOTOYX "*** BOOT MENU ***", TOP_ROW+3, 1); 
     486+       if (setup->comment) 
     487+               bm_printf(ANSI_GOTOYX "*** BOOT MENU (%s) ***", 
     488+                   TOP_ROW+3, 1, setup->comment); 
     489+       else 
     490+               bm_printf(ANSI_GOTOYX "*** BOOT MENU ***", TOP_ROW+3, 1); 
    487491+       bm_printf(ANSI_GOTOYX, MENU_0_ROW, 1); 
    488492+ 
     
    675679--- /dev/null 
    676680+++ u-boot/include/bootmenu.h 
    677 @@ -0,0 +1,79 @@ 
     681@@ -0,0 +1,82 @@ 
    678682+/* 
    679683+ * bootmenu.h - Boot menu 
    680684+ * 
    681 + * Copyright (C) 2006-2007 by OpenMoko, Inc. 
     685+ * Copyright (C) 2006-2008 by OpenMoko, Inc. 
    682686+ * Written by Werner Almesberger <werner@openmoko.org> 
    683687+ * All Rights Reserved 
     
    708712+ 
    709713+struct bootmenu_setup { 
     714+       /* title comment, NULL if none */ 
     715+       const char *comment; 
     716+ 
    710717+       /* non-zero while the "next" key is being pressed */ 
    711718+       int (*next_key)(void *user); 
  • trunk/src/target/u-boot/patches/gta02-bootmenu.patch

    r4164 r4169  
    33--- u-boot.orig/board/neo1973/gta02/gta02.c 
    44+++ u-boot/board/neo1973/gta02/gta02.c 
    5 @@ -306,12 +306,12 @@ continue_boot: 
     5@@ -33,6 +33,7 @@ 
     6 #include <common.h> 
     7 #include <s3c2440.h> 
     8 #include <i2c.h> 
     9+#include <bootmenu.h> 
     10  
     11 #include "../common/neo1973.h" 
     12 #include "../common/jbt6k74.h" 
     13@@ -308,12 +309,16 @@ continue_boot: 
    614                if (!(gpio->GPFDAT & (1 << 5))) 
    715                        gpio->GPBDAT &= ~(1 << 2); 
     
    1119        if (menu_vote > 0) { 
    1220-               bootmenu(); 
     21+               extern struct bootmenu_setup bootmenu_setup; 
     22+ 
     23+               if (booted_from_nand) 
     24+                       bootmenu_setup.comment = "NAND"; 
    1325+               neo1973_bootmenu(); 
    1426                nobootdelay = 1; 
     
    1830        return 0; 
    1931 } 
    20 @@ -408,13 +408,11 @@ int neo1973_on_key_pressed(void) 
     32@@ -410,13 +415,11 @@ int neo1973_on_key_pressed(void) 
    2133                                                & PCF50633_OOCSTAT_ONKEY); 
    2234 } 
     
    3446  
    3547 /* The sum of all part_size[]s must equal to or greater than the NAND size, 
     48Index: u-boot/board/neo1973/common/bootmenu.c 
     49=================================================================== 
     50--- u-boot.orig/board/neo1973/common/bootmenu.c 
     51+++ u-boot/board/neo1973/common/bootmenu.c 
     52@@ -95,7 +95,9 @@ static void poweroff_if_idle(void *user) 
     53 } 
     54  
     55  
     56-static struct bootmenu_setup bootmenu_setup = { 
     57+/* "bootmenu_setup" is extern, so platform can tweak it */ 
     58+ 
     59+struct bootmenu_setup bootmenu_setup = { 
     60        .next_key = aux_key, 
     61        .enter_key = on_key, 
     62        .seconds = seconds, 
  • trunk/src/target/u-boot/patches/nor-bootmenu.patch

    r4164 r4169  
    2525        char buf[32]; 
    2626        int menu_vote = 0; /* <= 0: no, > 0: yes */ 
    27 @@ -246,7 +248,7 @@ int board_late_init(void) 
     27@@ -250,7 +252,7 @@ int board_late_init(void) 
    2828        /* if there's no other reason, must be regular reset */ 
    2929        neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 
     
    3333                goto woken_by_reset; 
    3434  
    35         /* obtain wake-up reason, save INT1 in environment */ 
    36 @@ -308,7 +310,7 @@ continue_boot: 
     35        /* save wake-up reason in environment */ 
     36@@ -310,11 +312,13 @@ continue_boot: 
    3737        } 
    3838 #endif 
     
    4040-       if (menu_vote > 0) { 
    4141+       if (menu_vote > 0 || booted_from_nor) { 
     42                extern struct bootmenu_setup bootmenu_setup; 
     43  
     44                if (booted_from_nand) 
     45                        bootmenu_setup.comment = "NAND"; 
     46+               if (booted_from_nor) 
     47+                       bootmenu_setup.comment = "NOR"; 
    4248                neo1973_bootmenu(); 
    4349                nobootdelay = 1; 
Note: See TracChangeset for help on using the changeset viewer.