add support for TX6U-8012 KARO-TX-2014-05-29
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 16 May 2014 10:02:12 +0000 (12:02 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 16 May 2014 10:50:35 +0000 (12:50 +0200)
board/karo/tx6/config.mk
board/karo/tx6/tx6qdl.c
boards.cfg
include/configs/tx6.h

index 35cc156..5dffddc 100644 (file)
@@ -11,12 +11,17 @@ PLATFORM_CPPFLAGS += -Werror
 ifeq ($(CONFIG_TX6_V2),)
 # calculate U_BOOT_IMG_SIZE to be at least 3 eraseblocks larger than the maximum expected image size
 CONFIG_SYS_NAND_BLOCK_SIZE := 131072
+ifeq ($(CONFIG_SYS_NAND_BLOCKS),)
 CONFIG_SYS_NAND_BLOCKS := 1024
+endif
 ifneq ($(CONFIG_SYS_NAND_BLOCK_SIZE),)
 CONFIG_U_BOOT_IMG_SIZE = $(shell echo 'e=$(CONFIG_SYS_NAND_BLOCK_SIZE);s=640*1024;s + (e - s % e) % e + 3*e' | bc)
 CONFIG_SYS_USERFS_SIZE = $(shell expr \( $(CONFIG_SYS_NAND_BLOCKS) - 12 \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE) - $(CONFIG_U_BOOT_IMG_SIZE) - 36 \* 1048576)
 CONFIG_SYS_USERFS_SIZE2 = $(shell expr \( $(CONFIG_SYS_NAND_BLOCKS) - 15 \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE) - $(CONFIG_U_BOOT_IMG_SIZE) - 36 \* 1048576)
+CONFIG_SYS_NAND_BBT_BLOCKS := 4
+CONFIG_SYS_NAND_DTB_BLOCKS := 4
 
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BLOCKS=$(CONFIG_SYS_NAND_BLOCKS)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BLOCK_SIZE=$(CONFIG_SYS_NAND_BLOCK_SIZE)
 PLATFORM_CPPFLAGS += -DCONFIG_U_BOOT_IMG_SIZE=$(CONFIG_U_BOOT_IMG_SIZE)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_U_BOOT_PART_SIZE=$(shell printf "%uk" `expr $(CONFIG_U_BOOT_IMG_SIZE) / 1024`)
@@ -24,9 +29,10 @@ PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_U_BOOT_OFFS=$(shell printf "0x%x" `expr $
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_ENV_PART_SIZE=$(shell printf "%uk" `expr 3 \* $(CONFIG_SYS_NAND_BLOCK_SIZE) / 1024`)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_USERFS_PART_SIZE=$(shell printf "%uk" `expr $(CONFIG_SYS_USERFS_SIZE) / 1024`)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_USERFS_PART_SIZE2=$(shell printf "%uk" `expr $(CONFIG_SYS_USERFS_SIZE) / 1024`)
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_DTB_PART_SIZE=$(shell printf "%uk" `expr $(CONFIG_SYS_NAND_BLOCK_SIZE) \* 4 / 1024`)
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BBT_SIZE=$(shell printf "%uk" `expr 4 \* $(CONFIG_SYS_NAND_BLOCK_SIZE) / 1024`)
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BBT_OFFSET=$(shell printf "0x%x" `expr \( $(CONFIG_SYS_NAND_BLOCKS) - 4 \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE)`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_DTB_PART_SIZE=$(shell printf "%uk" `expr $(CONFIG_SYS_NAND_BLOCK_SIZE) \* $(CONFIG_SYS_NAND_BBT_BLOCKS) / 1024`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_DTB_OFFSET=$(shell printf "0x%x" `expr \( $(CONFIG_SYS_NAND_BLOCKS) - $(CONFIG_SYS_NAND_DTB_BLOCKS) - $(CONFIG_SYS_NAND_BBT_BLOCKS) \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE)`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BBT_SIZE=$(shell printf "%uk" `expr $(CONFIG_SYS_NAND_BBT_BLOCKS) \* $(CONFIG_SYS_NAND_BLOCK_SIZE) / 1024`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BBT_OFFSET=$(shell printf "0x%x" `expr \( $(CONFIG_SYS_NAND_BLOCKS) - $(CONFIG_SYS_NAND_BBT_BLOCKS) \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE)`)
 endif # CONFIG_SYS_NAND_BLOCK_SIZE
 else
 CONFIG_SYS_MMC_BOOT_PART_SIZE = $(shell expr 4096 \* 1024)
index 2596525..af052fa 100644 (file)
@@ -1290,7 +1290,8 @@ int checkboard(void)
        printf("Board: Ka-Ro TX6%c-%d%d1%d\n",
                cpu_variant == MXC_CPU_MX6Q ? 'Q' : 'U',
                cpu_variant == MXC_CPU_MX6Q ? 1 : 8,
-               is_lvds(), 1 - PHYS_SDRAM_1_WIDTH / 64);
+               is_lvds(), 1 - PHYS_SDRAM_1_WIDTH / 64 +
+               2 * (CONFIG_SYS_NAND_BLOCKS / 1024 - 1));
 
        return 0;
 }
index 8de4ca8..cc7ad36 100644 (file)
@@ -290,6 +290,9 @@ tx6u-8010_noenv              arm         armv7       tx6                 karo               m
 tx6u-8011                    arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32
 tx6u-8011_mfg                arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,MFG
 tx6u-8011_noenv              arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,ENV_IS_NOWHERE
+tx6u-8012                    arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_NAND_BLOCKS=2048
+tx6u-8012_mfg                arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_NAND_BLOCKS=2048,MFG
+tx6u-8012_noenv              arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_NAND_BLOCKS=2048,ENV_IS_NOWHERE
 tx6u-8110                    arm         armv7       tx6                 karo          mx6             tx6:MX6DL,SYS_LVDS_IF
 tx6u-8110_mfg                arm         armv7       tx6                 karo          mx6             tx6:MX6DL,MFG,SYS_LVDS_IF
 tx6u-8110_noenv              arm         armv7       tx6                 karo          mx6             tx6:MX6DL,ENV_IS_NOWHERE,SYS_LVDS_IF
index 4ca37e7..9eff81d 100644 (file)
        "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
        " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
        "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
-       " root=PARTUUID=${rootpart_uuid} rootwait\0"                    \
+       MMC_ROOT_STR                                                    \
        "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
        " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
        " ip=dhcp\0"                                                    \
        "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
        "nfsroot=/tftpboot/rootfs\0"                                    \
        "otg_mode=device\0"                                             \
-       "rootpart_uuid=0cc66cc0-02\0"                                   \
+       ROOTPART_UUID_STR                                               \
        "touchpanel=tsc2007\0"                                          \
        "video_mode=VGA\0"
 #endif /*  CONFIG_ENV_IS_NOWHERE */
 #define MTD_NAME                       "gpmi-nand"
 #define MTDIDS_DEFAULT                 "nand0=" MTD_NAME
 #define CONFIG_SYS_NAND_ONFI_DETECTION
+#define MMC_ROOT_STR " root=dev/mmcblk0p2 rootwait\0"
+#define ROOTPART_UUID_STR ""
 #else
 #define CONFIG_SYS_DEFAULT_BOOT_MODE "mmc"
 #define CONFIG_SYS_BOOT_CMD_NAND ""
 #define CONFIG_SYS_FDTSAVE_CMD                                         \
        "fdtsave=mmc open 0 1;mmc write ${fdtaddr} " xstr(CONFIG_SYS_DTB_BLKNO) " 80;mmc close 0 1\0"
+#define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
+#define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
 #define MTD_NAME                       ""
 #define MTDIDS_DEFAULT                 ""
 #define CONFIG_SUPPORT_EMMC_BOOT
        CONFIG_SYS_ENV_PART_STR                                         \
        "4m(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