Polling OpenBMC using IPMB

Vijay Khemka vijaykhemka at fb.com
Fri May 1 03:18:06 AEST 2020


Hi Konstantin,
Yes i2c-protocol was required if your ipmb device doesn’t support smbus command rather it supports raw i2c transaction. This patch was added in kernel to support.

Good that it is working for you.

Regards
-Vijay

From: Konstantin Klubnichkin <kitsok at yandex-team.ru>
Date: Thursday, April 30, 2020 at 1:47 AM
To: Vijay Khemka <vijaykhemka at fb.com>, "Bhat, Sumanth" <sumanth.bhat at intel.com>, "openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Subject: Re: Polling OpenBMC using IPMB

Hello, Vijay!

It works! It was "i2c-protocol" in DTS.

So step by step for further users:
1. Enable CONFIG_IPMB_DEVICE_INTERFACE=y in kernel config file;
2. Add device to DTS:
&i2c6 {
   bus-frequency = <100000>;
   aspeed,dma-buf-size = <4095>;
   aspeed,hw-timeout-ms = <300>;
   status = "okay";

   ina219 at 45 {
       compatible = "ti,ina219";
       reg = <0x45>;
       shunt-resistor = <250>
   };

   ipmb at 11 {
       compatible = "ipmb-dev";
       reg = <0x11>;
       i2c-protocol;
    };
};

Side note: in my case "i2c-protocol" was the root cause of incompatibility with controller
3. Change channel name in channel_config.json (part of phosphor-ipmi-config) to "Ipmb" from "IPMB".
Question: Should the number of channel in channel_config.json be the same as I2C bus number?
4. Change I2C bus number and addresses of BMC (OpenBMC, as in DTS but shifted left by one bit) and controller (again, shifted left by 1 bit) in ipmb-channels.json (part of phosphor-ipmi-ipmb) like this:
{
   "type": "ipmb",
   "slave-path": "/dev/ipmb-6",
   "bmc-addr": 34,
   "remote-addr": 108
}
Looks like that's all

Thank you!

30.04.2020, 00:30, "Vijay Khemka" <vijaykhemka at fb.com>:

Hi Konstantin,

If you define device through dts with register 0x11 then device should already be there and you don’t need to define this manually. Please check remote address  entry in case you see issues. I don’t think any controller issues at this time.



Regards

-Vijay



From: openbmc <openbmc-bounces+vijaykhemka=fb.com at lists.ozlabs.org<mailto:openbmc-bounces+vijaykhemka=fb.com at lists.ozlabs.org>> on behalf of Konstantin Klubnichkin <kitsok at yandex-team.ru<mailto:kitsok at yandex-team.ru>>
Date: Wednesday, April 29, 2020 at 8:09 AM
To: "Bhat, Sumanth" <sumanth.bhat at intel.com<mailto:sumanth.bhat at intel.com>>, "openbmc at lists.ozlabs.org<mailto:openbmc at lists.ozlabs.org>" <openbmc at lists.ozlabs.org<mailto:openbmc at lists.ozlabs.org>>
Subject: Re: Polling OpenBMC using IPMB



Hello, Sumanth!



Thank you for the reply, I've found that also it's necessary to

1. Compile ipmi_dev driver into kernel;

2. Rename channel in /usr/share/ipmi-providers/channel_config.json - it must be named "Ipmb", not "IPMB"

I'm confused with the addresses.

On the controller side I open slave device at 0x36 and expect BMC to appear at 0x10 (all in i2cdetect notation).

So I assume that in ipmb-channels.json must be the following:



"type": "ipmb",

"slave-path": "/dev/ipmb-6",

"bmc-addr": 34,

"remote-addr": 108



But ipmbbridged ignores this 34 (0x11 shifted left by 1 bit), instead it instantiates device at 0x10 and the re-instantiate it at what is commanded by some service. What service should it be?  updateSlaveAddrHandler is never called.



To override this I've manually changed 0x1010 to 0x1011 in sources and voila - I can now receive the requests from the controller, but it interprets ipmbbridged responses in a wrong manner.



I've added some debug (actually a lot of :)) to ipmbbridged, so it dumps what is sent via I2C. Here is the response:

=================================================================

bmcSlaveAddress=0x36 netfn=0x07 lun=0x00 cmd=0x01 cc=0x00

>>>> 17 6c 1e 76 36 0c 01 00 23 00 02 08 02 bf 3d 2b 00 00 00 ab 00 00 0d af

=================================================================

But the controller can't interpret it right:

=================================================================

ipmi-i2c 2-0011: IPMI message handler: BMC returned incorrect response, expected netfn 7 cmd 1, got netfn 7 cmd c

=================================================================



I'm not sure if it's a problem in controller's IPMB implementation, or it's the wrong addresses, but this controller works fine with other BMC over IPMB.

Could you please clarify what should be in bmc-addr and remote-addr in ipmb-channels.json?



Thank you!



29.04.2020, 13:05, "Bhat, Sumanth" <sumanth.bhat at intel.com<mailto:sumanth.bhat at intel.com>>:

Hi Konstantin,

   Ipmbbridge is the right service. Please override the https://github.com/openbmc/ipmbbridge/blob/master/ipmb-channels.json with the IPMB channel relevant on your board.



Thanks,

Sumanth



From: openbmc <openbmc-bounces+sumanth.bhat=intel.com at lists.ozlabs.org<mailto:openbmc-bounces+sumanth.bhat=intel.com at lists.ozlabs.org>> On Behalf Of Konstantin Klubnichkin
Sent: Wednesday, April 29, 2020 3:29 PM
To: openbmc at lists.ozlabs.org<mailto:openbmc at lists.ozlabs.org>
Subject: Polling OpenBMC using IPMB







Hello all!



I've got a Purley motherboard with one of the I2C buses going out from AST2500 to external controller.

It gets BMC data (sensors, MAC address, etc) by polling it with IPMB.



I'm trying to find out how to implement it in OpenBMC.

Is it ipmbbridge service used for this?



Thank you!

--

Best regards,

Konstantin Klubnichkin,

lead firmware engineer,

server hardware R&D group,

Yandex Moscow office.

tel: +7-903-510-33-33







--

Best regards,

Konstantin Klubnichkin,

lead firmware engineer,

server hardware R&D group,

Yandex Moscow office.

tel: +7-903-510-33-33




--
Best regards,
Konstantin Klubnichkin,
lead firmware engineer,
server hardware R&D group,
Yandex Moscow office.
tel: +7-903-510-33-33

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200430/037ab838/attachment-0001.htm>


More information about the openbmc mailing list