David Brownell <[email protected]> writes:

> Appended is an updated version of a patch I sent around earlier.
>
> ====== CUT HERE
> From: David Brownell <[email protected]>
>
> Update NAND partitioning for the dm6446 evm, unmasking the hidden
> data at the beginning and letting the kernel be updated from Linux.
>
>  - This is boot-compatible with TI's software (U-Boot 1.20 and both
>    the 2.6.10 and 2.6.18 kernels), in terms of startup and loading
>    kernels from flash.
>  
>  - In the same way, it's also boot-compatible with mainline U-Boot,
>    which stores U-Boot params in block 0 not block 16.
>
>  - It's not quite compatible with systems that previously used NAND
>    partitions to hold (filesystem) data.  The compatibilities are a
>    bit different based on which kernel was used previously
>      + Users of TI/MV kernels no longer see mtd2 "params"
>        (mainline u-boot env is in a different place)
>       * Filesystem is now mtd2 ... vs mtd3
>      + Users of GIT kernels now see mtd0 and mtd1 partitions
>       * Filesystem partition starts 640 KBytes earlier
>       * Filesystem is now mtd2 ... vs mtd0
>      * Linux now *uses* the flash-resident BBT
>       * Removes annoying slowdown/hiccup during boot
>       * Potentially ~64KB less space available with TI/MV kernels
>
> If you *used* NAND partitions from Linux, there is no solution that's
> fully compatible with all previous kernels in those respects ... ergo
> this "best compromise".  It'd be good to back back up the filesystem
> data; or, carry your own backwards-compatibility patch for awhile.
>
> Signed-off-by: David Brownell <[email protected]>
> ---
> NOTE:  if this gets merged, I've got a patch I'll submit to make
> mainline U-Boot default to this partition layout.  (It now knows
> about "partitions".)

OK, I'll push this to DaVinci git today and will include it in
the series I'm pushing upstream.

Kevin

>  arch/arm/mach-davinci/board-dm644x-evm.c |   35 ++++++++++++++++++++++++++---
>  1 file changed, 32 insertions(+), 3 deletions(-)
>
> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> @@ -120,20 +120,49 @@ static struct platform_device davinci_ev
>       .resource       = &davinci_evm_norflash_resource,
>  };
>  
> +/* DM644x EVM includes a 64 MByte small-page NAND flash (16K blocks).
> + * It may used instead of the (default) NOR chip to boot, using TI's
> + * tools to install the secondary boot loader (UBL) and U-Boot.
> + */
>  struct mtd_partition davinci_evm_nandflash_partition[] = {
> -     /* 5 MB space at the beginning for bootloader and kernel */
> +     /* Bootloader layout depends on whose u-boot is installed, but we
> +      * can hide all the details.
> +      *  - block 0 for u-boot environment ... in mainline u-boot
> +      *  - block 1 for UBL (plus up to four backup copies in blocks 2..5)
> +      *  - blocks 6...? for u-boot
> +      *  - blocks 16..23 for u-boot environment ... in TI's u-boot
> +      */
>       {
> -             .name           = "NAND filesystem",
> -             .offset         = 5 * SZ_1M,
> +             .name           = "bootloader",
> +             .offset         = 0,
> +             .size           = SZ_256K + SZ_128K,
> +             .mask_flags     = MTD_WRITEABLE,        /* force read-only */
> +     },
> +     /* Kernel */
> +     {
> +             .name           = "kernel",
> +             .offset         = MTDPART_OFS_APPEND,
> +             .size           = SZ_4M,
> +             .mask_flags     = 0,
> +     },
> +     /* File system (older GIT kernels started this on the 5MB mark) */
> +     {
> +             .name           = "filesystem",
> +             .offset         = MTDPART_OFS_APPEND,
>               .size           = MTDPART_SIZ_FULL,
>               .mask_flags     = 0,
>       }
> +     /* A few blocks at end hold a flash BBT ... created by TI's CCS
> +      * using flashwriter_nand.out, but ignored by TI's versions of
> +      * Linux and u-boot.  We boot faster by using them.
> +      */
>  };
>  
>  static struct davinci_nand_pdata davinci_evm_nandflash_data = {
>       .parts          = davinci_evm_nandflash_partition,
>       .nr_parts       = ARRAY_SIZE(davinci_evm_nandflash_partition),
>       .ecc_mode       = NAND_ECC_HW,
> +     .options        = NAND_USE_FLASH_BBT,
>  };
>  
>  static struct resource davinci_evm_nandflash_resource[] = {

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to