转载_基于VxBus的设备驱动开发

摘要:实现了一种全集成可变带宽中频宽带低通滤波器,讨论分析了跨导放大器-电容(OTA—C)连续时间型滤波器的结构、设计和具体实现,使用外部可编程电路对所设计滤波器带宽进行控制,并利用ADS软件进行电路设计和仿真验证。仿真结果表明,该滤波器带宽的可调范围为1~26 MHz,阻带抑制率大于35 dB,带内波纹小于0.5 dB,采用1.8 V电源,TSMC 0.18μm CMOS工艺库仿真,功耗小于21 mW,频响曲线接近理想状态。关键词:Butte

摘   要: 介绍了在VxWorks下,基于VxBus的设备驱动程序的开发。结合PCI2040,讲述了VxBus原理、设备驱动开发步骤及具体实现过程。
关键词: VxWorks; VxBus; 设备驱动; BSP; PCI2040

    VxBus是风河公司新的设备驱动程序架构,是VxWorks新增的特性,它是在VxWorks6.2及以后版本被增加到VxWorks中的。在以前的版本中,驱动程序并没有和工程配置集成到一起,如果要配置设备驱动,就要通过修改BSP目录下的config.h和syslib.c文件来完成。而基于VxBus架构模型的好处是允许驱动的集成和配置在Workbench工程中完成。这就意味着在Workbench环境下,每个驱动程序都能通过可视化环境进行配置,都能够按要求添加或删除设备。本文结合基于PCI2040数据采集卡驱动的开发过程[1],分析了VxBus架构下驱动的设计实现。
1 VxBus简介
 VxBus是指在VxWorks中用于支持设备驱动的特有的架构,这种架构包含对minimal BSP的支持。它包括以下功能:①允许设备驱动匹配对应设备;②提供驱动程序访问硬件的机制;③软件其他部分访问设备功能;④在VxWorks系统中,实现设备驱动的模块化。VxBus在总线控制器驱动程序服务的支持下,能在总线上发现设备,并执行一些初始化工作,使驱动与硬件设备之间正常的通讯。
 图1是VxBus 在整个系统中的位置示意图。从图1中可以看到,VxBus起到了辅助总线的作用,提供了对总线控制驱动的支持。

    在VxWorks6.2版本发布前,设备驱动并不能被集成到VxWorks工程配置当中,为了添加或移出设备驱动,需要有丰富的BSP和驱动开发相关的知识[2]。并且在驱动被添加或移出时要去做一些管理VxWorks 工程的额外的工作。作为VxWorks系统组件的一部分,VxBus消除了上面遇到的一些难题,各种驱动和支持组件的添加与删除完全可以在Workbench工程中进行,而不需要BSP和驱动相关的知识,也不会在添加、删除驱动时增加管理VxWorks工程的额外工作。因此大大方便了BSP的开发。
2 硬件介绍
    TI公司推出的PCI2040是一款用于实现PCI局部总线与DSP之间无缝链接的专用芯片。在VxWorks实时操作系统环境下实现主机与DSP的通讯,系统利用PCI2040实现TMS320VC5410与主机的通讯。由于PCI2040是TI的配套专用芯片,硬件级的连接比较简单,将对应的引脚连接即可。需要注意的是,未用的输入信号线需要通过上拉电阻上拉至有效逻辑电平。TMS320VC5410的MCBSP0与TLC2548 连接,实现8路12位A/D数据的采集。TMS320VC5410将采集到的数据通过PCI2040传输到主机上,数据在主机上得到进一步的处理。硬件连接框图如图2所示。


3 驱动开发
    基于VxBus架构下PCI2040设备驱动的开发主要包括设备的初始化、设备控制以及设备驱动如何以组件形式添加到Workbench配置界面中。下面分步介绍它的实现。
3.1设备驱动初始化
    设备的初始化,包含在BSP的初始化过程中[3],主要分三个阶段,如图3所示。


3.1.1内核预初始化阶段
 系统上电启动,CPU在上电时跳转到一个指定的地址 ,开始执行指令,初始化内存和CPU,然后是VxWorks 的初始化处理。
 在VxWorks内核预初始化早期,BSP的sysHwInit( )函数被执行[4],在这个函数中,设备驱动初始化工作第一步被执行。sysHwInit( )函数执行一些早期的初始化,调用hardWareInterFaceInit( )函数,执行初始化硬件内存分配机制,这步允许在系统内存池初始化之前,限制为设备驱动分配内存,这个函数接着调用hardWareInterFaceBusInit( ),在hardWareInterFaceBusInit( )函数中完成所有设备驱动和模块的注册工作。PCI2040的注册函数是vxbPci2040Register()。vxbPci2040Register()通过数据结构,向系统注册一些设备初始化函数。其中涉及到三个数据结构:
LOCAL struct drvBusFuncs PciFuncs =
        {
        Pci2040InstInit,    /* devInstanceInit */
        Pci2040InstInit2,    /* devInstanceInit2 */
        Pci204InstConnect    /* devConnect */
        }
       在这个结构中,包含了初始化阶段要调用的函数。下面的初始化过程会用到这些函数。
LOCAL struct vxbDeviceMethod Pci2040Methods[] =
       {
       DEVMETHOD(ReadHPID,    PCI2040ReadHPID),
       DEVMETHOD(WriteHPID,    PCI2040WriteHPID),
       DEVMETHOD(ReadHPIA,    PCI2040ReadHPIA),
       DEVMETHOD(WriteHPIA,    PCI2040WriteHPIA),
       DEVMETHOD(ReadHPIC,    PCI2040ReadHPIC),
       DEVMETHOD(WriteHPIC,    PCI2040WriteHPIC),
       DEVMETHOD(ReadCSR,    PCI2040ReadCSR),
       DEVMETHOD(WriteCSR,    PCI2040WriteCSR),
       { 0, 0 }
       }  
     这个结构提供了应用软件操作硬件的一些函数及方法。
        LOCAL struct vxbPciRegister Pci2040DevPciRegistration =
        {
              {
              NULL,                        /* pNext */
              VXB_DEVID_DEVICE,        /* devID */
        VXB_BUSID_PCI,            /* busID = PCI */
              VXB_VER_4_0_0,                /* vxbVersion */
           LNPCI_NAME,                    /* drvName */
           &Pci2040Funcs,            /* 总线驱动函数*/
           Pci2040Methods,            /* 设备方法结构 */
           Pci2040Probe,                    /* 设备探测函数 */
           Pci2040ParamDefaults        /* 参数*/
           },
        NELEMENTS(PciPci204DevIDList),
        PciPci204DevIDList                /*设备资源列表*/
      };
  最后这个结构在vxbPci2040Registe()中被使用。这个结构包括几个驱动的初始化入口,其中Pci2040Probe()是PCI2040采集卡的硬件探测函数,该函数在VxBus初始化过程中检测采集卡的数量,当检测到采集卡时,将采集卡与驱动结合,形成设备的一个实例,以便应用程序使用。Pci204InstanceInit( )函数在VxBus初始化的第一阶段被调用, Pci204InstanceInit( )函数只是简单地确保设备的中断被禁止。
    当所有驱动在VxWorks注册之后,hardWareInterFaceBusInit( )和hardWareInterFaceInit( ) 函数返回,sysHwInit( ) 完成非VxBus 驱动的初始化并返回。sysHwInit( ) 函数返回后,VxWorks内核被初始化。
