;****************************************************************************
;**         boot_debug.cmm
;**
;**         This script performs setup for debugging on secboot 3.0 Architecture.
;**
;** Copyright  2012-2018 by Qualcomm Technologies, Incorporated.  All Rights Reserved.
;**
;****************************************************************************
;**
;**                        EDIT HISTORY FOR MODULE
;**
;** $$
;**
;** when       who     what, where, why
;** --------   ---     ------------------------------------------------------
;** 06/20/18   ds      Add SM8250
;** 02/13/18   vk      Add SDM1000
;** 08/03/17   vk      Add SDM855
;** 11/03/16   kpa     Update for sdm845
;** 04/06/16   kpa     Update for 8998
;** 05/26/15   as      Add support for mode switch.
;** 05/15/15   kpa     Add build suffix Loader for 8996.
;** 04/21/15   as      Add support for build suffix.
;** 01/29/15   ck      Update for 2432 and 8996
;** 03/25/14   ck      Update for 8916
;** 10/31/13   jz      Updated to support command line usage
;** 10/23/13   kpa     Update for 9x35
;** 09/03/13   jz      Updated for 8084 to use common debug scripts
;** 07/23/13   plc     Update for 8994
;** 07/10/13   aus     Added support for boot crash dumps
;** 06/26/13   plc     Update for 8092
;** 05/06/13   plc     Update for 8x62
;** 03/18/13   plc     Update for 8x10
;** 08/20/12   dh      Initial revision for badger family

;****************************************************************************

  ; This script is a wrapper for the target specific debug script

  ;============================================================================
  ; Declare variables used
  ;============================================================================
  local &Choice
  local &Option  ; Menu Option
  local &variant
  
  ;============================================================================
  ; Get the arguments passed in.
  ;============================================================================
  ENTRY &Choice &Option &QSEEBuildPath &variant
  
  ;============================================================================
  ; Set up the display window
  ;============================================================================

  winclear
  area.RESET 
  WINPOS 0% 50% 68% 50% 0. 0. W001
  Area.create MAIN
  Area.view MAIN
  Area.select MAIN
  
  ;============================================================================
  ; If user passed TARGET on command line, just go
  ;============================================================================ 
  if "&Choice"=="Saipan"
  (
    do boot_debug_common.cmm Soc Saipan Loader False &variant &Option &QSEEBuildPath 
    enddo
  )

  if "&Choice"=="Bitra"
  (
    do boot_debug_common.cmm Soc Bitra Loader False &variant &Option &QSEEBuildPath 
    enddo
  )
  
  ;============================================================================
  ; Provide user with a choice for the chipset
  ;============================================================================
    
  print "Please enter chipset under debug: "
  print " 1: Saipan"
  print " 2: Bitra"  
  print
  print "Please make a choice: "
  enter &Choice
  print "Enter variant: "
  enter &variant
  
  if "&Choice"=="1"
  (
    do boot_debug_common.cmm Soc Saipan Loader False &variant
    enddo
  )

  if "&Choice"=="2"
  (
    do boot_debug_common.cmm Soc Bitra Loader False &variant
    enddo
  )
  
  ;Default case 
  (
    print "Incorrect entry"
    enddo
  )
  
CheckStorageOption:
  if "&Storage"!=""
  (
    &StorageType="&Storage"
  )
  else
  (
    print "Storage type not passed, so defaulting to UFS"
    &StorageType="UFS"
  )
  return