karo: tx28: add support for TX28-4033 (with 256MiB flash)
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Sep 2014 07:38:27 +0000 (09:38 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Sep 2014 08:21:50 +0000 (10:21 +0200)
board/karo/tx28/config.mk
board/karo/tx28/tx28.c
boards.cfg
include/configs/tx28.h

index a11dc49..c3beb5d 100644 (file)
@@ -8,3 +8,24 @@ PLATFORM_CPPFLAGS += -Werror
 ifneq ($(CONFIG_SPL_BUILD),y)
        ALL-y += $(obj)u-boot.sb
 endif
+
+CONFIG_SYS_NAND_BLOCK_SIZE := 131072
+CONFIG_U_BOOT_PART_SIZE := 1048576
+ifeq ($(CONFIG_SYS_NAND_BLOCKS),)
+CONFIG_SYS_NAND_BLOCKS := 1024
+endif
+CONFIG_SYS_NAND_BBT_BLOCKS := 4
+CONFIG_SYS_NAND_DTB_BLOCKS := 4
+CONFIG_SYS_ENV_BLOCKS := 3
+CONFIG_SYS_LINUX_PART_SIZE := $(shell expr 6 \* 1048576)
+CONFIG_SYS_ROOTFS_PART_SIZE := $(shell expr 32 \* 1048576)
+CONFIG_SYS_SYSTEM_BLOCKS := $(shell expr $(CONFIG_SYS_NAND_BBT_BLOCKS) + $(CONFIG_SYS_NAND_DTB_BLOCKS) + $(CONFIG_SYS_ENV_BLOCKS) + 1)
+CONFIG_SYS_USERFS_SIZE := $(shell expr \( $(CONFIG_SYS_NAND_BLOCKS) - $(CONFIG_SYS_SYSTEM_BLOCKS) \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE) - $(CONFIG_U_BOOT_PART_SIZE) - $(CONFIG_SYS_LINUX_PART_SIZE) - $(CONFIG_SYS_ROOTFS_PART_SIZE))
+CONFIG_SYS_USERFS_SIZE2 := $(shell expr \( $(CONFIG_SYS_NAND_BLOCKS) - $(CONFIG_SYS_SYSTEM_BLOCKS) - $(CONFIG_SYS_ENV_BLOCKS) \) \* $(CONFIG_SYS_NAND_BLOCK_SIZE) - $(CONFIG_U_BOOT_PART_SIZE) - $(CONFIG_SYS_LINUX_PART_SIZE) - $(CONFIG_SYS_ROOTFS_PART_SIZE))
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_SYSTEM_BLOCKS=$(shell printf "%u" `expr $(CONFIG_SYS_SYSTEM_BLOCKS)`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_ENV_PART_SIZE=$(shell printf "%uk" `expr $(CONFIG_SYS_ENV_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)`)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_NAND_BLOCKS=$(CONFIG_SYS_NAND_BLOCKS)
+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_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_SIZE2) / 1024`)
index 5b68dc2..8957b8c 100644 (file)
@@ -894,7 +894,8 @@ int checkboard(void)
        const char *dlm = "";
 
        printf("Board: Ka-Ro TX28-4%sx%d\n", TX28_MOD_SUFFIX,
-               CONFIG_SDRAM_SIZE / SZ_128M);
+               CONFIG_SDRAM_SIZE / SZ_128M +
+               CONFIG_SYS_NAND_BLOCKS / 2048 * 2);
 
        printf("POWERUP Source: ");
        if (pwrup_src & (3 << 0)) {
index cc7ad36..3308a20 100644 (file)
@@ -196,6 +196,7 @@ mx25pdk                      arm         arm926ejs   mx25pdk             freesca
 tx25                         arm         arm926ejs   tx25                karo           mx25
 tx28-40x1                    arm         arm926ejs   tx28                karo           mxs            tx28:TX28,SDRAM_SIZE=SZ_128M
 tx28-40x2                    arm         arm926ejs   tx28                karo           mxs            tx28:TX28,SDRAM_SIZE=SZ_256M
+tx28-40x3                    arm         arm926ejs   tx28                karo           mxs            tx28:TX28,SDRAM_SIZE=SZ_128M,SYS_NAND_BLOCKS=2048
 tx28-41x0                    arm         arm926ejs   tx28                karo           mxs            tx28:TX28_S,SDRAM_SIZE=SZ_64M
 zmx25                        arm         arm926ejs   zmx25               syteco         mx25
 imx27lite                    arm         arm926ejs   imx27lite           logicpd        mx27
index a3d3984..5af01dc 100644 (file)
  * NAND flash driver
  */
 #ifdef CONFIG_CMD_NAND
+#define CONFIG_SYS_NAND_BLOCK_SIZE     SZ_128K
 #define CONFIG_MTD_DEVICE
 #define CONFIG_NAND_MXS
 #define CONFIG_APBH_DMA
 #define CONFIG_APBH_DMA_BURST
 #define CONFIG_APBH_DMA_BURST8
-#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x20000
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    CONFIG_SYS_NAND_BLOCK_SIZE
 #define CONFIG_CMD_NAND_TRIMFFS
 #define CONFIG_SYS_MXS_DMA_CHANNEL     4
 #define CONFIG_SYS_NAND_MAX_CHIPS      1
 
 #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               0x60000
+#define CONFIG_ENV_RANGE               (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
 #ifdef CONFIG_ENV_OFFSET_REDUND
-#define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_ENV_RANGE)          \
+#define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_SYS_ENV_PART_SIZE)  \
        "(env),"                                                        \
-       xstr(CONFIG_ENV_RANGE)                                          \
+       xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
        "(env2),"
-#define CONFIG_SYS_USERFS_PART_STR     "89216k(userfs)"
+#define CONFIG_SYS_USERFS_PART_STR     xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
 #else
-#define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_ENV_RANGE)          \
+#define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_SYS_ENV_PART_SIZE)  \
        "(env),"
-#define CONFIG_SYS_USERFS_PART_STR     "89600k(userfs)"
+#define CONFIG_SYS_USERFS_PART_STR     xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
 #endif /* CONFIG_ENV_OFFSET_REDUND */
 
 /*
 #define MTDPARTS_DEFAULT               "mtdparts=" MTD_NAME ":"        \
        "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
        CONFIG_SYS_ENV_PART_STR                                         \
-       "6m(linux),32m(rootfs),"                                        \
-       CONFIG_SYS_USERFS_PART_STR ",512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
+       "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR             \
+       ",512k@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb)"               \
+       ",512k@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \