写作平台总线的设备驱动程序嵌入式系统? [英] Writing a device driver for Platform Bus in Embedded Systems?

查看:364
本文介绍了写作平台总线的设备驱动程序嵌入式系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过Linux内核源代码的一些驱动程序实现了,并且可以看出,这些都是平台的驱动程序。

I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver.

drivers/net/ethernet/smsc/smsc911x.c

  static struct platform_driver smc911x_driver = {
    .probe           = smc911x_drv_probe,
    .remove  = smc911x_drv_remove,
    .suspend         = smc911x_drv_suspend,
    .resume  = smc911x_drv_resume,
    .driver  = {
            .name    = CARDNAME,
            .owner  = THIS_MODULE,
    },
};

以上是对平台设备(SMSC基于以太网控制器)和平台设备是设备而不是象在传统设备坐在PCI总线在系统启动时自动探测驱动程序。

Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are not probed automatically during system boot-up unlike legacy devices sitting on the pci bus.

我想我的这种认识是可以在这里?

I guess this understanding of mine is OK here?

现在,当我说这是平台的设备,是意味着这些设备(以太网控制器)正坐在平台总线和ARM架构平台默认总线上的AMBA。

Now when I say it is the platform devices, is it mean these devices(Ethernet Controller) are sitting on Platform bus and on ARM architecture default platform bus is AMBA.

因此​​,当我们在焊接基于ARM板上以太网控制器的应该是坐或AMBA总线接口?

So when we solder the Ethernet controller on ARM based board it should be sit on or interfaced with AMBA bus?

我们如何决定该驱动程序,我们打算写的是平台驱动程序或普通司机?

How Do we decide that driver we're going to write is Platform driver or Normal driver?

推荐答案

从我在开发ARM平台驱动程序的经验有限,AMBA设备通常具有在其内存映射IO寄存器接口月底标识寄存器。

From my limited experience in developing ARM platform drivers, AMBA devices typically have identification registers at the end of their memory mapped IO register interface.

一般而言,如果你看一下参考手册以太网控制器和注册总结指定外设/组件识别寄存器(通常在偏移0xFE0-0xFEC和0xFF0-0xFFC),你应该写一个AMBA总线驱动程序。这些驱动程序可以自动被公交车司机进行识别。

Generally speaking, if you look at the reference manual for your ethernet controller and register summary specifies peripheral/component identification registers (usually at offsets 0xFE0-0xFEC and 0xFF0-0xFFC), you should write an AMBA bus driver. These drivers can be identified automatically by the bus driver.

否则,如果寄存器接口并没有给定偏移0xFE0-0xFEC和0xFF0-0xFFC任何ID寄存器,你可能只想写一个平台的驱动程序。这些设备不能自动识别并且需要一个驱动专门附加到设备

Otherwise, if the register interface doesn't specify any ID registers at offsets 0xFE0-0xFEC and 0xFF0-0xFFC, you'll probably just want to write a platform driver. These devices cannot be automatically identified and you need to specifically attach a driver to the device.

这篇关于写作平台总线的设备驱动程序嵌入式系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