background image

i.MX51 EVK Linux Reference Manual

Freescale Semiconductor

23-1

 

Chapter 23  
Symmetric/Asymmetric Hashing and Random Accelerator 
(Sahara) Drivers

23.1

Overview

The Symmetric/Asymmetric Hashing and Random Accelerator (Sahara) implements block encryption 
algorithms, hashing algorithms, a stream cipher algorithm, public key algorithms, and pseudo-random 
number generation. It has a slave IP bus interface for the host to write configuration and command 
information, and to read status information. It also has a DMA controller, with an AHB bus interface, to 
reduce the burden on the host to move the required data to and from memory.

23.2

Software Operation

23.2.1

API Notes

Kernel users should not use blocking mode unless the code is operating on behalf of the kernel process 
which needs to sleep because blocking mode attempts to put the current process to sleep. Therefore 
blocking mode cannot be used from bottom half code or from interrupt code.

Kernel users must provide a 

kmalloc

-ed buffer address for all data types (key structures, context structures, 

input/output buffers, and so on)

User-mode users should beware of (or even avoid) using the stack for I/O, as cache line boundaries can 
cause problems. This can even be true for such simple things as having a context object on the stack, or 
retrieving a random number into a 

uint32_t

 stack variable. This applies to key structures, context 

structures, and input/output buffers.

23.2.2

Architecture

The conceptual model is shown in 

Figure 23-1

. All of the processes in 

Figure 23-1

 are implemented as 

common code, except for the following platform-centric processes:

UM Extension

Init/Cleanup

Translator

Completion Notification

Summary of Contents for i.MX51 EVK

Page 1: ...Part Number 924 76374 Rev 10 11 01 11 2010 i MX51 EVK Linux Reference Manual...

Page 2: ...ch unintended or unauthorized application Buyer shall indemnify and hold Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs d...

Page 3: ...es 1 2 2 1 4 Interrupt Source Code Structure 1 2 2 1 5 Interrupt Programming Interface 1 3 2 2 Timer 1 3 2 2 1 Timer Hardware Operation 1 3 2 2 2 Timer Software Operation 1 3 2 2 3 Timer Features 1 3...

Page 4: ...Menu Configuration Options 2 3 3 6 Programming Interface 2 4 3 7 Usage Example 2 4 Chapter 3 MC13892 Regulator Driver 3 1 Hardware Operation 3 1 3 2 Driver Features 3 1 3 3 Software Operation 3 1 3 4...

Page 5: ...ce 7 2 Chapter 8 Dynamic Voltage Frequency Scaling DVFS Driver 8 1 Hardware Operation 8 1 8 2 Software Operation 8 1 8 3 Source Code Structure 8 2 8 4 Menu Configuration Options 8 2 8 4 1 Board Config...

Page 6: ...Interface 11 9 Chapter 12 Video for Linux Two V4L2 Driver 12 1 V4L2 Capture Device 12 2 12 1 1 V4L2 Capture IOCTLs 12 2 12 1 2 Use of the V4L2 Capture APIs 12 4 12 2 V4L2 Output Device 12 5 12 2 1 V4L...

Page 7: ...6 4 Chapter 17 Advanced Linux Sound Architecture ALSA System on a Chip ASoC Sound Driver 17 1 SoC Sound Card 17 1 17 1 1 Stereo Codec Features 17 2 17 1 2 Sound Card Information 17 2 17 2 ASoC Driver...

Page 8: ...7 Programming Interface 20 4 20 8 Interrupt Requirements 20 4 20 9 Device Specific Information 20 4 Chapter 21 Fast Ethernet Controller FEC Driver 21 1 Hardware Operation 21 1 21 2 Software Operation...

Page 9: ...s 23 1 23 2 2 Architecture 23 1 23 2 2 1 Registration List 23 2 23 2 2 2 Command Queue 23 2 23 2 2 3 Result Pools 23 3 23 2 2 4 Sahara Hardware 23 3 23 2 2 5 Initialize and Cleanup 23 3 23 2 2 6 Sahar...

Page 10: ...ver 26 1 Hardware Operation 26 1 26 2 Software Operation 26 1 26 2 1 SPI Sub System in Linux 26 1 26 2 2 Software Limitations 26 3 26 2 3 Standard Operations 26 3 26 2 4 CSPI Synchronous Operation 26...

Page 11: ...hitectural Overview 29 2 29 2 Hardware Operation 29 2 29 3 Software Operation 29 2 29 4 Driver Features 29 3 29 5 Source Code Structure 29 4 29 6 Menu Configuration Options 29 5 29 7 Programming Inter...

Page 12: ...re 32 3 32 6 Menu Configuration Options 32 3 Chapter 33 OProfile 33 1 Overview 33 1 33 2 Features 33 1 33 3 Hardware Operation 33 1 33 4 Software Operation 33 2 33 4 1 Architecture Specific Components...

Page 13: ...scale Semiconductor xiii 34 4 Error NAND MTD Driver Flash Erase Failure 34 3 34 5 Error NAND MTD Driver Attempt to Erase a Bad Block 34 3 34 6 Using the Memory Access Tool 34 3 34 7 How to Make Softwa...

