Skip to content

FSI device driver implementation

Christopher Bostic linux-arm-kernel linux-devicetree lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest24 patches 2 repliesIn review
  2. v723 patches 5 repliesSuperseded
  3. v623 patches 15 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v523 patches6 repliesSuperseded
v423 patches12 repliesSuperseded
v3 posting 2/20 of 18 patches0 repliesSuperseded
v3 posting 1/218 patches5 repliesSuperseded

Changes in v8 from the cover letter

- Export symbols fsi_slave_read, fsi_slave_write, fsi_slave_claim_range, fsi_release_range so that hub and gpio modules can use
- Type cast to (int) to clean up build warnings in include/trace/events/fsi.h
- Add MODULE_LICENSE() to fsi-core.c

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24drivers/fsi: Add fsi master definitiondrivers/fsi/fsi-core.c drivers/fsi/fsi-master.h+76 -00 replies
2/24drivers/fsi: Add slave definitiondrivers/fsi/fsi-core.c+10 -00 replies
3/24drivers/fsi: Add empty master scandrivers/fsi/fsi-core.c+23 -20 replies
4/24lib: Add crc4 moduleinclude/linux/crc4.h lib/Kconfig lib/Makefile +1 more+63 -00 replies
5/24drivers/fsi: Add slave & master read/write APIsdrivers/fsi/fsi-core.c+92 -00 replies
6/24drivers/fsi: Set up links for slave communicationdrivers/fsi/fsi-core.c+35 -20 replies
7/24drivers/fsi: Implement slave initialisationdrivers/fsi/Kconfig drivers/fsi/fsi-core.c+66 -20 replies
8/24drivers/fsi: Set slave SMODE to init communicationdrivers/fsi/fsi-core.c+75 -00 replies
9/24drivers/fsi: scan slaves & register devicesdrivers/fsi/fsi-core.c include/linux/fsi.h+131 -10 replies
10/24drivers/fsi: Add device read/write/peek APIdrivers/fsi/fsi-core.c include/linux/fsi.h+55 -20 replies
11/24drivers/fsi: Add master unscandrivers/fsi/fsi-core.c+44 -00 replies
12/24drivers/fsi: Add documentation for GPIO bindingsDocumentation/devicetree/bindings/fsi/fsi-master-gpio.txt+24 -00 replies
13/24drivers/fsi: Add client driver register utilitiesdrivers/fsi/fsi-core.c include/linux/fsi.h+29 -00 replies
14/24drivers/fsi: Add sysfs files for FSI master & slave accessesdrivers/fsi/fsi-core.c+116 -00 replies
15/24drivers/fsi: expose direct-access slave APIdrivers/fsi/fsi-core.c include/linux/fsi.h+36 -60 replies
16/24drivers/fsi: Add tracepoints for low-level operationsdrivers/fsi/fsi-core.c include/trace/events/fsi.h+148 -62 replies
17/24drivers/fsi: Add error handling for slavedrivers/fsi/fsi-core.c+114 -70 replies
18/24drivers/fsi: Document FSI master sysfs files in ABIDocumentation/ABI/testing/sysfs-bus-fsi+38 -00 replies
19/24drivers/fsi: Add GPIO based FSI masterdrivers/fsi/Kconfig drivers/fsi/Makefile drivers/fsi/fsi-master-gpio.c+607 -00 replies
20/24drivers/fsi/gpio: Add tracepoints for GPIO masterdrivers/fsi/fsi-master-gpio.c include/trace/events/fsi_master_gpio.h+77 -00 replies
21/24drivers/fsi: Add SCOM FSI client device driverdrivers/fsi/Kconfig drivers/fsi/Makefile drivers/fsi/fsi-scom.c+269 -00 replies
22/24drivers/fsi: Add hub master supportdrivers/fsi/Kconfig drivers/fsi/Makefile drivers/fsi/fsi-master-hub.c+336 -00 replies
23/24drivers/fsi: Use asynchronous slave modedrivers/fsi/fsi-core.c drivers/fsi/fsi-master-gpio.c drivers/fsi/fsi-master.h+24 -10 replies
24/24drivers/fsi: Add module license to core driverdrivers/fsi/fsi-core.c+1 -00 replies

Reviews trailers per patch

1 of 24 patches has a Reviewed-by or Acked-by.

