u-boot: update patches for boc01
authorJeremy Lainé <jeremy.laine@m4x.org>
Mon, 15 Dec 2008 15:11:43 +0000 (16:11 +0100)
committerJeremy Lainé <jeremy.laine@m4x.org>
Mon, 15 Dec 2008 15:11:43 +0000 (16:11 +0100)
packages/u-boot/u-boot-1.3.2/boc01/001-081209-SPI.patch
packages/u-boot/u-boot-1.3.2/boc01/006-081211-EEPROM_M24C32.patch [new file with mode: 0644]
packages/u-boot/u-boot-1.3.2/boc01/008-081211-TSEC.patch [new file with mode: 0644]
packages/u-boot/u-boot-1.3.2/boc01/011-081211-CMD_TEST.patch [new file with mode: 0644]
packages/u-boot/u-boot-1.3.2/boc01/012-081209-BUG_SETENV.patch [new file with mode: 0644]
packages/u-boot/u-boot-1.3.2/boc01/013-081211-FIX_OOB_8BITS_LARGEPAGE_NAND.patch [new file with mode: 0644]
packages/u-boot/u-boot-1.3.2/boc01/014-081211-BOOT_RESCUE.patch [new file with mode: 0644]
packages/u-boot/u-boot_1.3.2.bb

index 183cf49..861278d 100644 (file)
@@ -1,16 +1,16 @@
 Index: u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c
 ===================================================================
---- u-boot-1.3.2.orig/board/freescale/mpc8313erdb/mpc8313erdb.c        2008-11-24 16:34:21.000000000 +0100
-+++ u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c     2008-11-24 16:44:59.000000000 +0100
+--- u-boot-1.3.2.orig/board/freescale/mpc8313erdb/mpc8313erdb.c
++++ u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c
 @@ -28,6 +28,7 @@
  #endif
  #include <pci.h>
  #include <mpc83xx.h>
-+#include <spi.h> 
++#include <spi.h>
  
  DECLARE_GLOBAL_DATA_PTR;
  
-@@ -107,3 +108,33 @@
+@@ -107,3 +108,33 @@ void ft_board_setup(void *blob, bd_t *bd
  #endif
  }
  #endif
@@ -46,9 +46,9 @@ Index: u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c
 +
 Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
 ===================================================================
---- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h    2008-11-24 16:44:55.000000000 +0100
-+++ u-boot-1.3.2/include/configs/MPC8313ERDB.h 2008-11-24 16:45:26.000000000 +0100
-@@ -370,6 +370,7 @@
+--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h
++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h
+@@ -369,6 +369,7 @@
  #define CONFIG_CMD_PCI
  #define CONFIG_CMD_NAND
  #define CONFIG_CMD_JFFS2
@@ -56,7 +56,7 @@ Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
  
  #if defined(CFG_RAMBOOT)
      #undef CONFIG_CMD_ENV
-@@ -387,6 +388,11 @@
+@@ -386,6 +387,11 @@
  #define MTDPARTS_DEFAULT      "mtdparts=physmap-flash.0:384k(uboot),64k(env)"
  
  
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/006-081211-EEPROM_M24C32.patch b/packages/u-boot/u-boot-1.3.2/boc01/006-081211-EEPROM_M24C32.patch
new file mode 100644 (file)
index 0000000..b448d0f
--- /dev/null
@@ -0,0 +1,13 @@
+Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
+===================================================================
+--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h
++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h
+@@ -271,7 +271,7 @@
+ #define CFG_I2C_EEPROM_ADDR_LEN               2       /* 16-bit EEPROM address */
+ #define CFG_I2C_EEPROM_ADDR           0x50    /* Atmel: AT24C256*/
+ #define CFG_EEPROM_PAGE_WRITE_DELAY_MS        10      /* 10ms of delay */
+-#define CFG_EEPROM_PAGE_WRITE_BITS    6       /* 64-Byte Page Write Mode */
++#define CFG_EEPROM_PAGE_WRITE_BITS    5       /* 32-Byte Page Write Mode */
+ #define CFG_EEPROM_PAGE_WRITE_ENABLE
+ /* TSEC */
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/008-081211-TSEC.patch b/packages/u-boot/u-boot-1.3.2/boc01/008-081211-TSEC.patch
new file mode 100644 (file)
index 0000000..8a7ab22
--- /dev/null
@@ -0,0 +1,162 @@
+Index: u-boot-1.3.2/drivers/net/tsec.c
+===================================================================
+--- u-boot-1.3.2.orig/drivers/net/tsec.c
++++ u-boot-1.3.2/drivers/net/tsec.c
+@@ -179,6 +179,12 @@ int tsec_initialize(bd_t * bis, int inde
+       priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
+       priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
++      /* Init MACCFG2 */
++      priv->regs->maccfg2 = MACCFG2_INIT_SETTINGS;
++
++      /* Init ECNTRL */
++      priv->regs->ecntrl = ECNTRL_INIT_SETTINGS;
++
+ #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
+       && !defined(BITBANGMII)
+       miiphy_register(dev->name, tsec_miiphy_read, tsec_miiphy_write);
+@@ -204,7 +210,7 @@ int tsec_init(struct eth_device *dev, bd
+       /* Make sure the controller is stopped */
+       tsec_halt(dev);
+-      /* Init MACCFG2.  Defaults to GMII */
++      /* Init MACCFG2 */
+       regs->maccfg2 = MACCFG2_INIT_SETTINGS;
+       /* Init ECNTRL */
+@@ -868,7 +874,11 @@ static void startup_tsec(struct eth_devi
+       if(priv->phyinfo)
+               phy_run_commands(priv, priv->phyinfo->startup);
++#ifdef CONFIG_TSEC_NON_MANAGEABLE_PHY
++      priv->link = 1;
++#else
+       adjust_link(dev);
++#endif
+       /* Enable Transmit and Receive */
+       regs->maccfg1 |= (MACCFG1_RX_EN | MACCFG1_TX_EN);
+@@ -1318,6 +1328,21 @@ struct phy_info phy_info_generic =  {
+       }
+ };
++/* a non-manageable PHY interface  */
++struct phy_info phy_info_null =  {
++      0,
++      "Non-manageable PHY",
++      0,
++      (struct phy_cmd[]) { /* config */
++              {miim_end,}
++      },
++      (struct phy_cmd[]) { /* startup */
++              {miim_end,}
++      },
++      (struct phy_cmd[]) { /* shutdown */
++              {miim_end,}
++      }
++};
+ uint mii_parse_lxt971_sr2(uint mii_reg, struct tsec_private *priv)
+ {
+@@ -1473,6 +1498,10 @@ struct phy_info *phy_info[] = {
+  */
+ struct phy_info *get_phy_info(struct eth_device *dev)
+ {
++#ifdef CONFIG_TSEC_NON_MANAGEABLE_PHY
++      debug("%s: Using non-manageable PHY interface\n", dev->name);
++      return &phy_info_null;
++#else
+       struct tsec_private *priv = (struct tsec_private *)dev->priv;
+       uint phy_reg, phy_ID;
+       int i;
+@@ -1503,6 +1532,7 @@ struct phy_info *get_phy_info(struct eth
+       }
+       return theInfo;
++#endif  // CONFIG_TSEC_NON_MANAGEABLE_PHY
+ }
+ /* Execute the given series of commands on the given device's
+Index: u-boot-1.3.2/drivers/net/tsec.h
+===================================================================
+--- u-boot-1.3.2.orig/drivers/net/tsec.h
++++ u-boot-1.3.2/drivers/net/tsec.h
+@@ -56,11 +56,11 @@
+ #define MACCFG1_SYNCD_TX_EN   0x00000002
+ #define MACCFG1_TX_EN         0x00000001
+-#define MACCFG2_INIT_SETTINGS 0x00007205
+ #define MACCFG2_FULL_DUPLEX   0x00000001
+ #define MACCFG2_IF              0x00000300
+ #define MACCFG2_GMII          0x00000200
+ #define MACCFG2_MII             0x00000100
++#define MACCFG2_INIT_SETTINGS (0x00007005 | MACCFG2_MII)
+ #define ECNTRL_INIT_SETTINGS  0x00001000
+ #define ECNTRL_TBI_MODE         0x00000020
+Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
+===================================================================
+--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h
++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h
+@@ -246,8 +246,8 @@
+ #define CFG_BAUDRATE_TABLE    \
+       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
+-#define CFG_NS16550_COM1      (CFG_IMMR+0x4500)
+-#define CFG_NS16550_COM2      (CFG_IMMR+0x4600)
++#define CFG_NS16550_COM1      (CFG_IMMR+0x4600)
++#define CFG_NS16550_COM2      (CFG_IMMR+0x4500)
+ /* Use the HUSH parser */
+ #define CFG_HUSH_PARSER
+@@ -302,23 +302,24 @@
+  * TSEC configuration
+  */
+ #define CONFIG_TSEC_ENET              /* TSEC ethernet support */
++#define CONFIG_TSEC_NON_MANAGEABLE_PHY  /* Non-manageable PHY interface */
+ #ifndef CONFIG_NET_MULTI
+ #define CONFIG_NET_MULTI              1
+ #endif
+ #define CONFIG_GMII                   1       /* MII PHY management */
+-#define CONFIG_TSEC1          1
++//#define CONFIG_TSEC1                1
+ #define CONFIG_TSEC1_NAME     "TSEC0"
+ #define CONFIG_TSEC2          1
+ #define CONFIG_TSEC2_NAME     "TSEC1"
+-#define TSEC1_PHY_ADDR                        0x1c
+-#define TSEC2_PHY_ADDR                        4
+-#define TSEC1_FLAGS                   TSEC_GIGABIT
+-#define TSEC2_FLAGS                   TSEC_GIGABIT
++#define TSEC1_PHY_ADDR                        0 //0x1c
++#define TSEC2_PHY_ADDR                        0 //4
++#define TSEC1_FLAGS                   TSEC_REDUCED //TSEC_GIGABIT
++#define TSEC2_FLAGS                   TSEC_REDUCED //TSEC_GIGABIT
+ #define TSEC1_PHYIDX                  0
+-#define TSEC2_PHYIDX                  0
++#define TSEC2_PHYIDX                  1 //0
+ /* Options are: TSEC[0-1] */
+ #define CONFIG_ETHPRIME                       "TSEC1"
+@@ -472,8 +473,8 @@
+       HRCWH_SW_WATCHDOG_DISABLE |\
+       HRCWH_ROM_LOC_LOCAL_16BIT |\
+       HRCWH_RL_EXT_LEGACY |\
+-      HRCWH_TSEC1M_IN_RGMII |\
+-      HRCWH_TSEC2M_IN_RGMII |\
++      HRCWH_TSEC1M_IN_MII |\
++      HRCWH_TSEC2M_IN_MII |\
+       HRCWH_BIG_ENDIAN |\
+       HRCWH_LALE_NORMAL)
+@@ -482,7 +483,7 @@
+ #define CFG_WATCHDOG_VALUE 0xFFFF
+ /* System IO Config */
+-#define CFG_SICRH     (SICRH_TSOBI1 | SICRH_TSOBI2)   /* RGMII */
++#define CFG_SICRH     0 //(SICRH_TSOBI1 | SICRH_TSOBI2)       /* RGMII */
+ #define CFG_SICRL     (SICRL_USBDR    |SICRL_LBC)             /* Enable Internal USB Phy  */
+ #define CFG_HID0_INIT 0x000000000
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/011-081211-CMD_TEST.patch b/packages/u-boot/u-boot-1.3.2/boc01/011-081211-CMD_TEST.patch
new file mode 100644 (file)
index 0000000..f8a30fa
--- /dev/null
@@ -0,0 +1,454 @@
+Index: u-boot-1.3.2/common/Makefile
+===================================================================
+--- u-boot-1.3.2.orig/common/Makefile
++++ u-boot-1.3.2/common/Makefile
+@@ -95,6 +95,8 @@ COBJS-$(CONFIG_CMD_TERMINAL) += cmd_term
+ COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
+ COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
+ COBJS-$(CONFIG_CMD_LCD) +=cmd_lcd.o
++COBJS-$(CONFIG_CMD_FLTEST) += cmd_fltest.o
++COBJS-$(CONFIG_CMD_NANDTEST) += cmd_nandtest.o
+ COBJS-y += cmd_vfd.o
+ COBJS-y += command.o
+ COBJS-y += console.o
+Index: u-boot-1.3.2/common/cmd_fltest.c
+===================================================================
+--- /dev/null
++++ u-boot-1.3.2/common/cmd_fltest.c
+@@ -0,0 +1,198 @@
++/*
++ * (C) Copyright 2008
++ * Alexandre Coffignal, CenoSYS, alexandre.coffignal@cenosys.com
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <command.h>
++
++#define DEFAULT_RAM_ADDR 0x200000
++static const ulong bitpattern[] = {
++              0x11111111,     /* single bit */
++              0x33333333,     /* two adjacent bits */
++              0x77777777,     /* three adjacent bits */
++              0x0F0F0F0F,     /* four adjacent bits */
++              0x05050505,     /* two non-adjacent bits */
++              0x15151515,     /* three non-adjacent bits */
++              0x00550055,     /* four non-adjacent bits */
++              0xaaaaaaaa,     /* alternating 1/0 */
++      };
++
++#define SECTOR_SIZE   0x10000
++extern int cmd_get_data_size (char *arg, int default_size);
++extern flash_info_t flash_info[];     /* info for FLASH chips */
++static void fill_ram(ulong pattern)
++{
++      //fill ram with patern
++      ulong size=SECTOR_SIZE/4;
++      ulong ram, writeval;
++      char *s;
++      if ((s = getenv("loadaddr")) != NULL)
++      {
++              ram = simple_strtoul(s, NULL, 16);
++      }
++      else
++      {
++              ram=DEFAULT_RAM_ADDR;
++      }
++      writeval = pattern;
++      while (size-- > 0)
++      {
++              *((ulong  *)ram) = (ulong )writeval;
++              ram += 4;
++      }
++      size=SECTOR_SIZE/4;
++      while (size-- > 0)
++      {
++              *((ulong  *)ram) = (ulong )0xFFFFFFFF;
++              ram += 4;
++      }
++}
++
++static int test_sector(ulong start,ulong patern)
++{
++    int rc;
++    ulong addr1, addr2, count;
++      char *s;
++      if ((s = getenv("loadaddr")) != NULL)
++      {
++              addr1 = simple_strtoul(s, NULL, 16);
++      }
++      else
++      {
++              addr1=DEFAULT_RAM_ADDR;
++      }
++    rc = flash_write ((char *)addr1, start, SECTOR_SIZE);
++      if (rc != 0)
++      {
++              flash_perror (rc);
++      }
++      addr2 = start;
++      count=(SECTOR_SIZE/4);
++      while (count-- > 0)
++      {
++              ulong word1 = *(ulong *)addr1;
++              ulong word2 = *(ulong *)addr2;
++              if (word1 != word2)
++              {
++                      printf("word at 0x%08lx (0x%08lx)!=patern (0x%08lx) count = %ld \n",addr2, word2,word1,count);
++                              break;
++              }
++              addr1 += 4;
++              addr2 += 4;
++      }
++      return (0);
++}
++
++int do_fltest ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++      ulong   start,  patern, nb_sector;
++      int i,prot=0;
++      flash_info_t *info = flash_info;
++      int idxtstptrn=0;
++      char forever=0;
++
++      switch(argc)
++      {
++      case 1 :
++              start = 0;
++              nb_sector = info->sector_count-1;
++              patern=bitpattern[0];
++              break;
++      case 2 :
++              start = 0;
++              nb_sector = info->sector_count-1;
++              patern=bitpattern[idxtstptrn];
++              if (!strncmp(argv[1], "forever", 7))
++              {
++                      printf("Test nor flash forever\n");
++                      forever =1;
++              }
++              else
++              {
++                      printf ("Usage:\n%s\n", cmdtp->usage);
++                      return 1;
++              }
++              break;
++      case 4 :
++              start = simple_strtoul(argv[1], NULL, 16);
++              nb_sector = simple_strtoul(argv[2], NULL, 16);
++              patern = simple_strtoul(argv[3], NULL, 16);
++              break;
++
++      default :
++              printf ("Usage:\n%s\n", cmdtp->usage);
++              return 1;
++              break;
++      }
++
++      if((info->sector_count-1)<(start+nb_sector))
++      {
++              printf ("Usage:\n%s\nnot enought sector on this flash\n", cmdtp->usage);
++              return 1;
++      }
++
++      for (i = start; i < (start+nb_sector); ++i)
++      {
++              if (info->protect[i])
++              {
++                      prot++;
++              }
++      }
++      if (prot)
++      {
++              printf ("- Warning: %d protected sectors will not be tested!\n", prot);
++      }
++      do
++      {
++              printf("Test start at sector[%d]=%08lX end at  sector[%d]=%08lX with patern=%08lX\n",start,info->start[start],start+nb_sector,info->start[start+nb_sector],patern);
++              //Erasing flash
++              flash_erase (info, start, start+nb_sector);
++              for (i = start; i < (start+nb_sector); ++i)
++              {
++                      if(!info->protect[i])
++                      {
++                              printf("\rtest at sector[%d]=%08lX with patern=%08lX\t",i,info->start[i],patern);
++                              //fill ram with patern
++                              fill_ram(patern);
++                              //test flash sector
++                              test_sector(info->start[i],patern);
++                      }
++              }
++              printf("\r                                                         \n");
++              //change patern if test forever
++              idxtstptrn++;
++              if(idxtstptrn>7)
++              {
++                      idxtstptrn=0;
++              }
++              patern=bitpattern[idxtstptrn];
++              prot=0;
++      }while(forever);
++      return 0;
++}
++U_BOOT_CMD(
++      fltest,    4,    1,    do_fltest,
++      "fltest  - flash memory test\n",
++      "fltest start end patern\n    - test flash memory from sector start to sector end with partern patern \n"
++      "fltest\n    - test entire flash memory\n"
++      "fltest forever\n    - loop test entire flash memory\n"
++);
+Index: u-boot-1.3.2/common/cmd_nandtest.c
+===================================================================
+--- /dev/null
++++ u-boot-1.3.2/common/cmd_nandtest.c
+@@ -0,0 +1,219 @@
++/*
++ * (C) Copyright 2008
++ * Alexandre Coffignal, CenoSYS, alexandre.coffignal@cenosys.com
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <command.h>
++#include <nand.h>
++#define DEFAULT_RAM_ADDR 0x200000
++static const ulong bitpattern[] = {
++              0x11111111,     /* single bit */
++              0x33333333,     /* two adjacent bits */
++              0x77777777,     /* three adjacent bits */
++              0x0F0F0F0F,     /* four adjacent bits */
++              0x05050505,     /* two non-adjacent bits */
++              0x15151515,     /* three non-adjacent bits */
++              0x00550055,     /* four non-adjacent bits */
++              0xaaaaaaaa,     /* alternating 1/0 */
++      };
++
++static void fill_ram(nand_info_t *nand,ulong pattern)
++{
++      //fill ram with patern
++      ulong size=nand->erasesize/4;
++      ulong ram, writeval;
++      char *s;
++      if ((s = getenv("loadaddr")) != NULL)
++      {
++              ram = simple_strtoul(s, NULL, 16);
++      }
++      else
++      {
++              ram=DEFAULT_RAM_ADDR;
++      }
++
++      writeval = pattern;
++
++      while (size-- > 0)
++      {
++              *((ulong  *)ram) = (ulong )writeval;
++              ram += 4;
++      }
++      size=nand->erasesize/4;
++      while (size-- > 0)
++      {
++              *((ulong  *)ram) = (ulong )0xFFFFFFFF;
++              ram += 4;
++      }
++}
++
++static int test_sector(nand_info_t *nand,ulong start,ulong patern)
++{
++    int rc;
++    ulong addr1, addr2, count;
++      char *s;
++      if ((s = getenv("loadaddr")) != NULL)
++      {
++              addr1 = simple_strtoul(s, NULL, 16);
++      }
++      else
++      {
++              addr1=DEFAULT_RAM_ADDR;
++      }
++      nand_write_options_t opts;
++      memset(&opts, 0, sizeof(opts));
++      opts.buffer     = (u_char*) addr1;
++      opts.length     = nand->erasesize-sizeof(long);
++      opts.offset     = start;
++      opts.pad        = 1;
++      opts.blockalign = 1;
++      opts.quiet      = 1;
++      rc = nand_write_opts(nand, &opts);
++      if (rc != 0)
++      {
++              printf(" %d bytes written:ERROR \n", nand->erasesize);
++      }
++      /* read */
++      nand_read_options_t optsr;
++      memset(&optsr, 0, sizeof(optsr));
++      optsr.buffer    = (u_char*) (addr1+nand->erasesize);
++      optsr.length    = nand->erasesize-sizeof(long);
++      optsr.offset    = start;
++      optsr.quiet      = 1;
++      rc = nand_read_opts(nand, &optsr);
++      if (rc != 0)
++      {
++              printf(" %d bytes read :ERROR \n", nand->erasesize);
++      }
++      addr2 = addr1+nand->erasesize;
++      count=((nand->erasesize-sizeof(long))/4);
++      while (count-- > 0)
++      {
++              ulong word1 = *(ulong *)addr1;
++              ulong word2 = *(ulong *)addr2;
++              if (word1 != word2)
++              {
++                      printf("word at 0x%08lx (0x%08lx)!=patern (0x%08lx) count = %ld \n",addr2, word2,word1,count);
++                      break;
++              }
++              addr1 += 4;
++              addr2 += 4;
++      }
++      return (0);
++}
++
++int do_nandtest ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++      ulong   start,  patern, nb_sector,sector;
++      int prot=0;
++      int idxtstptrn=0;
++      char forever=0;
++      int ret;
++      nand_info_t *nand;
++      nand = &nand_info[nand_curr_device];
++      switch(argc)
++      {
++      case 1 :
++              start = 0;
++              nb_sector = (nand->size/nand->erasesize);
++              patern=bitpattern[0];
++              break;
++
++      case 2 :
++              start = 0;
++              nb_sector = (nand->size/nand->erasesize);
++              patern=bitpattern[idxtstptrn];
++              if (!strncmp(argv[1], "forever", 7))
++              {
++                      printf("Test nor flash forever\n");
++                      forever =1;
++              }
++              else
++              {
++                      printf ("Usage:\n%s\n", cmdtp->usage);
++                      return 1;
++              }
++              break;
++      case 4 :
++              start = simple_strtoul(argv[1], NULL, 16);
++              nb_sector = simple_strtoul(argv[2], NULL, 16);
++              patern = simple_strtoul(argv[3], NULL, 16);
++              break;
++
++      default :
++              printf ("Usage:\n%s\n", cmdtp->usage);
++              return 1;
++              break;
++      }
++
++
++      if((nb_sector+start) > (nand->size/nand->erasesize))
++      {
++              printf ("Not enought sector on this nand flash\n");
++              nb_sector=(nand->size/nand->erasesize)-start;
++      }
++      do
++      {
++              printf("Test start at sector[%d]=%08lX end at  sector[%d]=%08lX with patern=%08lX\n",start,start*nand->erasesize ,start+nb_sector,(start+nb_sector)*nand->erasesize ,patern);
++              for (sector = start; sector < nb_sector; sector ++ )
++              {
++                      printk("\rtest sector %d end at %d with patern=%08lX\t",sector,nb_sector-1,patern);
++                      //fill ram with patern
++                      fill_ram(nand,patern);
++                      //test flash sector
++                      if(nand_block_isbad(nand, sector*nand->erasesize))
++                      {
++                              printf("Bad block\n", nand);
++                      }
++                      else
++                      {
++                              //Erasing nand flash
++                              nand_erase_options_t opts;
++                              memset(&opts, 0, sizeof(opts));
++                              opts.offset = sector*nand->erasesize;
++                              opts.length = nand->erasesize;
++                              opts.quiet  = 1;
++                              ret = nand_erase_opts(nand, &opts);
++                              //Test nand sector
++                              test_sector(nand,sector*nand->erasesize,patern);
++                      }
++              }
++              printf("\r                                                         \n");
++              //change patern if test forever
++              idxtstptrn++;
++              if(idxtstptrn>7)
++              {
++                      idxtstptrn=0;
++              }
++              patern=bitpattern[idxtstptrn];
++              prot=0;
++      }while(forever);
++      return 0;
++}
++U_BOOT_CMD(
++      nandtest,    4,    1,    do_nandtest,
++      "nandtest- nand flash memory test\n",
++      "nandtest start nb_sector patern\n    - test nbsector sector(s) nand flash memory at sector start with partern patern \n"
++      "nandtest\n    - test entire nand flash memory\n"
++      "nandtest forever\n    - loop test entire nand flash memory\n"
++);
++
+Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
+===================================================================
+--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h
++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h
+@@ -376,6 +376,9 @@
+ #define CONFIG_CMD_GPIO
+ #define CONFIG_CMD_EXIO
+ #define CONFIG_CMD_LCD
++#define CONFIG_CMD_FLTEST
++#define CONFIG_CMD_NANDTEST
++
+ #if defined(CFG_RAMBOOT)
+     #undef CONFIG_CMD_ENV
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/012-081209-BUG_SETENV.patch b/packages/u-boot/u-boot-1.3.2/boc01/012-081209-BUG_SETENV.patch
new file mode 100644 (file)
index 0000000..7c5b2e2
--- /dev/null
@@ -0,0 +1,26 @@
+Index: u-boot-1.3.2/common/cmd_nvedit.c
+===================================================================
+--- u-boot-1.3.2.orig/common/cmd_nvedit.c      2008-12-09 16:40:17.000000000 +0100
++++ u-boot-1.3.2/common/cmd_nvedit.c   2008-12-09 16:40:49.000000000 +0100
+@@ -353,6 +353,21 @@
+               return 0;
+       }
++#if defined(CONFIG_HAS_ETH1)
++      if (strcmp(argv[1],"eth1addr") == 0) {
++              char *s = argv[2];      /* always use only one arg */
++              char *e;
++              for (i=0; i<6; ++i) {
++                      bd->bi_enet1addr[i] = s ? simple_strtoul(s, &e, 16) : 0;
++                      if (s) s = (*e) ? e+1 : e;
++              }
++#ifdef CONFIG_NET_MULTI
++              eth_set_enetaddr(1, argv[2]);
++#endif
++              return 0;
++      }
++#endif
++
+       if (strcmp(argv[1],"ipaddr") == 0) {
+               char *s = argv[2];      /* always use only one arg */
+               char *e;
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/013-081211-FIX_OOB_8BITS_LARGEPAGE_NAND.patch b/packages/u-boot/u-boot-1.3.2/boc01/013-081211-FIX_OOB_8BITS_LARGEPAGE_NAND.patch
new file mode 100644 (file)
index 0000000..911dd29
--- /dev/null
@@ -0,0 +1,17 @@
+Index: u-boot-1.3.2/drivers/mtd/nand/nand_bbt.c
+===================================================================
+--- u-boot-1.3.2.orig/drivers/mtd/nand/nand_bbt.c      2008-12-11 10:15:52.000000000 +0100
++++ u-boot-1.3.2/drivers/mtd/nand/nand_bbt.c   2008-12-11 10:16:39.000000000 +0100
+@@ -914,10 +914,11 @@
+       .pattern = scan_ff_pattern
+ };
++//Samsung makes sure that either the 1st or 2nd page of every initial invalid block has non-FFh data at the column address of 2048.
+ static struct nand_bbt_descr largepage_memorybased = {
+       .options = 0,
+       .offs = 0,
+-      .len = 2,
++      .len = 1,
+       .pattern = scan_ff_pattern
+ };
diff --git a/packages/u-boot/u-boot-1.3.2/boc01/014-081211-BOOT_RESCUE.patch b/packages/u-boot/u-boot-1.3.2/boc01/014-081211-BOOT_RESCUE.patch
new file mode 100644 (file)
index 0000000..e18055e
--- /dev/null
@@ -0,0 +1,40 @@
+Index: u-boot-1.3.2/common/main.c
+===================================================================
+--- u-boot-1.3.2.orig/common/main.c
++++ u-boot-1.3.2/common/main.c
+@@ -377,6 +377,15 @@ void main_loop (void)
+       }
+       else
+ #endif /* CONFIG_BOOTCOUNT_LIMIT */
++#ifdef CONFIG_ENV_BOOTRESCUE
++      if ( gpio_get(GPIO_RED_BUTTON) ) {
++              printf ("Red button pressed: booting in rescue mode.\n");
++              s = getenv (CONFIG_ENV_BOOTRESCUE);
++              if ( !s )
++                      printf ("Warning: environment variable '" CONFIG_ENV_BOOTRESCUE "' not set. Giving up rescue boot.\n");
++      }
++      else
++#endif
+               s = getenv ("bootcmd");
+       debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
+Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h
+===================================================================
+--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h
++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h
+@@ -405,6 +405,7 @@
+ #define PRE_INIT_GPIO 0x28
+ #define INIT_GPIO     0x08
+ #define       MAX_GPIO_OUT    7
++#define GPIO_RED_BUTTON 7
+ /* Digital Thermometer and Thermostat */
+ #define CONFIG_DTT_LM73               1
+@@ -558,6 +559,7 @@
+  * Environment Configuration
+  */
+ #define CONFIG_ENV_OVERWRITE
++#define CONFIG_ENV_BOOTRESCUE   "bootrescue"
+ #define CONFIG_ETHADDR                00:E0:0C:00:95:01
+ #define CONFIG_HAS_ETH1
index 9f8eab9..f5cdb1d 100644 (file)
@@ -2,7 +2,7 @@ require u-boot.inc
 
 DEFAULT_PREFERENCE = "-1"
 
-PR = "r6"
+PR = "r7"
 
 SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2"
 
@@ -25,12 +25,15 @@ SRC_URI_append_boc01 = "\
            file://001-081209-SPI.patch;patch=1 \
            file://002-081204-GPIO.patch;patch=1 \
            file://003-081205-DTT_LM73.patch;patch=1 \
-           file://004-081205-WATCHDOG.patch;patch=1 \
-           file://006-081205-EEPROM_INTERSIL.patch;patch=1 \
+           file://006-081211-EEPROM_M24C32.patch;patch=1 \
            file://007-081205-CAPSENSE.patch;patch=1 \
-           file://008-081205-TSEC.patch;patch=1 \
+           file://008-081211-TSEC.patch;patch=1 \
            file://009-081205-EXIO.patch;patch=1 \
            file://010-081205-LCD.patch;patch=1 \
+           file://011-081211-CMD_TEST.patch;patch=1 \
+           file://012-081209-BUG_SETENV.patch;patch=1 \
+           file://013-081211-FIX_OOB_8BITS_LARGEPAGE_NAND.patch;patch=1 \
+           file://014-081211-BOOT_RESCUE.patch;patch=1 \
            "
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"