Page 14: ...i MX51 EVK Linux Reference Manual xiv Freescale Semiconductor...

Page 15: ...1 Bus Frequency Scaling Driver Files 9 2 10 1 TV Out Driver Files 10 3 10 2 Frame Buffer Driver Files 10 3 11 1 IPU Driver Files 11 6 11 2 IPU Global Header Files 11 6 12 1 V2L2 Driver Files 12 6 13 1...

Page 16: ...Configuration 28 6 28 9 UART Hardware Flow Control Configuration 28 6 28 10 UART DMA Configuration 28 6 28 11 UART DMA RX Buffer Size Configuration 28 6 28 12 UART UCR4_CTSTL Configuration 28 6 28 13...

Page 17: ...1 ALSA SoC Software Architecture 17 1 17 2 ALSA Soc Source FIle Relationship 17 3 18 1 S PDIF Transceiver Data Interface Block Diagram 18 1 19 1 Components of a Flash Based File System 19 1 20 1 Keypa...

Page 18: ...i MX51 EVK Linux Reference Manual xviii Freescale Semiconductor...

Page 19: ...mes Italic type indicates replaceable command or function parameters Bold type indicates function names Definitions Acronyms and Abbreviations The following table defines the acronyms and abbreviation...

Page 20: ...rds FIPS 140 Security requirements for cryptographic modules Federal Information Processing Standard 140 2 FIPS 140 2 is a standard that describes US Federal government requirements that IT products s...

Page 21: ...such as the Compact Flash cards NAND is best suited to flash devices requiring high capacity data storage NAND flash devices offer storage space up to 512 Mbyte and offers faster erase write and read...

Page 22: ...ernal devices using four wires SPI devices communicate using a master slave relationship over two data lines and two control lines Also see SS SCLK MISO and MOSI SRAM Static Random Access Memory SSI S...

Page 23: ...i MX51 EVK Linux Reference Manual Freescale Semiconductor xxiii DOXY WSAS Guidelines for Writing Doxygen CommentsMCIMX51 Multimedia Applications Processor Reference Manual MCIMX51RM...

Page 24: ...i MX51 EVK Linux Reference Manual xxiv Freescale Semiconductor...

Page 25: ...stomers to rapidly build products based on i MX devices that use the Linux OS The BSP is not a platform or product reference implementation It does not contain all of the product specific drivers hard...

Page 26: ...including GPIO IOMUX and external board I O The IO software module is board specific and resides in the MSL layer as a self contained set of files I O configuration changes are centralized in the GPI...

Page 27: ...i MX51 Multimedia Drivers TV OUT TV OUT is an integrated television encoder that encodes video signals and generates synchronization signals for a given television standard Chapter 10 TV Encoder TVE D...

Page 28: ...ony Philips Digital Interface S PDIF Tx Driver i MX51 Memory Drivers SPI NOR MTD The SPI NOR MTD driver provides the support to the Atmel data Flash using the SPI interface Chapter 19 SPI NOR Flash Me...

Page 29: ...umber generator Chapter 23 Symmetric Asymmetric Hashing and Random Accelerator Sahara Drivers i MX51 Bus Drivers I2C The I2C bus driver is a low level interface that is used to interface with the I2C...

Page 30: ...erface to the ARC USB OTG controller Chapter 29 ARC USB Driver i MX51 SRTC The SRTC driver is designed to support MXC Secure RTC module to keep the time and date Chapter 30 Secure Real Time Clock SRTC...

Page 31: ...ware interfaces for MSL modules First the common modules such as Interrupts and Timer are discussed Next the board specific modules such as Memory Map and General Purpose Input Output GPIO including I...

Page 32: ...address model The following file has a description of the ARM interrupt architecture ltib_dir rpm BUILD linux Documentation arm Interrupts The software provides a processor specific interrupt structu...

Page 33: ...rocess has exhausted its time slice Runs any dynamic timers that have expired Updates resource usage and processor time statistics The timer hardware on most i MX platforms consists of either Enhanced...

Page 34: ...mory Map Software Operation A table mapping the virtual memory to physical memory is implemented for i MX platforms as defined in the ltib_dir rpm BUILD linux arch arm mach mx5 mm c file 2 3 3 Memory...

Page 35: ...function of this pin GPIO6 6 alternate mode 1 USBPHY1 DATAOUT 14 alternate mode 7 If the hardware modes are chosen at the system integration level this pin is dedicated only to that purpose and cannot...

Page 36: ...an API to configure the i MX processor external pins and a central place to control the GPIO interrupts The GPIO utility functions should be called to configure a pin instead of directly accessing the...

Page 37: ...output are provided to set GPIO when it s used as input or output See the API document and Documentation gpio txt for more details 2 5 2 GPIO Features This GPIO implementation supports the following f...

Page 38: ...Machine Specific Layer MSL i MX51 EVK Linux Reference Manual 2 8 Freescale Semiconductor...

Page 39: ...e and peripherals and includes the following features Multi channel DMA supporting up to 32 time division multiplexed DMA channels Powered by a 16 bit Instruction Set microRISC engine Each channel exe...

Page 40: ...customized for each platform I API is the lowest layer and it interfaces with the Linux DMA API with the SDMA controller The Linux DMA API interfaces other drivers for example MMC SD Sound with the S...

