06 Aug, 2018

1 commit

  • The chardev conversion forgot to copy the fsi_dev,
    silly mistake, compounded by a testing mistake on
    my side, this specific driver wasn't being tested
    properly.

    Fixes: d8f4587655f9 "fsi: scom: Convert to use the new chardev"
    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

27 Jul, 2018

5 commits

  • The bus scanning process isn't terribly good at parallel attempts
    at rescanning the same bus. Let's have a per-master mutex protecting
    the scanning process.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This aims to deprecate the "raw" sysfs file used for directly
    accessing the CFAM and instead use a char device like the
    other sub drivers.

    Since it reworks the slave creation code and adds a cfam device
    type, we also use the opportunity to convert the attributes
    to attribute groups and add a couple more.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This converts FSI scom to use the new fsi-core controlled
    chardev allocator and use a real cdev instead of a miscdev.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This converts FSI sbefifo to use the new fsi-core controlled
    chardev allocator and use a real cdev instead of a miscdev.

    One side effect is to fix the object lifetime by removing
    the use of devm_kzalloc() for something that contains kobjects,
    and using proper reference counting.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • The various FSI devices (sbefifo, occ, scom, more to come)
    currently use misc devices.

    This is problematic as the minor device space for misc is
    limited and there can be a lot of them. Also it limits our
    ability to move them to a dedicated /dev/fsi directory or
    to be smart about device naming and numbering.

    It also means we have IDAs on every single of these drivers

    This creates a common fsi "device_type" for the optional
    /dev/fsi grouping and a dev_t allocator for all FSI devices.

    "Legacy" devices get to use a backward compatible numbering
    scheme (as long as chip id

    Benjamin Herrenschmidt
     

26 Jul, 2018

2 commits


25 Jul, 2018

1 commit


24 Jul, 2018

1 commit


23 Jul, 2018

7 commits


12 Jul, 2018

13 commits


02 Jul, 2018

4 commits

  • On the Aspeed chip, the GPIOs can be under control of the ARM
    chip or of the ColdFire coprocessor. (There's a third command
    source, the LPC bus, which we don't use or support yet).

    The control of which master is allowed to modify a given
    GPIO is per-bank (8 GPIOs).

    Unfortunately, systems already exist for which we want to
    use GPIOs of both sources in the same bank.

    This provides an API exported by the gpio-aspeed driver
    that an aspeed coprocessor driver can use to "grab" some
    GPIOs for use by the coprocessor, and allow the coprocessor
    driver to provide callbacks for arbitrating access.

    Once at least one GPIO of a given bank has been "grabbed"
    by the coprocessor, the entire bank is marked as being
    under coprocessor control. It's command source is switched
    to the coprocessor.

    If the ARM then tries to write to a GPIO in such a marked bank,
    the provided callbacks are used to request access from the
    coprocessor driver, which is responsible to doing whatever
    is necessary to "pause" the coprocessor or prevent it from
    trying to use the GPIOs while the ARM is doing its accesses.

    During that time, the command source for the bank is temporarily
    switched back to the ARM.

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Joel Stanley
    Reviewed-by: Andrew Jeffery
    Signed-off-by: Linus Walleij

    Benjamin Herrenschmidt
     
  • This adds the definitions for the command source registers
    and a helper to set them.

    Those registers allow to control which bus master on the
    SoC is allowed to modify a given bank of GPIOs and will
    be used by subsequent patches.

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Joel Stanley
    Reviewed-by: Andrew Jeffery
    Signed-off-by: Linus Walleij

    Benjamin Herrenschmidt
     
  • The Aspeed GPIO hardware has a quirk: the value register, for an
    output GPIO, doesn't contain the last value written (the write
    latch content) but the sampled input value.

    This means that when reading back shortly after writing, you can
    get an incorrect value as the input value is delayed by a few
    synchronizers.

    The HW supports a separate read-only register "Data Read Register"
    which allows you to read the write latch instead.

    This adds the definition for it, and uses it for the initial
    population of the GPIO value cache. It will be used more in
    subsequent patches.

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Joel Stanley
    Reviewed-by: Andrew Jeffery
    Signed-off-by: Linus Walleij

    Benjamin Herrenschmidt
     
  • Use a single accessor function for all register types instead
    of several spread around. This will make it easier/cleaner
    to introduce new registers and keep the mechanism in one
    place.

    The big switch/case is optimized at compile time since the
    switch value is a constant.

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Joel Stanley
    Reviewed-by: Andrew Jeffery
    Signed-off-by: Linus Walleij

    Benjamin Herrenschmidt
     

18 Jun, 2018

6 commits

  • This was too hard to split ... this adds a number of features
    to the SCOM user interface:

    - Support for indirect SCOMs

    - read()/write() interface now handle errors and retries

    - New ioctl() "raw" interface for use by debuggers

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Eddie James
    Reviewed-by: Alistair Popple

    Benjamin Herrenschmidt
     
  • Add a few more register and bit definitions, also define and use
    SCOM_READ_CMD (which is 0 but it makes the code clearer)

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Eddie James

    Benjamin Herrenschmidt
     
  • Use the proper annotated type __be32 and fixup the
    accessor used for get_scom()

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Eddie James

    Benjamin Herrenschmidt
     
  • No functional changes

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Eddie James

    Benjamin Herrenschmidt
     
  • Otherwise, multiple clients can open the driver and attempt
    to access the PIB at the same time, thus clobbering each other
    in the process.

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Eddie James

    Benjamin Herrenschmidt
     
  • fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:210:9: warning: cast to restricted __be32
    fsi-core.c:606:15: warning: incorrect type in assignment (different base types)
    fsi-core.c:606:15: expected unsigned int [unsigned] [assigned] [usertype] smode
    fsi-core.c:606:15: got restricted __be32 [usertype]
    fsi-core.c:492:28: warning: expression using sizeof(void)
    fsi-core.c:520:29: warning: expression using sizeof(void)
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:682:19: warning: cast to restricted __be32
    fsi-core.c:706:24: warning: incorrect type in assignment (different base types)
    fsi-core.c:706:24: expected unsigned int [unsigned] [usertype] llmode
    fsi-core.c:706:24: got restricted __be32 [usertype]

    Signed-off-by: Joel Stanley
    Signed-off-by: Benjamin Herrenschmidt

    Joel Stanley