bootloader中添加emergency download mode
来源:互联网 发布:golang template 编辑:程序博客网 时间:2024/06/05 20:38
硬件平台:高通8x10
基线版本:QRD8x12_KK_1903411
在完成了寄存器初始化、display 设备初始化之后,系统准备开始启动,在aboot.c文件中
void aboot_init(const struct app_descriptor *app){unsigned reboot_mode = 0;bool boot_into_fastboot = false;/* Setup page size information for nand/emmc reads */if (target_is_emmc_boot()){page_size = 2048;page_mask = page_size - 1;}else{page_size = flash_page_size();page_mask = page_size - 1;}ASSERT((MEMBASE + MEMSIZE) > MEMBASE);read_device_info(&device);target_serialno((unsigned char *) sn_buf);dprintf(SPEW,"serial number: %s\n",sn_buf);memset(display_panel_buf, '\0', MAX_PANEL_BUF_SIZE);/* Check if we should do something other than booting up */<span style="color:#000099;">if (keys_get_state(KEY_VOLUMEUP) && keys_get_state(KEY_VOLUMEDOWN)) //音量上下键选择进入emergency download mode,但在此之前需要配置这两个GPIO{dprintf(ALWAYS,"dload mode key sequence detected\n");if (set_download_mode(EMERGENCY_DLOAD)){dprintf(CRITICAL,"dload mode not supported by target\n");}else{reboot_device(0);dprintf(CRITICAL,"Failed to reboot into dload mode\n");}boot_into_fastboot = true;}</span>if (!boot_into_fastboot){if (keys_get_state(KEY_HOME) || keys_get_state(KEY_VOLUMEUP))boot_into_recovery = 1;if (!boot_into_recovery &&(keys_get_state(KEY_BACK) || keys_get_state(KEY_VOLUMEDOWN)))boot_into_fastboot = true;}
#if MSM8610_C199#define TLMM_VOL_UP_BTN_GPIO 72#define TLMM_VOL_DOWN_BTN_GPIO 73#else#define TLMM_VOL_UP_BTN_GPIO -1#define TLMM_VOL_DOWN_BTN_GPIO -1
/* Return 1 if vol_up pressed */static int target_volume_up(){uint8_t status = 0;gpio_tlmm_config(TLMM_VOL_UP_BTN_GPIO, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA, GPIO_ENABLE);/* Wait for the configuration to complete.*/thread_sleep(1);/* Get status of GPIO */status = gpio_status(TLMM_VOL_UP_BTN_GPIO);/* Active low signal. */return !status;}/* Return 1 if vol_down pressed */uint32_t target_volume_down(){#if 1uint8_t status = 0;if(TLMM_VOL_DOWN_BTN_GPIO == -1)return 0;gpio_tlmm_config(TLMM_VOL_DOWN_BTN_GPIO, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA, GPIO_ENABLE);/* Wait for the configuration to complete.*/thread_sleep(1);/* Get status of GPIO */status = gpio_status(TLMM_VOL_DOWN_BTN_GPIO);/* Active low signal. */return !status;#else/* Volume down button tied in with PMIC RESIN. */return pm8x41_resin_status();#endif}
int set_download_mode(enum dload_mode mode) //这个函数在这个文件中是没有的,可以参考别的文件中{dload_util_write_cookie(mode == NORMAL_DLOAD ?DLOAD_MODE_ADDR : EMERGENCY_DLOAD_MODE_ADDR, mode);pm8x41_clear_pmic_watchdog();return 0;}
0 0
- bootloader中添加emergency download mode
- centos7 进入emergency mode
- 开机mint进入emergency mode
- Linux系统CentOS7中,fstab出错,系统重启进入emergency mode的解决办法
- centos7进入emergency mode时修复过程
- 树莓派ubuntu开机进入emergency mode解决
- centos7开机碰到emergency mode如何解决
- centos7开机出现welcome to emergency mode!
- 虚拟机RHEL7启动进入emergency mode问题
- centos7系统的emergency mode的原因之一及解决方法
- 树莓派 Ubuntu Mate系统 开机进入 Emergency Mode
- Linux 开机显示:welcome to emergency mode 的解决方法
- 树莓派上的kaili 每次启动都进入emergency mode
- ubuntu 16.04开机进入emergency mode的一种可能
- 类似welcome to emergency mode!错误的解决
- centos7开机启动进入紧急模式emergency mode
- linux开机只能进入emergency mode的问题
- centos7.4系统的emergency mode及解决方法
- POJ 1328 Radar Installation(贪心)
- Android之NDK开发
- nyoj204Coin Test
- css参考手册
- http 缓存机制
- bootloader中添加emergency download mode
- 关于Java配置文件properties的使用(简单易用版)
- Heap & Priority Queue
- 手机APPUI界面设计流程
- 有趣的 VPN
- HW -- temp
- 数据库事务应用编程规范
- Linux 修改文件用户属性
- cocoapod pod update命令导致一直Analyzing dependencies的问题