Skip to content

Commit f5b8abf

Browse files
mkjdavem330
authored andcommitted
mctp i2c: MCTP I2C binding driver
Provides MCTP network transport over an I2C bus, as specified in DMTF DSP0237. All messages between nodes are sent as SMBus Block Writes. Each I2C bus to be used for MCTP is flagged in devicetree by a 'mctp-controller' property on the bus node. Each flagged bus gets a mctpi2cX net device created based on the bus number. A 'mctp-i2c-controller' I2C client needs to be added under the adapter. In an I2C mux situation the mctp-i2c-controller node must be attached only to the root I2C bus. The I2C client will handle incoming I2C slave block write data for subordinate busses as well as its own bus. In configurations without devicetree a driver instance can be attached to a bus using the I2C slave new_device mechanism. The MCTP core will hold/release the MCTP I2C device while responses are pending (a 6 second timeout or once a socket is closed, response received etc). While held the MCTP I2C driver will lock the I2C bus so that the correct I2C mux remains selected while responses are received. (Ideally we would just lock the mux to keep the current bus selected for the response rather than a full I2C bus lock, but that isn't exposed in the I2C mux API) Signed-off-by: Matt Johnston <[email protected]> Signed-off-by: Jeremy Kerr <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> # I2C transport parts Signed-off-by: David S. Miller <[email protected]>
1 parent 6881e49 commit f5b8abf

File tree

3 files changed

+1094
-0
lines changed

3 files changed

+1094
-0
lines changed

drivers/net/mctp/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ config MCTP_SERIAL
2121
Say y here if you need to connect to MCTP endpoints over serial. To
2222
compile as a module, use m; the module will be called mctp-serial.
2323

24+
config MCTP_TRANSPORT_I2C
25+
tristate "MCTP SMBus/I2C transport"
26+
# i2c-mux is optional, but we must build as a module if i2c-mux is a module
27+
depends on I2C_MUX || !I2C_MUX
28+
depends on I2C
29+
depends on I2C_SLAVE
30+
select MCTP_FLOWS
31+
help
32+
Provides a driver to access MCTP devices over SMBus/I2C transport,
33+
from DMTF specification DSP0237. A MCTP protocol network device is
34+
created for each I2C bus that has been assigned a mctp-i2c device.
35+
2436
endmenu
2537

2638
endif

drivers/net/mctp/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
obj-$(CONFIG_MCTP_SERIAL) += mctp-serial.o
2+
obj-$(CONFIG_MCTP_TRANSPORT_I2C) += mctp-i2c.o

0 commit comments

Comments
 (0)