2021-07-05

高通 sdm660 屏蔽组合键(Power+音量up/down)进入recovery和fastboot界面

刚接触高通平台,接到客户这个需求,不知道在哪里改。先到bootloader搜一下fastboot关键字

grep -nrs “fastboot”

看到 “goto fastboot”,LinuxLoader.c, 应该就是这里了。

@ubuntu:~/zhangjk/SC66_Android9.0.0_r034/bootable/bootloader/edk2$ grep -nrs "fastboot"
EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h:24:  system/core/fastboot/fastboot_protocol.txt in the AOSP source tree for more
EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h:120:  However at the moment although the specification allows it, the AOSP fastboot
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c:283:      // fastboot_protocol.txt:
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c:285:      // I guess this means reboot back into fastboot mode to save the user
EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c:38:  In fact, this driver is the minimum required to implement fastboot.
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsb.c:107:    // (in match_fastboot_with_serial in fastboot.c).
QcomModulePkg/Application/LinuxLoader/LinuxLoader.c:266:  /* Populate board data required for fastboot, dtb selection and cmd line */
QcomModulePkg/Application/LinuxLoader/LinuxLoader.c:281:      goto fastboot;
QcomModulePkg/Application/LinuxLoader/LinuxLoader.c:287:fastboot:
QcomModulePkg/Application/LinuxLoader/LinuxLoader.c:288:  DEBUG ((EFI_D_INFO, "Launching fastboot\n"));

进代码看看 bootable\bootloader\edk2\QcomModulePkg\Application\LinuxLoader

相关的变量

STATIC BOOLEAN BootReasonAlarm = FALSE;
STATIC BOOLEANBootIntoFastboot = FALSE;
STATIC BOOLEAN BootIntoRecovery = FALSE;

注释标志位

LinuxLoaderEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
	……

  Status = GetKeyPress (&KeyPressed);
  DEBUG ((EFI_D_ERROR, "reading key status: %x\n", KeyPressed));
  if (Status == EFI_SUCCESS) {
    if (KeyPressed == SCAN_DOWN || KeyPressed == SCAN_DELETE)
      //BootIntoFastboot = TRUE;
    if (KeyPressed == SCAN_UP)
      //BootIntoRecovery = TRUE;
    if (KeyPressed == SCAN_ESC)
      RebootDevice (EMERGENCY_DLOAD);
    if (KeyPressed == SCAN_HOME)  //POWER+VOL UP will generate SCAN_HOME, detect this key, it will enter ffbm mode
    {
      //SetFFBMCommand();
    }
  } else if (Status == EFI_DEVICE_ERROR) {
    DEBUG ((EFI_D_ERROR, "Error reading key status: %r\n", Status));
    goto stack_guard_update_default;
  }
  ……

验证组合键失效,变成常规开机。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值