Merge tag 'pull-24apr19' of git://git.denx.de/u-boot-dm
authorTom Rini <trini@konsulko.com>
Wed, 24 Apr 2019 16:27:29 +0000 (12:27 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 24 Apr 2019 16:27:29 +0000 (12:27 -0400)
Various minor sandbox iumprovements
Fixes for tracing with sandbox
Refactoring for boot_get_fdt()

1  2 
cmd/Kconfig
common/image-fdt.c
include/pci.h

diff --combined cmd/Kconfig
index 5d1999ee0b5fd20de08170eded239f6589f879f1,8744cec5c0fd5282e2bb4894bb66e7631ecb9f27..67d23ca00c570b8e51f526a3a977b877382a01aa
@@@ -53,6 -53,17 +53,17 @@@ config SYS_PROMP
          This string is displayed in the command line to the left of the
          cursor.
  
+ config SYS_XTRACE
+       string "Command execution tracer"
+       depends on CMDLINE
+       default y if CMDLINE
+       help
+         This option enables the possiblity to print all commands before
+         executing them and after all variables are evaluated (similar
+         to Bash's xtrace/'set -x' feature).
+         To enable the tracer a variable "xtrace" needs to be defined in
+         the environment.
  menu "Autoboot options"
  
  config AUTOBOOT
@@@ -1433,12 -1444,6 +1444,12 @@@ config CMD_EFIDEBU
          particularly for managing boot parameters as  well as examining
          various EFI status for debugging.
  
 +config CMD_EXCEPTION
 +      bool "exception - raise exception"
 +      depends on ARM || RISCV || X86
 +      help
 +        Enable the 'exception' command which allows to raise an exception.
 +
  config CMD_LED
        bool "led"
        depends on LED
@@@ -1900,7 -1905,7 +1911,7 @@@ config CMD_TRAC
          Enables a command to control using of function tracing within
          U-Boot. This allows recording of call traces including timing
          information. The command can write data to memory for exporting
-         for analsys (e.g. using bootchart). See doc/README.trace for full
+         for analysis (e.g. using bootchart). See doc/README.trace for full
          details.
  
  config CMD_AVB
diff --combined common/image-fdt.c
index 9ed00b7d5bfb9e47db3dbafbf5d1989b32c15bf6,3aa5ffff0f69e49799c126fd7785ea25590c27cc..eb552ca207ca03904068e6172f78931d9de42dc3
@@@ -279,12 -279,11 +279,11 @@@ int boot_get_fdt(int flag, int argc, ch
        int             fdt_noffset;
  #endif
        const char *select = NULL;
-       int             ok_no_fdt = 0;
  
        *of_flat_tree = NULL;
        *of_size = 0;
  
 -      img_addr = simple_strtoul(argv[0], NULL, 16);
 +      img_addr = (argc == 0) ? load_addr : simple_strtoul(argv[0], NULL, 16);
        buf = map_sysmem(img_addr, 0);
  
        if (argc > 2)
                struct andr_img_hdr *hdr = buf;
                ulong fdt_data, fdt_len;
  
-               if (android_image_get_second(hdr, &fdt_data, &fdt_len) != 0)
-                       goto no_fdt;
+               if (!android_image_get_second(hdr, &fdt_data, &fdt_len) &&
+                   !fdt_check_header((char *)fdt_data)) {
+                       fdt_blob = (char *)fdt_data;
+                       if (fdt_totalsize(fdt_blob) != fdt_len)
+                               goto error;
  
-               fdt_blob = (char *)fdt_data;
-               if (fdt_check_header(fdt_blob) != 0)
-                       goto no_fdt;
+                       debug("## Using FDT in Android image second area\n");
+               } else {
+                       fdt_addr = env_get_hex("fdtaddr", 0);
+                       if (!fdt_addr)
+                               goto no_fdt;
  
-               if (fdt_totalsize(fdt_blob) != fdt_len)
-                       goto error;
+                       fdt_blob = map_sysmem(fdt_addr, 0);
+                       if (fdt_check_header(fdt_blob))
+                               goto no_fdt;
  
-               debug("## Using FDT found in Android image second area\n");
+                       debug("## Using FDT at ${fdtaddr}=Ox%lx\n", fdt_addr);
+               }
  #endif
        } else {
                debug("## No Flattened Device Tree\n");
        return 0;
  
  no_fdt:
-       ok_no_fdt = 1;
+       debug("Continuing to boot without FDT\n");
+       return 0;
  error:
-       *of_flat_tree = NULL;
-       *of_size = 0;
-       if (!select && ok_no_fdt) {
-               debug("Continuing to boot without FDT\n");
-               return 0;
-       }
        return 1;
  }
  
diff --combined include/pci.h
index 9668503f0930ba5618dfd128a12d0dabcccdc502,508f7bca81c00f8625e91c9c4fe02cb1c7754cd3..066238a9c3c686bfd7d8f7b984ea17a47cb7b0b2
  #define  PCI_MSI_FLAGS_QSIZE  0x70    /* Message queue size configured */
  #define  PCI_MSI_FLAGS_QMASK  0x0e    /* Maximum queue size available */
  #define  PCI_MSI_FLAGS_ENABLE 0x01    /* MSI feature enabled */
+ #define  PCI_MSI_FLAGS_MASKBIT        0x0100  /* Per-vector masking capable */
  #define PCI_MSI_RFU           3       /* Rest of capability flags */
  #define PCI_MSI_ADDRESS_LO    4       /* Lower 32 bits */
  #define PCI_MSI_ADDRESS_HI    8       /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
@@@ -545,11 -546,7 +546,11 @@@ extern void pci_cfgfunc_do_nothing(stru
  extern void pci_cfgfunc_config_device(struct pci_controller* hose, pci_dev_t dev,
                                      struct pci_config_table *);
  
 -#define MAX_PCI_REGIONS               7
 +#ifdef CONFIG_NR_DRAM_BANKS
 +#define MAX_PCI_REGIONS (CONFIG_NR_DRAM_BANKS + 7)
 +#else
 +#define MAX_PCI_REGIONS 7
 +#endif
  
  #define INDIRECT_TYPE_NO_PCIE_LINK    1