Changeset 3749


Ignore:
Timestamp:
12/28/07 08:16:20 (5 years ago)
Author:
werner
Message:

Support board-specific NAND initialization, and use this to make "nand
createbbt" on GTA02 more efficient. (Run time decreases from about 145 seconds
to less than ten.)

uboot-s3c2410-nand.patch:

  • cpu/arm920t/s3c24x0/nand.c (s3c2410_nand_enable_hwecc): is only used in this file and therefore should be "static"
  • cpu/arm920t/s3c24x0/nand.c (board_nand_init): renamed to board_nand_init and added weak alias, so that we can have board-specific NAND initialization
  • include/s3c24x0.h (board_nand_init): added prototype

uboot-gta02.patch:

  • board/neo1973/gta02/Makefile: added nand.o to OBJS, wrapped overlong line
  • board/neo1973/gta02/nand.c: override board_nand_init

neo1973-gsmver.patch:

  • board/neo1973/gta02/Makefile: updated for nand.o addition

bbt-scan-second.patch:

  • removed. The use of a "weak" symbol makes the mechanism more compact. Furthermore, since the default is NAND_BBT_SCANALLPAGES anyway, this patch didn't accomplish anything for GTA01.

The change to nand_block_bad in drivers/nand/nand_base.c is conceptually
sound if we assume that nand_block_bad should indicate all bad blocks also in
the absence of a bad block table. However, since we have a bad block table on
all OpenMoko? devices, this issue does not arise.

Location:
trunk/src/target/u-boot/patches
Files:
1 deleted
3 edited