Page 41: ...dule To get to this options use the ltib c command when located in the ltib dir On the screen displayed select Configure the Kernel and exit When the next screen appears select the following option to...

Page 42: ...ming Interface The module implements custom API and partially standard DMA API Custom API is needed for supporting non standard DMA features such as loading scripts interrupts handling and DVFS contro...

Page 43: ...ra BT WLAN and so on Naming conventions are suggestive of typical or possible use case applications but the switchers and regulators may be utilized for other system power requirements within the guid...

Page 44: ...etails visit http opensource wolfsonmicro com node 15 Under this framework most power operations can be done by the following unified API calls regulator_get lookup and obtain a reference to a regulat...

Page 45: ...switch supplies Four buck switch regulators on normal mode SWx where x 1 4 Four buck switch regulators on standby mode SWx_ST where x 1 4 Four buck switch regulators on DVFS mode SWx_ST where x 1 4 L...

Page 46: ...2 c 3 8 Menu Configuration Options The following Linux kernel configurations are provided for the MC13892 Regulator driver To get to the PMIC power configuration use the command ltib c when located in...

Page 47: ...ass framework 4 2 Software Operation The MC13892 RTC driver performs operations by reconfiguring the MC13892 hardware control registers This is done by calling protocol driver APIs with the required r...

Page 48: ...ory 4 5 Menu Configuration Options The following Linux kernel configurations are provided for this module To get to the MC13892 RTC configuration use the command ltib c when located in the ltib dir In...

Page 49: ...automatic conversion of all input channels in succession The conversion can also be triggered by issuing a command or by detecting the rising edge on a special signal line A hardware interrupt can be...

Page 50: ...ps that do not support this feature returns a NOT_SUPPORTED status Provides a complete IOCTL interface to initiate an ADC conversion operation and to return the conversion results Provides support for...

Page 51: ...3892 pmic_adc c ltib_dir rpm BUILD linux include linux pmic_adc h ltib_dir rpm BUILD linux drivers input touchscreen mxc_ts c 5 4 Menu Configuration Options The following Linux kernel configurations a...

Page 52: ...MC13892 Digitizer Driver i MX51 EVK Linux Reference Manual 5 4 Freescale Semiconductor...

Page 53: ...the array are based on the boot CPU frequency which can be changed by using the clock command in U Boot Refer to the API document for more information on the functions implemented in the driver in th...

Page 54: ...anagement CPU Frequency scaling The following options can be selected CPU Frequency scaling CPU frequency translation statistics Default CPU frequency governor userspace Performance governor Powersave...

Page 55: ...iding a very low latency transition back to a working system Mem suspend to RAM maps to STOP mode which offers significant power saving as all blocks in the system are put into a low power state excep...

Page 56: ...files are available in ltib_dir rpm BUILD linux arch arm mach mx5 7 4 Menu Configuration Options The following Linux kernel configuration options are provided for this module To get to these options u...

Page 57: ...he GPC General Power Controller block The hardware DVFS core interrupt is served by GPC IRQ The DVFS core domain performance update procedure includes both voltage and frequency changes in appropriate...

Page 58: ...e in the following directory ltib_dir rpm BUILD linux arch arm plat mxc 8 4 Menu Configuration Options There are no menu configuration options for this driver The DVFS core is included by default 8 4...

Page 59: ...e SW based Bus Frequency Scaling not needed to enter LPAPM mode use this command echo 1 sys devices platform busfreq 0 enable To disable the SW based Bus Frequency Scaling use this command echo 0 sys...

Page 60: ...requency setpoint In this mode none of the frequencies on the peripheral domain are scaled since drivers that need the AHB_HIGH_SETPOINT are active 9 2 Source Code Structure Table 9 1 lists the source...

Page 61: ...nit IPU Display Interfaces DI and converts it to TV output The TV out driver implements a frame buffer driver in the Linux kernel The frame buffer driver implements IPU DI configurations and the digit...

Page 62: ...high frequency noise reduction An output voltage of each TVE channel is monitored by the Cable Detection CD system The CD is able to distinguish between the following cases TVE directly drives a 75 l...

Page 63: ...th the TVE driver which are available in the directory ltib_dir rpm BUILD linux drivers video mxc Table 10 2 describes the source files associated with the frame buffer drivers which use TVE driver ar...

Page 64: ...TV Encoder TVE Driver i MX51 EVK Linux Reference Manual 10 4 Freescale Semiconductor...

Page 65: ...ize channels set up buffers enable and disable channels link channels for auto frame synchronization and set up interrupts Typical logical channels include CSI direct to memory CSI to viewfinder pre p...

Page 66: ...n The IPU driver is a self contained driver module in the Linux kernel It consists of a custom kernel level API for the following blocks Synchronous frame buffer driver Display Interface DI Image DMA...

Page 67: ...the ltib_dir rpm BUILD linux drivers media video directory of the Linux kernel Low level library routines interface to the IPU hardware registers They take input from the high level device drivers an...

Page 68: ...it and mmap it the main use The difference is that the memory that appears in the special file is not the whole memory but the frame buffer of some video hardware dev fb also interacts with several I...

Page 69: ...ads the raw pixel data from the frame buffer memory and sends it to the panel for display The frame buffer driver supports different panels as a kernel configuration option Support for new panels can...

Page 70: ...n the ltib dir On the screen displayed select Configure the kernel and exit When the next screen appears select the options to configure CONFIG_MXC_IPU Includes support for the Image Processing Unit I...

Page 71: ...G_MXC_CAMERA_OV3640 Option for both the OV3640 sensor driver and the use case driver This option is dependent on the MXC_IPU option In menuconfig this option is available under Device Drivers Multimed...

Page 72: ...rivers Graphics support MXC Framebuffer support By default this option is Y for all architectures CONFIG_FB_MXC_SYNC_PANEL This is the configuration option that chooses the synchronous panel framebuff...

Page 73: ...ice Drivers Graphics support MXC Framebuffer support Synchronous Panel Framebuffer CH7024 TV Out Encoder CONFIG_FB_MXC_TVOUT This configuration option selects the FS453 TVOUT encoder This option is de...

Page 74: ...Image Processing Unit IPU Drivers i MX51 EVK Linux Reference Manual 11 10 Freescale Semiconductor...

Page 75: ...ut not synchronized to LCD refresh Color keying or alpha blending of frame buffer and overlay planes Simultaneous preview and capture Streaming queued capture from IPU encoding channel Direct raw Baye...

Page 76: ...e files for this device are located in ltib_dir rpm BUILD linux drivers media video mxc capture The V4L2 capture device driver is in the mxc_v4l2_capture c file The lowest layer is in the ipu_prp_enc...

Page 77: ...DIOC_S_STD VIDIOC_ENUMOUTPUT VIDIOC_G_OUTPUT VIDIOC_S_OUTPUT V4L2 control code has been extended to provide support for rotation The ID is V4L2_CID_PRIVATE_BASE Supported values include 0 Normal opera...

Page 78: ...he common V4L2 driver creates a chain of buffers currently the maximum number of frames is 3 4 Memory maps the buffer to its user space 5 Queues buffers using the IOCTL command VIDIOC_QBUF 6 Starts th...

Page 79: ...ns for video output The driver implements the standard V4L2 API for output devices V4L2 output device support can be selected during kernel configuration The driver is available at ltib_dir rpm BUILD...

Page 80: ...er 7 Queues the buffer using the IOCTL command VIDIOC_QBUF 8 Starts the stream by executing IOCTL VIDIOC_STREAMON 9 VIDIOC_STREAMON and VIDIOC_OVERLAY cannot be enabled simultaneously 12 3 Source Code...

Page 81: ...video mxc capture 12 4 Menu Configuration Options The Linux kernel configuration options are provided in the chapter on the IPU module See Section 11 4 Menu Configuration Options 12 5 V4L2 Programming...

Page 82: ...Video for Linux Two V4L2 Driver i MX51 EVK Linux Reference Manual 12 8 Freescale Semiconductor...

Page 83: ...hin IPUv3 we can support dual display feature i e each of the two DIs can support an externel display device simultanously As long as the hardware bandwidth is not exceeded MX5 EVK platform can drive...

Page 84: ...present the framebuffer driver will compute the timings using VESA tm Coordinated Video Timings CVT Note if the dislplay resolution is 720P then 720P60 should be used as video_mode and if the display...

Page 85: ...ib_dir rpm BUILD linux drivers video mxc mxc_ipuv3_fb c ltib_dir rpm BUILD linux arch arm mach mx5 mx51_babbage c and ltib_dir rpm BUILD linux arch arm mach mx5 mx53_evk c for details or refer to i MX...

Page 86: ...i MX5 Dual Display i MX51 EVK Linux Reference Manual 13 4 Freescale Semiconductor...

Page 87: ...advanced simple profiles except GMC H 264 baseline main and high profiles H 263 profile 3 VC 1 simple main and advanced profiles MPEG 2 main profile at high level MJPEG Baseline Encoding MPEG 4 simple...

Page 88: ...on 16 16 8 8 4 4 block sizes are supported Available block sizes can be configurable The encoder uses only one reference frame for motion estimation Unrestricted motion vector MPEG 4 AC DC prediction...

Page 89: ...serving resources memory IRQ It provides an IOCTL interface for the application layer in user space as a path to access system resources The application in user space calls related IOCTLs and codec li...

Page 90: ...g in user space Device Shutdown Shutdowns the VPU clock and hardware and release the IRQ The VPU user space driver has the following functions Codec lib Downloads executable bitcode for hardware Initi...

Page 91: ...MXC VPU Video Processing Unit support 14 5 Programming Interface There is only a user space programming interface for the VPU module A user in the application layer cannot access the kernel driver int...

Page 92: ...le decHandle FrameBuffer pBuffer int num int stride DecBufInfo pBufInfo RetCode vpu_DecStartOneFrame DecHandle handle DecParam param RetCode vpu_DecGetOutputInfo DecHandle decHandle DecOutputInfo info...

Page 93: ...orm window system 1 3 API defined by Khronos Group OpenGL ES OpenGL ES is a royalty free cross platform API for full function 2D and 3D graphics on embedded systems 1 1 API defined by Khronos Group Op...

Page 94: ...s MXC support drivers MXC GPU support MXC GPU support To get to the GPU library package in LTIB use the command ltib c when located in the ltib dir On the screen displayed select Configure the kernel...

Page 95: ...celeration is supported for X Org X Server version 1 6 4 The following list summarizes the types of operations that are accelerated for X Windows All operations involve frame buffer memory which may b...

Page 96: ...address of any X pixmap stored in frame buffer memory The libz160 library module libz160 so contains the register level programming interface to the Z160 GPU module This includes the storing of regis...

Page 97: ...Operations for rectangles containing at least 150 pixels Only these blending functions SOURCE OVER IN IN REVERSE OUT REVERSE and ADD some of these are needed to support component alpha blending which...

Page 98: ...n which provides the most efficient blit of the back buffer contents to the window surface when eglSwapBuffers is called Each back buffer is allocated separately using the following approach Create an...

Page 99: ...Verify that the file etc modules contains the following entries in the order listed uio_pdrv_genirq gpu Verify that the file etc X11 xorg conf contains one Device section as follows Section Device Id...

Page 100: ...X Windows Acceleration i MX51 EVK Linux Reference Manual 16 6 Freescale Semiconductor...

Page 101: ...re The ALSA SoC driver has the following components as shown in Figure 17 1 Machine driver handles any machine specific controls and audio events such as turning on an external amp at the beginning of...

Page 102: ...formats Playback SNDRV_PCM_FMTBIT_S16_LE SNDRV_PCM_FMTBIT_S20_3LE SNDRV_PCM_FMTBIT_S24_LE Capture SNDRV_PCM_FMTBIT_S16_LE SNDRV_PCM_FMTBIT_S20_3LE SNDRV_PCM_FMTBIT_S24_LE 17 1 2 Sound Card Informatio...

Page 103: ...CPU DAI driver for the stereo ALSA SoC and configures the on chip SSI interface sgtl5000 c registers the stereo codec and hifi DAI drivers The direct hardware operations on the stereo codec are in sg...

Page 104: ...r SoC audio support Locate Audio DMA playback buffers in IRAM 17 4 Hardware Operation The following sections describe the hardware operation of the ASoC driver 17 4 1 Stereo Audio Codec The stereo aud...

Page 105: ...the codec driver DAI driver and their operation functions 2 The platform driver registers the PCM driver CPU DAI driver and their operation functions preallocates buffers for PCM components and sets...

Page 106: ...Advanced Linux Sound Architecture ALSA System on a Chip ASoC Sound Driver i MX51 EVK Linux Reference Manual 17 6 Freescale Semiconductor...

Page 107: ...at allows the processor to receive and transmit digital audio The S PDIF transceiver allows the handling of both S PDIF channel status CS and User U data and includes a frequency measurement block tha...

Page 108: ...cture of the S PDIF transceiver i MX51 only has the S PDIF transmitter 18 1 2 Software Overview The S PDIF driver is designed under Linux ALSA subsystem It provides hardware access ability to support...

Page 109: ...ed S PDIF has 16 TX sample FIFOs on Left and Right channel respectively When both FIFOs are empty an empty interrupt is generated if the empty interrupt is enabled If no data are refilled in the 20 8...

Page 110: ...cture ALSA subsystem This option is dependent on CONFIG_SOUND option In the menuconfig this option is available under Device Drivers Sound card support Advanced Linux Sound Architecture By default thi...

Page 111: ...two SRAM buffers of 512 528 bytes each which allow receiving of data while a page in the main memory is being reprogrammed as well as writing a continuous data stream Unlike conventional Flash memorie...

Page 112: ...layer MTD driver 19 4 Source Code Structure The SPI NOR MTD driver is implemented in the following directory ltib_dir rpm BUILD linux drivers mtd devices Table 19 1 shows the driver files 19 5 Menu C...

Page 113: ...pins The actual keypad matrix is dependent on hardware connection The keypad port interfaces with a keypad matrix On a keypress the intersecting row and column lines are shorted together The keypad h...

Page 114: ...t systems The keypad driver can generate only EV_KEY type events This can be indicated using __set_bit EV_KEY mxckbd_dev evbit The keypress key codes are reported by calling input_event The reported k...

Page 115: ...plications such as keyfuzz and input kbd from the input utils package use these IOCTLs which are handled by the input subsystem See the kernel Documentation input input programming txt for details on...

Page 116: ...eight rows and eight columns The keypad matrix configuration can be done by changing the rowmax and colmax members in the keypad_plat_data structure in the platform specific file see Table 20 1 Deboun...

Page 117: ...ECT 1 4 10 KEY_SELECT i MX51 RIGHT 1 5 11 KEY_RIGHT i MX51 7 2 0 12 KEY_7 i MX51 8 2 1 13 KEY_8 i MX51 9 2 2 14 KEY_9 i MX51 GP1 2 3 15 KEY_F3 i MX51 DOWN 2 4 16 KEY_DOWN i MX51 GP2 2 5 17 KEY_F4 i MX...

Page 118: ...Low Level Keypad Driver i MX51 EVK Linux Reference Manual 20 6 Freescale Semiconductor...

Page 119: ...rdware Operation The FEC is an Ethernet controller that interfaces the system to the LAN network The FEC supports different standard MAC PHY physical interfaces for connection to an external Ethernet...

Page 120: ...hecking and maximum frame length checking When the driver enables the FEC receiver by asserting ECR ETHER_EN it immediately starts processing receive frames When FEC_RX_DV asserts the receiver checks...

Page 121: ...are GRA TXF TXB RXF RXB Interrupts resulting from errors problems detected in the network or transceiver are HBERR BABR BABT LC and RL Interrupts resulting from internal errors are HBERR and UN Some...

Page 122: ...buffer descriptor For example Define the buffer descriptor structure struct bufdesc unsigned short cbd_datlen Data length unsigned short cbd_sc Control and status info unsigned long cbd_bufaddr Buffe...

Page 123: ...descriptor ring define FEC_R_BUFF_SIZE 0x188 Maximum receive buff size define FEC_MIIGSK_CFGR 0x300 MIIGSK config register define FEC_MIIGSK_ENR 0x308 MIIGSK enable register 21 5 2 Getting a MAC Addr...

Page 124: ...Fast Ethernet Controller FEC Driver i MX51 EVK Linux Reference Manual 21 6 Freescale Semiconductor...

Page 125: ...stored securely in external memory in encrypted form This module can clear the secure RAM during intrusion The security design covers the following modules Boot Security SCCv2 Secure RAM Secure Monit...

Page 126: ...sible only to the encryption module It is not accessible on any bus external to the secure memory module The data in the external RAM is stored in an encrypted format The data is encrypted using AES a...

Page 127: ...s for the encryption key resides elsewhere The Secret Key Interface contains a key mux to select between the encryption key and the default key and test the logic to determine the validity of the encr...

Page 128: ...igure 22 2 shows a block diagram of the SMN Figure 22 2 Security Monitor Block Diagram 22 1 8 Secure State Controller The Secure State Controller shown in Figure 22 3 is a state machine that controls...

Page 129: ...are currently active Refer to the SCC section in L3 specification document of the corresponding platform for more information on the SCC Debug Detector 22 1 12 1 Security Controller SCCV2 The Security...

Page 130: ...y modules there is optional specialized software that helps to deliver security 22 2 1 SCC Common Software Operations The SCC driver is only available to other kernel modules That is there is no node...

Page 131: ...ILD linux drivers mxc security directory Header files are available in the directory ltib_dir rpm BUILD linux include linux 22 5 Menu Configuration Options The following Linux kernel configurations ar...

Page 132: ...3 SCC Key13 0x9e SCC Key14 0x36 SCC Key15 0xd3 SCC Key16 0xfa SCC Key17 0x00 SCC key18 0x00 SCC Key19 0x9d SCC Key20 0xfe Follow the instructions below to program the SCC key using Icepick 1 Run Icepi...

Page 133: ...cale Semiconductor 22 9 4 Write the following ASC Sequence in the debugger script init_sdram txt setmem 32 0x53FAD008 0x00005CAA setmem 32 0x53FAD00C 0x00002E55 setmem 32 0x53FAD010 0x00002E55 5 Confi...

Page 134: ...Security Drivers i MX51 EVK Linux Reference Manual 22 10 Freescale Semiconductor...

Page 135: ...ng on behalf of the kernel process which needs to sleep because blocking mode attempts to put the current process to sleep Therefore blocking mode cannot be used from bottom half code or from interrup...

Page 136: ...d queue maintains a list of commands pointers to descriptor chains and their associated user destined for the Sahara hardware A pointer is maintained to the current active command as well as where the...

Page 137: ...ister cannot be set at startup Hardware Erratum for RNG reseed The available choices are Set this bit after the first random number is obtained Never set this bit but rather detect when the RNG Reseed...

Page 138: ...from the rest of the driver to return through the API return value Passes raw descriptor chains through must be registered that is have a UCO It is necessary to determine if the hardware erratum for...

Page 139: ...ecks that there is room in the Command Queue If there is not returns a queue full status and terminates 2 Checks that there is room in the Result Pool If there is not returns a pool full status and te...

Page 140: ...to the Result Pool 3 Copies Sahara Status and Error Status registers into the result pool 4 Writes Clr_Error in Command register and flag as FAILED if State field in Status register is 010 or 110 othe...

Page 141: ...d if State field in Status register is 011 Also sends notification to Sahara Public Interface to reject all future calls to Sahara driver Failed if SCC Fail bit in Status register is set Specific desc...

Page 142: ...which processes the SAHARA status registers sf_util c Security Functions component API Utility functions fsl_shw_auth c Contains the routines which do the combined encryption and authentication fsl_sh...

Page 143: ...reset This time out period is configurable When poll mode is selected the value for CONFIG_MXC_SAHARA_POLL_MODE_TIMEOUT can be modified Poll mode works nearly the same as interrupt mode that is block...

Page 144: ...etric Asymmetric Hashing and Random Accelerator Sahara Drivers i MX51 EVK Linux Reference Manual 23 10 Freescale Semiconductor 23 7 Interrupt Requirements There is no interrupt requirement in this mod...

Page 145: ...the files available under Documentation i2c in the kernel source tree This bus driver supports the following features Compatible with the I2 C bus standard Bit rates up to 400 Kbps Starts and stops s...

Page 146: ...artup the I2 C bus adapter is registered with the I2 C core when the driver is loaded Certain architectures have more than one I2 C module If so the driver registers separate i2c_adapter structures fo...

Page 147: ...ing options to enable this module Device Drivers I2C support I2C Hardware Bus support IMX I2C interface 24 8 Programming Interface The I2 C device driver can use the standard SMBus interface to read a...

Page 148: ...Inter IC I2C Driver i MX51 EVK Linux Reference Manual 24 4 Freescale Semiconductor...

Page 149: ...river implements the functions provided by i MX 1 Wire module and provides the interface to reset the bus read bit and write read byte 1 Wire slave driver DS2438 is registered as a power supply class...

Page 150: ...ct the following options to enable the 1 Wire driver Enable MXC 1 wire master In menuconfig this option is available under Device Driver Dallas s 1 wire support 1 wire Bus Masters Freescale MXC 1 wire...

Page 151: ...ith external SPI master or slave devices The primary features of the CSPI includes Master slave configurable Two chip selects allowing a maximum of four different slaves each for master mode operation...

Page 152: ...PMIC driver Client 2 driver Client 3 driver SPI Subsystem CSPI Hardware PMIC Client 2 Client 3 Electrical Interface PMIC driver Client 2 driver Client 3 driver SPI Subsystem CSPI Hardware PMIC Client...

Page 153: ...ver implements the following functions Init function mxc_spi_init Registers the device_driver structure Probe function mxc_spi_probe Performs initialization and registration of the SPI device specific...

Page 154: ...uration options are provided for this module To get to these options use the ltib c command when located in the ltib dir On the screen displayed select Configure the Kernel and exit When the next scre...

Page 155: ...in loop back mode In menuconfig this option is available under Device Drivers SPI Support LOOPBACK Testing of CSPIs By default this is disabled as it is intended to use only for testing purposes 26 6...

Page 156: ...Configurable Serial Peripheral Interface CSPI Driver i MX51 EVK Linux Reference Manual 26 6 Freescale Semiconductor...

Page 157: ...the SD bus protocol The eSDHC command transfer type and eSDHC command argument registers allow a command to be issued to the card The eSDHC command system control and protocol control registers allow...

Page 158: ...eSDHC The MMC driver is responsible for implementing standard entry points for init exit request and set_ios The driver implements the following functions The init function sdhci_drv_init Registers th...

Page 159: ...nd SD cards Recognizes data transfer errors such as command time outs and CRC errors Power management File System Ext2fs FAT driver Block Client Driver Storage Kinds of Bus Protocol Drivers Host Contr...

Page 160: ...river By default this option is Y CONFIG_MMC_IMX_ESDHCI Driver used for the i MX eSDHC ports In menuconfig this option is found under Device Drivers MMC SD Card Support Freescale i MX Secure Digital H...

Page 161: ...TS RTS hardware flow control both interrupt driven software controlled hardware flow and hardware driven hardware controlled flow Send and receive break characters through the standard Linux serial AP...

Page 162: ...e of this buffer is 512 bytes The size should be a multiple of 256 The driver breaks the DMA receive buffer into smaller sub buffers of 256 bytes and registers these buffers with the DMA system The DM...

Page 163: ...a and calls to register the device with the platform bus 28 5 Configuration This section discusses configuration options associated with Linux chip configuration options and board configuration option...

Page 164: ...UART number is listed in Table 28 5 28 5 2 2 Board Configuration Options The following board specific configuration options for the driver can be set within ltib_dir rpm BUILD linux arch arm mach mx b...

Page 165: ...T ports can be accessed through the device files dev ttymxc0 dev ttymxc1 and so on where dev ttymxc0 refers to UART 1 The number of UART ports on a particular platform are listed in Table 28 4 28 8 2...

Page 166: ...r Size Configuration Platform UART1 UART2 UART3 UART4 UART5 UART6 i MX51 1024 512 1024 N A N A Table 28 12 UART UCR4_CTSTL Configuration Platform UART1 UART2 UART3 UART4 UART5 UART6 i MX51 16 1 16 N A...

Page 167: ...2 6 10 and later kernels have an early UART driver that operates very early in the boot process The kernel immediately starts logging messages if the user supplies an argument as follows console mxcua...

Page 168: ...Universal Asynchronous Receiver Transmitter UART Driver i MX51 EVK Linux Reference Manual 28 8 Freescale Semiconductor...

Page 169: ...supports plug and play port expansion and any new USB peripheral that uses the same type of port The ARC USB controller is enhanced host controller interface EHCI compliant This USB driver has the fo...

Page 170: ...29 2 Hardware Operation For information on hardware operations refer to the EHCI spec ehci r10 pdf available at http www usb org developers docs 29 3 Software Operation The Linux OS contains a USB dri...

Page 171: ...sl_alloc_request allocates a request object to use with this endpoint fsl_free_request frees a request object arcotg_ep_queue queues submits an I O request to an endpoint arcotg_ep_dequeue dequeues ca...

Page 172: ...st ehci q c EHCI host queue manipulation host ehci q iram c Host driver source file for IRAM support gadget arcotg_udc c Peripheral driver source file gadget arcotg_udc h USB peripheral endpoint manag...

Page 173: ...the USB Host1 In menuconfig this option is available underDevice drivers USB support Support for Host1 port on Freescale controller By default this option is Y CONFIG_USB_EHCI_ARC_OTG Build support fo...

Page 174: ...ection By default this option is N CONFIG_UTMI_MXC_OTG USB OTG pin detect support for UTMI PHY enable UTMI PHY for OTG support By default this option is N CONFIG_USB_ETH Build support for Ethernet gad...

Page 175: ...SB OTG port in HS FS Host mode built as Y CONFIG_USB_GADGET USB Gadget Support built as y CONFIG_USB_OTG OTG Support built as Y CONFIG_MXC_OTG USB OTG pin detect support for UTMI PHY built as Y build...

Page 176: ...platform fsl usb2 otg power wakeup Host mode wakeup connect wakeup when usb device connects to host port Wakeup signal ID dm dp change echo enabled sys devices platform fsl usb2 otg power wakeup disc...

Page 177: ...evices 1 1 1 power wakeup enable the usb device s wakeup that device connects at second level hub 1 1 1 is the usb device name 29 11 3 How to close the usb child device power echo auto sys bus usb dev...

Page 178: ...ARC USB Driver i MX51 EVK Linux Reference Manual 29 10 Freescale Semiconductor...

Page 179: ...river complies with the Linux RTC driver model See the Linux documentation in ltib_dir rpm BUILD linux Documentation rtc txt for information on the RTC API Besides the initialization function the SRTC...

Page 180: ...0 Register can be enabled to keep VSRTC and CLK32KMCU on for all states Ordinarily when the main battery is removed and the device is in power off state a coin cell battery is used as a backup power s...

Page 181: ...nfiguration Options To get to the SRTC driver use the command ltib c when located in the ltib dir On the screen displayed select Configure the kernel and exit When the next screen appears select the f...

Page 182: ...Secure Real Time Clock SRTC Driver i MX51 EVK Linux Reference Manual 30 4 Freescale Semiconductor...

Page 183: ...ependently Since some bits of the WGOD registers are only one time programmable after booting ensure these registers are written correctly 31 3 Generic WDOG Driver The generic WGOD driver is implement...

Page 184: ...m BUILD linux drivers watchdog Watchdog system reset function is located under ltib_dir rpm BUILD linux arch arm plat mxc wdog c 31 3 4 Programming Interface The following IOCTLs are supported in the...

Page 185: ...ound from stored sample audio images and generate tones The PWM has 16 bit resolution and uses a 4 16 data FIFO to generate sound The software module is composed of a Linux driver that allows privileg...

Page 186: ...low power modes this clock can be switched off The clock input source is determined by the CLKSRC field of the PWM control register The CLKSRC value should only be changed when the PWM is disabled 32...

Page 187: ...vailable in the following directories ltib_dir rpm BUILD linux arch arm plat mxc pwm c ltib_dir rpm BUILD linux include linux pwm h 32 6 Menu Configuration Options To get to the PWM driver use the com...

Page 188: ...Pulse Width Modulator PWM Driver i MX51 EVK Linux Reference Manual 32 4 Freescale Semiconductor...

Page 189: ...em performance Performance counter support Enables collection of various low level data and association for particular sections of code Call graph support With an 2 6 kernel OProfile can provide gprof...

Page 190: ...g up and managing these counters can be located in the kernel source tree in the relevant ltib_dir rpm BUILD linux arch arm oprofile directory The architecture specific implementation operates through...

Page 191: ...the post profiling tools to run on this data at any time assuming the original binary files are still available and unchanged 33 4 5 Post Profiling Tools The collected data must be presented to the us...

Page 192: ...atency requirements are not needed The rate at which interrupts are generated depends on the event 33 10 Example Software Configuration The following steps show and example of how to configure the OPr...

Page 193: ...VK Linux Reference Manual Freescale Semiconductor 33 5 samples 4 100 000 libc 2 9 so 2 11 1111 cat CPU_CYCLES 100000 samples 1 50 0000 ld 2 9 so 1 50 0000 libc 2 9 so root ubuntu boot opcontrol stop S...

Page 194: ...OProfile i MX51 EVK Linux Reference Manual 33 6 Freescale Semiconductor...

Page 195: ...uired Another way to transfer a file is to use FTP which makes the download much faster than through the serial port To use FTP the Ethernet interface has to be set up first 34 2 Creating a JFFS2 Moun...

Page 196: ...tains the JFFS2 image inside the Flash When booting Linux the kernel is able to recognize the RedBoot partitions and create MTD partitions correspondingly when CONFIG_MTD_REDBOOT_PARTS y is in the ker...

Page 197: ...e possible reason for this failure is the NAND Flash is write protected 34 5 Error NAND MTD Driver Attempt to Erase a Bad Block This error indicates that a block marked as bad is attempting to be eras...

Page 198: ...estions i MX51 EVK Linux Reference Manual 34 4 Freescale Semiconductor 34 7 How to Make Software Workable when JTAG is Attached When the JTAG is attached add option jtag on in the command line when la...

Reviews: