摘要: // //递归函数来设定设备dev的数据, 分配设备的私有数据 int device_of_to_plat(struct udevice *dev) { const struct driver *drv; int ret; if (!dev) return -EINVAL; if (dev_get_ 阅读全文
posted @ 2022-02-21 22:12 liujunhuasd 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 分配设备的私有数据 对父设备probe,执行probe device之前uclass需要调用的一些函数 调用driver的ofdata_to_platdata,将dts信息转化为设备的平台数据 调用driver的probe函数,执行probe device之后uclass需要调用的一些函数 int 阅读全文
posted @ 2022-02-21 20:29 liujunhuasd 阅读(748) 评论(0) 推荐(0) 编辑
摘要: 分配设备的私有数据 static int device_alloc_priv(struct udevice *dev) { const struct driver *drv; void *ptr; int size; //通过设备来获得他的驱动 drv = dev->driver; assert(d 阅读全文
posted @ 2022-02-21 20:28 liujunhuasd 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) #define of_match_ptr(_ptr) (_ptr) #else #define of_match_ptr(_ptr) NULL #endif /* 阅读全文
posted @ 2022-02-20 19:51 liujunhuasd 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 设备 /* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (c) 2013 Google, Inc * * (C) Copyright 2012 * Pavel Herrmann <morpheus.ibis@gmail.com> * Mar 阅读全文
posted @ 2022-02-20 17:25 liujunhuasd 阅读(1175) 评论(0) 推荐(0) 编辑
摘要: http://betheme.net/news/txtlist_i88327v.html 两个关键宏U_BOOT_DRIVER及U_BOOT_DEVICES的作用 static const struct driver_info root_info = { .name = "root_driver", 阅读全文
posted @ 2022-02-20 16:22 liujunhuasd 阅读(393) 评论(0) 推荐(0) 编辑
摘要: #ifndef _DM_UCLASS_H #define _DM_UCLASS_H #include <dm/ofnode.h> #include <dm/uclass-id.h> #include <linker_lists.h> #include <linux/list.h> /** * str 阅读全文
posted @ 2022-02-20 15:39 liujunhuasd 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: 节点名称和别名 名称要体现设备的类型同一级的节点只要地址不一样,名称可以不唯一 serial@20080000 { //名称@设备地址 }; uart8: serial@20080000 { //别名: 名称@设备地址 }; //uart8就是这个节点的别名 节点的引用 向节点添加属性内容的时候,一 阅读全文
posted @ 2022-02-19 16:49 liujunhuasd 阅读(213) 评论(0) 推荐(0) 编辑
摘要: /** * uclass_add() - Create new uclass in list * @id: Id number to create * @ucp: Returns pointer to uclass, or NULL on error * @return 0 on success, 阅读全文
posted @ 2022-02-19 12:32 liujunhuasd 阅读(89) 评论(0) 推荐(0) 编辑
摘要: static int device_bind_common(struct udevice *parent, const struct driver *drv, const char *name, void *plat, ulong driver_data, ofnode node, uint of_ 阅读全文
posted @ 2022-02-18 22:21 liujunhuasd 阅读(294) 评论(0) 推荐(0) 编辑