History log of /openbmc/entity-manager/src/topology.cpp (Results 1 – 5 of 5)
Revision Date Author Comments
# 5a80703c 03-Mar-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I71c8504caaa31ac43ae0f20c002ed081078e3f48
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I71c8504caaa31ac43ae0f20c002ed081078e3f48
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# b7077437 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Id49ad73c860533f4658c909e86d6dc8e1423efb4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# b02752f7 30-Nov-2023 Jeff Lin <JeffLin2@quantatw.com>

topology: Add powered_by topology

bmcweb already support the power supply command, refer to
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668

Use "PowerPort" to add the powered_by association for

topology: Add powered_by topology

bmcweb already support the power supply command, refer to
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668

Use "PowerPort" to add the powered_by association for upstream port, so
that the PowerSupplyCollection in redfish can get the power supply
information.

Tested:
Add the following config in mobo.json:
```
{
"Name": "Mobo Upstream Port",
"Type": "Mobo Upstream Port"
},
```
Add the following config in PSU.json:
```
{
"ConnectsToType": "Mobo Upstream Port",
"Name": "PSU $BUS Downstream Port",
"Type": "DownstreamPort",
"PowerPort": true
},
```
Result for association:
```
{
"type" : "as",
"data" : [
[
"/xyz/openbmc_project/inventory/system/board/PSU_1"
]
]
}
```
Result in bmcweb:
```
$ curl -s -k -H "X-Auth-Token: $token" http://${bmc}/redfish/v1/Chassis/Mobo | jq .Links.Contains
[
{
"@odata.id": "/redfish/v1/Chassis/PSU_1"
}
]
$ curl -k -H "X-Auth-Token: $token" http://${bmc}/redfish/v1/Chassis/Mobo/PowerSubsystem/PowerSupplies/PSU_1
{
"@odata.id": "/redfish/v1/Chassis/Mobo/PowerSubsystem/PowerSupplies/PSU_1",
"@odata.type": "#PowerSupply.v1_5_0.PowerSupply",
...
}
```

Run unitest for test_topology is PASSED.

Change-Id: Iad10e61417437a41628cf311cdd7893725a5dcde
Signed-off-by: Jeff Lin <JeffLin2@quantatw.com>

show more ...


# 6eb60972 14-Aug-2023 Matt Spinler <spinler@us.ibm.com>

phys-topology: Add late add/remove support

The current physical topology code doesn't yet support adding entities
late (in a different propertiesChangedCallback call) or removing an
entity because:

phys-topology: Add late add/remove support

The current physical topology code doesn't yet support adding entities
late (in a different propertiesChangedCallback call) or removing an
entity because:
- The Topology class is just scoped to postToDbus(), so when that is
called again later with new cards it has no concept of existing parent
cards so it will miss creating associations.

- There is nothing to tell the class when an entity is removed, so it
never attempts to remove the association for that entity.

- When the containing/contained_by association is created it doesn't use
the createInterface() function, so if that entity is removed later
that association interface will be left on D-Bus.

To add support for entity adds and removes, this commit will:
- Make the Topology class have a global scoped lifetime so it can
remember entity relationships.

- Now that Topology will outlive postToDbus() calls, pass the
getAssocs() method the list of boards being processed in the current
postToDbus() incantation so it will only return the new associations.

- Use the createInterface() method when creating the association. This
stores the interface in a map with the entity name so that when the
entity is removed the interface will be removed along with all the
other interfaces.

- When an entity is removed, only the board name is known. So pass the
board name into addBoard() so the Topology class knows it, and add a
Topology::remove() method and call it so it can remove the removed
path from all of the connector maps.

Tested:
- All of the containing/contained_by associations still show up on good
path.

- Added new unit tests to cover the new functionality.

- When a downstream entity is added after EM does its initial D-Bus
publish, the containing/contained_by association is now created.

- On an entity remove, there are no left over interfaces for the removed
entity on D-Bus.

- When the removed entity is added back, the association is put back in
place.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ie5daaca92c6d2e6e7abc408f3e67e948977581ef

show more ...


# f2f5b7ac 09-Sep-2022 Benjamin Fair <benjaminfair@google.com>

topology: add initial module

To use this module, add information about boards and their exposes
records and then request a map of what resulting associations should be
exposed on D-Bus.

Tested: Uni

topology: add initial module

To use this module, add information about boards and their exposes
records and then request a map of what resulting associations should be
exposed on D-Bus.

Tested: Unit tests pass

Signed-off-by: Benjamin Fair <benjaminfair@google.com>
Change-Id: I42cd79407ab476599f5010c11cc146a569694b24

show more ...