3.1.2 内核自检
    在这个阶段,内核在sysHwInit2( )中执行,BSP调用Pci2040InstanceInit2( )函数[5]。在这个函数中,建立系统内存到设备空间的映射。关键部分代码如下:
LOCAL void Pci204InstInit2(VXB_DEVICE_ID pDev)
  {……
      for (i = 0; i < VXB_MAXBARS; i++)
          {
          if (pDev->regBaseFlags[i] == VXB_REG_IO)
              break;
          }
         if (i == VXB_MAXBARS)
         return;
    pDrvCtrl->Pci2040Bar = pDev->pRegBase[i];
      vxbRegMap (pDev, i, &pDrvCtrl->Pci2040Handle);
                            //设备I/O映射到系统内存
      ……
      }
    此时,完成内核服务初始化,并可以被驱动访问。但是,中间层的服务仍然无效。
3.1.3 应用程序初始化驱动部分
  在devInstanceInit2( )函数最后,创建用户的运行任务,并完成设备驱动的初始化。在这个阶段,Pci2040InstanceConnect( )函数被调用,完成最后的初始化工作,在这个函数中,主要是建立中断与中断服务程序的连接。
 至此,设备驱动的初始化完成。
3.2驱动程序的配置
 采用VxBus驱动的一个主要优点是:设备的驱动程序可以被看成VxWorks 系统的一个组件,通过集成的Workbench开发环境来配置设备驱动。为了实现这一功能,开发的驱动需要增加一些额外的扩展文件。标准VxWorks设备驱动有一个最小的文件集,对于大多数VxWorks设备驱动,最小的设备驱动集要求有6个单独的文件[6]。PCI2040数据采集卡需要有以下文件:
    · 一个驱动源文件PCI2040.c,执行驱动运行逻辑,包括PCI2040驱动的实现代码。
    · 一个组件描述文件PCI2040.cdf,允许集成驱动到VxWorks开发工具Workbench当中。
    · 一个PCI2040.dc文件,提供驱动注册函数原型。
    · 一个PCI2040.dr文件,提供一个调用注册函数的C语言代码段。
    · 一个readme文件 ,提供版本信息。
    · 一个makefile 文件,提供建立驱动的编译规则。
    当上述文件在workbench环境下进行相应的配置后,PCI2040的设备驱动就会以组件的形式出现在开发工程的Kernel Configuration选项中,可以方便地进行PCI2040驱动配置。
4 应用程序与驱动的通信
    为了使设备和驱动能够在VxWorks系统中使用,让应用程序、中间件、VxWorks内核模块访问设备,执行一些操作,最基本的方法是在VxWorks中采用VxBus方法来实现硬件设备的访问。VxBus方法是在驱动中公开一个入口,使VxBus中API函数可以调用这些入口函数。在PCI2040初始化阶段,Pci2040Methods结构中注册的函数就是在驱动中公开的函数,用于对PCI2040的操作。
    例如,通过PCI2040 完成对DSP数据寄存器的访问
    struct vxbDriverControl ctrl;
    vxbDevMethodRun(DEVMETHOD_CALL(ReadHPID),&ctrl);
    vxbDevMethodRun( )函数够被用于调用一个指定的驱动方法,这个函数反复查找所有的实例,并检查每一个,看是否有指定公开申明的方法,如果实例有指定的方法,vxbDevMethodRun( )调用方法函数。
    为了避免重复遍历在系统上的所有实例,可以用 vxbDevMethodGet( )函数找出驱动函数相对应的驱动方法 ,然后通过下面代码完成函数调用。
    STATUS (*methodFunc)(VXB_DEVICE_ID devID, void * pArg);
    methodFunc = bDevMethodGet(devID,DEVMETHOD_CALL(ReadHPID));
    if(methodFunc != NULL )
    (*methodFunc)(devID, pArg);
    在PCI2040的数据采集卡中,通常是DSP在采集完数据后,通过中断通知主机,去读取数据。下面是中断服务相关代码。
void PCI2040Isr()
{ ……
    temp=*(PCI2040. instID.pRegister+0x4); //读中断寄存器
    if((tempr&0x1)!=0)               //检查是否是该实例中断
    { *(PCI2040. instID.pRegister +0x4)=0x1;
    temp= *(PCI2040. instIDpDspHpicRegister);
    *(PCI2040. instIDpDspHpicRegister)=temp|0x0808;
                              //通知DSP,清除HINT中断
    semGive(semForPci2040Int);
   }
}
    采用基于VxBus架构来开发PCI2040数据采集卡的驱动,通过扩展文件实现驱动的配置。与简单的非VxBus
