diff options
author | Marcin Wojtas <mw@semihalf.com> | 2017-10-31 11:19:03 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-11-07 17:20:04 +0000 |
commit | f1d5a87036234d529c20841bd4776d1000b937c1 (patch) | |
tree | da17b54da5fa4574b10fdf781c1c8cb485a5c903 /Platform/Marvell/Include/Protocol | |
parent | 822f314f2c29a589ebde99ea4a10a4e0f84cbd50 (diff) | |
download | edk2-platforms-f1d5a87036234d529c20841bd4776d1000b937c1.tar.xz |
Marvell/Drivers: MvSpiFlash: Enable dynamic SPI Flash detection
Hitherto mechanism of fixing SPI flash model in the PCDs,
occured to be very inefficient and problematic. Enable
dynamic detection by reworking MvSpiFlashReadId() command,
which now uses newly added NorFlashInfoLib, that helps to
obtain description of the JEDEC compliant devices.
This patch updates the MvSpiFlashProtocol ReadId() protocol
callback on both producer's (MvFlashDxe) and consumers' sides
(FirmwareUpdate and SpiTool applications). Because all
information about detected SPI NOR flash is now stored in
the obtained NorFlashInfo structure fields, use them instead
of the PCDs.
Enable compilation of the NorFlashInfoLib and update
PortingGuide documentation accordingly.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Platform/Marvell/Include/Protocol')
-rw-r--r-- | Platform/Marvell/Include/Protocol/Spi.h | 4 | ||||
-rw-r--r-- | Platform/Marvell/Include/Protocol/SpiFlash.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Platform/Marvell/Include/Protocol/Spi.h b/Platform/Marvell/Include/Protocol/Spi.h index ae78a31ca0..6f26a36b5a 100644 --- a/Platform/Marvell/Include/Protocol/Spi.h +++ b/Platform/Marvell/Include/Protocol/Spi.h @@ -34,6 +34,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef __MARVELL_SPI_MASTER_PROTOCOL_H__
#define __MARVELL_SPI_MASTER_PROTOCOL_H__
+#include <Library/NorFlashInfoLib.h>
+
extern EFI_GUID gMarvellSpiMasterProtocolGuid;
typedef struct _MARVELL_SPI_MASTER_PROTOCOL MARVELL_SPI_MASTER_PROTOCOL;
@@ -49,6 +51,8 @@ typedef struct { INTN Cs;
INTN MaxFreq;
SPI_MODE Mode;
+ UINT32 AddrSize;
+ NOR_FLASH_INFO *Info;
} SPI_DEVICE;
typedef
diff --git a/Platform/Marvell/Include/Protocol/SpiFlash.h b/Platform/Marvell/Include/Protocol/SpiFlash.h index f65a12d188..4a3053ec7e 100644 --- a/Platform/Marvell/Include/Protocol/SpiFlash.h +++ b/Platform/Marvell/Include/Protocol/SpiFlash.h @@ -47,8 +47,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define CMD_ERASE_64K 0xd8
#define CMD_4B_ADDR_ENABLE 0xb7
-#define NOR_FLASH_MAX_ID_LEN 6
-
extern EFI_GUID gMarvellSpiFlashProtocolGuid;
typedef struct _MARVELL_SPI_FLASH_PROTOCOL MARVELL_SPI_FLASH_PROTOCOL;
@@ -64,8 +62,7 @@ typedef EFI_STATUS
(EFIAPI *MV_SPI_FLASH_READ_ID) (
IN SPI_DEVICE *SpiDev,
- IN UINT32 DataByteCount,
- IN OUT UINT8 *Buffer
+ IN BOOLEAN UseInRuntime
);
typedef
|