]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge remote-tracking branch 'remotes/tx6-devel/tx6-devel' into karo-tx-uboot KARO-TX-2014-04-09
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:22:39 +0000 (10:22 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:22:39 +0000 (10:22 +0200)
board/karo/common/mmc.c
board/karo/tx6/flash.c
board/karo/tx6/tx6qdl.c

index 635220e24bf733c9d8a06df47696376a6e3c311a..eb8804384cf0e0a00d490f22cf600958c453a16f 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
-*/
+ */
 
 #include <common.h>
 #include <errno.h>
 #include <libfdt.h>
 #include <fdt_support.h>
-//#include <nand.h>
 #include <mmc.h>
 #include <mxcfb.h>
 #include <linux/list.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void __maybe_unused memdmp(void *addr, size_t len)
-{
-       size_t i;
-
-       for (i = 0; i < len; i+= 16) {
-               size_t j;
-               u32 *wp = addr + i;
-
-               debug("%p: ", addr + i);
-               for (j = 0; j < 4; j++) {
-                       debug(" %08x", wp[j]);
-               }
-               debug("\n");
-       }
-}
-
 #define MAX_SEARCH_PARTITIONS 16
 
 static int find_efi_partition(const char *ifname, int devno, const char *part_str,
@@ -61,8 +44,6 @@ static int find_efi_partition(const char *ifname, int devno, const char *part_st
        int part;
        block_dev_desc_t *dd;
 
-printf("Searching for partition '%s'\n", part_str);
-
        dd = get_dev(ifname, devno);
        if (!dd || dd->type == DEV_TYPE_UNKNOWN) {
                printf("** Bad device %s %d **\n", ifname, devno);
@@ -113,6 +94,7 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        disk_partition_t part_info;
        int devno = CONFIG_MMC_BOOT_DEV;
        uint blk_start, blk_cnt;
+       block_dev_desc_t *mmc_dev;
 
        mmc = find_mmc_device(devno);
        if (!mmc) {
@@ -122,10 +104,6 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
 
        mmc_init(mmc);
 
-//     mmc_boot_part_access(mmc, 1, part_num, part_num);
-#if 1
-       block_dev_desc_t *mmc_dev;
-
        ret = find_efi_partition("mmc", devno, part, &mmc_dev, &part_info);
        if (ret < 0) {
                printf("eMMC partition '%s' not found: %d\n", part, ret);
@@ -136,30 +114,22 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        blk_start = 0;
        blk_cnt = DIV_ROUND_UP(len, part_info.blksz);
 
-       printf("Using mmc%d blksz %lu blks %lu\n", devno,
-               mmc_dev->blksz, mmc_dev->lba);
-#endif
        debug("Found partition '%s': offset=%08x size=%08lx\n",
                part, blk_start, part_info.size);
-       if (part_info.size < blk_cnt) {
-               printf("Warning: partition '%s' smaller than requested size: %u; truncating data to %lu blocks\n",
-                       part, len, part_info.size * mmc->read_bl_len);
+       if (part_info.size < blk_cnt)
                blk_cnt = part_info.size;
-       }
 
        debug("Reading %u blks from MMC partition '%s' offset %u to %p\n",
                blk_cnt, part, blk_start, addr);
        ret = mmc->block_dev.block_read(devno, blk_start, blk_cnt, addr);
        if (ret == 0) {
                printf("Failed to read MMC partition %s\n", part);
+               ret = -EIO;
                goto out;
        }
        debug("Read %u byte from partition '%s' @ offset %08x\n",
                ret * mmc->read_bl_len, part, blk_start);
-       memdmp(addr, 512);
-       ret = 0;
 out:
-//     mmc_boot_part_access(mmc, 1, part_num, 0);
        mmc_switch_part(devno, 0);
-       return ret;
+       return ret < 0 ? ret : 0;
 }
index 098115afc85b01ef476a89c229bddb242ccd6580..a558cd9eea75ba63dc182b1f942d5f6e2c8f8d84 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012,2013 Lothar Waßmann <LW@KARO-electronics.de>
+ * Copyright (C) 2012,2014 Lothar Waßmann <LW@KARO-electronics.de>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 #include <asm/imx-common/regs-gpmi.h>
 #include <asm/imx-common/regs-bch.h>
 
-#if CONFIG_SYS_NAND_U_BOOT_OFFS < 0x20000
-#error CONFIG_SYS_NAND_U_BOOT_OFFS must be >= 128kIB
-#endif
-
 struct mx6_nand_timing {
        u8 data_setup;
        u8 data_hold;
@@ -103,22 +99,6 @@ extern void *_start;
 
 #define BIT(v,n)       (((v) >> (n)) & 0x1)
 
-static inline void memdump(const void *addr, size_t len)
-{
-       const char *buf = addr;
-       int i;
-
-       for (i = 0; i < len; i++) {
-               if (i % 16 == 0) {
-                       if (i > 0)
-                               printf("\n");
-                       printf("%p:", &buf[i]);
-               }
-               printf(" %02x", buf[i]);
-       }
-       printf("\n");
-}
-
 static u8 calculate_parity_13_8(u8 d)
 {
        u8 p = 0;
@@ -188,21 +168,31 @@ static inline int calc_bb_offset(nand_info_t *mtd, struct mx6_fcb *fcb)
        return bb_mark_offset;
 }
 
+/*
+ * return number of blocks to skip for a contiguous partition
+ * of given # blocks
+ */
 static int find_contig_space(int block, int num_blocks, int max_blocks)
 {
-       int start = block;
+       int skip = 0;
        int found = 0;
+       int last = block + max_blocks;
 
-       for (; block < block + max_blocks; block++) {
+       debug("Searching %u contiguous blocks from %d..%d\n",
+               num_blocks, block, block + max_blocks - 1);
+       for (; block < last; block++) {
                if (nand_block_isbad(mtd, block * mtd->erasesize)) {
+                       skip += found + 1;
                        found = 0;
-                       printf("Adjusting start block from %u to %u\n",
-                               start, block + 1);
-                       start = block + 1;
+                       debug("Skipping %u blocks to %u\n",
+                               skip, block + 1);
                } else {
                        found++;
-                       if (found >= num_blocks)
-                               return start;
+                       if (found >= num_blocks) {
+                               debug("Found %u good blocks from %d..%d\n",
+                                       found, block - found + 1, block);
+                               return skip;
+                       }
                }
        }
        return -ENOSPC;
@@ -211,8 +201,7 @@ static int find_contig_space(int block, int num_blocks, int max_blocks)
 #define pr_fcb_val(p, n)       debug("%s=%08x(%d)\n", #n, (p)->n, (p)->n)
 
 static struct mx6_fcb *create_fcb(void *buf, int fw1_start_block,
-                               int fw2_start_block, int fw_num_blocks,
-                               int max_blocks)
+                               int fw2_start_block, int fw_num_blocks)
 {
        struct gpmi_regs *gpmi_base = (void *)GPMI_BASE_ADDRESS;
        struct bch_regs *bch_base = (void *)BCH_BASE_ADDRESS;
@@ -277,7 +266,7 @@ static struct mx6_fcb *create_fcb(void *buf, int fw1_start_block,
 
        if (fw2_start_block != 0 && fw2_start_block < mtd->size / mtd->erasesize) {
                fcb->fw2_start_page = fw2_start_block * fcb->sectors_per_block;
-               fcb->fw2_sectors = fw_num_blocks * fcb->sectors_per_block;
+               fcb->fw2_sectors = fcb->fw1_sectors;
                pr_fcb_val(fcb, fw2_start_page);
                pr_fcb_val(fcb, fw2_sectors);
        }
@@ -315,13 +304,13 @@ static int find_fcb(void *ref, int page)
                printf("Failed to read FCB from page %u: %d\n", page, ret);
                goto out;
        }
-       chip->select_chip(mtd, -1);
        if (memcmp(buf, ref, mtd->writesize) == 0) {
                debug("Found FCB in page %u (%08x)\n",
                        page, page * mtd->writesize);
                ret = 1;
        }
 out:
+       chip->select_chip(mtd, -1);
        free(buf);
        return ret;
 }
@@ -344,8 +333,8 @@ static int write_fcb(void *buf, int block)
                return ret;
        }
 
-       printf("Writing FCB to block %d @ %08x\n", block,
-               block * mtd->erasesize);
+       printf("Writing FCB to block %d @ %08llx\n", block,
+               (u64)block * mtd->erasesize);
        chip->select_chip(mtd, 0);
        ret = chip->write_page(mtd, chip, buf, 1, page, 0, 1);
        if (ret) {
@@ -417,6 +406,43 @@ static int patch_ivt(void *buf, size_t fsize)
        }                                                       \
 } while (0)
 
+static int tx6_prog_uboot(void *addr, int start_block, int skip,
+                       size_t size, size_t max_len)
+{
+       int ret;
+       nand_erase_options_t erase_opts = { 0, };
+       size_t actual;
+
+       erase_opts.offset = start_block * mtd->erasesize;
+       erase_opts.length = max_len;
+       erase_opts.quiet = 1;
+
+       printf("Erasing flash @ %08llx..%08llx\n", erase_opts.offset,
+               erase_opts.offset + erase_opts.length - 1);
+       ret = nand_erase_opts(mtd, &erase_opts);
+       if (ret) {
+               printf("Failed to erase flash: %d\n", ret);
+               return ret;
+       }
+
+       printf("Programming flash @ %08llx..%08llx from %p\n",
+               (u64)start_block * mtd->erasesize,
+               (u64)start_block * mtd->erasesize + size - 1, addr);
+       actual = size;
+       ret = nand_write_skip_bad(mtd, start_block * mtd->erasesize,
+                               &actual, NULL, erase_opts.length, addr,
+                               WITH_DROP_FFS);
+       if (ret) {
+               printf("Failed to program flash: %d\n", ret);
+               return ret;
+       }
+       if (actual < size) {
+               printf("Could only write %u of %u bytes\n", actual, size);
+               return -EIO;
+       }
+       return 0;
+}
+
 #ifdef CONFIG_ENV_IS_IN_NAND
 #ifndef CONFIG_ENV_OFFSET_REDUND
 #define TOTAL_ENV_SIZE CONFIG_ENV_RANGE
@@ -425,9 +451,6 @@ static int patch_ivt(void *buf, size_t fsize)
 #endif
 #endif
 
-#define pr_fcb_offset(n)       printf("%s: %04x (%d)\n", #n, \
-               offsetof(struct mx6_fcb, n), offsetof(struct mx6_fcb, n))
-
 int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
        int ret;
@@ -447,31 +470,28 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                DIV_ROUND_UP(TOTAL_ENV_SIZE, mtd->erasesize) - 1;
 #endif
        int optind;
-       int fw1_set = 0;
        int fw2_set = 0;
        unsigned long fw1_start_block = 0, fw1_end_block;
        unsigned long fw2_start_block = 0, fw2_end_block;
        unsigned long fw_num_blocks;
-       unsigned long extra_blocks = 2;
-       nand_erase_options_t erase_opts = { 0, };
+       int fw1_skip, fw2_skip;
+       unsigned long extra_blocks = 0;
        size_t max_len1, max_len2;
        struct mtd_device *dev;
        struct part_info *part_info;
+       struct part_info *redund_part_info;
+       const char *uboot_part = "u-boot";
+       const char *redund_part = NULL;
        u8 part_num;
-       size_t actual;
+       u8 redund_part_num;
 
        ret = mtdparts_init();
        if (ret)
                return ret;
 
-       ret = find_dev_and_part("u-boot", &dev, &part_num,
-                               &part_info);
-       if (ret) {
-               printf("Failed to find u-boot partition: %d\n", ret);
-               return ret;
-       }
-
        for (optind = 1; optind < argc; optind++) {
+               char *endp;
+
                if (strcmp(argv[optind], "-f") == 0) {
                        if (optind >= argc - 1) {
                                printf("Option %s requires an argument\n",
@@ -479,18 +499,27 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                                return -EINVAL;
                        }
                        optind++;
-                       fw1_start_block = simple_strtoul(argv[optind], NULL, 0);
+                       fw1_start_block = simple_strtoul(argv[optind], &endp, 0);
+                       if (*endp != '\0') {
+                               uboot_part = argv[optind];
+                               continue;
+                       }
+                       uboot_part = NULL;
                        if (fw1_start_block >= mtd_num_blocks) {
                                printf("Block number %lu is out of range: 0..%lu\n",
                                        fw1_start_block, mtd_num_blocks - 1);
                                return -EINVAL;
                        }
-                       fw1_set = 1;
                } else if (strcmp(argv[optind], "-r") == 0) {
+                       fw2_set = 1;
                        if (optind < argc - 1 && argv[optind + 1][0] != '-') {
                                optind++;
                                fw2_start_block = simple_strtoul(argv[optind],
-                                                               NULL, 0);
+                                                               &endp, 0);
+                               if (*endp != '\0') {
+                                       redund_part = argv[optind];
+                                       continue;
+                               }
                                if (fw2_start_block >= mtd_num_blocks) {
                                        printf("Block number %lu is out of range: 0..%lu\n",
                                                fw2_start_block,
@@ -498,7 +527,6 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                                        return -EINVAL;
                                }
                        }
-                       fw2_set = 1;
                } else if (strcmp(argv[optind], "-e") == 0) {
                        if (optind >= argc - 1) {
                                printf("Option %s requires an argument\n",
@@ -552,35 +580,85 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
        if (size > 0) {
                fw_num_blocks = DIV_ROUND_UP(size, mtd->erasesize);
        } else {
-               fw_num_blocks = part_info->size / mtd->erasesize - extra_blocks;
+               fw_num_blocks = part_info->size / mtd->erasesize -
+                       extra_blocks;
                size = fw_num_blocks * mtd->erasesize;
        }
-       if (!fw1_set)
+
+       if (uboot_part) {
+               ret = find_dev_and_part(uboot_part, &dev, &part_num,
+                                       &part_info);
+               if (ret) {
+                       printf("Failed to find '%s' partition: %d\n",
+                               uboot_part, ret);
+                       return ret;
+               }
                fw1_start_block = part_info->offset / mtd->erasesize;
+               max_len1 = part_info->size;
+       } else {
+               max_len1 = (fw_num_blocks + extra_blocks) * mtd->erasesize;
+       }
+
+       if (redund_part) {
+               ret = find_dev_and_part(redund_part, &dev, &redund_part_num,
+                                       &redund_part_info);
+               if (ret) {
+                       printf("Failed to find '%s' partition: %d\n",
+                               redund_part, ret);
+                       return ret;
+               }
+               fw2_start_block = redund_part_info->offset / mtd->erasesize;
+               max_len2 = redund_part_info->size;
+       } else if (fw2_set) {
+               max_len2 = (fw_num_blocks + extra_blocks) * mtd->erasesize;
+       } else {
+               max_len2 = 0;
+       }
 
-       fw1_start_block = find_contig_space(fw1_start_block,
-                                       fw_num_blocks,
-                                       size / mtd->erasesize);
-       if (fw1_start_block < 0) {
+       fw1_skip = find_contig_space(fw1_start_block, fw_num_blocks,
+                               max_len1 / mtd->erasesize);
+       if (fw1_skip < 0) {
                printf("Could not find %lu contiguous good blocks for fw image\n",
                        fw_num_blocks);
+               if (uboot_part) {
+#ifdef CONFIG_ENV_IS_IN_NAND
+                       if (part_info->offset <= CONFIG_ENV_OFFSET + TOTAL_ENV_SIZE) {
+                               printf("Use a different partition\n");
+                       } else {
+                               printf("Increase the size of the '%s' partition\n",
+                                       uboot_part);
+                       }
+#else
+                       printf("Increase the size of the '%s' partition\n",
+                               uboot_part);
+#endif
+               } else {
+                       printf("Increase the number of spare blocks to use with the '-e' option\n");
+               }
                return -ENOSPC;
        }
-       fw1_end_block = fw1_start_block + fw_num_blocks + extra_blocks - 1;
+       fw1_end_block = fw1_start_block + fw1_skip + fw_num_blocks - 1;
 
        if (fw2_set && fw2_start_block == 0)
                fw2_start_block = fw1_end_block + 1;
        if (fw2_start_block > 0) {
-               fw2_start_block = find_contig_space(fw2_start_block,
-                                               fw_num_blocks,
-                                               size / mtd->erasesize);
-               if (fw2_start_block < 0) {
+               fw2_skip = find_contig_space(fw2_start_block, fw_num_blocks,
+                                       max_len2 / mtd->erasesize);
+               if (fw2_skip < 0) {
                        printf("Could not find %lu contiguous good blocks for redundant fw image\n",
                                fw_num_blocks);
+                       if (redund_part) {
+                               printf("Increase the size of the '%s' partition or use a different partition\n",
+                                       redund_part);
+                       } else {
+                               printf("Increase the number of spare blocks to use with the '-e' option\n");
+                       }
                        return -ENOSPC;
                }
+       } else {
+               fw2_skip = 0;
        }
-       fw2_end_block = fw2_start_block + fw_num_blocks + extra_blocks - 1;
+       fw2_end_block = fw2_start_block + fw2_skip + fw_num_blocks - 1;
 
 #ifdef CONFIG_ENV_IS_IN_NAND
        fail_if_overlap(fcb, env, "FCB", "Environment");
@@ -601,8 +679,8 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                return -ENOMEM;
        }
 
-       fcb = create_fcb(buf, fw1_start_block, fw2_start_block, fw_num_blocks,
-                       size / mtd->erasesize);
+       fcb = create_fcb(buf, fw1_start_block + fw1_skip,
+                       fw2_start_block + fw2_skip, fw_num_blocks);
        if (IS_ERR(fcb)) {
                printf("Failed to initialize FCB: %ld\n", PTR_ERR(fcb));
                free(buf);
@@ -621,79 +699,39 @@ int do_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                return ret;
        }
 
-       printf("Programming U-Boot image from %p to block %lu\n",
-               addr, fw1_start_block);
        if (size & (page_size - 1)) {
                memset(addr + size, 0xff, size & (page_size - 1));
                size = ALIGN(size, page_size);
        }
 
-       erase_opts.offset = fcb->fw1_start_page * page_size;
-       erase_opts.length = (fw1_end_block - fw1_start_block + 1) *
-               mtd->erasesize;
-       erase_opts.quiet = 1;
-
-       printf("Erasing flash @ %08llx..%08llx\n", erase_opts.offset,
-               erase_opts.offset + erase_opts.length - 1);
-
-       ret = nand_erase_opts(mtd, &erase_opts);
-       if (ret) {
-               printf("Failed to erase flash: %d\n", ret);
-               return ret;
-       }
-
-       max_len1 = size;
+       printf("Programming U-Boot image from %p to block %lu @ %08llx\n",
+               addr, fw1_start_block + fw1_skip,
+               (u64)(fw1_start_block + fw1_skip) * mtd->erasesize);
+       ret = tx6_prog_uboot(addr, fw1_start_block, fw1_skip, size,
+                       max_len1);
 
-       printf("Programming flash @ %08x..%08x from %p\n",
-               fcb->fw1_start_page * page_size,
-               fcb->fw1_start_page * page_size + max_len1 - 1, addr);
-       ret = nand_write_skip_bad(mtd, fcb->fw1_start_page * page_size,
-                               &max_len1, &actual, erase_opts.length, addr,
-                               WITH_DROP_FFS);
-       if (ret || actual < size) {
-               printf("Failed to program flash: %d\n", ret);
-               return ret ?: -EIO;
-       }
        if (fw2_start_block == 0) {
                return ret;
        }
 
-       printf("Programming redundant U-Boot image to block %lu\n",
-               fw2_start_block);
-       erase_opts.offset = fcb->fw2_start_page * page_size;
-       erase_opts.length = (fw2_end_block - fw2_start_block + 1) *
-               mtd->erasesize;
-       printf("Erasing flash @ %08llx..%08llx\n", erase_opts.offset,
-               erase_opts.offset + erase_opts.length - 1);
-
-       ret = nand_erase_opts(mtd, &erase_opts);
-       if (ret) {
-               printf("Failed to erase flash: %d\n", ret);
-               return ret;
-       }
-
-       max_len2 = size;
-
-       printf("Programming flash @ %08x..%08x from %p\n",
-               fcb->fw2_start_page * page_size,
-               fcb->fw2_start_page * page_size + max_len2 - 1, addr);
-       ret = nand_write_skip_bad(mtd, fcb->fw2_start_page * page_size,
-                               &max_len2, &actual, erase_opts.length, addr,
-                               WITH_DROP_FFS);
-       if (ret || actual < size) {
-               printf("Failed to program flash: %d\n", ret);
-               return ret ?: -EIO;
-       }
+       printf("Programming redundant U-Boot image to block %lu @ %08llx\n",
+               fw2_start_block + fw2_skip,
+               (u64)(fw2_start_block + fw2_skip) * mtd->erasesize);
+       ret = tx6_prog_uboot(addr, fw2_start_block, fw2_skip, fw_num_blocks,
+                       max_len2);
        return ret;
 }
 
 U_BOOT_CMD(romupdate, 11, 0, do_update,
        "Creates an FCB data structure and writes an U-Boot image to flash",
-       "[-f #] [-r [#]] [-e #] [<address>] [<length>]\n"
-       "\t-f #\twrite bootloader image at block #\n"
+       "[-f {<part>|block#}] [-r [{<part>|block#}]] [-e #] [<address>] [<length>]\n"
+       "\t-f <part>\twrite bootloader image to partition <part>\n"
+       "\t-f #\twrite bootloader image at block # (decimal)\n"
        "\t-r\twrite redundant bootloader image at next free block after first image\n"
-       "\t-r #\twrite redundant bootloader image at block #\n"
-       "\t-e #\tspecify number of redundant blocks per boot loader image (default 2)\n"
+       "\t-r <part>\twrite redundant bootloader image to partition <part>\n"
+       "\t-r #\twrite redundant bootloader image at block # (decimal)\n"
+       "\t-e #\tspecify number of redundant blocks per boot loader image\n"
+       "\t\tonly valid if -f or -r specify a flash address rather than a partition name\n"
        "\t<address>\tRAM address of bootloader image (default: ${fileaddr}\n"
        "\t<length>\tlength of bootloader image in RAM (default: ${filesize}"
        );
index 5b95e59736e62cf890849660bddf4316099db1c5..05d359725ac903ace1c25a3ad59cd14aaa1f16ce 100644 (file)
@@ -636,36 +636,6 @@ static const iomux_v3_cfg_t stk5_pads[] = {
        /* SW controlled LED on STK5 baseboard */
        MX6_PAD_EIM_A18__GPIO_2_20,
 
-       /* LCD data pins */
-       MX6_PAD_DISP0_DAT0__IPU1_DISP0_DAT_0,
-       MX6_PAD_DISP0_DAT1__IPU1_DISP0_DAT_1,
-       MX6_PAD_DISP0_DAT2__IPU1_DISP0_DAT_2,
-       MX6_PAD_DISP0_DAT3__IPU1_DISP0_DAT_3,
-       MX6_PAD_DISP0_DAT4__IPU1_DISP0_DAT_4,
-       MX6_PAD_DISP0_DAT5__IPU1_DISP0_DAT_5,
-       MX6_PAD_DISP0_DAT6__IPU1_DISP0_DAT_6,
-       MX6_PAD_DISP0_DAT7__IPU1_DISP0_DAT_7,
-       MX6_PAD_DISP0_DAT8__IPU1_DISP0_DAT_8,
-       MX6_PAD_DISP0_DAT9__IPU1_DISP0_DAT_9,
-       MX6_PAD_DISP0_DAT10__IPU1_DISP0_DAT_10,
-       MX6_PAD_DISP0_DAT11__IPU1_DISP0_DAT_11,
-       MX6_PAD_DISP0_DAT12__IPU1_DISP0_DAT_12,
-       MX6_PAD_DISP0_DAT13__IPU1_DISP0_DAT_13,
-       MX6_PAD_DISP0_DAT14__IPU1_DISP0_DAT_14,
-       MX6_PAD_DISP0_DAT15__IPU1_DISP0_DAT_15,
-       MX6_PAD_DISP0_DAT16__IPU1_DISP0_DAT_16,
-       MX6_PAD_DISP0_DAT17__IPU1_DISP0_DAT_17,
-       MX6_PAD_DISP0_DAT18__IPU1_DISP0_DAT_18,
-       MX6_PAD_DISP0_DAT19__IPU1_DISP0_DAT_19,
-       MX6_PAD_DISP0_DAT20__IPU1_DISP0_DAT_20,
-       MX6_PAD_DISP0_DAT21__IPU1_DISP0_DAT_21,
-       MX6_PAD_DISP0_DAT22__IPU1_DISP0_DAT_22,
-       MX6_PAD_DISP0_DAT23__IPU1_DISP0_DAT_23,
-       MX6_PAD_DI0_PIN2__IPU1_DI0_PIN2, /* HSYNC */
-       MX6_PAD_DI0_PIN3__IPU1_DI0_PIN3, /* VSYNC */
-       MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* OE_ACD */
-       MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, /* LSCLK */
-
        /* I2C bus on DIMM pins 40/41 */
        MX6_PAD_GPIO_6__I2C3_SDA,
        MX6_PAD_GPIO_3__I2C3_SCL,
@@ -934,11 +904,8 @@ static const iomux_v3_cfg_t stk5_lcd_pads[] = {
        /* LCD Backlight (PWM) */
        MX6_PAD_GPIO_1__GPIO_1_1,
 
+#ifndef CONFIG_SYS_LVDS_IF
        /* Display */
-       MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK,
-       MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15,
-       MX6_PAD_DI0_PIN2__IPU1_DI0_PIN2,
-       MX6_PAD_DI0_PIN3__IPU1_DI0_PIN3,
        MX6_PAD_DISP0_DAT0__IPU1_DISP0_DAT_0,
        MX6_PAD_DISP0_DAT1__IPU1_DISP0_DAT_1,
        MX6_PAD_DISP0_DAT2__IPU1_DISP0_DAT_2,
@@ -963,6 +930,11 @@ static const iomux_v3_cfg_t stk5_lcd_pads[] = {
        MX6_PAD_DISP0_DAT21__IPU1_DISP0_DAT_21,
        MX6_PAD_DISP0_DAT22__IPU1_DISP0_DAT_22,
        MX6_PAD_DISP0_DAT23__IPU1_DISP0_DAT_23,
+       MX6_PAD_DI0_PIN2__IPU1_DI0_PIN2, /* HSYNC */
+       MX6_PAD_DI0_PIN3__IPU1_DI0_PIN3, /* VSYNC */
+       MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* OE_ACD */
+       MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, /* LSCLK */
+#endif
 };
 
 static const struct gpio stk5_lcd_gpios[] = {