驱动相比,显然增加了工作量,然而对于基于多个BSP设备的复杂的驱动,VxBus驱动是优于非VxBus驱动的。通过实际运用证明,所开发采集卡的驱动能够稳定运行,并且能很方便地将该驱动移植到其他的系统。
参考文献
[1]     高超,郝燕玲,吴润.VxWorks下网卡驱动程序的开发[J].微计算机信息.2004(9):18-20.
[2]     周启平,张杨. VxWorks下设备驱动程序及BSP开发指南[M]. 北京.中国电力出版社,2004.
[3]     VxWorks Device Driver Developer′s Guide Wind River Systems, Inc.2007.1,6.6
[4]     VxWorks Device Driver Developer's Guide Volume 2, 6.6. Wind River Systems, Inc.2007.2,6.6
[5]     VxWorks Device Driver Developer's Guide Volume 3,6.6. Wind River Systems, Inc.2007.3,6.6
[6]     BSP Developer's Guide,6.6 Wind River Systems,Inc.2007.
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目录 3 DMA驱动 1 3.1 简介 1 3.2 概要 1 3.3 VxBus驱动方法 1 3.3.1 {vxbDmaResourceGet}( ) 1 3.3.2 {vxbDmaResourceRelease}( ) 2 3.3.3 {vxbDmaResDedicatedGet}( ) 2 3.4 头文件 2 3.5 BSP配置 3 3.6 可用的工具函数 3 3.7 初始化 3 3.8 DMA系统结构和函数 3 3.8.1 (*dmaRead)( ) 3 3.8.2 (*dmaReadAndWait)( ) 4 3.8.3 (*dmaWrite)( ) 4 3.8.4 (*dmaWriteAndWait)( ) 4 3.8.5 (*dmaCancel)( ) 5 3.8.6 (*dmaPause)( ) 5 3.8.7 (*dmaResume)( ) 5 3.8.8 (*dmaStatus)( ) 5 3.9 调试 5 4 中断控制器驱动 5 4.1 介绍 6 4.2 概要 6 4.3 VxBus驱动方法 7 4.3.1 基本方法 7 4.3.2 动态向量方法 8 4.3.3 多处理器方法 9 4.4 头文件 9 4.5 BSP配置 10 4.5.1 中断输入表 10 4.5.2 动态向量表 11 4.5.3 CPU路由表 12 4.5.4 中断优先级 12 4.5.5 交差路由表 13 4.6 现有的工具函数 14 4.6.1 intCtlrHwConfGet( ) 14 4.6.2 intCtlrISRAdd( ) 14 4.6.3 intCtlrISRDisable( ) 14 4.6.4 intCtlrISREnable( ) 15 4.6.5 intCtlrISRRemove( ) 15 4.6.6 intCtlrPinFind( ) 15 4.6.7 intCtlrTableArgGet( ) 15 4.6.8 intCtlrTableFlagsGet( ) 15 4.6.9 intCtlrTableIsrGet( ) 15 4.6.10 intCtlrHwConfShow( ) 15 4.6.11 intCtlrTableCreate( ) 15 4.6.12 intCtlrTableFlagsSet( ) 15 4.1.13 intCtlrTableUserSet( ) 15 4.6.14 VXB_INTCTLR_ISR_CALL( ) 15 4.6.15 VXB_INTCTLR_PINENTRY_ENABLED( ) 16 4.6.16 VXB_INTCTLR_PINENTRY_ALLOCATED( ) 16 4.6.17 调度函数 16 4.7 初始化 16 4.8 中断控制器术语和层次 17 4.9 中断优先级 17 4.10 ISR调度 18 4.11 管理动态中断向量 20 4.12 中断输入的内部特征 22 4.13 VxWorks SMP 多处理器问题 22 4.14 调试 22 5 多功能驱动 23 5.1 介绍 23 5.2 概述 23 5.3 VxBus驱动方法 23 5.4 头文件 23 5.5 BSP配置 23 5.6 可用的工具函数 24 5.7 初始化 24 5.8 设备互联 24 5.8.1 交互寄存器 24 5.8.2 共享资源 25 5.8.3 其它交互 25 5.9 子设备的逻辑位置 25 5.10 调试 25 6 网卡驱动 25 6.1 介绍 25 6.1.1 术语 25 6.1.2 网络概述 26 6.2 网络接口驱动程序 27 6.2.1 网络接口驱动概述 27 6.2.2 网络接口驱动程序VxBus驱动方法 28 6.2.3 网络接口驱动程序头文件 33 6.2.4 网络接口驱动程序BSP配置 34 6.2.5 网络接口驱动程序可用的工具程序 34 6.2.6 网络接口驱动程序初始化 42 6.2.7 MUX:连接到网络代码 42 6.2.8 jobQueueLib:延迟中断处理 43 6.2.9 使用Ipcom_pkt包 43 6.2.10 netBufLib:用M_BLKs传输数据 46 6.2.11 协议对驱动程序的影响 48 6.2.12 其它的网络接口驱动问题 48 6.2.13 网络接口驱动程序的调试 48 6.3 PHY驱动程序 56 6.3.1 PHY驱动概述 56 6.3.2 PHY驱动程序的VxBus驱动方法 58 6.3.3 PHY驱动程序头文件 60 6.3.4 PHY驱动的BSP配置 60 6.3.5 PHY驱动程序拥有的工具程序 60 6.3.6 PHY驱动的初始化 62 6.3.7 PHY驱动的调试 62 6.4 无线以太网驱动 62 6.5 层次END驱动 62 7 Non-Volatile RAM驱动 63 7.1 介绍 63 7.2 Non-Volatile RAM 驱动 63 7.2.1 NVRAM驱动概述 63 7.2.2 针对NVRAM驱动VxBus驱动方法 63 7.2.3 头文件 64 7.2.4 NVRAM驱动的BSP配置 64 7.2.5 NVRAM驱动的工具程序 65 7.2.6 NVRAM驱动的初始化 65 7.2.7 NVRAM块大小 65 7.2.8 栈NVRAM实例 66 7.2.9 调试NVRAM驱动 66 7.3 TureFFS Flash文件系统支持 66 7.3.1 TrueFFS概述 66 7.3.2 TrueFFS驱动开发流程 67 8 资源驱动 90 8.1 介绍 90 8.2 概要 90 8.3 VxBus驱动方法 91 8.4 头文件 91 8.5 BSP配置 91 8.6 可以的工具函数 91 8.7 初始化 91 8.8 调试 91 10 存储器驱动 92 10.1 介绍 92 10.2 概要 92 10.3 VxBus驱动方法 92 10.4 头文件 92 10.5 BSP配置 92 10.6 可用的工具程序 93 10.7 初始化 93 10.8 VxWorks文件系统关联接口 93 10.8.1 设备创建 93 10.8.2 处理 95 10.8.3 事件报告 95 10.9 写一个新的存储器驱动 96 10.10 调试 97 12 USB驱动 97 12.1 介绍 97 12.2 风河USB概要 98 12.2.1 USB主机栈驱动 98 12.2.2 USB外设栈驱动 98 12.3 主机控制器和根集线器类驱动 98 12.3.1 VxBus驱动方法 98 12.3.2 头文件 99 12.3.3 BSP配置 99 12.3.4 可用的工具函数 101 12.3.5 初始化 101 12.3.6 调试 101 13 其它驱动类 103 13.1 介绍 103 13.2 概要 103 13.3 VxBus驱动方法 103 13.4 头文件 104 13.5 BSP配置 104 13.6 可以的工具函数 104 13.7 初始化 104 13.8 调试 104
PART I: VXBUS FUNDAMENTALS 1 Getting Started with Device Driver Development .................................... 3 1.1 About Device Drivers ..................................................................................................... 3 1.2 About this Documentation ............................................................................................ 4 1.2.1 Intended Audience ........................................................................................... 4 1.2.2 Navigating this Manual .................................................................................. 4 Experienced VxWorks Device Driver Developers ........................................ 4 Novice VxWorks Device Driver Developers ................................................. 5 1.2.3 Documentation Conventions .......................................................................... 5 1.3 Additional Documentation Resources ....................................................................... 6 2 VxBus and VxBus Device Drivers ............................................................. 7 2.1 Introduction ...................................................................................................................... 7 2.2 About VxBus ................................................................................................................... 7 2.3 VxBus Device Drivers ................................................................................................... 8 2.4 Design Goals ................................................................................................................... 11 2.4.1 Performance ....................................................................................................... 11 2.4.2 Maintenance and Readability .......................................................................... 11 2.4.3 Ease of Configuration ....................................................................................... 12 2.4.4 Performance Testing ......................................................................................... 12 2.4.5 Code Size ............................................................................................................ 12 3 Device Driver Fundamentals ..................................................................... 13 3.1 Introduction ...................................................................................................................... 13 3.2 Driver Classes ................................................................................................................. 14 VxBus Device Driver Developer's Guide, 6.9 iv 3.2.1 General Classes .................................................................................................. 14 Serial Drivers .................................................................................................... 14 Storage Drivers ................................................................................................. 14 Network Interface Drivers .............................................................................. 15 Non-Volatile RAM Drivers ............................................................................. 15 Timer Drivers .................................................................................................... 16 DMA Controller Drivers ................................................................................. 16 Bus Controller Drivers ..................................................................................... 16 USB Drivers ....................................................................................................... 17 Interrupt Controller Drivers ........................................................................... 17 Multifunction Drivers ...................................................................................... 17 Remote Processing Element Drivers ............................................................. 18 Console Drivers ................................................................................................ 18 Resource Drivers .............................................................................................. 19 3.2.2 Other Classes .................................................................................................... 19 3.3 Driver Organization ....................................................................................................... 19 3.3.1 File Location ...................................................................................................... 20 Wind River Drivers ........................................................................................... 20 Third-Party Drivers .......................................................................................... 20 3.3.2 Sample Driver Files: wrsample ....................................................................... 21 3.3.3 Required Files ................................................................................................... 21 Driver Source File ............................................................................................. 22 Component Description File ........................................................................... 24 Driver Configuration Stub Files ..................................................................... 29 README File .................................................................................................... 31 Device Driver Makefiles .................................................................................. 31 3.4 VxBus Driver Methods .................................................................................................. 33 3.4.1 Representing Driver Methods in the Documentation ................................ 33 3.4.2 Parts of a Driver Method ................................................................................. 33 3.4.3 Calling Driver Methods ................................................................................... 34 3.4.4 Advertising Driver Methods .......................................................................... 35 3.4.5 Driver Method Limitations ............................................................................. 36 3.5 Driver Run-time Life Cycle .......................................................................................... 36 3.5.1 Driver Initialization Sequence ........................................................................ 36 Making Assumptions About Initialization Order ....................................... 37 Early in the Boot Process ................................................................................. 37 sysHwInit( ), PLB, and Hardware Discovery ............................................... 37 Driver Registration ........................................................................................... 38 Driver Initialization Phase 1 ........................................................................... 38 Kernel Startup ................................................................................................... 39 Driver Initialization Phase 2 ........................................................................... 39 Driver Initialization Phase 3 ........................................................................... 39 3.5.2 Invoking a Driver Method .............................................................................. 39 3.5.3 Run-time Operation ......................................................................................... 39 Contents v Unloading a Driver .......................................................................................... 40 Removing a Device from the System ............................................................ 40 Dissociating a Device from a Driver .............................................................. 40 3.5.4 Handling a System Shutdown Notification ................................................. 41 3.5.5 Handling Late Driver Registration ................................................................ 41 3.5.6 Driver Registration Order Considerations ................................................... 42 3.5.7 Driver-to-Device Matching and Hardware Availability ............................. 42 PLB ..................................................................................................................... 43 Other Bus Types ................................................................................................ 43 3.6 Services Available to Drivers ....................................................................................... 44 3.6.1 Configuration .................................................................................................... 44 Determining Driver Configuration Information ......................................... 45 Responding to Changes in Device Parameters ............................................ 47 3.6.2 Memory Allocation .......................................................................................... 47 Allocating Memory During System Startup ................................................ 48 Allocating Memory During Normal System Operation ............................. 49 Intermixing Memory Allocation Methods within a Single Driver ........... 49 3.6.3 Non-Volatile RAM Support ............................................................................. 49 3.6.4 Hardware Access .............................................................................................. 50 Finding the Address of the Hardware Registers ......................................... 50 Reading and Writing to the Hardware Registers ........................................ 51 Special Requirements for Hardware Register Access ................................. 53 VxBus Version Considerations ........................................................................ 53 3.6.5 Interrupt Handling ........................................................................................... 54 Overview of Interrupt Handling .................................................................... 54 Interrupt Indexes .............................................................................................. 54 Dynamic Interrupt Handling .......................................................................... 55 Minimizing Work Performed Within an ISR ................................................ 56 3.6.6 Synchronization ................................................................................................ 57 Task-Level Synchronization ............................................................................ 57 Interrupt-Level Synchronization .................................................................... 58 3.6.7 Direct Memory Access (DMA) ....................................................................... 59 vxbDmaBufLib .................................................................................................. 60 DMA Considerations ........................................................................................ 60 Allocating External DMA Engines ................................................................ 63 3.6.8 Atomic Operators ............................................................................................. 65 3.7 BSP Configuration ......................................................................................................... 66 3.7.1 Requirements for PLB Devices ....................................................................... 67 3.7.2 Configuring Device Parameters in the BSP .................................................. 68 3.8 SMP Considerations ...................................................................................................... 69 3.8.1 Lack of Implicit Locking ................................................................................. 69 VxBus Device Driver Developer's Guide, 6.9 vi 3.8.2 True Task-to-Task Contention ......................................................................... 70 3.8.3 Interrupt Routing ............................................................................................. 70 3.8.4 Deferring Interrupt Processing ...................................................................... 71 3.9 Device Memory Mapping in 64-Bit Devices .............................................................. 72 3.10 Physical-to-Virtual Address Translations in 64-Bit VxWorks ................................. 73 3.10.1 64-bit Changes to the Memory Management Model ................................... 73 3.10.2 Porting Drivers That Rely on Physical-to-Virtual Address Translations .. 74 Transfer Using Descriptors .............................................................................. 74 Strategies When Order is Unpredictable ....................................................... 75 4 Development Strategies ............................................................................. 77 4.1 Introduction ...................................................................................................................... 77 4.2 Writing New VxBus Drivers ........................................................................................ 77 4.2.1 Creating the VxBus Infrastructure ................................................................. 78 Writing Driver Source Files ............................................................................. 78 Writing Header Files (Optional) .................................................................... 78 Writing the Component Description File (CDF) .......................................... 78 Writing the Configuration Stub Files ............................................................ 79 Verifying the Infrastructure ............................................................................ 80 4.2.2 Modifying the BSP (Optional) ........................................................................ 80 4.2.3 Adding Debug Code ........................................................................................ 81 4.2.4 Adding the VxBus Driver Methods ............................................................... 81 4.2.5 Removing Global Variables ............................................................................ 82 4.3 VxBus Show Routines ................................................................................................... 83 4.3.1 Available Show Routines ................................................................................ 83 vxBusShow( ) ..................................................................................................... 83 vxbDevStructShow( ) ........................................................................................ 85 vxbDevPathShow( ) .......................................................................................... 86 4.3.2 PCI Show Routines .......................................................................................... 86 pciDevShow( ) ................................................................................................... 87 vxbPciDeviceShow( ) ........................................................................................ 87 vxbPciHeaderShow( ) ....................................................................................... 88 vxbPciFindDeviceShow( ) ................................................................................ 89 vxbPciFindClassShow( ) ................................................................................... 89 vxbPciConfigTopoShow( ) ............................................................................... 90 4.3.3 Using Show Routines from Software ............................................................ 91 4.3.4 Configuring Show Routines into VxWorks .................................................. 93 4.4 Debugging ....................................................................................................................... 94 4.4.1 Configuring Show Routines ........................................................................... 94 Contents vii 4.4.2 Deferring Driver Registration ........................................................................ 95 4.4.3 Including Debug Code .................................................................................... 95 4.4.4 Confirming Register Access ............................................................................ 96 4.4.5 Increasing the Size of HWMEM_POOL ........................................................ 96 4.4.6 Confirming Device and Driver Name Matches ........................................... 96 5 Driver Release Procedure .......................................................................... 99 5.1 Introduction ..................................................................................................................... 99 5.2 Driver Source Location .................................................................................................. 100 5.3 Driver-Specific Directories ............................................................................................ 101 5.4 Driver Installation and the README File ................................................................ 102 5.5 Driver Packaging ............................................................................................................ 103 5.6 Driver Release Procedure ............................................................................................. 104 PART II: DEVICE DRIVER PORTING 6 Class-Specific Driver Development .......................................................... 107 6.1 About VxBus Driver Classes ........................................................................................ 107 6.2 Before You Begin ............................................................................................................. 107 6.3 About the Class-Specific Driver Documentation ..................................................... 108 7 Bus Controller Drivers ................................................................................ 109 7.1 Introduction ..................................................................................................................... 109 7.2 Overview .......................................................................................................................... 109 7.3 VxBus Driver Methods .................................................................................................. 111 7.3.1 {busCtlrDevCfgRead}( ) ................................................................................... 111 7.3.2 {busCtlrCfgRead}( ) ........................................................................................... 112 7.3.3 {busCtlrDevCfgWrite}( ) ................................................................................... 113 7.3.4 {busCtlrCfgWrite}( ) .......................................................................................... 113 7.3.5 {busCtlrDevCtlr}( ) ............................................................................................ 114 7.3.6 {busCtlrAccessOverride}( ) .............................................................................. 115 Override for (*busCfgRead)( ) ......................................................................... 115 Override for (*busCfgWrite)( ) ........................................................................ 116 Override for (*vxbDevControl)( ) ................................................................... 116 VxBus Device Driver Developer's Guide, 6.9 viii 7.3.7 {busCtlrCfgInfo}( ) ............................................................................................. 116 7.3.8 {busCtlrBaseAddrCvt}( ) .................................................................................. 117 7.3.9 {vxbDevRegMap}( ) ........................................................................................... 117 Specifying a Predefined Transaction Type ..................................................... 119 Providing a New Transaction Type ............................................................... 120 7.3.10 {vxbIntDynaVecProgram}( ) ............................................................................. 122 7.4 Header Files ..................................................................................................................... 122 7.5 BSP Configuration .......................................................................................................... 123 7.5.1 PCI Configuration ............................................................................................ 124 7.5.2 PCI Autoconfiguration .................................................................................... 124 7.6 Available Utility Routines ............................................................................................ 125 7.6.1 PCI Configuration ............................................................................................ 125 7.6.2 PCI Autoconfiguration ..................................................................................... 126 7.6.3 vxbBusAnnounce( ) ........................................................................................... 126 7.6.4 vxbPciBusTypeInit( ) ......................................................................................... 127 7.7 Initialization .................................................................................................................... 127 7.7.1 Initialization Example ..................................................................................... 128 vxbBusAnnounce( ) ........................................................................................... 129 vxbDeviceAnnounce( ) ..................................................................................... 130 vxbDevStructAlloc( ) ........................................................................................ 130 vxbDevStructFree( ) .......................................................................................... 130 7.8 Debugging ........................................................................................................................ 130 8 Direct Memory Access Drivers .................................................................. 131 8.1 Introduction ..................................................................................................................... 131 8.2 Overview ........................................................................................................................... 131 8.3 VxBus Driver Methods ................................................................................................... 132 8.3.1 {vxbDmaResourceGet}( ) .................................................................................. 132 8.3.2 {vxbDmaResourceRelease}( ) ........................................................................... 133 8.3.3 {vxbDmaResDedicatedGet}( ) .......................................................................... 133 8.4 Header Files ...................................................................................................................... 133 8.5 BSP Configuration .......................................................................................................... 134 8.6 Available Utility Routines ............................................................................................. 134 8.7 Initialization ..................................................................................................................... 134 Contents ix 8.8 DMA System Structures and Routines ....................................................................... 134 8.8.1 (*dmaRead)( ) ..................................................................................................... 135 8.8.2 (*dmaReadAndWait)( ) ..................................................................................... 135 8.8.3 (*dmaWrite)( ) .................................................................................................... 135 8.8.4 (*dmaWriteAndWait)( ) .................................................................................... 136 8.8.5 (*dmaCancel)( ) .................................................................................................. 136 8.8.6 (*dmaPause)( ) ................................................................................................... 136 8.8.7 (*dmaResume)( ) ................................................................................................ 136 8.8.8 (*dmaStatus)( ) ................................................................................................... 136 8.9 Debugging ....................................................................................................................... 137 9 I2C Drivers ................................................................................................... 139 9.1 Introduction ...................................................................................................................... 139 9.2 Overview ........................................................................................................................... 139 9.3 VxBus Driver Methods ................................................................................................... 140 9.4 Header Files ...................................................................................................................... 141 9.5 BSP Configuration .......................................................................................................... 141 9.6 Initialization ..................................................................................................................... 143 9.7 Implementing Driver Service Routines ...................................................................... 144 (*VXB_I2C_LOCK_BUS_FUNC)( ) ................................................................. 145 (*VXB_I2C_UNLOCK_BUS_FUNC)( ) ........................................................... 145 (*VXB_I2C_START_FUNC)( ) .......................................................................... 145 (*VXB_I2C_STOP_FUNC)( ) ............................................................................ 146 (*VXB_I2C_READ_FUNC)( ) ........................................................................... 146 (*VXB_I2C_WRITE_FUNC)( ) ......................................................................... 146 (*VXB_I2C_DEV_READ)( ) .............................................................................. 147 (*VXB_I2C_DEV_WRITE)( ) ............................................................................ 147 9.8 Device Driver ................................................................................................................... 148 9.8.1 Generic I2C Devices .......................................................................................... 149 10 Interrupt Controller Drivers ........................................................................ 151 10.1 Introduction ..................................................................................................................... 151 10.2 Overview .......................................................................................................................... 152 Interrupt Identification .................................................................................... 152 Interrupt Controller Driver Responsibilities ................................................. 152 Interrupt Controller Configurations ............................................................... 153 Dynamic Vectors ................................................................................................ 153 Interrupt Controller Drivers and Multiprocessing ....................................... 154 VxBus Device Driver Developer's Guide, 6.9 x 10.3 VxBus Driver Methods .................................................................................................. 154 10.3.1 Basic Methods .................................................................................................... 154 {vxbIntCtlrAlloc}( ) ............................................................................................ 154 {vxbIntCtlrFree}( ) ............................................................................................. 155 {vxbIntCtlrConnect}( ) ...................................................................................... 155 {vxbIntCtlrDisconnect}( ) ................................................................................. 155 {vxbIntCtlrEnable}( ) ......................................................................................... 156 {vxbIntCtlrDisable}( ) ........................................................................................ 156 10.3.2 Dynamic Vector Methods ................................................................................ 156 {vxbIntDynaVecConnect}( ) ............................................................................. 156 10.3.3 Multiprocessor Methods ................................................................................. 157 {vxbIntCtlrIntReroute}( ) .................................................................................. 157 {vxbIntCtlrCpuReroute}( ) .............................................................................. 157 {vxIpiControlGet}( ) .......................................................................................... 157 10.4 Header Files ...................................................................................................................... 158 vxbIntrCtlr.h ....................................................................................................... 158 vxbIntCtlrLib.h .................................................................................................. 158 10.5 BSP Configuration .......................................................................................................... 158 10.5.1 Interrupt Input Table ........................................................................................ 159 10.5.2 Dynamic Vector Table ....................................................................................... 160 10.5.3 CPU Routing Table ............................................................................................ 162 10.5.4 Interrupt Priority ............................................................................................... 163 10.5.5 Crossbar Routing Table .................................................................................... 163 10.6 Available Utility Routines ............................................................................................. 164 10.6.1 intCtlrHwConfGet( ) ......................................................................................... 165 10.6.2 intCtlrISRAdd( ) ................................................................................................ 165 10.6.3 intCtlrISRDisable( ) ........................................................................................... 165 10.6.4 intCtlrISREnable( ) ............................................................................................ 166 10.6.5 intCtlrISRRemove( ) .......................................................................................... 166 10.6.6 intCtlrPinFind( ) ................................................................................................ 166 10.6.7 intCtlrTableArgGet( ) ........................................................................................ 166 10.6.8 intCtlrTableFlagsGet( ) ..................................................................................... 166 10.6.9 intCtlrTableIsrGet( ) .......................................................................................... 166 10.6.10 intCtlrHwConfShow( ) ..................................................................................... 166 10.6.11 intCtlrTableCreate( ) ......................................................................................... 167 10.6.12 intCtlrTableFlagsSet( ) ...................................................................................... 167 10.6.13 intCtlrTableUserSet( ) ....................................................................................... 167 10.6.14 VXB_INTCTLR_ISR_CALL( ) ......................................................................... 167 10.6.15 VXB_INTCTLR_PINENTRY_ENABLED( ) ................................................... 167 Contents xi 10.6.16 VXB_INTCTLR_PINENTRY_ALLOCATED( ) ............................................. 167 10.6.17 Dispatch Routines ............................................................................................. 168 vxbIntDynaCtlrInputInit( ) .............................................................................. 168 vxbIntDynaVecProgram( ) ............................................................................... 168 vxbIntDynaVecErase( ) ..................................................................................... 169 10.7 Initialization ..................................................................................................................... 169 10.8 Interrupt Controller Topologies and Hierarchies ..................................................... 169 10.9 Interrupt Priority ............................................................................................................. 170 10.10 ISR Dispatch .................................................................................................................... 171 10.11 Managing Dynamic Interrupt Vectors ........................................................................ 173 Configuring Dynamic Vectors Using the Service Driver Routines ............ 174 Configuring Dynamic Vectors in the BSP ..................................................... 174 Programming Dynamic Vectors ...................................................................... 175 Determining Dynamic Vector Values ............................................................ 175 10.12 Internal Representation of Interrupt Inputs .............................................................. 176 10.13 Multiprocessor Issues with VxWorks SMP ................................................................ 177 10.13.1 Routing Interrupt Inputs to Individual CPUs .............................................. 177 10.13.2 Interprocessor Interrupts ................................................................................. 178 10.13.3 Limitations in Multiprocessor Systems .......................................................... 182 10.14 Debugging ........................................................................................................................ 182 11 Multifunction Drivers .................................................................................. 185 11.1 Introduction ...................................................................................................................... 185 11.2 Overview ........................................................................................................................... 185 11.3 VxBus Driver Methods ................................................................................................... 186 11.4 Header Files ...................................................................................................................... 186 11.5 BSP Configuration .......................................................................................................... 186 11.6 Available Utility Routines ............................................................................................. 187 vxbDevStructAlloc( ) ........................................................................................ 187 vxbDeviceAnnounce( ) ..................................................................................... 187 vxbDevRemovalAnnounce( ) .......................................................................... 187 vxbDevStructFree( ) .......................................................................................... 188 vxbBusAnnounce( ) ........................................................................................... 188 11.7 Initialization ..................................................................................................................... 188 11.8 Device Interconnections ................................................................................................ 188 VxBus Device Driver Developer's Guide, 6.9 xii 11.8.1 Interleaved Registers ........................................................................................ 188 11.8.2 Shared Resources ............................................................................................... 189 11.8.3 Other Interactions ............................................................................................. 190 11.9 Logical Location of Subordinate Devices ................................................................... 190 11.10 Debugging ........................................................................................................................ 190 12 Network Drivers .......................................................................................... 191 12.1 Introduction ...................................................................................................................... 191 12.1.1 Terminology ....................................................................................................... 191 12.1.2 Networking Overview ..................................................................................... 192 Seven Layer OSI Model .................................................................................... 192 Transmission Media and VxWorks ................................................................. 192 Protocols ............................................................................................................. 193 12.2 Network Interface Drivers ............................................................................................. 193 12.2.1 Network Interface Driver Overview .............................................................. 193 IPNET-Native Drivers ...................................................................................... 193 Functional Modules .......................................................................................... 194 Network Driver Interrupts ............................................................................. 195 12.2.2 VxBus Driver Methods for Network Interface Drivers .............................. 196 {muxDevConnect}( ) ......................................................................................... 196 {muxDevConnect2}( ) ....................................................................................... 197 {vxbDrvUnlink}( ) .............................................................................................. 199 {miiMediaUpdate}( ) ......................................................................................... 199 {miiRead}( ) ........................................................................................................ 200 {miiWrite}( ) ........................................................................................................ 201 12.2.3 Header Files for Network Interface Drivers ................................................. 201 12.2.4 BSP Configuration for Network Interface Drivers ...................................... 202 12.2.5 Available Utility Routines for Network Interface Drivers ......................... 203 MUX Interactions .............................................................................................. 203 Job Queueing ..................................................................................................... 204 Buffer Management .......................................................................................... 205 DMA Support .................................................................................................... 209 PHY and MII bus interactions ......................................................................... 210 12.2.6 Initialization for Network Interface Drivers ................................................ 212 12.2.7 MUX: Connecting to Networking Code ........................................................ 212 12.2.8 jobQueueLib: Deferring ISRs ........................................................................... 213 12.2.9 Working with Ipcom_pkt Packets ................................................................... 214 Supporting Scatter-Gather with IPNET-Native Drivers .............................. 217 12.2.10 netBufLib: Transferring Data with M_BLKs ................................................ 218 12.2.11 Protocol Impact on Drivers .............................................................................. 220 Contents xiii 12.2.12 Other Network Interface Driver Issues .......................................................... 232 Receive Handling Method ............................................................................... 233 Receive Stall Handling ..................................................................................... 240 12.2.13 Debugging Network Interface Drivers .......................................................... 241 Using VxBus Show Routines ........................................................................... 241 Deferring Driver Registration ......................................................................... 241 Pairing with a PHY instance ............................................................................ 242 Stress Testing ...................................................................................................... 242 Netperf Test Suite .............................................................................................. 243 Interrupt Validation .......................................................................................... 243 Additional Tests ................................................................................................. 243 12.3 PHY Drivers ...................................................................................................................... 249 12.3.1 PHY Driver Overview ...................................................................................... 250 PHY Device Probing and Discovery .............................................................. 250 MAC and MII Bus Relationship ...................................................................... 251 Generic PHY Driver Support ........................................................................... 252 Generic TBI Driver Support ............................................................................. 252 12.3.2 VxBus Driver Methods for PHY Drivers ....................................................... 253 Upper Edge Methods ........................................................................................ 253 Lower Edge Methods ....................................................................................... 253 12.3.3 Header Files for PHY Drivers ......................................................................... 255 12.3.4 BSP Configuration for PHY Drivers ............................................................... 255 12.3.5 Available Utility Routines for PHY Drivers .................................................. 255 Upper Edge Utility Routines ........................................................................... 256 Lower Edge Utility Routines ........................................................................... 256 12.3.6 Initialization for PHY Drivers ......................................................................... 257 12.3.7 Debugging PHY Drivers .................................................................................. 257 12.4 Wireless Ethernet Drivers .............................................................................................. 258 12.5 Hierarchical END Drivers ............................................................................................. 258 13 Non-Volatile RAM Drivers .......................................................................... 259 13.1 Introduction ...................................................................................................................... 259 NVRAM Drivers and TrueFFS ........................................................................ 259 13.2 Non-Volatile RAM Drivers ........................................................................................... 260 13.2.1 NVRAM Driver Overview ............................................................................... 260 13.2.2 VxBus Driver Methods for NVRAM Drivers ................................................ 260 {nonVolGet}( ) .................................................................................................... 260 {nonVolSet}( ) ..................................................................................................... 261 13.2.3 Header Files ....................................................................................................... 261 13.2.4 BSP Configuration for NVRAM Drivers ....................................................... 261 VxBus Device Driver Developer's Guide, 6.9 xiv 13.2.5 Utility Routines for NVRAM Drivers ............................................................ 262 13.2.6 Initialization for NVRAM Drivers .................................................................. 262 13.2.7 NVRAM Block Sizes ......................................................................................... 262 13.2.8 Stacking NVRAM Instances ............................................................................ 263 13.2.9 Debugging NVRAM Drivers ........................................................................... 263 13.3 Flash File System Support with TrueFFS ................................................................... 263 13.3.1 TrueFFS Overview ............................................................................................. 264 Core Layer .......................................................................................................... 264 MTD Layer ........................................................................................................ 264 Socket Layer ....................................................................................................... 264 Flash Translation Layer .................................................................................... 265 13.3.2 TrueFFS Driver Development Process ........................................................... 265 Using MTD-Supported Flash Devices ........................................................... 265 Writing MTD Components .............................................................................. 269 Socket Drivers .................................................................................................... 276 Flash Translation Layer .................................................................................... 282 14 RapidIO Drivers ........................................................................................... 297 14.1 Introduction ...................................................................................................................... 297 14.2 Overview ........................................................................................................................... 297 14.3 VxBus Driver Methods ................................................................................................... 299 {vxbRapidIoCtlrInfoGet}( ) .............................................................................. 299 {sharedMemSupportAPIGet}( ) ....................................................................... 300 {vxbMsgApiGet}( ) ............................................................................................ 300 14.4 Header Files ...................................................................................................................... 301 14.5 BSP Configuration .......................................................................................................... 301 RapidIO Bus Controller Driver ....................................................................... 301 Virtual Message Network Device Driver ....................................................... 301 14.6 Initialization ..................................................................................................................... 302 Phase 1 ................................................................................................................ 302 Phase 2 ................................................................................................................ 302 Phase 3 ................................................................................................................ 303 14.7 Implementing Driver Service Routines ...................................................................... 303 RapidIO Bus Controller Driver ....................................................................... 303 Message Controller Driver ............................................................................... 307 15 Resource Drivers ........................................................................................ 311 15.1 Introduction ...................................................................................................................... 311 Contents xv 15.2 Overview ........................................................................................................................... 311 15.3 VxBus Driver Methods ................................................................................................... 312 15.4 Header Files ...................................................................................................................... 312 15.5 BSP Configuration .......................................................................................................... 312 15.6 Available Utility Routines ............................................................................................. 313 15.7 Initialization ..................................................................................................................... 313 15.8 Debugging ........................................................................................................................ 313 16 Serial Drivers ............................................................................................... 315 16.1 Introduction ...................................................................................................................... 315 16.2 Overview ........................................................................................................................... 315 16.3 VxBus Driver Methods ................................................................................................... 316 16.3.1 {sioChanGet}( ) ................................................................................................... 316 16.3.2 {sioChanConnect}( ) .......................................................................................... 317 16.4 Header Files ...................................................................................................................... 317 16.5 BSP Configuration .......................................................................................................... 318 16.6 Available Utility Routines ............................................................................................. 318 16.7 Initialization ..................................................................................................................... 318 16.8 Polled Mode Versus Interrupt-Driven Mode ............................................................. 318 16.9 SIO_CHAN and SIO_DRV_FUNCS ............................................................................ 319 16.10 WDB ................................................................................................................................... 321 16.10.1 WDB and Kernel Initialization ........................................................................ 321 16.11 Serial Drivers, Initialization, and Interrupts ............................................................. 321 16.11.1 WDB and Interrupts ......................................................................................... 322 16.11.2 Initialization Order and Interrupts ................................................................. 322 16.11.3 Initialization Order ........................................................................................... 323 16.12 Debugging ........................................................................................................................ 323 17 SPI Drivers ................................................................................................... 325 17.1 Introduction ...................................................................................................................... 325 17.2 Overview ........................................................................................................................... 325 VxBus Device Driver Developer's Guide, 6.9 xvi 17.3 VxBus Driver Methods ................................................................................................... 326 17.4 Header Files ...................................................................................................................... 326 17.5 BSP Configuration .......................................................................................................... 327 17.6 Initialization ..................................................................................................................... 328 17.7 Implementing Driver Service Routines ...................................................................... 329 17.8 Device Driver ................................................................................................................... 329 17.8.1 SPI_EEPROM ..................................................................................................... 330 17.8.2 SPI Flash ............................................................................................................. 330 18 Storage Drivers ........................................................................................... 333 18.1 Introduction ...................................................................................................................... 333 18.2 Overview ........................................................................................................................... 333 Updates in VxWorks 6.9, Update Pack 2, Service Pack 1 ............................ 334 Updates in VxWorks 6.9, Update Pack 3, Service Pack 3 ............................ 334 18.3 VxBus Driver Methods ................................................................................................... 335 18.4 Header Files ...................................................................................................................... 335 18.5 BSP Configuration .......................................................................................................... 336 18.6 Available Utility Routines ............................................................................................. 336 erfHandlerRegister( ) and erfHandlerUnregister( ) ..................................... 336 erfEventRaise( ) ................................................................................................. 336 xbdAttach( ) ....................................................................................................... 336 bio_done( ) .......................................................................................................... 337 18.7 Initialization ..................................................................................................................... 337 18.8 Interface with VxWorks File Systems ......................................................................... 337 18.8.1 Device Creation ................................................................................................. 337 ERF Registration ................................................................................................ 338 Advertisement of XBD Methods ..................................................................... 338 ERF New Device Notification ......................................................................... 339 18.8.2 Processing ........................................................................................................... 340 xbd_request processing .................................................................................... 340 18.8.3 Event Reporting ................................................................................................. 341 18.9 Writing New Storage Drivers ........................................................................................ 342 18.10 Writing New SD/MMC/SDIO host controller Drivers ............................................ 343 18.11 Device Driver ................................................................................................................... 344 Contents xvii 19 Timer Drivers ............................................................................................... 345 19.1 Introduction ...................................................................................................................... 345 19.2 Overview ........................................................................................................................... 345 19.3 VxBus Driver Methods ................................................................................................... 346 19.4 Header Files ...................................................................................................................... 349 19.5 BSP Configuration .......................................................................................................... 349 19.6 Available Utility Routines ............................................................................................. 349 19.7 Initialization ..................................................................................................................... 349 19.8 Data Structure Layout ..................................................................................................... 350 19.9 Implementing Driver Service Routines ...................................................................... 351 19.9.1 (*timerAllocate)( ) .............................................................................................. 351 19.9.2 (*timerRelease)( ) ............................................................................................... 351 19.9.3 (*timerRolloverGet)( ) ....................................................................................... 352 19.9.4 (*timerCountGet)( ) ........................................................................................... 352 19.9.5 (*timerDisable)( ) ............................................................................................... 353 19.9.6 (*timerEnable)( ) ................................................................................................ 354 19.9.7 (*timerISRSet)( ) ................................................................................................. 354 19.9.8 (*timerEnable64)( ) ............................................................................................ 355 19.9.9 (*timerRolloverGet64)( ) ................................................................................... 355 19.9.10 (*timerCountGet64)( ) ....................................................................................... 356 19.10 Integrating a Timer Driver ............................................................................................ 357 19.10.1 VxWorks System Clock .................................................................................... 357 19.10.2 VxWorks Auxiliary Clock ................................................................................ 359 19.10.3 VxWorks Timestamp Driver ............................................................................ 360 19.11 Debugging ........................................................................................................................ 361 19.12 SMP Considerations ....................................................................................................... 361 20 USB Drivers ................................................................................................. 363 20.1 Introduction ...................................................................................................................... 363 20.2 Wind River USB Overview ............................................................................................ 363 20.2.1 USB Host Stack Drivers .................................................................................... 364 VxBus Model Drivers ....................................................................................... 364 Other Host Drivers ............................................................................................ 364 VxBus Device Driver Developer's Guide, 6.9 xviii 20.2.2 USB Target Stack ............................................................................................... 364 20.3 Host Controller and Root Hub Class Drivers ............................................................ 365 20.3.1 VxBus Driver Methods ..................................................................................... 365 20.3.2 Header Files ....................................................................................................... 365 20.3.3 BSP Configuration ............................................................................................. 366 20.3.4 Available Utility Routines ................................................................................ 367 20.3.5 Initialization ....................................................................................................... 367 20.3.6 Debugging .......................................................................................................... 368 21 Other Driver Classes .................................................................................. 371 21.1 Introduction ...................................................................................................................... 371 21.2 Overview ........................................................................................................................... 371 21.3 VxBus Driver Methods ................................................................................................... 372 21.4 Header Files ...................................................................................................................... 373 21.5 BSP Configuration .......................................................................................................... 373 21.6 Available Utility Routines ............................................................................................. 373 21.7 Initialization ..................................................................................................................... 373 21.8 Debugging ........................................................................................................................ 374 PART III: DEVICE DRIVER PORTING 22 Legacy Drivers and Migration ................................................................... 377 22.1 Migration Overview ....................................................................................................... 377 22.2 Legacy Driver Overview ................................................................................................ 377 23 Migrating to VxBus ..................................................................................... 379 23.1 Overview ........................................................................................................................... 379 23.2 Available Resources ........................................................................................................ 379 Template Drivers ............................................................................................... 379 23.3 Porting an Existing VxWorks Driver to VxBus .......................................................... 380 23.3.1 Verifying Your Hardware and Driver Code .................................................. 380 23.3.2 Creating the VxBus Infrastructure ........
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值