PatchRob Herring
1/24
2/24
3/24
4/24
5/24
6/24
7/24
8/24
9/24
10/24
11/24
12/24A-b
13/24
14/24
15/24
16/24
17/24
18/24
19/24
20/24
21/24
22/24
23/24
24/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 00/24] FSI device driver implementation

Implementation of the IBM 'Flexible Support Interface' (FSI) bus device driver. FSI is a high fan out serial bus consisting of a clock and a serial data line capable of running at speeds up to 166 MHz.

This set provides the basic framework to add FSI extensions to the Linux bus and device models. Master specific implementations are defined to utilize the core FSI function.

In Linux, we have a core FSI "bus type", along with drivers for FSI masters and engines.

The FSI master drivers expose a read/write interface to the bus address space. The master drivers are under drivers/fsi/fsi-master-*.c.

The core handles probing and discovery of slaves and slave engines, using those read/write interfaces. It is responsible for creating the endpoint Linux devices corresponding to the discovered engines on each slave.

Slave engines are identified by an 'engine' type, and an optional version. Engine, a.k.a. client, drivers are matched and bound to these engines during discovery.

This patch set does not include extended FSI function such as:

    *  Cascaded master support
    *  Application layer hot plug notification
    *  Application layer FSI bus status interface

Common FSI terminology:

* Master
Controller of the FSI bus. Only the master is allowed to control the clock line and is the initiator of all transactions on a bus.

* Slave
The receiver or target of a master initiated transaction. The slave cannot initiate communications on a bus and must respond to any master requests for data.

* CFAM
Stands for Common Field replaceable unit Access Macro. A CFAM is an ASIC residing in any device requiring FSI communications. CFAMs consist of an array of hardware 'engines' used for various purposes. I2C masters, UARTs, General Purpose IO hardware are common types of these engines.

* Configuration Space / Table
A table contained at the beginning of each CFAM address space. This table lists information such as the CFAM's ID, which engine types and versions it has available, as well as its addressing range.

* FSI Engine driver
A device driver that registers with the FSI core so that it can access devices it owns on an FSI bus.

* Hub
An FSI master that connects to an upstream 'primary' master allowing high fanout of target devices.

----
Changes in v8:
- Export symbols fsi_slave_read, fsi_slave_write, fsi_slave_claim_range, fsi_release_range so that hub and gpio modules can use
- Type cast to (int) to clean up build warnings in include/trace/events/fsi.h
- Add MODULE_LICENSE() to fsi-core.c

Changes in v7:
- Use GENMASK for bitmask definitions
- Move instances of dev_info to dev_dbg
- Add missing return code checks
- Add API details for fsi_device_read/write/peek()
- GPIO master: Unscan when unregistering master
- Document ABI sysfs files raw, term, break, rescan
- GPIO master: move global spinlock into struct fsi_master_gpio
- GPIO master: remove redundant checks for valid pin descriptors

Changes in v6:
- Remove redundant 'depends on' specifiers in Kconfig for SCOM GPIO master and Hub masters.

Changes in v5:
- Remove explicit kfree of struct fsi_master in fsi_master_gpio.
- Remove Palmetto and Romulus dts device tree file udates for FSI gpio master

Changes in v4:
- endianness: the _read() and _write() APIs are now all *bus endian*, so will be the same on all platforms (the previous fsi patches exposed as (BMC/FSP) CPU endian, which is variable).
- device tree: Remove the "ibm," prefix for the fsi core and GPIO master compatibility strings, as they're not describing IBM-specific
- device model: Create separate struct devices for each FSI master, which fits better with the Linux device model, and allows addition of sysfs attributes that are implemented by the fsi core
- sysfs: there are now sysfs facilities for break and term. Raw file supports reads and writes of arbitrary sizes.
- GPIO master: split the xfer() logic out a little, so that the response handling & DPOLL retry mechanism is more obvious
- GPIO master: simplifications for message construction
- GPIO master: fixes for some CRC calculations
- GPIO master: issue TERM in response to DPOLL busy-loops
- Error handling: rather than handle errors on (potentially) an entire cascaded read or write, the error handling is now down on a per-slave basis, where we try to reestablish communication in a more "gradual" manner, rather than sending a break immediately. May need to add a hook to percolate error recovery up to a slave's master but no need seen for that at present.
- Hub master: this is now implemented as a fsi engine driver, as the fsi_slave_{read,write}() functions are exported (and the port count is available in the hMFSI configuration register)
This means we need fewer special-cases in the fsi core.
- Tracepoints: Add tracepoints for FSI core read & write, and another set for low-level GPIO in/out operations.

