Merge branch 'tx6-bugfix'
[karo-tx-uboot.git] / include / configs / tx6.h
index bd67709..dcd36de 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 <LW@KARO-electronics.de>
+ * Copyright (C) 2012-2015 <LW@KARO-electronics.de>
  *
  * SPDX-License-Identifier:      GPL-2.0
  *
@@ -8,13 +8,30 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/sizes.h>
+#ifndef CONFIG_SOC_MX6UL
+#define CONFIG_ARM_ERRATA_743622
+#define CONFIG_ARM_ERRATA_751472
+#define CONFIG_ARM_ERRATA_794072
+#define CONFIG_ARM_ERRATA_761320
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define CONFIG_SYS_L2_PL310
+#define CONFIG_SYS_PL310_BASE   L2_PL310_BASE
+#endif
+
+#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
+#define CONFIG_MP
+#endif
+#define CONFIG_BOARD_POSTCLK_INIT
+#define CONFIG_MXC_GPT_HCLK
+
+#include <linux/kconfig.h>
+#include <linux/sizes.h>
 #include <asm/arch/imx-regs.h>
 
 /*
  * Ka-Ro TX6 board - SoC configuration
  */
-#define CONFIG_MX6
 #define CONFIG_SYS_MX6_HCLK            24000000
 #define CONFIG_SYS_MX6_CLK32           32768
 #define CONFIG_SYS_HZ                  1000            /* Ticks per second */
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_CMD_GPIO
 
-#ifndef CONFIG_MFG
 /* LCD Logo and Splash screen support */
-#define CONFIG_LCD
 #ifdef CONFIG_LCD
 #define CONFIG_SPLASH_SCREEN
 #define CONFIG_SPLASH_SCREEN_ALIGN
+#ifndef CONFIG_SOC_MX6UL
 #define CONFIG_VIDEO_IPUV3
-#define CONFIG_IPUV3_CLK               266000000
+#define CONFIG_IPUV3_CLK               (CONFIG_SYS_SDRAM_CLK * 1000000 / 2)
+#else
+#define CONFIG_VIDEO_MXS
+#define MXS_LCDIF_BASE                 0x021c8000UL
+#endif /* CONFIG_SOC_MX6UL */
 #define CONFIG_LCD_LOGO
-#define LCD_BPP                                LCD_COLOR24
+#define LCD_BPP                                LCD_COLOR32
 #define CONFIG_CMD_BMP
+#define CONFIG_BMP_8BPP
+#define CONFIG_BMP_16BPP
+#define CONFIG_BMP_24BPP
+#define CONFIG_BMP_32BPP
 #define CONFIG_VIDEO_BMP_RLE8
 #endif /* CONFIG_LCD */
-#endif /* CONFIG_MFG */
 
 /*
  * Memory configuration options
  */
-#define CONFIG_NR_DRAM_BANKS           1               /* # of SDRAM banks */
+#define CONFIG_NR_DRAM_BANKS           0x1             /* # of SDRAM banks */
+#ifndef CONFIG_SOC_MX6UL
 #define PHYS_SDRAM_1                   0x10000000      /* Base address of bank 1 */
-#ifdef CONFIG_SYS_SDRAM_BUS_WIDTH
-#define PHYS_SDRAM_1_WIDTH             CONFIG_SYS_SDRAM_BUS_WIDTH
+#define CONFIG_SYS_MPU_CLK             792
 #else
-#define PHYS_SDRAM_1_WIDTH             64
+#define PHYS_SDRAM_1                   0x80000000      /* Base address of bank 1 */
+#define CONFIG_SYS_MPU_CLK             528
+#endif
+#ifndef CONFIG_SYS_SDRAM_BUS_WIDTH
+#if defined(CONFIG_SYS_SDRAM_BUS_WIDTH_32)
+#define CONFIG_SYS_SDRAM_BUS_WIDTH     32
+#elif defined(CONFIG_SYS_SDRAM_BUS_WIDTH_16)
+#define CONFIG_SYS_SDRAM_BUS_WIDTH     16
+#else
+#define CONFIG_SYS_SDRAM_BUS_WIDTH     64
+#endif
+#endif /* CONFIG_SYS_SDRAM_BUS_WIDTH */
+#ifdef __ASSEMBLY__
+#define _AC(x,s)                       x
+#else
+#define _AC(x,s)                       (x##s)
+#endif
+#define UL(x)                          _AC(x,UL)
+#define PHYS_SDRAM_1_SIZE              (UL(CONFIG_SYS_SDRAM_CHIP_SIZE) * SZ_1M \
+                               / 32 * CONFIG_SYS_SDRAM_BUS_WIDTH)
+#if PHYS_SDRAM_1_SIZE > SZ_1G
+#define FDT_HIGH_STR                   "fdt_high=ffffffff\0"
+#else
+#define FDT_HIGH_STR                   ""
 #endif
