当前位置: 首页 > news >正文

最好机票网站建设天元建设集团有限公司文件

最好机票网站建设,天元建设集团有限公司文件,网站建设是基于,凡客诚品网址是多少linux设备树节点添加新的复位属性之后设备驱动加载异常问题分析 1 linux原始设备驱动信息1.1 设备树节点信息1.2 linux设备驱动1.3 makefile1.4 Kconfig1.5 对应的defconfig文件 2 修改之后的linux设备驱动2.1 修改之后的设备树节点信息2.2 原始test_fw.c出现的问题以及原因分析… linux设备树节点添加新的复位属性之后设备驱动加载异常问题分析 1 linux原始设备驱动信息1.1 设备树节点信息1.2 linux设备驱动1.3 makefile1.4 Kconfig1.5 对应的defconfig文件 2 修改之后的linux设备驱动2.1 修改之后的设备树节点信息2.2 原始test_fw.c出现的问题以及原因分析2.2.1 原始test_fw.c出现的问题2.2.2 原始test_fw.c出现的问题的原因分析 2.3 解决test_fw.c对应驱动加载异常的方法2.3.1 添加对应的test_reset.c驱动文件2.3.2 makefile添加对test_reset.c的支持2.3.3 Kconfig添加对test_reset功能的支持2.3.4 defconfig文件添加对test_reset功能的支持 3 对于该问题的总结3.1 添加一个新的linux设备驱动需要兼顾的几点3.2 设备树节点添加新的属性的处理 该问题是在调试linux设备驱动时出现根据当时对该问题的理解以及对应的验证方法去整理为该文档。 1 linux原始设备驱动信息 1.1 设备树节点信息 / {test_fw_load0x100000000 {compatible test,test-x280-fw;reg 0x01 0x00000000 0x0 0x20000000 , 0x0 0x4000f000 0x0 0x200;}; };1.2 linux设备驱动 这里只给出一个驱动代码的示意test_fw.cprobe函数具体的功能就不再贴出。 // SPDX-License-Identifier: GPL-2.0-or-later#include linux/module.h #include linux/kernel.h #include linux/init.h #include linux/types.h #include linux/errno.h #include linux/of.h #include linux/of_address.h #include linux/moduleparam.h #include linux/platform_device.h#include linux/io.h #include linux/device.h #include linux/firmware.h#define TEST_FW_LOAD_VERSION 1.0static int test_fw_probe(struct platform_device *pdev) {printk(test fw probe\r\n);return 0; }/*** test_fw_remove - set driver_data of the device to NULL* pdev: pointer to platform device handle** Always returns 0*/ static int test_fw_remove(struct platform_device *pdev) {printk(test fw probe\r\n);return 0; }static const struct of_device_id test_fw_match[] {{ .compatible test,test-x280-fw, },{}, }; MODULE_DEVICE_TABLE(of, test_fw_match);static struct platform_driver test_fw_load_driver {.driver {.name test_fw_load,.of_match_table test_fw_match,},.probe test_fw_probe,.remove test_fw_remove, }; module_platform_driver(test_fw_load_driver);MODULE_AUTHOR(W Test testtest.cn); MODULE_VERSION(TEST_FW_LOAD_VERSION); MODULE_LICENSE(GPL V2);1.3 makefile obj-$(CONFIG_TEST_FW_LOAD) test_fw.o1.4 Kconfig config TEST_FW_LOADtristate X280 Fw load on Test Platformselect FW_LOADERhelpThis option enables support for the Test load X280 FWYou may select when support test fw load. To compile this as a modulechoose M.If unsure, say N.1.5 对应的defconfig文件 CONFIG_TEST_FW_LOADy2 修改之后的linux设备驱动 2.1 修改之后的设备树节点信息 给test_fw_load节点添加了复位属性。 / {test_reset: test_reset {compatible test,scmi-reset;#reset-cells 1;}; };/ {test_fw_load0x100000000 {compatible test,test-x280-fw;reg 0x01 0x00000000 0x0 0x20000000 , 0x0 0x4000f000 0x0 0x200;resets test_reset 1;reset-names test_reset;}; };2.2 原始test_fw.c出现的问题以及原因分析 2.2.1 原始test_fw.c出现的问题 当给test_fw.c对应的设备树添加了复位属性之后就开始出现test_fw.c驱动的probe函数不被执行整个设备驱动好像就没有被调用。 可以确定test_fw.c所对应的makefileKconfigdefconfig均已正常添加对应的配置选项且之前test_fw.c所对应的驱动运行良好。 同时如果把复位属性注释掉则驱动又恢复运行良好。 2.2.2 原始test_fw.c出现的问题的原因分析 由于添加上复位属性设备驱动就会出现加载异常注释掉复位属性驱动就运行OK那么我们可以确定问题是由于添加复位属性引入的。 该问题的主要原因是使用test_reset的复位节点配置但是test_reset节点所对应的驱动并没有处理并加载导致test_fw.c所对应的驱动加载异常。 2.3 解决test_fw.c对应驱动加载异常的方法 解决test_fw.c对应驱动加载异常的方法就是添加test_reset设备树节点对应节点的设备驱动下面是已对应的示意代码为例来介绍的。 2.3.1 添加对应的test_reset.c驱动文件 // SPDX-License-Identifier: GPL-2.0-or-later#include linux/module.h#include linux/kernel.h #include linux/init.h #include linux/types.h #include linux/errno.h #include linux/of.h #include linux/of_address.h #include linux/moduleparam.h #include linux/platform_device.h#include linux/io.h #include linux/device.h/*** test_reset_probe - probe routine of the driver* pdev: pointer to Platform device handle** Return zero for success and non-zero for failure*/ static int test_reset_probe(struct platform_device *pdev) {return 0; }/*** test_reset_remove - set driver_data of the device to NULL* pdev: pointer to platform device handle** Always returns 0*/ static int test_reset_remove(struct platform_device *pdev) {return 0; }static const struct of_device_id test_reset_match[] {{ .compatible test,scmi-reset, },{}, }; MODULE_DEVICE_TABLE(of, test_reset_match);static struct platform_driver test_reset_driver {.driver {.name test_reset,.of_match_table test_reset_match,},.probe test_reset_probe,.remove test_reset_remove, }; module_platform_driver(test_reset_driver);MODULE_AUTHOR(W Test testtest.cn); MODULE_DESCRIPTION(TEST RESET driver); MODULE_LICENSE(GPL V2);2.3.2 makefile添加对test_reset.c的支持 obj-$(CONFIG_TEST_RESET) test_reset.o2.3.3 Kconfig添加对test_reset功能的支持 config TEST_RESETtristate test reset on Test PlatformhelpThis option enables support for the TEST RESETYou may select when support test reset. To compile this as a modulechoose M.If unsure, say N.2.3.4 defconfig文件添加对test_reset功能的支持 CONFIG_TEST_RESETy3 对于该问题的总结 3.1 添加一个新的linux设备驱动需要兼顾的几点 3.2 设备树节点添加新的属性的处理 若新添加的设备属性需要执行具体的功能那需要按照3.1章的部分去添加对应的设备驱动程序。若不需要则在原始的设备驱动初始化流程直接去解析对应的设备属性即可。
http://www.w-s-a.com/news/288009/

相关文章:

  • 成都网站建设成功案例单招网商丘网站建设大全
  • 受欢迎的购物网站建设网推专员是做什么的
  • 商城网站前期准备湖南郴州建设局网站
  • 企业如何在自己的网站上做宣传外贸自建站可以自己做网站吗
  • 甘肃网站建设制作商网站空间哪家公司的好
  • 思途旅游网站建设系统用vscode做网站
  • 广州站改造最新消息半年工作总结ppt模板
  • logo模板下载网站推荐哪家网站开发培训好
  • 做外贸网站效果图页面关键词优化
  • 广平网站建设成都活动轨迹
  • 小型网站网站建设需要网络公司是什么行业
  • 滑动 手机网站 代码网页制作与设计讨论
  • 自己做网站处理图片用什么软件wordpress html5支持
  • 校园网站怎么建软文文案范文
  • 中国建设官方网站如何创建自己的软件
  • 来宾住房与城乡建设网站天津西青区怎么样
  • 西安网站建设培训班鄂州网页定制
  • 西部数码网站备份自己怎么做网站啊
  • h5网站开发用什么软件制作公司网站建设代理怎么做
  • 网站建设资料准备网上购物app有哪些
  • 沧州做网站优化哪家公司便宜国内百度云网站建设
  • 网站的最近浏览 怎么做龙岩市人才网最新招聘信息
  • 网站建设需要找工信部吗网站开发账务处理
  • 做那种的视频网站个体工商网站备案
  • 推广网官方推广网站中国建设招聘信息网站
  • 医院网站建设需要多少钱网络营销渠道可分为哪几种
  • 怎么取网页视频网站元素计算机专业论文网站开发
  • 上海网站建设备案号怎么恢复wordpress打开页面空白
  • 30个做设计的网站企业设计网站
  • 招生网站开发的背景创意 wordpress