ChorusOS 5.0 Board Support Package Developer's Guide

BSP Hot Swap Support

The Compact PCI bus is an extension of the PCI bus which enables a board to be inserted or removed when the bus is powered up. The ENUM# signal is a specific bus signal which notifies of such an event. The support of hot swap in the BSP consists of the following:

The implementation of the BSP hot swap support in the ChorusOS operating system is across three levels of drivers:

The Hot Swap Controller is responsible for receiving and handling the ENUM# signal and providing a generic interface to manage the corresponding event/interrupt. Usually this driver is board specific.

The pciswap driver is generic and provides an interface for forwarding the PciSwap events to its client. Its role is to probe the PCI configuration space and to read the HS_CSR register (defined by the PICMG Hot Swap specification). Therefore, it detects which device has been inserted or is going to be removed, and notifies its client.

The PciswapEvents handlers are implemented in the CompactPCI bridge device driver. This driver is the client of the pciswap driver and uses its interface to manage the PciSwap events. The handler of the corresponding events are responsible for starting or stopping the child drivers.

Reference Implementation

This section contains a list of the reference boards for hot swap support and the corresponding drivers used in the implementation. More information on these can be found the corresponding man page in the 9DRV section:

CP1500

usparchsc(9DRV)

Hot Swap Controller

pciswap(9DRV)

PciSwap driver

dec2115x(9DRV)

PciSwap client

MCP750

gpiohsc(9DRV)

Hot Swap Controller

pciswap(9DRV)

PciSwap driver

dec2115x(9DRV)

PciSwap client

CPN5360

fpga(9DRV)

Hot Swap Controller

pciswap(9DRV)

PciSwap driver

dec2155x(9DRV)

PciSwap client

Porting Hot Swap

The pciswap driver is generic and may be used on any board. It provides a drv_probe() routine so there is no need to add a node in the device tree for this driver.

The following sections give more information on the drivers that may need to be written when porting to a new board.

Hot Swap Controller

In the ChorusOS operating system the following Hot Swap Controller drivers are provided (one reference board per target family):

As the Hot Swap Controller is supposed to attach a handler to the ENUM# interrupt, this driver is very board specific.

PCI Bridge PciSwapEvents Handlers

The following are implemented as PciSwap clients: dec2115x(9DRV), dec2155x(9DRV). If the compact PCI bridge of the new board is not one of these, the PciswapEvents handlers need to be implemented.

The Device Tree

A node for the Hot Swap Controller must be added in the device tree. The HSC_PROP_BUS_PATH property and its corresponding value must be added to this node. This property describes the bus from which the devices may be hot swapped.