forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: mfd: Add support for Moxtet bus
On the Turris Mox router there can be connected different modules to the main CPU board, currently a module with a SFP cage, a module with MiniPCIe connector, a 4-port switch module and a 8-port switch module, for example: [CPU]-[PCIe]-[8-port switch]-[8-port switch]-[SFP] Each of this modules has an input and output shift register, and these are connected via SPI to CPU board. Via this SPI connection we are able to discover which modules are connected and we can also read/write some configuration to the modules. Fromi/to each module 8 bits can be read (of which lower 4 bits identify the module) and written. For example from the module with a SFP cage we can read the LOS, TX-FAULT and MOD-DEF0 signals, while we can write TX-DISABLE and RATE-SELECT signals. Other modules may support something else. This driver creates a new bus type, called "moxtet". For each Mox module it finds via SPI, it creates a new device on the moxtet bus so that drivers can be written for them, for example a gpio driver for the module with a SFP cage. The topology of how Mox modules are connected can then be read by listing /sys/bus/moxtet/devices. Signed-off-by: Marek Behún <marek.behun@nic.cz>
- Loading branch information
1 parent
d2c9281
commit 316bda5
Showing
6 changed files
with
658 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Turris Mox module configuration bus (over SPI) | ||
|
||
Required properties: | ||
- compatible : Should be "cznic,moxtet". | ||
- #address-cells : Has to be 1 | ||
- #size-cells : Has to be 0 | ||
For other required and optional properties of SPI slave | ||
nodes please refer to ../spi/spi-bus.txt. | ||
|
||
Required properties of subnodes: | ||
- reg : Should be position on the Moxtet bus | ||
- moxtet,id : Should be ID of the Moxtet device connected | ||
|
||
The driver finds the devices connected to the bus by itself, but it may be | ||
needed to reference some of them from other parts of the device tree. In that | ||
case the devices can be defined as subnodes of the moxtet node. | ||
|
||
Example: | ||
|
||
moxtet@1 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
compatible = "cznic,moxtet"; | ||
reg = <1>; | ||
spi-max-frequency = <1000000>; | ||
spi-cpol; | ||
spi-cpha; | ||
|
||
moxtet_sfp: moxtet-sfp@0 { | ||
compatible = "cznic,moxtet-sfp"; | ||
gpio-controller; | ||
#gpio-cells; | ||
reg = <0>; | ||
moxtet,id = <1>; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.