r1176 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Thu Mar 1 14:36:15 CET 2007
Author: laforge
Date: 2007-03-01 14:36:15 +0100 (Thu, 01 Mar 2007)
New Revision: 1176
Added:
trunk/src/target/u-boot/patches/uboot-nand-markbad-reallybad.patch
Modified:
trunk/src/target/u-boot/patches/series
trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch
Log:
* introduce Hardware ECC support for the S3C2410 NAND driver
** big speedup compared to software ECC
** detects single and multi-bit errors
** doesn't correct 1-bit errors yet
* enable hardware ECC in the neo1973 config
* add a patch to really mark bad blocks as bad
Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series 2007-03-01 13:22:29 UTC (rev 1175)
+++ trunk/src/target/u-boot/patches/series 2007-03-01 13:36:15 UTC (rev 1176)
@@ -63,3 +63,4 @@
# those have to be implemented fully
uboot-dfu.patch
uboot-neo1973-defaultenv.patch
+uboot-nand-markbad-reallybad.patch
Modified: trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch 2007-03-01 13:22:29 UTC (rev 1175)
+++ trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch 2007-03-01 13:36:15 UTC (rev 1176)
@@ -6,9 +6,9 @@
Index: u-boot/Makefile
===================================================================
---- u-boot.orig/Makefile
-+++ u-boot/Makefile
-@@ -1931,6 +1931,13 @@ omap730p2_cs3boot_config : unconfig
+--- u-boot.orig/Makefile 2007-03-01 14:31:08.000000000 +0100
++++ u-boot/Makefile 2007-03-01 14:31:09.000000000 +0100
+@@ -1934,6 +1934,13 @@
sbc2410x_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
@@ -24,8 +24,8 @@
Index: u-boot/board/neo1973/Makefile
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/Makefile
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/Makefile 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000, 2001, 2002
@@ -76,8 +76,8 @@
+#########################################################################
Index: u-boot/board/neo1973/config.mk
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/config.mk
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/config.mk 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
@@ -115,8 +115,8 @@
+endif
Index: u-boot/board/neo1973/neo1973.c
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/neo1973.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/neo1973.c 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,317 @@
+/*
+ * (C) 2006 by OpenMoko, Inc.
@@ -437,8 +437,8 @@
+}
Index: u-boot/board/neo1973/lowlevel_init.S
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/lowlevel_init.S
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/lowlevel_init.S 2007-03-01 14:31:22.000000000 +0100
@@ -0,0 +1,188 @@
+/*
+ * Memory Setup stuff - taken from blob memsetup.S
@@ -630,8 +630,8 @@
+ .word 0x30
Index: u-boot/board/neo1973/u-boot.lds
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/u-boot.lds
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/u-boot.lds 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2002
@@ -693,9 +693,9 @@
+}
Index: u-boot/include/configs/neo1973.h
===================================================================
---- /dev/null
-+++ u-boot/include/configs/neo1973.h
-@@ -0,0 +1,259 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/include/configs/neo1973.h 2007-03-01 14:31:09.000000000 +0100
+@@ -0,0 +1,260 @@
+/*
+ * (C) Copyright 2006 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -953,12 +953,13 @@
+#endif
+
+#define CONFIG_S3C2410_NAND_BBT 1
++#define CONFIG_S3C2410_NAND_HWECC 1
+
+#endif /* __CONFIG_H */
Index: u-boot/board/neo1973/split_by_variant.sh
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/split_by_variant.sh
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/split_by_variant.sh 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,49 @@
+#!/bin/sh
+# ---------------------------------------------------------
@@ -1011,8 +1012,8 @@
+$MKCONFIG -a neo1973 arm arm920t neo1973 NULL s3c24x0
Index: u-boot/board/neo1973/cmd_neo1973.c
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/cmd_neo1973.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/cmd_neo1973.c 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,120 @@
+/*
+ * (C) Copyright 2006 by OpenMoko, Inc.
@@ -1136,8 +1137,8 @@
+#endif /* CFG_CMD_BDI */
Index: u-boot/board/neo1973/neo1973.h
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/neo1973.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/neo1973.h 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,18 @@
+#ifndef _NEO1973_H
+#define _NEO1973_H
@@ -1159,8 +1160,8 @@
+#endif
Index: u-boot/board/neo1973/pcf50606.c
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/pcf50606.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/pcf50606.c 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,168 @@
+
+#include <common.h>
@@ -1332,8 +1333,8 @@
+}
Index: u-boot/board/neo1973/pcf50606.h
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/pcf50606.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/pcf50606.h 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,267 @@
+#ifndef _PCF50606_H
+#define _PCF50606_H
@@ -1604,9 +1605,9 @@
+
Index: u-boot/common/main.c
===================================================================
---- u-boot.orig/common/main.c
-+++ u-boot/common/main.c
-@@ -61,6 +61,7 @@ static int abortboot(int);
+--- u-boot.orig/common/main.c 2007-03-01 14:29:31.000000000 +0100
++++ u-boot/common/main.c 2007-03-01 14:31:09.000000000 +0100
+@@ -61,6 +61,7 @@
#undef DEBUG_PARSER
char console_buffer[CFG_CBSIZE]; /* console I/O buffer */
@@ -1614,7 +1615,7 @@
#ifndef CONFIG_CMDLINE_EDITING
static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
-@@ -404,7 +405,7 @@ void main_loop (void)
+@@ -404,7 +405,7 @@
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
@@ -1625,8 +1626,8 @@
# endif
Index: u-boot/board/neo1973/jbt6k74.c
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/jbt6k74.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/jbt6k74.c 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,403 @@
+/* u-boot driver for the tpo JBT6K74-AS LCM ASIC
+ *
@@ -2033,8 +2034,8 @@
+}
Index: u-boot/board/neo1973/jbt6k74.h
===================================================================
---- /dev/null
-+++ u-boot/board/neo1973/jbt6k74.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/board/neo1973/jbt6k74.h 2007-03-01 14:31:09.000000000 +0100
@@ -0,0 +1,14 @@
+#ifndef _JBT6K74_H
+#define _JBT6K74_H
Added: trunk/src/target/u-boot/patches/uboot-nand-markbad-reallybad.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-nand-markbad-reallybad.patch 2007-03-01 13:22:29 UTC (rev 1175)
+++ trunk/src/target/u-boot/patches/uboot-nand-markbad-reallybad.patch 2007-03-01 13:36:15 UTC (rev 1176)
@@ -0,0 +1,20 @@
+This patch makes sure that the 'nand markbad' command does not only mark a block
+'bad' in the bad-block table, but _also_ marks it bad in the OOB area.
+
+we need this to preserve the bad block status when re-creating the bad block table
+at some later point.
+
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+Index: u-boot/drivers/nand/nand_base.c
+===================================================================
+--- u-boot.orig/drivers/nand/nand_base.c 2007-03-01 12:47:31.000000000 +0100
++++ u-boot/drivers/nand/nand_base.c 2007-03-01 12:48:08.000000000 +0100
+@@ -481,7 +481,7 @@
+
+ /* Do we have a flash based bad block table ? */
+ if (this->options & NAND_USE_FLASH_BBT)
+- return nand_update_bbt (mtd, ofs);
++ nand_update_bbt (mtd, ofs);
+
+ /* We write two bytes, so we dont have to mess with 16 bit access */
+ ofs += mtd->oobsize + (this->badblockpos & ~0x01);
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch 2007-03-01 13:22:29 UTC (rev 1175)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch 2007-03-01 13:36:15 UTC (rev 1176)
@@ -5,9 +5,9 @@
Index: u-boot/cpu/arm920t/s3c24x0/Makefile
===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/Makefile
-+++ u-boot/cpu/arm920t/s3c24x0/Makefile
-@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
+--- u-boot.orig/cpu/arm920t/s3c24x0/Makefile 2007-02-28 03:47:44.000000000 +0100
++++ u-boot/cpu/arm920t/s3c24x0/Makefile 2007-03-01 14:29:32.000000000 +0100
+@@ -26,7 +26,7 @@
LIB = $(obj)lib$(SOC).a
COBJS = i2c.o interrupts.o serial.o speed.o \
@@ -18,9 +18,9 @@
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Index: u-boot/cpu/arm920t/s3c24x0/nand.c
===================================================================
---- /dev/null
-+++ u-boot/cpu/arm920t/s3c24x0/nand.c
-@@ -0,0 +1,185 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/cpu/arm920t/s3c24x0/nand.c 2007-03-01 14:30:27.000000000 +0100
+@@ -0,0 +1,225 @@
+/*
+ * (C) Copyright 2006 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -64,6 +64,9 @@
+#define NFADDR __REGb(NF_BASE + 0x8)
+#define NFDATA __REGb(NF_BASE + 0xc)
+#define NFSTAT __REGb(NF_BASE + 0x10)
++#define NFECC0 __REGb(NF_BASE + 0x14)
++#define NFECC1 __REGb(NF_BASE + 0x15)
++#define NFECC2 __REGb(NF_BASE + 0x16)
+
+#define S3C2410_NFCONF_EN (1<<15)
+#define S3C2410_NFCONF_512BYTE (1<<14)
@@ -158,6 +161,35 @@
+ while (!s3c2410_dev_ready(mtd));
+}
+
++#ifdef CONFIG_S3C2410_NAND_HWECC
++void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode)
++{
++ DEBUGN("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd ,mode);
++ NFCONF |= S3C2410_NFCONF_INITECC;
++}
++
++static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code)
++{
++ ecc_code[0] = NFECC0;
++ ecc_code[1] = NFECC1;
++ ecc_code[2] = NFECC2;
++ DEBUGN("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n", mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
++
++ return 0;
++}
++
++int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc)
++{
++ if (read_ecc[0] == calc_ecc[0] &&
++ read_ecc[1] == calc_ecc[1] &&
++ read_ecc[2] == calc_ecc[2])
++ return 0;
++
++ printf("s3c2410_nand_correct_data: not implemented\n");
++ return -1;
++}
++#endif
++
+int board_nand_init(struct nand_chip *nand)
+{
+ u_int32_t cfg;
@@ -190,7 +222,15 @@
+
+ nand->dev_ready = s3c2410_dev_ready;
+
++#ifdef CONFIG_S3C2410_NAND_HWECC
++ nand->enable_hwecc = s3c2410_nand_enable_hwecc;
++ nand->calculate_ecc = s3c2410_nand_calculate_ecc;
++ nand->correct_data = s3c2410_nand_correct_data;
++ nand->eccmode = NAND_ECC_HW3_512;
++#else
+ nand->eccmode = NAND_ECC_SOFT;
++#endif
++
+#ifdef CONFIG_S3C2410_NAND_BBT
+ nand->options = NAND_USE_FLASH_BBT;
+#else
@@ -208,8 +248,8 @@
+#endif
Index: u-boot/cpu/arm920t/s3c24x0/nand_read.c
===================================================================
---- /dev/null
-+++ u-boot/cpu/arm920t/s3c24x0/nand_read.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ u-boot/cpu/arm920t/s3c24x0/nand_read.c 2007-02-28 03:51:24.000000000 +0100
@@ -0,0 +1,98 @@
+/*
+ * nand_read.c: Simple NAND read functions for booting from NAND
@@ -311,8 +351,8 @@
+#endif /* CONFIG_S3C2410_NAND_BOOT */
Index: u-boot/cpu/arm920t/start.S
===================================================================
---- u-boot.orig/cpu/arm920t/start.S
-+++ u-boot/cpu/arm920t/start.S
+--- u-boot.orig/cpu/arm920t/start.S 2007-02-28 03:47:44.000000000 +0100
++++ u-boot/cpu/arm920t/start.S 2007-03-01 14:29:22.000000000 +0100
@@ -5,6 +5,10 @@
* Copyright (c) 2002 Alex Züpke <azu at sysgo.de>
* Copyright (c) 2002 Gary Jennejohn <gj at denx.de>
@@ -332,7 +372,7 @@
/*
-@@ -161,6 +166,7 @@ reset:
+@@ -161,6 +166,7 @@
#endif
#ifndef CONFIG_SKIP_RELOCATE_UBOOT
@@ -340,7 +380,7 @@
relocate: /* relocate U-Boot to RAM */
adr r0, _start /* r0 <- current position of code */
ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
-@@ -177,6 +183,93 @@ copy_loop:
+@@ -177,6 +183,93 @@
stmia r1!, {r3-r10} /* copy to target address [r1] */
cmp r0, r2 /* until source end addreee [r2] */
ble copy_loop
@@ -436,8 +476,8 @@
/* Set up the stack */
Index: u-boot/include/s3c2410.h
===================================================================
---- u-boot.orig/include/s3c2410.h
-+++ u-boot/include/s3c2410.h
+--- u-boot.orig/include/s3c2410.h 2007-02-28 03:51:24.000000000 +0100
++++ u-boot/include/s3c2410.h 2007-03-01 14:29:22.000000000 +0100
@@ -38,12 +38,6 @@
#define S3C2410_ECCSIZE 512
#define S3C2410_ECCBYTES 3
@@ -451,7 +491,7 @@
/* S3C2410 device base addresses */
#define S3C24X0_MEMCTL_BASE 0x48000000
#define S3C24X0_USB_HOST_BASE 0x49000000
-@@ -65,9 +59,23 @@ typedef enum {
+@@ -65,9 +59,23 @@
#define S3C2410_SDI_BASE 0x5A000000
@@ -475,7 +515,7 @@
static inline S3C24X0_MEMCTL * S3C24X0_GetBase_MEMCTL(void)
{
-@@ -142,6 +150,7 @@ static inline S3C2410_SDI * S3C2410_GetB
+@@ -142,6 +150,7 @@
return (S3C2410_SDI * const)S3C2410_SDI_BASE;
}
More information about the commitlog
mailing list