add chaos_calmer branch
[15.05/openwrt.git] / package / boot / uboot-lantiq / patches / 0022-MIPS-lantiq-easy80920-add-support-for-NAND-SPL.patch
1 From 6fa1c350fa19a054371eccef84e4885cfdd6a2d7 Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Mon, 19 Aug 2013 18:11:31 +0200
4 Subject: MIPS: lantiq: easy80920: add support for NAND SPL
5
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7
8 --- a/boards.cfg
9 +++ b/boards.cfg
10 @@ -509,6 +509,7 @@ Active  mips        mips32         incai
11  Active  mips        mips32         incaip      -               incaip              incaip_100MHz                        incaip:CPU_CLOCK_RATE=100000000                                                                                                   Wolfgang Denk <wd@denx.de>
12  Active  mips        mips32         incaip      -               incaip              incaip_133MHz                        incaip:CPU_CLOCK_RATE=133000000                                                                                                   Wolfgang Denk <wd@denx.de>
13  Active  mips        mips32         incaip      -               incaip              incaip_150MHz                        incaip:CPU_CLOCK_RATE=150000000                                                                                                   Wolfgang Denk <wd@denx.de>
14 +Active  mips        mips32         vrx200      lantiq          easy80920           easy80920_nandspl                    easy80920:SYS_BOOT_NANDSPL                                                                                                        Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
15  Active  mips        mips32         vrx200      lantiq          easy80920           easy80920_nor                        easy80920:SYS_BOOT_NOR                                                                                                            Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
16  Active  mips        mips32         vrx200      lantiq          easy80920           easy80920_norspl                     easy80920:SYS_BOOT_NORSPL                                                                                                         Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
17  Active  mips        mips32         vrx200      lantiq          easy80920           easy80920_ram                        easy80920:SYS_BOOT_RAM                                                                                                            Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
18 --- a/include/configs/easy80920.h
19 +++ b/include/configs/easy80920.h
20 @@ -31,6 +31,14 @@
21  
22  #define CONFIG_LTQ_SUPPORT_SPL_NOR_FLASH       /* Build NOR flash SPL */
23  
24 +#define CONFIG_LTQ_SUPPORT_SPL_NAND_FLASH      /* Build NAND flash SPL */
25 +#define CONFIG_SYS_NAND_PAGE_COUNT     128
26 +#define CONFIG_SYS_NAND_PAGE_SIZE      2048
27 +#define CONFIG_SYS_NAND_OOBSIZE                64
28 +#define CONFIG_SYS_NAND_BLOCK_SIZE     (256 * 1024)
29 +#define CONFIG_SYS_NAND_BAD_BLOCK_POS  NAND_LARGE_BADBLOCK_POS
30 +#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x4000
31 +
32  #define CONFIG_LTQ_SPL_COMP_LZO
33  #define CONFIG_LTQ_SPL_CONSOLE
34  
35 @@ -57,6 +65,11 @@
36  #define CONFIG_ENV_OVERWRITE
37  #define CONFIG_ENV_OFFSET              (192 * 1024)
38  #define CONFIG_ENV_SECT_SIZE           (64 * 1024)
39 +#elif defined(CONFIG_SYS_BOOT_NANDSPL)
40 +#define CONFIG_ENV_IS_IN_NAND
41 +#define CONFIG_ENV_OVERWRITE
42 +#define CONFIG_ENV_OFFSET              (256 * 1024)
43 +#define CONFIG_ENV_SECT_SIZE           (256 * 1024)
44  #else
45  #define CONFIG_ENV_IS_NOWHERE
46  #endif
47 @@ -84,9 +97,13 @@
48  #define CONFIG_ENV_UPDATE_UBOOT_SF                                     \
49         "update-uboot-sf=run load-uboot-sfspl-lzo write-uboot-sf\0"
50  
51 +#define CONFIG_ENV_UPDATE_UBOOT_NAND                                   \
52 +       "update-uboot-nand=run load-uboot-nandspl-lzo write-uboot-nand\0"
53 +
54  #define CONFIG_EXTRA_ENV_SETTINGS      \
55         CONFIG_ENV_LANTIQ_DEFAULTS      \
56         CONFIG_ENV_UPDATE_UBOOT_NOR     \
57 -       CONFIG_ENV_UPDATE_UBOOT_SF
58 +       CONFIG_ENV_UPDATE_UBOOT_SF      \
59 +       CONFIG_ENV_UPDATE_UBOOT_NAND
60  
61  #endif /* __CONFIG_H */