|
华硕维护的固件:
tinkerOS_Android和tinkerOS_Debian,默认是GPT格式的固件,boot阶段判断是否默认插有USB typeC线,如果有插,就直接把EMMC模拟成U盘,方便刷固件。这其实也是大大的方便了用户。
但是有些行业用户,需要USB typeC口来做数据通讯,系统是会一直插着USB 线的,这种情况下,就需要把这个UMS mode去掉,
直接修改源码,编译出新固件
可以修改 boot_mode.c 這個文件,參考下面紅色部分把相关code comment 掉就好。
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();
-}
+//}
}
}
|
|