Continued...For the purposes of the one switch / four endpoint example, assume that no other host has claim over the found switch, then lock the device and set the Discovered bit. The next steps require an understanding of how many ports the switch has, which port of the switch has been entered, and at which port to begin to exploration. To do this, a maintenance read is issued to the Switch Port Information CAR. The bit-fields within this register will provide the information. The port chosen is arbitrary. Assume the entry is through Port 1. Explore each of the other ports on the switch in sequential order from lowest to highest port, starting with what lies beyond Port 0. At this point in the Discovery algorithm, there may be a number of other capability registers in preparation for the third step of initialization. In order to discover what exists out Port 0, issue a maintenance packet with a Destination ID of 0xFF and hop count of 1. First, configure the routing table in the switch to “steer” the next maintenance packet out Port 0. There are two ways to configure a switch’s routing table, Standard and Optional Proprietary methods. The standard interface allows one to specify the output port number for any given Destination ID in one global lookup table. There are a number of other details associated with routing tables such as default port for non-programmed entries. In this example, the entire routing table is not ready to configure as the entire system has not yet been discovered. Nonetheless, the next maintenance packets need to be forced out Port 0. Using a Destination ID of 0xFF, simply write an 0xFF into the Standard Route Configuration Destination ID Select CSR and an 0x0 into the Standard Route Configuration Port Select CSR. Again, look at the simplest form of routing table configuration so consult the User Manual for the switch that may be used for more advanced configuration requirements as they all offer different sets of advanced capabilities. Make sure to enter a route for the return path, back to the host being used to discover the system. If the Destination ID of the Host is zero, write a 0 into the Standard Route Configuration Destination ID Select CSR and a 1 (because the switch on Port 1 was entered) into the Standard Route Configuration Port Select CSR. Before leaving the switch, Discover what the width of the link is by using the Serial Port x Control CSR. Here, many devices can also discover the link speed. Both of these parameters are useful when trying to determine Throughput and Congestion. Now the routing table is configured to allow the maintenance packet to traverse the switch if the Destination ID of 0xFF and a Hop Count of 0x1 are used. At this point, consider issuing the maintenance packet and attempt to read the Processing Element Features CAR in whatever device that may be connected to Port 0. If nothing is connected to it a bus timeout will occur after a period of time as no response to the read request arrives. This approach will slow down the Discovery process due to cumulative timeout delays, causing appreciable delays for large systems with many 16-port switches. To make it more time efficient, before issuing any maintenance transactions out port 0, read the Serial Port 0 Error and Status (CSR) and determine if the port has trained. This could save costly bus timeouts and shorten system configuration time considerably. Presuming the port is trained, issue the maintenance packet read to the Processing Element Features CAR in whatever device may be connected out Port 0. It is an Endpoint, and as with any PE discovered, the test described earlier should be repeated to see if another host has locked the PE and already discovered it. Assuming one has not, lock the PE and set the Discovered bit. Now enumerate it and initialize or configure certain capabilities within it. The next step is to explore out of the next port of the switch. Simply overwrite the routing table entry of 0xFF to Port 0 with 0xFF to Port 2. Remember, the switch came in on Port 1, so the next Port to explore in the sequence is Port 2. The Discovery algorithm will want to track this. The return path route is the same as used for Port 0. In this process, keep track of the network topology as it is discovered. In some systems you will encounter multiple paths between PEs and many circular loops in full mesh systems. The Discovery algorithm will need to detect when the revisited parts of a network have already discovered and where in the existing known network map it happened to reconnecting to. The next step is enumeration which will be discussed in the next newsletter. To hear the related podcast, visit http://www.rapidio.org/wp/?p=25 |