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!\n");
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 }

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值