1. 11 7月, 2017 1 次提交
  2. 01 6月, 2017 1 次提交
    • S
      dm: Rename dev_addr..() functions · a821c4af
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      a821c4af
  3. 11 5月, 2017 3 次提交
    • J
      rockchip: spi: enable support for the rk_spi driver for the RK3399 · cdeb4d78
      Jakob Unterwurzacher 提交于
      The existing Rockchip SPI (rk_spi.c) driver also matches the hardware
      block found in the RK3399.  This has been confirmed both with SPI NOR
      flashes and general SPI transfers on the RK3399-Q7 for SPI1 and SPI5.
      
      This change adds the 'rockchip,rk3399-spi' string to its compatible
      list to allow reuse of the existing driver.
      
      X-AffectedPlatforms: RK3399-Q7
      Signed-off-by: NPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
      Tested-by: NJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      cdeb4d78
    • P
      rockchip: spi: rewrite rkspi_set_clk for a more conservative baudrate setting · 9fc354e2
      Philipp Tomsich 提交于
      The baudrate in rkspi was calculated by using an integer division
      (which implicitly discarded any fractional result), then rounding to
      an even number and finally clamping to 0xfffe using a bitwise AND
      operator.  This introduced two issues:
      1) for very small baudrates (overflowing the 0xfffe range), the
         bitwise-AND generates rather random-looking (wildly varying)
         actual output bitrates
      2) for higher baudrates, the calculation tends to 'err towards a
         higher baudrate' with the actual error increasing as the dividers
         become very small. E.g., with a 99MHz input clock, a request
         for a 20MBit baudrate (99/20 = 4.95), a 24.75 MBit would be use
         (which amounts to a 23.75% error)... for a 34 MBit request this
         would be an actual outbout of 49.5 Mbit (i.e. a 45% error).
      
      This change rewrites the divider selection (i.e. baudrate calculation)
      by making sure that
      a) for the normal case: the largest representable baudrate below the
         requested rate will be chosen;
      b) for the denormal case (i.e. when the divider can no longer be
         represented), the lowest representable baudrate is chosen.
      
      Even though the denormal case (b) may be of little concern in real
      world applications (even with a 198MHz input clock, this will only
      happen at below approx. 3kHz/3kBit), our board-verification team kept
      complaining.
      Signed-off-by: NPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
      Tested-by: NKlaus Goger <klaus.goger@theobroma-systems.com>
      9fc354e2
    • P
      rockchip: spi: rk_spi: dynamically select an module input rate · bd376714
      Philipp Tomsich 提交于
      The original clock/bitrate selection code for the rk_spi driver was a
      bit limited, as it always selected a 99MHz input clock rate (which
      would allow for a maximum bitrate of 49.5MBit/s), but returned -EINVAL
      if a bitrate higher than 48MHz was requested.
      
      To give us better control over the bitrate (i.e. add more operating
      points, especially at "higher" bitrate---such as above 9MBit/s), we
      try to choose 4x the maximum frequency (clamped to 50MBit) from the
      DTS instead of 99MHz... for most use-cases this will yield a frequency
      of 198MHz, but is flexible to go beyond this in future configurations.
      
      This also rewrites the check to allow frequencies of up to half the
      SPI module rate as bitrates and then clamps to whatever the DTS allows
      as a maximum (board-specific) frequency and does away with the -EINVAL
      when trying to select a bitrate (for cases that exceeded the hard
      limit) and instead consistently clamps to the lower of the hard limit,
      the soft limit for the SPI bus (from the DTS) or the soft limit for
      the SPI slave device.
      
      This replaces
        "rockchip: spi: rk_spi: select 198MHz input to the SPI module for the RK3399"
        "rockchip: spi: rk_spi: improve clocking code for the RK3399"
      from earlier versions of this series.
      Signed-off-by: NPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
      bd376714
  4. 08 2月, 2017 1 次提交
    • S
      dm: core: Replace of_offset with accessor · e160f7d4
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      e160f7d4
  5. 26 11月, 2016 2 次提交
  6. 24 9月, 2016 1 次提交
  7. 20 6月, 2016 1 次提交
    • S
      clk: convert API to match reset/mailbox style · 135aa950
      Stephen Warren 提交于
      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: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      135aa950
  8. 22 1月, 2016 7 次提交
  9. 19 1月, 2016 1 次提交
  10. 03 9月, 2015 1 次提交