导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    boot0启动的时候一直按 2 或者按 d,就能进入FEL烧录模式的原因

    MR Series
    1
    1
    1118
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • M
      memory LV 7 最后由 编辑

      void main(void)
      {
              int dram_size;
              int status;
              phys_addr_t  uboot_base = 0, optee_base = 0, monitor_base = 0, \
                                      rtos_base = 0, opensbi_base = 0;
              u16 pmu_type = 0, key_input = 0; /* TODO: set real value */
      
              sunxi_serial_init(BT0_head.prvt_head.uart_port, (void *)BT0_head.prvt_head.uart_ctrl, 6);
              printf("HELLO! BOOT0 is starting!\n");
              printf("BOOT0 commit : %s\n", BT0_head.hash);
              sunxi_set_printf_debug_mode(BT0_head.prvt_head.debug_mode);
      
              status = sunxi_board_init();
              if(status)
                      goto _BOOT_ERROR;
      
              if (rtc_probe_fel_flag()) {
                      rtc_clear_fel_flag();
                      goto _BOOT_ERROR;
      #ifdef CFG_SUNXI_PHY_KEY
              } else if (check_update_key(&key_input)) {
                      goto _BOOT_ERROR;
      #endif
              } else if (BT0_head.prvt_head.enable_jtag) {
                      printf("enable_jtag\n");
                      boot_set_gpio((normal_gpio_cfg *)BT0_head.prvt_head.jtag_gpio, 5, 1);
              }
      
      #ifdef FPGA_PLATFORM
              dram_size = mctl_init((void *)BT0_head.prvt_head.dram_para);
      #else
      #ifdef CFG_DDR_SOFT_TRAIN
              if (BT0_head.prvt_head.dram_para[30] & (1 << 11))
                      neon_enable();
      #endif
              dram_size = init_DRAM(0, (void *)BT0_head.prvt_head.dram_para);
      #endif
              if(!dram_size)
                      goto _BOOT_ERROR;
              else {
                      printf("dram size =%d\n", dram_size);
              }
      
              char uart_input_value = get_uart_input();
      
              if (uart_input_value == '2') {
                      sunxi_set_printf_debug_mode(3);
                      printf("detected user input 2\n");
                      goto _BOOT_ERROR;
              } else if (uart_input_value == 'd') {
                      sunxi_set_printf_debug_mode(8);
                      printf("detected user input d\n");
              }
      
              mmu_enable(dram_size);
              malloc_init(CONFIG_HEAP_BASE, CONFIG_HEAP_SIZE);
      

      lichee/brandy-2.0/spl/nboot/main/boot0_main.c

      1 条回复 最后回复 回复 引用 分享 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策