-#define PHYS_SDRAM_1_SIZE              (SZ_512M * (PHYS_SDRAM_1_WIDTH / 32))
 
-#ifdef CONFIG_MX6Q
+#ifdef CONFIG_SOC_MX6Q
 #define CONFIG_SYS_SDRAM_CLK           528
 #else
 #define CONFIG_SYS_SDRAM_CLK           400
 #endif
 #define CONFIG_STACKSIZE               SZ_128K
+#define CONFIG_SPL_STACK               (IRAM_BASE_ADDR + SZ_16K)
 #define CONFIG_SYS_MALLOC_LEN          SZ_8M
 #define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_1    /* Memtest start address */
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_4M)
  * U-Boot general configurations
  */
 #define CONFIG_SYS_LONGHELP
-#ifdef CONFIG_MX6Q
-#define CONFIG_SYS_PROMPT              "TX6Q U-Boot > "
+#if defined(CONFIG_SOC_MX6Q)
+#elif defined(CONFIG_SOC_MX6DL)
+#elif defined(CONFIG_SOC_MX6S)
+#elif defined(CONFIG_SOC_MX6UL)
 #else
-#define CONFIG_SYS_PROMPT              "TX6DL U-Boot > "
+#error Unsupported i.MX6 processor variant
 #endif
