uboot-mt623x/common
Ben Gardiner c9f7351b5b NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB)
This is a re-submission of the patch by Harald Welte
<laforge@openmoko.org> with minor modifications for rebase and changes
as suggested by Scott Wood <scottwood@freescale.com> [1] [2].

This patch enables the environment partition to have a run-time dynamic
location (offset) in the NAND flash.  The reason for this is simply that
all NAND flashes have factory-default bad blocks, and a fixed compile
time offset would mean that sometimes the environment partition would
live inside factory bad blocks. Since the number of factory default
blocks can be quite high (easily 1.3MBytes in current standard
components), it is not economic to keep that many spare blocks inside
the environment partition.

With this patch and CONFIG_ENV_OFFSET_OOB enabled, the location of the
environment partition is stored in the out-of-band (OOB) data of the
first block in flash. Since the first block is where most systems boot
from, the vendors guarantee that the first block is not a factory
default block.

This patch introduces the 'nand env.oob' command, which can be called
from the u-boot command line. 'nand env.oob get' reads the address of
the environment partition from the OOB data, 'nand env.oob set
{offset,partition-name}' allows the setting of the marker by specifying
a numeric offset or a partition name.

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/43916
[2] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/79195

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Acked-by: Harald Welte <laforge@gnumonks.org>
2010-07-12 13:56:46 -05:00
..
Makefile CRAMFS: support cramfs in RAM 2010-01-18 00:44:13 +01:00
bedbug.c common: Move conditional compilation to Makefile 2008-08-13 01:40:38 +02:00
cmd_ambapp.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_bdinfo.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_bedbug.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_bmp.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_boot.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_bootldr.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_bootm.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_cache.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_console.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_cplbinfo.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_cramfs.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_dataflash_mmc_mux.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_date.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_dcr.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_df.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_diag.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_display.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_dtt.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_echo.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_eeprom.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_elf.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_exit.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ext2.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_fat.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_fdc.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_fdos.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_fdt.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_flash.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_fpga.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_help.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_i2c.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ide.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_immap.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_irq.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_itest.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_jffs2.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_license.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_load.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_log.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mac.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mem.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mfsl.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mgdisk.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mii.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_misc.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mmc.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mp.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_mtdparts.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_nand.c NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB) 2010-07-12 13:56:46 -05:00
cmd_net.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_nvedit.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_onenand.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_otp.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_pci.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_pcmcia.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_portio.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_reginfo.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_reiser.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_sata.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_scsi.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_setexpr.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_sf.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_source.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_spi.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_spibootldr.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_strings.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_terminal.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_test.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_tsi148.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ubi.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ubifs.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_universe.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_usb.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_version.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_vfd.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ximg.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_yaffs2.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
command.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
console.c Make *printf() return "int" instead of "void" 2010-07-04 23:51:49 +02:00
ddr_spd.c Enabled support for Rev 1.3 SPD for DDR2 DIMMs 2010-05-12 04:54:30 -05:00
dlmalloc.c malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure 2010-04-10 00:30:27 +02:00
dlmalloc.src * Code cleanup: 2003-06-27 21:31:46 +00:00
env_common.c Remove AmigaOneG3SE board 2010-06-23 23:24:20 +02:00
env_dataflash.c env: kill off default_environment_size 2009-08-09 22:41:42 +02:00
env_eeprom.c Redundant environment: move flag definitions to header file 2010-07-04 23:52:42 +02:00
env_embedded.c Revert "env: only build env_embedded and envcrc when needed" 2009-10-27 20:46:31 +01:00
env_flash.c Redundant environment: move flag definitions to header file 2010-07-04 23:52:42 +02:00
env_mgdisk.c env: kill off default_environment_size 2009-08-09 22:41:42 +02:00
env_nand.c NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB) 2010-07-12 13:56:46 -05:00
env_nowhere.c env: kill off default_environment_size 2009-08-09 22:41:42 +02:00
env_nvram.c Remove AmigaOneG3SE board 2010-06-23 23:24:20 +02:00
env_onenand.c onenand: Fix compile errors due to FlexOneNAND 2010-01-06 16:28:00 -06:00
env_sf.c add redundant environment for env_sf.c 2010-06-30 23:47:08 -04:00
exports.c exports.c: fix warning: 'dummy' defined but not used 2010-07-04 23:50:55 +02:00
fdt_support.c fdt_support: add entry for sec3.1 and fix sec3.3 2010-05-30 11:14:37 -05:00
flash.c rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
hush.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
hwconfig.c hwconfig: Add some unit tests 2010-06-29 22:24:48 +02:00
image.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
iomux.c stdio/device: rework function naming convention 2009-07-18 00:27:46 +02:00
kallsyms.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
kgdb.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
kgdb_stubs.c kgdb: add default generic stubs 2010-01-18 00:23:00 +01:00
lcd.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
lynxkdi.c Fix implicit declaration of function 'eth_[gs]etenv_enetaddr' 2009-03-28 20:16:16 +01:00
main.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
memsize.c Sequential accesses to non-existent memory must be synchronized, 2006-11-06 17:06:36 +01:00
miiphyutil.c Cosmetic change - indentation correction. 2010-03-12 00:19:11 +01:00
modem.c make MODEM SUPPORT generic instead of duplicate it 2009-06-12 20:45:47 +02:00
s_record.c Initial revision 2002-08-17 09:36:01 +00:00
serial.c x86: Use CONFIG_SERIAL_MULTI 2010-05-06 00:16:46 +02:00
stdio.c arm/microblaze/nios/nios2/sh: Remove relocation fixups 2009-10-03 10:17:57 +02:00
system_map.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
update.c rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
usb.c USB: usb_control_msg wait for driver ISR to set status. 2010-02-03 22:06:59 +01:00
usb_kbd.c USB Consolidate descriptor definitions 2009-12-20 12:47:37 +01:00
usb_storage.c USB storage probe 2010-04-08 21:40:00 +02:00
xyzModem.c common: fix 'dummy' is used uninitialized in this function warning 2009-07-19 21:37:02 +02:00