pldmfw: enable selected component update
JIRA: https://issues.redhat.com/browse/RHEL-75600 Upstream commit(s): commit d4679b79ffae994fea08bc7751ff6550ad057f05 Author: Konrad Knitter <konrad.knitter@intel.com> Date: Wed Nov 6 10:36:41 2024 +0100 pldmfw: enable selected component update This patch enables to update a selected component from PLDM image containing multiple components. Example usage: struct pldmfw; data.mode = PLDMFW_UPDATE_MODE_SINGLE_COMPONENT; data.compontent_identifier = DRIVER_FW_MGMT_COMPONENT_ID; Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Petr Oros <poros@redhat.com>
This commit is contained in:
parent
52a83746ef
commit
d01f5be893
|
@ -125,9 +125,17 @@ struct pldmfw_ops;
|
||||||
* a pointer to their own data, used to implement the device specific
|
* a pointer to their own data, used to implement the device specific
|
||||||
* operations.
|
* operations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
enum pldmfw_update_mode {
|
||||||
|
PLDMFW_UPDATE_MODE_FULL,
|
||||||
|
PLDMFW_UPDATE_MODE_SINGLE_COMPONENT,
|
||||||
|
};
|
||||||
|
|
||||||
struct pldmfw {
|
struct pldmfw {
|
||||||
const struct pldmfw_ops *ops;
|
const struct pldmfw_ops *ops;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
u16 component_identifier;
|
||||||
|
enum pldmfw_update_mode mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool pldmfw_op_pci_match_record(struct pldmfw *context, struct pldmfw_record *record);
|
bool pldmfw_op_pci_match_record(struct pldmfw *context, struct pldmfw_record *record);
|
||||||
|
|
|
@ -481,9 +481,17 @@ static int pldm_parse_components(struct pldmfw_priv *data)
|
||||||
component->component_data = data->fw->data + offset;
|
component->component_data = data->fw->data + offset;
|
||||||
component->component_size = size;
|
component->component_size = size;
|
||||||
|
|
||||||
|
if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
|
||||||
|
data->context->component_identifier != component->identifier)
|
||||||
|
continue;
|
||||||
|
|
||||||
list_add_tail(&component->entry, &data->components);
|
list_add_tail(&component->entry, &data->components);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
|
||||||
|
list_empty(&data->components))
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
header_crc_ptr = data->fw->data + data->offset;
|
header_crc_ptr = data->fw->data + data->offset;
|
||||||
|
|
||||||
err = pldm_move_fw_offset(data, sizeof(data->header_crc));
|
err = pldm_move_fw_offset(data, sizeof(data->header_crc));
|
||||||
|
|
Loading…
Reference in New Issue