1. 15 Sep, 2020 1 commit
  2. 25 Jul, 2020 1 commit
    • Masahiro Yamada's avatar
      treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() · 8613c8d8
      Masahiro Yamada authored
      Use the _ptr suffixed variant instead of casting. Also, convert it to
      dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.
      
      One curious part is an error check like follows in
      drivers/watchdog/omap_wdt.c:
      
          priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
          if (!priv->regs)
                  return -EINVAL;
      
      devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
      So, this code does not catch any error in DT parsing.
      
      dev_read_addr_ptr() returns NULL on error, so this error check
      will work.
      
      I generated this commit by the following command:
      
       $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
         xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'
      
      I manually fixed drivers/usb/host/ehci-mx6.c
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      8613c8d8
  3. 24 Jul, 2020 1 commit
  4. 20 Jul, 2020 1 commit
    • Masahiro Yamada's avatar
      treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() · 3c12c62b
      Masahiro Yamada authored
      Use the _ptr suffixed variant instead of casting. Also, convert it to
      dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.
      
      One curious part is an error check like follows in
      drivers/watchdog/omap_wdt.c:
      
          priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
          if (!priv->regs)
                  return -EINVAL;
      
      devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
      So, this code does not catch any error in DT parsing.
      
      dev_read_addr_ptr() returns NULL on error, so this error check
      will work.
      
      I generated this commit by the following command:
      
       $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
         xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'
      
      I manually fixed drivers/usb/host/ehci-mx6.c
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      3c12c62b
  5. 06 Feb, 2020 1 commit
    • Simon Glass's avatar
      dm: core: Create a new header file for 'compat' features · 336d4615
      Simon Glass authored
      At present dm/device.h includes the linux-compatible features. This
      requires including linux/compat.h which in turn includes a lot of headers.
      One of these is malloc.h which we thus end up including in every file in
      U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
      which needs to use the system malloc() in some files.
      
      Move the compatibility features into a separate header file.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      336d4615
  6. 09 Aug, 2019 1 commit
  7. 07 May, 2018 1 commit
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: Tom Rini's avatarTom Rini <trini@konsulko.com>
      83d290c5
  8. 24 Jan, 2018 1 commit
  9. 01 Jun, 2017 1 commit
    • Simon Glass's avatar
      dm: Rename dev_addr..() functions · a821c4af
      Simon Glass authored
      These support the flat device tree. We want to use the dev_read_..()
      prefix for functions that support both flat tree and live tree. So rename
      the existing functions to avoid confusion.
      
      In the end we will have:
      
         1. dev_read_addr...()    - works on devices, supports flat/live tree
         2. devfdt_get_addr...()  - current functions, flat tree only
         3. of_get_address() etc. - new functions, live tree only
      
      All drivers will be written to use 1. That function will in turn call
      either 2 or 3 depending on whether the flat or live tree is in use.
      
      Note this involves changing some dead code - the imx_lpi2c.c file.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a821c4af
  10. 08 Feb, 2017 1 commit
    • Simon Glass's avatar
      dm: core: Replace of_offset with accessor · e160f7d4
      Simon Glass authored
      At present devices use a simple integer offset to record the device tree
      node associated with the device. In preparation for supporting a live
      device tree, which uses a node pointer instead, refactor existing code to
      access this field through an inline function.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      e160f7d4
  11. 23 Jan, 2017 1 commit
  12. 10 Oct, 2016 1 commit
  13. 23 Sep, 2016 1 commit
  14. 12 Aug, 2016 1 commit
  15. 05 Aug, 2016 2 commits
  16. 11 Jul, 2016 2 commits
  17. 08 Jul, 2016 1 commit
  18. 19 Jun, 2016 1 commit
    • Stephen Warren's avatar
      clk: convert API to match reset/mailbox style · 135aa950
      Stephen Warren authored
      The following changes are made to the clock API:
      * The concept of "clocks" and "peripheral clocks" are unified; each clock
        provider now implements a single set of clocks. This provides a simpler
        conceptual interface to clients, and better aligns with device tree
        clock bindings.
      * Clocks are now identified with a single "struct clk", rather than
        requiring clients to store the clock provider device and clock identity
        values separately. For simple clock consumers, this isolates clients
        from internal details of the clock API.
      * clk.h is split so it only contains the client/consumer API, whereas
        clk-uclass.h contains the provider API. This aligns with the recently
        added reset and mailbox APIs.
      * clk_ops .of_xlate(), .request(), and .free() are added so providers
        can customize these operations if needed. This also aligns with the
        recently added reset and mailbox APIs.
      * clk_disable() is added.
      * All users of the current clock APIs are updated.
      * Sandbox clock tests are updated to exercise clock lookup via DT, and
        clock enable/disable.
      * rkclk_get_clk() is removed and replaced with standard APIs.
      
      Buildman shows no clock-related errors for any board for which buildman
      can download a toolchain.
      
      test/py passes for sandbox (which invokes the dm clk test amongst
      others).
      Signed-off-by: Stephen Warren's avatarStephen Warren <swarren@nvidia.com>
      Acked-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      135aa950
  19. 01 Apr, 2016 1 commit