17 Dec, 2018

1 commit

  • [ Upstream commit 64999fa7aa2c076ec6d05aee481f11f5296ceb8c ]

    In randconfig builds without CONFIG_GENERIC_ALLOCATOR, this driver
    fails to link:

    ERROR: "gen_pool_alloc_algo" [drivers/fsi/fsi-master-ast-cf.ko] undefined!
    ERROR: "gen_pool_fixed_alloc" [drivers/fsi/fsi-master-ast-cf.ko] undefined!
    ERROR: "of_gen_pool_get" [drivers/fsi/fsi-master-ast-cf.ko] undefined!
    ERROR: "gen_pool_free" [drivers/fsi/fsi-master-ast-cf.ko] undefined!

    Select the dependency as all other users do.

    Fixes: 6a794a27daca ("fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

08 Aug, 2018

1 commit

  • Otherwise cronus putmem fails istep and BML fails to upload skiboot

    To do that, we still use our one-page command buffer for small commands
    for speed, and for anything bigger, with a limit of 1MB plus a page,
    we vmalloc a temporary buffer.

    The limit was chosen because Cronus will break up any data transfer
    into 1M chunks (the extra page is for the command header).

    Signed-off-by: Benjamin Herrenschmidt
    Reviewed-by: Andrew Jeffery

    Benjamin Herrenschmidt
     

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

3 commits


12 Jul, 2018

13 commits


18 Jun, 2018

8 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
     
  • fsi-master-hub.c:128:13: warning: incorrect type in assignment (different base types)
    fsi-master-hub.c:128:13: expected unsigned int [unsigned] [usertype] cmd
    fsi-master-hub.c:128:13: got restricted __be32 [usertype]
    fsi-master-hub.c:208:13: warning: incorrect type in assignment (different base types)
    fsi-master-hub.c:208:13: expected restricted __be32 [addressable] [assigned] [usertype] reg
    fsi-master-hub.c:208:13: got int

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

    Joel Stanley
     
  • fsi-sbefifo.c:547:58: warning: incorrect type in argument 2 (different base types)
    fsi-sbefifo.c:547:58: expected restricted __be32 [usertype] *word
    fsi-sbefifo.c:547:58: got unsigned int *
    fsi-sbefifo.c:635:16: warning: incorrect type in assignment (different base types)
    fsi-sbefifo.c:635:16: expected unsigned int [unsigned]
    fsi-sbefifo.c:635:16: got restricted __be32 [usertype]
    fsi-sbefifo.c:636:16: warning: incorrect type in assignment (different base types)
    fsi-sbefifo.c:636:16: expected unsigned int [unsigned]
    fsi-sbefifo.c:636:16: got restricted __be32 [usertype]

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

    Joel Stanley
     

14 Jun, 2018

1 commit


12 Jun, 2018

3 commits

  • This driver provides an in-kernel and a user API for accessing
    the command FIFO of the SBE (Self Boot Engine) of the POWER9
    processor, via the FSI bus.

    It provides an in-kernel interface to submit command and receive
    responses, along with a helper to locate and analyse the response
    status block. It's a simple synchronous submit() type API.

    The user interface uses the write/read interface that an earlier
    version of this driver already provided, however it has some
    specific limitations in order to keep the driver simple and
    avoid using up a lot of kernel memory:

    - The user should perform a single write() with the command and
    a single read() to get the response (with a buffer big enough
    to hold the entire response).

    - On a write() the command is simply "stored" into a kernel buffer,
    it is submitted as one operation on the subsequent read(). This
    allows to have the code write directly from the FIFO into the user
    buffer and avoid hogging the SBE between the write() and read()
    syscall as it's critical that the SBE be freed asap to respond
    to the host. An extra write() will simply replace the previously
    written command.

    - A write of a single 4 bytes containing the value 0x52534554
    in big endian will trigger a reset request. No read is necessary,
    the write() call will return when the reset has been acknowledged
    or times out.

    - The command is limited to 4K bytes.

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

    Benjamin Herrenschmidt
     
  • The PIB reset causes problems for the running P9 chip. The reset
    shouldn't be performed by this driver.

    Signed-off-by: Eddie James
    Reviewed-by: Christopher Bostic
    Signed-off-by: Benjamin Herrenschmidt
    Tested-by: Joel Stanley

    Eddie James
     
  • We currently use a spinlock (bit_lock) around operations that clock bits
    out of the FSI bus, and a mutex to protect against simultaneous access
    to the master.

    This means that bit_lock isn't needed for mutual exlusion, only to
    prevent timing issues when clocking bits out.

    To reflect this, this change converts bit_lock to just the
    local_irq_save/restore operation.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Benjamin Herrenschmidt
    Tested-by: Joel Stanley

    Jeremy Kerr