summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2016-12-06 23:13:48 +0100
committerPali Rohár <pali.rohar@gmail.com>2016-12-06 23:13:48 +0100
commit0650cdf51f374e8ab2e54324fe84c86d5a80cd72 (patch)
tree47706148104928e1a1027ea8172e007b4dd41fd0
parent9ea8f2bb3872ff91e3413c5bf8c099da7b617831 (diff)
download0xFFFF-0650cdf51f374e8ab2e54324fe84c86d5a80cd72.tar.bz2
cold-flash: Show OMAP chip revision
-rw-r--r--src/cold-flash.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/cold-flash.c b/src/cold-flash.c
index b4fe4e6..9b92d79 100644
--- a/src/cold-flash.c
+++ b/src/cold-flash.c
@@ -323,6 +323,7 @@ int init_cold_flash(struct usb_device_info * dev) {
uint8_t asic_buffer[127];
int asic_size = 69;
const char * chip = NULL;
+ int revision;
int i;
if ( dev->flash_device->protocol != FLASH_COLD )
@@ -346,11 +347,11 @@ int init_cold_flash(struct usb_device_info * dev) {
if ( asic_buffer[0] != 0x05 )
ERROR_RETURN("Invalid ASIC ID", -1);
- /* ID Subblock - header */
+ /* 1. ID Subblock - header */
if ( memcmp(asic_buffer+1, "\x01\x05\x01", 3) != 0 )
ERROR_RETURN("Invalid ASIC ID", -1);
- /* ID Subblock - OMAP chip version (check for OMAP3430 or 3630) */
+ /* 1. ID Subblock - OMAP chip version (check for OMAP3430 or 3630) */
if ( memcmp(asic_buffer+4, "\x34\x30\x07", 3) == 0 )
chip = "OMAP3430";
else if ( memcmp(asic_buffer+4, "\x36\x30\x07", 3) == 0 )
@@ -358,23 +359,26 @@ int init_cold_flash(struct usb_device_info * dev) {
else
ERROR_RETURN("Invalid ASIC ID", -1);
- /* Reserved1 - header */
+ /* 1. ID Subblock - OMAP chip revision */
+ revision = asic_buffer[7];
+
+ /* 2. Secure Mode Subblock - header */
if ( memcmp(asic_buffer+8, "\x13\x02\x01", 3) != 0 )
ERROR_RETURN("Invalid ASIC ID", -1);
- /* 2nd ID Subblock - header */
+ /* 3. 2nd ID Subblock - header */
if ( memcmp(asic_buffer+12, "\x12\x15\x01", 3) != 0 )
ERROR_RETURN("Invalid ASIC ID", -1);
- /* Reserved2 - header */
+ /* 4. Root Key Hash Subblock - header */
if ( memcmp(asic_buffer+35, "\x14\x15\x01", 3) != 0 )
ERROR_RETURN("Invalid ASIC ID", -1);
- /* Checksum subblock - header */
+ /* 5. Checksum subblock - header */
if ( memcmp(asic_buffer+58, "\x15\x09\x01", 3) != 0 )
ERROR_RETURN("Invalid ASIC ID", -1);
- printf("Detected %s chip\n", chip);
+ printf("Detected %s chip (revision %d)\n", chip, revision);
return 0;