Changes in v3:
- Patch set contained an invalid 18/18 test patch not meant for community review, corrected.

Changes in v2:
- Change from atomic global for master number to ida simple interface.
- Add valid pointer checks on register and unregister utils.
- Move CRC calculation utilities out of driver to lib path.
- Clean up white space issues.
- Remove added list management of master devices and use instead the device_for_each_child method available in the bus.
- Add new patch to document FSI bus functionality.
- Add new patch documenting FSI gpio master.
- Rearrage patch set to have documentation earlier than code implementing it.
- Document all compatible strings used in device tree bindings.
- Elaborate documentation definition of FSI GPIO master.
- Describe in more detail what each GPIO FSI master pin is for.
- Re-order compatible strings in example binding so that most specific device comes first.
- Indicate proper activation order of all FSI GPIO master pins.
- Fix an unmatched '>' bracket in the example for binding.
- Bracket each element of the example bindings individually.
- Add new patch documenting sysfs-bus-fsi attributes.
- Merge FSI GPIO master init into probe function.
- Set pin initial values at time of pin request.
- Assign value of master->master.dev at probe time.
- Use get_optional interface for all optional GPIO pins.

Christopher Bostic (10):
drivers/fsi: Set up links for slave communication drivers/fsi: Set slave SMODE to init communication drivers/fsi: Add master unscan
drivers/fsi: Add documentation for GPIO bindings drivers/fsi: Add client driver register utilities drivers/fsi: Document FSI master sysfs files in ABI drivers/fsi: Add GPIO based FSI master drivers/fsi: Add SCOM FSI client device driver drivers/fsi: Add hub master support drivers/fsi: Add module license to core driver

Jeremy Kerr (14):
drivers/fsi: Add fsi master definition drivers/fsi: Add slave definition
drivers/fsi: Add empty master scan
lib: Add crc4 module
drivers/fsi: Add slave & master read/write APIs drivers/fsi: Implement slave initialisation drivers/fsi: scan slaves & register devices drivers/fsi: Add device read/write/peek API drivers/fsi: Add sysfs files for FSI master & slave accesses drivers/fsi: expose direct-access slave API drivers/fsi: Add tracepoints for low-level operations drivers/fsi: Add error handling for slave drivers/fsi/gpio: Add tracepoints for GPIO master drivers/fsi: Use asynchronous slave mode

 Documentation/ABI/testing/sysfs-bus-fsi            |  38 +
 .../devicetree/bindings/fsi/fsi-master-gpio.txt    |  24 +
 drivers/fsi/Kconfig                                |  26 +
 drivers/fsi/Makefile                               |   3 +
 drivers/fsi/fsi-core.c                             | 841 +++++++++++++++++++++
 drivers/fsi/fsi-master-gpio.c                      | 604 +++++++++++++++
 drivers/fsi/fsi-master-hub.c                       | 327 ++++++++
 drivers/fsi/fsi-master.h                           |  43 ++
 drivers/fsi/fsi-scom.c                             | 263 +++++++
 include/linux/crc4.h                               |   8 +
 include/linux/fsi.h                                |  35 +-
 include/trace/events/fsi.h                         | 127 ++++
 include/trace/events/fsi_master_gpio.h             |  68 ++
 lib/Kconfig                                        |   8 +
 lib/Makefile                                       |   1 +
 lib/crc4.c                                         |  46 ++
 16 files changed, 2461 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-fsi
 create mode 100644 Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt
 create mode 100644 drivers/fsi/fsi-master-gpio.c
 create mode 100644 drivers/fsi/fsi-master-hub.c
 create mode 100644 drivers/fsi/fsi-master.h
 create mode 100644 drivers/fsi/fsi-scom.c
 create mode 100644 include/linux/crc4.h
 create mode 100644 include/trace/events/fsi.h
 create mode 100644 include/trace/events/fsi_master_gpio.h
 create mode 100644 lib/crc4.c
Signature · 1 line
1.8.2.2