ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

eBMC LED Management :: Create Associations between LED Groups and Inventory D-Bus objects #2306

Closed vishwabmc closed 3 years ago

vishwabmc commented 4 years ago

Today, we have these Inventory D-Bus objects in Wither spoon for example: ...............

        ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
        ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
        ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm8
        ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm9
        ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1

Also, we have these LED Group D-Bus objects that put the Fault and Identify for these FRUs.

    ├─/xyz/openbmc_project/led/groups/cpu0_fault
    ├─/xyz/openbmc_project/led/groups/cpu1_fault
    ├─/xyz/openbmc_project/led/groups/fan2_fault
    ├─/xyz/openbmc_project/led/groups/fan0_fault

What the caller is doing today :

Take the FRU name from : ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1

That is "cpu1". To that, they are adding "cpu1_fault" and making a call to /xyz/openbmc_project/led/groups/cpu1_fault

Instead of this, the idea is to have an association between

├─/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 --> /xyz/openbmc_project/led/groups/cpu1_fault

Doing this will eliminate the logic of going by the names.

For now: We shall do for these FRUs in Witherspoon. We can then with little modification, achieve this for other systems since they are just JSON configs.

Reference : https://github.com/openbmc/meta-ibm/blob/master/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json

vishwabmc commented 4 years ago

We need associations for more groups. But then once the infrastructure is setup, it would be a matter of adding in more data into JSON.

lxwinspur commented 4 years ago

@vishwabmc According to my understanding, we only need to add some data to JSON to realize the Association between LED Group and Inventory D-BUS objects. In phosphor-inventory-manager: I don't think we need to modify any code. Because all related data will be added to the following interface. https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Association/Definitions.interface.yaml. But I don't know how to use this interface in the future? Please correct me if I am wrong, thanks.

vishwabmc commented 4 years ago

@lxwinspur Yes.. I think so. Have you looked at : https://github.com/openbmc/meta-ibm/blob/master/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json

if you can make one update and see if the association comes up, we can then verify

vishwabmc commented 4 years ago

This is system specific and hence can not be a common code.. Each implementations can define the associations and put into /usr/share/

vishwabmc commented 4 years ago

2 Associations will be created.

fType: fault_led_group and fType: identify_led_group

rType=fru for both

vishwabmc commented 3 years ago

It's merged now.. https://github.com/openbmc/openbmc/tree/master/meta-ibm/recipes-phosphor/inventory/phosphor-inventory-manager/rainier