diff options
author | Guo Mang <mang.guo@intel.com> | 2017-11-16 17:04:15 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-12-05 16:35:49 +0800 |
commit | 0174e9469377daf45ccc081a46032b91fa9f6205 (patch) | |
tree | 9c52cee9c700796858dbff03226316c1fc0cec2d /Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library | |
parent | 779af71cf7bd82c43f4da13de8b72dac032b112c (diff) | |
download | edk2-platforms-0174e9469377daf45ccc081a46032b91fa9f6205.tar.xz |
Spi driver change
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library')
-rw-r--r-- | Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library/BaseScSpiCommonLib/SpiCommon.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library/BaseScSpiCommonLib/SpiCommon.c b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library/BaseScSpiCommonLib/SpiCommon.c index 97a13fa0d7..722f297309 100644 --- a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library/BaseScSpiCommonLib/SpiCommon.c +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Library/BaseScSpiCommonLib/SpiCommon.c @@ -601,6 +601,7 @@ SendSpiCmd ( UINT8 BiosCtlSave;
UINT32 SmiEnSave;
UINT16 ABase;
+ UINT32 HsfstsCtl;
Status = EFI_SUCCESS;
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);
@@ -653,6 +654,15 @@ SendSpiCmd ( goto SendSpiCmdEnd;
}
+
+ if (FlashCycleType == FlashCycleWriteStatus) {
+ HsfstsCtl = MmioRead32 (ScSpiBar0 + R_SPI_HSFS);
+ if ((HsfstsCtl & B_SPI_HSFS_WRSDIS) != 0) {
+ Status = EFI_ACCESS_DENIED;
+ goto SendSpiCmdEnd;
+ }
+ }
+
HardwareSpiAddr = Address;
if ((FlashCycleType == FlashCycleRead) ||
(FlashCycleType == FlashCycleWrite) ||
|