diff options
-rw-r--r-- | db600c_flasher.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/db600c_flasher.py b/db600c_flasher.py index be09c50..32d28d0 100644 --- a/db600c_flasher.py +++ b/db600c_flasher.py @@ -87,6 +87,8 @@ FEATURE_UNCOMPRESSED_DLOAD = 0x00000001 FEATURE_SECTOR_ADDRESSES = 0x00000010 PRTN_EMMCUSER = 0x21 # For programming eMMC chip (singleimage.bin) +PRTN_EMMCBOOT1 = 0x22 +PRTN_EMMCBOOT2 = 0x23 DLOAD_MAX_WRITE_SIZE= 1536 COM_PORT = None @@ -1266,16 +1268,18 @@ Emulates QPST Emergency download. -p, --port COM/serial Port -d, --dload HEX file to transfer over DLOAD (MPRG8064.hex) -i, --image image to (singleimage.bin) + -e, --emmcphysicalpartition EMMC physical partition: 0: USERDATA 1: BOOT1 2: BOOT2 Example: For Windows machine: python db600c_flasher.py -p COM26 -d MPRG8064.hex -i singleimage.bin For Linux machine: - sudo python db600c_flasher.py -p /dev/ttyUSB0 -d MPRG8064.hex -i singleimage.bin """ + sudo python db600c_flasher.py -p /dev/ttyUSB0 -d MPRG8064.hex -i singleimage.bin -e 0""" def ParseCommandLineOptions(): global COM_PORT,verbose,hex_filename,DoDLOAD,DoStreaming,SEARCH_CWD_LAST,search_paths,streaming_erase,temp_patch_filename - + physical_emmc_partition = PRTN_EMMCUSER + image_filename = "" try: opts, args = getopt.getopt(sys.argv[1:], "p:d:i:v?k:f:s:ewx:ngqz:", ["port=", "dload=", "image=", "verbose", "help", "disk=", "files=", "search_path=", "erase", "wipe", "xml=", "new", "gpp", "quick", "send_data="]) except getopt.GetoptError, err: @@ -1295,13 +1299,22 @@ def ParseCommandLineOptions(): elif o in ("-d", "--dload"): hex_filename= a DoDLOAD = True + elif o in ("-e", "--emmcphysicalpartition"): + if (a == "0"): + physical_emmc_partition = PRTN_EMMCUSER + elif (a == "1"): + physical_emmc_partition = PRTN_EMMCBOOT1 + elif (a == "2"): + physical_emmc_partition = PRTN_EMMCBOOT2 elif o in ("-i", "--image"): - FSM.add_state(OpenMultiImage,partition=PRTN_EMMCUSER) - FSM.add_state(Write, filename=a) - FSM.add_state(CloseMultiImage) + image_filename= a else: assert False, "unhandled option" + FSM.add_state(OpenMultiImage,partition=physical_emmc_partition) + FSM.add_state(Write, filename=image_filename) + FSM.add_state(CloseMultiImage) + if SEARCH_CWD_LAST: search_paths.append(os.getcwd()) ## Put CWD at the end of search paths else: |