diff --git a/cmd/dtimg.c b/cmd/dtimg.c
index 5348a4ad46e8..10e909ce551b 100644
--- a/cmd/dtimg.c
+++ b/cmd/dtimg.c
@@ -7,6 +7,7 @@
 #include <env.h>
 #include <image-android-dt.h>
 #include <common.h>
+#include <linux/ctype.h>
 
 enum cmd_dtimg_info {
 	CMD_DTIMG_START = 0,
@@ -48,6 +49,61 @@ static int do_dtimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
 	return CMD_RET_SUCCESS;
 }
 
+static int dtimg_get_opthex(int *argcp, char * const *argvp[], u32 *valp)
+{
+	char *endp;
+	u32 val;
+
+	if (!argcp || !argvp || !valp)
+		return CMD_RET_FAILURE;
+
+	if (*argcp < 2) {
+		printf("Error: Option '%s' expects an argument\n", (*argvp)[0]);
+		return CMD_RET_FAILURE;
+	}
+
+	val = simple_strtoul((*argvp)[1], &endp, 16);
+	if (*endp != '\0') {
+		printf("Error: Bad value '%s=%s'\n", (*argvp)[0], (*argvp)[1]);
+		return CMD_RET_FAILURE;
+	}
+
+	*valp = val;
+	(*argcp)--;
+	(*argvp)++;
+
+	return CMD_RET_SUCCESS;
+}
+
+static int dtimg_get_opt(int argc, char * const argv[],
+			 struct dt_table_entry *ep, char **envstrp)
+{
+	if (!ep || argc < 0 || !argv || !envstrp)
+		return CMD_RET_FAILURE;
+
+	for (; argc > 0; argc--, argv++) {
+		int ret;
+
+		if (!strcmp(argv[0], "--id")) {
+			ret = dtimg_get_opthex(&argc, &argv, &ep->id);
+			if (ret != CMD_RET_SUCCESS)
+				return ret;
+		} else if (!strcmp(argv[0], "--rev")) {
+			ret = dtimg_get_opthex(&argc, &argv, &ep->rev);
+			if (ret != CMD_RET_SUCCESS)
+				return ret;
+		} else if (argc == 1 && argv[0][0] != '-' &&
+			   !isdigit(argv[0][0])) {
+			*envstrp = argv[0];
+		} else {
+			printf("Error: Option '%s' not supported\n", argv[0]);
+			return CMD_RET_FAILURE;
+		}
+	}
+
+	return CMD_RET_SUCCESS;
+}
+
 static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 {
 	ulong hdr_addr;
@@ -55,6 +111,8 @@ static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 	char *endp;
 	ulong fdt_addr;
 	u32 fdt_size;
+	struct dt_table_entry entry = { 0 };
+	char *envstr = NULL;
 	ulong envval;
 	int ret;
 
@@ -70,7 +128,18 @@ static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 		return CMD_RET_FAILURE;
 	}
 
-	if (!android_dt_get_fdt_by_index(hdr_addr, index, &fdt_addr, &fdt_size))
+	/*
+	 * Consume all processed mandatory arguments.
+	 * Prepare for parsing the optional ones.
+	 */
+	argc -= 3;
+	argv += 3;
+
+	ret = dtimg_get_opt(argc, argv, &entry, &envstr);
+	if (ret != CMD_RET_SUCCESS)
+		return ret;
+
+	if (!android_dt_get_fdt(hdr_addr, index, &entry, &fdt_addr, &fdt_size))
 		return CMD_RET_FAILURE;
 
 	switch (cmd) {
@@ -85,11 +154,11 @@ static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 		return CMD_RET_FAILURE;
 	}
 
-	if (argv[3]) {
-		ret = env_set_hex(argv[3], envval);
+	if (envstr) {
+		ret = env_set_hex(envstr, envval);
 		if (ret)
 			printf("Error(%d) env-setting '%s=0x%lx'\n",
-			       ret, argv[3], envval);
+			       ret, envstr, envval);
 	} else {
 		printf("0x%lx\n", envval);
 	}
