a4092flash: Fix detection and verification

This commit is contained in:
Stefan Reinauer 2025-07-10 13:28:01 -07:00
parent 9726dcb0e3
commit a3e881544c
2 changed files with 4 additions and 4 deletions

View File

@ -279,10 +279,10 @@ bool flash_init(UBYTE *manuf, UBYTE *devid, ULONG *base, UWORD *sectorSize) {
flash_unlock_sdp(); flash_unlock_sdp();
flash_command(CMD_ID_ENTRY); flash_command(CMD_ID_ENTRY);
// Read manufacturer ID from byte address 0 // Read manufacturer ID
manufId = flash_read_byte(0); manufId = flash_read_byte(0);
// Read device ID from byte address 2 // Read device ID
deviceId = flash_read_byte(2); deviceId = flash_read_byte(1);
flash_command(CMD_CFI_ID_EXIT); flash_command(CMD_CFI_ID_EXIT);

View File

@ -482,7 +482,7 @@ BOOL writeBufToFlash(struct scsiBoard *board, UBYTE *source, UBYTE *dest, ULONG
lastProgress = progress; lastProgress = progress;
} }
sourcePtr = ((void *)source + i); sourcePtr = ((void *)source + i);
destPtr = ((void *)dest + (i << 1)); destPtr = ((void *)dest + (i << 2));
if (*sourcePtr != *destPtr) { if (*sourcePtr != *destPtr) {
printf("\nVerification failed at %06x - Expected %02X but read %02X\n",(int)destPtr,*sourcePtr,*destPtr); printf("\nVerification failed at %06x - Expected %02X but read %02X\n",(int)destPtr,*sourcePtr,*destPtr);
return false; return false;