]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/commitdiff
mcasp-lld: add to PDK
authorJacob Stiffler <j-stiffler@ti.com>
Fri, 1 Nov 2019 18:55:03 +0000 (14:55 -0400)
committerJacob Stiffler <j-stiffler@ti.com>
Fri, 1 Nov 2019 18:55:03 +0000 (14:55 -0400)
Development of mcasp-lld has been relocated here from:
* Repo: https://git.ti.com/keystone-rtos/mcasp-lld
* Branch: master
* Commit ID: 3b206c0081cc3e78122982948b40a16e2e24522c

Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
225 files changed:
packages/ti/drv/mcasp/.gitignore [new file with mode: 0644]
packages/ti/drv/mcasp/Settings.h [new file with mode: 0644]
packages/ti/drv/mcasp/Settings.xdc [new file with mode: 0644]
packages/ti/drv/mcasp/Settings.xdc.xdt [new file with mode: 0644]
packages/ti/drv/mcasp/build/buildlib.xs [new file with mode: 0644]
packages/ti/drv/mcasp/build/makefile.mk [new file with mode: 0644]
packages/ti/drv/mcasp/build/makefile_profile.mk [new file with mode: 0644]
packages/ti/drv/mcasp/config.bld [new file with mode: 0644]
packages/ti/drv/mcasp/config_mk.bld [new file with mode: 0644]
packages/ti/drv/mcasp/docs/Doxyfile [new file with mode: 0644]
packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.doc [new file with mode: 0644]
packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.pdf [new file with mode: 0644]
packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.doc [new file with mode: 0644]
packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.pdf [new file with mode: 0644]
packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.txt [new file with mode: 0644]
packages/ti/drv/mcasp/docs/Module.xs [new file with mode: 0644]
packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.doc [new file with mode: 0644]
packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.pdf [new file with mode: 0644]
packages/ti/drv/mcasp/docs/Thumbs.db [new file with mode: 0644]
packages/ti/drv/mcasp/docs/doxyfile.xdt [new file with mode: 0644]
packages/ti/drv/mcasp/docs/tifooter.htm [new file with mode: 0644]
packages/ti/drv/mcasp/docs/tiheader.htm [new file with mode: 0644]
packages/ti/drv/mcasp/docs/tilogo.gif [new file with mode: 0644]
packages/ti/drv/mcasp/docs/titagline.gif [new file with mode: 0644]
packages/ti/drv/mcasp/eclipseDocs/sample.xml [new file with mode: 0644]
packages/ti/drv/mcasp/eclipseDocs/toc_cdoc_sample.xml [new file with mode: 0644]
packages/ti/drv/mcasp/example/MCASP_AudioDCAnalogLoopback_TestApp/makefile [new file with mode: 0755]
packages/ti/drv/mcasp/example/MCASP_AudioDCDigitalLoopback_TestApp/makefile [new file with mode: 0755]
packages/ti/drv/mcasp/example/MCASP_AudioLoopback_TestApp/makefile [new file with mode: 0644]
packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_Regression_TestApp/makefile [new file with mode: 0644]
packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_TestApp/makefile [new file with mode: 0644]
packages/ti/drv/mcasp/example/Module.xs [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_Audio_evmAM335x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_DeviceLoopback_evmAM335x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM335x/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_Audio_evmAM437x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_DeviceLoopback_evmAM437x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM437x/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_SMP_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_DeviceLoopback_evmAM572x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioEQ_demo.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_AudioEQ_evmAM572x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_Audio_evmAM572x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_DeviceLoopback_evmAM572x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/include/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/a53/mcaspUnitTest_a53.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/include/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/r5/mcaspUnitTest_r5.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/r5/mpu.xs [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmAM65xx/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/armv7/bios/MCASP_Audio_evmDRA72x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/armv7/bios/MCASP_Audio_evmDRA75x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/armv7/bios/MCASP_DeviceLoopback_evmDRA72x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/armv7/bios/MCASP_DeviceLoopback_evmDRA75x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/armv7/bios/loopback_arm.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_AudioEQ_evmDRA72x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_AudioEQ_evmDRA75x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_AudioEQ_evmDRA78x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_Audio_evmDRA72x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_Audio_evmDRA75x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_Audio_evmDRA78x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_DeviceLoopback_evmDRA72x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_DeviceLoopback_evmDRA75x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/MCASP_DeviceLoopback_evmDRA78x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/c66/bios/loopback_dsp.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra72x/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra72x/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra72x/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra75x/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra75x/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra75x/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra78x/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra78x/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/include/dra78x/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_Audio_evmDRA72x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_Audio_evmDRA75x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_Audio_evmDRA78x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_DeviceLoopback_evmDRA72x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_DeviceLoopback_evmDRA75x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/MCASP_DeviceLoopback_evmDRA78x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/m4/bios/loopback_m4.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra72x/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra72x/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra75x/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra75x/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra78x/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmDRA7xx/src/dra78x/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/armv7/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/armv7/bios/MCASP_Audio_evmK2G_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/armv7/bios/MCASP_DeviceLoopback_evmK2G_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/AudioEQ_demo.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/AudioLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/MCASP_AudioEQ_evmK2G_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/MCASP_Audio_evmK2G_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/c66/bios/MCASP_DeviceLoopback_evmK2G_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmK2G/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/AIC31_Stereo_Loopback/src/audioSample_io.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/armv5/bios/MCASP_Audio_evmOMAPL137_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/armv5/bios/audiosample.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/c674/bios/MCASP_Audio_evmOMAPL137_c674xExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/c674/bios/audiosample.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/evmOMAPL137/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/armv7/bios/MCASP_DeviceLoopback_idkAM571x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/c66/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/c66/bios/MCASP_DeviceLoopback_idkAM571x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM571x/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/armv7/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/armv7/bios/MCASP_DeviceLoopback_idkAM574x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/c66/bios/DeviceLoopback.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/c66/bios/MCASP_DeviceLoopback_idkAM574x_c66ExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/idkAM574x/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/Aic31.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/Aic31Local.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/ICodec.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/MCASP_log.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/aic31_if.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/audioEQ.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/codec_if.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/deviceloopback.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/hw_types.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/mcasp_debug.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/mcasp_tune.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/profiling.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/include/regression.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/include/audioEQ_biquad.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/mcasp_extra_config.xs [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/j721e/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/armv5/bios/MCASP_Audio_lcdkOMAPL138_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/armv5/bios/audiosample.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/c674/bios/MCASP_Audio_lcdkOMAPL138_c674xExampleProject.txt [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/c674/bios/audiosample.cfg [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/include/Audio_evmInit.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/include/mcasp_cfg.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/src/audio_evmInit.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/lcdkOMAPL138/src/mcasp_cfg.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/MCASP_log.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/aic31.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/aic3104_if.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/aic3106_if.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/audioEQ.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/audioEQ_biquad.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/audioSample_io.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/audioSample_io_regression.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/audioSample_main.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/codec_if.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/deviceloopback.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/mcasp_debug.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/profiling.c [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/profiling.h [new file with mode: 0644]
packages/ti/drv/mcasp/example/src/regression.c [new file with mode: 0644]
packages/ti/drv/mcasp/include/McaspLocal.h [new file with mode: 0644]
packages/ti/drv/mcasp/include/Module.xs [new file with mode: 0644]
packages/ti/drv/mcasp/install/mcasplld.mpi [new file with mode: 0644]
packages/ti/drv/mcasp/makefile [new file with mode: 0644]
packages/ti/drv/mcasp/mcasp_component.mk [new file with mode: 0644]
packages/ti/drv/mcasp/mcasp_drv.h [new file with mode: 0644]
packages/ti/drv/mcasp/mcasp_osal.h [new file with mode: 0644]
packages/ti/drv/mcasp/mcasp_types.h [new file with mode: 0644]
packages/ti/drv/mcasp/mcaspver.h [new file with mode: 0644]
packages/ti/drv/mcasp/mcaspver.h.xdt [new file with mode: 0644]
packages/ti/drv/mcasp/package.bld [new file with mode: 0644]
packages/ti/drv/mcasp/package.xdc [new file with mode: 0644]
packages/ti/drv/mcasp/package.xs [new file with mode: 0644]
packages/ti/drv/mcasp/soc/Module.xs [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am335x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am437x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am571x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am572x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am574x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/am65xx/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/dra72x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/dra75x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/dra78x/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/j721e/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/k2g/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/mcasp_soc.h [new file with mode: 0644]
packages/ti/drv/mcasp/soc/omapl137/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/soc/omapl138/mcasp_soc.c [new file with mode: 0644]
packages/ti/drv/mcasp/src/Module.xs [new file with mode: 0644]
packages/ti/drv/mcasp/src/dma/V0/mcasp_dma.c [new file with mode: 0644]
packages/ti/drv/mcasp/src/dma/V1/mcasp_dma.c [new file with mode: 0755]
packages/ti/drv/mcasp/src/mcasp_drv.c [new file with mode: 0755]
packages/ti/drv/mcasp/src/mcasp_ioctl.c [new file with mode: 0644]
packages/ti/drv/mcasp/src/src_files_common.mk [new file with mode: 0644]

diff --git a/packages/ti/drv/mcasp/.gitignore b/packages/ti/drv/mcasp/.gitignore
new file mode 100644 (file)
index 0000000..c3af857
--- /dev/null
@@ -0,0 +1 @@
+lib/
diff --git a/packages/ti/drv/mcasp/Settings.h b/packages/ti/drv/mcasp/Settings.h
new file mode 100644 (file)
index 0000000..8a9c916
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ *  Do not modify this file; it is automatically 
+ *  generated and any modifications will be overwritten.
+ *
+ * @(#) xdc-D20
+ */
+
+/*
+ * ======== GENERATED SECTIONS ========
+ *
+ *     PROLOGUE
+ *     INCLUDES
+ *
+ *     INTERNAL DEFINITIONS
+ *     MODULE-WIDE CONFIGS
+ *     FUNCTION DECLARATIONS
+ *     SYSTEM FUNCTIONS
+ *
+ *     EPILOGUE
+ *     STATE STRUCTURES
+ *     PREFIX ALIASES
+ */
+
+
+/*
+ * ======== PROLOGUE ========
+ */
+
+#ifndef ti_drv_mcasp_Settings__include
+#define ti_drv_mcasp_Settings__include
+
+#ifndef __nested__
+#define __nested__
+#define ti_drv_mcasp_Settings__top__
+#endif
+
+#ifdef __cplusplus
+#define __extern extern "C"
+#else
+#define __extern extern
+#endif
+
+#define ti_drv_mcasp_Settings___VERS 200
+
+
+/*
+ * ======== INCLUDES ========
+ */
+
+#include <xdc/std.h>
+
+#include <xdc/runtime/xdc.h>
+#include <xdc/runtime/Types.h>
+#include <ti/drv/mcasp/package/package.defs.h>
+
+#include <xdc/runtime/IModule.h>
+
+
+/*
+ * ======== AUXILIARY DEFINITIONS ========
+ */
+
+
+/*
+ * ======== INTERNAL DEFINITIONS ========
+ */
+
+
+/*
+ * ======== MODULE-WIDE CONFIGS ========
+ */
+
+/* Module__diagsEnabled */
+typedef xdc_Bits32 CT__ti_drv_mcasp_Settings_Module__diagsEnabled;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__diagsEnabled ti_drv_mcasp_Settings_Module__diagsEnabled__C;
+#ifdef ti_drv_mcasp_Settings_Module__diagsEnabled__CR
+#define ti_drv_mcasp_Settings_Module__diagsEnabled__C (*((CT__ti_drv_mcasp_Settings_Module__diagsEnabled*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__diagsEnabled__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__diagsEnabled (ti_drv_mcasp_Settings_Module__diagsEnabled__C)
+#endif
+
+/* Module__diagsIncluded */
+typedef xdc_Bits32 CT__ti_drv_mcasp_Settings_Module__diagsIncluded;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__diagsIncluded ti_drv_mcasp_Settings_Module__diagsIncluded__C;
+#ifdef ti_drv_mcasp_Settings_Module__diagsIncluded__CR
+#define ti_drv_mcasp_Settings_Module__diagsIncluded__C (*((CT__ti_drv_mcasp_Settings_Module__diagsIncluded*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__diagsIncluded__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__diagsIncluded (ti_drv_mcasp_Settings_Module__diagsIncluded__C)
+#endif
+
+/* Module__diagsMask */
+typedef xdc_Bits16 *CT__ti_drv_mcasp_Settings_Module__diagsMask;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__diagsMask ti_drv_mcasp_Settings_Module__diagsMask__C;
+#ifdef ti_drv_mcasp_Settings_Module__diagsMask__CR
+#define ti_drv_mcasp_Settings_Module__diagsMask__C (*((CT__ti_drv_mcasp_Settings_Module__diagsMask*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__diagsMask__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__diagsMask (ti_drv_mcasp_Settings_Module__diagsMask__C)
+#endif
+
+/* Module__gateObj */
+typedef xdc_Ptr CT__ti_drv_mcasp_Settings_Module__gateObj;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__gateObj ti_drv_mcasp_Settings_Module__gateObj__C;
+#ifdef ti_drv_mcasp_Settings_Module__gateObj__CR
+#define ti_drv_mcasp_Settings_Module__gateObj__C (*((CT__ti_drv_mcasp_Settings_Module__gateObj*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__gateObj__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__gateObj (ti_drv_mcasp_Settings_Module__gateObj__C)
+#endif
+
+/* Module__gatePrms */
+typedef xdc_Ptr CT__ti_drv_mcasp_Settings_Module__gatePrms;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__gatePrms ti_drv_mcasp_Settings_Module__gatePrms__C;
+#ifdef ti_drv_mcasp_Settings_Module__gatePrms__CR
+#define ti_drv_mcasp_Settings_Module__gatePrms__C (*((CT__ti_drv_mcasp_Settings_Module__gatePrms*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__gatePrms__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__gatePrms (ti_drv_mcasp_Settings_Module__gatePrms__C)
+#endif
+
+/* Module__id */
+typedef xdc_runtime_Types_ModuleId CT__ti_drv_mcasp_Settings_Module__id;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__id ti_drv_mcasp_Settings_Module__id__C;
+#ifdef ti_drv_mcasp_Settings_Module__id__CR
+#define ti_drv_mcasp_Settings_Module__id__C (*((CT__ti_drv_mcasp_Settings_Module__id*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__id__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__id (ti_drv_mcasp_Settings_Module__id__C)
+#endif
+
+/* Module__loggerDefined */
+typedef xdc_Bool CT__ti_drv_mcasp_Settings_Module__loggerDefined;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerDefined ti_drv_mcasp_Settings_Module__loggerDefined__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerDefined__CR
+#define ti_drv_mcasp_Settings_Module__loggerDefined__C (*((CT__ti_drv_mcasp_Settings_Module__loggerDefined*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerDefined__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerDefined (ti_drv_mcasp_Settings_Module__loggerDefined__C)
+#endif
+
+/* Module__loggerObj */
+typedef xdc_Ptr CT__ti_drv_mcasp_Settings_Module__loggerObj;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerObj ti_drv_mcasp_Settings_Module__loggerObj__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerObj__CR
+#define ti_drv_mcasp_Settings_Module__loggerObj__C (*((CT__ti_drv_mcasp_Settings_Module__loggerObj*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerObj__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerObj (ti_drv_mcasp_Settings_Module__loggerObj__C)
+#endif
+
+/* Module__loggerFxn0 */
+typedef xdc_runtime_Types_LoggerFxn0 CT__ti_drv_mcasp_Settings_Module__loggerFxn0;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerFxn0 ti_drv_mcasp_Settings_Module__loggerFxn0__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerFxn0__CR
+#define ti_drv_mcasp_Settings_Module__loggerFxn0__C (*((CT__ti_drv_mcasp_Settings_Module__loggerFxn0*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerFxn0__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerFxn0 (ti_drv_mcasp_Settings_Module__loggerFxn0__C)
+#endif
+
+/* Module__loggerFxn1 */
+typedef xdc_runtime_Types_LoggerFxn1 CT__ti_drv_mcasp_Settings_Module__loggerFxn1;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerFxn1 ti_drv_mcasp_Settings_Module__loggerFxn1__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerFxn1__CR
+#define ti_drv_mcasp_Settings_Module__loggerFxn1__C (*((CT__ti_drv_mcasp_Settings_Module__loggerFxn1*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerFxn1__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerFxn1 (ti_drv_mcasp_Settings_Module__loggerFxn1__C)
+#endif
+
+/* Module__loggerFxn2 */
+typedef xdc_runtime_Types_LoggerFxn2 CT__ti_drv_mcasp_Settings_Module__loggerFxn2;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerFxn2 ti_drv_mcasp_Settings_Module__loggerFxn2__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerFxn2__CR
+#define ti_drv_mcasp_Settings_Module__loggerFxn2__C (*((CT__ti_drv_mcasp_Settings_Module__loggerFxn2*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerFxn2__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerFxn2 (ti_drv_mcasp_Settings_Module__loggerFxn2__C)
+#endif
+
+/* Module__loggerFxn4 */
+typedef xdc_runtime_Types_LoggerFxn4 CT__ti_drv_mcasp_Settings_Module__loggerFxn4;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerFxn4 ti_drv_mcasp_Settings_Module__loggerFxn4__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerFxn4__CR
+#define ti_drv_mcasp_Settings_Module__loggerFxn4__C (*((CT__ti_drv_mcasp_Settings_Module__loggerFxn4*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerFxn4__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerFxn4 (ti_drv_mcasp_Settings_Module__loggerFxn4__C)
+#endif
+
+/* Module__loggerFxn8 */
+typedef xdc_runtime_Types_LoggerFxn8 CT__ti_drv_mcasp_Settings_Module__loggerFxn8;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Module__loggerFxn8 ti_drv_mcasp_Settings_Module__loggerFxn8__C;
+#ifdef ti_drv_mcasp_Settings_Module__loggerFxn8__CR
+#define ti_drv_mcasp_Settings_Module__loggerFxn8__C (*((CT__ti_drv_mcasp_Settings_Module__loggerFxn8*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Module__loggerFxn8__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Module__loggerFxn8 (ti_drv_mcasp_Settings_Module__loggerFxn8__C)
+#endif
+
+/* Object__count */
+typedef xdc_Int CT__ti_drv_mcasp_Settings_Object__count;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Object__count ti_drv_mcasp_Settings_Object__count__C;
+#ifdef ti_drv_mcasp_Settings_Object__count__CR
+#define ti_drv_mcasp_Settings_Object__count__C (*((CT__ti_drv_mcasp_Settings_Object__count*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Object__count__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Object__count (ti_drv_mcasp_Settings_Object__count__C)
+#endif
+
+/* Object__heap */
+typedef xdc_runtime_IHeap_Handle CT__ti_drv_mcasp_Settings_Object__heap;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Object__heap ti_drv_mcasp_Settings_Object__heap__C;
+#ifdef ti_drv_mcasp_Settings_Object__heap__CR
+#define ti_drv_mcasp_Settings_Object__heap__C (*((CT__ti_drv_mcasp_Settings_Object__heap*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Object__heap__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Object__heap (ti_drv_mcasp_Settings_Object__heap__C)
+#endif
+
+/* Object__sizeof */
+typedef xdc_SizeT CT__ti_drv_mcasp_Settings_Object__sizeof;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Object__sizeof ti_drv_mcasp_Settings_Object__sizeof__C;
+#ifdef ti_drv_mcasp_Settings_Object__sizeof__CR
+#define ti_drv_mcasp_Settings_Object__sizeof__C (*((CT__ti_drv_mcasp_Settings_Object__sizeof*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Object__sizeof__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Object__sizeof (ti_drv_mcasp_Settings_Object__sizeof__C)
+#endif
+
+/* Object__table */
+typedef xdc_Ptr CT__ti_drv_mcasp_Settings_Object__table;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_Object__table ti_drv_mcasp_Settings_Object__table__C;
+#ifdef ti_drv_mcasp_Settings_Object__table__CR
+#define ti_drv_mcasp_Settings_Object__table__C (*((CT__ti_drv_mcasp_Settings_Object__table*)(xdcRomConstPtr + ti_drv_mcasp_Settings_Object__table__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_Object__table (ti_drv_mcasp_Settings_Object__table__C)
+#endif
+
+/* mcaspVersionString */
+typedef xdc_String CT__ti_drv_mcasp_Settings_mcaspVersionString;
+__extern __FAR__ const CT__ti_drv_mcasp_Settings_mcaspVersionString ti_drv_mcasp_Settings_mcaspVersionString__C;
+#ifdef ti_drv_mcasp_Settings_mcaspVersionString__CR
+#define ti_drv_mcasp_Settings_mcaspVersionString (*((CT__ti_drv_mcasp_Settings_mcaspVersionString*)(xdcRomConstPtr + ti_drv_mcasp_Settings_mcaspVersionString__C_offset)))
+#else
+#define ti_drv_mcasp_Settings_mcaspVersionString (ti_drv_mcasp_Settings_mcaspVersionString__C)
+#endif
+
+
+/*
+ * ======== FUNCTION DECLARATIONS ========
+ */
+
+/* Module_startup */
+#define ti_drv_mcasp_Settings_Module_startup( state ) (-1)
+
+/* Module__startupDone__S */
+xdc__CODESECT(ti_drv_mcasp_Settings_Module__startupDone__S, "ti_drv_mcasp_Settings_Module__startupDone__S")
+__extern xdc_Bool ti_drv_mcasp_Settings_Module__startupDone__S( void );
+
+
+/*
+ * ======== SYSTEM FUNCTIONS ========
+ */
+
+/* Module_startupDone */
+#define ti_drv_mcasp_Settings_Module_startupDone() ti_drv_mcasp_Settings_Module__startupDone__S()
+
+/* Object_heap */
+#define ti_drv_mcasp_Settings_Object_heap() ti_drv_mcasp_Settings_Object__heap__C
+
+/* Module_heap */
+#define ti_drv_mcasp_Settings_Module_heap() ti_drv_mcasp_Settings_Object__heap__C
+
+/* Module_id */
+static inline CT__ti_drv_mcasp_Settings_Module__id ti_drv_mcasp_Settings_Module_id(void);
+static inline CT__ti_drv_mcasp_Settings_Module__id ti_drv_mcasp_Settings_Module_id( void ) 
+{
+    return ti_drv_mcasp_Settings_Module__id__C;
+}
+
+/* Module_hasMask */
+static inline xdc_Bool ti_drv_mcasp_Settings_Module_hasMask(void);
+static inline xdc_Bool ti_drv_mcasp_Settings_Module_hasMask(void) 
+{
+    return (xdc_Bool)(ti_drv_mcasp_Settings_Module__diagsMask__C != NULL);
+}
+
+/* Module_getMask */
+static inline xdc_Bits16 ti_drv_mcasp_Settings_Module_getMask(void);
+static inline xdc_Bits16 ti_drv_mcasp_Settings_Module_getMask( void ) 
+{
+    return ti_drv_mcasp_Settings_Module__diagsMask__C != NULL ? *ti_drv_mcasp_Settings_Module__diagsMask__C : (xdc_Bits16)0;
+}
+
+/* Module_setMask */
+static inline xdc_Void ti_drv_mcasp_Settings_Module_setMask(xdc_Bits16 mask);
+static inline xdc_Void ti_drv_mcasp_Settings_Module_setMask(xdc_Bits16 mask)
+{
+    if (ti_drv_mcasp_Settings_Module__diagsMask__C != NULL) {
+        *ti_drv_mcasp_Settings_Module__diagsMask__C = mask;
+    }
+}
+
+
+/*
+ * ======== EPILOGUE ========
+ */
+
+#ifdef ti_drv_mcasp_Settings__top__
+#undef __nested__
+#endif
+
+#endif /* ti_drv_mcasp_Settings__include */
+
+
+/*
+ * ======== STATE STRUCTURES ========
+ */
+
+#if defined(__config__) || (!defined(__nested__) && defined(ti_drv_mcasp_Settings__internalaccess))
+
+#ifndef ti_drv_mcasp_Settings__include_state
+#define ti_drv_mcasp_Settings__include_state
+
+
+#endif /* ti_drv_mcasp_Settings__include_state */
+
+#endif
+
+/*
+ * ======== PREFIX ALIASES ========
+ */
+
+#if !defined(__nested__) && !defined(ti_drv_mcasp_Settings__nolocalnames)
+
+#ifndef ti_drv_mcasp_Settings__localnames__done
+#define ti_drv_mcasp_Settings__localnames__done
+
+/* module prefix */
+#define Settings_mcaspVersionString ti_drv_mcasp_Settings_mcaspVersionString
+#define Settings_Module_name ti_drv_mcasp_Settings_Module_name
+#define Settings_Module_id ti_drv_mcasp_Settings_Module_id
+#define Settings_Module_startup ti_drv_mcasp_Settings_Module_startup
+#define Settings_Module_startupDone ti_drv_mcasp_Settings_Module_startupDone
+#define Settings_Module_hasMask ti_drv_mcasp_Settings_Module_hasMask
+#define Settings_Module_getMask ti_drv_mcasp_Settings_Module_getMask
+#define Settings_Module_setMask ti_drv_mcasp_Settings_Module_setMask
+#define Settings_Object_heap ti_drv_mcasp_Settings_Object_heap
+#define Settings_Module_heap ti_drv_mcasp_Settings_Module_heap
+
+#endif /* ti_drv_mcasp_Settings__localnames__done */
+#endif
diff --git a/packages/ti/drv/mcasp/Settings.xdc b/packages/ti/drv/mcasp/Settings.xdc
new file mode 100644 (file)
index 0000000..4ec1dce
--- /dev/null
@@ -0,0 +1,31 @@
+
+
+module Settings
+{
+    config string mcaspVersionString = "01.01.00.15";
+    /*! This variable is to control the SoC type selection.
+     * By default this variable is set to NULL.
+     * 
+     * To use LLD for the selected device, add the following lines to config
+     * file and set the deviceType correctly:
+        *
+     *      var mcaspSettings = xdc.useModule ('ti.drv.mcasp.Settings');
+     *      mcaspSettings.socType = "am572x";
+     * 
+     */
+    metaonly config string socType = "";
+       
+    /*! This variable is to control the device library type selection.
+     * By default this variable is set to release.
+     * 
+     * To use CSL to use the debug/release library, add the following lines to config
+     * file and set the library profile accordingly:
+     * 
+     *      var Uart Settings = xdc.useModule ('ti.Uart.Settings');
+     *      UartSettings.libProfile = "debug";
+     * 
+     */
+    metaonly config string libProfile = "release";     
+
+}
+
diff --git a/packages/ti/drv/mcasp/Settings.xdc.xdt b/packages/ti/drv/mcasp/Settings.xdc.xdt
new file mode 100644 (file)
index 0000000..7b3232e
--- /dev/null
@@ -0,0 +1,48 @@
+
+%%{
+/*!
+ *  This template implements the Settings.xdc
+ */  
+  /* Versioning */
+  var ver = this;
+  for each(i=0;i<ver.length;i++)
+  {
+      if(String(ver[i]).length < 2)
+      {
+        ver[i]="0"+ver[i];
+      }
+  }
+  
+  var packageVersion = "\""+ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3]+"\"";
+
+%%}
+
+module Settings
+{
+    config string mcaspVersionString = `packageVersion`;
+    /*! This variable is to control the SoC type selection.
+     * By default this variable is set to NULL.
+     * 
+     * To use LLD for the selected device, add the following lines to config
+     * file and set the deviceType correctly:
+        *
+     *      var mcaspSettings = xdc.useModule ('ti.drv.mcasp.Settings');
+     *      mcaspSettings.socType = "am572x";
+     * 
+     */
+    metaonly config string socType = "";
+       
+    /*! This variable is to control the device library type selection.
+     * By default this variable is set to release.
+     * 
+     * To use CSL to use the debug/release library, add the following lines to config
+     * file and set the library profile accordingly:
+     * 
+     *      var Uart Settings = xdc.useModule ('ti.Uart.Settings');
+     *      UartSettings.libProfile = "debug";
+     * 
+     */
+    metaonly config string libProfile = "release";     
+
+}
+
diff --git a/packages/ti/drv/mcasp/build/buildlib.xs b/packages/ti/drv/mcasp/build/buildlib.xs
new file mode 100644 (file)
index 0000000..a98d0af
--- /dev/null
@@ -0,0 +1,625 @@
+/******************************************************************************
+ * FILE PURPOSE: Build Library Utilities
+ ******************************************************************************
+ * FILE NAME: buildlib.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains common routines that are used by the various McASP 
+ *  LLD components.
+ *
+ * Copyright (C) 2014-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/**************************************************************************
+ * FUNCTION NAME : listAllFiles
+ **************************************************************************
+ * DESCRIPTION   :
+ *  Utility function which lists all files with a specific extension 
+ *  present in a directory and any directory inside it.
+ **************************************************************************/
+function listAllFiles(ext, dir, recurse)
+{     
+    var srcFile = [];
+    var d;
+
+    /* If recurse parameter is not specified we default to recursive search. */
+    if (recurse == null)
+        recurse = true;
+
+    if (dir == undefined) 
+          d = ".";
+    else 
+      d = dir;
+
+    /* Get access to the current directory. */
+    var file = new java.io.File(d);
+
+    /* Check if the file exists and it is a directory. */
+    if (file.exists() && file.isDirectory()) 
+    {
+        /* Get a list of all files in the specific directory. */
+        var fileList = file.listFiles();
+        for (var i = 0; i < fileList.length; i++) 
+        {
+            /* Dont add the generated directory 'package' and any of its files 
+             * to the list here. */
+            if (fileList[i].getName().matches("package") == false)
+            {
+                /* Check if the detected file is a directory */
+                if (fileList[i].isDirectory())
+                {
+                    /* We will recurse into the subdirectory only if required to do so. */
+                    if (recurse == true)
+                    {
+                        /* Generate the directory Name in which we will recurse. */ 
+                        var directoryName = d + "/" + fileList[i].getName();
+
+                        /* Get a list of all files in this directory */
+                        var fileListing = listAllFiles (ext, directoryName, recurse);
+                        if (fileListing != null)
+                        {
+                            /* Return a list of all file names in the directory. */
+                            for (var j = 0 ; j < fileListing.length; j++) 
+                                srcFile[srcFile.length++] = fileListing[j];
+                        }
+                    }
+                }
+                else
+                {
+                    /* This was a file. Check if the file name matches the extension */
+                    if (fileList[i].getName().endsWith(ext) == true)
+                        srcFile[srcFile.length++] = d + "/" + fileList[i].getName();
+                }
+            }
+        }
+        return srcFile;
+    }
+    return null;
+}
+
+function createMake(makefile)
+{
+    /* Create the main make file */
+    var fileModule = xdc.module('xdc.services.io.File');
+    if(makefile==undefined)
+    {
+      try{
+          makefile = fileModule.open("makefile", "w");
+         } catch (ex)
+         {
+           print("makefile cannot be written to. Please check Writing Permissions.");
+           java.lang.System.exit(1);
+         }   
+    
+      Pkg.makePrologue += "\ninclude makefile\n"; 
+         
+      Pkg.makeEpilogue += "\nclean::\n\t-$(RM)  makefile\n";
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#* FILE PURPOSE: Top level makefile for Creating Component Libraries");
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#* FILE NAME: makefile");
+      makefile.writeLine("#*");
+      makefile.writeLine("#* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options ");
+      makefile.writeLine("#*");
+      makefile.writeLine("#*");
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#*");
+      makefile.writeLine("# (Mandatory) Specify where various tools are installed.");
+
+      var file = xdc.module('xdc.services.io.File');
+    
+      
+      makefile.writeLine("\n# Output for prebuilt generated libraries");
+      makefile.writeLine("export LIBDIR ?= ./lib");
+      /* use sectti from path */
+      makefile.writeLine("export SECTTI ?= sectti");
+
+      /* Create INCDIR from XDCPATH */
+    
+      /* copy the environment array from the current environment */
+      var env   = java.lang.System.getenv();
+      var getxdcpath=String(java.lang.System.getenv("XDCPATH"));
+      getxdcpath= getxdcpath.replace(/\\/g,"/");
+      var keys  = env.keySet().toArray();
+      var key;
+      var stat={};
+      var env_j=[];
+      var listxdcpath = new Array();
+      for (var i = 0; i < keys.length; i++) {
+           key = String(keys[i]);
+           if((key.match("INSTALL_PATH")) || (key.match("INSTALLDIR")))
+           {
+             var keyPath=String(env.get(key));
+             keyPath=keyPath.replace(/\\/g,"/");
+             var file = xdc.module('xdc.services.io.File');
+             keyPath=file.getDOSPath(keyPath);
+             if(getxdcpath.toString().match(keyPath))
+             {
+                 listxdcpath.push({keyname: key,keypath: keyPath});
+                 while(getxdcpath.toString().match(keyPath))
+                 {
+                   getxdcpath=getxdcpath.toString().replace(keyPath,"$("+key+")");
+                 }
+             }
+           }
+    
+     }
+       var pkgroot="..";
+       for (var i = Pkg.name.split('.').length; i > 1; i--) {
+              pkgroot+="/..";
+          }
+        
+      makefile.writeLine("\n# ROOT Directory");        
+      makefile.writeLine("export ROOTDIR := "+pkgroot);
+    
+      makefile.writeLine("\n# INCLUDE Directory");
+      makefile.writeLine("export INCDIR := "+getxdcpath+";$(ROOTDIR)");       
+    
+      makefile.writeLine("\n# Common Macros used in make");  
+      makefile.writeLine("\nifndef RM");     
+      makefile.writeLine("export RM = rm -f");
+      makefile.writeLine("endif");        
+    
+      makefile.writeLine("\nifndef CP");     
+      makefile.writeLine("export CP = cp -p");    
+      makefile.writeLine("endif");    
+        
+      makefile.writeLine("\nexport MKDIR = mkdir -p");
+    
+      makefile.writeLine("\nifndef RMDIR");         
+      makefile.writeLine("export RMDIR = rm -rf");
+      makefile.writeLine("endif");        
+    
+      makefile.writeLine("\nifndef SED"); 
+      makefile.writeLine("export SED = sed");    
+      makefile.writeLine("endif");    
+    
+      makefile.writeLine("\nifndef MAKE"); 
+      makefile.writeLine("export MAKE = make");    
+      makefile.writeLine("endif");        
+
+      makefile.writeLine("\n# PHONY Targets");                
+      makefile.writeLine(".PHONY: all clean cleanall ");    
+      
+      makefile.writeLine("\n# FORCE Targets");                
+      makefile.writeLine("FORCE: ");          
+      
+      makefile.writeLine("\n# all rule");                
+      makefile.writeLine("all: .executables");           
+      makefile.writeLine(".executables: .libraries");
+      makefile.writeLine(".libraries:");
+      
+      makefile.writeLine("\n# Clean Rule");          
+      makefile.writeLine("clean:: clean_package");                  
+      makefile.writeLine("# Clean Top Level Object Directory ");          
+      makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/");      
+      makefile.writeLine("\t$(RMDIR) package/cfg");            
+   }
+   else
+   {
+     try{
+          makefile = fileModule.open("makefile", "a");
+         } catch (ex)
+         {
+           print("makefile cannot be written to. Please check Writing Permissions.");
+           java.lang.System.exit(1);
+         }  
+    
+    }
+
+ return makefile;
+}
+
+function createLibMake(device, objExtDir, makelibname,targetname, objectPath)
+{
+   var tooldir;
+   var cmdprefix;
+   var targetDir;
+   var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");
+   
+
+   switch(stringname)
+   {
+    case String(C66LE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c66/release";
+      targetname=C66LE;
+      break;
+    case String(C66BE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c66/release";
+      targetname=C66BE;
+      break;
+       case String(C674LE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c674/release";
+      targetname=C674LE;
+      break;
+    case String(A15LE):
+      tooldir="TOOLCHAIN_PATH_A15"; 
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a15/release";
+      targetname=A15LE;
+      break;
+    case String(A9LE):
+      tooldir="TOOLCHAIN_PATH_A9";
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a9/release";
+      targetname=A9LE;
+      break;
+       case String(ARM9LE):
+      tooldir="TOOLCHAIN_PATH_Arm9";
+      cmdprefix="";
+      targetDir="arm9/release";
+      targetname=ARM9LE;
+      break;
+    case String(A8LE):
+      tooldir="TOOLCHAIN_PATH_A8";
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a8/release";
+      targetname=A8LE;
+      break;
+    case String(M4LE):
+      tooldir="TOOLCHAIN_PATH_M4";
+      cmdprefix="";
+      targetDir="m4/release";
+      targetname=M4LE;
+      break;
+   }
+   
+    var fileModule = xdc.module('xdc.services.io.File');
+    try{
+     var dstFile = new java.io.File(makelibname);
+     dstFile.getParentFile().mkdirs();    
+     libmakefile = fileModule.open(makelibname, "w");
+     /* Add to Archive list */
+    } catch (ex)
+    {
+     print(makelibname+" cannot be written to. Please check Writing Permissions.");
+     java.lang.System.exit(1);
+    }   
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#* FILE PURPOSE: Lower level makefile for Creating Component Libraries");
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#* FILE NAME: "+makelibname);
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#* DESCRIPTION: Defines Source Files, Compilers flags and build rules");
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("# Macro definitions referenced below");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("empty =");
+    libmakefile.writeLine("space =$(empty) $(empty)");
+    
+    if ((targetname.name == "A15F") || (targetname.name == "A9F") || (targetname.name == "A8F"))
+    {
+    
+        if(stringname.match("gnu.targets"))
+        {
+            libmakefile.writeLine("CC = $("+tooldir+")/bin/$("+cmdprefix+")gcc");
+            libmakefile.writeLine("AC = $("+tooldir+")/bin/$("+cmdprefix+")as");    
+            libmakefile.writeLine("ARIN = $("+tooldir+")/bin/$("+cmdprefix+")ar");    
+            libmakefile.writeLine("LD = $("+tooldir+")/bin/$("+cmdprefix+")gcc");   
+        }
+        else
+        {
+            print("Error: Non-GNU targets are not currently supported ");
+            java.lang.System.exit(1);
+
+        }
+       
+        libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR)))) -I$("+tooldir+")/include");
+        libmakefile.writeLine("OBJEXT = o"+targetname.suffix); 
+        libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);     
+        libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+        libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+        libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+        libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
+        libmakefile.writeLine("INTERNALDEFS = -MD -MF $@.dep");
+        libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");  /* TBD */
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir); 
+    
+    }
+    else
+    {
+  
+        if(stringname.match("ti.targets"))
+        {
+
+            var rtslibtemp = targetname.lnkOpts.suffix.toString().split("/");
+            var rtslib;
+            for(n=0;n<rtslibtemp.length;n++)
+            {
+                if(rtslibtemp[n].match(".lib"))
+                { 
+                    rtslib=rtslibtemp[n];
+                }
+            }
+
+            libmakefile.writeLine("CC = $("+tooldir+")/bin/"+targetname.cc.cmd);
+            libmakefile.writeLine("AC = $("+tooldir+")/bin/"+targetname.asm.cmd);    
+            libmakefile.writeLine("ARIN = $("+tooldir+")/bin/"+targetname.ar.cmd);    
+            libmakefile.writeLine("LD = $("+tooldir+")/bin/"+targetname.lnk.cmd);   
+            libmakefile.writeLine("RTSLIB = -l $("+tooldir+")/lib/"+rtslib);        
+        }
+        else
+        {
+            print("Error: Non-TI targets are not currently supported ");
+            java.lang.System.exit(1);
+
+        }
+       
+        libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR)))) -I$("+tooldir+")/include");
+        libmakefile.writeLine("OBJEXT = o"+targetname.suffix); 
+        libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);     
+        libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+        libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+        libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+        libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
+        /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/
+        libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+"  -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");
+        libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir); 
+    }
+   
+ return libmakefile;
+
+}
+
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir)
+{
+  var  sourcestring = (srcString + fileExt).toString().toUpperCase();
+  var  compileflagstring = sourcestring + "FLAGS";
+  var  objectliststring = sourcestring + "OBJS";
+  /* List all the source files */
+  makefilename.writeLine("\n#List the "+srcString+" Files");  
+  makefilename.writeLine(sourcestring + "= \\");
+  for(var i=0;i<srcfiles.length-1;i++)
+  {
+    makefilename.writeLine("    "+srcfiles[i]+"\\");
+  }
+    makefilename.writeLine("    "+srcfiles[i]+"\n");
+    
+ /* Flags for the source files */
+ makefilename.writeLine("# FLAGS for the "+srcString+" Files"); 
+ var compileflags="";
+ if(fileExt == "asm" && flags.aopts != undefined)
+ {
+   compileflags+=" "+flags.aopts;
+ }
+ else if((fileExt == "c" || fileExt == "sa")&& flags.copts != undefined)
+ {
+   compileflags+=" "+flags.copts;
+ } 
+
+ if(flags.incs != undefined)
+ {
+   compileflags+=" "+flags.incs;
+ }
+
+
+ makefilename.writeLine(compileflagstring+" = "+compileflags +" \n");     
+ makefilename.writeLine("# Make Rule for the "+srcString+" Files");  
+ makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))"); 
+ makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt);   
+ if(fileExt == "c")
+ { 
+   makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ...");     
+ }
+ else
+ {
+   makefilename.writeLine("\t-@echo asm"+targetName.suffix +" $< ...");      
+ }
+ makefilename.writeLine("\tif [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; fi;");           
+ if(fileExt == "c")
+ {
+   if ((targetName.name == "A15F") || (targetName.name == "A9F") || (targetName.name == "A8F"))
+   {
+    makefilename.writeLine("\t$(RM) $@.dep");
+    makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< -o $@");
+   /* 
+    TBD
+   */
+   }
+   else
+   {
+    makefilename.writeLine("\t$(RM) $@.dep");
+    makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fc $< ");
+    makefilename.writeLine("\t-@$(CP) $@.dep $@.pp; \\");
+    makefilename.writeLine("         $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\$$//' \\");
+    makefilename.writeLine("             -e '/^$$/ d' -e 's/$$/ :/' < $@.pp >> $@.dep; \\");
+    makefilename.writeLine("         $(RM) $@.pp ");
+   }
+ }
+ else if(fileExt == "asm")
+ {
+   makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fa $< ");
+ }
+ else if(fileExt == "sa")
+ {
+   makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< ");
+ }
+ makefilename.writeLine("\n#Create Empty rule for dependency");
+ makefilename.writeLine("$("+objectliststring+"):"+makefilename.$private.fd);
+ makefilename.writeLine(makefilename.$private.fd+":");
+ makefilename.writeLine("\n#Include Depedency for "+srcString+" Files");
+ makefilename.writeLine("ifneq (clean,$(MAKECMDGOALS))");
+ makefilename.writeLine(" -include $("+objectliststring+":%.$(OBJEXT)=%.$(OBJEXT).dep)");
+ makefilename.writeLine("endif");
+}
+
+/**************************************************************************
+ * FUNCTION NAME : buildLibrary
+ **************************************************************************
+ * DESCRIPTION   :
+ *  Utility function which will build a specific library
+ **************************************************************************/
+var makefilelocal;
+function buildLibrary (socName, isDmaSoc, isSoc, libOptions, libName, target, libFiles) 
+{
+    var targetDir;
+    var objExtDir;
+    
+    if (target.name == "A15F")
+    {
+        targetDir = "a15/release";
+    }
+       else if (target.name == "A9F")
+    {
+        targetDir = "a9/release";
+    }
+       else if (target.name == "A8F")
+    {
+        targetDir = "a8/release";
+    }
+    else if (target.name == "M4")
+    {
+        targetDir = "m4/release";
+    }
+       else if (target.name == "Arm9")
+    {
+        targetDir = "arm9/release";
+    }
+       else if (target.name == "C674")
+    {
+        targetDir = "c674/release";
+    }
+    else
+    {
+        targetDir = "c66/release";
+    }
+    
+    /* Derive the operating system and soc names */
+    if (isSoc == "true") {
+        var libNameExp = libName;
+        targetDir = socName+"/"+targetDir;
+        objExtDir = "soc";
+    }
+    else  {
+        var libNameExp = libName;
+        objExtDir = "all";
+    }
+
+    var lldFullLibraryPath = "./lib/" + targetDir +"/" + libNameExp;
+    var lldFullBuildPath = "./build/" + targetDir +"/" + libNameExp;
+    var lldFullLibraryPathMake = "$(LIBDIR)/" + targetDir +"/" + libNameExp;
+    /* Create Main make file in the root of package folder */
+    makefilelocal = createMake(makefilelocal);
+
+    /* Write the rule to make library in main makefile */
+    lib = lldFullBuildPath+".a"+target.suffix;
+    libMake = lldFullLibraryPathMake+".a"+target.suffix;
+    var objectPath= "./package/"+lldFullBuildPath;
+  
+    makefilelocal.writeLine("\n\n# Make rule to create "+libMake+" library");
+    makefilelocal.writeLine(".libraries: "+ libMake);
+    makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@");                                 
+
+    /* Create Library make file in the lib folder */
+    var makefilelib= createLibMake(socName, objExtDir, lib+".mk",target,objectPath);  
+
+    /* Rule to clean library in main makefile */
+    makefilelocal.writeLine("# Rule to clean "+libMake+" library");                                              
+    makefilelocal.writeLine("clean ::\n\t$(RM) "+ libMake);                                          
+    librule="\n\n"+libMake+" :";
+
+    /* Add files to be compiled */
+    /* Separate out the C and assembly files */
+    var cfiles= new Array();
+    var afiles= new Array();
+    var safiles= new Array();
+    for each(var srcFile in libFiles)
+    {
+        var srcFile=String(srcFile);
+        var dot = srcFile.lastIndexOf(".");
+        var extension = srcFile.substr(dot,srcFile.length);      
+        if(extension == ".c")
+        {
+            cfiles.push(srcFile);
+        }
+        else if(extension == ".sa")
+        {
+            safiles.push(srcFile);
+        }
+        else if(extension == ".asm")
+        {
+            afiles.push(srcFile);
+        }
+        else
+        {
+            print("ERROR: Unsupported file extension");
+            java.lang.System.exit(1);
+        }
+    }
+    if(cfiles.length > 0)
+    {                                                
+      makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCCOBJS)";                   
+    }
+    if(afiles.length > 0)
+    {                                                
+      makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCASMOBJS)";                   
+    }
+    if(safiles.length > 0)
+    {                                                
+      makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCSAOBJS)";                   
+    }
+
+    makefilelib.writeLine(librule);
+    makefilelib.writeLine("\t@echo archiving $? into $@ ...");
+    makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/"+targetDir+" ]; then $(MKDIR) $(LIBDIR)/"+targetDir+" ; fi;"); 
+       makefilelib.writeLine("\t$(ARIN) $(ARFLAGS_INTERNAL) $@ $?");
+       makefilelib.close();   
+
+    /* Create the Epilogue; which executes after all the builds are completed. 
+     * This is used to generate the benchmark information for the built library. 
+     * Also add the benchmarking information file to the package. */
+    /* Put the temp file in object directory since javascript doesn't have a built in tmpname, 
+     * and don't want --jobs=# with # > 1 to result in collisions */
+    var libFullName = lldFullLibraryPath + ".a" + target.suffix;
+    var tempFile = libFullName + ".xml";
+    Pkg.makeEpilogue += ".libraries: " + libFullName +  "_size.txt\n";
+    Pkg.makeEpilogue += libFullName +  "_size.txt: " + libFullName + "\n";
+    if ( java.lang.String(target.name).contains('66') )
+    {    
+        Pkg.makeEpilogue += "\n\t $(C6X_GEN_INSTALL_PATH)/bin/ofd6x -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }   
+    else if (target.name == "M4")
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_M4)/bin/armofd -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }
+    else
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_A15)/bin/$(CROSS_TOOL_PRFX)size " + libFullName + " > " + libFullName + "_size.txt";
+    }                
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;
+
+    /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
+    Pkg.makeEpilogue += "\nclean::\n";
+    Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; 
+    Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + targetDir + "/ \n\n";
+
+    return lib;
+}
+
+
+
diff --git a/packages/ti/drv/mcasp/build/makefile.mk b/packages/ti/drv/mcasp/build/makefile.mk
new file mode 100644 (file)
index 0000000..2e53e91
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# Copyright (c) 2017, Texas Instruments Incorporated
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# *  Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# *  Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# *  Neither the name of Texas Instruments Incorporated nor the names of
+#    its contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_MCASP_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = mcasp
+
+ifeq ($(SOC),$(filter $(SOC), am571x am572x am574x dra72x dra75x dra78x k2g am437x omapl137 omapl138 am65xx j721e))
+SRCDIR += soc/$(SOC)
+INCDIR += soc
+# Common source files across all platforms and cores
+  SRCS_COMMON += mcasp_soc.c
+endif
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk
+                      
+ifeq ($(SOC),$(filter $(SOC), am571x am572x am574x dra72x dra75x dra78x k2g am437x omapl137 omapl138 am65xx j721e))
+
+endif
+
+ifeq ($(SOC),$(filter $(SOC), am65xx j721e))
+CFLAGS_LOCAL_COMMON += -DMCASP_UDMA_ENABLED
+endif
+
+CFLAGS_LOCAL_COMMON += $(PDK_CFLAGS)
+
+ifeq ($(SOC),$(filter $(SOC), am571x am572x am574x dra72x dra75x dra78x k2g am437x am335x omapl137 omapl138))
+CFLAGS_LOCAL_COMMON += -DMcasp_LOOPJOB_ENABLED -DMCASP_EDMA_ENABLED
+INCLUDE_EXTERNAL_INTERFACES += edma
+endif
+
+ifeq ($(CORE),$(filter $(CORE), c66x c674x))
+CFLAGS_LOCAL_COMMON += -DBUILD_DSP
+endif
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/mcasp/build/makefile_profile.mk b/packages/ti/drv/mcasp/build/makefile_profile.mk
new file mode 100644 (file)
index 0000000..a5a3090
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (c) 2017, Texas Instruments Incorporated
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# *  Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# *  Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# *  Neither the name of Texas Instruments Incorporated nor the names of
+#    its contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_MCASP_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = mcasp_profile
+
+ifeq ($(SOC),$(filter $(SOC), am571x am572x am574x dra72x dra75x dra78x k2g am437x omapl137 omapl138 am65xx))
+SRCDIR += soc/$(SOC)
+INCDIR += soc
+# Common source files across all platforms and cores
+  SRCS_COMMON += mcasp_soc.c
+endif
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk
+                      
+
+ifeq ($(SOC),$(filter $(SOC),  am571x am572x am574x dra72x dra72x dra75x dra78x k2g am437x omapl137 omapl138 am65xx))
+endif
+
+
+ifeq ($(BUILDTYPE),$(filter $(BUILDTYPE), profile profiledma))
+  ifeq ($(CORE),$(filter $(CORE), a15_0 a9host a8host mpu1_0))
+    CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) -finstrument-functions -gdwarf-3 -g -D_ENABLE_BM
+  else
+    CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) --entry_parm=address --exit_hook=ti_utils_exit --exit_parm=address --entry_hook=ti_utils_entry -g -D_ENABLE_BM
+  endif
+endif
+
+
+ifeq ($(SOC),$(filter $(SOC), am571x am572x am574x dra72x dra72x dra75x dra78x k2g am437x am335x omapl137 omapl138))
+CFLAGS_LOCAL_COMMON += -DMcasp_LOOPJOB_ENABLED -DMCASP_EDMA_ENABLED
+INCLUDE_EXTERNAL_INTERFACES += edma
+endif
+
+
+ifeq ($(SOC),$(filter $(SOC),am65xx))
+CFLAGS_LOCAL_COMMON += -DMCASP_UDMA_ENABLED
+endif
+
+ifeq ($(CORE),$(filter $(CORE), c66x c674x))
+CFLAGS_LOCAL_COMMON += -DBUILD_DSP
+endif
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/mcasp/config.bld b/packages/ti/drv/mcasp/config.bld
new file mode 100644 (file)
index 0000000..8b80037
--- /dev/null
@@ -0,0 +1,282 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the MCASP LLD
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION: 
+ *  This file contains the build configuration script for the MCASP LLD
+ *  and is responsible for configuration of the paths for the various 
+ *  tools required to build the LLD.
+ *
+ * Copyright (C) 2014-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var c674ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var m4ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+var a9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
+var arm9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_ARM9");
+var a8ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+/* Get the extended debug flags for C66x, 
+ * did not change the name for backwards compatibilty */
+var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
+
+/* Get the extended debug flags for A15 */
+var extDbgFlags_a15 = java.lang.System.getenv("EXTDBGFLAGS_A15");
+
+/* Get the extended debug flags for A8 */
+var extDbgFlags_a8 = java.lang.System.getenv("EXTDBGFLAGS_A8");
+
+/* Get the extended debug flags for A9 */
+var extDbgFlags_a9 = java.lang.System.getenv("EXTDBGFLAGS_A9");
+
+/* Get the extended debug flags for ARM9 */
+var extDbgFlags_arm9 = java.lang.System.getenv("EXTDBGFLAGS_ARM9");
+/* Get the extended debug flags for M4 */
+var extDbgFlags_m4 = java.lang.System.getenv("EXTDBGFLAGS_M4");
+
+/* Get the base directory for the McASP LLD Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath + " -I" + driverPath + "/include";
+
+/* Configure the McASP Release Version Information */
+/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
+var driverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
+
+/* Print the Compiler Options */
+var pOpts = 1;
+
+/* C66 ELF compiler configuration for Little Endian Mode. */
+var C66LE           = xdc.useModule('ti.targets.elf.C66');
+C66LE.rootDir       = c66ToolsBaseDir;
+C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DPSP_DISABLE_INPUT_PARAMETER_CHECK -DBUILD_DSP";
+if(extDbgFlags)     
+    C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags; 
+
+/* C66 ELF compiler configuration for Big Endian Mode. */
+var C66BE           = xdc.useModule('ti.targets.elf.C66_big_endian');
+C66BE.rootDir       = c66ToolsBaseDir;
+C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
+if(extDbgFlags)     
+    C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
+
+       /* C674 ELF compiler configuration for Little Endian Mode. */
+var C674LE          = xdc.useModule('ti.targets.elf.C674');
+C674LE.rootDir       = c674ToolsBaseDir;
+C674LE.asmOpts.prefix = "--strip_coff_underscore";
+C674LE.ccOpts.prefix  = "--strip_coff_underscore -mo -o3 -q -k -eo.o " + "-D" + cslPartNumber;
+if(extDbgFlags)     
+    C674LE.ccOpts.prefix = C674LE.ccOpts.prefix + " " + extDbgFlags; 
+       
+/* ARMv7 A15 compiler configuration */
+var A15LE            = xdc.useModule('gnu.targets.arm.A15F');
+A15LE.rootDir        = a15ToolsBaseDir;
+A15LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a15)     
+    A15LE.ccOpts.prefix = A15LE.ccOpts.prefix + " " + extDbgFlags_a15; 
+    
+/* ARMv7 A9 compiler configuration */
+var A9LE            = xdc.useModule('gnu.targets.arm.A9F');
+A9LE.rootDir        = a9ToolsBaseDir;
+A9LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a9 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a9)     
+    A9LE.ccOpts.prefix = A9LE.ccOpts.prefix + " " + extDbgFlags_a9; 
+
+/* ARMv5 ARM9 compiler configuration */
+var ARM9LE            = xdc.useModule('ti.targets.arm.elf.Arm9');
+ARM9LE.rootDir        = arm9ToolsBaseDir;
+ARM9LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=arm926ej-s -msoft-float -mfloat-abi=soft -march=armv5te -marm -DDRA7xx -Dxdc_target_types__=gnu/targets/arm/std.h -Dxdc_target_name__=Arm9 -gstrict-dwarf -Wall -D__ARMv5 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_arm9)     
+    ARM9LE.ccOpts.prefix = ARM9LE.ccOpts.prefix + " " + extDbgFlags_arm9; 
+       
+/* ARMv7 A8 compiler configuration */
+var A8LE            = xdc.useModule('gnu.targets.arm.A8F');
+A8LE.rootDir        = a8ToolsBaseDir;
+A8LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a8 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a8)     
+    A8LE.ccOpts.prefix = A8LE.ccOpts.prefix + " " + extDbgFlags_a8; 
+
+/* M4 ELF compiler configuration for Little Endian Mode. */
+var M4LE            = xdc.useModule('ti.targets.arm.elf.M4');
+M4LE.rootDir        = m4ToolsBaseDir;
+M4LE.ccOpts.prefix  = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD";
+if(extDbgFlags_m4)
+    M4LE.ccOpts.prefix = M4LE.ccOpts.prefix + " " + extDbgFlags_m4; 
+
+/* soc name (am?) is inserted between first an second element of this
+   list to construct device file name for each device */
+var deviceConstruct = [ "soc/", "/mcasp_soc.c" ];
+
+/* Create the SoC List  */
+var socs = { 
+    /* device independent libraries */
+    all :
+    {
+        /* Build this library */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "false",
+        /* Library options */
+        copts: "",
+        /* target lists, kept blank now, would be updated based on argument lists */
+        targets: []
+    },
+    am335x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am335x */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DSOC_AM335x",
+        /* target list */
+        targets: [ A8LE ]
+    },
+    am437x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am437x */
+        build: "false",       
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DSOC_AM437x",
+        /* target list */
+        targets: [ A9LE ]
+   },
+   am572x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am572x */
+        build: "false", 
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_AM572x",
+       /* target list */
+       targets: [ C66LE, M4LE, A15LE]
+    },
+   am574x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am574x */
+        build: "false",
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_AM574x",
+       /* target list */
+       targets: [ C66LE, M4LE, A15LE]
+    },
+   am571x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am571x */
+        build: "false",     
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_AM571x",
+       /* target list */
+       targets: [ C66LE, M4LE, A15LE]
+    },
+  k2g :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains k2g */
+        build: "false",     
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_K2G",
+       /* target list */
+       targets: [ C66LE, A15LE]
+    },
+  omapl137 :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains k2g */
+        build: "false",     
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_OMAPL137",
+       /* target list */
+       targets: [ C674LE, ARM9LE]
+    }
+ omapl138 :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains omapl138 */
+        build: "false",
+       /* SoC lib enabled */
+       socDevLib: "true",
+       /* Library options */
+       copts: " -DSOC_OMAPL138",
+       /* target list */
+       targets: [ C674LE, ARM9LE]
+    }
+};
+
+/**************************************************************************
+ * FUNCTION NAME : merge
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to merge two arrarys
+ **************************************************************************/
+function merge() {
+    var args = arguments;
+    var hash = {};
+    var arr = [];
+    for (var i = 0; i < args.length; i++) {
+       for (var j = 0; j < args[i].length; j++) {
+         if (hash[args[i][j]] !== true) {
+           arr[arr.length] = args[i][j];
+           hash[args[i][j]] = true;
+         }
+       }
+     }
+    return arr;
+}
+
+/* Grab input from XDCARGS */
+var buildArguments  = [];
+
+/* Construct the build arguments */
+for (var tmp=0; arguments[tmp] != undefined; tmp++)
+{
+
+    /* If no arguments are provided, override for building all */
+    if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )
+        buildArguments[buildArguments.length++] = "all";
+    else
+        buildArguments[buildArguments.length++] = arguments[tmp];
+}
+
+/* Build targets on this build */
+var build_targets = [];
+var soc_names = Object.keys(socs);
+
+for (var i=0; i < buildArguments.length; i++ ) {
+    /* Build it for all targets */
+    if (buildArguments[i] == "all") {
+        for (var j = 0; j < soc_names.length; j++)  {
+            build_targets = merge (build_targets.slice(0), socs[soc_names[j]].targets.slice(0));
+            /* Set build to "true" for that SoC */
+            socs[soc_names[j]].build = "true";
+        }
+    }
+    else {
+        /* Skip the first argument, which is ./config.bld to get to next SoCs */
+        if (i == 0) continue;          
+        /* Set that build to true if it is found in supported build socs */
+        for (j = 0; j < soc_names.length; j++) {
+            if (buildArguments[i] == soc_names[j]) {
+                socs[buildArguments[i]].build = "true";
+                build_targets = merge (build_targets.slice(0), socs[buildArguments[i]].targets.slice(0));
+                break;
+            }
+        }
+    }   
+}
+
+/* Update the Build target generated list */
+socs["all"].targets = build_targets; 
+Build.targets   = build_targets;
diff --git a/packages/ti/drv/mcasp/config_mk.bld b/packages/ti/drv/mcasp/config_mk.bld
new file mode 100644 (file)
index 0000000..268c0b9
--- /dev/null
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the MCASP LLD
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION: 
+ *  This file contains the build configuration script for the MCASP LLD
+ *  and is responsible for configuration of the paths for the various 
+ *  tools required to build the LLD.
+ *
+ * Copyright (C) 2014-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var c674ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var m4ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+var a9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
+var arm9ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_ARM9");
+var a8ToolsBaseDir  = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+/* Get the base directory for the McASP LLD Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath + " -I" + driverPath + "/include";
+
+/* Configure the McASP Release Version Information */
+/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
+var driverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
+
+/* Do not Print the Compiler Options */
+var pOpts = 0;
+
+/* List of all devices that needs to be build via XDC
+ * As the build happens through makefile, there is nothing to build via XDC
+ * using the below for packaging infrastructure
+ */
+var socs = [];
+var devices = [];
+var build_devices = [];
+Build.targets = []
+
diff --git a/packages/ti/drv/mcasp/docs/Doxyfile b/packages/ti/drv/mcasp/docs/Doxyfile
new file mode 100644 (file)
index 0000000..55ee96d
--- /dev/null
@@ -0,0 +1,289 @@
+
+# Doxyfile 1.5.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = "MCASP Low Level Driver"
+PROJECT_NUMBER         = 1.1.0.15
+OUTPUT_DIRECTORY       = ./docs/doxygen
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+TYPEDEF_HIDES_STRUCT   = NO
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl
+RECURSIVE              = YES
+EXCLUDE                = YES \
+                         ./example \
+                         ./test \
+                         ./package \
+                         ./packages
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = cslr_*.h
+EXCLUDE_SYMBOLS        = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = ./docs/tiheader.htm
+HTML_FOOTER            = ./docs/tifooter.htm
+HTML_STYLESHEET        = 
+GENERATE_HTMLHELP      = YES
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+HTML_DYNAMIC_SECTIONS  = NO
+CHM_FILE               = 
+HHC_LOCATION           = hhc.exe
+GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     = 
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NONE
+TREEVIEW_WIDTH         = 250
+FORMULA_FONTSIZE       = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            = 
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+DOT_FONTPATH           = 
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 1000
+DOT_TRANSPARENT        = YES
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+
+
diff --git a/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.doc b/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.doc
new file mode 100644 (file)
index 0000000..b61e433
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.doc differ
diff --git a/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.pdf b/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.pdf
new file mode 100644 (file)
index 0000000..b46be09
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/MCASP_LLD_SDS.pdf differ
diff --git a/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.doc b/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.doc
new file mode 100644 (file)
index 0000000..3a713ee
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.doc differ
diff --git a/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.pdf b/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.pdf
new file mode 100644 (file)
index 0000000..4ea85a9
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.pdf differ
diff --git a/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.txt b/packages/ti/drv/mcasp/docs/MCASP_LLD_SoftwareManifest.txt
new file mode 100644 (file)
index 0000000..21190cd
--- /dev/null
@@ -0,0 +1,102 @@
+<--\r
+Manifest template 1.0  \r
+\r
+This template is used to generate an unloadable manifest to the SRAS. \r
+\r
+To do so, save the document as a plain text file (Save As .txt). \r
+\r
+Do not change any options on the save which means leave the default as Windows Default Encoding UNLESS you are on a MAC in which case you must change the encoding to Windows.\r
+\r
+The SRAS will generate a nice looking HTML manifest for you.\r
+\r
+Instructions:\r
+\r
+ 1.   Text in blue should not be edited or removed. It will NOT appear on your manifest.\r
+ 2.   DO NOT color outside the lines in the manifest.  There are specific blocks where you enter information. Information \r
+       should only be entered in the sections below and not outside of them.\r
+ 3.   DO NOT use the < or > symbols in your manifest table or in your footnotes.\r
+ 4.   Please REFRAIN from using Word specific formatting when filling in the table. Examples are things like superscripts,\r
+      subscripts, etc. We are unable to understand those.\r
+ 5.   Auto correction is not your friend in word. Please turn it off. It should be disabled already in this template.\r
+\r
+Table Instructions:\r
+\r
+Define what you are delivering by filling in the table below. Tables start with the start keyword <table> end with the end keyword, </table> and may also contain footnotes specific to that table.  \r
+\r
+You can have as many \93Public\94 tables as you like in your manifest and can name them.  You can have one and only one \93Private\94 table. To create additional tables copy everything starting with <table> down to </table> and then paste it after the table below.\r
+\r
+The field \93attribute =\94 can be set to Public (the default) or Private to define the type of table it is. If the table is Public then everything in the table will appear on your manifest. If the table is Private then none of the entries will appear on your manifest but they will be stored in the SRAS. Private tables are useful for documenting third party code, that requires Legal review, but does not need to be acknowledged on the manifest you ship; e.g. it may be covered by our TI license.\r
+\r
+The field \93name = \93 is used to put a heading over the table on the manifest you ship.\r
+\r
+The field \93description =\94 is used to put a description under the Table name on the manifest you ship.\r
+\r
+To learn how to document software in the table read the instructions here. A brief explanation of the table columns follows.\r
+License Type - If its an SPDX defined license use their short name identifier. You can see a list here: http://spdx.org/licenses/ . If it\92s not on the list and not a commercial or TSPA  license then use the application name as the license.\r
+\r
+Delivered As - This field will either be \93Source\94\93Binary\94 or \93Source and Binary\94 and is the form the content of the Software is delivered in.  If the Software is delivered in an archive format, this field applies to the contents of the archive. If the word Limited is used with Source, as in \93Limited Source\94 or \93Limited Source and Binary\94 then only portions of the Source for the application are provided.\r
+\r
+Modified by TI - This field will either be \93Yes\94 or \93No\94. A \93Yes\94 means TI has made changes to the Software. A \93No\94 means TI has not made any changes. Note: This field is not applicable for Software \93Obtained from\94 TI.\r
+\r
+Location - The directory name and path on the media, e.g. drive, (or in an archive) where the Software is located after installing or extracting. \r
+\r
+Obtained From - This field specifies from where or from whom TI obtained the Software. It may be a URL to an Open Source site, a 3rd party licensor, or TI (if TI developed the software). If this field contains a link to Open Source software, the date TI downloaded the Software is also recorded. See Links Disclaimer in the Disclaimers Section.\r
+-->\r
+\r
+<directives>\r
+Version = \931.0\94\r
+Sep = \93^M\94\r
+Tool=\94Word\94\r
+</directives>\r
+\r
+<-- ** Do not edit or remove anything above this line **   \r
+-->\r
+\r
+<--  \r
+Instructions: DO NOT Alter the column headings below. This is now a single row table as opposed to the older manifests which used merged rows. The order is extremely important; if you change the order or add or remove a column the upload will not work.\r
+--> \r
+\r
+<table>\r
+<thead>\r
+attribute = \93Public\94\r
+name = \93AM5x PDK MCASP LLD Manifest Table\94\r
+description = \93See the Legend above for a description of these columns.\94\r
+</thead>\r
+\r
+<tbody>\r
+<!-- Software Name\rVersion\rLicense Type\rDelivered As \rModified by TI \rLocation\rObtained from -->\rMCASP LLD\r01.01.00\rBSD-3-Clause\rSource and Binary\rN/A\rAM5x_PDK_MCASP-LLD.zip\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r
+</tbody>\r
+\r
+<Footnotes>\r
+\r
+<--   Instructions: Use this section to place footnotes you may have for the table above or just any notes in general. To do a footnote DO NOT use the Microsoft word footnote capability. Instead use an old fashioned (number), e.g. (1) in the table above.  All notes must between the Footnotes \85 footnotes block. Anything outside of this will not work.  Do not remove this text. It will not appear on your manifest..-->\r
+\r
+\r
+</footnotes>\r
+</table>\r
+\r
+\r
+\r
+\r
+<Credits>\r
+\r
+<--  Instructions: Some open source licenses may require a specific credit or attribution in product documentation. Those credits should be listed here and all credits should fit between the Credits \85 credit block. Anything outside of this will not work.  Do not remove this text. It will not appear on your manifest. -->\r
\r
+\r
+\r
+\r
+</credits>\r
+\r
+\r
+<Licenses>\r
+\r
+<-- Instructions: Place a unique copy of each Open Source license referenced in the table above here and any OSS licenses that require attribution. All license text should fit between the Licenses \85licenses block. Anything outside of this will not work.  Do not remove this text. It will not appear on your manifest. -->\r
+\r
+\r
+/* Copyright (c) 2015 Texas Instruments Inc - http://www.ti.com */ /* *  Redistribution and use in source and binary forms, with or without *  modification, are permitted provided that the following conditions *  are met: * *    Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * *    Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the *    distribution. * *    Neither the name of Texas Instruments Incorporated nor the names of *    its contributors may be used to endorse or promote products derived *    from this software without specific prior written permission. * *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */\r
+\r
+\r
+</licenses>\r
+\r
+                               \r
+\r
diff --git a/packages/ti/drv/mcasp/docs/Module.xs b/packages/ti/drv/mcasp/docs/Module.xs
new file mode 100644 (file)
index 0000000..96c396c
--- /dev/null
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * FILE PURPOSE: MCASP LLD DOCS Module specification file.
+ ******************************************************************************
+ * FILE NAME: Module.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains the module specification for the MCASP LLD Documentation.
+ *
+ * Copyright (C) 2012-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to build all the components of the documentation
+ **************************************************************************/
+function modBuild() 
+{
+    /* Create the actual PROLOGUE Section for the Documentation.*/
+    Pkg.makePrologue += "release: mcasp_lld_document_generation\n";
+    Pkg.makePrologue += "mcasp_lld_document_generation:\n";
+    Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";
+    Pkg.makePrologue += "\t @echo Generating MCASP LLD Documentation\n";
+    Pkg.makePrologue += "\t doxygen docs/Doxyfile\n";
+    Pkg.makePrologue += "\t @echo MCASP LLD Documentation Generated \n";
+    Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";
+
+    /* Add the documentation file to the package. */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tifooter.htm";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tiheader.htm";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tilogo.gif";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/titagline.gif";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxygen";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/MCASP_LLD_SDS.pdf";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/MCASP_LLD_SoftwareManifest.pdf";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/ReleaseNotes_MCASP_LLD.pdf";
+
+    if (driverInstallType == "SETUP")
+    {
+        /* Generate the ECLIPSE Plugin Generation */
+        Pkg.makePrologue += "all: eclipse_plugin_generation\n";
+        Pkg.makePrologue += "eclipse_plugin_generation:\n";
+        Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";
+        Pkg.makePrologue += "\t @echo MCASP LLD Eclipse Plugin Generation\n";
+        Pkg.makePrologue += "\t xs xdc.tools.eclipsePluginGen -o . -x ./eclipseDocs/sample.xml -c ./eclipseDocs/toc_cdoc_sample.xml\n";
+        Pkg.makePrologue += "\t @echo MCASP LLD Eclipse Plugin Generated \n";
+        Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";
+    }
+}
+
diff --git a/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.doc b/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.doc
new file mode 100644 (file)
index 0000000..1430b07
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.doc differ
diff --git a/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.pdf b/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.pdf
new file mode 100644 (file)
index 0000000..3433d9b
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/ReleaseNotes_MCASP_LLD.pdf differ
diff --git a/packages/ti/drv/mcasp/docs/Thumbs.db b/packages/ti/drv/mcasp/docs/Thumbs.db
new file mode 100644 (file)
index 0000000..b44a5d6
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/Thumbs.db differ
diff --git a/packages/ti/drv/mcasp/docs/doxyfile.xdt b/packages/ti/drv/mcasp/docs/doxyfile.xdt
new file mode 100644 (file)
index 0000000..5c4abe4
--- /dev/null
@@ -0,0 +1,298 @@
+%%{
+/*!
+ *  This template implements the Doxyfile
+ */  
+  /* Versioning */
+  var ver = this;
+  var packageVersion = ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3];
+
+%%}
+
+# Doxyfile 1.5.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = "MCASP Low Level Driver"
+PROJECT_NUMBER         = `packageVersion`
+OUTPUT_DIRECTORY       = ./docs/doxygen
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+TYPEDEF_HIDES_STRUCT   = NO
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl
+RECURSIVE              = YES
+EXCLUDE                = YES \
+                         ./example \
+                         ./test \
+                         ./package \
+                         ./packages
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = cslr_*.h
+EXCLUDE_SYMBOLS        = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = ./docs/tiheader.htm
+HTML_FOOTER            = ./docs/tifooter.htm
+HTML_STYLESHEET        = 
+GENERATE_HTMLHELP      = YES
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+HTML_DYNAMIC_SECTIONS  = NO
+CHM_FILE               = 
+HHC_LOCATION           = hhc.exe
+GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     = 
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NONE
+TREEVIEW_WIDTH         = 250
+FORMULA_FONTSIZE       = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            = 
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+DOT_FONTPATH           = 
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 1000
+DOT_TRANSPARENT        = YES
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+
+
diff --git a/packages/ti/drv/mcasp/docs/tifooter.htm b/packages/ti/drv/mcasp/docs/tifooter.htm
new file mode 100644 (file)
index 0000000..4bdf9c9
--- /dev/null
@@ -0,0 +1,4 @@
+<hr size="1"><small>
+Copyright  $year, Texas Instruments Incorporated</small>
+</body>
+</html>
diff --git a/packages/ti/drv/mcasp/docs/tiheader.htm b/packages/ti/drv/mcasp/docs/tiheader.htm
new file mode 100644 (file)
index 0000000..3c61efe
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>$title</title>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">
+</head><body>
+<table width=100%>
+<tr>
+  <td bgcolor="black" width="1"><a href="http://www.ti.com"><img border=0 src="../../tilogo.gif"></a></td>
+  <td bgcolor="red"><img src="../../titagline.gif"></td>
+</tr>
+</table>
diff --git a/packages/ti/drv/mcasp/docs/tilogo.gif b/packages/ti/drv/mcasp/docs/tilogo.gif
new file mode 100644 (file)
index 0000000..f2fab2d
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/tilogo.gif differ
diff --git a/packages/ti/drv/mcasp/docs/titagline.gif b/packages/ti/drv/mcasp/docs/titagline.gif
new file mode 100644 (file)
index 0000000..743a024
Binary files /dev/null and b/packages/ti/drv/mcasp/docs/titagline.gif differ
diff --git a/packages/ti/drv/mcasp/eclipseDocs/sample.xml b/packages/ti/drv/mcasp/eclipseDocs/sample.xml
new file mode 100644 (file)
index 0000000..ada54a3
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<product>
+    <name>MCASP Low Level Driver</name>
+    <id>ti.drv.mcasp</id>
+    <version>1.00.00.00</version>
+    <companyName>Texas Instruments Inc.</companyName>
+    <companyUrl>http://ti.com</companyUrl>
+    <copyRightNotice>Copyright Texas Instruments 2012</copyRightNotice>
+
+    <licenseNotice>
+      Released under the Eclipse Public License 1.0 (http://www.eclipse.org/legal/epl-v10.html)
+    </licenseNotice>
+
+    <installLocation>../../..</installLocation>
+    <repository>../../../packages</repository>
+
+    <docsLoc>../../../packages/ti/drv/mcasp/docs</docsLoc>
+
+    <folderPrefix>MCASP Low Level Driver</folderPrefix>
+</product>
diff --git a/packages/ti/drv/mcasp/eclipseDocs/toc_cdoc_sample.xml b/packages/ti/drv/mcasp/eclipseDocs/toc_cdoc_sample.xml
new file mode 100644 (file)
index 0000000..20d53ce
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="toc.xsl"?>
+<toc label="MCASP" topic="packages.html">
+    <topic class="toc-id" label="Functions" href="doxygen/html/group___m_c_b_s_p___l_l_d___f_u_n_c_t_i_o_n.html" 
+            title="MCASP Low Level Driver Docs">
+    </topic>
+    <topic class="toc-id" label="Symbols" href="doxygen/html/group___m_c_b_s_p___l_l_d___s_y_m_b_o_l.html" 
+            title="MCASP Low Level Driver Docs">
+    </topic>            
+    <topic class="toc-id" label="Enums" href="doxygen/html/group___m_c_b_s_p___l_l_d___e_n_u_m.html" 
+            title="MCASP Low Level Driver Docs">
+    </topic>            
+    <topic class="toc-id" label="Data Structures" 
+                    href="doxygen/html/group___m_c_b_s_p___l_l_d___d_a_t_a_s_t_r_u_c_t.html" 
+                    title="MCASP Low Level Driver Docs">
+    </topic>                    
+    <topic class="toc-id" label="OSAL Adaptation Layer" href="doxygen/html/group___m_c_b_s_p___l_l_d___o_s_a_l.html" 
+            title="MCASP Low Level Driver Docs">
+    </topic>
+</toc>
+
diff --git a/packages/ti/drv/mcasp/example/MCASP_AudioDCAnalogLoopback_TestApp/makefile b/packages/ti/drv/mcasp/example/MCASP_AudioDCAnalogLoopback_TestApp/makefile
new file mode 100755 (executable)
index 0000000..9f792b6
--- /dev/null
@@ -0,0 +1,52 @@
+# Makefile for McASP device loopback unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+#Name of the directory created under packages/ti/binary/
+APP_NAME = MCASP_AudioDCAnalogLoopback_TestApp
+
+SRCDIR = ../src ../../
+INCDIR = ../src ../include ../../
+
+SRCS_COMMON = audioSample_io.c audioSample_main.c audio_evmInit.c mcasp_cfg.c mcasp_debug.c
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+COMP_LIST_COMMON = csl mcasp osal_tirtos uart board
+
+CFLAGS_MCASP_UT = -DMCASP_MASTER -DAUDIO_DC_ANALOG_TEST
+
+ifeq ($(SOC), $(filter $(SOC), j721e))
+  SRCDIR += ../j721e/src
+  INCDIR += ../j721e/include
+
+  COMP_LIST_COMMON += udma sciclient i2c
+
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = $(PDK_INSTALL_PATH)/ti/build/$(SOC)/sysbios_$(ISA).cfg
+  XDC_CFG_UPDATE_$(CORE) = ../j721e/mcasp_extra_config.xs
+endif
+
+PACKAGE_SRCS_COMMON = .
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_MCASP_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
+
diff --git a/packages/ti/drv/mcasp/example/MCASP_AudioDCDigitalLoopback_TestApp/makefile b/packages/ti/drv/mcasp/example/MCASP_AudioDCDigitalLoopback_TestApp/makefile
new file mode 100755 (executable)
index 0000000..55acb0b
--- /dev/null
@@ -0,0 +1,52 @@
+# Makefile for McASP device loopback unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+#Name of the directory created under packages/ti/binary/
+APP_NAME = MCASP_AudioDCDigitalLoopback_TestApp
+
+SRCDIR = ../src ../../
+INCDIR = ../src ../include ../../
+
+SRCS_COMMON = audioSample_io.c audioSample_main.c audio_evmInit.c mcasp_cfg.c mcasp_debug.c
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+COMP_LIST_COMMON = csl mcasp osal_tirtos uart board
+
+CFLAGS_MCASP_UT = -DMCASP_MASTER -DAUDIO_DC_DIGITAL_TEST
+
+ifeq ($(SOC), $(filter $(SOC), j721e))
+  SRCDIR += ../j721e/src
+  INCDIR += ../j721e/include
+
+  COMP_LIST_COMMON += udma sciclient i2c
+
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = $(PDK_INSTALL_PATH)/ti/build/$(SOC)/sysbios_$(ISA).cfg
+  XDC_CFG_UPDATE_$(CORE) = ../j721e/mcasp_extra_config.xs
+endif
+
+PACKAGE_SRCS_COMMON = .
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_MCASP_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
+
diff --git a/packages/ti/drv/mcasp/example/MCASP_AudioLoopback_TestApp/makefile b/packages/ti/drv/mcasp/example/MCASP_AudioLoopback_TestApp/makefile
new file mode 100644 (file)
index 0000000..6487403
--- /dev/null
@@ -0,0 +1,72 @@
+# Makefile for McASP device loopback unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+#Name of the directory created under packages/ti/binary/
+APP_NAME = MCASP_AudioLoopback_TestApp
+
+SRCDIR = ../src ../../
+INCDIR = ../src ../include ../../
+
+SRCS_COMMON = audioSample_io.c audioSample_main.c audio_evmInit.c mcasp_cfg.c mcasp_debug.c
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+COMP_LIST_COMMON = csl mcasp osal_tirtos uart board
+
+CFLAGS_MCASP_UT = -DMCASP_MASTER
+
+ifeq ($(SOC),$(filter $(SOC), am65xx))
+  # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
+  LOCAL_APP_NAME = MCASP_AudioLoopback_$(BOARD)_$(CORE)TestApp
+
+  SRCDIR += ../evmAM65xx/src
+  INCDIR += ../evmAM65xx/include
+
+  COMP_LIST_COMMON += udma sciclient
+
+  ifeq ($(CORE),$(filter $(CORE), mpu1_0))
+    # Enable XDC build for application by providing XDC CFG File per core
+    XDC_CFG_FILE_$(CORE) = ../evmAM65xx/a53/mcaspUnitTest_a53.cfg
+  endif
+
+  ifeq ($(CORE),$(filter $(CORE), mcu1_0))
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = ../evmAM65xx/r5/mcaspUnitTest_r5.cfg
+  endif
+endif
+
+ifeq ($(SOC), $(filter $(SOC), j721e))
+  SRCDIR += ../j721e/src
+  INCDIR += ../j721e/include
+
+  COMP_LIST_COMMON += udma sciclient i2c
+
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = $(PDK_INSTALL_PATH)/ti/build/$(SOC)/sysbios_$(ISA).cfg
+  XDC_CFG_UPDATE_$(CORE) = ../j721e/mcasp_extra_config.xs
+endif
+
+PACKAGE_SRCS_COMMON = .
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_MCASP_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
+
diff --git a/packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_Regression_TestApp/makefile b/packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_Regression_TestApp/makefile
new file mode 100644 (file)
index 0000000..c585f32
--- /dev/null
@@ -0,0 +1,63 @@
+# Makefile for McASP device loopback unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+#Name of the directory created under packages/ti/binary/
+APP_NAME = MCASP_DeviceLoopback_Regression_TestApp
+# Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
+LOCAL_APP_NAME = MCASP_DeviceLoopback_Regression_$(BOARD)_$(CORE)TestApp
+
+ifeq ($(SOC),$(filter $(SOC), am65xx))
+SRCDIR = ../src ../../ ../evmAM65xx/src
+INCDIR = ../src ../include ../../ ../evmAM65xx/include
+# Common source files across all platforms and cores
+SRCS_COMMON += audioSample_io_regression.c audioSample_main.c deviceloopback.c audio_evmInit.c mcasp_cfg.c mcasp_debug.c regression.c
+
+ifeq ($(CORE),$(filter $(CORE), mpu1_0))
+# Enable XDC build for application by providing XDC CFG File per core
+XDC_CFG_FILE_$(CORE) = ../evmAM65xx/a53/mcaspUnitTest_a53.cfg
+endif
+
+ifeq ($(CORE),$(filter $(CORE), mcu1_0))
+# Enable XDC build for application by providing XDC CFG File per core
+XDC_CFG_FILE_$(CORE) = ../evmAM65xx/r5/mcaspUnitTest_r5.cfg
+endif
+
+endif
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+# List all the components required by the application
+COMP_LIST_COMMON = csl mcasp osal_tirtos uart board
+
+CFLAGS_MCASP_UT = -DMCASP_MASTER -DDEVICE_LOOPBACK
+
+# Enable below to log various events
+# CFLAGS_MCASP_UT += -DMCASP_ENABLE_DEBUG_LOG
+
+ifeq ($(SOC),$(filter $(SOC), am65xx))
+COMP_LIST_COMMON += udma sciclient
+endif
+
+PACKAGE_SRCS_COMMON = .
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_MCASP_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_TestApp/makefile b/packages/ti/drv/mcasp/example/MCASP_DeviceLoopback_TestApp/makefile
new file mode 100644 (file)
index 0000000..4bb97cf
--- /dev/null
@@ -0,0 +1,80 @@
+# Makefile for McASP device loopback unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+ifeq ($(SMP), enable)
+    #Name of the directory created under packages/ti/binary/
+    APP_NAME = MCASP_DeviceLoopback_SMP_TestApp
+else
+    #Name of the directory created under packages/ti/binary/
+    APP_NAME = MCASP_DeviceLoopback_TestApp
+endif
+
+SRCDIR = ../src ../../
+INCDIR = ../src ../include ../../
+
+SRCS_COMMON = audioSample_io.c audioSample_main.c deviceloopback.c audio_evmInit.c mcasp_cfg.c mcasp_debug.c
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+COMP_LIST_COMMON = csl mcasp osal_tirtos uart board
+
+CFLAGS_MCASP_UT = -DMCASP_MASTER -DDEVICE_LOOPBACK
+
+PACKAGE_SRCS_COMMON = . ../src ../include ../$(SOC)
+
+# Enable below to log various events
+CFLAGS_MCASP_UT += -DMCASP_ENABLE_DEBUG_LOG
+
+ifeq ($(SOC),$(filter $(SOC), am65xx))
+  # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
+  LOCAL_APP_NAME = MCASP_DeviceLoopback_$(BOARD)_$(CORE)TestApp
+
+  SRCDIR += ../evmAM65xx/src
+  INCDIR += ../evmAM65xx/include
+
+  COMP_LIST_COMMON += udma sciclient
+
+  ifeq ($(CORE),$(filter $(CORE), mpu1_0))
+    # Enable XDC build for application by providing XDC CFG File per core
+    XDC_CFG_FILE_$(CORE) = ../evmAM65xx/a53/mcaspUnitTest_a53.cfg
+  endif
+
+  ifeq ($(CORE),$(filter $(CORE), mcu1_0))
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = ../evmAM65xx/r5/mcaspUnitTest_r5.cfg
+  endif
+endif
+
+ifeq ($(SOC), $(filter $(SOC), j721e))
+  SRCDIR += ../j721e/src
+  INCDIR += ../j721e/include
+
+  COMP_LIST_COMMON += udma sciclient i2c
+
+  # Enable XDC build for application by providing XDC CFG File per core
+  XDC_CFG_FILE_$(CORE) = $(PDK_INSTALL_PATH)/ti/build/$(SOC)/sysbios_$(ISA).cfg
+  XDC_CFG_UPDATE_$(CORE) = ../j721e/mcasp_extra_config.xs
+endif
+
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_MCASP_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/mcasp/example/Module.xs b/packages/ti/drv/mcasp/example/Module.xs
new file mode 100644 (file)
index 0000000..fb14913
--- /dev/null
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * FILE PURPOSE: MCASP LLD example files.
+ ******************************************************************************
+ * FILE NAME: Module.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains the module specification for MCASP LLD example files.
+ *
+ * Copyright (C) 2012-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to add all the source files in the example 
+ *  directory into the package.
+ **************************************************************************/
+function modBuild() 
+{
+    /* Add all the .c files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".c", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .h files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".h", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .cmd files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".cmd", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .cfg files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".cfg", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the make files to the release package. */
+    var exampleFiles = libUtility.listAllFiles ("makefile", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add the .txt to the package */
+    var exampleFiles = libUtility.listAllFiles (".txt", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add the .xs to the package */
+    var exampleFiles = libUtility.listAllFiles (".xs", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .mk files to the release package. */
+    var mkFiles = libUtility.listAllFiles (".mk", "example", true);
+    for (var k = 0 ; k < mkFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles[k];
+}
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/AudioLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/AudioLoopback.cfg
new file mode 100644 (file)
index 0000000..afbd53b
--- /dev/null
@@ -0,0 +1,291 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+var socType           = "am335x";
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+// var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM335x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+GPIO.Settings.socType=socType;
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 600000000;
+BIOS.libType = BIOS.LibType_Custom;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+Hwi.initStackFlag = false;
+Hwi.checkStackFlag = false;
+
+/* Enable the cache                                                           */
+var Cache  = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
+Cache.enableCache = true;
+// Cache.configureL2Sram = false;//DDR build
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var attrs0 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+
+/* CM_, PRM_ registers */
+Mmu.setFirstLevelDescMeta(0x44E00000, 0x44E00000, attrs0);
+
+/* edma */
+
+for (var i=0x49000000; i < 0x49100000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+for (var i=0x49800000; i < 0x49B00000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C0 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x44e0b000, 0x44e0b000, attrs0);
+
+/* I2C1 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4802A000, 0x4802A000, attrs0);
+/* I2C2 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4819c000, 0x4819c000, attrs0);
+
+/* mcasp-0 CFG*/
+for (var i=0x48038000; i < 0x4803B000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp-0 DATA */
+for (var i=0x46000000; i < 0x46400000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+var attrs1 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs1);
+}
+*/
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x40000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+Task.enableIdleTask = true;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/DeviceLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/DeviceLoopback.cfg
new file mode 100644 (file)
index 0000000..afbd53b
--- /dev/null
@@ -0,0 +1,291 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+var socType           = "am335x";
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+// var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM335x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+GPIO.Settings.socType=socType;
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 600000000;
+BIOS.libType = BIOS.LibType_Custom;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+Hwi.initStackFlag = false;
+Hwi.checkStackFlag = false;
+
+/* Enable the cache                                                           */
+var Cache  = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
+Cache.enableCache = true;
+// Cache.configureL2Sram = false;//DDR build
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var attrs0 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+
+/* CM_, PRM_ registers */
+Mmu.setFirstLevelDescMeta(0x44E00000, 0x44E00000, attrs0);
+
+/* edma */
+
+for (var i=0x49000000; i < 0x49100000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+for (var i=0x49800000; i < 0x49B00000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C0 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x44e0b000, 0x44e0b000, attrs0);
+
+/* I2C1 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4802A000, 0x4802A000, attrs0);
+/* I2C2 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4819c000, 0x4819c000, attrs0);
+
+/* mcasp-0 CFG*/
+for (var i=0x48038000; i < 0x4803B000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp-0 DATA */
+for (var i=0x46000000; i < 0x46400000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+var attrs1 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs1);
+}
+*/
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x40000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+Task.enableIdleTask = true;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_Audio_evmAM335x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_Audio_evmAM335x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..2348ee9
--- /dev/null
@@ -0,0 +1,13 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3106_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am335x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am335x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/gpio/soc/am335x/GPIO_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/armv7/bios/AudioLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DAIC_CODEC -DSOC_AM335x -DEVM_AM335X -g -gstrict-dwarf -gdwarf-3 -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board  -I${PDK_INSTALL_PATH}/ti/starterware -I${PDK_INSTALL_PATH}/ti/starterware/include -I${PDK_INSTALL_PATH}/ti/starterware/include/hw -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/starterware/include/am335x" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections -L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu "
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_DeviceLoopback_evmAM335x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM335x/armv7/bios/MCASP_DeviceLoopback_evmAM335x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..68ac0f9
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/deviceloopback.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am335x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/armv7/bios/DeviceLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DMCASP_MASTER -DDEVICE_LOOPBACK -DSOC_AM335x -DEVM_AM335X -g -gstrict-dwarf -gdwarf-3 -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM335x/include  -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board -I${PDK_INSTALL_PATH}/ti/starterware/include -I${PDK_INSTALL_PATH}/ti/starterware/include/am335x" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections  "
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/include/Audio_evmInit.h b/packages/ti/drv/mcasp/example/evmAM335x/include/Audio_evmInit.h
new file mode 100644 (file)
index 0000000..2a9a2d8
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _AUDIO_EVMINIT_H_
+#define _AUDIO_EVMINIT_H_
+
+#include <xdc/std.h>
+#include "board.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+Void configureAudio(Void);
+Void audioUserI2cInit(Void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/include/mcasp_cfg.h b/packages/ti/drv/mcasp/example/evmAM335x/include/mcasp_cfg.h
new file mode 100644 (file)
index 0000000..3464d13
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _MCASP_CFG_H_
+#define _MCASP_CFG_H_
+
+#include <xdc/std.h>
+#include <string.h>
+#include <xdc/runtime/Log.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/io/GIO.h>
+#include <ti/sysbios/BIOS.h>
+#include <xdc/runtime/System.h>
+
+#include <mcasp_drv.h>
+#include <ti/sysbios/io/IOM.h>
+#include <Aic31.h>
+
+//#include <Audio.h>
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+#include <ti/csl/csl_edma3.h>
+#include <ti/csl/soc.h>
+#include <ti/csl/csl_bootcfg.h>
+
+#include <ti/starterware/include/hw/soc_am335x.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef DEVICE_LOOPBACK
+#define MCASP_NUM 0
+#define MCASP_RX_DMA_CH  9
+#define MCASP_TX_DMA_CH  8
+#define SOC_I2C_1_REGS SOC_I2C1_REG
+#else
+#define MCASP_NUM 1
+#define MCASP_RX_DMA_CH  11
+#define MCASP_TX_DMA_CH  10
+
+#endif
+#define EDMACC_NUM 0
+
+#define I2C_MCASP_INSTANCE 1
+
+#define AIC31_NUM_INSTANCES   1
+#define AIC31_INST0_ADDRESS   0x1B
+
+/**<    Address of first instance                                         */
+
+extern void GblErr(int arg);
+extern Mcasp_HwSetupData mcaspRcvSetup;
+extern Mcasp_HwSetupData mcaspXmtSetup;
+extern Mcasp_ChanParams  mcasp_chanparam[];
+extern ICodec_ChannelConfig AIC31_config;
+
+/** Number of serializers configured for record */
+
+#ifdef DEVICE_LOOPBACK
+#define RX_NUM_SERIALIZER       (2u)
+#define TX_NUM_SERIALIZER       (2u)
+#else
+#define RX_NUM_SERIALIZER       (1u)
+#define TX_NUM_SERIALIZER       (1u)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/src/audio_evmInit.c b/packages/ti/drv/mcasp/example/evmAM335x/src/audio_evmInit.c
new file mode 100644 (file)
index 0000000..100a72e
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * audio_evmInit.c
+ *
+ * This file contains Audio application related EVM (platform) specific routines
+ * implementation. 
+ * This is part of the EVM Initialization library (evmInit) which contains pinmux
+ * enabling routines for peripherals used by the application, and may contain 
+ * related device pre-driver initialization routines.
+ *
+ * Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ *  \file   audio_evmInit.c
+ *
+ *  \brief  This file contains the board specific code for enabling the use of
+ *          audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#include <xdc/std.h>
+#define SW_I2C
+#ifndef SW_I2C
+#include <i2c/include/I2c.h>
+#endif
+#include <xdc/runtime/System.h>
+#include <Audio_evmInit.h>
+#include <ti/csl/cslr_device.h>
+#include <ti/csl/soc.h>
+#include <ti/drv/mcasp/soc/mcasp_soc.h>
+#include <mcasp_cfg.h>
+#include <board.h>
+
+#include <ti/csl/hw_types.h>
+#include <ti/drv/uart/UART_stdio.h>
+#include <ti/starterware/include/hw/soc_am335x.h>
+#include <ti/starterware/include/hw/hw_control_am335x.h>
+#include <ti/starterware/include/am335x/hw_cm_per.h>
+#include <ti/starterware/include/am335x/hw_cm_wkup.h>
+#include <ti/starterware/include/chipdb.h>
+#include <ti/starterware/include/prcm.h>
+#include <ti/starterware/include/error.h>
+#include <ti/starterware/include/pinmux.h>
+#include <ti/drv/gpio/GPIO.h>
+#include <ti/drv/gpio/soc/GPIO_v1.h>
+#include <ti/board/board.h>
+#include "MCASP_log.h"
+
+/*============================================================================*/
+/*                          MACRO DEFINITIONS                                 */
+/*============================================================================*/
+
+/**
+ *  \brief    Initializes platform specific modules
+ *
+ *  This function initializes the modules like PLL, DDR, I2C etc
+ *  which are required for audio processing. Need to call this function
+ *  before doing any HW related operations.
+ *
+ *  \return    Platform_EOK on Success or error code
+ */
+
+
+extern Board_STATUS Board_init(Board_initCfg);
+
+void PRCM_ClockConfig(void);
+
+//#define HW_WR_REG32(addr, data)   *(unsigned int*)(addr) =(unsigned int)(data)
+
+/*
+ * Function to enable the pinmux for the mcasp and i2c devices in the soc.
+ *
+ */
+void configureAudio(void)
+{
+       Board_STATUS stat = BOARD_SOK;
+       Board_initCfg arg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO;
+
+       stat = Board_init(arg);
+
+    if( BOARD_SOK != stat)
+    {
+        MCASP_log("Board init failed!!");
+        return;
+    }
+
+#ifndef DEVICE_LOOPBACK
+       // set the pinmux for the McASP 1 for Audio Codec Loopback example
+       /* McASP1 AXR2 */
+       HWREG(SOC_CONTROL_REGS + CONTROL_CONF_MII1_COL) = (4
+               | (0x1 << CONTROL_CONF_MII1_COL_CONF_MII1_COL_PUDEN_SHIFT)
+               /* | (0x1 << CONTROL_CONF_MII1_COL_CONF_MII1_COL_RXACTIVE_SHIFT) */
+               /* | (0x1 << CONTROL_CONF_MII1_COL_CONF_MII1_COL_SLEWCTRL_SHIFT) */
+               );
+
+       /* McASP1 ACLKX */
+       HWREG(SOC_CONTROL_REGS + CONTROL_CONF_MII1_CRS) = (4
+               | (0x1 << CONTROL_CONF_MII1_CRS_CONF_MII1_CRS_PUDEN_SHIFT)
+               | (0x1 << CONTROL_CONF_MII1_CRS_CONF_MII1_CRS_RXACTIVE_SHIFT)
+               | (0x1 << CONTROL_CONF_MII1_CRS_CONF_MII1_CRS_SLEWCTRL_SHIFT)
+               );
+
+       /* McASP1 FSX */
+       HWREG(SOC_CONTROL_REGS + CONTROL_CONF_MII1_RXERR) = (4
+               | (0x1 << CONTROL_CONF_MII1_RXERR_CONF_MII1_RXERR_PUDEN_SHIFT)
+               | (0x1 << CONTROL_CONF_MII1_RXERR_CONF_MII1_RXERR_RXACTIVE_SHIFT)
+               | (0x1 << CONTROL_CONF_MII1_RXERR_CONF_MII1_RXERR_SLEWCTRL_SHIFT)
+               );
+
+       /* McASP1 AHCLKX in mode 7 */   /* McASP1 AXR3 in mode 5 */             /* testing */
+       /* Confirm whether AHCLKX is required for this -- AHCLKX is a Master clock
+        * and Audio codec has master as Oscillator clock, so this pin will be used as
+        * McASP1 AXR3 */
+       HWREG(SOC_CONTROL_REGS + CONTROL_CONF_RMII1_REFCLK) = (4
+               | (0x1 << CONTROL_CONF_RMII1_REFCLK_CONF_RMII1_REFCLK_PUDEN_SHIFT)
+               | (0x1 << CONTROL_CONF_RMII1_REFCLK_CONF_RMII1_REFCLK_RXACTIVE_SHIFT) );
+               /* | (0x1 << CONTROL_CONF_RMII1_REFCLK_CONF_RMII1_REFCLK_SLEWCTRL_SHIFT) */
+
+#endif
+
+       /* Enable the PRCM Clock to get a 24.6 MHz clock as Aux Clock to MCASP */
+       PRCM_ClockConfig();
+}
+
+
+/* This function sets up the CORE PLL which provides AUXCLK to McASP */
+void PRCM_ClockConfig(void)
+{
+#ifdef DEVICE_LOOPBACK
+    uint32_t dpllMult; /* M */
+    uint32_t dpllDiv; /* N */
+    uint32_t inputClk;
+    uint32_t dpllPostDivM4;
+    uint32_t dpllPostDivM5;
+    uint32_t dpllPostDivM6;
+    uint32_t crystalFreqSel;
+
+       /* Set the Core PLL (ADPLLS), as per Section 8.1.6.7 in the TRM */
+       /*
+       1. Switch PLL to bypass mode by setting CM_CLKMODE_DPLL_CORE.DPLL_EN to 0x4
+
+       2. Wait for CM_IDLEST_DPLL_CORE.ST_MN_BYPASS = 1 to ensure PLL is in bypass
+       (CM_IDLEST_DPLL_CORE.ST_DPLL_CLK should also change to 0 to denote the PLL is unlocked).
+       3. Configure Multiply and Divide values by setting CM_CLKSEL_DPLL_CORE.DPLL_MULT and
+       DPLL_DIV to the desired values.
+       4. Configure M4, M5 and M6 dividers by setting HSDIVIDER_CLKOUT1_DIV bits in
+       CM_DIV_M4_DPLL_CORE,CM_DIV_M5_DPLL_CORE, and CM_DIV_M6_DPLL_CORE to the
+       desired values.
+       5. Switch over to lock mode by setting CM_CLKMODE_DPLL_CORE.DPLL_EN to 0x7.
+       6. Wait for CM_IDLEST_DPLL_CORE.ST_DPLL_CLK = 1 to ensure PLL is locked
+       (CM_IDLEST_DPLL_CORE.ST_MN_BYPASS should also change to 0 to denote the PLL is out of
+       bypass mode).
+       */
+    /* Get input clock frequency. */
+    crystalFreqSel = HW_RD_FIELD32_RAW(SOC_CONTROL_REGS + CONTROL_STATUS,
+        CONTROL_STATUS_SYSBOOT1,
+        CONTROL_STATUS_SYSBOOT1_SHIFT);
+    switch(crystalFreqSel)
+     {
+         case 0U:
+         {
+             inputClk = 19U;
+             break;
+         }
+
+         case 1U:
+         {
+             inputClk = 24U;
+             break;
+         }
+
+         case 2U:
+         {
+             inputClk = 25U;
+             break;
+         }
+
+         case 3U:
+         {
+             inputClk = 26U;
+             break;
+         }
+
+         default:
+         {
+             break;
+         }
+     }
+
+     /*
+      * pllDiv = (inputClk/refClk) - 1U
+      * PLL divider derived from input clock with referance clock as 1MHz.
+      * PLL divider is same for all PLLs.
+      */
+
+    /* The below values are chosen for this EVM because of the following reason */
+    /* The MCASP needs a bit clock of 3.072 Mhz (ACLK) - This is derived from
+     *   48Khz * 64 bits (because of L+R 32 bit channels) = 3.072 Mhz
+     *   But ACLK = AuxCLK /( AHCLKDIV + ACLKDIV)
+     *   If we keep AHCLKDIV + ACLKDIV = 8 approx, we get a desired AuxCLK=  24.576 Mhz
+     *
+     *   In AM335x , the AUXCLK is provided by L4_PER_CLK which is the output of Core PLL
+     *   By programming the ADPLLS and the dividers of the Core PLL appropriately, we can
+     *   get the 24.576 Mhz, or in this example a close enough value 24.61 Mhz.
+     *
+     *   The L4_PER_CLK = CLKDCOOUT (of the ADPLLS) /(M4 Div) * (2)
+     *                  = (2*(M/(N+1))/((M4 Div)*2)
+     */
+     dpllDiv = inputClk - 1U; /* N=23 */
+     dpllMult = 1000U; /* M= 1000 */
+     dpllPostDivM4 = 39;
+     dpllPostDivM5 = 8U;/* Not used here */
+     dpllPostDivM6 = 4U;/* Not used here */
+    /* Put the PLL in bypass mode */
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKMODE_DPLL_CORE,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN_SHIFT,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN_DPLL_MN_BYP_MODE);
+
+     /* Wait for DPLL to go in to bypass mode */
+
+     while(0U == HW_RD_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_IDLEST_DPLL_CORE,
+         CM_WKUP_CM_IDLEST_DPLL_CORE_ST_MN_BYPASS,
+         CM_WKUP_CM_IDLEST_DPLL_CORE_ST_MN_BYPASS_SHIFT));
+
+     /* Set the multipler and divider values for the PLL */
+
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKSEL_DPLL_CORE,
+         CM_WKUP_CM_CLKSEL_DPLL_CORE_DPLL_MULT,
+         CM_WKUP_CM_CLKSEL_DPLL_CORE_DPLL_MULT_SHIFT,
+         dpllMult);
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKSEL_DPLL_CORE,
+         CM_WKUP_CM_CLKSEL_DPLL_CORE_DPLL_DIV,
+         CM_WKUP_CM_CLKSEL_DPLL_CORE_DPLL_DIV_SHIFT,
+         dpllDiv);
+
+     /* Configure the High speed dividers */
+
+     /* Set M4 divider */
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_DIV_M4_DPLL_CORE,
+         CM_WKUP_CM_DIV_M4_DPLL_CORE_HSDIVIDER_CLKOUT1_DIV,
+         CM_WKUP_CM_DIV_M4_DPLL_CORE_HSDIVIDER_CLKOUT1_DIV_SHIFT,
+         dpllPostDivM4);
+
+     /* Set M5 divider */
+
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_DIV_M5_DPLL_CORE,
+         CM_WKUP_CM_DIV_M5_DPLL_CORE_HSDIVIDER_CLKOUT2_DIV,
+         CM_WKUP_CM_DIV_M5_DPLL_CORE_HSDIVIDER_CLKOUT2_DIV_SHIFT,
+         dpllPostDivM5);
+
+     /* Set M6 divider */
+
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_DIV_M6_DPLL_CORE,
+         CM_WKUP_CM_DIV_M6_DPLL_CORE_HSDIVIDER_CLKOUT3_DIV,
+         CM_WKUP_CM_DIV_M6_DPLL_CORE_HSDIVIDER_CLKOUT3_DIV_SHIFT,
+         dpllPostDivM6);
+
+     /* Now LOCK the PLL by enabling it */
+
+     HW_WR_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKMODE_DPLL_CORE,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN_SHIFT,
+         CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN);
+
+     while(0U == HW_RD_FIELD32_RAW(SOC_CM_WKUP_REGS + CM_WKUP_CM_IDLEST_DPLL_CORE,
+                         CM_WKUP_CM_IDLEST_DPLL_CORE_ST_DPLL_CLK,
+                         CM_WKUP_CM_IDLEST_DPLL_CORE_ST_DPLL_CLK_SHIFT));
+
+#else
+     /// if the audio codec loopback is selected, eanble the clock for McASP 1
+       /* For McASP1 clock setting */
+       HWREG(SOC_PRCM_REGS + CM_PER_MCASP1_CLKCTRL) = CM_PER_MCASP1_CLKCTRL_MODULEMODE_ENABLE ;
+#endif
+}
+
+void configMcASP_SocHwInfo()
+{
+  /* Configure the interrupts for the McASP Instance MCASP_NUM */
+  /* ON Keystone, it involves CIC programming as well.
+   * The McASP does that internally, if configured with the correct parameters.
+   * Such as muxNum, muxInEvent, muxOutEvent,
+   * cpuInEventNum, cpuIntNum
+  */
+    Mcasp_HwInfo hwInfo;
+
+    Mcasp_socGetInitCfg(MCASP_NUM, &hwInfo);
+
+
+/* Change anything if needed */
+    Mcasp_socSetInitCfg(MCASP_NUM,&hwInfo);
+}
+
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM335x/src/mcasp_cfg.c b/packages/ti/drv/mcasp/example/evmAM335x/src/mcasp_cfg.c
new file mode 100644 (file)
index 0000000..ee01a7f
--- /dev/null
@@ -0,0 +1,322 @@
+/*
+ * mcasp_cfg.c
+ *
+ * This file contains the test / demo code to demonstrate the Audio component
+ * driver functionality on SYS/BIOS 6.
+ *
+ * Copyright (C) 2009-2017 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/** \file     mcasp_cfg.c
+ *
+ *  \brief    sample application for demostration of audio playing
+ *
+ *  This file contains the implementation of the sample appliation for the
+ *  demonstration of audio playing through the audio interface layer.
+ *
+ *             (C) Copyright 2009, Texas Instruments, Inc
+ */
+
+/* ========================================================================== */
+/*                            INCLUDE FILES                                   */
+/* ========================================================================== */
+
+#include <xdc/std.h>
+#include <ti/sysbios/io/IOM.h>
+#include <xdc/runtime/Memory.h>
+#include <ti/sysbios/heaps/HeapMem.h>
+#include <xdc/runtime/IHeap.h>
+#include <xdc/runtime/Error.h>
+#include <xdc/runtime/Log.h>
+#include <xdc/runtime/System.h>
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Semaphore.h>
+#include <mcasp_drv.h>
+#include <mcasp_cfg.h>
+#include <mcasp_tune.h>
+#include <ti/csl/csl_chip.h>
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+#include <ti/sdo/edma3/rm/edma3_rm.h>
+#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
+#include "ICodec.h"
+#include "stdio.h"
+#include "string.h"
+
+void GblErrXmt(Mcasp_errCbStatus errCbStat);
+void GblErrRcv(Mcasp_errCbStatus errCbStat);
+
+/* ========================================================================== */
+/*                          IMPORTED VARIABLES                                */
+/* ========================================================================== */
+
+
+extern EDMA3_DRV_Handle hEdma;
+extern HeapMem_Handle myHeap;
+
+/* ========================================================================== */
+/*                          McASP Init config                                 */
+/* ========================================================================== */
+
+
+
+Mcasp_HwSetupData mcaspRcvSetup = {
+        /* .rmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
+#if defined (DSP_MODE)
+        /* .rfmt     = */ 0x000080f0,
+#else /* I2S MODE*/
+    /* .rfmt     = */ 0x000180F0,
+#endif                                                           /* 0/1 bit delay from framsync
+                                       * MSB first
+                                       * No extra bit padding
+                                       * Padding bit (ignore)
+                                       * slot Size is 32
+                                       * Reads from DMA port
+                                       * NO rotation
+                                       */
+#if defined (MCASP_MASTER)
+       #if defined (DSP_MODE)
+    /* .afsrctl  = */ 0x00000002,           /* burst mode,
+                                             * Frame sync is one bit
+                                             * internally generated frame sync
+                                             * Rising edge is start of frame
+                                             */
+
+       #else /* I2S MODE*/
+          /* .afsrctl  = */ 0x00000113,     /* I2S mode,
+                                             * Frame sync is one word
+                                             * Internally generated frame sync
+                                             * Falling edge is start of frame
+                                             */
+       #endif
+#else
+       #if defined (DSP_MODE)
+    /* .afsrctl  = */ 0x00000000,           /* burst mode,
+                                             * Frame sync is one bit
+                                             * Externally generated frame sync
+                                             * Rising edge is start of frame
+                                             */
+
+       #else /* I2S MODE*/
+          /* .afsrctl  = */ 0x00000111,     /* I2S mode,
+                                             * Frame sync is one word
+                                             * Externally generated frame sync
+                                             * Falling edge is start of frame
+                                             */
+       #endif
+#endif
+
+#if defined (DSP_MODE)
+/* .rtdm     = */ 0x00000001,           /* slot 1 is active (DSP)
+                                         *              */
+
+#else /* I2S MODE*/
+      /* .rtdm     = */ 0x00000003,     /* 2 slots are active (I2S)
+                                         *            */
+#endif
+        /* .rintctl  = */ 0x00000003, /* sync error and overrun error         */
+        /* .rstat    = */ 0x000001FF, /* reset any existing status bits       */
+        /* .revtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
+        {
+#if defined (MCASP_MASTER)
+               #if defined (DSP_MODE)
+                       /* .aclkrctl  = */ 0x00000027,
+                       /* .ahclkrctl = */ 0x00008027,
+               #else /* I2S MODE*/
+                       /* .aclkrctl  = */ 0x00000027,  /* Div (8), Internal Source, rising edge */
+                       /* .ahclkrctl = */ 0x00008013,  /* Div (20), Internal AUX_CLK Source */
+               #endif
+#else
+               #if defined (DSP_MODE)
+                       /* .aclkrctl  = */ 0x00000000,
+               #else /* I2S MODE*/
+                       /* .aclkrctl  = */ 0x00000080,  /* External Source, rising edge */
+               #endif
+                       /* .ahclkrctl = */ 0x00000000,  /* Don't Care */
+#endif
+             /* .rclkchk   = */ 0x00000000
+        }
+} ;
+
+Mcasp_HwSetupData mcaspXmtSetup = {
+        /* .xmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
+               #if defined (DSP_MODE)
+                       /* .xfmt     = */ 0x000080F0,
+               #else /* I2S MODE*/
+                       /* .xfmt     = */ 0x000180F0,
+               #endif                                            /*
+                                       * 0/1 bit delay from framsync
+                                       * MSB first
+                                       * No extra bit padding
+                                       * Padding bit (ignore)
+                                       * slot Size is 32
+                                       * Reads from DMA port
+                                       * 0-bit rotation
+                                       */
+#if defined (MCASP_MASTER)
+               #if defined (DSP_MODE)
+               /* .afsxctl  = */ 0x00000002,       /* burst mode,
+                                                                                        * Frame sync is one bit
+                                                                                        * Internally generated frame sync
+                                                                                        * Rising edge is start of frame
+                                                                                        */
+               /* .xtdm     = */ 0x00000001,       /* slot 1 is active (DSP) */
+               #else /*I2S MODE*/
+                         /* .afsxctl  = */ 0x00000113, /* I2S mode,
+                                                                                        * Frame sync is one word
+                                                                                        * internally generated frame sync
+                                                                                        * Falling edge is start of frame
+                                                                                        */
+                         /* .xtdm     = */ 0x00000003, /* 2 slots are active (I2S) */
+               #endif
+#else
+               #if defined (DSP_MODE)
+               /* .afsxctl  = */ 0x00000000,       /* burst mode,
+                                                                                        * Frame sync is one bit
+                                                                                        * Rising edge is start of frame
+                                                                                        * externally generated frame sync
+                                                                                        */
+               /* .xtdm     = */ 0x00000001,       /* slot 1 is active (DSP) */
+               #else /*I2S MODE*/
+                         /* .afsxctl  = */ 0x00000111, /* I2S mode,
+                                                                                        * Frame sync is one word
+                                                                                        * Externally generated frame sync
+                                                                                        * Falling edge is start of frame
+                                                                                        */
+                         /* .xtdm     = */ 0x00000003, /* 2 slots are active (I2S) */
+               #endif
+#endif
+        /* .xintctl  = */ 0x00000003, /* sync error,overrun error,clK error   */
+        /* .xstat    = */ 0x000001FF, /* reset any existing status bits       */
+        /* .xevtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
+        {
+#if defined (MCASP_MASTER)
+        #if defined (DSP_MODE)
+                       /* .aclkxctl  = */ 0x00000027,
+                       /* .ahclkxctl = */ 0x00008000,
+
+               #else /* I2S MODE*/
+                       /* .aclkxctl  = */ 0x000000A7, /* Div (8), Internal Source, SYNC, Falling edge */
+                       /* .ahclkxctl = */ 0x00008000, /* Div (1), Internal AUX_CLK Source */
+               #endif
+#else
+               #if defined (DSP_MODE)
+                       /* .aclkxctl  = */ 0x00000000,  /* External Source, SYNC */
+
+               #else /* I2S MODE*/
+                       /* .aclkxctl  = */ 0x00000080, /* External Source, SYNC, Falling edge */
+               #endif
+#endif
+             /* .xclkchk   = */ 0x00000000
+        },
+
+};
+
+/* McAsp channel parameters                                  */
+Mcasp_ChanParams  mcasp_chanparam[2]=
+{
+    {
+        RX_NUM_SERIALIZER,         /* number of serialisers      */
+        {Mcasp_SerializerNum_3, Mcasp_SerializerNum_1}, /* serialiser index           */
+        &mcaspRcvSetup,
+        TRUE,
+        Mcasp_OpMode_TDM,          /* Mode (TDM/DIT)             */
+        Mcasp_WordLength_32,
+        NULL,
+        0,
+        NULL,
+               (Mcasp_GblCallback)&GblErrRcv,
+#if defined (DSP_MODE)
+        1,
+#if RX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_1SLOT,
+#else
+        Mcasp_BufferFormat_MULTISER_1SLOT_SER_INTERLEAVED,
+#endif
+#else      /* I2S MODE*/
+        2, /* number of TDM channels      */
+#if RX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
+#else
+        Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
+#endif
+#endif
+        TRUE,
+               RX_FIFO_EVENT_DMA_RATIO,
+        TRUE,
+        Mcasp_WordBitsSelect_LSB
+    },
+    {
+        TX_NUM_SERIALIZER,        /* number of serialisers       */
+        {Mcasp_SerializerNum_2, Mcasp_SerializerNum_0},
+        &mcaspXmtSetup,
+        TRUE,
+        Mcasp_OpMode_TDM,
+        Mcasp_WordLength_32,      /* word width                  */
+        NULL,
+        0,
+        NULL,
+               (Mcasp_GblCallback)&GblErrXmt,
+#if defined (DSP_MODE)
+        1,
+#if TX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_1SLOT,
+#else
+        Mcasp_BufferFormat_MULTISER_1SLOT_SER_INTERLEAVED,
+#endif
+#else      /* I2S MODE*/
+        2, /* number of TDM channels      */
+#if TX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
+#else
+        Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
+#endif
+#endif
+        TRUE,
+               TX_FIFO_EVENT_DMA_RATIO,
+        TRUE,
+        Mcasp_WordBitsSelect_LSB
+    }
+};
+
+/*
+ * ======== createStreams ========
+ */
+ICodec_ChannelConfig AIC31_config =
+{
+               48000,  /* sampling rate for codec */
+               90,  /* gain (%) for codec      */
+               0x00,
+               0x00
+};
+
+
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/AudioLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/AudioLoopback.cfg
new file mode 100644 (file)
index 0000000..4436944
--- /dev/null
@@ -0,0 +1,309 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+// var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+
+/* Load the OSAL package */ 
+var socType           = "am437x";
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM437x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 600000000;
+BIOS.libType = BIOS.LibType_Custom;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+Hwi.initStackFlag = false;
+Hwi.checkStackFlag = false;
+
+/* Enable the cache                                                           */
+var Cache  = xdc.useModule('ti.sysbios.family.arm.a9.Cache');
+Cache.enableCache = true;
+// Cache.configureL2Sram = false;//DDR build
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var attrs0 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+
+/*
+Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+Mmu.setFirstLevelDescMeta(0x4a4E0000, 0x4a4E0000, attrs0);
+*/
+/* GPIO0 */
+Mmu.setFirstLevelDescMeta(0x44E07000, 0x44E07000, attrs0);
+Mmu.setFirstLevelDescMeta(0x4804C000, 0x4804C000, attrs0);
+Mmu.setFirstLevelDescMeta(0x481AC000, 0x481AC000, attrs0);
+Mmu.setFirstLevelDescMeta(0x481AE000, 0x481AE000, attrs0);
+Mmu.setFirstLevelDescMeta(0x48320000, 0x48320000, attrs0);
+Mmu.setFirstLevelDescMeta(0x48322000, 0x48322000, attrs0);
+
+
+/* PRCM registers */
+Mmu.setFirstLevelDescMeta(0x44DF0000, 0x44DF0000, attrs0);
+
+/* edma */
+
+for (var i=0x47c30000; i < 0x47c40000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+
+for (var i=0x49000000; i < 0x49100000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+for (var i=0x49800000; i < 0x49B00000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C0 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x44e0b000, 0x44e0b000, attrs0);
+
+/* I2C1 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4802A000, 0x4802A000, attrs0);
+/* I2C2 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4819c000, 0x4819c000, attrs0);
+
+/* mcasp-1 CFG*/
+for (var i=0x4803C000; i < 0x4803E000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp-1 DATA */
+for (var i=0x46400000; i < 0x46800000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+var attrs1 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs1);
+}
+*/
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x40000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+Task.enableIdleTask = true;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/DeviceLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/DeviceLoopback.cfg
new file mode 100644 (file)
index 0000000..a973077
--- /dev/null
@@ -0,0 +1,300 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+var socType           = "am437x";
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+// var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM437x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+GPIO.Settings.socType=socType;
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 600000000;
+BIOS.libType = BIOS.LibType_Custom;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+Hwi.initStackFlag = false;
+Hwi.checkStackFlag = false;
+
+/* Enable the cache                                                           */
+var Cache  = xdc.useModule('ti.sysbios.family.arm.a9.Cache');
+Cache.enableCache = true;
+// Cache.configureL2Sram = false;//DDR build
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var attrs0 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+
+/* GPIO0 */
+Mmu.setFirstLevelDescMeta(0x44E07000, 0x44E07000, attrs0);
+Mmu.setFirstLevelDescMeta(0x4804C000, 0x4804C000, attrs0);
+Mmu.setFirstLevelDescMeta(0x481AC000, 0x481AC000, attrs0);
+Mmu.setFirstLevelDescMeta(0x481AE000, 0x481AE000, attrs0);
+Mmu.setFirstLevelDescMeta(0x48320000, 0x48320000, attrs0);
+Mmu.setFirstLevelDescMeta(0x48322000, 0x48322000, attrs0);
+/* CM_, PRM_ registers */
+Mmu.setFirstLevelDescMeta(0x44DF0000, 0x44DF0000, attrs0);
+
+/* UART-0 */
+Mmu.setFirstLevelDescMeta(0x44E09000, 0x44E09000, attrs0);
+
+/* edma */
+
+for (var i=0x49000000; i < 0x49100000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+for (var i=0x49800000; i < 0x49B00000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C0 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x44e0b000, 0x44e0b000, attrs0);
+
+/* I2C1 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4802A000, 0x4802A000, attrs0);
+/* I2C2 */
+// Each 'BLOCK' descriptor entry spans a 2MB address range
+Mmu.setFirstLevelDescMeta(0x4819c000, 0x4819c000, attrs0);
+
+/* mcasp-0 CFG*/
+for (var i=0x48038000; i < 0x4803B000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp-0 DATA */
+for (var i=0x46000000; i < 0x46400000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs0);
+}
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+var attrs1 = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setFirstLevelDescMeta(i, i, attrs1);
+}
+*/
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x40000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+Task.enableIdleTask = true;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_Audio_evmAM437x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_Audio_evmAM437x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..45470b1
--- /dev/null
@@ -0,0 +1,13 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3106_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am437x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am437x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/gpio/soc/am437x/GPIO_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/armv7/bios/AudioLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DAIC_CODEC -DSOC_AM437x -DEVM_AM437X -g -gstrict-dwarf -gdwarf-3 -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board -I${PDK_INSTALL_PATH}/ti/starterware/include  -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/starterware/include/am43xx" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections "
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_DeviceLoopback_evmAM437x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM437x/armv7/bios/MCASP_DeviceLoopback_evmAM437x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..3b84728
--- /dev/null
@@ -0,0 +1,11 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/deviceloopback.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am437x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am437x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/gpio/soc/am437x/GPIO_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/armv7/bios/DeviceLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DMCASP_MASTER -DDEVICE_LOOPBACK -DSOC_AM437x -DEVM_AM437X -g -gstrict-dwarf -gdwarf-3 -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM437x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board -I${PDK_INSTALL_PATH}/ti/starterware/include -I${PDK_INSTALL_PATH}/ti/starterware/include/am43xx -I${PDK_INSTALL_PATH}/ti/starterware/include/am43xx/am437x" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections "
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/include/Audio_evmInit.h b/packages/ti/drv/mcasp/example/evmAM437x/include/Audio_evmInit.h
new file mode 100644 (file)
index 0000000..2a9a2d8
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _AUDIO_EVMINIT_H_
+#define _AUDIO_EVMINIT_H_
+
+#include <xdc/std.h>
+#include "board.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+Void configureAudio(Void);
+Void audioUserI2cInit(Void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/include/mcasp_cfg.h b/packages/ti/drv/mcasp/example/evmAM437x/include/mcasp_cfg.h
new file mode 100644 (file)
index 0000000..43cd526
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _MCASP_CFG_H_
+#define _MCASP_CFG_H_
+
+#include <xdc/std.h>
+#include <string.h>
+#include <xdc/runtime/Log.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/io/GIO.h>
+#include <ti/sysbios/BIOS.h>
+#include <xdc/runtime/System.h>
+
+#include <mcasp_drv.h>
+#include <ti/sysbios/io/IOM.h>
+#include <Aic31.h>
+
+//#include <Audio.h>
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+#include <ti/csl/csl_edma3.h>
+#include <ti/csl/soc.h>
+#include <ti/csl/csl_bootcfg.h>
+
+#include <ti/starterware/include/hw/am437x.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef DEVICE_LOOPBACK
+#define MCASP_NUM 0
+#define MCASP_RX_DMA_CH  9
+#define MCASP_TX_DMA_CH  8
+#else
+#define MCASP_NUM 1
+#define MCASP_RX_DMA_CH  11
+#define MCASP_TX_DMA_CH  10
+
+#endif
+#define EDMACC_NUM 0
+
+
+#define SOC_I2C_1_REGS SOC_I2C1_REG
+#define I2C_MCASP_INSTANCE 1
+
+#define AIC31_NUM_INSTANCES   1
+#define AIC31_INST0_ADDRESS   0x1B
+
+/**<    Address of first instance                                         */
+
+extern void GblErr(int arg);
+extern Mcasp_HwSetupData mcaspRcvSetup;
+extern Mcasp_HwSetupData mcaspXmtSetup;
+extern Mcasp_ChanParams  mcasp_chanparam[];
+extern ICodec_ChannelConfig AIC31_config;
+
+/** Number of serializers configured for record */
+
+#ifdef DEVICE_LOOPBACK
+#define RX_NUM_SERIALIZER       (2u)
+#define TX_NUM_SERIALIZER       (2u)
+#else
+#define RX_NUM_SERIALIZER       (1u)
+#define TX_NUM_SERIALIZER       (1u)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/src/audio_evmInit.c b/packages/ti/drv/mcasp/example/evmAM437x/src/audio_evmInit.c
new file mode 100644 (file)
index 0000000..fe236cb
--- /dev/null
@@ -0,0 +1,337 @@
+/*
+ * audio_evmInit.c
+ *
+ * This file contains Audio application related EVM (platform) specific routines
+ * implementation. 
+ * This is part of the EVM Initialization library (evmInit) which contains pinmux
+ * enabling routines for peripherals used by the application, and may contain 
+ * related device pre-driver initialization routines.
+ *
+ * Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ *  \file   audio_evmInit.c
+ *
+ *  \brief  This file contains the board specific code for enabling the use of
+ *          audio driver.
+ *
+ *  (C) Copyright 2009-2018, Texas Instruments, Inc
+ *
+ */
+
+#include <xdc/std.h>
+#define SW_I2C
+#ifndef SW_I2C
+#include <i2c/include/I2c.h>
+#endif
+#include <xdc/runtime/System.h>
+#include <Audio_evmInit.h>
+#include <ti/csl/cslr_device.h>
+#include <ti/csl/soc.h>
+#include <ti/drv/mcasp/soc/mcasp_soc.h>
+#include <mcasp_cfg.h>
+#include <board.h>
+
+#include <ti/csl/hw_types.h>
+#include <ti/drv/uart/UART_stdio.h>
+#include <ti/starterware/include/hw/am437x.h>
+#include <ti/starterware/include/hw/hw_control_am43xx.h>
+#include <ti/starterware/include/am43xx/am437x/hw_cm_wkup.h>
+#include <ti/starterware/include/am43xx/am437x/hw_cm_per.h>
+#include <ti/starterware/board/am43xx/am43xx_pinmux.h>
+#include <ti/starterware/include/chipdb.h>
+#include <ti/starterware/include/prcm.h>
+#include <ti/starterware/include/error.h>
+#include <ti/starterware/include/pinmux.h>
+#include <ti/drv/gpio/GPIO.h>
+#include <ti/drv/gpio/soc/GPIO_v1.h>
+#include <ti/board/board.h>
+#include "MCASP_log.h"
+
+/*============================================================================*/
+/*                          MACRO DEFINITIONS                                 */
+/*============================================================================*/
+
+/**
+ *  \brief    Initializes platform specific modules
+ *
+ *  This function initializes the modules like PLL, DDR, I2C etc
+ *  which are required for audio processing. Need to call this function
+ *  before doing any HW related operations.
+ *
+ *  \return    Platform_EOK on Success or error code
+ */
+
+
+
+extern Board_STATUS Board_init(Board_initCfg);
+void Configure_XBAR(void);
+
+
+/*
+ * Function to enable the pinmux for the mcasp and i2c devices in the soc.
+ *
+ */
+/* GPIO pin value definitions */
+#define GPIO_PIN_VAL_LOW     (0U)
+#define GPIO_PIN_VAL_HIGH    (1U)
+/* GPIO Driver board specific pin configuration structure */
+GPIO_PinConfig gpioPinConfigs[] = {
+    /* Input pin with interrupt disabled */
+    GPIO_DEVICE_CONFIG(1, 24) | GPIO_CFG_OUTPUT,
+};
+
+/* GPIO Driver call back functions */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+    NULL,
+};
+
+/* GPIO Driver configuration structure */
+GPIO_v1_Config GPIO_v1_config = {
+    gpioPinConfigs,
+    gpioCallbackFunctions,
+    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
+    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
+    0,
+    };
+
+#ifndef DEVICE_LOOPBACK
+
+void I2C1_ClockCfg()
+{
+    HWREG(SOC_CM_PER_REG + PRCM_CM_PER_I2C1_CLKCTRL) |=
+                             PRCM_CM_PER_I2C1_CLKCTRL_MODULEMODE_ENABLE;
+
+    while((HWREG(SOC_CM_PER_REG + PRCM_CM_PER_I2C1_CLKCTRL) &
+      PRCM_CM_PER_I2C1_CLKCTRL_MODULEMODE_MASK) != PRCM_CM_PER_I2C1_CLKCTRL_MODULEMODE_ENABLE);
+
+    while(!(HWREG(SOC_CM_PER_REG + PRCM_CM_PER_L4LS_CLKSTCTRL) &
+           (PRCM_CM_PER_L4LS_CLKSTCTRL_CLKACTIVITY_GCLK_MASK |
+            PRCM_CM_PER_L4LS_CLKSTCTRL_CLKACTIVITY_I2C_FCLK_MASK)));
+
+    HWREG(SOC_CONTROL_MODULE_REG +PIN_SPI0_D1)=PIN_RX_ACTIVE | PIN_PULL_UP_EN | PIN_MODE(2);
+    HWREG(SOC_CONTROL_MODULE_REG +PIN_SPI0_CS0)=PIN_RX_ACTIVE | PIN_PULL_UP_EN | PIN_MODE(2);
+
+
+}
+#endif
+void McASP1_ClockCfg(void)
+{
+#ifdef DEVICE_LOOPBACK
+       uint32_t dpllDiv = 0U;
+    uint32_t dpllMult = 0U;
+    uint32_t dpllPostDivM4 = 0U;
+    uint32_t dpllPostDivM5 = 0U;
+    uint32_t dpllPostDivM6 = 0U;
+    uint32_t crystalFreqSel;
+    uint32_t regVal = 0U;
+    uint32_t inputClk;
+       /* Set the Core PLL (ADPLLS), as per Section 8.1.6.7 in the TRM */
+       /*
+       1. Switch PLL to bypass mode by setting CM_CLKMODE_DPLL_CORE.DPLL_EN to 0x4
+
+       2. Wait for CM_IDLEST_DPLL_CORE.ST_MN_BYPASS = 1 to ensure PLL is in bypass
+       (CM_IDLEST_DPLL_CORE.ST_DPLL_CLK should also change to 0 to denote the PLL is unlocked).
+       3. Configure Multiply and Divide values by setting CM_CLKSEL_DPLL_CORE.DPLL_MULT and
+       DPLL_DIV to the desired values.
+       4. Configure M4, M5 and M6 dividers by setting HSDIVIDER_CLKOUT1_DIV bits in
+       CM_DIV_M4_DPLL_CORE,CM_DIV_M5_DPLL_CORE, and CM_DIV_M6_DPLL_CORE to the
+       desired values.
+       5. Switch over to lock mode by setting CM_CLKMODE_DPLL_CORE.DPLL_EN to 0x7.
+       6. Wait for CM_IDLEST_DPLL_CORE.ST_DPLL_CLK = 1 to ensure PLL is locked
+       (CM_IDLEST_DPLL_CORE.ST_MN_BYPASS should also change to 0 to denote the PLL is out of
+       bypass mode).
+       */
+    /* Get input clock frequency. */
+    /* Get input clock frequency. */
+    crystalFreqSel = HW_RD_FIELD32(SOC_CONTROL_MODULE_REG + CTRL_STS,
+        CTRL_STS_SYSBOOT15_14);
+
+    switch(crystalFreqSel)
+     {
+         case 0U:
+         {
+             inputClk = 19U;
+             break;
+         }
+
+         case 1U:
+         {
+             inputClk = 24U;
+             break;
+         }
+
+         case 2U:
+         {
+             inputClk = 25U;
+             break;
+         }
+
+         case 3U:
+         {
+             inputClk = 26U;
+             break;
+         }
+
+         default:
+         {
+             break;
+         }
+     }
+
+     /*
+      * pllDiv = (inputClk/refClk) - 1U
+      * PLL divider derived from input clock with referance clock as 1MHz.
+      * PLL divider is same for all PLLs.
+      */
+
+    /* The below values are chosen for this EVM because of the following reason */
+    /* The MCASP needs a bit clock of 3.072 Mhz (ACLK) - This is derived from
+     *   48Khz * 64 bits (because of L+R 32 bit channels) = 3.072 Mhz
+     *   But ACLK = AuxCLK /( AHCLKDIV + ACLKDIV)
+     *   If we keep AHCLKDIV + ACLKDIV = 8 approx, we get a desired AuxCLK=  24.576 Mhz
+     *
+     *   In AM335x , the AUXCLK is provided by L4_PER_CLK which is the output of Core PLL
+     *   By programming the ADPLLS and the dividers of the Core PLL appropriately, we can
+     *   get the 24.576 Mhz, or in this example a close enough value 24.61 Mhz.
+     *
+     *   The L4_PER_CLK = CLKDCOOUT (of the ADPLLS) /(M4 Div) * (2)
+     *                  = (2*(M/(N+1))/((M4 Div)*2)
+     */
+    dpllDiv = inputClk-1;/* 23 */
+    dpllMult = 1000U;
+    dpllPostDivM4 = 39U;
+    dpllPostDivM5 = 8U;
+    dpllPostDivM6 = 4U;
+
+    /* Put the PLL in bypass mode */
+     /* Put the PLL in bypass mode */
+     HW_WR_FIELD32(SOC_CM_WKUP_REG + PRCM_CM_CLKMODE_DPLL_CORE,
+     PRCM_CM_CLKMODE_DPLL_CORE_EN, PRCM_CM_CLKMODE_DPLL_CORE_EN_MN_BYP_MODE);
+
+     while(0U == HW_RD_FIELD32(SOC_CM_WKUP_REG + PRCM_CM_IDLEST_DPLL_CORE,
+         PRCM_CM_IDLEST_DPLL_CORE_ST_MN_BYPASS));
+
+     /* Set the multipler and divider values for the PLL */
+     regVal = HW_RD_REG32(SOC_CM_WKUP_REG + PRCM_CM_CLKSEL_DPLL_CORE);
+     HW_SET_FIELD(regVal, PRCM_CM_CLKSEL_DPLL_CORE_MULT, dpllMult);
+     HW_SET_FIELD(regVal, PRCM_CM_CLKSEL_DPLL_CORE_DIV, dpllDiv);
+     HW_WR_REG32((SOC_CM_WKUP_REG + PRCM_CM_CLKSEL_DPLL_CORE), regVal);
+
+     /* Configure the High speed dividers */
+     /* Set M4 divider */
+     HW_WR_REG32((SOC_CM_WKUP_REG + PRCM_CM_DIV_M4_DPLL_CORE), dpllPostDivM4);
+
+     /* Set M5 divider */
+     HW_WR_REG32((SOC_CM_WKUP_REG + PRCM_CM_DIV_M5_DPLL_CORE), dpllPostDivM5);
+
+     /* Set M6 divider */
+     HW_WR_REG32((SOC_CM_WKUP_REG + PRCM_CM_DIV_M6_DPLL_CORE), dpllPostDivM6);
+
+     /* Now LOCK the PLL by enabling it */
+     HW_WR_FIELD32(SOC_CM_WKUP_REG + PRCM_CM_CLKMODE_DPLL_CORE,
+         PRCM_CM_CLKMODE_DPLL_CORE_EN, PRCM_CM_CLKMODE_DPLL_CORE_EN_LOCK_MODE);
+
+     while(0U == HW_RD_FIELD32(SOC_CM_WKUP_REG + PRCM_CM_IDLEST_DPLL_CORE,
+         PRCM_CM_IDLEST_DPLL_CORE_ST_CLK));
+
+#else
+    HWREG(SOC_CM_PER_REG + PRCM_CM_PER_MCASP1_CLKCTRL) =
+                           PRCM_CM_PER_MCASP1_CLKCTRL_MODULEMODE_ENABLE;
+
+    while((HWREG(SOC_CM_PER_REG + PRCM_CM_PER_MCASP1_CLKCTRL) &
+      PRCM_CM_PER_MCASP1_CLKCTRL_MODULEMODE_MASK) != PRCM_CM_PER_MCASP1_CLKCTRL_MODULEMODE_ENABLE);
+
+
+    /*
+    ** Waiting for IDLEST field in CM_PER_MCASP1_CLKCTRL register to attain the
+    ** desired value.
+    */
+    while((PRCM_CM_PER_MCASP1_CLKCTRL_IDLEST_FUNC <<
+           PRCM_CM_PER_MCASP1_CLKCTRL_IDLEST_SHIFT)!=
+          (HWREG(SOC_CM_PER_REG + PRCM_CM_PER_MCASP1_CLKCTRL) &
+           PRCM_CM_PER_MCASP1_CLKCTRL_IDLEST_MASK));
+
+#endif
+
+}
+       
+       
+       
+void I2C1_Enable(void);
+void configureAudio(void)
+{
+       Board_STATUS stat = BOARD_SOK;
+       Board_initCfg arg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO;
+    stat = Board_init(arg);
+
+    if( BOARD_SOK != stat)
+    {
+        MCASP_log("Board init failed!!");
+        return;
+    }
+#ifndef DEVICE_LOOPBACK
+    /* GPIO 0_24 is connected to the AIC Codec's CLKRST . Turning this high
+          enables the AIC Codec */
+       GPIO_init();
+    GPIO_write(0, GPIO_PIN_VAL_HIGH);
+       I2C1_ClockCfg();
+#endif
+    McASP1_ClockCfg();
+}
+
+/*
+ * Function to configure SOC specific parameters. This includes SOC
+ * specific parameters such as interrupt configuration using Muxes,
+ * interrupt configuration etc.
+ */
+void configMcASP_SocHwInfo()
+{
+  /* Configure the interrupts for the McASP Instance MCASP_NUM */
+  /* ON Keystone, it involves CIC programming as well.
+   * The McASP does that internally, if configured with the correct parameters.
+   * Such as muxNum, muxInEvent, muxOutEvent,
+   * cpuInEventNum, cpuIntNum
+  */
+    Mcasp_HwInfo hwInfo;
+
+    Mcasp_socGetInitCfg(MCASP_NUM, &hwInfo);
+
+
+/* Change anything if needed */
+    Mcasp_socSetInitCfg(MCASP_NUM,&hwInfo);
+}
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM437x/src/mcasp_cfg.c b/packages/ti/drv/mcasp/example/evmAM437x/src/mcasp_cfg.c
new file mode 100644 (file)
index 0000000..a438bce
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * mcasp_cfg.c
+ *
+ * This file contains the test / demo code to demonstrate the Audio component
+ * driver functionality on SYS/BIOS 6.
+ *
+ * Copyright (C) 2009-2017 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/** \file     mcasp_cfg.c
+ *
+ *  \brief    sample application for demostration of audio playing
+ *
+ *  This file contains the implementation of the sample appliation for the
+ *  demonstration of audio playing through the audio interface layer.
+ *
+ *             (C) Copyright 2009, Texas Instruments, Inc
+ */
+
+/* ========================================================================== */
+/*                            INCLUDE FILES                                   */
+/* ========================================================================== */
+
+#include <xdc/std.h>
+#include <ti/sysbios/io/IOM.h>
+#include <xdc/runtime/Memory.h>
+#include <ti/sysbios/heaps/HeapMem.h>
+#include <xdc/runtime/IHeap.h>
+#include <xdc/runtime/Error.h>
+#include <xdc/runtime/Log.h>
+#include <xdc/runtime/System.h>
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Semaphore.h>
+#include <mcasp_drv.h>
+#include <mcasp_cfg.h>
+#include <mcasp_tune.h>
+#include <ti/csl/csl_chip.h>
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+#include <ti/sdo/edma3/rm/edma3_rm.h>
+#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
+#include "ICodec.h"
+#include "stdio.h"
+#include "string.h"
+
+void GblErrXmt(Mcasp_errCbStatus errCbStat);
+void GblErrRcv(Mcasp_errCbStatus errCbStat);
+
+/* ========================================================================== */
+/*                          IMPORTED VARIABLES                                */
+/* ========================================================================== */
+
+
+extern EDMA3_DRV_Handle hEdma;
+extern HeapMem_Handle myHeap;
+
+/* ========================================================================== */
+/*                          McASP Init config                                 */
+/* ========================================================================== */
+
+
+
+Mcasp_HwSetupData mcaspRcvSetup = {
+        /* .rmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
+#if defined (DSP_MODE)
+        /* .rfmt     = */ 0x000080f0,
+#else /* I2S MODE*/
+    /* .rfmt     = */ 0x000180F0,
+#endif                                                           /* 0/1 bit delay from framsync
+                                       * MSB first
+                                       * No extra bit padding
+                                       * Padding bit (ignore)
+                                       * slot Size is 32
+                                       * Reads from DMA port
+                                       * NO rotation
+                                       */
+#if defined (MCASP_MASTER)
+       #if defined (DSP_MODE)
+    /* .afsrctl  = */ 0x00000002,           /* burst mode,
+                                             * Frame sync is one bit
+                                             * internally generated frame sync
+                                             * Rising edge is start of frame
+                                             */
+
+       #else /* I2S MODE*/
+          /* .afsrctl  = */ 0x00000113,     /* I2S mode,
+                                             * Frame sync is one word
+                                             * Internally generated frame sync
+                                             * Falling edge is start of frame
+                                             */
+       #endif
+#else
+       #if defined (DSP_MODE)
+    /* .afsrctl  = */ 0x00000000,           /* burst mode,
+                                             * Frame sync is one bit
+                                             * Externally generated frame sync
+                                             * Rising edge is start of frame
+                                             */
+
+       #else /* I2S MODE*/
+          /* .afsrctl  = */ 0x00000110,     /* I2S mode,
+                                             * Frame sync is one word
+                                             * Externally generated frame sync
+                                             * Falling edge is start of frame
+                                             */
+       #endif
+#endif
+
+#if defined (DSP_MODE)
+/* .rtdm     = */ 0x00000001,           /* slot 1 is active (DSP)
+                                         *              */
+
+#else /* I2S MODE*/
+      /* .rtdm     = */ 0x00000003,     /* 2 slots are active (I2S)
+                                         *            */
+#endif
+//        /* .rintctl  = */ 0x00000003, /* sync error and overrun error         */
+          /* .rintctl  = */ 0x00000000, /* sync error and overrun error         */
+        /* .rstat    = */ 0x000001FF, /* reset any existing status bits       */
+        /* .revtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
+        {
+#if defined (MCASP_MASTER)
+               #if defined (DSP_MODE)
+                       /* .aclkrctl  = */ 0x00000027,
+                       /* .ahclkrctl = */ 0x00008027,
+               #else /* I2S MODE*/
+                       /* .aclkrctl  = */ 0x00000027,  /* Div (8), Internal Source, rising edge */
+                       /* .ahclkrctl = */ 0x00008013,  /* Div (20), Internal AUX_CLK Source */
+               #endif
+#else
+               #if defined (DSP_MODE)
+                       /* .aclkrctl  = */ 0x00180080,
+               #else /* I2S MODE*/
+                       /* .aclkrctl  = */ 0x00180080,  /* External Source, rising edge */
+               #endif
+                       /* .ahclkrctl = */ 0x00180000,  /* Don't Care */
+#endif
+             /* .rclkchk   = */0x00FF0005
+        }
+} ;
+
+Mcasp_HwSetupData mcaspXmtSetup = {
+        /* .xmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
+               #if defined (DSP_MODE)
+                       /* .xfmt     = */ 0x000080F0,
+               #else /* I2S MODE*/
+                       /* .xfmt     = */ 0x000180F0,
+               #endif                                            /*
+                                       * 0/1 bit delay from framsync
+                                       * MSB first
+                                       * No extra bit padding
+                                       * Padding bit (ignore)
+                                       * slot Size is 32
+                                       * Reads from DMA port
+                                       * 0-bit rotation
+                                       */
+#if defined (MCASP_MASTER)
+               #if defined (DSP_MODE)
+               /* .afsxctl  = */ 0x00000002,       /* burst mode,
+                                                                                        * Frame sync is one bit
+                                                                                        * Internally generated frame sync
+                                                                                        * Rising edge is start of frame
+                                                                                        */
+               /* .xtdm     = */ 0x00000001,       /* slot 1 is active (DSP) */
+               #else /*I2S MODE*/
+                         /* .afsxctl  = */ 0x00000113, /* I2S mode,
+                                                                                        * Frame sync is one word
+                                                                                        * internally generated frame sync
+                                                                                        * Falling edge is start of frame
+                                                                                        */
+                         /* .xtdm     = */ 0x00000003, /* 2 slots are active (I2S) */
+               #endif
+#else
+               #if defined (DSP_MODE)
+               /* .afsxctl  = */ 0x00000000,       /* burst mode,
+                                                                                        * Frame sync is one bit
+                                                                                        * Rising edge is start of frame
+                                                                                        * externally generated frame sync
+                                                                                        */
+               /* .xtdm     = */ 0x00000001,       /* slot 1 is active (DSP) */
+               #else /*I2S MODE*/
+                         /* .afsxctl  = */ 0x00000110, /* I2S mode,
+                                                                                        * Frame sync is one word
+                                                                                        * Externally generated frame sync
+                                                                                        * Falling edge is start of frame
+                                                                                        */
+                         /* .xtdm     = */ 0x00000003, /* 2 slots are active (I2S) */
+               #endif
+#endif
+        /* .xintctl  = */ 0x00000000, /* sync error,overrun error,clK error   */
+        /* .xstat    = */ 0x000001FF, /* reset any existing status bits       */
+        /* .xevtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
+        {
+#if defined (MCASP_MASTER)
+        #if defined (DSP_MODE)
+                       /* .aclkxctl  = */ 0x00000027,
+                       /* .ahclkxctl = */ 0x00008001, 
+
+               #else /* I2S MODE*/
+                       /* .aclkxctl  = */ 0x000000A7, /* Div (8), Internal Source, SYNC, Falling edge */
+                       /* .ahclkxctl = */ 0x00008000, /* Div (1), Internal AUX_CLK Source */
+               #endif
+#else
+               #if defined (DSP_MODE)
+                       /* .aclkxctl  = */ 0x00000000,  /* External Source, SYNC */
+
+               #else /* I2S MODE*/
+                       /* .aclkxctl  = */ 0x0180080, /* External Source, SYNC, Falling edge */
+                       /* .ahclkxctl = */ 0, /* Div (20), Internal AUX_CLK Source */
+               
+               #endif
+#endif
+             /* .xclkchk   = */ 0xFF0005
+        },
+
+};
+
+/* McAsp channel parameters                                  */
+Mcasp_ChanParams  mcasp_chanparam[2]=
+{
+    {
+        RX_NUM_SERIALIZER,         /* number of serialisers      */
+        {Mcasp_SerializerNum_3, Mcasp_SerializerNum_1}, /* serialiser index           */
+        &mcaspRcvSetup,
+        TRUE,
+        Mcasp_OpMode_TDM,          /* Mode (TDM/DIT)             */
+        Mcasp_WordLength_32,
+        NULL,
+        0,
+        NULL,
+               (Mcasp_GblCallback)&GblErrRcv,
+#if defined (DSP_MODE)
+        1,
+#if RX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_1SLOT,
+#else
+        Mcasp_BufferFormat_MULTISER_1SLOT_SER_INTERLEAVED,
+#endif
+#else      /* I2S MODE*/
+        2, /* number of TDM channels      */
+#if RX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
+#else
+        Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
+#endif
+#endif
+        TRUE,
+       RX_FIFO_EVENT_DMA_RATIO,
+        TRUE,
+        Mcasp_WordBitsSelect_LSB
+    },
+    {
+        TX_NUM_SERIALIZER,        /* number of serialisers       */
+        {Mcasp_SerializerNum_2, Mcasp_SerializerNum_0},
+        &mcaspXmtSetup,
+        TRUE,
+        Mcasp_OpMode_TDM,
+        Mcasp_WordLength_32,      /* word width                  */
+        NULL,
+        0,
+        NULL,
+               (Mcasp_GblCallback)&GblErrXmt,
+#if defined (DSP_MODE)
+        1,
+#if TX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_1SLOT,
+#else
+        Mcasp_BufferFormat_MULTISER_1SLOT_SER_INTERLEAVED,
+#endif
+#else      /* I2S MODE*/
+        2, /* number of TDM channels      */
+#if TX_NUM_SERIALIZER == 1u
+               Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
+#else
+        Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
+#endif
+#endif
+        TRUE,
+       TX_FIFO_EVENT_DMA_RATIO,
+        TRUE,
+        Mcasp_WordBitsSelect_LSB
+    }
+};
+
+/*
+ * ======== createStreams ========
+ */
+ICodec_ChannelConfig AIC31_config =
+{
+               48000,  /* sampling rate for codec */
+               90,  /* gain (%) for codec      */
+               0x00,
+               0x00
+};
+
+
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/AudioLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/AudioLoopback.cfg
new file mode 100644 (file)
index 0000000..edae443
--- /dev/null
@@ -0,0 +1,307 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+var socType           = "am572x";
+
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = "am572x";
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 1000000000;
+BIOS.libType = BIOS.LibType_Custom;
+var smpCfg;
+if (Program.build.cfgArgs !=  null)
+{
+    smpCfg = Program.build.cfgArgs.SMP;
+    if(smpCfg == 'enable')
+    {
+        xdc.print("Enabling BIOS SMP mode");
+        BIOS.smpEnabled = true;
+        var Cache = xdc.module("ti.sysbios.hal.Cache");
+    }
+}
+
+/* Enable the cache                                                           */
+if(smpCfg == null || smpCfg == '')
+{
+    var Cache  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+    Cache.enableCache = true;
+}
+
+
+
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+var attrs0 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs0);
+attrs0.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs0.shareable = 2;                      // sharerable
+attrs0.accPerm=0;                          // read/write at PL1
+attrs0.noExecute = true;
+attrs0.attrIndx = 1;                       // Non-cache, device memory
+
+Mmu.setSecondLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+Mmu.setSecondLevelDescMeta(0x4a4E0000, 0x4a4E0000, attrs0);
+
+/* DMA Cross bar config */
+Mmu.setSecondLevelDescMeta(0x4A000000, 0x4A000000, attrs0);
+/*
+// Set the descriptor for each entry in the address range
+for (var i=0x40000000; i < 0x60000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+*/
+/* edma */
+for (var i=0x43300000; i < 0x43520000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C */
+for (var i=0x48060000; i < 0x48080000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp */
+for (var i=0x45800000; i < 0x47000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp contd */
+for (var i=0x48436000; i < 0x48480000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs1);
+attrs1.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs1.noExecute = true;
+attrs1.accPerm=0;                          // read/write at PL1
+attrs1.shareable = 2;                      // sharerable
+attrs1.attrIndx = 2;                       // Cached, normal memory
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs1);
+}
+*/
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm = 0;
+attrs.attrIndx = 1;
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x20000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
+
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/DeviceLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/DeviceLoopback.cfg
new file mode 100644 (file)
index 0000000..682ed4c
--- /dev/null
@@ -0,0 +1,291 @@
+/**
+ *  \file   audiosample.cfg
+ *
+ *  \brief  Sysbios config file for mmcsd test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+var socType           = "am572x";
+
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = "am572x";
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the driver packages, starting with mcasp */
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+BIOS.cpuFreq.lo = 1000000000;
+BIOS.libType = BIOS.LibType_Custom;
+
+/* Enable the cache                                                           */
+var Cache  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+Cache.enableCache = true;
+
+/* Enable the MMU (Required for L1/L2 caching)                              */
+
+/***********************************************
+ *              MMU Configuration              *
+ ***********************************************/
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ * 
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+var attrs0 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs0);
+attrs0.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs0.shareable = 2;                      // sharerable
+attrs0.accPerm=0;                          // read/write at PL1
+attrs0.noExecute = true;
+attrs0.attrIndx = 1;                       // Non-cache, device memory
+
+Mmu.setSecondLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);
+Mmu.setSecondLevelDescMeta(0x4a4E0000, 0x4a4E0000, attrs0);
+
+/* DMA Cross bar config */
+Mmu.setSecondLevelDescMeta(0x4A000000, 0x4A000000, attrs0);
+/*
+// Set the descriptor for each entry in the address range
+for (var i=0x40000000; i < 0x60000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+*/
+/* edma */
+for (var i=0x43300000; i < 0x43520000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* I2C */
+for (var i=0x48060000; i < 0x48080000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp */
+for (var i=0x45800000; i < 0x47000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+/* mcasp contd */
+for (var i=0x48436000; i < 0x48480000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+
+/*
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs1);
+attrs1.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs1.noExecute = true;
+attrs1.accPerm=0;                          // read/write at PL1
+attrs1.shareable = 2;                      // sharerable
+attrs1.attrIndx = 2;                       // Cached, normal memory
+
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs1);
+}
+*/
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm = 0;
+attrs.attrIndx = 1;
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+
+/*
+ * Program.argSize sets the size of the .args section.
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x20000;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/* 
+ * Create and install logger for the whole system
+ */
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+//HeapParam.sectionName = "L2SRAM"
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+//Program.sectMap[".text"] = "L2SRAM";
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+
+/* No runtime stack checking is performed */
+// Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+// Task.numPriorities = 6;
+
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_SMP_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_SMP_armExampleProject.txt
new file mode 100644 (file)
index 0000000..4cbea9f
--- /dev/null
@@ -0,0 +1,14 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3104_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am572x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/armv7/bios/AudioLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -march=armv7-a -marm -mfloat-abi=hard -DMCASP_MASTER -DAIC_CODEC -DSOC_AM572x -DEVM_AM572X -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections "
+-rtsc.setConfiguroOptions "--cfgArgs {SMP:\"enable\"}"
+
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_Audio_evmAM572x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..29bd325
--- /dev/null
@@ -0,0 +1,12 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3104_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am572x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/armv7/bios/AudioLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -march=armv7-a -marm -mfloat-abi=hard -DMCASP_MASTER -DAIC_CODEC -DSOC_AM572x -DEVM_AM572X -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections "
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_DeviceLoopback_evmAM572x_armExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/armv7/bios/MCASP_DeviceLoopback_evmAM572x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..b0fc609
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/deviceloopback.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/armv7/bios/DeviceLoopback.cfg" 
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -march=armv7-a -marm -mfloat-abi=hard -DMCASP_MASTER -DDEVICE_LOOPBACK -DSOC_AM572x -DEVM_AM572X -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "-lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections "
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioEQ_demo.cfg b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioEQ_demo.cfg
new file mode 100644 (file)
index 0000000..79abc9c
--- /dev/null
@@ -0,0 +1,118 @@
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var ECM         = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
+var System      = xdc.useModule ("xdc.runtime.System");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+var cache       = xdc.useModule ("ti.sysbios.hal.Cache");
+var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+var Hwi         = xdc.useModule ("ti.sysbios.family.c64p.Hwi");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = "am572x";
+
+/* Load the packages */
+var socType           = "am572x";
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+
+BIOS.cpuFreq.lo = 600000000;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x1000;
+
+System.SupportProxy = SysStd;
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+var task1Params = new Task.Params();
+task1Params.priority = 1;
+task1Params.instance.name = "task1";
+
+Program.global.task1 = Task.create("&ReadInputTask", task1Params);
+
+ECM.eventGroupHwiNum[0] = 7;
+ECM.eventGroupHwiNum[1] = 8;
+ECM.eventGroupHwiNum[2] = 9;
+ECM.eventGroupHwiNum[3] = 10;
+
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+/* 
+ * Create and install logger for the whole system
+ */
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var loggerBuf0 = LoggerBuf.create();
+LoggingSetup.sysbiosHwiLogging = true;
+LoggingSetup.sysbiosSemaphoreLogging = true;
+LoggingSetup.loadHwiLogging = true;
+LoggingSetup.loggerType = LoggingSetup.LoggerType_JTAGRUNMODE;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioLoopback.cfg
new file mode 100644 (file)
index 0000000..7eef469
--- /dev/null
@@ -0,0 +1,105 @@
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var ECM         = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
+var System      = xdc.useModule ("xdc.runtime.System");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+var cache       = xdc.useModule ("ti.sysbios.hal.Cache");
+var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+var Hwi         = xdc.useModule ("ti.sysbios.family.c64p.Hwi");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+/* Load the packages */
+var socType           = "am572x";
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = "am572x";
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+
+BIOS.cpuFreq.lo = 600000000;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x1000;
+
+System.SupportProxy = SysStd;
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+ECM.eventGroupHwiNum[0] = 7;
+ECM.eventGroupHwiNum[1] = 8;
+ECM.eventGroupHwiNum[2] = 9;
+ECM.eventGroupHwiNum[3] = 10;
+
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+/* 
+ * Create and install logger for the whole system
+ */
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var loggerBuf0 = LoggerBuf.create();
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/DeviceLoopback.cfg b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/DeviceLoopback.cfg
new file mode 100644 (file)
index 0000000..7eef469
--- /dev/null
@@ -0,0 +1,105 @@
+/* ========================================================================== */
+/*                      CFG script for the Audio sample                       */
+/* ========================================================================== */
+
+/* load the required files and packages                                       */
+var GIO                = xdc.useModule('ti.sysbios.io.GIO');
+var Task        = xdc.useModule ("ti.sysbios.knl.Task");
+var BIOS        = xdc.useModule ("ti.sysbios.BIOS");
+var ECM         = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
+var System      = xdc.useModule ("xdc.runtime.System");
+var SysStd      = xdc.useModule('xdc.runtime.SysStd');
+var cache       = xdc.useModule ("ti.sysbios.hal.Cache");
+var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+var Hwi         = xdc.useModule ("ti.sysbios.family.c64p.Hwi");
+var Sem         = xdc.useModule("ti.sysbios.knl.Semaphore");
+var Log                = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf  = xdc.useModule('xdc.runtime.LoggerBuf');
+var Memory             = xdc.useModule('xdc.runtime.Memory')
+var SysMin             = xdc.useModule('xdc.runtime.SysMin');
+var System             = xdc.useModule('xdc.runtime.System');
+var Defaults   = xdc.useModule('xdc.runtime.Defaults');
+var Main               = xdc.useModule('xdc.runtime.Main');
+var Diags              = xdc.useModule('xdc.runtime.Diags');
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var Edma                       = xdc.loadPackage ("ti.sdo.edma3.drv.sample");
+var drv                        = xdc.loadPackage ("ti.sdo.edma3.drv");
+var rm                 = xdc.loadPackage ("ti.sdo.edma3.rm");
+
+/* Load the packages */
+var socType           = "am572x";
+var McASP               = xdc.loadPackage('ti.drv.mcasp');
+McASP.Settings.socType  = socType;
+
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = "am572x";
+/* Load the i2c package */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the uart package */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType  = socType;
+
+/* Load the OSAL package */ 
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x2000;
+
+BIOS.cpuFreq.lo = 600000000;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x1000;
+
+System.SupportProxy = SysStd;
+
+/* allocate a config-params object */  
+var HeapParam = new HeapMem.Params;  
+  
+/* optionally assign per-instance configs */  
+HeapParam.size = 200000;
+  
+/* create an instance-object */  
+Program.global.myHeap = HeapMem.create(HeapParam);  
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+
+Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
+
+ECM.eventGroupHwiNum[0] = 7;
+ECM.eventGroupHwiNum[1] = 8;
+ECM.eventGroupHwiNum[2] = 9;
+ECM.eventGroupHwiNum[3] = 10;
+
+// chnaging default tick of timer to 100us from default 1000us
+var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 
+Clock.tickPeriod = 1000;
+
+/* 
+ * Create and install logger for the whole system
+ */
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var loggerBuf0 = LoggerBuf.create();
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_AudioEQ_evmAM572x_c66ExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_AudioEQ_evmAM572x_c66ExampleProject.txt
new file mode 100644 (file)
index 0000000..2c0791a
--- /dev/null
@@ -0,0 +1,14 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioEQ.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioEQ_biquad.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3104_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am572x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioEQ_demo.cfg" 
+-ccs.setCompilerOptions "-mv6600 --abi=eabi -g --define=SOC_AM572x --define=DMA_XBAR_AVAILABLE --define=AUDIO_EQ_DEMO --define=AIC_CODEC --define=MCASP_MASTER --define=BUILD_AM572X_DSP --display_error_number --diag_warning=225 -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "--reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model "
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_Audio_evmAM572x_c66ExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_Audio_evmAM572x_c66ExampleProject.txt
new file mode 100644 (file)
index 0000000..202f86c
--- /dev/null
@@ -0,0 +1,12 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic3104_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/aic31.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/codec_if.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/i2c/soc/am572x/I2C_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/c66/bios/AudioLoopback.cfg" 
+-ccs.setCompilerOptions "-mv6600 --abi=eabi -g --define=SOC_AM572x --define=AIC_CODEC --define=DMA_XBAR_AVAILABLE --define=MCASP_MASTER --define=BUILD_AM572X_DSP --display_error_number --diag_warning=225 -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include  -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "--reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model "
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_DeviceLoopback_evmAM572x_c66ExampleProject.txt b/packages/ti/drv/mcasp/example/evmAM572x/c66/bios/MCASP_DeviceLoopback_evmAM572x_c66ExampleProject.txt
new file mode 100644 (file)
index 0000000..718da6f
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_io.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/audioSample_main.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/src/deviceloopback.c" 
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/soc/am572x/mcasp_soc.c"
+-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/c66/bios/DeviceLoopback.cfg" 
+-ccs.setCompilerOptions "-mv6600 --abi=eabi -g --define=SOC_AM572x --define=DMA_XBAR_AVAILABLE --define=MCASP_MASTER -DDEVICE_LOOPBACK --define=BUILD_AM572X_DSP --define=DEVICE_LOOPBACK --display_error_number --diag_warning=225 -I${PDK_INSTALL_PATH} -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/example/evmAM572x/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp/include -I${PDK_INSTALL_PATH}/ti/drv/mcasp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc 
+-ccs.setLinkerOptions "--reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model "
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/include/Audio_evmInit.h b/packages/ti/drv/mcasp/example/evmAM572x/include/Audio_evmInit.h
new file mode 100644 (file)
index 0000000..2a9a2d8
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _AUDIO_EVMINIT_H_
+#define _AUDIO_EVMINIT_H_
+
+#include <xdc/std.h>
+#include "board.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+Void configureAudio(Void);
+Void audioUserI2cInit(Void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/include/audioEQ_biquad.h b/packages/ti/drv/mcasp/example/evmAM572x/include/audioEQ_biquad.h
new file mode 100644 (file)
index 0000000..dff45fa
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * audioEQ_biquad.c
+ *
+ * This file contains the Biquad implementation used for audio equalization
+ *
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+/** \file     audioEQ_biquad.h
+ *
+ *  \brief    Biquad filter implementation function prototypes
+ *
+ *  This file contains the function prototypes and macros for the
+ *  biquad filter implementation used for audio equalization.
+ *
+ *  References:
+ *  http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
+ *  http://www.earlevel.com/main/2012/11/26/biquad-c-source-code/ 
+ */
+#ifndef Biquad_h
+#define Biquad_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+    bq_type_lowpass = 0,
+    bq_type_highpass,
+    bq_type_bandpass,
+    bq_type_notch,
+    bq_type_peak,
+    bq_type_lowshelf,
+    bq_type_highshelf
+};
+
+typedef struct Biquad{    
+       int type;
+    double a0;
+    double a1;
+    double a2;
+    double b1;
+    double b2;
+    double Fc;
+    double Q;
+    double peakGain;
+    double z1;
+    double z2;
+} BIQUAD_T;
+
+inline float Biquad_process(BIQUAD_T *filter, float in) {
+    double out = in * filter->a0 + filter->z1;
+    filter->z1 = in * filter->a1 + filter->z2 - filter->b1 * out;
+    filter->z2 = in * filter->a2 - filter->b2 * out;
+    return out;
+}
+
+void Biquad_initParams(BIQUAD_T *filter);
+void Biquad_setPeakGain(BIQUAD_T *filter, double peakGainDB);
+void Biquad_setBiquad(BIQUAD_T *filter, int type, double Fc, double Q, double peakGain);
+float Biquad_process(BIQUAD_T *filter, float in);
+void Biquad_computeCoeff(BIQUAD_T *filter);
+void Biquad_applyFilter32(BIQUAD_T *filterer, int *input, int *output, int BufferSize);
+void Biquad_applyFilter16(BIQUAD_T *filterer, short *input, short *output, int BufferSize);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // Biquad_h
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/include/mcasp_cfg.h b/packages/ti/drv/mcasp/example/evmAM572x/include/mcasp_cfg.h
new file mode 100644 (file)
index 0000000..f716173
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Audio_evmInit.h
+ *
+ * This file contains Application programming interface for the Audio application
+ * related EVM (platform) specifc initialization routines
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * \file   Audio_evmInit.h
+ *
+ * \brief  This file contains the board level functions of Audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#ifndef _MCASP_CFG_H_
+#define _MCASP_CFG_H_
+
+#include <xdc/std.h>
+#include <string.h>
+#include <xdc/runtime/Log.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/io/GIO.h>
+#include <ti/sysbios/BIOS.h>
+#include <xdc/runtime/System.h>
+
+#include <mcasp_drv.h>
+#include <ti/sysbios/io/IOM.h>
+#include <Aic31.h>
+
+//#include <Audio.h>
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+#include <ti/csl/csl_edma3.h>
+#include <ti/csl/soc.h>
+#include <ti/csl/csl_bootcfg.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define MCASP_NUM 2
+#define EDMACC_NUM 0
+#define SOC_I2C_1_REGS CSL_DSP_I2C1_REGS
+#define I2C_MCASP_INSTANCE 0
+
+#define AIC31_NUM_INSTANCES   1
+#define AIC31_INST0_ADDRESS   0x18
+
+#define MCASP_RX_DMA_CH  CSL_EDMA3_CHA_MCASP2_RX
+#define MCASP_TX_DMA_CH  CSL_EDMA3_CHA_MCASP2_TX
+
+extern void GblErr(int arg);
+extern Mcasp_HwSetupData mcaspRcvSetup;
+extern Mcasp_HwSetupData mcaspXmtSetup;
+extern Mcasp_ChanParams  mcasp_chanparam[];
+extern ICodec_ChannelConfig AIC31_config;
+
+/** Number of serializers configured for record */
+
+#ifdef DEVICE_LOOPBACK
+#define RX_NUM_SERIALIZER       (2u)
+#define TX_NUM_SERIALIZER       (2u)
+#else
+#define RX_NUM_SERIALIZER       (1u)
+#define TX_NUM_SERIALIZER       (1u)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _AUDIO_EVMINIT_H_ */
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c b/packages/ti/drv/mcasp/example/evmAM572x/src/audio_evmInit.c
new file mode 100644 (file)
index 0000000..599b991
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * audio_evmInit.c
+ *
+ * This file contains Audio application related EVM (platform) specific routines
+ * implementation. 
+ * This is part of the EVM Initialization library (evmInit) which contains pinmux
+ * enabling routines for peripherals used by the application, and may contain 
+ * related device pre-driver initialization routines.
+ *
+ * Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ *  \file   audio_evmInit.c
+ *
+ *  \brief  This file contains the board specific code for enabling the use of
+ *          audio driver.
+ *
+ *  (C) Copyright 2009, Texas Instruments, Inc
+ *
+ */
+
+#include <xdc/std.h>
+#define SW_I2C
+#ifndef SW_I2C
+#include <i2c/include/I2c.h>
+#endif
+
+#include <Audio_evmInit.h>
+#include <mcasp_cfg.h>
+#include <ti/csl/cslr_device.h>
+#include <ti/csl/soc.h>
+#include <ti/drv/mcasp/soc/mcasp_soc.h>
+#include <board.h>
+//#include "evmam572x_pinmux.h"
+#include <ti/csl/hw_types.h>
+#include <ti/drv/uart/UART_stdio.h>
+#include "MCASP_log.h"
+
+/*============================================================================*/
+/*                          MACRO DEFINITIONS                                 */
+/*============================================================================*/
+
+/**
+ *  \brief    Initializes platform specific modules
+ *
+ *  This function initializes the modules like PLL, DDR, I2C etc
+ *  which are required for audio processing. Need to call this function
+ *  before doing any HW related operations.
+ *
+ *  \return    Platform_EOK on Success or error code
+ */
+
+
+//extern void PinmuxConfig(void);
+
+extern Board_STATUS Board_init(Board_initCfg);
+
+void Configure_XBAR(void);
+void McASP3_Enable(void);
+
+//#define HW_WR_REG32(addr, data)   *(unsigned int*)(addr) =(unsigned int)(data)
+
+/*
+ * Function to enable the pinmux for the mcasp and i2c devices in the soc.
+ *
+ */
+void configureAudio(void)
+{
+       Board_STATUS stat = BOARD_SOK;
+       Board_initCfg arg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
+
+       stat = Board_init(arg);
+
+    if( BOARD_SOK != stat)
+    {
+        MCASP_log("Board init failed!!");
+        return;
+    }
+
+       McASP3_Enable();
+
+       Configure_XBAR();
+}
+
+
+void McASP3_Enable(void)
+{
+
+       //uint32_t regVal = 0U;
+
+               // Choose SYS_CLK2 (22.5792 MHZ) as source for ABE_PLL REF CLK
+               HW_WR_FIELD32(CSL_DSP_CKGEN_PRM_REGS+CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG, \
+                               CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG_CLKSEL, \
+                               CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG_CLKSEL_SEL_SYS_CLK2);
+
+               /* Reprogram ABE DPLL for 451.584 MHz output on PER_ABE_X1_GFCLK line */
+
+               // step 1: disable the PLL, if enabled (ex: via GEL)
+               while(HW_RD_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN) == CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN_DPLL_LOCK_MODE)
+                       HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG, \
+                                       CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN, \
+                                       CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN_DPLL_FR_BYP_MODE);
+
+               // step 2: modify Synthesized Clock Parameters - DPLL MULT & DIV
+               HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKSEL_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_CLKSEL_DPLL_ABE_REG_DPLL_MULT, \
+                               0xC8);
+
+               HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKSEL_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_CLKSEL_DPLL_ABE_REG_DPLL_DIV, \
+                               0x09);
+
+               // step 3: Configure output clocks parameters - M2 = 1  M3 = 1
+               HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_DIV_M2_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_DIV_M2_DPLL_ABE_REG_DIVHS, \
+                               0x1);
+               HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_DIV_M3_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_DIV_M3_DPLL_ABE_REG_DIVHS, \
+                               0x1);
+
+               // step 4: Confirm that the PLL has locked
+               while(HW_RD_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG, \
+                               CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN) != CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN_DPLL_LOCK_MODE)
+                       HW_WR_FIELD32(CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG, \
+                                       CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN, \
+                                       CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN_DPLL_LOCK_MODE);
+
+               /* McASP3 Module Control */
+           HW_WR_FIELD32(CSL_DSP_L4PER_CM_CORE_REGS+CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_MCASP3_CLKCTRL_REG, \
+                       CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_MCASP3_CLKCTRL_REG_MODULEMODE, \
+                               CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_MCASP3_CLKCTRL_REG_MODULEMODE_ENABLE);
+           while (HW_RD_REG32(CSL_DSP_L4PER_CM_CORE_REGS+CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_MCASP3_CLKCTRL_REG) != \
+                       CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_MCASP3_CLKCTRL_REG_MODULEMODE_ENABLE) ;
+
+
+        /* PAD IO Config for McASP3 pins - ACLKX, AFSX, AXR0, AXR1*/
+
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_ACLKX, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_ACLKX_MCASP3_ACLKX_MUXMODE, \
+                       0x0);
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_FSX, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_FSX_MCASP3_FSX_MUXMODE, \
+                       0x0);
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_AXR0, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_AXR0_MCASP3_AXR0_MUXMODE, \
+                       0x0);
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_AXR1, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_MCASP3_AXR1_MCASP3_AXR1_MUXMODE, \
+                       0x0);
+
+           //HW_WR_REG32(0x4AE06160, 0x1); // CM_CLKSEL_CLKOUT2: 0x1: Selects SYS_CLK2
+           HW_WR_FIELD32(CSL_DSP_CKGEN_PRM_REGS+CSL_CKGEN_PRM_CM_CLKSEL_CLKOUTMUX2_REG, \
+                       CSL_CKGEN_PRM_CM_CLKSEL_CLKOUTMUX2_REG_CLKSEL, \
+                               CSL_CKGEN_PRM_CM_CLKSEL_CLKOUTMUX2_REG_CLKSEL_SEL_SYS_CLK2);
+
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_XREF_CLK0, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_XREF_CLK0_XREF_CLK0_INPUTENABLE, \
+                               0x0);   // 0x0: Receive mode is disabled
+
+           HW_WR_FIELD32(CSL_DSP_CORE_PAD_IO_REGISTERS_REGS+CSL_CONTROL_CORE_PAD_IO_PAD_XREF_CLK0, \
+                       CSL_CONTROL_CORE_PAD_IO_PAD_XREF_CLK0_XREF_CLK0_MUXMODE, \
+                   0x9);       //0x9: clkout2
+
+           HW_WR_FIELD32(CSL_DSP_COREAON_CM_CORE_REGS+CSL_COREAON_CM_CORE_CM_COREAON_DUMMY_MODULE2_CLKCTRL_REG, \
+                       CSL_COREAON_CM_CORE_CM_COREAON_DUMMY_MODULE2_CLKCTRL_REG_OPTFCLKEN_CLKOUTMUX2_CLK, \
+                       CSL_COREAON_CM_CORE_CM_COREAON_DUMMY_MODULE2_CLKCTRL_REG_OPTFCLKEN_CLKOUTMUX2_CLK_FCLK_EN);
+
+}
+
+void Configure_XBAR(void)
+{
+    /* Mapping the DMA crossbar for McASP DMA_DREQ_(128-120) in to EDMA3_DREQ_0-15.
+     * The EDMA3_DREQ_0-15 correspond to (CSL_EDMA3_CHA_MCASP'n'_RX) which are
+     * used inside mcasp_soc.c to register EDMA. Please note that the API below takes
+     * the mapped DMAReq  with 1 as the base, whereas CSL_EDMA3_CHA_MCASP'n'
+     * are with base 0 */
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,128,1+CSL_EDMA3_CHA_MCASP0_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,129,1+CSL_EDMA3_CHA_MCASP0_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,130,1+CSL_EDMA3_CHA_MCASP1_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,131,1+CSL_EDMA3_CHA_MCASP1_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,132,1+CSL_EDMA3_CHA_MCASP2_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,133,1+CSL_EDMA3_CHA_MCASP2_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,134,1+CSL_EDMA3_CHA_MCASP3_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,135,1+CSL_EDMA3_CHA_MCASP3_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,136,1+CSL_EDMA3_CHA_MCASP4_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,137,1+CSL_EDMA3_CHA_MCASP4_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,138,1+CSL_EDMA3_CHA_MCASP5_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,139,1+CSL_EDMA3_CHA_MCASP5_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,140,1+CSL_EDMA3_CHA_MCASP6_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,141,1+CSL_EDMA3_CHA_MCASP6_TX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,142,1+CSL_EDMA3_CHA_MCASP7_RX);
+       CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,143,1+CSL_EDMA3_CHA_MCASP7_RX);
+}
+
+/*
+ * Function to configure SOC specific parameters. This includes SOC
+ * specific parameters such as interrupt configuration using Muxes,
+ * interrupt configuration etc.
+ */
+void configMcASP_SocHwInfo()
+{
+  /* Configure the interrupts for the McASP Instance MCASP_NUM */
+  /* ON Keystone, it involves CIC programming as well.
+   * The McASP does that internally, if configured with the correct parameters.
+   * Such as muxNum, muxInEvent, muxOutEvent,
+   * cpuInEventNum, cpuIntNum
+  */
+    Mcasp_HwInfo hwInfo;
+
+    Mcasp_socGetInitCfg(MCASP_NUM, &hwInfo);
+
+    if(hwInfo.muxNum==MCASP_INVALID_MUX_NUM)
+    {
+#ifdef _TMS320C6X
+       /* Choosing a free Crossbar Instance number from Table 17-3. DSP1_INTC Default Interrupt Mapping
+        * in the AM572x TRM . Please note that this is fore Core 0 , i.e DSP1 only*/
+       /* Freely available cross bar instance numbers for DSP1 */
+       hwInfo.txMuxOutEvent=CSL_XBAR_INST_DSP1_IRQ_74;
+       hwInfo.rxMuxOutEvent=CSL_XBAR_INST_DSP1_IRQ_75;
+       /* The CPU event numbers corresponding to the above  */
+       hwInfo.cpuTxEventNumber = 74;
+       hwInfo.cpuRxEventNumber = 75;
+
+       hwInfo.muxNum=MUXINTCP_CROSSBAR_MUXNUM_DSP1; /* We use DSP1 for this demo */
+
+#elif defined(__TI_ARM_V7M4__)
+      /* M4. Please note that M4 is not currently supported for this demo. */
+
+       /* Choosing a free Crossbar Instance number from IPU_INTC Default Interrupt Mapping
+        * in the AM572x TRM. Please note that this is fore Core 0 , i.e IPU1 */
+       hwInfo.txMuxOutEvent=CSL_XBAR_INST_IPU1_IRQ_24;
+       hwInfo.rxMuxOutEvent=CSL_XBAR_INST_IPU1_IRQ_25;
+
+      /* The corresponding interrupts for MPU  */
+       hwInfo.txIntNum = 24;
+       hwInfo.rxIntNum = 25;
+
+       hwInfo.cpuTxEventNumber =  24;
+       hwInfo.cpuRxEventNumber =  25;
+
+       hwInfo.muxNum=MUXINTCP_CROSSBAR_MUXNUM_IPU1;
+
+#else
+       /* A15 */
+       /* Choosing a free Crossbar Instance number from Table 17-2. MPU_INTC Default Interrupt Mapping
+        * in the AM572x TRM */
+       hwInfo.txMuxOutEvent=CSL_XBAR_INST_MPU_IRQ_141;
+       hwInfo.rxMuxOutEvent=CSL_XBAR_INST_MPU_IRQ_142;
+
+       /* The corresponding interrupts for MPU  */
+       hwInfo.txIntNum = (141+32);
+       hwInfo.rxIntNum = (142+32);
+
+       hwInfo.cpuTxEventNumber = (141+32);
+       hwInfo.cpuRxEventNumber = (142+32);
+
+       hwInfo.muxNum=MUXINTCP_CROSSBAR_MUXNUM_MPU;
+#endif
+    }
+
+    /* Write back */
+    Mcasp_socSetInitCfg(MCASP_NUM,&hwInfo);
+}
+/* ========================================================================== */
+/*                              END OF FILE                                   */
+/* ========================================================================== */
diff --git a/packages/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c b/packages/ti/drv/mcasp/example/evmAM572x/src/mcasp_cfg.c
new file mode 100644 (file)
index 0000000..95044ba
--- /dev/null
@@ -0,0 +1,322 @@
+/*
+ * mcasp_cfg.c
+ *
+ * This file contains the test / demo code to demonstrate the Audio component
+ * driver functionality on SYS/BIOS 6.
+ *
+ * Copyright (C) 2009-2017 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright