diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2014-11-19 13:53:27 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-11-25 01:37:38 +0100 |
commit | 81188ef870ead9121d66287eb2ced28a25a1e8d4 (patch) | |
tree | de7f78d7675804365bcf3f7701746387d8d73f8c /platform-intel.c | |
parent | imsm: support for OROMs shared by multiple HBAs (diff) | |
download | mdadm-81188ef870ead9121d66287eb2ced28a25a1e8d4.tar.xz mdadm-81188ef870ead9121d66287eb2ced28a25a1e8d4.zip |
imsm: support for second and combined AHCI controllers in UEFI mode
Grantly platform introduces a second AHCI controller (sSATA) and two new
UEFI variables for the RSTe firmware. This patch adds support for those
variables in order to correctly determine IMSM platform capabilities in
UEFI mode.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'platform-intel.c')
-rw-r--r-- | platform-intel.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/platform-intel.c b/platform-intel.c index f779d021..c5a0aa4e 100644 --- a/platform-intel.c +++ b/platform-intel.c @@ -401,6 +401,8 @@ static const struct imsm_orom *find_imsm_hba_orom(struct sys_dev *hba) #define SYS_EFI_VAR_PATH "/sys/firmware/efi/vars" #define SCU_PROP "RstScuV" #define AHCI_PROP "RstSataV" +#define AHCI_SSATA_PROP "RstsSatV" +#define AHCI_CSATA_PROP "RstCSatV" #define VENDOR_GUID \ EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, 0x1a, 0x04, 0xc6) @@ -455,6 +457,7 @@ const struct imsm_orom *find_imsm_efi(struct sys_dev *hba) { struct imsm_orom orom; const struct imsm_orom *ret; + int err; if (check_env("IMSM_TEST_AHCI_EFI") || check_env("IMSM_TEST_SCU_EFI")) return imsm_platform_test(hba); @@ -466,7 +469,26 @@ const struct imsm_orom *find_imsm_efi(struct sys_dev *hba) if (hba->type == SYS_DEV_SATA && hba->class != PCI_CLASS_RAID_CNTRL) return NULL; - if (read_efi_variable(&orom, sizeof(orom), hba->type == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID)) + err = read_efi_variable(&orom, sizeof(orom), hba->type == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID); + + /* try to read variable for second AHCI controller */ + if (err && hba->type == SYS_DEV_SATA) + err = read_efi_variable(&orom, sizeof(orom), AHCI_SSATA_PROP, VENDOR_GUID); + + /* try to read variable for combined AHCI controllers */ + if (err && hba->type == SYS_DEV_SATA) { + static const struct imsm_orom *csata; + + err = read_efi_variable(&orom, sizeof(orom), AHCI_CSATA_PROP, VENDOR_GUID); + if (!err) { + if (!csata) + csata = add_orom(&orom); + add_orom_device_id(csata, hba->dev_id); + return csata; + } + } + + if (err) return NULL; ret = add_orom(&orom); |