@@ -111,8 +180,8 @@ static int do_dtimg_size(cmd_tbl_t *cmdtp, int flag, int argc,
 
 static cmd_tbl_t cmd_dtimg_sub[] = {
 	U_BOOT_CMD_MKENT(dump, 2, 0, do_dtimg_dump, "", ""),
-	U_BOOT_CMD_MKENT(start, 4, 0, do_dtimg_start, "", ""),
-	U_BOOT_CMD_MKENT(size, 4, 0, do_dtimg_size, "", ""),
+	U_BOOT_CMD_MKENT(start, 8, 0, do_dtimg_start, "", ""),
+	U_BOOT_CMD_MKENT(size, 8, 0, do_dtimg_size, "", ""),
 };
 
 static int do_dtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
diff --git a/common/image-android-dt.c b/common/image-android-dt.c
index a2d52df4a2a9..91e6b4eca23a 100644
--- a/common/image-android-dt.c
+++ b/common/image-android-dt.c
@@ -5,7 +5,6 @@
  */
 
 #include <image-android-dt.h>
-#include <dt_table.h>
 #include <common.h>
 #include <linux/libfdt.h>
 #include <mapmem.h>
@@ -38,14 +37,15 @@ bool android_dt_check_header(ulong hdr_addr)
  *
  * @return true on success or false on error
  */
-bool android_dt_get_fdt_by_index(ulong hdr_addr, u32 index, ulong *addr,
-				 u32 *size)
+bool android_dt_get_fdt(ulong hdr_addr, u32 index,
+			struct dt_table_entry *ep, ulong *addr, u32 *size)
 {
 	const struct dt_table_header *hdr;
 	const struct dt_table_entry *e;
 	u32 entry_count, entries_offset, entry_size;
 	ulong e_addr;
-	u32 dt_offset, dt_size;
+	u32 dt_offset, dt_size, dt_id, dt_rev;
+	int i, cnt;
 
 	hdr = map_sysmem(hdr_addr, sizeof(*hdr));
 	entry_count = fdt32_to_cpu(hdr->dt_entry_count);
@@ -59,6 +59,62 @@ bool android_dt_get_fdt_by_index(ulong hdr_addr, u32 index, ulong *addr,
 		return false;
 	}
 
+	/*
+	 * In case of a NULL dt_table_entry _or_ if both its 'id' and 'rev'
+	 * fields are empty/zero, return the ${index}'th DTB/DTBO entry
+	 */
+	if (!ep || (!ep->id && !ep->rev))
+		goto found;
+
+	/*
+	 * - In case of non-zero value received in both 'id' and 'rev' fields,
+	 *   return the ${cnt}'th DTB/DTBO entry matching both fields
+	 * - In case of non-zero value received in 'id' and zero in 'rev',
+	 *   return the ${cnt}'th DTB/DTBO entry matching the 'id' field only
+	 * - In case of non-zero value received in 'rev' and zero in 'id',
+	 *   return the ${cnt}'th DTB/DTBO entry matching the 'rev' field only
+	 * In any of the above cases: 0 <= ${cnt} <= ${index} < entry_count
+	 */
+	for (i = 0, cnt = -1; i < entry_count; i++) {
+		e_addr = hdr_addr + entries_offset + i * entry_size;
+		e = map_sysmem(e_addr, sizeof(*e));
+		dt_id = fdt32_to_cpu(e->id);
+		dt_rev = fdt32_to_cpu(e->rev);
+		unmap_sysmem(e);
+
+		if (ep->id && ep->rev) {
+			if (ep->id == dt_id && ep->rev == dt_rev) {
+				cnt++;
+				if (cnt == index) {
+					index = i;
+					goto found;
+				}
+			}
+		} else if (ep->id) {
+			if (ep->id == dt_id) {
+				cnt++;
+				if (cnt == index) {
+					index = i;
+					goto found;
+				}
+			}
+		} else if (ep->rev) {
+			if (ep->rev == dt_rev) {
+				cnt++;
+				if (cnt == index) {
+					index = i;
+					goto found;
+				}
+			}
+		}
+	}
+
+	printf("Error: No #%d entry having id=0x%x && rev=0x%x\n",
+	       index, ep->id, ep->rev);
+
+	return false;
+
+found:
 	e_addr = hdr_addr + entries_offset + index * entry_size;
 	e = map_sysmem(e_addr, sizeof(*e));
 	dt_offset = fdt32_to_cpu(e->dt_offset);
diff --git a/include/image-android-dt.h b/include/image-android-dt.h
index 9a3aa8fa30fb..15f6115eedf0 100644
--- a/include/image-android-dt.h
+++ b/include/image-android-dt.h
@@ -8,10 +8,11 @@
 #define IMAGE_ANDROID_DT_H
 
 #include <linux/types.h>
+#include <dt_table.h>
 
 bool android_dt_check_header(ulong hdr_addr);
-bool android_dt_get_fdt_by_index(ulong hdr_addr, u32 index, ulong *addr,
-				 u32 *size);
+bool android_dt_get_fdt(ulong hdr_addr, u32 index,
+			struct dt_table_entry *ep, ulong *addr, u32 *size);
 
 #if !defined(CONFIG_SPL_BUILD)
 void android_dt_print_contents(ulong hdr_addr);