Legend:

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

    r3184 r3749  
    1111--- u-boot.orig/board/neo1973/common/cmd_neo1973.c 
    1212+++ u-boot/board/neo1973/common/cmd_neo1973.c 
    13 @@ -77,8 +77,10 @@ 
     13@@ -85,8 +85,10 @@ 
    1414                        goto out_help; 
    1515                if (!strcmp(argv[2], "on")) 
     
    2323                if (argc < 3) 
    2424                        goto out_help; 
    25 @@ -121,7 +123,7 @@ 
    26         "neo1973 charger off - disable charging\n" 
     25@@ -130,7 +132,7 @@ 
    2726        "neo1973 backlight (on|off) - switch backlight on or off\n" 
     27        "neo1973 led num (on|off) - switch LED number 'num' on or off\n" 
    2828        "neo1973 vibrator (on|off) - switch vibrator on or off\n" 
    2929-       "neo1973 gsm (on|off) - switch GSM Modem on or off\n" 
     
    134134--- u-boot.orig/board/neo1973/gta02/Makefile 
    135135+++ u-boot/board/neo1973/gta02/Makefile 
    136 @@ -25,7 +25,7 @@ 
    137   
     136@@ -26,6 +26,7 @@ 
    138137 LIB    = lib$(BOARD).a 
    139138  
    140 -OBJS   := gta02.o pcf50633.o ../common/cmd_neo1973.o ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o 
    141 +OBJS   := gta02.o pcf50633.o ../common/cmd_neo1973.o ../common/gsmver.o ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o 
     139 OBJS   := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \ 
     140+          ../common/gsmver.o \ 
     141           ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o 
    142142 SOBJS  := ../common/lowlevel_init.o 
    143143  
    144  .PHONY:        all 
  • trunk/src/target/u-boot/patches/uboot-gta02.patch

    r3648 r3749  
    55--- u-boot.orig/Makefile 
    66+++ u-boot/Makefile 
    7 @@ -2250,6 +2250,13 @@ 
     7@@ -2253,6 +2253,13 @@ 
    88 sbc2410x_config: unconfig 
    99        @$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0 
     
    2323--- /dev/null 
    2424+++ u-boot/board/neo1973/gta02/Makefile 
    25 @@ -0,0 +1,64 @@ 
     25@@ -0,0 +1,65 @@ 
    2626+# 
    2727+# (C) Copyright 2000, 2001, 2002 
     
    5151+LIB    = lib$(BOARD).a 
    5252+ 
    53 +OBJS   := gta02.o pcf50633.o ../common/cmd_neo1973.o ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o 
     53+OBJS   := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \ 
     54+          ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o 
    5455+SOBJS  := ../common/lowlevel_init.o 
    5556+ 
     
    23462347+ 
    23472348+#endif /* _GLAMO_REGS_H */ 
     2349Index: u-boot/board/neo1973/gta02/nand.c 
     2350=================================================================== 
     2351--- /dev/null 
     2352+++ u-boot/board/neo1973/gta02/nand.c 
     2353@@ -0,0 +1,47 @@ 
     2354+/* 
     2355+ * nand.c - Board-specific NAND setup 
     2356+ * 
     2357+ * Copyright (C) 2007 by OpenMoko, Inc. 
     2358+ * Written by Werner Almesberger <werner@openmoko.org> 
     2359+ * All Rights Reserved 
     2360+ * 
     2361+ * This program is free software; you can redistribute it and/or 
     2362+ * modify it under the terms of the GNU General Public License as 
     2363+ * published by the Free Software Foundation; either version 2 of 
     2364+ * the License, or (at your option) any later version. 
     2365+ * 
     2366+ * This program is distributed in the hope that it will be useful, 
     2367+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     2368+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     2369+ * GNU General Public License for more details. 
     2370+ * 
     2371+ * You should have received a copy of the GNU General Public License 
     2372+ * along with this program; if not, write to the Free Software 
     2373+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
     2374+ * MA 02111-1307 USA 
     2375+ */ 
     2376+ 
     2377+ 
     2378+#include "config.h" /* nand.h needs NAND_MAX_CHIPS */ 
     2379+#include "linux/mtd/mtd.h" 
     2380+#include "linux/mtd/nand.h" 
     2381+#include "s3c2440.h" 
     2382+ 
     2383+ 
     2384+/* Derived from drivers/nand/nand_bbt.c:largepage_flashbased */ 
     2385+ 
     2386+static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; 
     2387+ 
     2388+static struct nand_bbt_descr badblock_pattern = { 
     2389+       .options = NAND_BBT_SCAN2NDPAGE, 
     2390+       .offs = 0, 
     2391+       .len = 1, 
     2392+       .pattern = scan_ff_pattern 
     2393+}; 
     2394+ 
     2395+ 
     2396+int board_nand_init(struct nand_chip *nand) 
     2397+{ 
     2398+       nand->badblock_pattern = &badblock_pattern; 
     2399+       return __board_nand_init(nand); 
     2400+} 
  • trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch

    r3692 r3749  
    2020--- /dev/null 
    2121+++ u-boot/cpu/arm920t/s3c24x0/nand.c 
    22 @@ -0,0 +1,179 @@ 
     22@@ -0,0 +1,183 @@ 
    2323+/* 
    2424+ * (C) Copyright 2006 OpenMoko, Inc. 
     
    114114+ 
    115115+#ifdef CONFIG_S3C2410_NAND_HWECC 
    116 +void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode) 
     116+static void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode) 
    117117+{ 
    118118+       DEBUGN("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd ,mode); 
     
    145145+#endif 
    146146+ 
    147 +int board_nand_init(struct nand_chip *nand) 
     147+ 
     148+int board_nand_init(void) __attribute__((weak, alias("__board_nand_init"))); 
     149+ 
     150+ 
     151+int __board_nand_init(struct nand_chip *nand) 
    148152+{ 
    149153+       u_int32_t cfg; 
     
    200204+#endif 
    201205+#endif 
     206Index: u-boot/include/s3c24x0.h 
     207=================================================================== 
     208--- u-boot.orig/include/s3c24x0.h 
     209+++ u-boot/include/s3c24x0.h 
     210@@ -1132,4 +1132,6 @@ 
     211  
     212 #endif 
     213  
     214+int __board_nand_init(struct nand_chip *nand); 
     215+ 
     216 #endif /*__S3C24X0_H__*/ 
Note: See TracChangeset for help on using the changeset viewer.