--- /dev/null
+/** @file\r
+\r
+ Macros and type definitions for LSI 53C895A SCSI devices.\r
+\r
+ Copyright (C) 2020, SUSE LLC.\r
+\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _LSI_SCSI_H_\r
+#define _LSI_SCSI_H_\r
+\r
+//\r
+// Device ID\r
+//\r
+#define LSI_LOGIC_PCI_VENDOR_ID 0x1000\r
+#define LSI_53C895A_PCI_DEVICE_ID 0x0012\r
+\r
+#endif // _LSI_SCSI_H_\r
\r
**/\r
\r
+#include <IndustryStandard/LsiScsi.h>\r
+#include <IndustryStandard/Pci.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiLib.h>\r
+#include <Protocol/PciIo.h>\r
+#include <Protocol/PciRootBridgeIo.h>\r
#include <Uefi/UefiSpec.h>\r
\r
#include "LsiScsi.h"\r
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
)\r
{\r
- return EFI_UNSUPPORTED;\r
+ EFI_STATUS Status;\r
+ EFI_PCI_IO_PROTOCOL *PciIo;\r
+ PCI_TYPE00 Pci;\r
+\r
+ Status = gBS->OpenProtocol (\r
+ ControllerHandle,\r
+ &gEfiPciIoProtocolGuid,\r
+ (VOID **)&PciIo,\r
+ This->DriverBindingHandle,\r
+ ControllerHandle,\r
+ EFI_OPEN_PROTOCOL_BY_DRIVER\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ Status = PciIo->Pci.Read (\r
+ PciIo,\r
+ EfiPciIoWidthUint32,\r
+ 0,\r
+ sizeof (Pci) / sizeof (UINT32),\r
+ &Pci\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto Done;\r
+ }\r
+\r
+ if (Pci.Hdr.VendorId == LSI_LOGIC_PCI_VENDOR_ID &&\r
+ Pci.Hdr.DeviceId == LSI_53C895A_PCI_DEVICE_ID) {\r
+ Status = EFI_SUCCESS;\r
+ } else {\r
+ Status = EFI_UNSUPPORTED;\r
+ }\r
+\r
+Done:\r
+ gBS->CloseProtocol (\r
+ ControllerHandle,\r
+ &gEfiPciIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ ControllerHandle\r
+ );\r
+ return Status;\r
}\r
\r
EFI_STATUS\r