-#define CONFIG_SYS_CBSIZE              2048            /* Console I/O buffer size */
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
-                               sizeof(CONFIG_SYS_PROMPT) + 16) /* Print buffer size */
-#define CONFIG_SYS_MAXARGS             64              /* Max number of command args */
+#define CONFIG_SYS_CBSIZE              2048    /* Console I/O buffer size */
+#define CONFIG_SYS_PBSIZE                                              \
+       (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+                                               /* Print buffer size */
+#define CONFIG_SYS_MAXARGS             256     /* Max number of command args */
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
-                                       /* Boot argument buffer size */
-#define CONFIG_VERSION_VARIABLE                /* U-BOOT version */
-#define CONFIG_AUTO_COMPLETE           /* Command auto complete */
-#define CONFIG_CMDLINE_EDITING         /* Command history etc */
+                                               /* Boot argument buffer size */
+#define CONFIG_VERSION_VARIABLE                        /* U-BOOT version */
+#define CONFIG_AUTO_COMPLETE                   /* Command auto complete */
+#define CONFIG_CMDLINE_EDITING                 /* Command history etc */
 
 #define CONFIG_SYS_64BIT_VSPRINTF
-#define CONFIG_SYS_NO_FLASH
-
-/*
- * Flattened Device Tree (FDT) support
-*/
-#ifndef CONFIG_MFG
-#define CONFIG_OF_LIBFDT
-#ifdef CONFIG_OF_LIBFDT
-#define CONFIG_FDT_FIXUP_PARTITIONS
-#define CONFIG_OF_BOARD_SETUP
-#ifdef CONFIG_MX6Q
-#define CONFIG_DEFAULT_DEVICE_TREE     tx6q
-#define CONFIG_ARCH_DEVICE_TREE                mx6q
-#else
-#define CONFIG_DEFAULT_DEVICE_TREE     tx6dl
-#define CONFIG_ARCH_DEVICE_TREE                mx6dl
-#endif
-#define CONFIG_SYS_FDT_ADDR            (PHYS_SDRAM_1 + SZ_16M)
-#endif /* CONFIG_OF_LIBFDT */
-#endif /* CONFIG_MFG */
 
 /*
  * Boot Linux
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_SERIAL_TAG
-#ifndef CONFIG_MFG
+#ifndef CONFIG_TX6_UBOOT_MFG
 #define CONFIG_BOOTDELAY               1
 #else
 #define CONFIG_BOOTDELAY               0
 #endif
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 #define CONFIG_SYS_AUTOLOAD            "no"
-#ifndef CONFIG_MFG
+#define DEFAULT_BOOTCMD                        "run bootcmd_${boot_mode} bootm_cmd"
 #define CONFIG_BOOTFILE                        "uImage"
-#define CONFIG_BOOTARGS                        "console=ttymxc0,115200 ro debug panic=1"
-#define CONFIG_BOOTCOMMAND             "run bootcmd_nand"
+#define CONFIG_BOOTARGS                        "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
+#ifndef CONFIG_TX6_UBOOT_MFG
+#define CONFIG_BOOTCOMMAND             DEFAULT_BOOTCMD
+#else
+#define CONFIG_BOOTCOMMAND             "setenv bootcmd '" DEFAULT_BOOTCMD "';" \
+       "env import " xstr(CONFIG_BOOTCMD_MFG_LOADADDR) ";run bootcmd_mfg"
+#if (defined(CONFIG_SOC_MX6SX) || defined(CONFIG_SOC_MX6SL) || defined(CONFIG_SOC_MX6UL))
+#define CONFIG_BOOTCMD_MFG_LOADADDR    80500000
 #else
-#define CONFIG_BOOTCOMMAND             "env import " xstr(CONFIG_BOOTCMD_MFG_LOADADDR) ";run bootcmd_mfg"
 #define CONFIG_BOOTCMD_MFG_LOADADDR    10500000
+#endif
 #define CONFIG_DELAY_ENVIRONMENT
-#endif /* CONFIG_MFG */
+#endif /* CONFIG_TX6_UBOOT_MFG */
+#if (defined(CONFIG_SOC_MX6SX) || defined(CONFIG_SOC_MX6SL) || defined(CONFIG_SOC_MX6UL))
+#define CONFIG_LOADADDR                        82000000
+#define CONFIG_FDTADDR                 81000000
+#else
 #define CONFIG_LOADADDR                        18000000
+#define CONFIG_FDTADDR                 11000000
+#endif
 #define CONFIG_SYS_LOAD_ADDR           _pfx(0x, CONFIG_LOADADDR)
-#define CONFIG_IMX_WATCHDOG
-#define CONFIG_WATCHDOG_TIMEOUT_MSECS  3000
+#define CONFIG_SYS_FDT_ADDR            _pfx(0x, CONFIG_FDTADDR)
+#ifndef CONFIG_SYS_LVDS_IF
+#define DEFAULT_VIDEO_MODE             "VGA"
+#else
+#define DEFAULT_VIDEO_MODE             "HSD100PXN1"
+#endif
 
 /*
- * Extra Environments
+ * Extra Environment Settings
  */
-#ifndef CONFIG_MFG
-#ifdef CONFIG_ENV_IS_NOWHERE
+#ifdef CONFIG_TX6_UBOOT_NOENV
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        "autostart=no\0"                                                \
        "autoload=no\0"                                                 \
+       "baseboard=stk5-v3\0"                                           \
        "bootdelay=-1\0"                                                \
-       "fdtaddr=11000000\0"                                            \
+       "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
        "mtdids=" MTDIDS_DEFAULT "\0"                                   \
        "mtdparts=" MTDPARTS_DEFAULT "\0"
 #else
+#define CONFIG_SYS_CPU_CLK_STR         xstr(CONFIG_SYS_MPU_CLK)
+
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        "autostart=no\0"                                                \
        "baseboard=stk5-v3\0"                                           \
-       "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
-       " root=/dev/mmcblk0p3 rootwait\0"                               \
-       "bootargs_nand=run default_bootargs;set bootargs ${bootargs}"   \
+       "bootargs_jffs2=run default_bootargs"                           \
+       ";setenv bootargs ${bootargs}"                                  \
        " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
-       "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
-       " root=/dev/nfs ip=dhcp nfsroot=${nfs_server}:${nfsroot},nolock\0"\
-       "bootcmd_mmc=set autostart no;run bootargs_mmc;"                \
-       "fatload mmc 0 ${loadaddr} uImage;run bootm_cmd\0"              \
-       "bootcmd_nand=set autostart no;run bootargs_nand;"              \
-       "nboot linux;run bootm_cmd\0"                                   \
-       "bootcmd_net=set autostart no;run bootargs_nfs;dhcp;"           \
-       "run bootm_cmd\0"                                               \
+       "bootargs_mmc=run default_bootargs;setenv bootargs ${bootargs}" \
+       MMC_ROOT_STR                                                    \
+       "bootargs_nfs=run default_bootargs;setenv bootargs ${bootargs}" \
+       " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
+       " ip=dhcp\0"                                                    \
+       "bootargs_ubifs=run default_bootargs"                           \
+       ";setenv bootargs ${bootargs}"                                  \
+       " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
+       "bootcmd_jffs2=setenv autostart no;run bootargs_jffs2"          \
+       ";nboot linux\0"                                                \
+       "bootcmd_mmc=setenv autostart no;run bootargs_mmc"              \
+       ";fatload mmc 0 ${loadaddr} uImage\0"                           \
+       CONFIG_SYS_BOOT_CMD_NAND                                        \
+       "bootcmd_net=setenv autoload y;setenv autostart n"              \
+       ";run bootargs_nfs"                                             \
+       ";dhcp\0"                                                       \
        "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
-       "cpu_clk=800\0"                                                 \
-       "bootdelay=-1\0"                                                \
-       "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
-       " video=${video_mode} ${append_bootargs}\0"                     \
-       "fdtaddr=11000000\0"                                            \
+       "boot_mode=" CONFIG_SYS_DEFAULT_BOOT_MODE "\0"                  \
+       "cpu_clk=" CONFIG_SYS_CPU_CLK_STR "\0"                          \
+       "default_bootargs=setenv bootargs " CONFIG_BOOTARGS             \
+       " ${append_bootargs}\0"                                         \
+       EMMC_BOOT_PART_STR                                              \
+       EMMC_BOOT_ACK_STR                                               \
+       "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
+       FDT_HIGH_STR                                                    \
+       FDTSAVE_CMD_STR                                                 \
        "mtdids=" MTDIDS_DEFAULT "\0"                                   \
        "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
        "nfsroot=/tftpboot/rootfs\0"                                    \
        "otg_mode=device\0"                                             \
+       ROOTPART_UUID_STR                                               \
        "touchpanel=tsc2007\0"                                          \
-       "video_mode=VGA\0"
+       "video_mode=" DEFAULT_VIDEO_MODE "\0"
 #endif /*  CONFIG_ENV_IS_NOWHERE */
-#endif /*  CONFIG_MFG */
 
+#ifdef CONFIG_TX6_NAND
+#define CONFIG_SYS_DEFAULT_BOOT_MODE   "nand"
+#define CONFIG_SYS_BOOT_CMD_NAND                                       \
+       "bootcmd_nand=setenv autostart no;run bootargs_ubifs;nboot linux\0"
+#define FDTSAVE_CMD_STR                                                        \
+       "fdtsave=fdt resize;nand erase.part dtb"                        \
+       ";nand write ${fdtaddr} dtb ${fdtsize}\0"
 #define MTD_NAME                       "gpmi-nand"
 #define MTDIDS_DEFAULT                 "nand0=" MTD_NAME
 #define CONFIG_SYS_NAND_ONFI_DETECTION
-
-/*
- * U-Boot Commands
- */
-#include <config_cmd_default.h>
-#define CONFIG_CMD_CACHE
-#define CONFIG_CMD_MMC
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_MTDPARTS
-#define CONFIG_CMD_BOOTCE
-#define CONFIG_CMD_TIME
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_MEMTEST
+#define MMC_ROOT_STR " root=/dev/mmcblk0p2 rootwait\0"
+#define ROOTPART_UUID_STR              ""
+#define EMMC_BOOT_ACK_STR              ""
+#define EMMC_BOOT_PART_STR             ""
+#else
+#define CONFIG_SYS_DEFAULT_BOOT_MODE   "mmc"
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
+#define CONFIG_SYS_BOOT_CMD_NAND       ""
+#define FDTSAVE_CMD_STR                                                        \
+       "fdtsave=mmc partconf 0 ${emmc_boot_ack} ${emmc_boot_part} ${emmc_boot_part}" \
+       ";mmc write ${fdtaddr} " xstr(CONFIG_SYS_DTB_BLKNO) " 80"       \
+       ";mmc partconf 0 ${emmc_boot_ack} ${emmc_boot_part} 0\0"
+#define MTD_NAME                       ""
+#define MTDIDS_DEFAULT                 ""
+#define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
+#define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
+#define EMMC_BOOT_ACK_STR              "emmc_boot_ack=1\0"
+#define EMMC_BOOT_PART_STR             "emmc_boot_part="       \
+       xstr(CONFIG_SYS_MMCSD_FS_BOOT_PARTITION) "\0"
+#endif /* CONFIG_TX6_NAND */
 
 /*
  * Serial Driver
 #define CONFIG_BAUDRATE                        115200          /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, }
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
+#define CONFIG_CONS_INDEX              1
 
 /*
  * GPIO driver
 /*
  * Ethernet Driver
  */
-#define CONFIG_FEC_MXC
 #ifdef CONFIG_FEC_MXC
 /* This is required for the FEC driver to work with cache enabled */
 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
-#define CONFIG_SYS_CACHELINE_SIZE      64
 
-#define IMX_FEC_BASE                   ENET_BASE_ADDR
+#ifndef CONFIG_SOC_MX6UL
 #define CONFIG_FEC_MXC_PHYADDR         0
-#define CONFIG_PHYLIB
-#define CONFIG_PHY_SMSC
-#define CONFIG_MII
+#define IMX_FEC_BASE                   ENET_BASE_ADDR
+#else
+#define FEC_MDIO_BASE_ADDR             ENET_BASE_ADDR
+#endif
 #define CONFIG_FEC_XCV_TYPE            RMII
-#define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_PING
-/* Add for working with "strict" DHCP server */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_DNS
 #endif
 
 /*
  * I2C Configs
  */
-#ifdef CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C                        1
-#define CONFIG_I2C_MXC                 1
+#ifdef CONFIG_HARD_I2C
 #define CONFIG_SYS_I2C_BASE            I2C1_BASE_ADDR
-#define CONFIG_SYS_I2C_MX6_PORT1
 #define CONFIG_SYS_I2C_SPEED           400000
-#define CONFIG_SYS_I2C_SLAVE           0x3c
-#define CONFIG_MX6_INTER_LDO_BYPASS    0
+#endif /* CONFIG_HARD_I2C */
+#if defined(CONFIG_TX6_REV)
+#if CONFIG_TX6_REV == 0x1
+#define CONFIG_LTC3676
+#elif CONFIG_TX6_REV == 0x2
+#define CONFIG_RN5T618
+#elif CONFIG_TX6_REV == 0x3
+#define CONFIG_RN5T567
+#else
+#error Unsupported TX6 module revision
 #endif
+#else /* CONFIG_TX6_REV */
+#ifdef CONFIG_SOC_MX6UL
+#ifdef CONFIG_SYS_I2C_SOFT
+/* NOENV U-Boot is used for initial bootstrap.
+ * Since the TAMPER_PIN_DISABLE fuses have to be programmed
+ * to be able to use the TAMPER pins as GPIO to access the
+ * PMIC I2C bus, this is not possible on virgin hardware.
+ */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SPEED           CONFIG_SYS_I2C_SOFT_SPEED
+#define CONFIG_SOFT_I2C_GPIO_SCL       IMX_GPIO_NR(5, 0)
+#define CONFIG_SOFT_I2C_GPIO_SDA       IMX_GPIO_NR(5, 1)
+#define CONFIG_SOFT_I2C_READ_REPEATED_START
+#endif /* CONFIG_SYS_I2C_SOFT */
+#else /* !CONFIG_SOC_MX6UL */
+/* autodetect which PMIC is present to derive TX6_REV */
+#define CONFIG_LTC3676                 /* TX6_REV == 1 */
+#endif /*  CONFIG_SOC_MX6UL */
+#define CONFIG_RN5T567                 /* TX6_REV == 3 */
+#endif /* CONFIG_TX6_REV */
 
-#ifndef CONFIG_ENV_IS_NOWHERE
-/* define one of the following options:
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_IS_IN_MMC
-*/
-#define CONFIG_ENV_IS_IN_NAND
-#endif
 #define CONFIG_ENV_OVERWRITE
 
 /*
  * NAND flash driver
  */
-#ifdef CONFIG_CMD_NAND
-#define CONFIG_MTD_DEVICE
-#if 0
-#define CONFIG_MTD_DEBUG
-#define CONFIG_MTD_DEBUG_VERBOSE       4
-#endif
-#define CONFIG_NAND_MXS
-#define CONFIG_NAND_MXS_NO_BBM_SWAP
-#define CONFIG_APBH_DMA
-#define CONFIG_APBH_DMA_BURST
-#define CONFIG_APBH_DMA_BURST8
-#define CONFIG_CMD_NAND_TRIMFFS
+#ifdef CONFIG_TX6_NAND
 #define CONFIG_SYS_MXS_DMA_CHANNEL     4
-#define CONFIG_SYS_MAX_FLASH_BANKS     1
-#define CONFIG_SYS_NAND_MAX_CHIPS      1
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_SYS_NAND_5_ADDR_CYCLE
-#define CONFIG_SYS_NAND_USE_FLASH_BBT
+#define CONFIG_SYS_MAX_FLASH_BANKS     0x1
+#define CONFIG_SYS_NAND_MAX_CHIPS      0x1
+#define CONFIG_SYS_MAX_NAND_DEVICE     0x1
 #define CONFIG_SYS_NAND_BASE           0x00000000
-#define CONFIG_CMD_ROMUPDATE
-#else
-#undef CONFIG_ENV_IS_IN_NAND
-#endif /* CONFIG_CMD_NAND */
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
 
 #define CONFIG_ENV_OFFSET              (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
 #define CONFIG_ENV_SIZE                        SZ_128K
 #define CONFIG_ENV_RANGE               (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
+#endif /* CONFIG_TX6_NAND */
+
 #ifdef CONFIG_ENV_OFFSET_REDUND
 #define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_SYS_ENV_PART_SIZE)  \
        "(env),"                                                        \
 /*
  * MMC Driver
  */
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_MMC
-#define CONFIG_GENERIC_MMC
-#define CONFIG_FSL_ESDHC
-#define CONFIG_FSL_USDHC
+#ifdef CONFIG_FSL_ESDHC
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
-#define CONFIG_SYS_FSL_ESDHC_NUM       2
-
-#define CONFIG_DOS_PARTITION
+#endif
+#ifdef CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
 #define CONFIG_CMD_EXT2
 
 /*
  */
 #ifdef CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#undef CONFIG_ENV_OFFSET
-#undef CONFIG_ENV_SIZE
-/* Associated with the MMC layout defined in mmcops.c */
-#define CONFIG_ENV_OFFSET              SZ_1K
-#define CONFIG_ENV_SIZE                        (SZ_128K - CONFIG_ENV_OFFSET)
+#define CONFIG_SYS_MMC_ENV_PART                0x1
 #define CONFIG_DYNAMIC_MMC_DEVNO
 #endif /* CONFIG_ENV_IS_IN_MMC */
-#else
-#undef CONFIG_ENV_IS_IN_MMC
 #endif /* CONFIG_CMD_MMC */
 
-#ifdef CONFIG_ENV_IS_NOWHERE
-#undef CONFIG_ENV_SIZE
-#define CONFIG_ENV_SIZE                        SZ_4K
-#endif
-
+#ifdef CONFIG_TX6_NAND
 #define MTDPARTS_DEFAULT               "mtdparts=" MTD_NAME ":"        \
        xstr(CONFIG_SYS_U_BOOT_PART_SIZE)                               \
        "@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS)                           \
        "(u-boot),"                                                     \
        CONFIG_SYS_ENV_PART_STR                                         \
-       "4m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR ","         \
+       "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR ","         \
        xstr(CONFIG_SYS_DTB_PART_SIZE)                                  \
-       "(dtb),"                                                        \
+       "@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb),"                   \
        xstr(CONFIG_SYS_NAND_BBT_SIZE)                                  \
        "@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
+#else
+#define MTDPARTS_DEFAULT               ""
+#endif
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \