Spring 2013 Diamond Light Source OSI and Architecture

  • Slides: 16
Download presentation
Spring 2013 – Diamond Light Source OSI and Architecture Independent Device Driver Jim Chen

Spring 2013 – Diamond Light Source OSI and Architecture Independent Device Driver Jim Chen (jim. chen@hytec-electronics. co. uk) HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Contents • • • The problem Things in

Spring 2013 – Diamond Light Source Contents • • • The problem Things in common The solution Exceptions and caveats Conclusions HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source EPICS Device Support to “Device Driver” • •

Spring 2013 – Diamond Light Source EPICS Device Support to “Device Driver” • • Since introducing of asyn, EPICS device support actually becomes device driver Asyn takes over the interfaces with records – the device support layer Asyn standardize the interfaces to generic data type Device driver only focuses on hardware access and controls ---- Much easier! HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source What’s the Problem The operating systems: Vx. Works

Spring 2013 – Diamond Light Source What’s the Problem The operating systems: Vx. Works Solaris Free. BSD RTEMS Windows Linux Darwin …… The architectures: Standalone via TCP/IP BUS VME ATCA/u. TC A PCI/PCIe/c. PCI/PXI PCIe 6335 PMC FPGA Ether. Cat Raspberry PI c. PCI u. TCA 7003 Cubie board D C VME 8004 C o o n IOC 8800 IOC 9010 The processors (with different BSP or device driver): PPC (MVMExxxx) Intel (Concurrent/Tews/Acromag) HYTEC ELECTRONICS LIMITED ARM ……

Spring 2013 – Diamond Light Source For a single ADC for example Linux VME

Spring 2013 – Diamond Light Source For a single ADC for example Linux VME u. TCA c. PCI Standalone IOC 9010 IOC 8800 D C … Concurrent PPC Kontron … Eurotech PC 104 Raspberry PI /Cubie Board Advantech … Intel … • The BSP or processor device driver could be totally different • Some have kernel-user space like Linux, Windows. Some just have one space – Vx. Works, RTEMS • VME architecture has AM code plus addr/data bit and even CR/CSR etc whereas PCI doesn’t HYTEC ELECTRONICS LIMITED C o n o

Spring 2013 – Diamond Light Source Multiply by Different OS (An exaggerated figure) Vx.

Spring 2013 – Diamond Light Source Multiply by Different OS (An exaggerated figure) Vx. Works Solaris Free. BSD RTEMS Windows Linux Darwin …… PPC Intel PPCIntel PPC PPC Intel Intel PPCIntel PPC Intel PPC Intel PPCPPC Intel Intel PPC Intel PPC Intel. PPC PPC Intel PPC Intel How about DAC, Scaler, Digital, SIO, Step motor, Timing modules, frame grabber…. . HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Hold on – we’ve got OSI model –

Spring 2013 – Diamond Light Source Hold on – we’ve got OSI model – Operating System Independent. It takes over the operating dependant calls (interrupt, mutex, event, message queue, signals, thread, math etc) Yet down to the device driver level, we still face architecture differences and processor specific BSP/kernel driver differences HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Things in Common For all I/O moduels such

Spring 2013 – Diamond Light Source Things in Common For all I/O moduels such as ADC, DAC, Scaler, Digital, SIO, Step motor, Timing modules, frame grabber etc devices…. • • Register access Memory access Interrupt management DMA or BLT or MBLT • Most processors use PCI/PCIe to bridge the other side, implemented by Universe II/Tsi 148/Plx chips HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source The (my) solution – ipac + arch specific

Spring 2013 – Diamond Light Source The (my) solution – ipac + arch specific • Utilise Andrew Johnson’s ipac module + arch specific interface to BSP/kernel device driver • What ipac provides: EPICS device driver • Generic base addresses mapping • ipm. Base. Addr • Generic interrupt management Standard ipac/asyn interfaces • ipm. Irq. Cmd • ipm. Int. Connect Arch specific Interface BSP/kernel driver • • • BSP or kernel device driver • mmap/sys. Busto. Local • connect. Interrupt/wait. Interrupt • dma. Init/dma. Request This applies to both carrier card case and normal modules as well (see examples) The only thing ipac doesn’t have is DMA support at the moment HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Example 1 -- Carrier Card + IP BUS

Spring 2013 – Diamond Light Source Example 1 -- Carrier Card + IP BUS VME 8004 PCIe 6335 Standalone IPs IOC 9010 PC 104 ADC u. TCA 7002 DAC u. TCA 7003 IOC 8800 Cubie board /Raspberry PI D C HYTEC ELECTRONICS LIMITED C o n o SCALER

Spring 2013 – Diamond Light Source Example 1 -- Carrier Card + IP EPICS

Spring 2013 – Diamond Light Source Example 1 -- Carrier Card + IP EPICS Device Driver Ipac-2. 11 Vx. Works/RTEMS VME PPC drv. Hy 8002. c drv. Tip 810. c drv. Xy 9660. c …… dev. Lib RTEMS Intel PCI/PCIe drv. Hy. RTEMSCarrier. c dev. Lib 2 Linux VME Intel Concurrent drv. Hy 8002 Concurrent. c cct Kernel Driver + API Device HYTEC ELECTRONICS LIMITED Linux PCI/PCIe Intel drv. Hy. Linux. Carrier. c Hytec Kernel Driver + API

Spring 2013 – Diamond Light Source Example 2 – Micro Research Timing Module VME

Spring 2013 – Diamond Light Source Example 2 – Micro Research Timing Module VME c. PCI PMC c. RIO PXI …… • • They have the nearly identical (at least to now) register/memory configuration They have similar interrupt scheme MRF provides a generic API function set for Linux, based on memory pointer! With the arch specific interface module in place, we can use this generic API for all HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Example 2 – Micro Research Timing Module EPICS

Spring 2013 – Diamond Light Source Example 2 – Micro Research Timing Module EPICS Device Driver Ipac-2. 11 Vx. Works/RTEMS VME PPC drv. Mrf. VMEPPC. c dev. Lib Linux VME Intel drv. Mrf. VMEcct. c Kernel Driver + API With CR/CSR support Device HYTEC ELECTRONICS LIMITED Linux c. PCI Intel drv. Mrfc. PCIcct. c Kernel Driver + API ……

Spring 2013 – Diamond Light Source Exceptions and Caveats • • • mmap –

Spring 2013 – Diamond Light Source Exceptions and Caveats • • • mmap – not all OS support Byte swap – endian problem. Not all processor boards support it. Then need be 32_to_cpu etc. Serial port, Ethernet. This needs device driver. Can be done by this model. Standalone unit, like Raspberry PI/Cubieboard IOC 8800, the interface cound be SPI or just I/O operations. We might be able to utilise the macro: be 32_to_cpu – developing. . DMA support – no common support in EPICS by far. Maybe a generic dma. Init, dma. Request in ipac plus drv. XXX. c? HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Conclusion • • • EPICS Device driver to

Spring 2013 – Diamond Light Source Conclusion • • • EPICS Device driver to hardware has common operations such as register, memory access, interrupt management and DMA operations The ipac module happens to provide these services in standard interfaces. We can utilise ipac plus OS/Arch specific module to mezzanine the OS/ARCH specific which hides the complex operations. And it gives a common EPICS device driver for I/O peripherals – easy to maintain. Discussion • Is this the right place? • A DMA interface? HYTEC ELECTRONICS LIMITED --- leave these to the core developers

Spring 2013 – Diamond Light Source Thank You! HYTEC ELECTRONICS LIMITED

Spring 2013 – Diamond Light Source Thank You! HYTEC ELECTRONICS LIMITED