The inter-integrated circuit (or I2C) bus (created by Royal Philips Electronics Inc. of Amsterdam, the Netherlands) is a multi-master serial single-ended computer bus frequently used to attach peripherals to a motherboard, embedded system, cell phone, etc. In particular, an I2C bus is a two-wire bus that includes a serial data line (SDA) and a serial clock line (SCL). In networking, I2C communications can be used to configure a group of slave nodes. Given the nature of the I2C bus and corresponding protocol, in situations where a group of slave nodes share a common slave address, a master node selects and communicates with each slave node separately even if the master node is repeating the same communication to each of the slave nodes.
The following description includes discussion of figures having illustrations given by way of example of implementations of embodiments of the invention. The drawings should be understood by way of example, not by way of limitation. As used herein, references to one or more “embodiments” are to be understood as describing a particular feature, structure, or characteristic included in at least one implementation of the invention. Thus, phrases such as “in one embodiment” or “in an alternate embodiment” appearing herein describe various embodiments and implementations of the invention, and do not necessarily all refer to the same embodiment. However, they are also not necessarily mutually exclusive.
Embodiments described herein facilitate expansion of a single I2C bus to multiple devices, allowing a master node to perform one-to-one, one-to-many, and/or one-to-all communications with slave nodes. Various types of networking devices (e.g. a router, switch, network card, media converter, etc.) might employ a master node (e.g., mother board, CPU, ASIC, etc.) that communicates with multiple slave nodes via I2C communications. For example, the master node might be responsible for configuring a group of slave nodes. In certain situations, the slave nodes might share a common slave address. For example, the slave nodes might be SFP (small form-factor pluggable) transceivers that connect the master node to a networking cable such as a fiber-optic or copper networking cable.
To communicate over an I2C bus with multiple slave nodes sharing the same slave address, a multiplexer can be used to segregate the slave nodes from each other. Examples of multiplexers include a pass-through FET (field effect transistor) multiplexer and an I2C-controlled multiplexer. However, given the limitations of the I2C bus and corresponding protocol, the master node communicates with each slave node individually. In other words, each time the master node finishes communicating with one slave node, it selects the next slave node and then starts communicating with that slave node. This successive serial communication with the various slave nodes takes place even if the master node is repeating the same communication to each slave node (which is the case, for example, during SFP transceiver initialization). Thus, the time required to configure a networking device that has multiple slave nodes may increase with the number of slave nodes.
In
Master node 110 selects one or more slave nodes 130 to receive a communication and sends the selection with the communication to expander module 120 via the I2C protocol. In one example, the communication includes configuration information (e.g., for an SFP transceiver). Via the use of various registers, expander module 120 propagates the communication to selected slave nodes 130.
Similar to
Master node 210 controls various register values on expander module 220. In some embodiments, master node 210 sets register values automatically based on predefined settings. In other embodiments, master node 210 sets register values on expander module 220 in response to user input. For example, in various embodiments master node 210 sets slave address register 226 to a common slave address (e.g., an 8-bit slave address) for slave nodes 240. In alternate embodiments, expander module 220 could include a separate slave address register for each slave node, thereby allowing master node 210 to set each slave address individually.
Master node 210 sets write register 228 to include the data (e.g., configuration data) to be sent to selected slave nodes. Particular slave nodes are selected via multicast register 222. One slave node, many slave nodes or all slave nodes may be selected via multicast register 222. Multicast register 222 may additionally include a broadcast bit that can be selected to broadcast data to all slave nodes 240.
Control register 224 includes various bits that are also controlled and/or set by master node 210. As discussed above, multicast register 222 may include a broadcast bit. Alternatively, control register 224 may contain a broadcast bit that, when selected, sends data to all slave nodes 240. A read/write bit on control register 224 determines whether a read or write operation is to be performed by expander module 220.
A start bit on control register 224, when asserted by master node 210, starts I2C communications. A combined ACK (acknowledgement) bit indicates whether or not all slave nodes 240 have responded with a proper ACK. Thus, if one or more slave nodes fail to acknowledge a communication sent from master node 210, such slave nodes may be removed from receiving future broadcasts and/or multicasts.
Error register 230 includes one bit for each slave node to track communication errors on a per slave node basis. If the error bit for a particular slave node indicates a communication error, master node 210 can choose (e.g., automatically or in response to user input) to remove the slave node from multicast list.
Speed divisor register 232 controls the operating frequency of I2C bus 202. Register 232 may be set automatically by master node 210 based on a predefined value or current conditions, or it may be set in response to user input.
Read data register 234 stores reply messages and/or data from slave nodes 240 in response to communications from master node 210. Read data register 234 can be a single register for all slave nodes 240 or it may be implemented as a single register for each of slave nodes 240. In embodiments with a register for each slave node, master node 210 read out data from each read register in serial fashion.
A master node selects 310 a plurality of slave nodes to receive data from the master node. The master node sends 320 a data communication (that includes the data for the slave nodes and additional information) onto an I2C bus (having a serial data line and a serial clock line) for receipt by the slave nodes. An expander module on the I2C bus, acting as an intermediary between the master node and the slave nodes, receives the data communication to facilitate the multicast to the selected slave nodes. In particular, the additional information in the data communication includes register values to be applied to various registers in the expander module. For example, if the slave nodes share a common slave address, the additional information causes a slave address register on the expander modules to be set to the common slave address for all of the slave nodes. Alternatively, if each slave node has a different slave address, the additional information could cause each of a plurality of slave address registers to be set to a respective slave address.
In another example, the additional information in the data communication causes the data intended for the slave nodes to be written to a write data register. In yet another example, the additional information in the data communication causes various register bits in a multicast register to be set, indicating which slave nodes are intended to receive the data from the master node.
Given the operations described with respect to
Similar to the operations of
The master node receives 430 an indication of a communication error associated with at least one slave node. For example, the expander module might include an error register that sets a flag for each slave node that does not provide a proper acknowledge in response to receiving data from the master node. In response to receiving the indication of the communication error, the master node removes 440 the slave node associated with the communication error from the list of selected slave nodes.
Various modifications may be made to the disclosed embodiments and implementations of the invention without departing from their scope. Therefore, the illustrations and examples herein should be construed in an illustrative, and not a restrictive sense.