All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Qiu <xqiu@google.com>
To: James Feist <james.feist@linux.intel.com>
Cc: Milton Miller II <miltonm@us.ibm.com>,
	Peter Lundgren <peterlundgren@google.com>,
	 OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Kais Belgaied <belgaied@google.com>,
	Devjit Gopalpur <devjitg@google.com>
Subject: Re: Configuring device with I2C mux
Date: Thu, 9 Jan 2020 17:46:48 -0800	[thread overview]
Message-ID: <CAA_a9x+s5Gm4eS2q5it9o+PUoV9+EuyPS=RrWoHkq_15yB+2jQ@mail.gmail.com> (raw)
In-Reply-To: <CAA_a9xKa1VpvhfJVdvt_OqJ7in5Ntiowqmdpq_J1okYX8xq1yQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]

Hi folks,

Thanks for your responses! We managed to configure them by setting up the
device tree, fixing the child buses to numbers related to the parent buses,
so that we could address them using simple arithmetic operations in JSON
config files.

- Alex Qiu


On Wed, Jan 8, 2020 at 10:06 AM Alex Qiu <xqiu@google.com> wrote:

> Hi James,
>
> I'll take a look at them. Thanks for pointing the related code out!
>
> - Alex Qiu
>
>
> On Wed, Jan 8, 2020 at 10:02 AM James Feist <james.feist@linux.intel.com>
> wrote:
>
>> On 1/8/20 9:54 AM, Alex Qiu wrote:
>> > Hi James,
>> >
>> > Yes, we have multiple devices sitting behind the mux, and they're
>> > onboard devices instead of standalone FRUs. The parent bus is described
>> > as the FRU for each PCIe card.
>> >
>> > After naming the mux channels, can these names be used somehow to
>> config
>> > I2C devices? For example, {"Bus": "$bus", "ChannelNames":
>> > ["C0", "C1", "C2", "C3"]} for the mux, and {"Bus": "$bus.C1"} for
>> > devices behind the mux on channel 1.
>>
>> This syntax doesn't exist today.. On all our systems things behind the
>> mux are again detectable, so we haven't hit this problem. Right now the
>> template replacement is purely based on the found device on d-bus. So
>> $bus is the bus property from the xyz.openbmc_project.FruDevice
>> interface, there's no way to trace that to a mux channel, as it's just a
>> d-bus property.
>>
>> The code you're looking for is here:
>>
>> https://github.com/openbmc/entity-manager/blob/01542d2af1b1f45335cc8813fffcd3ed07f22989/src/Utils.cpp#L144
>>
>>
>> Along with the channel identification logic here:
>>
>> https://github.com/openbmc/entity-manager/blob/01542d2af1b1f45335cc8813fffcd3ed07f22989/src/Overlay.cpp#L112
>>
>> You could probably add some special syntax to make this work. Luckily
>> this is the one part of entity-manager that is unit-tested, so that
>> should help you
>>
>> https://github.com/openbmc/entity-manager/blob/master/test/test_entity-manager.cpp
>>
>>
>> -James
>>
>>
>>
>>
>>

[-- Attachment #2: Type: text/html, Size: 3535 bytes --]

      reply	other threads:[~2020-01-10  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08  1:13 Configuring device with I2C mux Alex Qiu
2020-01-08 14:43 ` Milton Miller II
2020-01-08 17:25   ` Alex Qiu
2020-01-08 17:46     ` James Feist
2020-01-08 17:54       ` Alex Qiu
2020-01-08 18:02         ` James Feist
2020-01-08 18:06           ` Alex Qiu
2020-01-10  1:46             ` Alex Qiu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA_a9x+s5Gm4eS2q5it9o+PUoV9+EuyPS=RrWoHkq_15yB+2jQ@mail.gmail.com' \
    --to=xqiu@google.com \
    --cc=belgaied@google.com \
    --cc=devjitg@google.com \
    --cc=james.feist@linux.intel.com \
    --cc=miltonm@us.ibm.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=peterlundgren@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.