W 5.0 Device Drivers and System Services Manual for Blackfin® Processors Revision 4.3, January 2011 Part Number 82-000430-01 Analog Devices, Inc. a One Technology Way Norwood, Mass. 02062-9106 Copyright Information © 2011 Analog Devices, Inc., ALL RIGHTS RESERVED. This docu- ment may not be reproduced in any form without prior, express written consent from Analog Devices, Inc. Printed in the USA. Disclaimer Analog Devices, Inc. reserves the right to change this product without prior notice. Information furnished by Analog Devices is believed to be accurate and reliable. However, no responsibility is assumed by Analog Devices for its use; nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by impli- cation or otherwise under the patent rights of Analog Devices, Inc. Trademark and Service Mark Notice The Analog Devices logo, Blackfin, the Blackfin logo, EZ-KIT Lite, SHARC, TigerSHARC, and VisualDSP++ are registered trademarks of Analog Devices, Inc. All other brand and product names are trademarks or service marks of their respective owners. CONTENTS PREFACE Purpose of This Manual ........................................................... xxxvii Intended Audience ................................................................... xxxvii Manual Contents Description ................................................. xxxviii What’s New in This Manual ...................................................... xxxix Technical or Customer Support ...................................................... xl Supported Processors ...................................................................... xl Product Information ...................................................................... xl Analog Devices Web Site ......................................................... xli VisualDSP++ Online Documentation ..................................... xli Technical Library CD ............................................................. xlii Social Networking Web Sites ................................................. xliii Notation Conventions ................................................................. xliii INTRODUCTION System Services Overview .............................................................. 1-2 General ................................................................................... 1-3 Application Interface ............................................................... 1-8 Dependencies ........................................................................ 1-10 VisualDSP++ 5.0 Device Drivers and System iii Services Manual for Blackfin Processors Contents Initialization ......................................................................... 1-11 Termination .......................................................................... 1-12 System Services Directory and File Structure .......................... 1-13 Accessing the System Services API ..................................... 1-13 Linking in the System Services Library .............................. 1-16 Rebuilding the System Services Library ............................. 1-17 Examples .......................................................................... 1-19 Dual-Core Considerations ................................................ 1-19 RTOS Considerations ................................................................. 1-19 Interoperability of System Services With VDK ....................... 1-20 Deployment of Services Within a Multi-Threaded Application ........................................................................ 1-21 Device Driver Overview .............................................................. 1-22 Application Interface ............................................................. 1-23 Device Driver Architecture .................................................... 1-24 Interaction With System Services ...................................... 1-26 Initialization ......................................................................... 1-26 Termination .......................................................................... 1-27 Device Driver Directory and File Structure ............................ 1-27 Accessing the Device Driver API ....................................... 1-28 Device Driver File Locations ............................................. 1-29 Linking in the Device Driver Library ................................ 1-30 Rebuilding the Device Driver Library ................................ 1-31 Examples on Distribution ................................................. 1-32 iv VisualDSP++ 5.0 Device Drivers and System Services Manual for Blackfin Processors Contents INTERRUPT MANAGER Introduction ................................................................................. 2-2 Interrupt Manager Initialization .................................................... 2-4 Interrupt Manager Termination ..................................................... 2-5 Core Event Controller Functions ................................................... 2-6 adi_int_CECHook() Function ................................................. 2-6 adi_int_CECUnhook() Function ............................................. 2-8 Interrupt Handlers .................................................................. 2-8 System Interrupt Controller Functions .......................................... 2-9 adi_int_SICDisable ............................................................... 2-10 adi_int_SICEnable ................................................................ 2-10 adi_int_SICGetIVG .............................................................. 2-10 adi_int_SICInterruptAsserted ................................................ 2-10 adi_int_SICSetIVG ............................................................... 2-11 adi_int_SICWakeup .............................................................. 2-11 adi_int_SICGlobalWakeup .................................................... 2-12 Protecting Critical Code Regions ................................................. 2-13 Modifying IMASK ...................................................................... 2-16 Examples .................................................................................... 2-17 File Structure .............................................................................. 2-17 Interrupt Manager API Reference ................................................ 2-18 Notation Conventions ........................................................... 2-18 adi_int_Init ................................................................................ 2-19 adi_int_Terminate ...................................................................... 2-20 VisualDSP++ 5.0 Device Drivers and System v Services Manual for Blackfin Processors Contents adi_int_CECHook ..................................................................... 2-21 adi_int_CECUnhook ................................................................. 2-23 adi_int_ClearIMaskBits .............................................................. 2-25 adi_int_EnterCriticalRegion ....................................................... 2-27 adi_int_ExitCriticalRegion ......................................................... 2-29 adi_int_GetCurrentIVGLevel ..................................................... 2-30 adi_int_GetLibraryDetails .......................................................... 2-31 adi_int_SICDisable .................................................................... 2-32 adi_int_SICEnable ..................................................................... 2-33 adi_int_SICGetIVG ................................................................... 2-34 adi_int_SICInterruptAsserted ..................................................... 2-35 adi_int_SICSetIVG ................................................................... 2-36 adi_int_SetIMaskBits .................................................................. 2-37 adi_int_SICWakeup ................................................................... 2-39 adi_int_SICGlobalWakeup ......................................................... 2-40 POWER MANAGEMENT MODULE Introduction ................................................................................. 3-2 PM Module Operation – Getting Started ...................................... 3-3 Dual-Core Considerations ............................................................ 3-5 Using Automatic Synchronization ........................................... 3-5 Synchronization Requirement .................................................. 3-6 Running Applications on One Core Only ................................ 3-7 Running Applications on Both Cores ....................................... 3-8 vi VisualDSP++ 5.0 Device Drivers and System Services Manual for Blackfin Processors Contents Synchronization Between Cores ............................................... 3-9 Built-In Lock Variable and Linking Considerations ................ 3-10 SDRAM Initialization Prior to Loading an Executable ................. 3-12 Power Management API Reference .............................................. 3-14 Notation Conventions ........................................................... 3-14 adi_pwr_AdjustFreq .................................................................... 3-15 adi_pwr_Control ........................................................................ 3-16 adi_pwr_GetConfigSize .............................................................. 3-18 adi_pwr_GetFreq ........................................................................ 3-19 adi_pwr_GetPowerMode ............................................................. 3-20 adi_pwr_GetPowerSaving ............................................................ 3-21 adi_pwr_Init ............................................................................... 3-22 adi_pwr_LoadConfig .................................................................. 3-28 adi_pwr_Reset ............................................................................ 3-29 adi_pwr_SaveConfig ................................................................... 3-30 adi_pwr_SetFreq ......................................................................... 3-31 adi_pwr_SetMaxFreqForVolt ....................................................... 3-33 adi_pwr_SetPowerMode .............................................................. 3-34 adi_pwr_SetVoltageRegulator ...................................................... 3-37 adi_pwr_Terminate ..................................................................... 3-41 Public Data Types and Enumerations ........................................... 3-42 ADI_PWR_COMMAND ........................................................... 3-42 ADI_PWR_COMMAND_PAIR ................................................. 3-48 ADI_PWR_CSEL ....................................................................... 3-48 VisualDSP++ 5.0 Device Drivers and System vii Services Manual for Blackfin Processors Contents ADI_PWR_DF .......................................................................... 3-49 ADI_PWR_INPUT_DELAY ...................................................... 3-49 ADI_PWR_OUTPUT_DELAY .................................................. 3-49 ADI_PWR_MODE .................................................................... 3-50 ADI_PWR_PACKAGE_KIND ................................................... 3-50 ADI_PWR_PCC133_COMPLIANCE ....................................... 3-51 ADI_PWR_PROC_KIND ......................................................... 3-51 ADI_PWR_RESULT .................................................................. 3-53 ADI_PWR_SSEL ....................................................................... 3-55 ADI_PWR_VDDEXT ................................................................ 3-56 ADI_PWR_VLEV ...................................................................... 3-56 ADI_PWR_VR_CANWE .......................................................... 3-57 ADI_PWR_VR_CKELOW ........................................................ 3-57 ADI_PWR_VR_CLKBUFOE .................................................... 3-57 ADI_PWR_VR_FREQ .............................................................. 3-58 ADI_PWR_VR_GAIN ............................................................... 3-58 ADI_PWR_VR_GPWE_MXVRWE ........................................... 3-59 ADI_PWR_VR_PHYWE ........................................................... 3-59 ADI_PWR_VR_USBWE ........................................................... 3-59 ADI_PWR_VR_WAKE .............................................................. 3-60 PM Module Macros .................................................................... 3-60 viii VisualDSP++ 5.0 Device Drivers and System Services Manual for Blackfin Processors Contents EXTERNAL BUS INTERFACE UNIT MODULE Introduction ................................................................................. 4-2 Using the EBIU Module ................................................................ 4-3 EBIU API Reference ..................................................................... 4-9 Notation Conventions ............................................................. 4-9 adi_ebiu_AdjustSDRAM ............................................................. 4-10 adi_ebiu_Control ........................................................................ 4-11 adi_ebiu_GetConfigSize .............................................................. 4-14 adi_ebiu_Init .............................................................................. 4-15 adi_ebiu_LoadConfig .................................................................. 4-22 adi_ebiu_SaveConfig .................................................................. 4-23 adi_ebiu_Terminate .................................................................... 4-24 Public Data Types and Enumerations .......................................... 4-25 ADI_EBIU_RESULT ................................................................. 4-25 ADI_EBIU_SDRAM_BANK_VALUE ........................................ 4-28 ADI_EBIU_TIME ...................................................................... 4-29 ADI_EBIU_TIMING_VALUE ................................................... 4-30 ADI_EBIU_ASYNCH_BANK_TIMING ................................... 4-30 ADI_EBIU_ASYNCH_BANK_VALUE ...................................... 4-31 Setting Control Values in the EBIU Module ................................ 4-32 ADI_EBIU_COMMAND ..................................................... 4-32 ADI_EBIU_COMMAND_PAIR ........................................... 4-39 VisualDSP++ 5.0 Device Drivers and System ix Services Manual for Blackfin Processors Contents Command Value Enumerations ............................................. 4-39 ADI_EBIU_SDRAM_ENABLE ....................................... 4-40 ADI_EBIU_SDRAM_BANK_SIZE .................................. 4-40 ADI_EBIU_SDRAM_BANK_COL_WIDTH .................. 4-41 ADI_EBIU_SDRAM_MODULE_TYPE .......................... 4-41 ADI_EBIU_CMD_SET_SDRAM_SCTLE ....................... 4-41 ADI_EBIU_SDRAM_EMREN ........................................ 4-42 ADI_EBIU_SDRAM_PASR ............................................. 4-42 ADI_EBIU_SDRAM_TCSR ............................................ 4-43 ADI_EBIU_SDRAM_SRFS ............................................. 4-43 ADI_EBIU_SDRAM_EBUFE .......................................... 4-44 ADI_EBIU_SDRAM_PUPSD .......................................... 4-44 ADI_EBIU_SDRAM_PSM .............................................. 4-45 ADI_EBIU_SDRAM_FBBRW ......................................... 4-45 ADI_EBIU_SDRAM_CDDBG ........................................ 4-46 ADI_EBIU_BANK_NUMBER ........................................ 4-46 ADI_EBIU_ASYNCH_BANK_ENABLE ......................... 4-47 ADI_EBIU_ASYNCH_CLKOUT .................................... 4-47 ADI_EBIU_ASYNCH_BANK_DATA_PATH .................. 4-47 ADI_EBIU_ASYNCH_BANK_ARDY_ENABLE ............. 4-48 ADI_EBIU_ASYNCH_BANK_ARDY_POLARITY ......... 4-48 ADI_EBIU_ASYNCH_HOLD_TIME ............................. 4-48 ADI_EBIU_ASYNCH_SETUP_TIME ............................. 4-49 ADI_EBIU_ASYNCH_TRANSITION_TIME ................. 4-50 x VisualDSP++ 5.0 Device Drivers and System Services Manual for Blackfin Processors
Description: