zoukankan      html  css  js  c++  java
  • uboot的devices_init函数分析

    一、函数说明

    函数功能: 完成设备的初始化

    函数位置: common/devices.c

    二、程序分析

     1 int devices_init (void)
     2 {
     3 #ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
     4     ulong relocation_offset = gd->reloc_off;
     5     int i;
     6 
     7     /* relocate device name pointers */
     8     for (i = 0; i < (sizeof (stdio_names) / sizeof (char *)); ++i) {
     9         stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
    10                         relocation_offset);
    11     }//重定位设备输入输出设备名字指针
    12 #endif
    13 
    14     /* Initialize the list */
    15     devlist = ListCreate (sizeof (device_t));//初始化列表
    16 
    17     if (devlist == NULL) {
    18         eputs ("Cannot initialize the list of devices!
    ");
    19         return -1;
    20     }
    21 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
    22     i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
    23 #endif
    24 #ifdef CONFIG_LCD
    25     drv_lcd_init ();
    26 #endif
    27 #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
    28     drv_video_init ();
    29 #endif
    30 #ifdef CONFIG_KEYBOARD
    31     drv_keyboard_init ();
    32 #endif
    33 #ifdef CONFIG_LOGBUFFER
    34     drv_logbuff_init ();
    35 #endif
    36     drv_system_init ();
    37 #ifdef CONFIG_SERIAL_MULTI
    38     serial_devices_init ();
    39 #endif
    40 #ifdef CONFIG_USB_TTY
    41     drv_usbtty_init ();
    42 #endif
    43 #ifdef CONFIG_NETCONSOLE
    44     drv_nc_init ();
    45 #endif
    46 
    47     return (0);
    48 }
  • 相关阅读:
    VSCode中按ESLint规则格式化Javascript代码
    VSCode设置资源管理器字体大小
    Windows下利用安装压缩包安装MySQL
    Windows部署Apache 2.4.46及PHP 8.0.3
    npm设置国内镜像
    IDEA运行Tomcat输出信息乱码
    深入理解jvm虚拟机读书笔记-Java内存区域与内存溢出异常
    Navicat Premium
    mysql安装
    ElasticSearch 基础
  • 原文地址:https://www.cnblogs.com/amanlikethis/p/3509040.html
Copyright © 2011-2022 走看看