Skip to content
Snippets Groups Projects
  1. Apr 11, 2022
    • Tom Rini's avatar
      Merge branch '2022-04-11-initial-valgrind-support' · c45d38d6
      Tom Rini authored
      To quote the author:
      This series adds support for running valgrind against U-Boot's internal
      malloc. This allows for much more useful reports to be generated.
      
      Some example output of valgrind run against u-boot/master with this
      branch applied may be found at [1]. Note that valgrind gives up around
      acpi.  This feature still needs a lot of work on suppressions/hints to
      filter out the noise properly.
      
      [1] https://gist.githubusercontent.com/Forty-Bot/199bf06f9cdd6871e54f8f484c16e111/raw/2a2f99108eef84b48e27a54332f3f71f4e2e5342/gistfile1.txt
      c45d38d6
    • Sean Anderson's avatar
      doc: sandbox: Document how to run sandbox with valgrind · 02fc8678
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      This documents how to get more detailed results from valgrind made possible
      by the last two commits.
      
      Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      02fc8678
    • Sean Anderson's avatar
      malloc: Annotate allocator for valgrind · bdaeea1b
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      This annotates malloc and friends so that valgrind can track the heap. To
      do this, we need to follow a few rules:
      
      * Call VALGRIND_MALLOCLIKE_BLOCK whenever we malloc something
      * Call VALGRIND_FREELIKE_BLOCK whenever we free something (generally after
        we have done our bookkeeping)
      * Call VALGRIND_RESIZEINPLACE_BLOCK whenever we change the size of an
        allocation. We don't record the original request size of a block, and
        neither does valgrind. For this reason, we pretend that the old size of
        the allocation was for 0 bytes. This marks the whole allocaton as
        undefined, so in order to mark all bits correctly, we must make the whole
        new allocation defined with VALGRIND_MAKE_MEM_DEFINED. This may cause us
        to miss some invalid reads, but there is no way to detect these without
        recording the original size of the allocation.
      
      In addition to the above, dlmalloc itself tends to make a lot of accesses
      which we know are safe, but which would be unsafe outside of dlmalloc. For
      this reason, we provide a suppression file which ignores errors ocurring in
      dlmalloc.c
      
      Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      bdaeea1b
    • Sean Anderson's avatar
      Add valgrind headers to U-Boot · fba0882b
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      Valgrind uses magic code sequences to define an ABI that the client may use
      to request behavior from the host. In particular, this may be used to
      inform valgrind about custom allocators, such as the one used in U-Boot.
      
      This adds headers defining these sequences to U-Boot. It also adds a config
      option to disable emission of these sequences entirely, in the (likely)
      event that the user does not wish to use valgrind. Note that this option is
      called NVALGRIND upstream, but was renamed (and inverted) to
      CONFIG_VALGRIND. Aside from this and the conversion of a few instances of
      VALGRIND_DO_CLIENT_REQUEST_EXPR to STMT, these headers are unmodified.
      
      These headers were copied from valgrind 3.16.1-4 as distributed in Arch
      Linux. They are licensed with the bzip2 1.16 license. This appears to be a
      BSD license with some clauses from Zlib.
      
      Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      fba0882b
    • Peng Fan's avatar
      Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ · b5989572
      Peng Fan authored and Tom Rini's avatar Tom Rini committed
      
      i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
      32KB memory, use 0x10000 will make SPL not bootable.
      
      Signed-off-by: Peng Fan's avatarPeng Fan <peng.fan@nxp.com>
      Reviewed-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
      Reviewed-by: default avatarFabio Estevam <festevam@denx.de>
      b5989572
  2. Apr 10, 2022
    • Tom Rini's avatar
      Merge tag 'efi-2022-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi · 33ae8c5b
      Tom Rini authored
      Pull request for efi-2022-07-rc1
      
      Documentation:
      
      * Describe how enable DM_SERIAL for a board
      
      UEFI
      
      * Preparatory patches for better integration of DM and UEFI
      * Use sysreset after capsule updates instead of do_reset
      * Allow to disable persisting non-volatile variables
      33ae8c5b
    • Marek Vasut's avatar
      Revert "env: Load env when ENV_IS_NOWHERE is only location selected" · 5c7399ec
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      This reverts commit 8d61237e.
      
      This commit broke environment on literally every board I have access
      to, with this revert in place, environment works as it should again.
      The problem I observe with this patch is that saved environment in
      either SPI NOR or eMMC is never used, the system always falls back
      to default environment. The 'saveenv' command does succeed, but then
      after reset, the default env is again used.
      
      Furthermore, the commit introduced duplicate code in env_init(), this:
      "
      	if (!prio) {
      		gd->env_addr = (ulong)&default_environment[0];
      		gd->env_valid = ENV_INVALID;
      
      		return 0;
      	}
      
      	if (ret == -ENOENT) {
      		gd->env_addr = (ulong)&default_environment[0];
      		gd->env_valid = ENV_INVALID;
      
      		return 0;
      	}
      "
      
      Furthermore, the commit is missing DCO SoB line.
      
      Also note that upstream does not support UltraZed EG board, so
      this might have been a patch pulled from downstream which did
      depend on some other downstream behavior.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Felix.Vietmeyer@jila.colorado.edu <felix.vietmeyer@jila.colorado.edu>
      Cc: Tom Rini <trini@konsulko.com>
      5c7399ec
    • Tom Rini's avatar
      Merge branch '2022-04-08-gpio-updates' · 22b7d140
      Tom Rini authored
      - Add PCA957X GPIO support, enable GPIO hogging in SPL, add
        gpio_request_by_line_name() for later use and add some pytests for
        'gpio'
      22b7d140
  3. Apr 09, 2022
  4. Apr 08, 2022
Loading