1. 13 Feb, 2020 1 commit
    • Philippe Reynes's avatar
      test: aes: fix memleak · 58b209cf
      Philippe Reynes authored
      In the first version, the result of malloc is checked
      with ut_assertnonnull. But on a fail, this macro exit
      the function, so previously malloc are not freed.
      So to avoid a memleak, we don't use ut_assertnonnull,
      but simply check the return of malloc. If one has failed,
      we freed all the allocated memory and quit the function.
      Reported-by: Coverity (CID: 284403)
      Reported-by: Coverity (CID: 284404)
      Reported-by: Coverity (CID: 284405)
      Reported-by: Coverity (CID: 284406)
      Reported-by: Coverity (CID: 284407)
      Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
  2. 07 Feb, 2020 4 commits
    • Simon Glass's avatar
      dm: irq: Add support for requesting interrupts · 02554355
      Simon Glass authored
      At present driver model supports the IRQ uclass but there is no way to
      request a particular interrupt for a driver.
      Add a mechanism, similar to clock and reset, to read the interrupts
      required by a device from the device tree and to request those interrupts.
      U-Boot itself does not have interrupt-driven handlers, so just provide a
      means to read and clear an interrupt. This can be useful to handle
      peripherals which must use an interrupt to determine when data is
      available, for example.
      Bring over the basic binding file as well, from Linux v5.4. Note that the
      older binding is not supported in U-Boot; the newer 'special form' must be
      Add a simple test of the new functionality.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
    • Simon Glass's avatar
      dm: irq: Add support for interrupt controller types · ba876079
      Simon Glass authored
      There can be different types of interrupt controllers in a system and some
      drivers may need to distinguish between these. In general this can be
      handled using the device tree by adding the interrupt information to
      device nodes.
      However on x86 devices we have interrupt controllers which are not tied
      to any particular device and not really used in U-Boot. These still need
      to be inited, so a convenient method is to give each controller a type
      and allow a particular controller type to be probed.
      Add support for this in sandbox along with a test.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      [bmeng: remove the new bland line at EOF of test/dm/irq.c]
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
    • Simon Glass's avatar
      dm: core: Add a function to find a device by drvdata · 50162348
      Simon Glass authored
      It is sometimes useful to find a device in a uclass using only its driver
      data. The driver data often indicates the 'subtype' of the device, e,g,
      via its compatible string.
      Add a function to handle this.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
    • Simon Glass's avatar
      dm: core: Allow iterating devices without uclass_get() · 3cf0fba4
      Simon Glass authored
      At present we have uclass_foreach_dev() which requires that uclass_get()
      be called beforehand to find the uclass. This is good if we suspect that
      that function might fail, but often we know that the uclass is available.
      Add a new helper which does this uclass_get() automatically, so that only
      the uclass ID is needed.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
  3. 06 Feb, 2020 12 commits
  4. 05 Feb, 2020 2 commits
  5. 04 Feb, 2020 2 commits
  6. 30 Jan, 2020 1 commit
  7. 27 Jan, 2020 1 commit
  8. 17 Jan, 2020 2 commits
  9. 16 Jan, 2020 1 commit
  10. 14 Jan, 2020 1 commit
  11. 10 Jan, 2020 1 commit
    • Philippe Reynes's avatar
      test/cmd_ut.c: fix cmd_ut_category · 3f05f087
      Philippe Reynes authored
      In the function cmd_ut_category, the prefix is used with
      the function strncmp to know if the prefix should be
      removed from the test name, even if the prefix is NULL.
      To avoid this issue, we consider that a prefix NULL
      mean no prefix. So we only try to remove the prefix
      from the test_name if the prefix is not NULL, then
      we avoid to call the function strncmp with a NULL
      Reported-by: Coverity CID 281110
      Fixes: 4ad4edfe ("cmd_ut: add a parameter prefix to the function cmd_ut_category")
      Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
  12. 07 Jan, 2020 10 commits
  13. 02 Jan, 2020 2 commits
    • Simon Glass's avatar
      test: Fix the boardspec for the SPL handoff test · 1785bf54
      Simon Glass authored
      This test currently does not run because it specifies the sandbox board
      instead of sandbox_spl. Fix it.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Stephen Warren's avatar
      test_env: don't strip() printenv results · fc1a3bfe
      Stephen Warren authored
      get_env() was originally written to strip() the output of printenv to
      isolate the test from any whitespace changes in printenv's output.
      However, this throws away any whitespace in the variable value, which can
      cause issues when test code expects to see that whitespace. In fact,
      printenv never adds any whitespace at all, so there's no need to strip.
      The strip causes a practical problem for test_env_echo_exists() if
      state_test_env.get_existent_var() happens to choose a U-Boot variable that
      contains trailing whitespace. This is true for variable boot_targets.
      With Python 2, get_existent_var() never returned boot_targets so this
      issue never caused a practical problem.
      With Python 3, get_existent_var does sometimes return boot_targets, no
      doubt due to Python 3's different dict hash key order implementation,
      about 0.5-2% of the time, so this test appears intermittent. With the
      strip removed, this intermittency is solved, since the test passes for all
      possible U-Boot variables.
      Signed-off-by: Stephen Warren's avatarStephen Warren <swarren@nvidia.com>