瀏覽代碼

fdt: fdt addr w/o any args reports back the current working address

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Kumar Gala 16 年之前
父節點
當前提交
7dbc38ad91
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      common/cmd_fdt.c

+ 8 - 0
common/cmd_fdt.c

@@ -67,6 +67,14 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		/*
 		 * Set the address [and length] of the fdt.
 		 */
+		if (argc == 2) {
+			if (!fdt_valid()) {
+				return 1;
+			}
+			printf("The address of the fdt is %p\n", working_fdt);
+			return 0;
+		}
+
 		working_fdt = (struct fdt_header *)simple_strtoul(argv[2], NULL, 16);
 
 		if (!fdt_valid()) {