Jump to content
Sign in to follow this  
Tinker Board

A Guide to Disable UMS Mode Under Android

Recommended Posts

In any case if you'd like to force disable booting under UMS Mode in Android on Tinker Board 2S when USB debug port been connected with PC,

Please refer below to comment code in "boot_mode.c" (the link) to disable Tinker Board 2S from automatically booting through UMS mode:


https://github.com/TinkerBoard2-Android/u-boot/blob/android10-rk3399/arch/arm/mach-rockchip/boot_mode.c

diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c 
index b028a093fe..ef076f0b9d 100644
--- a/arch/arm/mach-rockchip/boot_mode.c
+++ b/arch/arm/mach-rockchip/boot_mode.c
@@ -10,7 +10,7 @@
 #include <asm/io.h>
 #include <asm/arch/boot_mode.h>
 
-#define CONFIG_GRF_SOC_STATUS3_REG 0xff77e2ac
+//#define CONFIG_GRF_SOC_STATUS3_REG 0xff77e2ac
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -168,7 +168,7 @@ int rockchip_get_boot_mode(void)
  { -EINVAL, -EINVAL, -EINVAL };
  static int bcb_offset = -EINVAL; /* static */
  uint32_t reg_boot_mode;
- uint32_t reg_soc_status3;
+ //uint32_t reg_soc_status3;
  char *env_reboot_mode;
  int clear_boot_reg = 0;
 #ifdef CONFIG_ANDROID_BOOT_IMAGE
@@ -286,16 +286,16 @@ int rockchip_get_boot_mode(void)
  boot_mode[PL] = BOOT_MODE_WATCHDOG;
  break;
  default:
- reg_soc_status3 = readl((void *)CONFIG_GRF_SOC_STATUS3_REG);
- if (reg_soc_status3 & (1 << 12)) {
- printf("usbcphy0_otg_utmi_bvalid = 1\n");
- boot_mode[PH] = BOOT_MODE_UMS;
- clear_boot_reg = 1;
- } else {
+ //reg_soc_status3 = readl((void *)CONFIG_GRF_SOC_STATUS3_REG);
+ //if (reg_soc_status3 & (1 << 12)) {
+ // printf("usbcphy0_otg_utmi_bvalid = 1\n");
+ //boot_mode[PH] = BOOT_MODE_UMS;
+ //clear_boot_reg = 1;
+ //} else {
  printf("boot mode: None\n");
  boot_mode[PL] = BOOT_MODE_UNDEFINE;
  flash_bootloader_msg();
- }
+ //}
  }
  }

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...