1*d1312fcaSShawn McCarney# chassis_template 2*d1312fcaSShawn McCarney 3*d1312fcaSShawn McCarney## Description 4*d1312fcaSShawn McCarney 5*d1312fcaSShawn McCarneyChassis templates are used to avoid duplicate data. 6*d1312fcaSShawn McCarney 7*d1312fcaSShawn McCarneyIn a multiple chassis system, two or more of the [chassis](chassis.md) may have 8*d1312fcaSShawn McCarneythe same hardware design. The corresponding chassis objects in the config file 9*d1312fcaSShawn McCarneywould be almost identical with a few minor property value differences. 10*d1312fcaSShawn McCarney 11*d1312fcaSShawn McCarneyA chassis template defines the power sequencers, GPIOs, and voltage rails in a 12*d1312fcaSShawn McCarneychassis. One or more property values in the template contain variables, such as 13*d1312fcaSShawn McCarney`${chassis_number}`, to support chassis-specific values. 14*d1312fcaSShawn McCarney 15*d1312fcaSShawn McCarneyMultiple chassis can use the template rather than duplicating the information. 16*d1312fcaSShawn McCarneyThe individual chassis specify values for the template variables, such as 17*d1312fcaSShawn McCarneysetting `${chassis_number}` to "1" or "2". 18*d1312fcaSShawn McCarney 19*d1312fcaSShawn McCarney### Template Variables 20*d1312fcaSShawn McCarney 21*d1312fcaSShawn McCarneyVariables are specified in property values of a chassis template. This includes 22*d1312fcaSShawn McCarneythe properties of contained sub-objects like 23*d1312fcaSShawn McCarney[power_sequencers](power_sequencer.md) or [rails](rail.md). 24*d1312fcaSShawn McCarney 25*d1312fcaSShawn McCarneyThe syntax to specify a variable is `${variable_name}`. 26*d1312fcaSShawn McCarney 27*d1312fcaSShawn McCarneyVariable names can only contain letters (A-Z, a-z), numbers (0-9), and 28*d1312fcaSShawn McCarneyunderscores (\_). 29*d1312fcaSShawn McCarney 30*d1312fcaSShawn McCarneyVariables can be specified as the entire property value or as part of the 31*d1312fcaSShawn McCarneyproperty value: 32*d1312fcaSShawn McCarney 33*d1312fcaSShawn McCarney```json 34*d1312fcaSShawn McCarney"number": "${chassis_number}", 35*d1312fcaSShawn McCarney"power_good_gpio_name": "power-chassis${chassis_number}-good", 36*d1312fcaSShawn McCarney``` 37*d1312fcaSShawn McCarney 38*d1312fcaSShawn McCarneyVariables are supported for the property types string, number, and boolean. 39*d1312fcaSShawn McCarney 40*d1312fcaSShawn McCarneyVariables must be specified within a string value (surrounded by double quotes). 41*d1312fcaSShawn McCarneyIf the property type is number or boolean, the string will be converted to the 42*d1312fcaSShawn McCarneyrequired type. 43*d1312fcaSShawn McCarney 44*d1312fcaSShawn McCarney## Properties 45*d1312fcaSShawn McCarney 46*d1312fcaSShawn McCarney| Name | Required | Type | Description | 47*d1312fcaSShawn McCarney| :--------------- | :------: | :---------------------------------------------- | :------------------------------------------------------------------------------------------------------------ | 48*d1312fcaSShawn McCarney| comments | no | array of strings | One or more comment lines describing this chassis template. | 49*d1312fcaSShawn McCarney| id | yes | string | Unique ID for this chassis template. Can only contain letters (A-Z, a-z), numbers (0-9), and underscore (\_). | 50*d1312fcaSShawn McCarney| number | yes | number | Chassis number within the system. Chassis numbers start at 1 because chassis 0 represents the entire system. | 51*d1312fcaSShawn McCarney| inventory_path | yes | string | D-Bus inventory path of the chassis, such as "/xyz/openbmc_project/inventory/system/chassis". | 52*d1312fcaSShawn McCarney| power_sequencers | yes | array of [power_sequencers](power_sequencer.md) | One or more power sequencer devices within the chassis. | 53*d1312fcaSShawn McCarney 54*d1312fcaSShawn McCarney## Example 55*d1312fcaSShawn McCarney 56*d1312fcaSShawn McCarney```json 57*d1312fcaSShawn McCarney{ 58*d1312fcaSShawn McCarney "id": "standard_chassis_template", 59*d1312fcaSShawn McCarney "number": "${chassis_number}", 60*d1312fcaSShawn McCarney "inventory_path": "/xyz/openbmc_project/inventory/system/chassis${chassis_number}", 61*d1312fcaSShawn McCarney "power_sequencers": [ 62*d1312fcaSShawn McCarney { 63*d1312fcaSShawn McCarney "type": "UCD90320", 64*d1312fcaSShawn McCarney "i2c_interface": { "bus": "${sequencer_bus_number}", "address": "0x11" }, 65*d1312fcaSShawn McCarney "power_control_gpio_name": "power-chassis${chassis_number}-control", 66*d1312fcaSShawn McCarney "power_good_gpio_name": "power-chassis${chassis_number}-good", 67*d1312fcaSShawn McCarney "rails": [ 68*d1312fcaSShawn McCarney { 69*d1312fcaSShawn McCarney "name": "VDD_CPU0", 70*d1312fcaSShawn McCarney "page": 11, 71*d1312fcaSShawn McCarney "check_status_vout": true 72*d1312fcaSShawn McCarney }, 73*d1312fcaSShawn McCarney { 74*d1312fcaSShawn McCarney "name": "VCS_CPU1", 75*d1312fcaSShawn McCarney "presence": "/xyz/openbmc_project/inventory/system/chassis${chassis_number}/motherboard/cpu1", 76*d1312fcaSShawn McCarney "gpio": { "line": 60 } 77*d1312fcaSShawn McCarney } 78*d1312fcaSShawn McCarney ] 79*d1312fcaSShawn McCarney } 80*d1312fcaSShawn McCarney ] 81*d1312fcaSShawn McCarney} 82*d1312fcaSShawn McCarney``` 83