Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mpi3mr/mpi/mpi30_image.h
/* | /* | ||||
* SPDX-License-Identifier: BSD-2-Clause | * SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
* | * | ||||
* Copyright (c) 2016-2023, Broadcom Inc. All rights reserved. | * Copyright (c) 2016-2024, Broadcom Inc. All rights reserved. | ||||
* Support: <fbsd-storage-driver.pdl@broadcom.com> | * Support: <fbsd-storage-driver.pdl@broadcom.com> | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions are | * modification, are permitted provided that the following conditions are | ||||
* met: | * met: | ||||
* | * | ||||
* 1. Redistributions of source code must retain the above copyright notice, | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* this list of conditions and the following disclaimer. | * this list of conditions and the following disclaimer. | ||||
Show All 20 Lines | |||||
* those of the authors and should not be interpreted as representing | * those of the authors and should not be interpreted as representing | ||||
* official policies,either expressed or implied, of the FreeBSD Project. | * official policies,either expressed or implied, of the FreeBSD Project. | ||||
* | * | ||||
* Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131 | * Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131 | ||||
* | * | ||||
* Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD | * Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD | ||||
* | * | ||||
*/ | */ | ||||
#ifndef MPI30_IMAGE_H | #ifndef MPI30_IMAGE_H | ||||
#define MPI30_IMAGE_H 1 | #define MPI30_IMAGE_H 1 | ||||
/* Component Image Version */ | /* Component Image Version */ | ||||
typedef struct _MPI3_COMP_IMAGE_VERSION | typedef struct _MPI3_COMP_IMAGE_VERSION | ||||
{ | { | ||||
U16 BuildNum; /* 0x00 */ | U16 BuildNum; /* 0x00 */ | ||||
U16 CustomerID; /* 0x02 */ | U16 CustomerID; /* 0x02 */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_SPD (0x20445053) /* string "SPD " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_SPD (0x20445053) /* string "SPD " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_GAS_GAUGE (0x20534147) /* string "GAS " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_GAS_GAUGE (0x20534147) /* string "GAS " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_PBLP (0x504C4250) /* string "PBLP" */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_PBLP (0x504C4250) /* string "PBLP" */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_MANIFEST (0x464E414D) /* string "MANF" */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_MANIFEST (0x464E414D) /* string "MANF" */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_OEM (0x204D454F) /* string "OEM " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_OEM (0x204D454F) /* string "OEM " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_RMC (0x20434D52) /* string "RMC " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_RMC (0x20434D52) /* string "RMC " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_SMM (0x204D4D53) /* string "SMM " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_SMM (0x204D4D53) /* string "SMM " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_PSW (0x20575350) /* string "PSW " */ | #define MPI3_IMAGE_HEADER_SIGNATURE1_PSW (0x20575350) /* string "PSW " */ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE1_CSW (0x20575343) /* string "CSW " */ | |||||
/**** Definitions for Signature2 field ****/ | /**** Definitions for Signature2 field ****/ | ||||
#define MPI3_IMAGE_HEADER_SIGNATURE2_VALUE (0x50584546) | #define MPI3_IMAGE_HEADER_SIGNATURE2_VALUE (0x50584546) | ||||
/**** Definitions for Flags field ****/ | /**** Definitions for Flags field ****/ | ||||
#define MPI3_IMAGE_HEADER_FLAGS_SIGNED_UEFI_MASK (0x00000300) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_SIGNED_UEFI_UNSPECIFIED (0x00000000) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_SIGNED_UEFI_NOT_SIGNED (0x00000100) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_SIGNED_UEFI_MICROSOFT_SIGNED (0x00000200) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_CERT_CHAIN_FORMAT_MASK (0x000000C0) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_CERT_CHAIN_FORMAT_DEVICE_CERT (0x00000000) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_CERT_CHAIN_FORMAT_ALIAS_CERT (0x00000040) | |||||
#define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_MASK (0x00000030) | #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_MASK (0x00000030) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_CDI (0x00000000) | #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_CDI (0x00000000) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_DI (0x00000010) | #define MPI3_IMAGE_HEADER_FLAGS_DEVICE_KEY_BASIS_DI (0x00000010) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_SIGNED_NVDATA (0x00000008) | #define MPI3_IMAGE_HEADER_FLAGS_SIGNED_NVDATA (0x00000008) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_REQUIRES_ACTIVATION (0x00000004) | #define MPI3_IMAGE_HEADER_FLAGS_REQUIRES_ACTIVATION (0x00000004) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_COMPRESSED (0x00000002) | #define MPI3_IMAGE_HEADER_FLAGS_COMPRESSED (0x00000002) | ||||
#define MPI3_IMAGE_HEADER_FLAGS_FLASH (0x00000001) | #define MPI3_IMAGE_HEADER_FLAGS_FLASH (0x00000001) | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | typedef struct _MPI3_CI_MANIFEST_MPI | ||||
U32 DiagAuthorizationIdentifier[16]; /* 0x50 */ | U32 DiagAuthorizationIdentifier[16]; /* 0x50 */ | ||||
MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF ComponentImageRef[MPI3_CI_MANIFEST_MPI_MAX]; /* 0x90 */ /* variable length */ | MPI3_CI_MANIFEST_MPI_COMP_IMAGE_REF ComponentImageRef[MPI3_CI_MANIFEST_MPI_MAX]; /* 0x90 */ /* variable length */ | ||||
/* StringData - offset of this field must be calculated */ /* variable length */ | /* StringData - offset of this field must be calculated */ /* variable length */ | ||||
} MPI3_CI_MANIFEST_MPI, MPI3_POINTER PTR_MPI3_CI_MANIFEST_MPI, | } MPI3_CI_MANIFEST_MPI, MPI3_POINTER PTR_MPI3_CI_MANIFEST_MPI, | ||||
Mpi3CIManifestMpi_t, MPI3_POINTER pMpi3CIManifestMpi_t; | Mpi3CIManifestMpi_t, MPI3_POINTER pMpi3CIManifestMpi_t; | ||||
/* defines for the ReleaseLevel field */ | /* defines for the ReleaseLevel field */ | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_DEV (0x00) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_DEV (0x00) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_PRE_PRODUCTION (0x08) | |||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_PREALPHA (0x10) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_PREALPHA (0x10) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_ALPHA (0x20) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_ALPHA (0x20) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_BETA (0x30) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_BETA (0x30) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_RC (0x40) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_RC (0x40) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_GCA (0x50) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_GCA (0x50) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_POINT (0x60) | #define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_POINT (0x60) | ||||
#define MPI3_CI_MANIFEST_MPI_RELEASE_LEVEL_DIAG (0xF0) | |||||
/* defines for the Flags field */ | /* defines for the Flags field */ | ||||
#define MPI3_CI_MANIFEST_MPI_FLAGS_DIAG_AUTHORIZATION (0x01) | #define MPI3_CI_MANIFEST_MPI_FLAGS_DIAG_AUTHORIZATION (0x01) | ||||
/* defines for the SubsystemID field */ | /* defines for the SubsystemID field */ | ||||
#define MPI3_CI_MANIFEST_MPI_SUBSYSTEMID_IGNORED (0xFFFF) | #define MPI3_CI_MANIFEST_MPI_SUBSYSTEMID_IGNORED (0xFFFF) | ||||
/* defines for the PackageVersionStringOffset field */ | /* defines for the PackageVersionStringOffset field */ | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | typedef struct _MPI3_SUPPORTED_DEVICES_DATA | ||||
U8 Reserved01; /* 0x01 */ | U8 Reserved01; /* 0x01 */ | ||||
U8 NumDevices; /* 0x02 */ | U8 NumDevices; /* 0x02 */ | ||||
U8 Reserved03; /* 0x03 */ | U8 Reserved03; /* 0x03 */ | ||||
U32 Reserved04; /* 0x04 */ | U32 Reserved04; /* 0x04 */ | ||||
MPI3_SUPPORTED_DEVICE SupportedDevice[MPI3_SUPPORTED_DEVICE_MAX]; /* 0x08 */ /* variable length */ | MPI3_SUPPORTED_DEVICE SupportedDevice[MPI3_SUPPORTED_DEVICE_MAX]; /* 0x08 */ /* variable length */ | ||||
} MPI3_SUPPORTED_DEVICES_DATA, MPI3_POINTER PTR_MPI3_SUPPORTED_DEVICES_DATA, | } MPI3_SUPPORTED_DEVICES_DATA, MPI3_POINTER PTR_MPI3_SUPPORTED_DEVICES_DATA, | ||||
Mpi3SupportedDevicesData_t, MPI3_POINTER pMpi3SupportedDevicesData_t; | Mpi3SupportedDevicesData_t, MPI3_POINTER pMpi3SupportedDevicesData_t; | ||||
#ifndef MPI3_ENCRYPTED_HASH_MAX | #ifndef MPI3_PUBLIC_KEY_MAX | ||||
#define MPI3_ENCRYPTED_HASH_MAX (1) | #define MPI3_PUBLIC_KEY_MAX (1) | ||||
#endif /* MPI3_ENCRYPTED_HASH_MAX */ | #endif /* MPI3_PUBLIC_KEY_MAX */ | ||||
/* Encrypted Hash Entry Format */ | /* Encrypted Hash Entry Format */ | ||||
typedef struct _MPI3_ENCRYPTED_HASH_ENTRY | typedef struct _MPI3_ENCRYPTED_HASH_ENTRY | ||||
{ | { | ||||
U8 HashImageType; /* 0x00 */ | U8 HashImageType; /* 0x00 */ | ||||
U8 HashAlgorithm; /* 0x01 */ | U8 HashAlgorithm; /* 0x01 */ | ||||
U8 EncryptionAlgorithm; /* 0x02 */ | U8 EncryptionAlgorithm; /* 0x02 */ | ||||
U8 Reserved03; /* 0x03 */ | U8 Reserved03; /* 0x03 */ | ||||
U32 Reserved04; /* 0x04 */ | U16 PublicKeySize; /* 0x04 */ | ||||
U32 EncryptedHash[MPI3_ENCRYPTED_HASH_MAX]; /* 0x08 */ /* variable length */ | U16 SignatureSize; /* 0x06 */ | ||||
U32 PublicKey[MPI3_PUBLIC_KEY_MAX]; /* 0x08 */ /* variable length */ | |||||
/* Signature - offset of this field must be calculated */ /* variable length */ | |||||
} MPI3_ENCRYPTED_HASH_ENTRY, MPI3_POINTER PTR_MPI3_ENCRYPTED_HASH_ENTRY, | } MPI3_ENCRYPTED_HASH_ENTRY, MPI3_POINTER PTR_MPI3_ENCRYPTED_HASH_ENTRY, | ||||
Mpi3EncryptedHashEntry_t, MPI3_POINTER pMpi3EncryptedHashEntry_t; | Mpi3EncryptedHashEntry_t, MPI3_POINTER pMpi3EncryptedHashEntry_t; | ||||
/* defines for the HashImageType field */ | /* defines for the HashImageType field */ | ||||
#define MPI3_HASH_IMAGE_TYPE_KEY_WITH_SIGNATURE (0x03) | #define MPI3_HASH_IMAGE_TYPE_KEY_WITH_SIGNATURE (0x03) | ||||
/* defines for the HashAlgorithm field */ | /* defines for the HashAlgorithm field */ | ||||
Show All 15 Lines | |||||
#define MPI3_ENCRYPTION_ALGORITHM_RSA512 (0x02) /* Obsolete */ | #define MPI3_ENCRYPTION_ALGORITHM_RSA512 (0x02) /* Obsolete */ | ||||
#define MPI3_ENCRYPTION_ALGORITHM_RSA1024 (0x03) /* Obsolete */ | #define MPI3_ENCRYPTION_ALGORITHM_RSA1024 (0x03) /* Obsolete */ | ||||
#define MPI3_ENCRYPTION_ALGORITHM_RSA2048 (0x04) | #define MPI3_ENCRYPTION_ALGORITHM_RSA2048 (0x04) | ||||
#define MPI3_ENCRYPTION_ALGORITHM_RSA4096 (0x05) | #define MPI3_ENCRYPTION_ALGORITHM_RSA4096 (0x05) | ||||
#define MPI3_ENCRYPTION_ALGORITHM_RSA3072 (0x06) | #define MPI3_ENCRYPTION_ALGORITHM_RSA3072 (0x06) | ||||
#define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P256 (0x07) /* NIST secp256r1 curve */ | #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P256 (0x07) /* NIST secp256r1 curve */ | ||||
#define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P384 (0x08) /* NIST secp384r1 curve */ | #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P384 (0x08) /* NIST secp384r1 curve */ | ||||
#define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P521 (0x09) /* NIST secp521r1 curve */ | #define MPI3_ENCRYPTION_ALGORITHM_ECDSA_P521 (0x09) /* NIST secp521r1 curve */ | ||||
#define MPI3_ENCRYPTION_ALGORITHM_LMS_HSS (0x0A) /* Leighton-Micali Signature (LMS) - | |||||
* Hierarchical Signature System (HSS) | |||||
#ifndef MPI3_PUBLIC_KEY_MAX | */ | ||||
#define MPI3_PUBLIC_KEY_MAX (1) | |||||
#endif /* MPI3_PUBLIC_KEY_MAX */ | |||||
/* Encrypted Key with Hash Entry Format */ | |||||
typedef struct _MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY | |||||
{ | |||||
U8 HashImageType; /* 0x00 */ | |||||
U8 HashAlgorithm; /* 0x01 */ | |||||
U8 EncryptionAlgorithm; /* 0x02 */ | |||||
U8 Reserved03; /* 0x03 */ | |||||
U32 Reserved04; /* 0x04 */ | |||||
U32 PublicKey[MPI3_PUBLIC_KEY_MAX]; /* 0x08 */ /* variable length */ | |||||
/* EncryptedHash - offset of this field must be calculated */ /* variable length */ | |||||
} MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY, MPI3_POINTER PTR_MPI3_ENCRYPTED_KEY_WITH_HASH_ENTRY, | |||||
Mpi3EncryptedKeyWithHashEntry_t, MPI3_POINTER pMpi3EncryptedKeyWithHashEntry_t; | |||||
#ifndef MPI3_ENCRYPTED_HASH_ENTRY_MAX | #ifndef MPI3_ENCRYPTED_HASH_ENTRY_MAX | ||||
#define MPI3_ENCRYPTED_HASH_ENTRY_MAX (1) | #define MPI3_ENCRYPTED_HASH_ENTRY_MAX (1) | ||||
#endif /* MPI3_ENCRYPTED_HASH_ENTRY_MAX */ | #endif /* MPI3_ENCRYPTED_HASH_ENTRY_MAX */ | ||||
/* Encrypted Hash Image Data */ | /* Encrypted Hash Image Data */ | ||||
typedef struct _MPI3_ENCRYPTED_HASH_DATA | typedef struct _MPI3_ENCRYPTED_HASH_DATA | ||||
{ | { | ||||
Show All 40 Lines |