1. 20 8月, 2014 1 次提交
    • S
      regmap: of_regmap_get_endian() cleanup · 45e1a279
      Stephen Warren 提交于
      Commit d647c199 ("regmap: add DT endianness binding support") had
      some issues. Commit ba1b53fe ("regmap: Fix DT endianess parsing
      logic") fixed the main problem. This patch fixes the other.
      
      Specifically, restore the overall default of REGMAP_ENDIAN_BIG if none of
      the config, DT, or the bus specify any endianness. Without this,
      of_regmap_get_endian() could return REGMAP_ENDIAN_DEFAULT, which the
      calling code can't handle. Since all busses do specify an endianness in
      the current code, this makes no difference right now, but I saw no
      justification in the patch description for removing this final default.
      
      Also, clean up the code a bit:
      
      * s/of_regmap_get_endian/regmap_get_endian/ since the function isn't DT-
        specific, even if the reason it was originally added was to add some
        DT-specific features.
      * After potentially reading an endianess specification from DT, the code
        checks whether DT did specify an endianness, and if so, returns it. Move
        this test outside the whole switch statement so that if the
        REGMAP_ENDIAN_REG case ever modifies *endian, this check will pick that
        up. This partially reverts part of commit ba1b53fe ("regmap: Fix DT
        endianess parsing logic"), while maintaining the bug-fix that commit
        made to this code.
      * Make the comments briefer, and only refer to the specific action taken
        at their location. This makes most of the comments independent of DT,
        and easier to follow.
      
      Cc: Xiubo Li <Li.Xiubo@freescale.com>
      Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
      Cc: Thierry Reding <treding@nvidia.com>
      Fixes: d647c199 ("regmap: add DT endianness binding support")
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      45e1a279
  2. 19 8月, 2014 1 次提交
    • J
      regmap: Fix DT endianess parsing logic · ba1b53fe
      Javier Martinez Canillas 提交于
      Commit d647c199 ("regmap: add DT endianness binding support.")
      added support to parse the device endianness from the device tree
      but unfortunately the added logic doesn't have the same semantics
      than the old code. This leads to a NULL dereference pointer error
      when these properties are not provided by the Device Tree:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000044
      pgd = c0004000
      [00000044] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 5 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc1-next-20140818ccu #671
      task: ea412800 ti: ea484000 task.ti: ea484000
      PC is at regmap_update_bits+0xc/0x5c
      
      The problem is that platforms that rely on the default value now
      gets different values due two related issues in the current code:
      
      a) It only parses the endianness from DT for the regmap registers
         and not for the regmap values but it checks unconditionally in
         both cases if the resulting endiannes is REGMAP_ENDIAN_NATIVE.
      
      b) REGMAP_ENDIAN_NATIVE is not even a valid DT property according
         to the regmap DT binding documentation so it shouldn't be set.
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      ba1b53fe
  3. 17 8月, 2014 3 次提交
    • X
      regmap: Add the DT binding documentation for endianness · 275876e2
      Xiubo Li 提交于
      Device-Tree binding for device endianness
      Index     Device     Endianness properties
      ---------------------------------------------------
      1         BE         'big-endian'
      2         LE         'little-endian'
      
      For one device driver, which will run in different scenarios above
      on different SoCs using the devicetree, we need one way to simplify
      this.
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      275876e2
    • X
      regmap: add DT endianness binding support. · d647c199
      Xiubo Li 提交于
      For many drivers which will support rich endianness of Devices
      need define DT properties by itself with the binding support.
      
      The endianness using regmap:
      Index      Device     Properties if needs bytes-swap,
                            or just ignore it
      -------------------------------------------------------------
      1          BE         'big-endian'
      2          LE         'little-endian'
      
      The properties include all the register values and the buffers.
      And these properties are very usful for the MMIO devices:
      
      Such as: a memory-mapped device, on one SoC is in BE mode, while
      in another SoC will be in LE mode, and the CPU will always in LE
      mode.
      
      For the first case, we must use cpu_to_be32/be32_to_cpu for
      32-bit registers accessing, so the 'big-endian' property is needed.
      
      For the second case, we can just ignore the bytes-swap
      functions like cpu_to_le32/le32_to_cpu, so the 'little-endian'
      property could be abscent.
      
      And vice versa...
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      d647c199
    • L
      Linux 3.17-rc1 · 7d1311b9
      Linus Torvalds 提交于
      7d1311b9
  4. 16 8月, 2014 35 次提交