History log of /openbmc/pldm/pldmtool/pldm_fru_cmd.cpp (Results 1 – 13 of 13)
Revision Date Author Comments
# 06f9b29e 31-Mar-2024 Sagar Srinivas <sagar.srinivas@ibm.com>

Use std::map.contains as per latest c++

This commit replaces occurrences of 'find' with
'contains' to access elements in a std::map
according to the latest C++ standard (since C++20).

However, cont

Use std::map.contains as per latest c++

This commit replaces occurrences of 'find' with
'contains' to access elements in a std::map
according to the latest C++ standard (since C++20).

However, contains() is not suitable in all situations
as in the case where we want to use the element contained
in the map using contains(), then it would do 2 searches
instead of 1 in the case where we use find() which fetches
the element from the map also.

Here are some relevant links to C++ documentation and
resources:

[1]: https://en.cppreference.com/w/cpp/container/map/find
[2]: https://en.cppreference.com/w/cpp/container/map/contains
[3]: https://wg21.link/N4861

Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: If589e52026417c1c14a6a946e48826b749034e9a

show more ...


# 21f128d8 14-Jan-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

pldm: Use modern libpldm OEM header paths

Fixed with:

```
sed -Ei 's/libpldm\/([a-z_]+)_oem_ibm\.h/libpldm\/oem\/ibm\/\1.h/' $(git ls-files)
sed -Ei 's/libpldm\/file_io.h/libpldm\/oem\/ibm\/file_io

pldm: Use modern libpldm OEM header paths

Fixed with:

```
sed -Ei 's/libpldm\/([a-z_]+)_oem_ibm\.h/libpldm\/oem\/ibm\/\1.h/' $(git ls-files)
sed -Ei 's/libpldm\/file_io.h/libpldm\/oem\/ibm\/file_io.h/' $(git ls-files)
sed -Ei 's/libpldm\/host.h/libpldm\/oem\/ibm\/host.h/' $(git ls-files)
```

Change-Id: Idbe61dcc53754d7e6005b34ae21bec8ab6ed45da
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


# a7dbca53 07-Jul-2023 Pavithra Barithaya <pavithra.b@ibm.com>

clang-error: fix clang-diagnostic-defaulted-function-deleted error

The clang-diagnostic-defaulted-function-deleted error is generated when
explicitly defaulted move assignment operator is implicitly

clang-error: fix clang-diagnostic-defaulted-function-deleted error

The clang-diagnostic-defaulted-function-deleted error is generated when
explicitly defaulted move assignment operator is implicitly deleted.
This commit fixes those errors.

Change-Id: I7a407dd3411b19a73a13b1c1e4805b89fc2ec51a
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>

show more ...


# 6da4f91b 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...


# 71689b8b 27-Apr-2023 Potin Lai <potin.lai@quantatw.com>

pldmtool: fix GetFruRecordTable request fail

1. Use PLDM_GET_FIRSTPART for TransferOperationFlag to fix request
failed due to CC code 0x81 (INVALID_TRANSFER_OPERATION_FLAG).
2. Move fruFieldValue

pldmtool: fix GetFruRecordTable request fail

1. Use PLDM_GET_FIRSTPART for TransferOperationFlag to fix request
failed due to CC code 0x81 (INVALID_TRANSFER_OPERATION_FLAG).
2. Move fruFieldValuestring() to else part to avoid IANA print issue.

Tested result:
```
[
[
{
"FRU Record Set Identifier": 1,
"FRU Record Type": "General(1)",
"Number of FRU fields": 11,
"Encoding Type for FRU fields": "ASCII(1)"
},

......

{
"FRU Field Type": "Vendor IANA(15)",
"FRU Field Length": 4,
"FRU Field Value": "33049"
}
]
]
```

Change-Id: I1a711ee05c49e35cb76c104ab9b11b5b1ac97118
Signed-off-by: Potin Lai <potin.lai@quantatw.com>

show more ...


# c453e164 21-Dec-2022 George Liu <liuxiwei@inspur.com>

libpldm: Correct reference to libpldm header files

When relying on header files from external libraries, #include<> should
be used instead of #include "" to avoid ambiguity.

Tested: Built pldm succ

libpldm: Correct reference to libpldm header files

When relying on header files from external libraries, #include<> should
be used instead of #include "" to avoid ambiguity.

Tested: Built pldm successfully after enabling ibm-oem

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ia1997de7e0f61564055bbd837f4e24c8f14e55a5

show more ...


# 27a022ca 10-Aug-2022 Andrew Jeffery <andrew@aj.id.au>

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organi

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organisation
of the source code to make it work as a subproject.

There are no .c/.h files changes in this commit, only meson
changes and re-organising the code structure.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I20a71c0c972b1fd81fb359d604433618799102c6

show more ...


# c50c6cd7 08-Jun-2021 Sridevi Ramesh <sridevra@in.ibm.com>

Fix for pldmtool GetFruRecordTable command with oem-ibm disabled.

Tested on BMC environment with oem-ibm enabled & disabled.

Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>

Fix for pldmtool GetFruRecordTable command with oem-ibm disabled.

Tested on BMC environment with oem-ibm enabled & disabled.

Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
Change-Id: Ie8b43f7ea55a4255b74a46250dc9d15ec5949cad

show more ...


# dd04990d 12-Aug-2020 Sridevi Ramesh <sridevra@in.ibm.com>

Display pldmtool Fru & oem-ibm command output in JSON

./pldmtool fru GetFruRecordTableMetadata
{
"FRU DATAStructureTableIntegrityChecksum": 3870816131,
"FRUDATAMajorVersi

Display pldmtool Fru & oem-ibm command output in JSON

./pldmtool fru GetFruRecordTableMetadata
{
"FRU DATAStructureTableIntegrityChecksum": 3870816131,
"FRUDATAMajorVersion": 1,
"FRUDATAMinorVersion": 0,
"FRUTableLength": 2005,
"FRUTableMaximumSize": 4294967295,
"Total number of Record Set Identifiers in table": 13,
"Total number of records in table": 33
}

./pldmtool oem-ibm GetAlertStatus -i 0x00
{
"pri cec node": "0x00008030",
"rack entry": "0xff000030"
}

./pldmtool oem-ibm GetFileTable
[
{
"FileHandle": "0",
"FileName": "PHYP-NVRAM",
"FileNameLength": 10,
"FileSize": 17870848,
"FileTraits": 1
},
{
"FileHandle": "1",
"FileName": "PHYP-NVRAM-CKSUM",
"FileNameLength": 16,
"FileSize": 16,
"FileTraits": 4
}
]

./pldmtool fru GetFruRecordTable
[
[
{
"FRU Record Set Identifier": 1,
"FRU Record Type": "General(1)",
"Number of FRU fields": 2,
"Encoding Type for FRU fields": "ASCII(1)"
},
{
"FRU Field Type": "Model(2)",
"FRU Field Length": 8,
"FRU Field Value": "9105-22A"
},
{
"FRU Field Type": "Serial Number(4)",
"FRU Field Length": 7,
"FRU Field Value": "SIMP10R"
}
],
...
...
...
...
...
[
{
"FRU Record Set Identifier": 13,
"FRU Record Type": "OEM(254)",
"Number of FRU fields": 1,
"Encoding Type for FRU fields": "ASCII(1)"
},
{
"FRU Field Type": "Location Code(254)",
"FRU Field Length": 24,
"FRU Field Value": "U78DA.ND1.1234567-P0-C23"
}
],
[
{
"FRU Record Set Identifier": 13,
"FRU Record Type": "General(1)",
"Number of FRU fields": 3,
"Encoding Type for FRU fields": "ASCII(1)"
},
{
"FRU Field Type": "Part Number(3)",
"FRU Field Length": 7,
"FRU Field Value": "PN12345"
},
{
"FRU Field Type": "Serial Number(4)",
"FRU Field Length": 12,
"FRU Field Value": "YL2E32010000"
},
{
"FRU Field Type": "Name(8)",
"FRU Field Length": 16,
"FRU Field Value": "CPU POWER CARD "
}
]
]

./pldmtool fru GetFRURecordByOption -i 3 -r 1 -f 3
[
[
{
"FRU Record Set Identifier": 3,
"FRU Record Type": "General(1)",
"Number of FRU fields": 1,
"Encoding Type for FRU fields": "ASCII(1)"
},
{
"FRU Field Type": "Part Number(3)",
"FRU Field Length": 7,
"FRU Field Value": "PN12345"
}
]
]

Change-Id: I1c5db56e5f336a0a1340ccd2ff8da5483a562cf8
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>

show more ...


# b8baffa3 22-Jul-2020 Sridevi Ramesh <sridevra@in.ibm.com>

pldmtool: Parse OEM IBM FRU records

./pldmtool fru GetFRURecordByOption -i 1 -r 254 -f 0
FRU Record Set Identifier: 1
FRU Record Type: OEM(254)
Number of FRU fields: 15
Encod

pldmtool: Parse OEM IBM FRU records

./pldmtool fru GetFRURecordByOption -i 1 -r 254 -f 0
FRU Record Set Identifier: 1
FRU Record Type: OEM(254)
Number of FRU fields: 15
Encoding Type for FRU fields: ASCII(1)
FRU Field Type: RT(2)
FRU Field Length: 4
FRU Field Value: VSYS
FRU Field Type: BR(3)
FRU Field Length: 2
FRU Field Value: 0x20 0x20
FRU Field Type: DR(4)
FRU Field Length: 6
FRU Field Value: 0x53 0x59 0x53 0x54 0x45 0x4d
FRU Field Type: FV(5)
FRU Field Length: 32
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: ID(6)
FRU Field Length: 2
FRU Field Value: 0x20 0x20
FRU Field Type: MN(7)
FRU Field Length: 7
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: NN(8)
FRU Field Length: 16
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: RB(9)
FRU Field Length: 4
FRU Field Value: 0x20 0x20 0x20 0x20
FRU Field Type: RG(10)
FRU Field Length: 4
FRU Field Value: 0x20 0x20 0x20 0x20
FRU Field Type: SE(11)
FRU Field Length: 7
FRU Field Value: 0x53 0x49 0x4d 0x50 0x31 0x30 0x52
FRU Field Type: SG(12)
FRU Field Length: 7
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: SU(13)
FRU Field Length: 6
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: TM(14)
FRU Field Length: 8
FRU Field Value: 0x39 0x31 0x30 0x35 0x2d 0x32 0x32 0x41
FRU Field Type: TN(15)
FRU Field Length: 8
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: WN(16)
FRU Field Length: 12
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Record Set Identifier: 1
FRU Record Type: OEM(254)
Number of FRU fields: 1
Encoding Type for FRU fields: ASCII(1)
FRU Field Type: Location Code(254)
FRU Field Length: 17
FRU Field Value: U9105.22A.SIMP10R
ecord Set Identifier: 1
FRU Record Type: OEM(254)
Number of FRU fields: 15
Encoding Type for FRU fields: ASCII(1)
FRU Field Type: RT(2)
FRU Field Length: 4
FRU Field Value: VSYS
FRU Field Type: BR(3)
FRU Field Length: 2
FRU Field Value: 0x20 0x20
FRU Field Type: DR(4)
FRU Field Length: 6
FRU Field Value: 0x53 0x59 0x53 0x54 0x45 0x4d
FRU Field Type: FV(5)
FRU Field Length: 32
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: ID(6)
FRU Field Length: 2
FRU Field Value: 0x20 0x20
FRU Field Type: MN(7)
FRU Field Length: 7
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: NN(8)
FRU Field Length: 16
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: RB(9)
FRU Field Length: 4
FRU Field Value: 0x20 0x20 0x20 0x20
FRU Field Type: RG(10)
FRU Field Length: 4
FRU Field Value: 0x20 0x20 0x20 0x20
FRU Field Type: SE(11)
FRU Field Length: 7
FRU Field Value: 0x53 0x49 0x4d 0x50 0x31 0x30 0x52
FRU Field Type: SG(12)
FRU Field Length: 7
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Length: 7
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: SU(13)
FRU Field Length: 6
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: TM(14)
FRU Field Length: 8
FRU Field Value: 0x39 0x31 0x30 0x35 0x2d 0x32 0x32 0x41
FRU Field Type: TN(15)
FRU Field Length: 8
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Field Type: WN(16)
FRU Field Length: 12
FRU Field Value: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
FRU Record Set Identifier: 1
FRU Record Type: OEM(254)
Number of FRU fields: 1
Encoding Type for FRU fields: ASCII(1)
FRU Field Type: Location Code(254)
FRU Field Length: 17
FRU Field Value: U9105.22A.SIMP10R

./pldmtool fru GetFRURecordByOption -i 2 -r 254 -f 254
FRU Record Set Identifier: 2
FRU Record Type: OEM(254)
Number of FRU fields: 1
Encoding Type for FRU fields: ASCII(1)
FRU Field Type: Location Code(254)
FRU Field Length: 17
FRU Field Value: U78DA.ND1.1234567

./pldmtool fru GetFRURecordByOption -i 0 -r 254 -f 4
terminate called after throwing an instance of 'std::invalid_argument'
what(): GetFRURecordByOption is not supported for recordType : 254 and fieldType > 2
Aborted (core dumped)

Change-Id: I8fdf60f25b18d0d02319460a0c212028a87f1c4b
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>

show more ...


# bd9440bd 24-Mar-2020 Sridevi Ramesh <sridevra@in.ibm.com>

pldmtool: Implement GetFRURecordTable.

Example output:

./pldmtool fru GetFruRecordTable
FRU Record Set Identifier: 1
FRU Record Type: 254(OEM)
Number of FRU fields: 1

pldmtool: Implement GetFRURecordTable.

Example output:

./pldmtool fru GetFruRecordTable
FRU Record Set Identifier: 1
FRU Record Type: 254(OEM)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 2
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: Model
FRU Field Length: 5
FRU Field Value: 1234A
FRU Field Type: Serial Number
FRU Field Length: 6
FRU Field Value: SNR123
FRU Record Set Identifier: 1
FRU Record Type: 254(OEM)
Number of FRU fields: 15
Encoding Type for FRU fields: 1(ASCII)
...

Change-Id: I470beb708ac0ad50da9bc74f1f26295c5529fac1
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>

show more ...


# 5bdde3a4 16-Jun-2020 John Wang <wangzqbj@inspur.com>

pldmtool: Implement GetFRURecordByOption

Implement GetFRURecordByOption

Tested:

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 0
...
FRU Record Set Identifier: 1

pldmtool: Implement GetFRURecordByOption

Implement GetFRURecordByOption

Tested:

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 0
...
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 5
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 3(Part Number)
FRU Field Length: 7
FRU Field Value: 02CY415
FRU Field Type: 4(Serial Number)
FRU Field Length: 12
FRU Field Value: YA1934319126
FRU Field Type: 5(Manufacturer)
FRU Field Length: 3
FRU Field Value: IBM
FRU Field Type: 8(Name)
FRU Field Length: 16
FRU Field Value: PROCESSOR MODULE
FRU Field Type: 10(Version)
FRU Field Length: 2
FRU Field Value: 22
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 4
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 2(Model)
FRU Field Length: 20
FRU Field Value: M393A2K43BB1-CTD
FRU Field Type: 4(Serial Number)
FRU Field Length: 10
FRU Field Value: 0x367f4d92
FRU Field Type: 5(Manufacturer)
FRU Field Length: 19
FRU Field Value: Samsung Electronics
FRU Field Type: 8(Name)
FRU Field Length: 32
FRU Field Value: DDR4-2666 16GiB 64-bit ECC RDIMM
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 12
FRU Field Value: powersupply0
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 12
FRU Field Value: powersupply1

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 8
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 16
FRU Field Value: PROCESSOR MODULE
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 32
FRU Field Value: DDR4-2666 16GiB 64-bit ECC RDIMM
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 12
FRU Field Value: powersupply0
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 8(Name)
FRU Field Length: 12
FRU Field Value: powersupply1

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 4
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 4(Serial Number)
FRU Field Length: 12
FRU Field Value: YA1934319126
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
FRU Field Type: 4(Serial Number)
FRU Field Length: 10
FRU Field Value: 0x367f4d92
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 0
Encoding Type for FRU fields: 1(ASCII)
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 0
Encoding Type for FRU fields: 1(ASCII)

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: Ia4bf6f938061dad69ab243704cfa9ac8da5fc80e

show more ...


# f7f5da97 17-Jun-2020 Deepak Kodihalli <dkodihal@in.ibm.com>

Rename tool/ as pldmtool/

Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: I38d7a6ab907014cd5fca049b095d692d069feab1