Skip to content

Commit

Permalink
Added die revision id mask in chip identification
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   mdloader_common.c
	modified:   mdloader_common.h
 Added die revision mask to chip id. Now mdloader shall work for all die
 revision ids as per chip datasheet.
  • Loading branch information
shailendragovardhan committed Jul 16, 2020
1 parent caa03ed commit fcef3c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mdloader_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int test_mcu(char silent)
continue;
}

if (deviceid == mcu->cidr)
if ((deviceid & CIDR_DIE_REVISION_MASK) == mcu->cidr)
{
if (!silent && verbose) printf("Found supported device ID: %08X\n", deviceid);
break;
Expand Down
4 changes: 3 additions & 1 deletion mdloader_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#define PROGRAM_NAME "Massdrop Loader"
#define VERSION_MAJOR 1
#define VERSION_MINOR 3 //0-99
#define VERSION_MINOR 4 //0-99

#ifdef _WIN32
#define INITGUID
Expand Down Expand Up @@ -102,6 +102,8 @@ extern mailbox_t initparams;
extern mailbox_t appletinfo;
extern appinfo_t appinfo;

#define CIDR_DIE_REVISION_MASK 0xFFFFF0FF

typedef struct mcu_s {
char name[20]; //MCU Name
int cidr_addr; //Chip ID Address
Expand Down

0 comments on commit fcef3c4

Please sign in to comment.