if (strncmp(argv[1], "ad", 2) == 0) {
unsigned long addr;
int control = 0;
+ int quiet = 0;
struct fdt_header *blob;
/* Set the address [and length] of the fdt */
argc -= 2;
argv += 2;
- if (argc && !strcmp(*argv, "-c")) {
- control = 1;
+ while (argc > 0 && **argv == '-') {
+ char *arg = *argv;
+
+ while (*++arg) {
+ switch (*arg) {
+ case 'c':
+ control = 1;
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ default:
+ return CMD_RET_USAGE;
+ }
+ }
argc--;
argv++;
}
addr = hextoul(argv[0], NULL);
blob = map_sysmem(addr, 0);
- if (!fdt_valid(&blob))
+ if ((quiet && fdt_check_header(blob)) ||
+ (!quiet && !fdt_valid(&blob)))
return 1;
if (control)
gd->fdt_blob = blob;
/* Optional new length */
len = hextoul(argv[1], NULL);
if (len < fdt_totalsize(blob)) {
- printf("New length %d < existing length %d, ignoring\n",
- len, fdt_totalsize(blob));
+ if (!quiet)
+ printf("New length %d < existing length %d, ignoring\n",
+ len, fdt_totalsize(blob));
} else {
/* Open in place with a new length */
err = fdt_open_into(blob, blob, len);
- if (err != 0) {
+ if (!quiet && err != 0) {
printf("libfdt fdt_open_into(): %s\n",
fdt_strerror(err));
}
/********************************************************************/
#ifdef CONFIG_SYS_LONGHELP
static char fdt_help_text[] =
- "addr [-c] <addr> [<length>] - Set the [control] fdt location to <addr>\n"
+ "addr [-cq] <addr> [<length>] - Set the [control] fdt location to <addr>\n"
#ifdef CONFIG_OF_LIBFDT_OVERLAY
"fdt apply <addr> - Apply overlay to the DT\n"
#endif
#ifdef CONFIG_CMD_BOOTEFI_BOOTMGR
#define BOOTENV_EFI_BOOTMGR \
"boot_efi_bootmgr=" \
- "if fdt addr ${fdt_addr_r}; then " \
+ "if fdt addr -q ${fdt_addr_r}; then " \
"bootefi bootmgr ${fdt_addr_r};" \
"else " \
"bootefi bootmgr;" \
"boot_efi_binary=" \
"load ${devtype} ${devnum}:${distro_bootpart} " \
"${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \
- "if fdt addr ${fdt_addr_r}; then " \
+ "if fdt addr -q ${fdt_addr_r}; then " \
"bootefi ${kernel_addr_r} ${fdt_addr_r};" \
"else " \
"bootefi ${kernel_addr_r} ${fdtcontroladdr};" \
"setenv bootp_arch " BOOTENV_EFI_PXE_ARCH ";" \
"if dhcp ${kernel_addr_r}; then " \
"tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};" \
- "if fdt addr ${fdt_addr_r}; then " \
+ "if fdt addr -q ${fdt_addr_r}; then " \
"bootefi ${kernel_addr_r} ${fdt_addr_r}; " \
"else " \
"bootefi ${kernel_addr_r} ${fdtcontroladdr};" \