<div dir="ltr"><div>Hello,</div><div><br></div><div dir="ltr">BMC has information in the device tree about which I2C bus goes to which PCIe slot.<div>(for example in arch/arm/boot/dts/aspeed-bmc-quanta-q71l.dts file)</div><div class="gmail-navLinks gmail-desktop gmail-style-scope gmail-gr-diff-view" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Roboto,-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";vertical-align:baseline;display:flex;white-space:nowrap;color:rgb(33,33,33)"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small;color:rgb(34,34,34)">&i2c2 {</span></div><div><div><span style="white-space:pre">     </span>status = "okay";</div><div><br></div><div><span style="white-space:pre">   </span>/* 0: PCIe Slot 2,</div><div><span style="white-space:pre">    </span> *    Slot 3,</div><div><span style="white-space:pre">       </span> *    Slot 6,</div><div><span style="white-space:pre">       </span> *    Slot 7</div><div><span style="white-space:pre">        </span> */</div><div><span style="white-space:pre">   </span>i2c-switch@74 {</div><div><span style="white-space:pre">               </span>compatible = "nxp,pca9546";</div><div><span style="white-space:pre">         </span>reg = <0x74>;</div><div><span style="white-space:pre">           </span>#address-cells = <1>;</div><div><span style="white-space:pre">           </span>#size-cells = <0>;</div><div><span style="white-space:pre">              </span>i2c-mux-idle-disconnect;  /* may use mux@77 next. */</div><div><br></div><div><span style="white-space:pre">                </span>i2c_pcie2: i2c@0 {</div><div><span style="white-space:pre">                    </span>#address-cells = <1>;</div><div><span style="white-space:pre">                   </span>#size-cells = <0>;</div><div><span style="white-space:pre">                      </span>reg = <0>;</div><div><span style="white-space:pre">              </span>};</div><div><br></div><div><span style="white-space:pre">           </span>i2c_pcie3: i2c@1 {</div><div><span style="white-space:pre">                    </span>#address-cells = <1>;</div><div><span style="white-space:pre">                   </span>#size-cells = <0>;</div><div><span style="white-space:pre">                      </span>reg = <1>;</div><div><span style="white-space:pre">              </span>};</div></div><div><br></div><div>}</div><div><br></div><div>I would like the host to get this information from the BMC firmware by sending a IPMI OEM command.</div><div><br></div><div>I would like to add an extra property in the device tree like:</div><div><br></div><div><div class="gmail-navLinks gmail-desktop gmail-style-scope gmail-gr-diff-view" style="font-size:13px;box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Roboto,-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";vertical-align:baseline;display:flex;white-space:nowrap;color:rgb(33,33,33)"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small;color:rgb(34,34,34)">&i2c2 {</span></div><div><div><span style="white-space:pre">        </span>status = "okay";</div><div><br></div><div><span style="white-space:pre">   </span>/* 0: PCIe Slot 2,</div><div><span style="white-space:pre">    </span> *    Slot 3,</div><div><span style="white-space:pre">      </span> *    Slot 6,</div><div><span style="white-space:pre">      </span> *    Slot 7</div><div><span style="white-space:pre">       </span> */</div><div><span style="white-space:pre">  </span>i2c-switch@74 {</div><div><span style="white-space:pre">               </span>compatible = "nxp,pca9546";</div><div><span style="white-space:pre">         </span>reg = <0x74>;</div><div><span style="white-space:pre">           </span>#address-cells = <1>;</div><div><span style="white-space:pre">           </span>#size-cells = <0>;</div><div><span style="white-space:pre">              </span>i2c-mux-idle-disconnect;  /* may use mux@77 next. */</div><div><br></div><div><span style="white-space:pre">                </span>i2c_pcie2: i2c@0 {</div><div><span style="white-space:pre">                    </span>#address-cells = <1>;</div><div><span style="white-space:pre">                   </span>#size-cells = <0>;</div><div><span style="white-space:pre">                      </span>reg = <0>;</div><div>                     <b>   slot = "PE2";</b></div><div><span style="white-space:pre">         </span>};</div><div><br></div><div><span style="white-space:pre">           </span>i2c_pcie3: i2c@1 {</div><div><span style="white-space:pre">                    </span>#address-cells = <1>;</div><div><span style="white-space:pre">                   </span>#size-cells = <0>;</div><div><span style="white-space:pre">                      </span>reg = <1>;</div><div>                        <b>slot = "PE3"</b></div><div><span style="white-space:pre">          </span>};</div></div><div><br></div><div>}</div></div><div>Whenever the host sends the IPMI OEM command to get the I2C bus/PCIe slot mapping info,</div><div>the BMC can parse through all the i2c devices under /sys/bus/i2c/ and find only the i2c devices which have a property called slot under of_node. The BMC can send then send the corresponding I2C bus number and the slot info as part of the IPMI command response.</div><div><br></div><div><br></div><div>Does anyone have any ideas/suggestions about this ?</div></div></div>