summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /bsps
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'bsps')
-rw-r--r--bsps/arm/altera-cyclone-v/headers.am45
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp.h50
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h1555
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h825
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h964
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h114
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h1434
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h1007
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h162
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h951
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h1254
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_hwlibs_ver.h56
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_i2c.h2024
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_interrupt_common.h533
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_mpu_registers.h156
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_qspi_private.h167
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/alt_reset_manager.h291
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/hwlib.h189
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/i2cdrv.h76
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/irq.h41
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_acpidmap.h3569
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_clkmgr.h6464
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmanonsecure.h144
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmasecure.h144
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_gpio.h1991
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_i2c.h5940
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_l3.h6299
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspi.h5951
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspidata.h52
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_rstmgr.h3382
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sdr.h4149
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sysmgr.h24810
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/alt_uart.h5158
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/hps.h8026
-rw-r--r--bsps/arm/altera-cyclone-v/include/bsp/socal/socal.h259
-rw-r--r--bsps/arm/altera-cyclone-v/include/tm27.h24
-rw-r--r--bsps/arm/atsam/headers.am269
-rw-r--r--bsps/arm/atsam/include/bsp.h102
-rw-r--r--bsps/arm/atsam/include/bsp/atsam-clock-config.h62
-rw-r--r--bsps/arm/atsam/include/bsp/atsam-i2c.h74
-rw-r--r--bsps/arm/atsam/include/bsp/atsam-spi.h36
-rw-r--r--bsps/arm/atsam/include/bsp/i2c.h36
-rw-r--r--bsps/arm/atsam/include/bsp/irq.h30
-rw-r--r--bsps/arm/atsam/include/bsp/pin-config.h36
-rw-r--r--bsps/arm/atsam/include/bsp/power.h245
-rw-r--r--bsps/arm/atsam/include/bsp/sc16is752.h68
-rw-r--r--bsps/arm/atsam/include/bsp/spi.h36
-rw-r--r--bsps/arm/atsam/include/libchip/chip.h124
-rw-r--r--bsps/arm/atsam/include/libchip/compiler.h476
-rw-r--r--bsps/arm/atsam/include/libchip/include/acc.h152
-rw-r--r--bsps/arm/atsam/include/libchip/include/adc.h179
-rw-r--r--bsps/arm/atsam/include/libchip/include/aes.h68
-rw-r--r--bsps/arm/atsam/include/libchip/include/afe_dma.h116
-rw-r--r--bsps/arm/atsam/include/libchip/include/afec.h190
-rw-r--r--bsps/arm/atsam/include/libchip/include/chip.h1
-rw-r--r--bsps/arm/atsam/include/libchip/include/dac_dma.h150
-rw-r--r--bsps/arm/atsam/include/libchip/include/efc.h128
-rw-r--r--bsps/arm/atsam/include/libchip/include/exceptions.h52
-rw-r--r--bsps/arm/atsam/include/libchip/include/flashd.h91
-rw-r--r--bsps/arm/atsam/include/libchip/include/gmac.h349
-rw-r--r--bsps/arm/atsam/include/libchip/include/gmacd.h283
-rw-r--r--bsps/arm/atsam/include/libchip/include/hsmci.h155
-rw-r--r--bsps/arm/atsam/include/libchip/include/icm.h112
-rw-r--r--bsps/arm/atsam/include/libchip/include/isi.h200
-rw-r--r--bsps/arm/atsam/include/libchip/include/iso7816_4.h110
-rw-r--r--bsps/arm/atsam/include/libchip/include/mcan.h329
-rw-r--r--bsps/arm/atsam/include/libchip/include/mcid.h170
-rw-r--r--bsps/arm/atsam/include/libchip/include/mediaLB.h45
-rw-r--r--bsps/arm/atsam/include/libchip/include/mpu.h222
-rw-r--r--bsps/arm/atsam/include/libchip/include/pio.h217
-rw-r--r--bsps/arm/atsam/include/libchip/include/pio_capture.h79
-rw-r--r--bsps/arm/atsam/include/libchip/include/pio_it.h117
-rw-r--r--bsps/arm/atsam/include/libchip/include/pmc.h101
-rw-r--r--bsps/arm/atsam/include/libchip/include/pwmc.h137
-rw-r--r--bsps/arm/atsam/include/libchip/include/qspi.h236
-rw-r--r--bsps/arm/atsam/include/libchip/include/qspi_dma.h115
-rw-r--r--bsps/arm/atsam/include/libchip/include/rstc.h64
-rw-r--r--bsps/arm/atsam/include/libchip/include/rtc.h102
-rw-r--r--bsps/arm/atsam/include/libchip/include/rtt.h82
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_acc.h128
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_aes.h191
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_afec.h483
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_chipid.h123
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_dacc.h184
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_efc.h111
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_gmac.h1240
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_gpbr.h53
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_hsmci.h335
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_icm.h192
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_isi.h280
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_matrix.h301
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_mcan.h845
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_pio.h1711
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_pmc.h723
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_pwm.h644
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_qspi.h216
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_rstc.h79
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_rswdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_rtc.h234
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_rtt.h71
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_sdramc.h173
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_smc.h144
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_spi.h161
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_ssc.h280
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_supc.h295
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_tc.h346
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_trng.h73
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_twihs.h250
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_uart.h151
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_usart.h478
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_usbhs.h909
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_utmi.h63
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_wdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/component/component_xdmac.h616
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70j19.h431
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70j20.h437
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70j21.h437
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70n19.h495
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70n20.h495
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70n21.h495
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70q19.h668
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70q20.h668
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/pio/pio_same70q21.h668
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70.h55
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70j19.h623
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70j20.h630
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70j21.h630
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70n19.h636
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70n20.h636
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70n21.h636
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70q19.h684
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70q20.h684
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/same70q21.h689
-rw-r--r--bsps/arm/atsam/include/libchip/include/same70/system_same70.h80
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_acc.h128
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_aes.h191
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_afec.h483
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_chipid.h123
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_dacc.h184
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_efc.h111
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_gpbr.h53
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_hsmci.h335
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_icm.h192
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_isi.h280
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_matrix.h461
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_pio.h1711
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_pmc.h786
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_pwm.h667
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_qspi.h216
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_rstc.h79
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_rswdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_rtc.h234
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_rtt.h71
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_sdramc.h173
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_smc.h144
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_spi.h161
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_ssc.h280
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_supc.h295
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_tc.h346
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_trng.h73
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_twihs.h250
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_uart.h151
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_usart.h478
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_usbhs.h905
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_utmi.h63
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_wdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/component/component_xdmac.h616
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70j19.h406
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70j20.h407
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70j21.h407
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70n19.h464
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70n20.h463
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70n21.h463
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70q19.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70q20.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/pio/pio_sams70q21.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70.h55
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70j19.h610
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70j20.h610
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70j21.h610
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70n19.h616
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70n20.h616
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70n21.h616
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70q19.h664
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70q20.h664
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/sams70q21.h664
-rw-r--r--bsps/arm/atsam/include/libchip/include/sams70/system_sams70.h77
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_acc.h135
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_aes.h198
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_afec.h490
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_chipid.h123
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_dacc.h191
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_efc.h118
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_gmac.h1246
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_gpbr.h53
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_hsmci.h342
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_icm.h224
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_isi.h287
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_matrix.h181
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_mcan.h868
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_mlb.h192
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_pio.h1717
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_pmc.h729
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_pwm.h651
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_qspi.h223
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_rstc.h79
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_rswdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_rtc.h241
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_rtt.h71
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_sdramc.h180
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_smc.h151
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_spi.h168
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_ssc.h287
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_supc.h302
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_tc.h353
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_trng.h80
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_twihs.h264
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_uart.h162
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_usart.h485
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_usbhs.h961
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_utmi.h63
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_wdt.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/component/component_xdmac.h625
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71j19.h441
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71j20.h442
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71j21.h442
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71n19.h499
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71n20.h498
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71n21.h498
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71q19.h672
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71q20.h672
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/pio/pio_samv71q21.h672
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71.h58
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71j19.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71j20.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71j21.h637
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71n19.h643
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71n20.h643
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71n21.h643
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71q19.h691
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71q20.h691
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/samv71q21.h696
-rw-r--r--bsps/arm/atsam/include/libchip/include/samv71/system_samv71.h80
-rw-r--r--bsps/arm/atsam/include/libchip/include/sdramc.h68
-rw-r--r--bsps/arm/atsam/include/libchip/include/smc.h174
-rw-r--r--bsps/arm/atsam/include/libchip/include/spi.h116
-rw-r--r--bsps/arm/atsam/include/libchip/include/spi_dma.h146
-rw-r--r--bsps/arm/atsam/include/libchip/include/ssc.h72
-rw-r--r--bsps/arm/atsam/include/libchip/include/supc.h75
-rw-r--r--bsps/arm/atsam/include/libchip/include/tc.h77
-rw-r--r--bsps/arm/atsam/include/libchip/include/timetick.h101
-rw-r--r--bsps/arm/atsam/include/libchip/include/trace.h231
-rw-r--r--bsps/arm/atsam/include/libchip/include/trng.h50
-rw-r--r--bsps/arm/atsam/include/libchip/include/twi.h114
-rw-r--r--bsps/arm/atsam/include/libchip/include/twid.h140
-rw-r--r--bsps/arm/atsam/include/libchip/include/uart.h68
-rw-r--r--bsps/arm/atsam/include/libchip/include/uart_dma.h137
-rw-r--r--bsps/arm/atsam/include/libchip/include/usart.h164
-rw-r--r--bsps/arm/atsam/include/libchip/include/usart_dma.h137
-rw-r--r--bsps/arm/atsam/include/libchip/include/usbhs.h1699
-rw-r--r--bsps/arm/atsam/include/libchip/include/video.h79
-rw-r--r--bsps/arm/atsam/include/libchip/include/wdt.h74
-rw-r--r--bsps/arm/atsam/include/libchip/include/xdma_hardware_interface.h58
-rw-r--r--bsps/arm/atsam/include/libchip/include/xdmac.h640
-rw-r--r--bsps/arm/atsam/include/libchip/include/xdmad.h253
-rw-r--r--bsps/arm/atsam/include/tm27.h1
-rw-r--r--bsps/arm/beagle/headers.am14
-rw-r--r--bsps/arm/beagle/include/bsp.h364
-rw-r--r--bsps/arm/beagle/include/bsp/bbb-gpio.h45
-rw-r--r--bsps/arm/beagle/include/bsp/bbb-pwm.h178
-rw-r--r--bsps/arm/beagle/include/bsp/beagleboneblack.h72
-rw-r--r--bsps/arm/beagle/include/bsp/i2c.h211
-rw-r--r--bsps/arm/beagle/include/bsp/irq.h23
-rw-r--r--bsps/arm/beagle/include/tm27.h1
-rw-r--r--bsps/arm/csb336/headers.am11
-rw-r--r--bsps/arm/csb336/include/bsp.h68
-rw-r--r--bsps/arm/csb336/include/bsp/irq.h95
-rw-r--r--bsps/arm/csb336/include/mc9328mxl.h486
-rw-r--r--bsps/arm/csb336/include/tm27.h1
-rw-r--r--bsps/arm/csb337/headers.am21
-rw-r--r--bsps/arm/csb337/include/at91rm9200.h344
-rw-r--r--bsps/arm/csb337/include/at91rm9200_dbgu.h89
-rw-r--r--bsps/arm/csb337/include/at91rm9200_emac.h160
-rw-r--r--bsps/arm/csb337/include/at91rm9200_gpio.h401
-rw-r--r--bsps/arm/csb337/include/at91rm9200_mem.h115
-rw-r--r--bsps/arm/csb337/include/at91rm9200_pmc.h169
-rw-r--r--bsps/arm/csb337/include/at91rm9200_usart.h146
-rw-r--r--bsps/arm/csb337/include/bits.h48
-rw-r--r--bsps/arm/csb337/include/bsp.h78
-rw-r--r--bsps/arm/csb337/include/bsp/irq.h63
-rw-r--r--bsps/arm/csb337/include/font8x16.h3615
-rw-r--r--bsps/arm/csb337/include/sed1356.h52
-rw-r--r--bsps/arm/csb337/include/sed1356_16bit.h566
-rw-r--r--bsps/arm/csb337/include/tm27.h1
-rw-r--r--bsps/arm/edb7312/headers.am11
-rw-r--r--bsps/arm/edb7312/include/bsp.h72
-rw-r--r--bsps/arm/edb7312/include/bsp/irq.h92
-rw-r--r--bsps/arm/edb7312/include/ep7312.h218
-rw-r--r--bsps/arm/edb7312/include/tm27.h1
-rw-r--r--bsps/arm/gdbarmsim/headers.am11
-rw-r--r--bsps/arm/gdbarmsim/include/bsp.h82
-rw-r--r--bsps/arm/gdbarmsim/include/bsp/irq.h95
-rw-r--r--bsps/arm/gdbarmsim/include/bsp/swi.h110
-rw-r--r--bsps/arm/gdbarmsim/include/tm27.h1
-rw-r--r--bsps/arm/gumstix/headers.am12
-rw-r--r--bsps/arm/gumstix/include/bsp.h84
-rw-r--r--bsps/arm/gumstix/include/bsp/irq.h29
-rw-r--r--bsps/arm/gumstix/include/ffuart.h48
-rw-r--r--bsps/arm/gumstix/include/pxa255.h128
-rw-r--r--bsps/arm/gumstix/include/tm27.h1
-rw-r--r--bsps/arm/headers.am45
-rw-r--r--bsps/arm/imx/headers.am22
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_ccmvar.h64
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_ecspireg.h111
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_gpcreg.h162
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_i2creg.h54
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_iomuxreg.h61
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_iomuxvar.h49
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_srcreg.h104
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_uartreg.h174
-rw-r--r--bsps/arm/imx/include/arm/freescale/imx/imx_wdogreg.h62
-rw-r--r--bsps/arm/imx/include/bsp.h84
-rw-r--r--bsps/arm/imx/include/bsp/irq.h38
-rw-r--r--bsps/arm/imx/include/tm27.h24
-rw-r--r--bsps/arm/include/bsp/arm-a8core-start.h55
-rw-r--r--bsps/arm/include/bsp/arm-a9mpcore-clock.h38
-rw-r--r--bsps/arm/include/bsp/arm-a9mpcore-irq.h40
-rw-r--r--bsps/arm/include/bsp/arm-a9mpcore-regs.h133
-rw-r--r--bsps/arm/include/bsp/arm-a9mpcore-start.h172
-rw-r--r--bsps/arm/include/bsp/arm-cp15-start.h187
-rw-r--r--bsps/arm/include/bsp/arm-errata.h121
-rw-r--r--bsps/arm/include/bsp/arm-gic-irq.h112
-rw-r--r--bsps/arm/include/bsp/arm-gic-regs.h138
-rw-r--r--bsps/arm/include/bsp/arm-gic-tm27.h103
-rw-r--r--bsps/arm/include/bsp/arm-gic.h207
-rw-r--r--bsps/arm/include/bsp/arm-pl011-regs.h130
-rw-r--r--bsps/arm/include/bsp/arm-pl011.h51
-rw-r--r--bsps/arm/include/bsp/arm-pl050-regs.h57
-rw-r--r--bsps/arm/include/bsp/arm-pl050.h47
-rw-r--r--bsps/arm/include/bsp/arm-pl111-fb.h44
-rw-r--r--bsps/arm/include/bsp/arm-pl111-regs.h184
-rw-r--r--bsps/arm/include/bsp/arm-release-id.h152
-rw-r--r--bsps/arm/include/bsp/armv7m-irq.h36
-rw-r--r--bsps/arm/include/bsp/linker-symbols.h167
-rw-r--r--bsps/arm/include/bsp/lpc-dma.h221
-rw-r--r--bsps/arm/include/bsp/lpc-emc.h170
-rw-r--r--bsps/arm/include/bsp/lpc-i2s.h132
-rw-r--r--bsps/arm/include/bsp/lpc-lcd.h213
-rw-r--r--bsps/arm/include/bsp/lpc-timer.h159
-rw-r--r--bsps/arm/include/bsp/start.h183
-rw-r--r--bsps/arm/include/cmsis_gcc.h1373
-rw-r--r--bsps/arm/include/core_cm7.h2512
-rw-r--r--bsps/arm/include/core_cmFunc.h87
-rw-r--r--bsps/arm/include/core_cmInstr.h87
-rw-r--r--bsps/arm/include/core_cmSimd.h96
-rw-r--r--bsps/arm/include/libcpu/am335x.h704
-rw-r--r--bsps/arm/include/libcpu/mmu.h32
-rw-r--r--bsps/arm/include/libcpu/omap3.h384
-rw-r--r--bsps/arm/include/libcpu/omap_timer.h39
-rw-r--r--bsps/arm/include/uart.h163
-rw-r--r--bsps/arm/lm3s69xx/headers.am15
-rw-r--r--bsps/arm/lm3s69xx/include/bsp.h52
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/io.h191
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/irq.h107
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/lm3s69xx.h407
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/ssi.h43
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/syscon.h43
-rw-r--r--bsps/arm/lm3s69xx/include/bsp/uart.h46
-rw-r--r--bsps/arm/lm3s69xx/include/tm27.h1
-rw-r--r--bsps/arm/lpc176x/headers.am30
-rw-r--r--bsps/arm/lpc176x/include/bsp.h98
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/adc-defs.h96
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/adc.h60
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/can-defs.h183
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/can.h179
-rw-r--r--bsps/arm/lpc176x/include/bsp/common-types.h118
-rw-r--r--bsps/arm/lpc176x/include/bsp/dma.h98
-rw-r--r--bsps/arm/lpc176x/include/bsp/gpio-defs.h218
-rw-r--r--bsps/arm/lpc176x/include/bsp/io-defs.h142
-rw-r--r--bsps/arm/lpc176x/include/bsp/io.h88
-rw-r--r--bsps/arm/lpc176x/include/bsp/irq.h108
-rw-r--r--bsps/arm/lpc176x/include/bsp/lpc-clock-config.h45
-rw-r--r--bsps/arm/lpc176x/include/bsp/lpc-gpio.h100
-rw-r--r--bsps/arm/lpc176x/include/bsp/lpc176x.h1585
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/mbed-pinmap.h50
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/pwmout-defs.h105
-rwxr-xr-xbsps/arm/lpc176x/include/bsp/pwmout.h73
-rw-r--r--bsps/arm/lpc176x/include/bsp/system-clocks.h91
-rw-r--r--bsps/arm/lpc176x/include/bsp/timer-defs.h449
-rw-r--r--bsps/arm/lpc176x/include/bsp/timer.h195
-rw-r--r--bsps/arm/lpc176x/include/bsp/watchdog-defs.h65
-rw-r--r--bsps/arm/lpc176x/include/bsp/watchdog.h70
-rw-r--r--bsps/arm/lpc176x/include/tm27.h1
-rw-r--r--bsps/arm/lpc24xx/headers.am21
-rw-r--r--bsps/arm/lpc24xx/include/bsp.h128
-rw-r--r--bsps/arm/lpc24xx/include/bsp/dma.h95
-rw-r--r--bsps/arm/lpc24xx/include/bsp/i2c.h71
-rw-r--r--bsps/arm/lpc24xx/include/bsp/io.h1154
-rw-r--r--bsps/arm/lpc24xx/include/bsp/irq.h140
-rw-r--r--bsps/arm/lpc24xx/include/bsp/lcd.h91
-rw-r--r--bsps/arm/lpc24xx/include/bsp/lpc-clock-config.h49
-rw-r--r--bsps/arm/lpc24xx/include/bsp/lpc-ethernet-config.h130
-rw-r--r--bsps/arm/lpc24xx/include/bsp/lpc17xx.h207
-rw-r--r--bsps/arm/lpc24xx/include/bsp/lpc24xx.h2206
-rw-r--r--bsps/arm/lpc24xx/include/bsp/ssp.h47
-rw-r--r--bsps/arm/lpc24xx/include/bsp/start-config.h121
-rw-r--r--bsps/arm/lpc24xx/include/bsp/system-clocks.h89
-rw-r--r--bsps/arm/lpc24xx/include/tm27.h1
-rw-r--r--bsps/arm/lpc32xx/headers.am19
-rw-r--r--bsps/arm/lpc32xx/include/bsp.h259
-rw-r--r--bsps/arm/lpc32xx/include/bsp/boot.h114
-rw-r--r--bsps/arm/lpc32xx/include/bsp/emc.h161
-rw-r--r--bsps/arm/lpc32xx/include/bsp/hsu.h68
-rw-r--r--bsps/arm/lpc32xx/include/bsp/i2c.h269
-rw-r--r--bsps/arm/lpc32xx/include/bsp/irq.h179
-rw-r--r--bsps/arm/lpc32xx/include/bsp/lpc-clock-config.h59
-rw-r--r--bsps/arm/lpc32xx/include/bsp/lpc-ethernet-config.h98
-rw-r--r--bsps/arm/lpc32xx/include/bsp/lpc32xx.h641
-rw-r--r--bsps/arm/lpc32xx/include/bsp/mmu.h79
-rw-r--r--bsps/arm/lpc32xx/include/bsp/nand-mlc.h422
-rw-r--r--bsps/arm/lpc32xx/include/tm27.h72
-rw-r--r--bsps/arm/raspberrypi/headers.am20
-rw-r--r--bsps/arm/raspberrypi/include/bsp.h69
-rw-r--r--bsps/arm/raspberrypi/include/bsp/fbcons.h47
-rw-r--r--bsps/arm/raspberrypi/include/bsp/i2c.h95
-rw-r--r--bsps/arm/raspberrypi/include/bsp/irq.h76
-rw-r--r--bsps/arm/raspberrypi/include/bsp/mailbox.h32
-rw-r--r--bsps/arm/raspberrypi/include/bsp/mmu.h68
-rw-r--r--bsps/arm/raspberrypi/include/bsp/raspberrypi.h572
-rw-r--r--bsps/arm/raspberrypi/include/bsp/rpi-fb.h55
-rw-r--r--bsps/arm/raspberrypi/include/bsp/rpi-gpio.h70
-rw-r--r--bsps/arm/raspberrypi/include/bsp/spi.h77
-rw-r--r--bsps/arm/raspberrypi/include/bsp/usart.h43
-rw-r--r--bsps/arm/raspberrypi/include/bsp/vc.h157
-rw-r--r--bsps/arm/raspberrypi/include/tm27.h1
-rw-r--r--bsps/arm/realview-pbx-a9/headers.am10
-rw-r--r--bsps/arm/realview-pbx-a9/include/bsp.h67
-rw-r--r--bsps/arm/realview-pbx-a9/include/bsp/irq.h102
-rw-r--r--bsps/arm/realview-pbx-a9/include/tm27.h41
-rw-r--r--bsps/arm/rtl22xx/headers.am11
-rw-r--r--bsps/arm/rtl22xx/include/bsp.h226
-rw-r--r--bsps/arm/rtl22xx/include/bsp/irq.h71
-rw-r--r--bsps/arm/rtl22xx/include/lpc22xx.h475
-rw-r--r--bsps/arm/rtl22xx/include/tm27.h1
-rw-r--r--bsps/arm/smdk2410/headers.am14
-rw-r--r--bsps/arm/smdk2410/include/bsp.h80
-rw-r--r--bsps/arm/smdk2410/include/bsp/irq.h96
-rw-r--r--bsps/arm/smdk2410/include/s3c2400.h676
-rw-r--r--bsps/arm/smdk2410/include/s3c2410.h825
-rw-r--r--bsps/arm/smdk2410/include/s3c24xx.h17
-rw-r--r--bsps/arm/smdk2410/include/smc.h44
-rw-r--r--bsps/arm/smdk2410/include/tm27.h1
-rw-r--r--bsps/arm/stm32f4/headers.am29
-rw-r--r--bsps/arm/stm32f4/include/bsp.h54
-rw-r--r--bsps/arm/stm32f4/include/bsp/i2c.h96
-rw-r--r--bsps/arm/stm32f4/include/bsp/io.h416
-rw-r--r--bsps/arm/stm32f4/include/bsp/irq.h141
-rw-r--r--bsps/arm/stm32f4/include/bsp/rcc.h196
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32_i2c.h113
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32_usart.h110
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f10xxx_exti.h50
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f10xxx_gpio.h51
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f10xxx_rcc.h48
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f4.h258
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f4xxxx_adc.h320
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f4xxxx_exti.h64
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_flash.h83
-rw-r--r--bsps/arm/stm32f4/include/bsp/stm32f4xxxx_gpio.h39
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_otgfs.h445
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_pwr.h47
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_rcc.h289
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_syscfg.h108
-rwxr-xr-xbsps/arm/stm32f4/include/bsp/stm32f4xxxx_tim.h206
-rw-r--r--bsps/arm/stm32f4/include/bsp/usart.h45
-rw-r--r--bsps/arm/stm32f4/include/tm27.h1
-rw-r--r--bsps/arm/tms570/headers.am63
-rw-r--r--bsps/arm/tms570/include/bsp.h42
-rw-r--r--bsps/arm/tms570/include/bsp/irq.h160
-rw-r--r--bsps/arm/tms570/include/bsp/system-clocks.h62
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_adc.h626
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_ccmsr.h72
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_crc.h379
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_dcan.h941
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_dcc.h183
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_dma.h711
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_dmm.h557
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_efuse.h126
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_emacc.h285
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_emacm.h898
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_emif.h468
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_esm.h170
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_flash.h675
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_flex_ray.h618
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_gio.h324
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_htu.h333
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_i2c.h363
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_iomm.h235
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_lin.h594
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_mdio.h230
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_n2het.h332
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_pbist.h195
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_pcr.h120
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_pll.h298
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_pmm.h258
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_pom.h309
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_rti.h359
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_rtp.h227
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_sci.h450
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_spi.h918
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_stc.h158
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_sys.h695
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_sys2.h170
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_tcr.h84
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_tcram.h170
-rw-r--r--bsps/arm/tms570/include/bsp/ti_herc/reg_vim.h190
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-pinmux.h137
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-pins.h10
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-pom.h60
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-rti.h46
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-sci-driver.h65
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-sci.h45
-rw-r--r--bsps/arm/tms570/include/bsp/tms570-vim.h48
-rw-r--r--bsps/arm/tms570/include/bsp/tms570.h137
-rw-r--r--bsps/arm/tms570/include/bsp/tms570_hwinit.h31
-rw-r--r--bsps/arm/tms570/include/bsp/tms570_selftest.h214
-rw-r--r--bsps/arm/tms570/include/bsp/tms570_selftest_parity.h110
-rw-r--r--bsps/arm/tms570/include/bsp/tms570lc4357-pins.h1114
-rw-r--r--bsps/arm/tms570/include/bsp/tms570ls3137zwt-pins.h690
-rw-r--r--bsps/arm/tms570/include/tm27.h1
-rw-r--r--bsps/arm/xilinx-zynq/headers.am15
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp.h80
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/cadence-i2c-regs.h73
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/cadence-i2c.h35
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/i2c.h50
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/irq.h115
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/zynq-uart-regs.h150
-rw-r--r--bsps/arm/xilinx-zynq/include/bsp/zynq-uart.h67
-rw-r--r--bsps/arm/xilinx-zynq/include/tm27.h36
-rw-r--r--bsps/bfin/TLL6527M/headers.am7
-rw-r--r--bsps/bfin/TLL6527M/include/bsp.h129
-rw-r--r--bsps/bfin/TLL6527M/include/cplb.h47
-rw-r--r--bsps/bfin/TLL6527M/include/tm27.h50
-rw-r--r--bsps/bfin/bf537Stamp/headers.am6
-rw-r--r--bsps/bfin/bf537Stamp/include/bsp.h122
-rw-r--r--bsps/bfin/bf537Stamp/include/tm27.h1
-rw-r--r--bsps/bfin/eZKit533/headers.am7
-rw-r--r--bsps/bfin/eZKit533/include/bsp.h166
-rw-r--r--bsps/bfin/eZKit533/include/cplb.h47
-rw-r--r--bsps/bfin/eZKit533/include/tm27.h48
-rw-r--r--bsps/bfin/headers.am37
-rw-r--r--bsps/bfin/include/bf52x.h131
-rw-r--r--bsps/bfin/include/bsp/interrupt.h144
-rw-r--r--bsps/bfin/include/libcpu/bf533.h135
-rw-r--r--bsps/bfin/include/libcpu/bf537.h225
-rw-r--r--bsps/bfin/include/libcpu/cecRegs.h46
-rw-r--r--bsps/bfin/include/libcpu/coreTimerRegs.h29
-rw-r--r--bsps/bfin/include/libcpu/dmaRegs.h97
-rw-r--r--bsps/bfin/include/libcpu/ebiuRegs.h133
-rw-r--r--bsps/bfin/include/libcpu/ethernet.h54
-rw-r--r--bsps/bfin/include/libcpu/ethernetRegs.h419
-rw-r--r--bsps/bfin/include/libcpu/gpioRegs.h36
-rw-r--r--bsps/bfin/include/libcpu/interrupt.h80
-rw-r--r--bsps/bfin/include/libcpu/memoryRegs.h58
-rw-r--r--bsps/bfin/include/libcpu/mmu.h73
-rw-r--r--bsps/bfin/include/libcpu/mmuRegs.h54
-rw-r--r--bsps/bfin/include/libcpu/ppiRegs.h58
-rw-r--r--bsps/bfin/include/libcpu/rtcRegs.h65
-rw-r--r--bsps/bfin/include/libcpu/sicRegs.h43
-rw-r--r--bsps/bfin/include/libcpu/spi.h53
-rw-r--r--bsps/bfin/include/libcpu/spiRegs.h69
-rw-r--r--bsps/bfin/include/libcpu/sport.h2
-rw-r--r--bsps/bfin/include/libcpu/sportRegs.h111
-rw-r--r--bsps/bfin/include/libcpu/timerRegs.h45
-rw-r--r--bsps/bfin/include/libcpu/twi.h68
-rw-r--r--bsps/bfin/include/libcpu/twiRegs.h118
-rw-r--r--bsps/bfin/include/libcpu/uart.h135
-rw-r--r--bsps/bfin/include/libcpu/uartRegs.h70
-rw-r--r--bsps/bfin/include/libcpu/wdogRegs.h33
-rw-r--r--bsps/epiphany/epiphany_sim/headers.am10
-rw-r--r--bsps/epiphany/epiphany_sim/include/bsp.h65
-rw-r--r--bsps/epiphany/epiphany_sim/include/bsp/irq.h49
-rw-r--r--bsps/epiphany/epiphany_sim/include/tm27.h1
-rw-r--r--bsps/epiphany/headers.am5
-rw-r--r--bsps/epiphany/include/bsp/linker-symbols.h81
-rw-r--r--bsps/headers.am83
-rw-r--r--bsps/i386/headers.am20
-rw-r--r--bsps/i386/include/bsp/apic.h125
-rw-r--r--bsps/i386/include/bsp/irq.h96
-rw-r--r--bsps/i386/include/bsp/irq_asm.h45
-rw-r--r--bsps/i386/include/bsp/realmode_int.h97
-rw-r--r--bsps/i386/include/bsp/smp-imps.h245
-rw-r--r--bsps/i386/include/bsp/tty_drv.h104
-rw-r--r--bsps/i386/include/i386_io.h73
-rw-r--r--bsps/i386/include/libcpu/byteorder.h31
-rw-r--r--bsps/i386/include/libcpu/cpuModel.h51
-rw-r--r--bsps/i386/include/libcpu/page.h39
-rw-r--r--bsps/i386/include/uart.h191
-rw-r--r--bsps/i386/pc386/headers.am25
-rw-r--r--bsps/i386/pc386/include/bsp.h264
-rw-r--r--bsps/i386/pc386/include/bsp/bspimpl.h47
-rw-r--r--bsps/i386/pc386/include/bsp/exar17d15x.h55
-rw-r--r--bsps/i386/pc386/include/bsp/fb_default_mode.h25
-rw-r--r--bsps/i386/pc386/include/bsp/fb_vesa.h132
-rw-r--r--bsps/i386/pc386/include/bsp/rtd316.h77
-rw-r--r--bsps/i386/pc386/include/bsp/tblsizes.h24
-rw-r--r--bsps/i386/pc386/include/bsp/vbe3.h619
-rw-r--r--bsps/i386/pc386/include/crt.h94
-rw-r--r--bsps/i386/pc386/include/edid.h520
-rw-r--r--bsps/i386/pc386/include/rtems/kd.h111
-rw-r--r--bsps/i386/pc386/include/rtems/keyboard.h604
-rw-r--r--bsps/i386/pc386/include/rtems/ps2_drv.h79
-rw-r--r--bsps/i386/pc386/include/rtems/vgacons.h49
-rw-r--r--bsps/i386/pc386/include/tm27.h38
-rw-r--r--bsps/include/bsp/VME.h133
-rw-r--r--bsps/include/bsp/VMEDMA.h309
-rw-r--r--bsps/include/bsp/bootcard.h188
-rw-r--r--bsps/include/bsp/bspVmeDmaList.h140
-rw-r--r--bsps/include/bsp/console-polled.h43
-rw-r--r--bsps/include/bsp/console-termios.h117
-rw-r--r--bsps/include/bsp/default-initial-extension.h53
-rw-r--r--bsps/include/bsp/fatal.h153
-rw-r--r--bsps/include/bsp/fdt.h67
-rw-r--r--bsps/include/bsp/gpio.h955
-rw-r--r--bsps/include/bsp/irq-generic.h304
-rw-r--r--bsps/include/bsp/irq-info.h56
-rw-r--r--bsps/include/bsp/mm.h41
-rw-r--r--bsps/include/bsp/stackalloc.h94
-rw-r--r--bsps/include/bsp/u-boot.h66
-rw-r--r--bsps/include/bsp/uart-output-char.h60
-rw-r--r--bsps/include/bsp/utility.h156
-rw-r--r--bsps/include/bsp/vmeTsi148.h662
-rw-r--r--bsps/include/bsp/vmeTsi148DMA.h102
-rw-r--r--bsps/include/bsp/vmeUniverse.h1045
-rw-r--r--bsps/include/bsp/vmeUniverseDMA.h95
-rw-r--r--bsps/include/bsp/vme_am_defs.h198
-rw-r--r--bsps/include/libchip/am29lv160.h55
-rw-r--r--bsps/include/libchip/ata.h50
-rw-r--r--bsps/include/libchip/ata_internal.h323
-rw-r--r--bsps/include/libchip/cs8900.h761
-rw-r--r--bsps/include/libchip/disp_hcms29xx.h156
-rw-r--r--bsps/include/libchip/ds1375-rtc.h99
-rw-r--r--bsps/include/libchip/greth.h152
-rw-r--r--bsps/include/libchip/i2c-2b-eeprom.h74
-rw-r--r--bsps/include/libchip/i2c-ds1621.h81
-rw-r--r--bsps/include/libchip/i2c-sc620.h40
-rw-r--r--bsps/include/libchip/i82586var.h319
-rw-r--r--bsps/include/libchip/icm7170.h97
-rw-r--r--bsps/include/libchip/ide_ctrl.h35
-rw-r--r--bsps/include/libchip/ide_ctrl_cfg.h123
-rw-r--r--bsps/include/libchip/ide_ctrl_io.h186
-rw-r--r--bsps/include/libchip/if_dcreg.h1120
-rw-r--r--bsps/include/libchip/if_fxpvar.h203
-rw-r--r--bsps/include/libchip/m48t08.h87
-rw-r--r--bsps/include/libchip/mc146818a.h68
-rw-r--r--bsps/include/libchip/mc68681.h122
-rw-r--r--bsps/include/libchip/ns16550.h99
-rwxr-xr-xbsps/include/libchip/ns16550_p.h142
-rw-r--r--bsps/include/libchip/open_eth.h173
-rw-r--r--bsps/include/libchip/rtc.h80
-rw-r--r--bsps/include/libchip/serial.h235
-rw-r--r--bsps/include/libchip/sersupp.h19
-rw-r--r--bsps/include/libchip/smc91111.h558
-rw-r--r--bsps/include/libchip/smc91111exp.h26
-rw-r--r--bsps/include/libchip/sonic.h458
-rw-r--r--bsps/include/libchip/spi-flash-m25p40.h44
-rw-r--r--bsps/include/libchip/spi-fram-fm25l256.h44
-rw-r--r--bsps/include/libchip/spi-memdrv.h90
-rw-r--r--bsps/include/libchip/spi-sd-card.h86
-rw-r--r--bsps/include/libchip/wd80x3.h139
-rw-r--r--bsps/include/libchip/z85c30.h83
-rw-r--r--bsps/include/mpci.h56
-rw-r--r--bsps/include/rtems/umon.h68
-rw-r--r--bsps/include/rtems/zilog/z8036.h106
-rw-r--r--bsps/include/rtems/zilog/z8530.h97
-rw-r--r--bsps/include/shm_driver.h542
-rw-r--r--bsps/include/umon/cli.h147
-rw-r--r--bsps/include/umon/monlib.h265
-rw-r--r--bsps/include/umon/tfs.h214
-rw-r--r--bsps/lm32/headers.am18
-rw-r--r--bsps/lm32/include/bsp/irq.h47
-rw-r--r--bsps/lm32/include/bsp/milkymist_ac97.h76
-rw-r--r--bsps/lm32/include/bsp/milkymist_buttons.h59
-rw-r--r--bsps/lm32/include/bsp/milkymist_dmx.h68
-rw-r--r--bsps/lm32/include/bsp/milkymist_flash.h64
-rw-r--r--bsps/lm32/include/bsp/milkymist_gpio.h59
-rw-r--r--bsps/lm32/include/bsp/milkymist_ir.h59
-rw-r--r--bsps/lm32/include/bsp/milkymist_memcard.h32
-rw-r--r--bsps/lm32/include/bsp/milkymist_midi.h59
-rw-r--r--bsps/lm32/include/bsp/milkymist_pfpu.h72
-rw-r--r--bsps/lm32/include/bsp/milkymist_tmu.h98
-rw-r--r--bsps/lm32/include/bsp/milkymist_usbinput.h71
-rw-r--r--bsps/lm32/include/bsp/milkymist_versions.h53
-rw-r--r--bsps/lm32/include/bsp/milkymist_video.h90
-rw-r--r--bsps/lm32/lm32_evr/headers.am7
-rw-r--r--bsps/lm32/lm32_evr/include/bsp.h87
-rw-r--r--bsps/lm32/lm32_evr/include/system_conf.h180
-rw-r--r--bsps/lm32/lm32_evr/include/tm27.h38
-rw-r--r--bsps/lm32/milkymist/headers.am7
-rw-r--r--bsps/lm32/milkymist/include/bsp.h62
-rw-r--r--bsps/lm32/milkymist/include/system_conf.h329
-rw-r--r--bsps/lm32/milkymist/include/tm27.h1
-rw-r--r--bsps/m32c/m32cbsp/headers.am6
-rw-r--r--bsps/m32c/m32cbsp/include/bsp.h49
-rw-r--r--bsps/m32c/m32cbsp/include/tm27.h1
-rw-r--r--bsps/m68k/av5282/headers.am6
-rw-r--r--bsps/m68k/av5282/include/bsp.h97
-rw-r--r--bsps/m68k/av5282/include/tm27.h37
-rw-r--r--bsps/m68k/csb360/headers.am6
-rw-r--r--bsps/m68k/csb360/include/bsp.h189
-rw-r--r--bsps/m68k/csb360/include/tm27.h39
-rw-r--r--bsps/m68k/gen68340/headers.am11
-rw-r--r--bsps/m68k/gen68340/include/bsp.h81
-rw-r--r--bsps/m68k/gen68340/include/m340timer.h85
-rw-r--r--bsps/m68k/gen68340/include/m340uart.h162
-rw-r--r--bsps/m68k/gen68340/include/m68340.h145
-rw-r--r--bsps/m68k/gen68340/include/m68340.inc148
-rw-r--r--bsps/m68k/gen68340/include/m68349.inc410
-rw-r--r--bsps/m68k/gen68340/include/tm27.h1
-rw-r--r--bsps/m68k/gen68360/headers.am6
-rw-r--r--bsps/m68k/gen68360/include/bsp.h111
-rw-r--r--bsps/m68k/gen68360/include/tm27.h40
-rw-r--r--bsps/m68k/genmcf548x/headers.am10
-rw-r--r--bsps/m68k/genmcf548x/include/bsp.h134
-rw-r--r--bsps/m68k/genmcf548x/include/bsp/irq.h96
-rw-r--r--bsps/m68k/genmcf548x/include/tm27.h37
-rw-r--r--bsps/m68k/headers.am47
-rw-r--r--bsps/m68k/include/bsp/linker-symbols.h84
-rw-r--r--bsps/m68k/include/mcf5206/mcf5206e.h609
-rw-r--r--bsps/m68k/include/mcf5206/mcfmbus.h129
-rw-r--r--bsps/m68k/include/mcf5206/mcfuart.h109
-rw-r--r--bsps/m68k/include/mcf5223x/mcf5223x.h3362
-rw-r--r--bsps/m68k/include/mcf5225x/fec.h32
-rw-r--r--bsps/m68k/include/mcf5225x/mcf5225x.h3552
-rw-r--r--bsps/m68k/include/mcf5235/mcf5235.h2998
-rw-r--r--bsps/m68k/include/mcf5272/mcf5272.h699
-rw-r--r--bsps/m68k/include/mcf5282/mcf5282.h2407
-rw-r--r--bsps/m68k/include/mcf532x/mcf532x.h4483
-rw-r--r--bsps/m68k/include/mcf548x/MCD_dma.h362
-rw-r--r--bsps/m68k/include/mcf548x/MCD_progCheck.h5
-rw-r--r--bsps/m68k/include/mcf548x/MCD_tasksInit.h44
-rw-r--r--bsps/m68k/include/mcf548x/mcdma_glue.h106
-rw-r--r--bsps/m68k/include/mcf548x/mcf548x.h4056
-rw-r--r--bsps/m68k/include/mvme16x_hw.h274
-rw-r--r--bsps/m68k/mcf5206elite/headers.am10
-rw-r--r--bsps/m68k/mcf5206elite/include/bsp.h181
-rw-r--r--bsps/m68k/mcf5206elite/include/ds1307.h41
-rw-r--r--bsps/m68k/mcf5206elite/include/i2c.h243
-rw-r--r--bsps/m68k/mcf5206elite/include/i2cdrv.h35
-rw-r--r--bsps/m68k/mcf5206elite/include/nvram.h71
-rw-r--r--bsps/m68k/mcf5206elite/include/tm27.h35
-rw-r--r--bsps/m68k/mcf52235/headers.am6
-rw-r--r--bsps/m68k/mcf52235/include/bsp.h87
-rw-r--r--bsps/m68k/mcf52235/include/tm27.h35
-rw-r--r--bsps/m68k/mcf5225x/headers.am6
-rw-r--r--bsps/m68k/mcf5225x/include/bsp.h90
-rw-r--r--bsps/m68k/mcf5225x/include/tm27.h35
-rw-r--r--bsps/m68k/mcf5235/headers.am6
-rw-r--r--bsps/m68k/mcf5235/include/bsp.h70
-rw-r--r--bsps/m68k/mcf5235/include/tm27.h35
-rw-r--r--bsps/m68k/mcf5329/headers.am6
-rw-r--r--bsps/m68k/mcf5329/include/bsp.h70
-rw-r--r--bsps/m68k/mcf5329/include/tm27.h35
-rw-r--r--bsps/m68k/mrm332/headers.am7
-rw-r--r--bsps/m68k/mrm332/include/bsp.h90
-rw-r--r--bsps/m68k/mrm332/include/mrm332.h71
-rw-r--r--bsps/m68k/mrm332/include/tm27.h1
-rw-r--r--bsps/m68k/mvme147/headers.am6
-rw-r--r--bsps/m68k/mvme147/include/bsp.h117
-rw-r--r--bsps/m68k/mvme147/include/tm27.h38
-rw-r--r--bsps/m68k/mvme147s/headers.am6
-rw-r--r--bsps/m68k/mvme147s/include/bsp.h192
-rw-r--r--bsps/m68k/mvme147s/include/tm27.h38
-rw-r--r--bsps/m68k/mvme162/headers.am7
-rw-r--r--bsps/m68k/mvme162/include/bsp.h204
-rw-r--r--bsps/m68k/mvme162/include/page_table.h27
-rw-r--r--bsps/m68k/mvme162/include/tm27.h39
-rw-r--r--bsps/m68k/mvme167/headers.am7
-rw-r--r--bsps/m68k/mvme167/include/bsp.h318
-rw-r--r--bsps/m68k/mvme167/include/page_table.h43
-rw-r--r--bsps/m68k/mvme167/include/tm27.h38
-rw-r--r--bsps/m68k/uC5282/headers.am6
-rw-r--r--bsps/m68k/uC5282/include/bsp.h175
-rw-r--r--bsps/m68k/uC5282/include/tm27.h40
-rw-r--r--bsps/mips/csb350/headers.am10
-rw-r--r--bsps/mips/csb350/include/bsp.h47
-rw-r--r--bsps/mips/csb350/include/bsp/irq.h123
-rw-r--r--bsps/mips/csb350/include/tm27.h48
-rw-r--r--bsps/mips/headers.am15
-rw-r--r--bsps/mips/hurricane/headers.am11
-rw-r--r--bsps/mips/hurricane/include/bsp.h79
-rw-r--r--bsps/mips/hurricane/include/bsp/irq.h40
-rw-r--r--bsps/mips/hurricane/include/tm27.h1
-rw-r--r--bsps/mips/hurricane/include/usc.h32
-rw-r--r--bsps/mips/include/bsp/i8259.h269
-rw-r--r--bsps/mips/include/bsp/regs.h187
-rw-r--r--bsps/mips/include/libcpu/au1x00.h445
-rw-r--r--bsps/mips/include/libcpu/isr_entries.h39
-rw-r--r--bsps/mips/include/libcpu/rm5231.h19
-rw-r--r--bsps/mips/include/libcpu/tx3904.h45
-rw-r--r--bsps/mips/include/libcpu/tx4925.h107
-rw-r--r--bsps/mips/include/libcpu/tx4938.h191
-rw-r--r--bsps/mips/jmr3904/headers.am10
-rw-r--r--bsps/mips/jmr3904/include/bsp.h37
-rw-r--r--bsps/mips/jmr3904/include/bsp/irq.h68
-rw-r--r--bsps/mips/jmr3904/include/tm27.h52
-rw-r--r--bsps/mips/malta/headers.am11
-rw-r--r--bsps/mips/malta/include/bsp.h113
-rw-r--r--bsps/mips/malta/include/bsp/irq.h131
-rw-r--r--bsps/mips/malta/include/bsp/pci.h139
-rw-r--r--bsps/mips/malta/include/tm27.h1
-rw-r--r--bsps/mips/rbtx4925/headers.am10
-rw-r--r--bsps/mips/rbtx4925/include/bsp.h46
-rw-r--r--bsps/mips/rbtx4925/include/bsp/irq.h80
-rw-r--r--bsps/mips/rbtx4925/include/tm27.h1
-rw-r--r--bsps/mips/rbtx4938/headers.am10
-rw-r--r--bsps/mips/rbtx4938/include/bsp.h46
-rw-r--r--bsps/mips/rbtx4938/include/bsp/irq.h80
-rw-r--r--bsps/mips/rbtx4938/include/tm27.h1
-rw-r--r--bsps/moxie/moxiesim/headers.am6
-rw-r--r--bsps/moxie/moxiesim/include/bsp.h35
-rw-r--r--bsps/moxie/moxiesim/include/tm27.h1
-rw-r--r--bsps/nios2/nios2_iss/headers.am6
-rw-r--r--bsps/nios2/nios2_iss/include/bsp.h130
-rw-r--r--bsps/nios2/nios2_iss/include/tm27.h1
-rw-r--r--bsps/no_cpu/no_bsp/headers.am6
-rw-r--r--bsps/no_cpu/no_bsp/include/bsp.h41
-rw-r--r--bsps/no_cpu/no_bsp/include/tm27.h1
-rw-r--r--bsps/or1k/generic_or1k/headers.am12
-rw-r--r--bsps/or1k/generic_or1k/include/bsp.h45
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/generic_or1k.h118
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/irq.h45
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/uart.h42
-rw-r--r--bsps/or1k/generic_or1k/include/tm27.h1
-rw-r--r--bsps/or1k/headers.am6
-rw-r--r--bsps/or1k/include/bsp/cache_.h43
-rw-r--r--bsps/or1k/include/bsp/linker-symbols.h79
-rw-r--r--bsps/powerpc/beatnik/headers.am22
-rw-r--r--bsps/powerpc/beatnik/include/bsp.h297
-rw-r--r--bsps/powerpc/beatnik/include/bsp/VMEConfig.h114
-rw-r--r--bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h79
-rw-r--r--bsps/powerpc/beatnik/include/bsp/early_enet_link_status.h30
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gt_timer.h133
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gti2c_busdrv.h62
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gti2creg.h83
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gtintrreg.h257
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gtpcireg.h964
-rw-r--r--bsps/powerpc/beatnik/include/bsp/gtreg.h854
-rw-r--r--bsps/powerpc/beatnik/include/bsp/if_em_pub.h22
-rw-r--r--bsps/powerpc/beatnik/include/bsp/if_gfe_pub.h30
-rw-r--r--bsps/powerpc/beatnik/include/bsp/if_mve_pub.h422
-rw-r--r--bsps/powerpc/beatnik/include/bsp/irq.h133
-rw-r--r--bsps/powerpc/beatnik/include/tm27.h1
-rw-r--r--bsps/powerpc/gen5200/headers.am45
-rw-r--r--bsps/powerpc/gen5200/include/bsp.h266
-rw-r--r--bsps/powerpc/gen5200/include/bsp/ata.h338
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm.h370
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/bestcomm_api.h460
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/bestcomm_glue.h114
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/bestcomm_priv.h38
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/dma_image.capi.h84
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/dma_image.h472
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/include/mgt5200/mgt5200.h61
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/include/mgt5200/sdma.h153
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/include/ppctypes.h43
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/task_api/bestcomm_api_mem.h67
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/task_api/bestcomm_cntrl.h282
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/task_api/tasksetup_bdtable.h86
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm/task_api/tasksetup_general.h624
-rw-r--r--bsps/powerpc/gen5200/include/bsp/bestcomm_ops.h224
-rw-r--r--bsps/powerpc/gen5200/include/bsp/i2c.h243
-rw-r--r--bsps/powerpc/gen5200/include/bsp/i2cdrv.h35
-rw-r--r--bsps/powerpc/gen5200/include/bsp/irq.h212
-rw-r--r--bsps/powerpc/gen5200/include/bsp/mpc5200.h1369
-rw-r--r--bsps/powerpc/gen5200/include/bsp/mscan-base.h284
-rw-r--r--bsps/powerpc/gen5200/include/bsp/mscan.h127
-rw-r--r--bsps/powerpc/gen5200/include/bsp/nvram.h141
-rw-r--r--bsps/powerpc/gen5200/include/bsp/slicetimer.h69
-rw-r--r--bsps/powerpc/gen5200/include/bsp/u-boot-config.h20
-rw-r--r--bsps/powerpc/gen5200/include/tm27.h66
-rw-r--r--bsps/powerpc/gen83xx/headers.am13
-rw-r--r--bsps/powerpc/gen83xx/include/bsp.h163
-rw-r--r--bsps/powerpc/gen83xx/include/bsp/hwreg_vals.h381
-rw-r--r--bsps/powerpc/gen83xx/include/bsp/irq.h184
-rw-r--r--bsps/powerpc/gen83xx/include/bsp/tsec-config.h28
-rw-r--r--bsps/powerpc/gen83xx/include/bsp/u-boot-config.h21
-rw-r--r--bsps/powerpc/gen83xx/include/tm27.h62
-rw-r--r--bsps/powerpc/haleakala/headers.am11
-rw-r--r--bsps/powerpc/haleakala/include/bsp.h87
-rw-r--r--bsps/powerpc/haleakala/include/bsp/irq.h166
-rw-r--r--bsps/powerpc/haleakala/include/mmu_405.h77
-rw-r--r--bsps/powerpc/haleakala/include/tm27.h1
-rw-r--r--bsps/powerpc/headers.am101
-rw-r--r--bsps/powerpc/include/bsp/consoleIo.h38
-rw-r--r--bsps/powerpc/include/bsp/flashPgm.h209
-rw-r--r--bsps/powerpc/include/bsp/flashPgmPvt.h274
-rw-r--r--bsps/powerpc/include/bsp/irq_supp.h124
-rw-r--r--bsps/powerpc/include/bsp/linker-symbols.h139
-rw-r--r--bsps/powerpc/include/bsp/motorola.h69
-rw-r--r--bsps/powerpc/include/bsp/openpic.h378
-rw-r--r--bsps/powerpc/include/bsp/pci.h84
-rw-r--r--bsps/powerpc/include/bsp/pnp.h644
-rw-r--r--bsps/powerpc/include/bsp/residual.h356
-rw-r--r--bsps/powerpc/include/bsp/start.h84
-rw-r--r--bsps/powerpc/include/bsp/tictac.h78
-rw-r--r--bsps/powerpc/include/bsp/tsec.h380
-rw-r--r--bsps/powerpc/include/bsp/u-boot-board-info.h146
-rw-r--r--bsps/powerpc/include/bsp/uart.h190
-rw-r--r--bsps/powerpc/include/bsp/vectors.h493
-rw-r--r--bsps/powerpc/include/bsp/vpd.h143
-rw-r--r--bsps/powerpc/include/ictrl.h75
-rw-r--r--bsps/powerpc/include/libcpu/bat.h85
-rw-r--r--bsps/powerpc/include/libcpu/byteorder.h54
-rw-r--r--bsps/powerpc/include/libcpu/c_clock.h56
-rwxr-xr-xbsps/powerpc/include/libcpu/cpuIdent.h158
-rw-r--r--bsps/powerpc/include/libcpu/e500_mmu.h230
-rw-r--r--bsps/powerpc/include/libcpu/io.h139
-rw-r--r--bsps/powerpc/include/libcpu/irq.h199
-rw-r--r--bsps/powerpc/include/libcpu/mmu.h304
-rw-r--r--bsps/powerpc/include/libcpu/page.h66
-rw-r--r--bsps/powerpc/include/libcpu/pgtable.h144
-rw-r--r--bsps/powerpc/include/libcpu/powerpc-utility.h985
-rw-r--r--bsps/powerpc/include/libcpu/pte121.h265
-rw-r--r--bsps/powerpc/include/libcpu/raw_exception.h161
-rw-r--r--bsps/powerpc/include/libcpu/spr.h78
-rw-r--r--bsps/powerpc/include/libcpu/stackTrace.h8
-rw-r--r--bsps/powerpc/include/libcpu/vectors.h115
-rw-r--r--bsps/powerpc/include/mpc55xx/dspi.h128
-rw-r--r--bsps/powerpc/include/mpc55xx/edma.h329
-rw-r--r--bsps/powerpc/include/mpc55xx/emios.h197
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc551x.h4005
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc555x.h3383
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc556x.h4563
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc564xL.h20666
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc5668.h6721
-rw-r--r--bsps/powerpc/include/mpc55xx/fsl-mpc567x.h6630
-rw-r--r--bsps/powerpc/include/mpc55xx/mpc55xx.h155
-rw-r--r--bsps/powerpc/include/mpc55xx/reg-defs.h100
-rw-r--r--bsps/powerpc/include/mpc55xx/regs-edma.h710
-rw-r--r--bsps/powerpc/include/mpc55xx/regs-mmu.h200
-rw-r--r--bsps/powerpc/include/mpc55xx/regs.h88
-rw-r--r--bsps/powerpc/include/mpc55xx/siu.h313
-rw-r--r--bsps/powerpc/include/mpc55xx/watchdog.h68
-rw-r--r--bsps/powerpc/include/mpc5xx.h626
-rw-r--r--bsps/powerpc/include/mpc5xx/console.h34
-rw-r--r--bsps/powerpc/include/mpc8260.h1510
-rw-r--r--bsps/powerpc/include/mpc8260/console.h60
-rw-r--r--bsps/powerpc/include/mpc8260/cpm.h123
-rw-r--r--bsps/powerpc/include/mpc8260/mmu.h47
-rw-r--r--bsps/powerpc/include/mpc83xx/gtm.h67
-rw-r--r--bsps/powerpc/include/mpc83xx/mpc83xx.h1014
-rw-r--r--bsps/powerpc/include/mpc83xx/mpc83xx_i2cdrv.h68
-rw-r--r--bsps/powerpc/include/mpc83xx/mpc83xx_spidrv.h172
-rw-r--r--bsps/powerpc/include/mpc8xx.h1499
-rw-r--r--bsps/powerpc/include/mpc8xx/console.h32
-rw-r--r--bsps/powerpc/include/mpc8xx/cpm.h36
-rw-r--r--bsps/powerpc/include/mpc8xx/mmu.h47
-rw-r--r--bsps/powerpc/include/nvram.h167
-rw-r--r--bsps/powerpc/include/ppc4xx/ppc405ex.h191
-rw-r--r--bsps/powerpc/include/ppc4xx/ppc405gp.h214
-rw-r--r--bsps/powerpc/include/rtems/powerpc/cache.h38
-rw-r--r--bsps/powerpc/include/rtems/powerpc/debugmod.h124
-rw-r--r--bsps/powerpc/include/rtems/powerpc/powerpc.h644
-rw-r--r--bsps/powerpc/include/tty_drv.h63
-rw-r--r--bsps/powerpc/motorola_powerpc/headers.am11
-rw-r--r--bsps/powerpc/motorola_powerpc/include/bsp.h248
-rw-r--r--bsps/powerpc/motorola_powerpc/include/bsp/VMEConfig.h233
-rw-r--r--bsps/powerpc/motorola_powerpc/include/bsp/irq.h204
-rw-r--r--bsps/powerpc/motorola_powerpc/include/tm27.h64
-rw-r--r--bsps/powerpc/mpc55xxevb/headers.am15
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp.h104
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/console-esci.h57
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/console-generic.h81
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/console-linflex.h64
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/irq.h499
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/mpc55xx-config.h170
-rw-r--r--bsps/powerpc/mpc55xxevb/include/bsp/smsc9218i.h704
-rw-r--r--bsps/powerpc/mpc55xxevb/include/tm27.h1
-rw-r--r--bsps/powerpc/mpc8260ads/headers.am10
-rw-r--r--bsps/powerpc/mpc8260ads/include/bsp.h86
-rw-r--r--bsps/powerpc/mpc8260ads/include/bsp/irq.h193
-rw-r--r--bsps/powerpc/mpc8260ads/include/tm27.h46
-rw-r--r--bsps/powerpc/mvme3100/headers.am13
-rw-r--r--bsps/powerpc/mvme3100/include/bsp.h343
-rw-r--r--bsps/powerpc/mvme3100/include/bsp/VMEConfig.h132
-rw-r--r--bsps/powerpc/mvme3100/include/bsp/if_tsec_pub.h475
-rw-r--r--bsps/powerpc/mvme3100/include/bsp/irq.h137
-rw-r--r--bsps/powerpc/mvme3100/include/bsp/mpc8540_i2c_busdrv.h72
-rw-r--r--bsps/powerpc/mvme3100/include/tm27.h1
-rw-r--r--bsps/powerpc/mvme5500/headers.am21
-rw-r--r--bsps/powerpc/mvme5500/include/bsp.h206
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/GT64260TWSI.h20
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/GT64260eth.h140
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/GT64260ethreg.h879
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/VMEConfig.h67
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/VPD.h9
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/bspException.h99
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/bspMvme5500.h15
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/gtpcireg.h99
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/gtreg.h810
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/if_wmreg.h740
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/irq.h137
-rw-r--r--bsps/powerpc/mvme5500/include/bsp/pcireg.h386
-rw-r--r--bsps/powerpc/mvme5500/include/tm27.h66
-rw-r--r--bsps/powerpc/psim/headers.am11
-rw-r--r--bsps/powerpc/psim/include/bsp.h90
-rw-r--r--bsps/powerpc/psim/include/bsp/irq.h74
-rw-r--r--bsps/powerpc/psim/include/psim.h90
-rw-r--r--bsps/powerpc/psim/include/tm27.h66
-rw-r--r--bsps/powerpc/qemuppc/headers.am10
-rw-r--r--bsps/powerpc/qemuppc/include/bsp.h47
-rw-r--r--bsps/powerpc/qemuppc/include/bsp/irq.h76
-rw-r--r--bsps/powerpc/qemuppc/include/tm27.h1
-rw-r--r--bsps/powerpc/qoriq/headers.am24
-rw-r--r--bsps/powerpc/qoriq/include/asm/epapr_hcalls.h573
-rw-r--r--bsps/powerpc/qoriq/include/asm/fsl_hcalls.h653
-rw-r--r--bsps/powerpc/qoriq/include/bsp.h128
-rw-r--r--bsps/powerpc/qoriq/include/bsp/intercom.h125
-rw-r--r--bsps/powerpc/qoriq/include/bsp/irq.h401
-rw-r--r--bsps/powerpc/qoriq/include/bsp/mmu.h101
-rw-r--r--bsps/powerpc/qoriq/include/bsp/qoriq.h559
-rw-r--r--bsps/powerpc/qoriq/include/bsp/tsec-config.h36
-rw-r--r--bsps/powerpc/qoriq/include/bsp/uart-bridge.h72
-rw-r--r--bsps/powerpc/qoriq/include/tm27.h96
-rw-r--r--bsps/powerpc/qoriq/include/uapi/asm/epapr_hcalls.h98
-rw-r--r--bsps/powerpc/ss555/headers.am10
-rw-r--r--bsps/powerpc/ss555/include/bsp.h91
-rw-r--r--bsps/powerpc/ss555/include/bsp/irq.h66
-rw-r--r--bsps/powerpc/ss555/include/tm27.h56
-rw-r--r--bsps/powerpc/t32mppc/headers.am10
-rw-r--r--bsps/powerpc/t32mppc/include/bsp.h42
-rw-r--r--bsps/powerpc/t32mppc/include/bsp/irq.h52
-rw-r--r--bsps/powerpc/t32mppc/include/tm27.h1
-rw-r--r--bsps/powerpc/tqm8xx/headers.am13
-rw-r--r--bsps/powerpc/tqm8xx/include/bsp.h169
-rw-r--r--bsps/powerpc/tqm8xx/include/bsp/8xx_immap.h477
-rw-r--r--bsps/powerpc/tqm8xx/include/bsp/irq.h160
-rw-r--r--bsps/powerpc/tqm8xx/include/bsp/spi.h146
-rw-r--r--bsps/powerpc/tqm8xx/include/bsp/tqm.h51
-rw-r--r--bsps/powerpc/tqm8xx/include/tm27.h1
-rw-r--r--bsps/powerpc/virtex/headers.am13
-rw-r--r--bsps/powerpc/virtex/include/bsp.h84
-rw-r--r--bsps/powerpc/virtex/include/bsp/irq.h94
-rw-r--r--bsps/powerpc/virtex/include/bsp/opbintctrl.h75
-rw-r--r--bsps/powerpc/virtex/include/tm27.h1
-rw-r--r--bsps/powerpc/virtex/include/xiltemac.h375
-rw-r--r--bsps/powerpc/virtex/include/xparameters_dflt.h192
-rw-r--r--bsps/powerpc/virtex4/headers.am11
-rw-r--r--bsps/powerpc/virtex4/include/bsp.h83
-rw-r--r--bsps/powerpc/virtex4/include/bsp/irq.h79
-rw-r--r--bsps/powerpc/virtex4/include/bsp/mmu.h269
-rw-r--r--bsps/powerpc/virtex4/include/tm27.h1
-rw-r--r--bsps/powerpc/virtex5/headers.am11
-rw-r--r--bsps/powerpc/virtex5/include/bsp.h107
-rw-r--r--bsps/powerpc/virtex5/include/bsp/irq.h82
-rw-r--r--bsps/powerpc/virtex5/include/bsp/mmu.h287
-rw-r--r--bsps/powerpc/virtex5/include/tm27.h1
-rw-r--r--bsps/riscv/headers.am5
-rw-r--r--bsps/riscv/include/bsp/linker-symbols.h81
-rw-r--r--bsps/riscv/riscv_generic/headers.am10
-rw-r--r--bsps/riscv/riscv_generic/include/bsp.h73
-rw-r--r--bsps/riscv/riscv_generic/include/bsp/irq.h49
-rw-r--r--bsps/riscv/riscv_generic/include/tm27.h1
-rw-r--r--bsps/sh/gensh1/headers.am17
-rw-r--r--bsps/sh/gensh1/include/bsp.h86
-rw-r--r--bsps/sh/gensh1/include/rtems/score/iosh7032.h220
-rw-r--r--bsps/sh/gensh1/include/rtems/score/ispsh7032.h162
-rw-r--r--bsps/sh/gensh1/include/sh/sci.h82
-rw-r--r--bsps/sh/gensh1/include/sh/sh7_pfc.h115
-rw-r--r--bsps/sh/gensh1/include/sh/sh7_sci.h79
-rw-r--r--bsps/sh/gensh1/include/tm27.h1
-rw-r--r--bsps/sh/gensh2/headers.am19
-rw-r--r--bsps/sh/gensh2/include/bsp.h85
-rw-r--r--bsps/sh/gensh2/include/rtems/score/iosh7045.h322
-rw-r--r--bsps/sh/gensh2/include/rtems/score/ispsh7045.h208
-rw-r--r--bsps/sh/gensh2/include/sh/io_types.h84
-rw-r--r--bsps/sh/gensh2/include/sh/sci.h89
-rw-r--r--bsps/sh/gensh2/include/sh/sci_termios.h65
-rw-r--r--bsps/sh/gensh2/include/sh/sh7_pfc.h202
-rw-r--r--bsps/sh/gensh2/include/sh/sh7_sci.h88
-rw-r--r--bsps/sh/gensh2/include/tm27.h1
-rw-r--r--bsps/sh/gensh4/headers.am19
-rw-r--r--bsps/sh/gensh4/include/bsp.h92
-rw-r--r--bsps/sh/gensh4/include/rtems/score/iosh7750.h47
-rw-r--r--bsps/sh/gensh4/include/rtems/score/ipl.h73
-rw-r--r--bsps/sh/gensh4/include/rtems/score/ispsh7750.h62
-rw-r--r--bsps/sh/gensh4/include/rtems/score/sh4_regs.h51
-rw-r--r--bsps/sh/gensh4/include/rtems/score/sh7750_regs.h1613
-rw-r--r--bsps/sh/gensh4/include/sdram.h40
-rw-r--r--bsps/sh/gensh4/include/sh/sh4uart.h174
-rw-r--r--bsps/sh/gensh4/include/tm27.h59
-rw-r--r--bsps/sh/shsim/headers.am10
-rw-r--r--bsps/sh/shsim/include/bsp.h65
-rw-r--r--bsps/sh/shsim/include/bsp/syscall.h32
-rw-r--r--bsps/sh/shsim/include/tm27.h1
-rw-r--r--bsps/sparc/erc32/headers.am11
-rw-r--r--bsps/sparc/erc32/include/bsp.h184
-rw-r--r--bsps/sparc/erc32/include/bsp/irq.h48
-rw-r--r--bsps/sparc/erc32/include/erc32.h549
-rw-r--r--bsps/sparc/erc32/include/tm27.h85
-rw-r--r--bsps/sparc/headers.am75
-rw-r--r--bsps/sparc/include/ambapp.h376
-rw-r--r--bsps/sparc/include/ambapp_ids.h317
-rw-r--r--bsps/sparc/include/bsp/ahbstat.h76
-rw-r--r--bsps/sparc/include/bsp/apbuart.h60
-rw-r--r--bsps/sparc/include/bsp/apbuart_cons.h16
-rw-r--r--bsps/sparc/include/bsp/apbuart_termios.h60
-rw-r--r--bsps/sparc/include/bsp/b1553brm.h178
-rw-r--r--bsps/sparc/include/bsp/b1553rt.h79
-rw-r--r--bsps/sparc/include/bsp/canmux.h32
-rw-r--r--bsps/sparc/include/bsp/cons.h42
-rw-r--r--bsps/sparc/include/bsp/debug_defs.h45
-rw-r--r--bsps/sparc/include/bsp/genirq.h132
-rw-r--r--bsps/sparc/include/bsp/gnatcommon.h19
-rw-r--r--bsps/sparc/include/bsp/gpiolib.h94
-rw-r--r--bsps/sparc/include/bsp/gptimer.h30
-rw-r--r--bsps/sparc/include/bsp/gr1553b.h369
-rw-r--r--bsps/sparc/include/bsp/gr1553bc.h250
-rw-r--r--bsps/sparc/include/bsp/gr1553bc_list.h707
-rw-r--r--bsps/sparc/include/bsp/gr1553bm.h204
-rw-r--r--bsps/sparc/include/bsp/gr1553rt.h434
-rw-r--r--bsps/sparc/include/bsp/gr_701.h51
-rw-r--r--bsps/sparc/include/bsp/gr_cpci_gr740.h61
-rw-r--r--bsps/sparc/include/bsp/gr_leon4_n2x.h61
-rw-r--r--bsps/sparc/include/bsp/gr_rasta_adcdac.h52
-rw-r--r--bsps/sparc/include/bsp/gr_rasta_io.h52
-rw-r--r--bsps/sparc/include/bsp/gr_rasta_spw_router.h48
-rw-r--r--bsps/sparc/include/bsp/gr_rasta_tmtc.h103
-rw-r--r--bsps/sparc/include/bsp/gr_tmtc_1553.h55
-rw-r--r--bsps/sparc/include/bsp/gradcdac.h227
-rw-r--r--bsps/sparc/include/bsp/grascs.h92
-rw-r--r--bsps/sparc/include/bsp/grcan.h342
-rw-r--r--bsps/sparc/include/bsp/grctm.h171
-rw-r--r--bsps/sparc/include/bsp/greth.h157
-rw-r--r--bsps/sparc/include/bsp/grgpio.h25
-rw-r--r--bsps/sparc/include/bsp/griommu.h187
-rw-r--r--bsps/sparc/include/bsp/grpci.h31
-rw-r--r--bsps/sparc/include/bsp/grpci2.h65
-rw-r--r--bsps/sparc/include/bsp/grpci2dma.h263
-rw-r--r--bsps/sparc/include/bsp/grpwm.h127
-rw-r--r--bsps/sparc/include/bsp/grslink.h148
-rw-r--r--bsps/sparc/include/bsp/grspw.h168
-rw-r--r--bsps/sparc/include/bsp/grspw_pkt.h845
-rw-r--r--bsps/sparc/include/bsp/grspw_router.h505
-rw-r--r--bsps/sparc/include/bsp/grtc.h155
-rw-r--r--bsps/sparc/include/bsp/grtm.h245
-rw-r--r--bsps/sparc/include/bsp/i2cmst.h65
-rw-r--r--bsps/sparc/include/bsp/l2c.h201
-rw-r--r--bsps/sparc/include/bsp/l4stat.h91
-rw-r--r--bsps/sparc/include/bsp/mctrl.h26
-rw-r--r--bsps/sparc/include/bsp/memscrub.h172
-rw-r--r--bsps/sparc/include/bsp/network_interface_add.h47
-rw-r--r--bsps/sparc/include/bsp/occan.h165
-rw-r--r--bsps/sparc/include/bsp/pcif.h15
-rw-r--r--bsps/sparc/include/bsp/satcan.h142
-rw-r--r--bsps/sparc/include/bsp/spictrl.h126
-rw-r--r--bsps/sparc/include/bsp/spwcuc.h188
-rw-r--r--bsps/sparc/include/bsp/tlib.h202
-rw-r--r--bsps/sparc/include/drvmgr/ambapp_bus.h142
-rw-r--r--bsps/sparc/include/drvmgr/ambapp_bus_grlib.h36
-rw-r--r--bsps/sparc/include/drvmgr/bspcommon.h28
-rw-r--r--bsps/sparc/include/drvmgr/leon2_amba_bus.h95
-rw-r--r--bsps/sparc/include/grlib.h164
-rw-r--r--bsps/sparc/include/libcpu/access.h50
-rw-r--r--bsps/sparc/leon2/headers.am12
-rw-r--r--bsps/sparc/leon2/include/bsp.h220
-rw-r--r--bsps/sparc/leon2/include/bsp/at697_pci.h26
-rw-r--r--bsps/sparc/leon2/include/bsp/irq.h28
-rw-r--r--bsps/sparc/leon2/include/leon.h423
-rw-r--r--bsps/sparc/leon2/include/tm27.h84
-rw-r--r--bsps/sparc/leon3/headers.am13
-rw-r--r--bsps/sparc/leon3/include/amba.h48
-rw-r--r--bsps/sparc/leon3/include/bsp.h250
-rw-r--r--bsps/sparc/leon3/include/bsp/irq.h55
-rw-r--r--bsps/sparc/leon3/include/bsp/watchdog.h49
-rw-r--r--bsps/sparc/leon3/include/leon.h511
-rw-r--r--bsps/sparc/leon3/include/tm27.h84
-rw-r--r--bsps/sparc64/headers.am54
-rw-r--r--bsps/sparc64/include/arch/arch.h61
-rw-r--r--bsps/sparc64/include/arch/boot.h98
-rw-r--r--bsps/sparc64/include/arch/mm/cache_spec.h58
-rw-r--r--bsps/sparc64/include/arch/mm/frame.h47
-rw-r--r--bsps/sparc64/include/arch/mm/mmu.h48
-rw-r--r--bsps/sparc64/include/arch/mm/page.h84
-rw-r--r--bsps/sparc64/include/arch/mm/sun4u/frame.h87
-rw-r--r--bsps/sparc64/include/arch/mm/sun4u/mmu.h123
-rw-r--r--bsps/sparc64/include/arch/mm/sun4u/page.h84
-rw-r--r--bsps/sparc64/include/arch/mm/sun4u/tlb.h693
-rw-r--r--bsps/sparc64/include/arch/mm/sun4u/tte.h104
-rw-r--r--bsps/sparc64/include/arch/mm/tlb.h48
-rw-r--r--bsps/sparc64/include/arch/mm/tte.h47
-rw-r--r--bsps/sparc64/include/arch/regdef.h67
-rw-r--r--bsps/sparc64/include/arch/stack.h72
-rw-r--r--bsps/sparc64/include/arch/sun4u/arch.h47
-rw-r--r--bsps/sparc64/include/asm.h13
-rw-r--r--bsps/sparc64/include/boot/align.h48
-rw-r--r--bsps/sparc64/include/boot/balloc.h52
-rw-r--r--bsps/sparc64/include/boot/gentypes.h47
-rw-r--r--bsps/sparc64/include/boot/main.h75
-rw-r--r--bsps/sparc64/include/boot/ofw.h117
-rw-r--r--bsps/sparc64/include/boot/ofw_tree.h61
-rw-r--r--bsps/sparc64/include/boot/ofwarch.h41
-rw-r--r--bsps/sparc64/include/boot/register.h39
-rw-r--r--bsps/sparc64/include/boot/stack.h36
-rw-r--r--bsps/sparc64/include/boot/types.h44
-rw-r--r--bsps/sparc64/include/genarch/ofw/ofw_tree.h88
-rw-r--r--bsps/sparc64/include/kernel/align.h59
-rw-r--r--bsps/sparc64/include/traptable.h21
-rw-r--r--bsps/sparc64/niagara/headers.am6
-rw-r--r--bsps/sparc64/niagara/include/bsp.h41
-rw-r--r--bsps/sparc64/niagara/include/tm27.h1
-rw-r--r--bsps/sparc64/usiii/headers.am6
-rw-r--r--bsps/sparc64/usiii/include/bsp.h42
-rw-r--r--bsps/sparc64/usiii/include/tm27.h1
-rw-r--r--bsps/v850/gdbv850sim/headers.am10
-rw-r--r--bsps/v850/gdbv850sim/include/bsp.h35
-rw-r--r--bsps/v850/gdbv850sim/include/bsp/syscall.h47
-rw-r--r--bsps/v850/gdbv850sim/include/tm27.h1
1217 files changed, 381032 insertions, 0 deletions
diff --git a/bsps/arm/altera-cyclone-v/headers.am b/bsps/arm/altera-cyclone-v/headers.am
new file mode 100644
index 0000000000..f63ee38854
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/headers.am
@@ -0,0 +1,45 @@
+## This file was generated by "./boostrap -H".
+
+include_HEADERS =
+include_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp.h
+include_HEADERS += include/bspopts.h
+include_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/tm27.h
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS =
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_hwlibs_ver.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_i2c.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_interrupt_common.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_mpu_registers.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_qspi_private.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/alt_reset_manager.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/hwlib.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/i2cdrv.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/irq.h
+
+include_bsp_socaldir = $(includedir)/bsp/socal
+include_bsp_socal_HEADERS =
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_acpidmap.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_clkmgr.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmanonsecure.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmasecure.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_gpio.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_i2c.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_l3.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspi.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspidata.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_rstmgr.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sdr.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sysmgr.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/alt_uart.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/hps.h
+include_bsp_socal_HEADERS += ../../../../../../bsps/arm/altera-cyclone-v/include/bsp/socal/socal.h
diff --git a/bsps/arm/altera-cyclone-v/include/bsp.h b/bsps/arm/altera-cyclone-v/include/bsp.h
new file mode 100644
index 0000000000..4118823958
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <info@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H
+#define LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H
+
+#include <bspopts.h>
+
+#define BSP_FEATURE_IRQ_EXTENSION
+
+#ifndef ASM
+
+#include <rtems.h>
+
+#include <bsp/default-initial-extension.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define BSP_ARM_A9MPCORE_SCU_BASE 0xFFFEC000
+
+#define BSP_ARM_GIC_CPUIF_BASE ( BSP_ARM_A9MPCORE_SCU_BASE + 0x00000100 )
+
+#define BSP_ARM_A9MPCORE_GT_BASE ( BSP_ARM_A9MPCORE_SCU_BASE + 0x00000200 )
+
+#define BSP_ARM_GIC_DIST_BASE ( BSP_ARM_A9MPCORE_SCU_BASE + 0x00001000 )
+
+#define BSP_ARM_L2C_310_BASE 0xfffef000
+
+#define BSP_ARM_L2C_310_ID 0x410000c9
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ASM */
+
+#endif /* LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h
new file mode 100644
index 0000000000..bca6f63e00
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h
@@ -0,0 +1,1555 @@
+/*
+ * Altera - SoC UART Manager
+ */
+
+/*****************************************************************************
+ *
+ * Copyright 2013 Altera Corporation. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+ *
+ *****************************************************************************/
+
+#ifndef __ALT_16550_UART_H__
+#define __ALT_16550_UART_H__
+
+#include "hwlib.h"
+#include "alt_clock_manager.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*!
+ * \addtogroup UART UART Driver API
+ *
+ * This module defines the Universal Asynchronous Receiver/Transmitter (UART)
+ * API for accessing and using the UART resources. The API allows for general
+ * control of a 16550 compatible UART controller.
+ *
+ * This implementation can control the following UARTs:
+ * * SoCFPGA On-board UARTs
+ * * Altera 16550 Compatible Soft IP UART
+ *
+ * The following reference materials were used in the design of this API:
+ * * Synopsys&reg; DesignWare DW_apb_uart Databook v3.10a
+ *
+ * @{
+ */
+
+/*!
+ * \addtogroup UART_BASIC UART Basic
+ *
+ * This group of APIs provides basic access to the UART to initialize,
+ * uninitialize, read, write, and reset the UART.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the list of UARTs available on the system.
+ */
+typedef enum ALT_16550_DEVICE_e
+{
+ /*!
+ * This option selects UART0 in the SoC FPGA.
+ */
+ ALT_16550_DEVICE_SOCFPGA_UART0 = 0,
+
+ /*!
+ * This option selects UART1 in the SoC FPGA.
+ */
+ ALT_16550_DEVICE_SOCFPGA_UART1 = 1,
+
+ /*!
+ * This option selects an Altera 16550 Compatible soft IP UART. The memory
+ * location of the device must be provided as part of the initialization.
+ */
+ ALT_16550_DEVICE_ALTERA_16550_UART = 0x100
+}
+ALT_16550_DEVICE_t;
+
+/*!
+ * This structure is used to represent a handle to a specific UART on the
+ * system. The internal members are undocumented and should be not altered
+ * outside of this API.
+ */
+typedef struct ALT_16550_HANDLE_s
+{
+ ALT_16550_DEVICE_t device;
+ void * location;
+ alt_freq_t clock_freq;
+ uint32_t data;
+ uint32_t fcr;
+}
+ALT_16550_HANDLE_t;
+
+/*!
+ * Performs the initialization steps needed by the UART. This should be the
+ * first API call made when accessing a particular UART
+ *
+ * The default UART setting is 8 databits, no parity, 1 stopbit, and 57600
+ * baud.
+ *
+ * For the SoCFPGA UARTs, The ALT_CLK_L4_SP clock needs to be setup before
+ * initialization.
+ *
+ * \param device
+ * The UART device identifier.
+ *
+ * \param location
+ * The memory of the location for the given UART. For SoCFPGA
+ * UARTs, this parameter is ignored.
+ *
+ * \param clock_freq
+ * The clock frequency of the serial clock for the given UART.
+ * For SoCFPGA UARTs, this paramter is ignored.
+ *
+ * \param handle
+ * [out] A pointer to a handle that will represent the UART. This
+ * handle should subsequently be used when calling other UART
+ * APIs.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device identifier is invalid.
+ * \retval ALT_E_BAD_CLK The required clock is not yet setup.
+ */
+ALT_STATUS_CODE alt_16550_init(ALT_16550_DEVICE_t device,
+ void * location,
+ alt_freq_t clock_freq,
+ ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Performs the uninitialization steps for the UART. This should be the last
+ * API call made to cleanup the UART.
+ *
+ * After calling this function, the handle will need to be initialized again
+ * before being used by calling alt_16550_init().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_uninit(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Resets the UART to the default configuration. The UART will be reset and
+ * reinitialized.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_reset(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Starts the UART after all configuration has been completed.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_enable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Stops the UART. While UART configuration can be done while enabled, it is
+ * not recommended.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_disable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Reads a single character from the UART receiver buffer. This API should
+ * only be used when FIFOs are disabled.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param item
+ * [out] Pointer to an output parameter that contains the in
+ * receiver buffer of the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_read(ALT_16550_HANDLE_t * handle,
+ char * item);
+
+/*!
+ * Writes a single character to the UART transmitter buffer. This API should
+ * only be used when FIFOs are disabled.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param item
+ * The character to write to the transmitter buffer of the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_write(ALT_16550_HANDLE_t * handle,
+ char item);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup UART_FIFO UART FIFO Interface
+ *
+ * This group of APIs provides access, configuration, and control of the UART
+ * FIFO. The FIFO allows the UART to buffer received data and data to be
+ * transmitted.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the receiver FIFO level conditions that
+ * will trigger the receiver FIFO to issue a receiver FIFO full event.
+ */
+typedef enum ALT_16550_FIFO_TRIGGER_RX_e
+{
+ /*!
+ * 1 or more character(s) in the receiver FIFO will trigger an event.
+ */
+ ALT_16550_FIFO_TRIGGER_RX_ANY = 0,
+
+ /*!
+ * 25% or higher capacity usage in the receiver FIFO will trigger an
+ * event.
+ */
+ ALT_16550_FIFO_TRIGGER_RX_QUARTER_FULL = 1,
+
+ /*!
+ * 50% or higher capacity usage in the receiver FIFO will trigger an
+ * event.
+ */
+ ALT_16550_FIFO_TRIGGER_RX_HALF_FULL = 2,
+
+ /*!
+ * 2 characters less than the receiver FIFO capacity will trigger an
+ * event.
+ */
+ ALT_16550_FIFO_TRIGGER_RX_ALMOST_FULL = 3
+}
+ALT_16550_FIFO_TRIGGER_RX_t;
+
+/*!
+ * This type definition enumerates the transmitter FIFO level conditions that
+ * will trigger the transmitter FIFO to issue a transmitter FIFO empty event.
+ */
+typedef enum ALT_16550_FIFO_TRIGGER_TX_e
+{
+ /*!
+ * Transmitter FIFO being completely empty will trigger an event.
+ */
+ ALT_16550_FIFO_TRIGGER_TX_EMPTY = 0,
+
+ /*!
+ * 2 or less character(s) in the transmitter FIFO will trigger an event.
+ */
+ ALT_16550_FIFO_TRIGGER_TX_ALMOST_EMPTY = 1,
+
+ /*!
+ * 25% or less capacity usage in the transmitter FIFO will trigger an
+ * event.
+ */
+ ALT_16550_FIFO_TRIGGER_TX_QUARTER_FULL = 2,
+
+ /*!
+ * 50% or less capacity usage in the transmitter FIFO will trigger an
+ * event.
+ */
+ ALT_16550_FIFO_TRIGGER_TX_HALF_FULL = 3
+}
+ALT_16550_FIFO_TRIGGER_TX_t;
+
+/*!
+ * Enables FIFO on the UART. This will enable both the receiver FIFO and
+ * transmitter FIFO. Both FIFOs will be cleared.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_enable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables FIFOs on the UART. This will disable both the receiver FIFO and
+ * transmitter FIFO. Any data left in the FIFOs will be lost.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_disable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Reads the given buffer from the receiver FIFO in the UART.
+ *
+ * The available characters in the FIFO can be determined by a few ways. Users
+ * can determine the number of items by calling alt_16550_fifo_level_get_rx().
+ *
+ * Another way is by using the RX trigger and RX interrupt. First determine the
+ * RX FIFO size by calling alt_16550_fifo_size_get_rx(). Then set the desired
+ * trigger level by calling alt_16550_fifo_trigger_set_rx(). Calculate the
+ * triggering point by applying trigger description on the FIFO size. Enable RX
+ * interrupts by calling alt_16550_int_enable_rx(). When the RX interrupt fires
+ * due to the ALT_16550_INT_STATUS_RX_DATA condition, the calculated triggering
+ * point value can be used to determine the RX FIFO level. If the interrupt
+ * fires due to the ALT_16550_INT_STATUS_RX_TIMEOUT, the RX FIFO can be
+ * completely emptied by repeatedly polling the Line Status
+ * ALT_16550_LINE_STATUS_DR condition by calling alt_16550_line_status_get().
+ * These steps are necessary if the UART does not implement FIFO level query
+ * functionality. As of 13.0sp1, this applies to the Altera 16550 Compatible
+ * Soft UART.
+ *
+ * Reading more data than that which is available can result in invalid data
+ * appearing like valid data.
+ *
+ * The FIFO must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param buffer
+ * [out] Pointer to a buffer where the specified count of
+ * characters from the receiver FIFO will be copied to.
+ *
+ * \param count
+ * The count of characters from the receiver FIFO to be copied.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_read(ALT_16550_HANDLE_t * handle,
+ char * buffer,
+ size_t count);
+
+/*!
+ * Writes the given buffer to the transmitter FIFO in the UART.
+ *
+ * The available space in the FIFO can be determined by a few ways. Users can
+ * determine the number of items by calculating the FIFO capacity minus the
+ * FIFO level. This can be done by calling alt_16550_fifo_size_get_tx() and
+ * alt_16550_fifo_level_get_tx() respectively.
+ *
+ * Another way is by using the TX trigger and TX interrupt. First determine the
+ * TX FIFO size by calling alt_16550_fifo_size_get_tx(). The set the desired
+ * trigger level by calling alt_16550_fifo_trigger_set_tx(). Calculate the
+ * triggering point by applying the trigger description on the FIFO size.
+ * Enable TX interrupts by calling alt_16550_int_enable_tx(). When the TX
+ * interrupt fires, calculate the empty entries in the FIFO by subtracting the
+ * TX FIFO size and the calculated value. These steps are necessary if the UART
+ * does not implement FIFO level query functionality. As of 13.0sp1, this
+ * applies to the Altera 16550 Compatible Soft UART.
+ *
+ * Writing more data that there is space can result in data lost due to
+ * overflowing.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param buffer
+ * Pointer to a buffer from where the specified count of
+ * characters will be copied to the transmitter FIFO.
+ *
+ * \param count
+ * The count of characters from the given buffer to be copied.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_write(ALT_16550_HANDLE_t * handle,
+ const char * buffer,
+ size_t count);
+
+/*!
+ * Clears the contents of the receiver FIFO. Any characters which were
+ * previously contained in that FIFO will be discarded.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_clear_rx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Clears the contents of the transmitter FIFO. Any characters which were
+ * previously contained in that FIFO will be discarded.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_clear_tx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Clears the contents of the receiver and transmitter FIFO. Any characters
+ * which were previously contained on those FIFOs will be discarded.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_clear_all(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Queries the size of the receiver FIFO.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param size
+ * [out] Pointer to an output parameter that contains the size of
+ * the receiver FIFO.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_size_get_rx(ALT_16550_HANDLE_t * handle,
+ uint32_t * size);
+
+/*!
+ * Queries the size of the transmitter FIFO.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param size
+ * [out] Pointer to an output parameter that contains the size of
+ * the transmitter FIFO.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_size_get_tx(ALT_16550_HANDLE_t * handle,
+ uint32_t * size);
+
+/*!
+ * Queries the current level of the receiver FIFO.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * For the Altera 16550 Compatible UART, it may not be possible to read the
+ * FIFO level and this function may always report 0. For more information on
+ * interacting with the FIFO in this situation, see documentation for
+ * alt_16550_fifo_read().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param level
+ * [out] Pointer to an output parameter that contains the level
+ * or number of characters in the receiver FIFO.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_level_get_rx(ALT_16550_HANDLE_t * handle,
+ uint32_t * level);
+
+/*!
+ * Queries the current level of the transmitter FIFO.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * For the Altera 16550 Compatible UART, it may not be possible to read the
+ * FIFO level and this function may always report 0. For more information on
+ * interacting with the FIFO in this situation, see documentation for
+ * alt_16550_fifo_write().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param level
+ * [out] Pointer to an output parameter that contains the level
+ * or number of characters in the transmitter FIFO.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_level_get_tx(ALT_16550_HANDLE_t * handle,
+ uint32_t * level);
+
+/*!
+ * Sets the receiver FIFO level which will trigger the receiver FIFO to issue
+ * receiver FIFO full event. For the list of available receiver FIFO trigger
+ * levels, see the documentation for ALT_16550_FIFO_TRIGGER_RX_t.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param trigger
+ * The level of the receiver FIFO which is needed to trigger a
+ * receiver FIFO full event.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_trigger_set_rx(ALT_16550_HANDLE_t * handle,
+ ALT_16550_FIFO_TRIGGER_RX_t trigger);
+
+/*!
+ * Sets the transmitter FIFO level which will trigger the transmitter FIFO to
+ * transmitter FIFO empty event. For the list of available transmitter FIFO
+ * trigger levels, see the documentation for ALT_16550_FIFO_TRIGGER_TX_t.
+ *
+ * The FIFOs must first be enabled before calling this function by calling
+ * alt_16550_fifo_enable().
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param trigger
+ * The level of the transmitter FIFO which is needed to trigger a
+ * transmitter FIFO empty event.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_fifo_trigger_set_tx(ALT_16550_HANDLE_t * handle,
+ ALT_16550_FIFO_TRIGGER_TX_t trigger);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup UART_BAUD UART Baudrate Interface
+ *
+ * This group of APIs allows for the configuration of the UART's baudrate
+ * generation related functions.
+ *
+ * The UART baudrate is determined by dividing the ALT_CLK_L4_SP clock with
+ * the configured divisor.
+ *
+ * @{
+ */
+
+/*!
+ * This enumeration lists out the common baudrates used with modem and serial
+ * ports. Not every baudrate is available for the UART due to the limits of
+ * the serial clock frequency and divisor value.
+ */
+typedef enum ALT_16550_BAUDRATE_e
+{
+ ALT_16550_BAUDRATE_50 = 50, /*!< 50 bps baudrate. */
+ ALT_16550_BAUDRATE_75 = 75, /*!< 75 bps baudrate. */
+ ALT_16550_BAUDRATE_150 = 150, /*!< 150 bps baudrate. */
+ ALT_16550_BAUDRATE_300 = 300, /*!< 300 bps baudrate. */
+ ALT_16550_BAUDRATE_600 = 600, /*!< 600 bps baudrate. */
+ ALT_16550_BAUDRATE_900 = 900, /*!< 900 bps baudrate. */
+ ALT_16550_BAUDRATE_1200 = 1200, /*!< 1200 bps baudrate. */
+ ALT_16550_BAUDRATE_1800 = 1800, /*!< 1800 bps baudrate. */
+ ALT_16550_BAUDRATE_2400 = 2400, /*!< 2400 bps baudrate. */
+ ALT_16550_BAUDRATE_3600 = 3600, /*!< 3600 bps baudrate. */
+ ALT_16550_BAUDRATE_4800 = 4800, /*!< 4800 bps baudrate. */
+ ALT_16550_BAUDRATE_7200 = 7200, /*!< 7200 bps baudrate. */
+ ALT_16550_BAUDRATE_9600 = 9600, /*!< 9600 bps baudrate. */
+ ALT_16550_BAUDRATE_14400 = 14400, /*!< 14400 bps baudrate. */
+ ALT_16550_BAUDRATE_19200 = 19200, /*!< 19200 bps baudrate. */
+ ALT_16550_BAUDRATE_28800 = 28800, /*!< 28800 bps baudrate. */
+ ALT_16550_BAUDRATE_38400 = 38400, /*!< 38400 bps baudrate. */
+ ALT_16550_BAUDRATE_57600 = 57600, /*!< 57600 bps baudrate. */
+ ALT_16550_BAUDRATE_115200 = 115200 /*!< 115200 bps baudrate. */
+}
+ALT_16550_BAUDRATE_t;
+
+/*!
+ * Gets the baudrate for the UART.
+ *
+ * This is done by calculating the baudrate from the divisor and the serial
+ * clock. The reported baudrate may not correspond exactly to the request
+ * baudrate.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param baudrate
+ * [out] Pointer to an output paramter that contains the current
+ * baudrate of the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_baudrate_get(ALT_16550_HANDLE_t * handle,
+ uint32_t * baudrate);
+
+/*!
+ * Sets the baudrate for the UART. This change will take effect when the UART
+ * moves from disabled to enabled.
+ *
+ * This is done by calculating the correct divisor using the request baudrate
+ * and the known serial clock.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param baudrate
+ * The requested baudrate for the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ * \retval ALT_E_ARG_RANGE The given baudrate is not possible due to
+ * limitations of the baudrate divisor and/or
+ * serial clock.
+ */
+ALT_STATUS_CODE alt_16550_baudrate_set(ALT_16550_HANDLE_t * handle,
+ uint32_t baudrate);
+
+/*!
+ * Gets the baudrate divisor for the UART.
+ *
+ * The baudrate is determined by the following formula:
+ * * Baudrate = (serial clock frequency) / (16 * divisor)
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param divisor
+ * [out] Pointer to an output parameter that contains the current
+ * divisor used for baudrate generation.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_divisor_get(ALT_16550_HANDLE_t * handle,
+ uint32_t * divisor);
+
+/*!
+ * Sets the baudrate divisor for the UART. This change will take effect when
+ * the UART moves from disabled to enabled.
+ *
+ * The baudrate is determined by the following formula:
+ * * Baudrate = (serial clock frequency) / (16 * divisor)
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param divisor
+ * The specified divisor value to use for baudrate generation.
+ * Valid values are 1 - 65535.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART identifier is invalid or the
+ * specified divisor is not supported by the
+ * UART.
+ */
+ALT_STATUS_CODE alt_16550_divisor_set(ALT_16550_HANDLE_t * handle,
+ uint32_t divisor);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup UART_INT UART Interrupt Interface
+ *
+ * This group of APIs provides access, configuration, and control of the
+ * UART interrupts.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the different interrupt conditions that can
+ * be generated by the UART controller.
+ *
+ * Interrupts are listed in highest to lowest priority order.
+ */
+typedef enum ALT_16550_INT_STATUS_e
+{
+ /*!
+ * This interrupt signals that a overrun, parity, or framing error
+ * occurred, or a break event occured. The interrupt is cleared by reading
+ * the line status by calling alt_16550_line_status_get() or by disabling
+ * line status interrupts by calling alt_16550_int_disable_line().
+ */
+ ALT_16550_INT_STATUS_LINE = 0x6,
+
+ /*!
+ * This interrupt signals that some data is available to be read from the
+ * UART. The definition of some depends on whether FIFOs are enabled or
+ * not.
+ *
+ * If FIFOs are disabled, this interrupt signals that the receiver
+ * contains data. In this case, the interrupt is cleared by reading the
+ * data from the UART by calling alt_16550_read().
+ *
+ * If FIFOs are enabled, this interrupt signals that the receiver FIFO
+ * level is above the receiver trigger level specified. In this case, the
+ * interrupt is cleared by reading a sufficiently large buffer from the
+ * receiver FIFO such that the FIFO is filled below the receiver trigger
+ * level specified by calling alt_16550_fifo_read() or by adjusting the
+ * receiver trigger level appropriately by calling
+ * alt_16550_fifo_trigger_set_rx().
+ *
+ * In either case, this interrupt can also be cleared by disabling
+ * receiver interrupts by calling alt_16550_int_disable_rx().
+ */
+ ALT_16550_INT_STATUS_RX_DATA = 0x4,
+
+ /*!
+ * This interrupt signals that data is available in the receiver FIFO and
+ * that there has been no activity with the receiver FIFO for the last 4
+ * character frames. In essence, the receiver FIFO has temporarily settled
+ * thus it may be a good time to empty the receiver FIFO. This interrupt
+ * is only available if FIFOs are enabled. The interrupt is cleared by
+ * reading from the receiver FIFO by calling alt_16550_fifo_read() or by
+ * disabling receiver interrupts by calling alt_16550_int_disable_rx().
+ */
+ ALT_16550_INT_STATUS_RX_TIMEOUT = 0xC,
+
+ /*!
+ * This interrupt signals that the transmitter is idling. The definition
+ * of idling depends on whether FIFOs are enabled or not.
+ *
+ * If FIFOs are disabled, this interrupt signals that the transmitter
+ * shift register is empty. In this case, the interrupt is cleared by
+ * writing data to the UART by calling alt_16550_write().
+ *
+ * If FIFO are enabled, this interrupt signals that the transmitter FIFO
+ * level is below the transmitter trigger level specified. In this case,
+ * the interrupt is cleared by writing a sufficiently large buffer to the
+ * transmitter FIFO such that the FIFO is filled above the transmitter
+ * trigger level specified by calling alt_16550_fifo_write() or by
+ * adjusting the transmitter trigger level appropriately by calling
+ * alt_16550_fifo_trigger_set_tx().
+ *
+ * In either case, this interrupt can also be cleared by disabling
+ * transmitter interrupts by calling alt_16550_int_disable_tx().
+ */
+ ALT_16550_INT_STATUS_TX_IDLE = 0x2,
+
+ /*!
+ * Modem status interrupt pending. The interrupt is cleared by reading the
+ * modem status by calling alt_16550_modem_status_get() or by disabling
+ * modem status interrupts by calling alt_16550_int_disable_modem().
+ */
+ ALT_16550_INT_STATUS_MODEM = 0x0,
+
+ /*!
+ * No interrupts pending.
+ */
+ ALT_16550_INT_STATUS_NONE = 0x1
+}
+ALT_16550_INT_STATUS_t;
+
+/*!
+ * Enables the receiver FIFO to generate interrupts. Enabling this interrupt
+ * allows for the following interrupt signal(s):
+ * * ALT_16550_INT_STATUS_RX_DATA
+ * * ALT_16550_INT_STATUS_RX_TIMEOUT
+ *
+ * This interrupt is disabled by default.
+ *
+ * The FIFOs must also be enabled for this interrupt to actually be generated.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_enable_rx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables the receiver FIFO from generating interrupts.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_disable_rx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Enables the transmitter FIFO to generate interrupts. Enabling this
+ * interrupt allows for the following interrupt signal(s):
+ * * ALT_16550_INT_STATUS_TX_IDLE
+ *
+ * This interrupt is disabled by default.
+ *
+ * The FIFOs must also be enabled for this interrupt to actually be generated.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_enable_tx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables the transmitter FIFO from generating interrupts.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_disable_tx(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Enables the receiver to generate line status interrupts. Enabling this
+ * interrupt allows for the following interrupt signal(s):
+ * * ALT_16550_INT_STATUS_LINE
+ *
+ * This interrupt is disabled by default.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_enable_line(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables the receiver from generating line status interrupts.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_disable_line(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Enables the UART to generate modem status interrupts. Enabling this
+ * interrupt allows for the following interrupt signal(s):
+ * * ALT_16550_INT_STATUS_MODEM
+ *
+ * This interrupt is disabled by default.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_enable_modem(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables the UART from generate modem status interrupts.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_disable_modem(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables all interrupts on the UART.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_disable_all(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Queries the interrupt status of the UART. This returns the highest priority
+ * interrupt pending. The appropriate interrupts must be enabled for them be
+ * generated in the UART.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param status
+ * [out] Pointer to an output parameter that contains the current
+ * interrupt status of the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_int_status_get(ALT_16550_HANDLE_t * handle,
+ ALT_16550_INT_STATUS_t * status);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup UART_MODEM UART Modem Interface
+ *
+ * This group of APIs provides access, configuration, and control of the UART
+ * Modem interface.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the set of UART modem status conditions as
+ * register mask values.
+ */
+typedef enum ALT_16550_MODEM_STATUS_e
+{
+ /*!
+ * Data Carrier Detect. This status indicates that the carrier has been
+ * detected by the modem. It corresponds to an inverted dcd_n input. DCD
+ * is unasserted when dcd_n is logic 1 and asserted when dcd_n is logic 0.
+ */
+ ALT_16550_MODEM_STATUS_DCD = 1 << 7,
+
+ /*!
+ * Ring Indicator. This status indicates that the telephone ringing signal
+ * has been redeived by the modem. It corresponds to an inverted ri_n
+ * input. RI is unasserted when ri_n is logic 1 and asserted when ri_n is
+ * logic 0.
+ */
+ ALT_16550_MODEM_STATUS_RI = 1 << 6,
+
+ /*!
+ * Data Set Ready. This status indicates that the modem is ready to
+ * establish communications with the UART. It corresponds to an inverted
+ * dsr_n input. DSR is unasserted when dsr_n is logic 1 and asserted when
+ * dsr_n is logic 0.
+ */
+ ALT_16550_MODEM_STATUS_DSR = 1 << 5,
+
+ /*!
+ * Clear To Send. This status indicates the current state of the modem
+ * cts_n line. It corresponds to an inverted cts_n input. CTS is
+ * unasserted when cts_n is logic 1 and asserted when cts_n is logic 0.
+ */
+ ALT_16550_MODEM_STATUS_CTS = 1 << 4,
+
+ /*!
+ * Delta Data Carrier Detect. This status condition indicates that the
+ * Data Carrier Detect has changed since the last time the modem status
+ * was read. Reading the modem status clears this status. For more
+ * information about the Data Carrier Detect status, see
+ * ALT_16550_MODEM_STATUS_DCD.
+ */
+ ALT_16550_MODEM_STATUS_DDCD = 1 << 3,
+
+ /*!
+ * Trailing Edge of Ring Indicator. This status indicates that the Ring
+ * Indicator has changed from asserted to unasserted. Reading the modem
+ * status will clear this status. For more information about the Ring
+ * Indicator status, reference ALT_16550_MODEM_STATUS_RI.
+ */
+ ALT_16550_MODEM_STATUS_TERI = 1 << 2,
+
+ /*!
+ * Delta Data Set Ready. This status condition indicates that the Data Set
+ * Ready has changed since the last time the modem status was read.
+ * Reading the modem status will clear this status. For more information
+ * about the Data Set Ready status, see ALT_16550_MODEM_STATUS_DSR.
+ */
+ ALT_16550_MODEM_STATUS_DDSR = 1 << 1,
+
+ /*!
+ * Delta Clear To Send. This status condition indicates that the Clear To
+ * Send has changed since the last time the modem status was read. Reading
+ * the modem status will clear this status. For more information about the
+ * Clear To Send status, see ALT_16550_MODEM_STATUS_CTS.
+ */
+ ALT_16550_MODEM_STATUS_DCTS = 1 << 0
+}
+ALT_16550_MODEM_STATUS_t;
+
+/*!
+ * Enables automatic flow control in the UART modem. When in this mode, the
+ * rts_n is gated with the threshold trigger condition of the receiver FIFO.
+ *
+ * The Altera 16550 Compatible Soft IP UART may not have this option enabled.
+ *
+ * The FIFOs must be enabled for flow control to be used.
+ *
+ * The recommended bring up for flow control is as follows:
+ * * Enable automatic flow control by calling alt_16550_flowcontrol_enable().
+ * This will allow both the receiver FIFO and user RTS to control the rts_n
+ * output. Because the user RTS is not enabled, the rts_n will be inactive
+ * high.
+ * * Enable RTS by calling alt_16550_modem_enable_rts(). This will give the
+ * receiver FIFO to have full control of the rts_n output.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_flowcontrol_enable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Disables automatic flow control in the UART modem.
+ *
+ * The recommended bring down for flow control is as follows:
+ * * Disable RTS by calling alt_16550_modem_disable_rts(). This will disable
+ * generation of the rts_n ouput.
+ * * Disable automatic flow control by calling
+ * alt_16550_flowcontrol_disable().
+ *
+ * The receiver FIFO will still be active after these steps.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_flowcontrol_disable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Puts the UART in loopback mode. This is used for diagnostic and test
+ * purposes.
+ *
+ * The SoCFPGA UARTs does not support automatic flow control when in loopback
+ * mode.
+ *
+ * The Altera 16550 Compatible Soft IP UART implements this in 13.0sp1 and
+ * later. Setting this has no effect with 13.0.
+ *
+ * When in this mode, the modem control inputs (dsr_n, cts_n, ri_n, dcd_n) are
+ * disconnected and the modem control outputs (dtr_n, rts_n, out1_n, out2_n)
+ * are held inactive high externally and internally looped back to the inputs.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_loopback_enable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Takes the UART out of loopback mode.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_loopback_disable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Asserts the OUT1 output. OUT1 is inverted then driven out to out1_n.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_enable_out1(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Unasserts the OUT1 output. OUT1 is inverted then driven out to out1_n.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_disable_out1(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Asserts the OUT2 output. OUT2 is inverted then driven out to out2_n.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_enable_out2(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Unasserts the OUT2 output. OUT2 is inverted then driven out to out2_n.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_disable_out2(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Asserts the RTS (Request To Send) output. RTS is inverted then driven out
+ * to rts_n. RTS is used to inform the modem that the UART is ready to receive
+ * data.
+ *
+ * There are special considerations when the UART is in automatic flow control
+ * mode. See alt_16550_flowcontrol_enable() for more information.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_enable_rts(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Deaserts the RTS (Request To Send) output. RTS is inverted then driven out
+ * to rts_n.
+ *
+ * There are special considerations when the UART is in automatic flow control
+ * mode. See alt_16550_flowcontrol_enable() for more information.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_disable_rts(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Asserts the DTR (Data Terminal Ready) output. DTR is inverted then driven
+ * out to dtr_n. DTR is used to inform the modem that UART is ready to
+ * establish communications.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_enable_dtr(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Deasserts the DTR (Data Terminal Ready) output. DTR is inverted then driven
+ * out to dtr_n.
+ *
+ * There are special considerations when the UART is in loopback mode. See
+ * alt_16550_loopback_enable() for more information.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_disable_dtr(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Reads the modem status from the UART.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param status
+ * [out] Pointer to an output parameter that contains the current
+ * modem status of the UART as a register mask.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_modem_status_get(ALT_16550_HANDLE_t * handle,
+ uint32_t * status);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup UART_LINE UART Line Interface
+ *
+ * This group of APIs provides access, configuration, and control of the UART
+ * Line interface.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the supported databits per frame.
+ */
+typedef enum ALT_16550_DATABITS_e
+{
+ /*!
+ * This option selects 5 databits per frame.
+ */
+ ALT_16550_DATABITS_5 = 0,
+
+ /*!
+ * This option selects 6 databits per frame.
+ */
+ ALT_16550_DATABITS_6 = 1,
+
+ /*!
+ * This option selects 7 databits per frame.
+ */
+ ALT_16550_DATABITS_7 = 2,
+
+ /*!
+ * This option selects 8 databits per frame.
+ */
+ ALT_16550_DATABITS_8 = 3
+}
+ALT_16550_DATABITS_t;
+
+/*!
+ * This type definition enumerates the supported stopbits per frame.
+ */
+typedef enum ALT_16550_STOPBITS_e
+{
+ /*!
+ * This options specifies 1 stopbit per frame.
+ */
+ ALT_16550_STOPBITS_1 = 0,
+
+ /*!
+ * This options specifies 2 stopbits per frame. If the frame is
+ * configured with 5 databits, 1.5 stopbits is used instead.
+ */
+ ALT_16550_STOPBITS_2 = 1
+}
+ALT_16550_STOPBITS_t;
+
+/*!
+ * This type definition enumerates the possible parity to use per frame.
+ */
+typedef enum ALT_16550_PARITY_e
+{
+ /*!
+ * This option disables the parity error detection bit in the data frame.
+ */
+ ALT_16550_PARITY_DISABLE = 0,
+
+ /*!
+ * This option enables the odd parity error detection bit in the data
+ * frame.
+ */
+ ALT_16550_PARITY_ODD = 1,
+
+ /*!
+ * This option enables the even parity error detection bit in the data
+ * frame.
+ */
+ ALT_16550_PARITY_EVEN = 2
+}
+ALT_16550_PARITY_t;
+
+/*!
+ * This type definition enumerates the set of UART line status conditions as
+ * register mask values.
+ */
+typedef enum ALT_16550_LINE_STATUS_e
+{
+ /*!
+ * Receiver FIFO Error. This status indicates that one or more parity
+ * error, framing error, or break indication exists in the receiver FIFO.
+ * It is only set when FIFO is enabled. This status cleared when line
+ * status is read, the character with the issue is at the top of the FIFO,
+ * and when no other issues exist in the FIFO.
+ */
+ ALT_16550_LINE_STATUS_RFE = 1 << 7,
+
+ /*!
+ * Transmitter EMpTy (Empty). This status indicates that transmitter shift
+ * register is empty. If FIFOs are enabled, the status is set when the
+ * transmitter FIFO is also empty. This status is cleared when the
+ * transmitter shift registers is loaded by writing to the UART
+ * transmitter buffer or transmitter FIFO if FIFOs are enabled. This is
+ * done by calling alt_16550_write() and alt_16550_fifo_write()
+ * respectively.
+ */
+ ALT_16550_LINE_STATUS_TEMT = 1 << 6,
+
+ /*!
+ * Transmitter Holding Register Empty. This status indicates that the
+ * transmitter will run out of data soon. The definition of soon depends
+ * on whether the FIFOs are enabled.
+ *
+ * If FIFOs are disabled, this status indicates that the transmitter will
+ * run out of data to send after the current transmit shift register
+ * completes. In this case, this status is cleared when the data is
+ * written to the UART. This can be done by calling alt_16550_write().
+ *
+ * If FIFOs are enabled, this status indicates that the transmitter FIFO
+ * level is below the transmitter trigger level specified. In this case,
+ * this status is cleared by writing a sufficiently large buffer to the
+ * transmitter FIFO such that the FIFO is filled above the transmitter
+ * trigger level specified by calling alt_16550_fifo_write() or by
+ * adjusting the transmitter trigger level appropriately by calling
+ * alt_16550_fifo_trigger_set_tx().
+ *
+ * \internal
+ * The implementation of the UART driver always ensures that IER[7] is
+ * set. This means that the UART always has Programmable THRE (Transmitter
+ * Holding Register Empty) Interrupt Mode Enable (PTIME) enabled.
+ * \endinternal
+ */
+ ALT_16550_LINE_STATUS_THRE = 1 << 5,
+
+ /*!
+ * Break Interrupt. This status indicates that a break interrupt sequence
+ * is detected in the incoming serial data. This happens when the the data
+ * is 0 for longer than a frame would normally be transmitted. The break
+ * interrupt status is cleared by reading the line status by calling
+ * alt_16550_line_status_get().
+ *
+ * If FIFOs are enabled, this status will be set when the character with
+ * the break interrupt status is at the top of the receiver FIFO.
+ */
+ ALT_16550_LINE_STATUS_BI = 1 << 4,
+
+ /*!
+ * Framing Error. This status indicates that a framing error occurred in
+ * the receiver. This happens when the receiver detects a missing or
+ * incorrect number of stopbit(s).
+ *
+ * If FIFOs are enabled, this status will be set when the character with
+ * the framing error is at the top of the FIFO. When a framing error
+ * occurs, the UART attempts to resynchronize with the transmitting UART.
+ * This status is also set if break interrupt occurred.
+ */
+ ALT_16550_LINE_STATUS_FE = 1 << 3,
+
+ /*!
+ * Parity Error. This status indicates that a parity error occurred in the
+ * receiver.
+ *
+ * If FIFOs are enabled, this status will be set when the character with
+ * the parity error is at the top of the receiver FIFO. This status is
+ * also set if a break interrupt occurred.
+ */
+ ALT_16550_LINE_STATUS_PE = 1 << 2,
+
+ /*!
+ * Overrun Error. This status indicates that an overrun occurred in the
+ * receiver.
+ *
+ * If FIFOs are disabled, the arriving character will overwrite the
+ * existing character in the receiver. Any previously existing
+ * character(s) will be lost.
+ *
+ * If FIFOs are disabled, the arriving character will be discarded. The
+ * buffer will continue to contain the preexisting characters.
+ */
+ ALT_16550_LINE_STATUS_OE = 1 << 1,
+
+ /*!
+ * Data Ready. This status indicates that the receiver or receiver FIFO
+ * contains at least one character.
+ */
+ ALT_16550_LINE_STATUS_DR = 1 << 0
+}
+ALT_16550_LINE_STATUS_t;
+
+/*!
+ * Sets the configuration for a given character frame.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param databits
+ * The number of databits for each character frame.
+ *
+ * \param parity
+ * The parity to use for each character frame.
+ *
+ * \param stopbits
+ * The number of stopbits for each character frame.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_line_config_set(ALT_16550_HANDLE_t * handle,
+ ALT_16550_DATABITS_t databits,
+ ALT_16550_PARITY_t parity,
+ ALT_16550_STOPBITS_t stopbits);
+
+/*!
+ * Starts transmitting a break condition by transmitting a logic 0 state
+ * longer than a frame would normally be transmitted.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_line_break_enable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Stops transmitting a break condition.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_line_break_disable(ALT_16550_HANDLE_t * handle);
+
+/*!
+ * Reads the line status from the UART.
+ *
+ * \param handle
+ * The UART device handle.
+ *
+ * \param status
+ * [out] Pointer to an output parameter that contains the current
+ * line status of the UART.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given UART device handle is invalid.
+ */
+ALT_STATUS_CODE alt_16550_line_status_get(ALT_16550_HANDLE_t * handle,
+ uint32_t * status);
+
+/*!
+ * @}
+ */
+
+/*!
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALT_16550_UART_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h
new file mode 100644
index 0000000000..781cc49aa3
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h
@@ -0,0 +1,825 @@
+/*! \file
+ * Altera - SoC FPGA Address Space Manager
+ */
+
+/******************************************************************************
+*
+* Copyright 2013 Altera Corporation. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. 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.
+*
+* 3. The name of the author may not be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+*
+******************************************************************************/
+
+#ifndef __ALT_ADDRESS_SPACE_H__
+#define __ALT_ADDRESS_SPACE_H__
+
+#include <stdbool.h>
+#include "hwlib.h"
+#include "socal/hps.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/******************************************************************************/
+// ARM Level 2 Cache Controller L2C-310 Register Interface
+
+// Address Filtering Start Register
+// The Address Filtering Start Register is a read and write register.
+// Bits Field Description
+// :-------|:--------------------------|:-----------------------------------------
+// [31:20] | address_filtering_start | Address filtering start address for
+// | | bits [31:20] of the filtering address.
+// [19:1] | Reserved | SBZ/RAZ
+// [0] | address_filtering_enable | 0 - address filtering disabled
+// | | 1 - address filtering enabled.
+
+// Address Filtering Start Register Address
+#define L2_CACHE_ADDR_FILTERING_START_OFST 0xC00
+#define L2_CACHE_ADDR_FILTERING_START_ADDR (ALT_MPUL2_OFST + L2_CACHE_ADDR_FILTERING_START_OFST)
+// Address Filtering Start Register - Start Value Mask
+#define L2_CACHE_ADDR_FILTERING_START_ADDR_MASK 0xFFF00000
+// Address Filtering Start Register - Reset Start Address Value (1 MB)
+#define L2_CACHE_ADDR_FILTERING_START_RESET 0x100000
+// Address Filtering Start Register - Enable Flag Mask
+#define L2_CACHE_ADDR_FILTERING_ENABLE_MASK 0x00000001
+// Address Filtering Start Register - Reset Enable Flag Value (Enabled)
+#define L2_CACHE_ADDR_FILTERING_ENABLE_RESET 0x1
+
+// Address Filtering End Register
+// The Address Filtering End Register is a read and write register.
+// Bits Field Description
+// :-------|:--------------------------|:-----------------------------------------
+// [31:20] | address_filtering_end | Address filtering end address for bits
+// | | [31:20] of the filtering address.
+// [19:0] | Reserved | SBZ/RAZ
+
+// Address Filtering End Register Address
+#define L2_CACHE_ADDR_FILTERING_END_OFST 0xC04
+#define L2_CACHE_ADDR_FILTERING_END_ADDR (ALT_MPUL2_OFST + L2_CACHE_ADDR_FILTERING_END_OFST)
+// Address Filtering End Register - End Value Mask
+#define L2_CACHE_ADDR_FILTERING_END_ADDR_MASK 0xFFF00000
+// Address Filtering End Register - Reset End Address Value (3 GiB)
+#define L2_CACHE_ADDR_FILTERING_END_RESET 0xC0000000
+
+#ifndef __ASSEMBLY__
+
+/******************************************************************************/
+/*! \addtogroup ADDR_SPACE_MGR The Address Space Manager
+ *
+ * This module contains group APIs for managing the HPS address space. This
+ * module contains group APIs to manage:
+ * * Memory Map Control
+ * * Memory Coherence
+ * * Cache Managment
+ * * MMU Managment
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*! \addtogroup ADDR_SPACE_MGR_REMAP Address Space Mapping Control
+ *
+ * This group API provides functions to map and remap selected address ranges
+ * into the accessible (visible) views of the MPU and non MPU address spaces.
+ *
+ * \b Caveats
+ *
+ * \b NOTE: Caution should be observed when remapping address 0 to different
+ * memory. The code performing the remapping operation should not be executing
+ * in the address range being remapped to different memory.
+ *
+ * For example, if address 0 is presently mapped to OCRAM and the code is
+ * preparing to remap address 0 to SDRAM, then the code must not be executing in
+ * the range 0 to 64 KB as this address space is about to be remapped to
+ * different memory. If the code performing the remap operation is executing
+ * from OCRAM then it needs to be executing from its permanently mapped OCRAM
+ * address range in upper memory (i.e. ALT_OCRAM_LB_ADDR to ALT_OCRAM_UB_ADDR).
+ *
+ * \b NOTE: The MPU address space view is controlled by two disparate hardware
+ * control interfaces: the L3 remap register and the L2 cache address filtering
+ * registers. To complicate matters, the L3 remap register is write-only which
+ * means not only that current remap register state cannot be read but also that
+ * a read-modify-write operation cannot be performed on the register.
+ *
+ * This should not present a problem in most use case scenarios except for the
+ * case where a current MPU address space mapping of 0 to SDRAM is being changed
+ * to to a mapping of 0 to Boot ROM or OCRAM.
+ *
+ * In this case, a two step process whereby the L3 remap register is first set
+ * to the new desired MPU address 0 mapping and then the L2 cache address
+ * filtering registers have their address ranges adjusted accordingly must be
+ * followed. An example follows:
+\verbatim
+// 1 MB reset default value for address filtering start
+#define L2_CACHE_ADDR_FILTERING_START_RESET 0x100000
+uint32_t addr_filt_start;
+uint32_t addr_filt_end;
+
+// Perform L3 remap register programming first by setting the desired new MPU
+// address space 0 mapping. Assume OCRAM for the example.
+alt_addr_space_remap(ALT_ADDR_SPACE_MPU_ZERO_AT_OCRAM, ...);
+
+// Next, adjust the L2 cache address filtering range. Set the start address to
+// the default reset value and retain the existing end address configuration.
+alt_l2_addr_filter_cfg_get(&addr_filt_start, &addr_filt_end);
+if (addr_filt_start != L2_CACHE_ADDR_FILTERING_START_RESET)
+{
+ alt_l2_addr_filter_cfg_set(L2_CACHE_ADDR_FILTERING_START_RESET, addr_filt_end);
+}
+\endverbatim
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the MPU address space attributes.
+ *
+ * The MPU address space consists of the ARM Cortex A9 processors and associated
+ * processor peripherals (cache, MMU).
+ */
+typedef enum ALT_ADDR_SPACE_MPU_ATTR_e
+{
+ ALT_ADDR_SPACE_MPU_ZERO_AT_BOOTROM, /*!< Maps the Boot ROM to address
+ * 0x0 for the MPU L3 master. Note
+ * that the Boot ROM is also
+ * always mapped to address
+ * 0xfffd_0000 for the MPU L3
+ * master independent of
+ * attribute.
+ */
+
+ ALT_ADDR_SPACE_MPU_ZERO_AT_OCRAM /*!< Maps the On-chip RAM to address
+ * 0x0 for the MPU L3 master. Note
+ * that the On-chip RAM is also
+ * always mapped to address
+ * 0xffff_0000 for the MPU L3
+ * master independent of this
+ * attribute.
+ */
+} ALT_ADDR_SPACE_MPU_ATTR_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the non-MPU address space attributes.
+ *
+ * The non-MPU address space consists of the non-MPU L3 masters including the
+ * DMA controllers (standalone and those built into peripherals), the F2H AXI
+ * Bridge, and the DAP.
+ */
+typedef enum ALT_ADDR_SPACE_NONMPU_ATTR_e
+{
+ ALT_ADDR_SPACE_NONMPU_ZERO_AT_SDRAM, /*!< Maps the SDRAM to address 0x0
+ * for the non-MPU L3 masters.
+ */
+ ALT_ADDR_SPACE_NONMPU_ZERO_AT_OCRAM /*!< Maps the On-chip RAM to address
+ * 0x0 for the non-MPU L3
+ * masters. Note that the On-chip
+ * RAM is also always mapped to
+ * address 0xffff_0000 for the
+ * non-MPU L3 masters independent
+ * of this attribute.
+ */
+} ALT_ADDR_SPACE_NONMPU_ATTR_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the HPS to FPGA bridge accessiblity
+ * attributes.
+ */
+typedef enum ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_e
+{
+ ALT_ADDR_SPACE_H2F_INACCESSIBLE, /*!< The H2F AXI Bridge is not
+ * visible to L3 masters. Accesses
+ * to the associated address range
+ * return an AXI decode error to
+ * the master.
+ */
+ ALT_ADDR_SPACE_H2F_ACCESSIBLE /*!< The H2F AXI Bridge is visible
+ * to L3 masters.
+ */
+} ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the Lightweight HPS to FPGA bridge
+ * accessiblity attributes.
+ */
+typedef enum ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_e
+{
+ ALT_ADDR_SPACE_LWH2F_INACCESSIBLE, /*!< The LWH2F AXI Bridge is not
+ * visible to L3 masters. Accesses
+ * to the associated address range
+ * return an AXI decode error to
+ * the master.
+ */
+ ALT_ADDR_SPACE_LWH2F_ACCESSIBLE /*!< The LWH2F AXI Bridge is visible
+ * to L3 masters.
+ */
+} ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_t;
+
+/******************************************************************************/
+/*!
+ * Configures the mapped and accessible (visible) address ranges for the HPS
+ * MPU, non-MPU, and Bridge address spaces.
+ *
+ * \param mpu_attr
+ * The MPU address space configuration attributes.
+ *
+ * \param nonmpu_attr
+ * The non-MPU address space configuration attributes.
+ *
+ * \param h2f_attr
+ * The H2F Bridge attribute mapping and accessibility attributes.
+ *
+ * \param lwh2f_attr
+ * The Lightweight H2F Bridge attribute mapping and accessibility
+ * attributes.
+ *
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_INV_OPTION One or more invalid attribute options were
+ * specified.
+ */
+ALT_STATUS_CODE alt_addr_space_remap(ALT_ADDR_SPACE_MPU_ATTR_t mpu_attr,
+ ALT_ADDR_SPACE_NONMPU_ATTR_t nonmpu_attr,
+ ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_t h2f_attr,
+ ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_t lwh2f_attr);
+
+/******************************************************************************/
+/*!
+ * Maps SDRAM to address 0x0 for the MPU address space view.
+ *
+ * When address 0x0 is mapped to the Boot ROM or on-chip RAM, only the lowest
+ * 64KB of the boot region are accessible because the size of the Boot ROM and
+ * on-chip RAM are only 64KB. Addresses in the range 0x100000 (1MiB) to
+ * 0xC0000000 (3GiB) access SDRAM and addresses in the range 0xC0000000 (3GiB) to
+ * 0xFFFFFFFF access the L3 interconnect. Thus, the lowest 1MiB of SDRAM is not
+ * accessible to the MPU unless address 0 is remapped to SDRAM after reset.
+ *
+ * This function remaps the addresses between 0x0 to 0x100000 (1MiB) to access
+ * SDRAM.
+ *
+ * \internal
+ * The remap to address 0x0 is achieved by configuring the L2 cache Address
+ * Filtering Registers to redirect address 0x0 to \e sdram_end_addr to the SDRAM
+ * AXI (M1) master port by calling:
+ *
+ * alt_l2_addr_filter_cfg_set(0x0, <current_addr_filt_end_value>);
+ *
+ * See: <em>ARM DDI 0246F, CoreLink Level 2 Cache Controller L2C-310 Technical
+ * Reference Manual, Section 3.3.12 Address Filtering </em>.
+ * \endinternal
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_mpu_addr_space_remap_0_to_sdram(void);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup L2_ADDR_FLTR L2 Cache Address Filter
+ *
+ * The L2 cache address filter controls where physical addresses within certain
+ * ranges of the MPU address space are directed.
+ *
+ * The L2 cache has master port connections to the L3 interconnect and the SDRAM
+ * controller. A programmable address filter controls which portions of the
+ * 32-bit physical address space use each master.
+ *
+ * When l2 address filtering is configured and enabled, a physical address will
+ * be redirected to one master or the other based upon the address filter
+ * configuration.
+ *
+ * If \b address_filter_start <= \e physical_address < \b address_filter_end:
+ * * then redirect \e physical_address to AXI Master Port M1 (SDRAM controller)
+ * * else redirect \e physical_address to AXI Master Port M0 (L3 interconnect)
+ *
+ * See: <em>ARM DDI 0246F, CoreLink Level 2 Cache Controller L2C-310 Technical
+ * Reference Manual, Section 3.3.12 Address Filtering </em> for more information.
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * Get the L2 cache address filtering configuration settings.
+ *
+ * \param addr_filt_start
+ * [out] An output parameter variable for the address filtering
+ * start address for the range of physical addresses redirected to
+ * the SDRAM AXI master port. The value returned is always a 1 MiB
+ * aligned address.
+ *
+ * \param addr_filt_end
+ * [out] An output parameter variable for the address filtering
+ * end address for the range of physical addresses redirected to
+ * the SDRAM AXI master port. The value returned is always a 1 MiB
+ * aligned address.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG An bad argument was passed. Either \e addr_filt_start
+ * or \e addr_filt_end or both are invalid addresses.
+ */
+ALT_STATUS_CODE alt_l2_addr_filter_cfg_get(uint32_t* addr_filt_start,
+ uint32_t* addr_filt_end);
+
+/******************************************************************************/
+/*!
+ * Set the L2 cache address filtering configuration settings.
+ *
+ * Address filtering start and end values must be 1 MiB aligned.
+ *
+ * \param addr_filt_start
+ * The address filtering start address for the range of physical
+ * addresses redirected to the SDRAM AXI master port. Only bits
+ * [31:20] of the address are valid. Any bits outside the range
+ * [31:20] are invalid and will cause an error status to be
+ * returned.
+ *
+ * \param addr_filt_end
+ * The address filtering end address for the range of physical
+ * addresses redirected to the SDRAM AXI master port. Only bits
+ * [31:20] of the address are valid. Any bits outside the range
+ * [31:20] are invalid and will cause an error status to be
+ * returned.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. One or
+ * more address arguments do not satisfy the argument
+ * constraints.
+ */
+ALT_STATUS_CODE alt_l2_addr_filter_cfg_set(uint32_t addr_filt_start,
+ uint32_t addr_filt_end);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup ADDR_SPACE_MGR_MEM_COHERENCE ACP Memory Coherence and ID Mapping
+ *
+ * This API provides management of the ACP ID Mapper that enables data coherent
+ * access to the MPU address space by external masters. The set of external
+ * masters include L3 master peripherals and FPGA soft IP.
+ *
+ * The Accelerator Coherency Port (ACP) allows peripherals - including FPGA
+ * based soft IP - to maintain data coherency with the Cortex-A9 MPCore
+ * processors and the Snoop Control Unit (SCU).
+ *
+ * The ACP supports up to six masters. However, soft IP implemented in the FPGA
+ * fabric can have a larger number of masters that need to access the ACP. The
+ * ACP ID Mapper expands the number of masters able to access the ACP. The ACP
+ * ID Mapper is situated between the interconnect and the ACP of the MPU
+ * subsystem. It has the following characteristics:
+ * * Support for up to six concurrent ID mappings.
+ * * 1 GiB coherent window into 4 GiB MPU address space
+ * * Remaps the 5-bit user sideband signals used by the Snoop Control Unit (SCU)
+ * and L2 cache.
+ *
+ * The function of the ACP ID Mapper is to map 12-bit Advanced Microcontroller
+ * Bus Architecture (AMBA) Advanced eXtensible Interface (AXI) IDs (input
+ * identifiers) from the Level 3 (L3) interconnect to 3-bit AXI IDs (output
+ * identifiers) required by the ACP slave port.
+ *
+ * The ACP ID Mapper supports the two ID mapping modes:
+ * * Dynamic Mapping - In this mode an input ID is automatically mapped to an
+ * available output ID. The dynamic mode is more flexible because the hardware
+ * handles the mapping. The hardware mapping allows an output ID to be used
+ * for more than one input ID. Output IDs are assigned to input IDs on a
+ * first-come, first-served basis.
+ * * Fixed Mapping - In this mode there is a one-to-one mapping from input IDs
+ * to output IDs.
+ *
+ * Out of the total of eight ACP output ID values, only six are available to the
+ * ACP ID Mapper for remapping. The first two output IDs (0 and 1) are
+ * dedicated to the Cortex-A9 processor cores in the MPU subsystem, leaving the
+ * last six output IDs (2-7) available to the ACP ID mapper. Output IDs 2-6
+ * support fixed and dynamic modes of operation while output ID 7 supports
+ * dynamic mode only.
+ *
+ * The following table summarizes the usage of the 3-bit ouput ID values by the
+ * ACP ID Mapper and their settings at reset.
+ *
+ * Output ID | Usage | Reset State
+ * :-----------|:--------------------------------------------------|:------------
+ * 0 | Reserved for Cortex-A9 cores. | -
+ * 1 | Reserved for Cortex-A9 cores. | -
+ * 2 | Assigned to Debug Access Port (DAP) input ID at | Fixed
+ * : | reset. After reset, can be reconfigured to either | DAP Master
+ * : | fixed or dynamic. |:
+ * 3 | Configurable fixed or dynamic mode. | Dynamic
+ * 4 | Configurable fixed or dynamic mode. | Dynamic
+ * 5 | Configurable fixed or dynamic mode. | Dynamic
+ * 6 | Configurable fixed or dynamic mode. | Dynamic
+ * 7 | Dynamic mode only. | Dynamic
+ *
+ * Where <em>Output ID</em> is the ACP ID Mapper output value that goes to the ACP.
+ *
+ * Additionally, for masters unable to drive the AXI user sideband signals of
+ * incoming transactions, the ACP ID Mapper allows control of the AXI user
+ * sideband signal values. Not all masters drive these signals, so the ACP ID
+ * Mapper makes it possible to drive the 5-bit user sideband signal with either
+ * a default value (in dynamic mode) or specific values (in fixed mode).
+ *
+ * The ACP ID Mapper can also control which 1 GiB coherent window into memory is
+ * accessed by masters of the L3 interconnect. Each fixed mapping can be
+ * assigned a different user sideband signal and memory window to allow specific
+ * settings for different masters. All dynamic mappings share a common user
+ * sideband signal and memory window setting. One important exception, however,
+ * is that the ACP ID mapper always allows user sideband signals from the
+ * FPGA-to-HPS bridge to pass through to the ACP regardless of the configured
+ * user sideband value associated with the ID.
+ *
+ * The ACP ID Mapper has a 1 GiB address window into the MPU address space, which
+ * is by default a view into the bottom 1 GiB of SDRAM. The ACP ID Mapper allows
+ * transactions to be routed to different 1 GiB-sized memory views, called pages,
+ * in both dynamic and fixed modes.
+ *
+ * See: <em>Chapter 6: Cortex-A9 Microprocessor Unit Subsystem</em> in
+ * <em>Volume 3: Hard Processor System Technical Reference Manual</em> of the
+ * <em>Arria V or Cyclone V Device Handbook</em> for a complete discussion of
+ * the operation and restrictions on the ACP and the ACP ID Mapper.
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * \name External Master ID Macros
+ *
+ * These macros define the HPS external master identifiers that are 12-bit input
+ * IDs to the ACP ID Mapper. Some of the masters have a range of identifier
+ * values assigned to them and are distinguished by taking a <em>(var)\</em>
+ * argument.
+ * @{
+ */
+
+/*! Bit mask for the relevant 12 bits of an external master ID */
+#define ALT_ACP_ID_MAP_MASTER_ID_MASK 0xfff
+
+/*! Master ID for L2M0 */
+#define ALT_ACP_ID_MAP_MASTER_ID_L2M0(var) (0x00000002 | (0x000007f8 & (var)))
+/*! Master ID for DMA */
+#define ALT_ACP_ID_MAP_MASTER_ID_DMA(var) (0x00000001 | (0x00000078 & (var)))
+/*! Master ID for EMAC0 */
+#define ALT_ACP_ID_MAP_MASTER_ID_EMAC0(var) (0x00000801 | (0x00000878 & (var)))
+/*! Master ID for EMAC1 */
+#define ALT_ACP_ID_MAP_MASTER_ID_EMAC1(var) (0x00000802 | (0x00000878 & (var)))
+/*! Master ID for USB0 */
+#define ALT_ACP_ID_MAP_MASTER_ID_USB0 0x00000803
+/*! Master ID for USB1 */
+#define ALT_ACP_ID_MAP_MASTER_ID_USB1 0x00000806
+/*! Master ID for NAND controller */
+#define ALT_ACP_ID_MAP_MASTER_ID_NAND(var) (0x00000804 | (0x00000ff8 & (var)))
+/*! Master ID for Embedded Trace Router (ETR) */
+#define ALT_ACP_ID_MAP_MASTER_ID_TMC 0x00000800
+/*! Master ID for Debug Access Port (DAP) */
+#define ALT_ACP_ID_MAP_MASTER_ID_DAP 0x00000004
+/*! Master ID for SD/MMC controller */
+#define ALT_ACP_ID_MAP_MASTER_ID_SDMMC 0x00000805
+/*! Master ID for FPGA to HPS (F2H) bridge - conduit for soft IP masters in FPGA fabric */
+#define ALT_ACP_ID_MAP_MASTER_ID_F2H(var) (0x00000000 | (0x000007f8 & (var)))
+/*! @} */
+
+/******************************************************************************/
+/*!
+ * This type defines the enumerations 3-bit output ids to ACP ID mapper.
+ */
+typedef enum ALT_ACP_ID_OUTPUT_ID_e
+{
+ ALT_ACP_ID_OUT_FIXED_ID_2 = 2, /*!< Assigned to the input ID of the DAP at reset.
+ * After reset, can be either fixed or dynamic,
+ * programmed by software.
+ */
+ ALT_ACP_ID_OUT_DYNAM_ID_3 = 3, /*!< Fixed or dynamic, programmed by software output id */
+ ALT_ACP_ID_OUT_DYNAM_ID_4 = 4, /*!< Fixed or dynamic, programmed by software output id */
+ ALT_ACP_ID_OUT_DYNAM_ID_5 = 5, /*!< Fixed or dynamic, programmed by software output id */
+ ALT_ACP_ID_OUT_DYNAM_ID_6 = 6, /*!< Fixed or dynamic, programmed by software output id */
+ ALT_ACP_ID_OUT_DYNAM_ID_7 = 7 /*!< Dynamic mapping only */
+} ALT_ACP_ID_OUTPUT_ID_t;
+
+/*!
+ * This type defines the enumerations used to specify the 1 GiB page view of the
+ * MPU address space used by an ACP ID mapping configuration.
+ */
+typedef enum ALT_ACP_ID_MAP_PAGE_e
+{
+ ALT_ACP_ID_MAP_PAGE_0 = 0, /*!< Page 0 - MPU address range 0x00000000 - 0x3FFFFFFF */
+ ALT_ACP_ID_MAP_PAGE_1 = 1, /*!< Page 1 - MPU address range 0x40000000 - 0x7FFFFFFF */
+ ALT_ACP_ID_MAP_PAGE_2 = 2, /*!< Page 2 - MPU address range 0x80000000 - 0xBFFFFFFF */
+ ALT_ACP_ID_MAP_PAGE_3 = 3 /*!< Page 3 - MPU address range 0xC0000000 - 0xFFFFFFFF */
+} ALT_ACP_ID_MAP_PAGE_t;
+
+/******************************************************************************/
+/*!
+ * Configure a fixed ACP ID mapping for read transactions originating from
+ * external masters identified by \e input_id. The \e input_id value is
+ * translated to the specified 3-bit \e output_id required by the ACP slave
+ * port.
+ *
+ * \param input_id
+ * The 12 bit external master ID originating read transactions
+ * targeted for ID translation. Valid argument range must be 0 <=
+ * \e output_id <= 4095.
+ *
+ * \param output_id
+ * The 3-bit output ID value the ACP ID Mapper translates read
+ * transactions identified by \e input_id to. This is the value
+ * propogated to the ACP slave port. Valid argument values must be
+ * 0 <= \e output_id <= 7.
+ *
+ * \param page
+ * The MPU address space page view to use for the ACP window used
+ * by the ID tranlation mapping.
+ *
+ * \param aruser
+ * The 5-bit AXI ARUSER read user sideband signal value to use for
+ * masters unable to drive the AXI user sideband signals. Valid
+ * argument range is 0 <= \e aruser <= 31.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. One or
+ * more of the \e input_id, and/or \e output_id
+ * arguments violates its range constraint.
+ * \retval ALT_E_BAD_ARG The \e page argument is invalid.
+ */
+ALT_STATUS_CODE alt_acp_id_map_fixed_read_set(const uint32_t input_id,
+ const uint32_t output_id,
+ const ALT_ACP_ID_MAP_PAGE_t page,
+ const uint32_t aruser);
+
+/******************************************************************************/
+/*!
+ * Configure a fixed ACP ID mapping for write transactions originating from
+ * external masters identified by \e input_id. The \e input_id value is
+ * translated to the specified 3-bit \e output_id required by the ACP slave
+ * port.
+ *
+ * \param input_id
+ * The 12 bit external master ID originating write transactions
+ * targeted for ID translation. Valid argument range must be 0 <=
+ * \e output_id <= 4095.
+ *
+ * \param output_id
+ * The 3-bit output ID value the ACP ID Mapper translates write
+ * transactions identified by \e input_id to. This is the value
+ * propogated to the ACP slave port. Valid argument values must be
+ * 0 <= \e output_id <= 7.
+ *
+ * \param page
+ * The MPU address space page view to use for the ACP window used
+ * by the ID tranlation mapping.
+ *
+ * \param awuser
+ * The 5-bit AXI AWUSER write user sideband signal value to use for
+ * masters unable to drive the AXI user sideband signals. Valid
+ * argument range is 0 <= \e awuser <= 31.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. One or
+ * more of the \e input_id, and/or \e output_id
+ * arguments violates its range constraint.
+ * \retval ALT_E_BAD_ARG The \e page argument is invalid.
+ */
+ALT_STATUS_CODE alt_acp_id_map_fixed_write_set(const uint32_t input_id,
+ const uint32_t output_id,
+ const ALT_ACP_ID_MAP_PAGE_t page,
+ const uint32_t awuser);
+
+/******************************************************************************/
+/*!
+ * Configure the designated 3-bit output ID as an available identifier resource
+ * for use by the dynamic ID mapping function of the ACP ID Mapper for read
+ * transactions. The \e output_id value is available for dynamic assignment to
+ * external master read transaction IDs that do not have an explicit fixed ID
+ * mapping.
+ *
+ * \param output_id
+ * The 3-bit output ID value designated as an available ID for use
+ * by the dynamic mapping function of the ACP ID Mapper. The \e
+ * ouput_id value is used exclusively for dynamic ID mapping until
+ * reconfigured as a fixed ID mapping by a call to
+ * alt_acp_id_map_fixed_read_set(). Valid argument values must be
+ * 0 <= \e output_id <= 7.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint.
+ */
+ALT_STATUS_CODE alt_acp_id_map_dynamic_read_set(const uint32_t output_id);
+
+/******************************************************************************/
+/*!
+ * Configure the designated 3-bit output ID as an available identifier resource
+ * for use by the dynamic ID mapping function of the ACP ID Mapper for write
+ * transactions. The \e output_id value is available for dynamic assignment to
+ * external master write transaction IDs that do not have an explicit fixed ID
+ * mapping.
+ *
+ * \param output_id
+ * The 3-bit output ID value designated as an available ID for use
+ * by the dynamic mapping function of the ACP ID Mapper. The \e
+ * ouput_id value is used exclusively for dynamic ID mapping until
+ * reconfigured as a fixed ID mapping by a call to
+ * alt_acp_id_map_fixed_write_set(). Valid argument values must be
+ * 0 <= \e output_id <= 7.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint.
+ */
+ALT_STATUS_CODE alt_acp_id_map_dynamic_write_set(const uint32_t output_id);
+
+/******************************************************************************/
+/*!
+ * Configure the page and user read sideband signal options that are applied to
+ * all read transactions that have their input IDs dynamically mapped.
+ *
+ * \param page
+ * The MPU address space page view to use for the ACP window used
+ * by the dynamic ID tranlation mapping.
+ *
+ * \param aruser
+ * The 5-bit AXI ARUSER read user sideband signal value to use for
+ * masters unable to drive the AXI user sideband signals. Valid
+ * argument range is 0 <= \e aruser <= 31.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. One or
+ * more of the \e page and/or \e aruser
+ * arguments violates its range constraint.
+ * \retval ALT_E_BAD_ARG The \e mid argument is not a valid master
+ * identifier.
+ */
+ALT_STATUS_CODE alt_acp_id_map_dynamic_read_options_set(const ALT_ACP_ID_MAP_PAGE_t page,
+ const uint32_t aruser);
+
+/******************************************************************************/
+/*!
+ * Configure the page and user write sideband signal options that are applied to
+ * all write transactions that have their input IDs dynamically mapped.
+ *
+ * \param page
+ * The MPU address space page view to use for the ACP window used
+ * by the dynamic ID tranlation mapping.
+ *
+ * \param awuser
+ * The 5-bit AXI AWUSER write user sideband signal value to use for
+ * masters unable to drive the AXI user sideband signals. Valid
+ * argument range is 0 <= \e aruser <= 31.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. One or
+ * more of the \e page and/or \e awuser
+ * arguments violates its range constraint.
+ * \retval ALT_E_BAD_ARG The \e mid argument is not a valid master
+ * identifier.
+ */
+ALT_STATUS_CODE alt_acp_id_map_dynamic_write_options_set(const ALT_ACP_ID_MAP_PAGE_t page,
+ const uint32_t awuser);
+
+/******************************************************************************/
+/*!
+ * Return the current read transaction mapping configuration used by the ACP ID
+ * Mapper for the specified output ID.
+ *
+ * If \e output_id is configured as a fixed mapping then \b true is returned in
+ * the \e fixed output parameter and the translation mapping options configured
+ * for that \e output_id are returned in the other output parameters.
+ *
+ * If \e output_id is configured as a dynamic mapping then \b false is returned
+ * in the \e fixed output parameter and the translation mapping options
+ * configured for all dynamically remapped output IDs are returned in the other
+ * output parameters.
+ *
+ * \param output_id
+ * The output ID to return the mapping configuration for. 0 <= \e
+ * output_id <= 7.
+ *
+ * \param fixed
+ * [out] Set to \b true if the specified \e output_id is a fixed ID
+ * mapping configuration. Set to \b false if the mapping
+ * configuration is dynamic.
+ *
+ * \param input_id
+ * [out] The input ID of the external master that a fixed ID
+ * mapping is applied to for the \e output_id. If \e fixed is \b
+ * false then this output parameter is set to 0 and its value
+ * should be considered as not applicable.
+ *
+ * \param page
+ * [out] The MPU address space page view used by the mapping
+ * configuration.
+ *
+ * \param aruser
+ * [out] The 5-bit AXI ARUSER read user sideband signal value used
+ * by the mapping configuration when masters are unable to drive
+ * the AXI user sideband signals.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. The \e
+ * output_id argument violates its range constraint.
+ */
+ALT_STATUS_CODE alt_acp_id_map_read_options_get(const uint32_t output_id,
+ bool* fixed,
+ uint32_t* input_id,
+ ALT_ACP_ID_MAP_PAGE_t* page,
+ uint32_t* aruser);
+
+/******************************************************************************/
+/*!
+ * Return the current write transaction mapping configuration used by the ACP ID
+ * Mapper for the specified output ID.
+ *
+ * If \e output_id is configured as a fixed mapping then \b true is returned in
+ * the \e fixed output parameter and the translation mapping options configured
+ * for that \e output_id are returned in the other output parameters.
+ *
+ * If \e output_id is configured as a dynamic mapping then \b false is returned
+ * in the \e fixed output parameter and the translation mapping options
+ * configured for all dynamically remapped output IDs are returned in the other
+ * output parameters.
+ *
+ * \param output_id
+ * The output ID to return the mapping configuration for. 0 <= \e
+ * output_id <= 7.
+ *
+ * \param fixed
+ * [out] Set to \b true if the specified \e output_id is a fixed ID
+ * mapping configuration. Set to \b false if the mapping
+ * configuration is dynamic.
+ *
+ * \param input_id
+ * [out] The input ID of the external master that a fixed ID
+ * mapping is applied to for the \e output_id. If \e fixed is \b
+ * false then this output parameter is set to 0 and its value
+ * should be considered as not applicable.
+ *
+ * \param page
+ * [out] The MPU address space page view used by the mapping
+ * configuration.
+ *
+ * \param awuser
+ * [out] The 5-bit AXI AWUSER write user sideband signal value used
+ * by the mapping configuration when masters are unable to drive
+ * the AXI user sideband signals.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_RESERVED The argument value is reserved or unavailable.
+ * \retval ALT_E_ARG_RANGE An argument violates a range constraint. The \e
+ * output_id argument violates its range constraint.
+ */
+ALT_STATUS_CODE alt_acp_id_map_write_options_get(const uint32_t output_id,
+ bool* fixed,
+ uint32_t* input_id,
+ ALT_ACP_ID_MAP_PAGE_t* page,
+ uint32_t* awuser);
+
+/*! @} */
+
+/*! @} */
+
+#endif /* __ASSEMBLY__ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __ALT_ADDRESS_SPACE_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h
new file mode 100644
index 0000000000..8d088ab744
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h
@@ -0,0 +1,964 @@
+/******************************************************************************
+ *
+ * Copyright 2013 Altera Corporation. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+ *
+ ******************************************************************************/
+
+#ifndef __ALT_CACHE_H__
+#define __ALT_CACHE_H__
+
+#include "hwlib.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*!
+ * \addtogroup CACHE_MGR Cache Management API
+ *
+ * This module defines the cache management API for enabling and disabling L1
+ * data cache, L1 instruction cache, L1 dynamic branch prediction caches, L1
+ * TLB cache, and L2 cache in the SoC. As well, many it allows users to perform
+ * cache maintenance operations on these caches. This includes the following
+ * operations:
+ * * Invalidate: Marks the cache line as being invalid, freeing up the space
+ * to cache other data. All APIs which enable caches invalidates the memory
+ * before being enabling the cache.
+ * * Clean: If the cache line is dirty, it synchronizes the cache line data
+ * with the upper level memory system and marks that line as clean. All APIs
+ * which disable caches cleans the memory before disabling the cache.
+ * * Purge: A term used in this API as a short form for clean and invalidate.
+ * This operation cleans and invalidates a cache line in that order, as a
+ * single command to the cache controller.
+ *
+ * The following reference materials were used in the design of this API:
+ * * ARM&reg; Architecture Reference Manual, ARMv7-A and ARMv7-R edition
+ * * Cortex&trade;-A9 Technical Reference Manual
+ * * Cortex&trade;-A9 MPCore Technical Reference Manual
+ * * CoreLink&trade; Level 2 Cache Controller L2C-310 Technical Reference
+ * Manual
+ *
+ * @{
+ */
+
+/*!
+ * \addtogroup CACHE_SYS System Level Cache Management API
+ *
+ * This API group provides cache maintenance operations which affects multiple
+ * cache levels.
+ *
+ * The enable and disable functions enables and disables all caches in the
+ * system respectively. For caches shared by the CPU core(s), particularly the
+ * L2 cache, once that cache is enabled or disabled it will not be invalidated
+ * or cleaned again respectively. This allows the safe system-wide enable and
+ * disable to be used in single-core and multi-core scenarios.
+ *
+ * For cache maintenance operations, this API implements the procedures
+ * outlined in the L2C-310 Technical Reference Manual, section 3.3.10,
+ * subsection "System cache maintenance considerations". This allows for a
+ * convenient way to invalidate, clean, or clean and invalidate cache data from
+ * the L1 to L2 to L3 while avoiding any potential race conditions in
+ * mutli-core or multi-master scenarios. It assumes that the L1 and L2 cache is
+ * set in "non-exclusive" mode. This means a segment of data can reside in both
+ * the L1 and L2 simultaneously. This is the default mode for caches in the
+ * system.
+ *
+ * The current implementation of the system cache APIs assumes that the MMU is
+ * configured with a flat memory mapping or that every virtual address matches
+ * perfectly with the physical address. This restriction may be lifted in a
+ * future release of the cache API implementation.
+ *
+ * @{
+ */
+
+/*!
+ * Enables support for a non-flat virtual memory. A flat virtual memory is
+ * where every virtual address matches exactly to the physical address, making
+ * the virtual to physical translation trivial. Adding support for non-flat
+ * adds some overhead for the VA to PA translation and error detection.
+ *
+ * To enable non-flat virtual memory support, defined
+ * ALT_CACHE_SUPPORT_NON_FLAT_VIRTUAL_MEMORY=1 in your Makefile when compiling
+ * HWLibs.
+ */
+#ifndef ALT_CACHE_SUPPORT_NON_FLAT_VIRTUAL_MEMORY
+#define ALT_CACHE_SUPPORT_NON_FLAT_VIRTUAL_MEMORY (0)
+#endif
+
+/*!
+ * This is the system wide cache line size, given in bytes.
+ */
+#define ALT_CACHE_LINE_SIZE 32
+
+/*!
+ * Enables all caches and features which improve reliability and speed on all
+ * cache controllers visible to the current CPU core. This includes parity
+ * error detection. Cache controllers visible to multiple CPU cores, for
+ * example the L2, will first be checked to be disabled before being enabled.
+ * All necessary cache maintenance operations will be done automatically.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_system_enable(void);
+
+/*!
+ * Disables all cache controllers visible to the current CPU core. Cache
+ * controllers visible to multiple CPU cores, for example the L2, will first
+ * be checked to be enabled before being disabled. All necessary cache
+ * maintenance operations will be done automatically.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_system_disable(void);
+
+/*!
+ * Invalidates the specified contents of all cache levels visible to the
+ * current CPU core for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * The following pseudocode outlines the operations carried out by this
+ * function:
+ * -# L2 invalidate address(es)
+ * -# L2 cache sync
+ * -# L1 invalidate address(es)
+ * -# DSB instruction
+ *
+ * The current implementation of the system cache APIs assumes that the MMU is
+ * configured with a flat memory mapping or that every virtual address matches
+ * perfectly with the physical address. This restriction may be lifted in a
+ * future release of the cache API implementation.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be invalidated.
+ *
+ * \param length
+ * The length of the memory segment to be invalidated.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_system_invalidate(void * vaddress, size_t length);
+
+/*!
+ * Cleans the specified contents of all cache levels visible to the current
+ * CPU core for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * The following pseudocode outlines the operations carried out by this
+ * function:
+ * -# L1 clean address(es)
+ * -# DSB instruction
+ * -# L2 clean address(es)
+ * -# L2 cache sync
+ *
+ * The current implementation of the system cache APIs assumes that the MMU is
+ * configured with a flat memory mapping or that every virtual address matches
+ * perfectly with the physical address. This restriction may be lifted in a
+ * future release of the cache API implementation.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be cleaned.
+ *
+ * \param length
+ * The length of the memory segment to be cleaned.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_system_clean(void * vaddress, size_t length);
+
+/*!
+ * Cleans and invalidates the specified contents of all cache levels visible
+ * to the current CPU core for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * The following pseudocode outlines the operations carried out by this
+ * function:
+ * -# L1 clean address(es)
+ * -# DSB instruction
+ * -# L2 clean and invalidate address(es)
+ * -# L2 cache sync
+ * -# L1 invalidate address(es)
+ * -# DSB instruction
+ *
+ * The current implementation of the system cache APIs assumes that the MMU is
+ * configured with a flat memory mapping or that every virtual address matches
+ * perfectly with the physical address. This restriction may be lifted in a
+ * future release of the cache API implementation.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be purged.
+ *
+ * \param length
+ * The length of the memory segment to be purged.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_system_purge(void * vaddress, size_t length);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup CACHE_L1 L1 Cache Management API
+ *
+ * This API group provides functions to interact with various components of the
+ * L1 cache on the SoCFPGA. This includes the following cache components:
+ * * Instruction Cache
+ * * Data Cache
+ * * Parity error detection
+ * * Dynamic branch prediction
+ * * Data prefetching
+ *
+ * The API within this group only affects the L1 cache on the current CPU. To
+ * interact the L1 cache on another CPU, the API must be called from that other
+ * CPU.
+ *
+ * With respect to bring-up, the L1 and L2 cache controller setups are fully
+ * independent. The L2 can be setup at any time, before or after the L1 is setup.
+ * \internal
+ * Source: Cortex-A9 MPCore TRM, section 5.3.4 "Multiprocessor bring-up".
+ * \endinternal
+ *
+ * @{
+ */
+
+/*!
+ * Enables all L1 caches and features on the current CPU core. This includes
+ * the instruction cache, data cache, parity error detection, branch target
+ * address cache, global history buffer, and data prefetching. All necessary
+ * maintenance tasks will be taken care of.
+ *
+ * This function should not be mixed with other L1 cache related functions
+ * which enable or disable caches individually.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_enable_all(void);
+
+/*!
+ * Disables all L1 caches and features on the current CPU core. This includes
+ * the instruction cache, data cache, parity error detection, branch target
+ * address cache, global history buffer, and data prefetching. All necessary
+ * maintenance tasks will be taken care of.
+ *
+ * This function should not be mixed with other L1 cache related functions
+ * which enable or disable caches individually.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_disable_all(void);
+
+/*!
+ * Enables the L1 instruction cache on the current CPU core. If the cache is
+ * already enabled, nothing is done. Otherwise the instruction cache is first
+ * invalidated before being enabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_instruction_enable(void);
+
+/*!
+ * Disables the L1 instruction cache on the current CPU core.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_instruction_disable(void);
+
+/*!
+ * Returns \b true when the L1 instruction cache is enabled and \b false when
+ * it is disabled on the current CPU core.
+ *
+ * \retval true The L1 instruction cache is enabled.
+ * \retval false The L1 instruction cache is disabled.
+ */
+bool alt_cache_l1_instruction_is_enabled(void);
+
+/*!
+ * Invalidates the contents of the L1 instruction cache on the current CPU
+ * core.
+ *
+ * Normally this is done automatically as part of
+ * alt_cache_l1_instruction_enable(), but in certain circumstances it may be
+ * necessary to invalidate it manually. An example of this situation is when
+ * the address space is remapped and the processor executes instructions from
+ * the new memory area.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_instruction_invalidate(void);
+
+/*!
+ * Enables the L1 data cache on the current CPU core.
+ *
+ * If the cache is already enabled nothing is done. Otherwise the data cache is
+ * first invalidated before being enabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_enable(void);
+
+/*!
+ * Disables the L1 data cache on the current CPU core.
+ *
+ * If the cache is already disabled nothing is done. Otherwise the data cache
+ * is first cleaned before being disabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_disable(void);
+
+/*!
+ * Returns \b true when the L1 data cache is enabled and \b false when it is
+ * disabled on the current CPU core.
+ *
+ * \retval true The L1 data cache is enabled.
+ * \retval false The L1 data cache is disabled.
+ */
+bool alt_cache_l1_data_is_enabled(void);
+
+/*!
+ * Invalidates the specified contents of the L1 data cache on the current CPU
+ * core for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be invalidated.
+ *
+ * \param length
+ * The length of the memory segment to be invalidated.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_invalidate(void * vaddress, size_t length);
+
+/*!
+ * Invalidates the entire contents of the L1 data cache on the current CPU
+ * core.
+ *
+ * Normally this is done automatically as part of alt_cache_l1_data_enable(),
+ * but in certain circumstances it may be necessary to invalidate it manually.
+ * An example of this situation is when the address space is remapped and the
+ * processor accesses memory from the new memory area.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_invalidate_all(void);
+
+/*!
+ * Cleans the specified contents of the L1 data cache on the current CPU core
+ * for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be cleaned.
+ *
+ * \param length
+ * The length of the memory segment to be cleaned.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_clean(void * vaddress, size_t length);
+
+/*!
+ * Cleans the entire L1 data cache for the current CPU core.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_clean_all(void);
+
+/*!
+ * Cleans and invalidates the specified contents of the L1 data cache on the
+ * current CPU core for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * Normally this is done automatically as part of alt_cache_l1_data_disable(),
+ * but in certain circumstances it may be necessary to purged it manually.
+ * An example of this situation is when the address space is remapped and the
+ * processor accesses memory from the new memory area.
+ *
+ * \param vaddress
+ * The virtual address of the memory segment to be purged.
+ *
+ * \param length
+ * The length of the memory segment to be purged.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_purge(void * vaddress, size_t length);
+
+/*!
+ * Cleans and invalidates the entire L1 data cache for the current CPU core.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_data_purge_all(void);
+
+/*!
+ * Enables the parity error detection feature in the L1 caches on the current
+ * CPU core.
+ *
+ * Ideally parity should be enabled before any L1 caches are enabled. If the
+ * instruction, data, and / or dynamic branch predictor caches are already
+ * enabled, they will first be cleaned (if needed) and disabled before parity
+ * is enabled in hardware. Afterwards, the affected caches will be invalidated
+ * and enabled.
+ *
+ * Parity and TLB interaction deserves special attention. The TLB is considered
+ * to be a L1 cache but is enabled when the MMU, which is grouped in another
+ * API, is enabled. Due to the system-wide influence of the MMU, it cannot be
+ * disabled and enabled with impunity as the other L1 caches, which are
+ * designed to operate as transparently as possible. Thus parity error
+ * detection must be enabled before the L1 TLB cache, and by extension the MMU,
+ * is enabled.
+ *
+ * For a parity error to be reported, the appropriate CPU PARITYFAIL interrupt
+ * for the current CPU core must be enabled using the interrupt controller API.
+ * For CPU0, ALT_INT_INTERRUPT_CPU0_PARITYFAIL is asserted if any parity error
+ * is detected while the other PARITYFAIL interrupts are for parity errors in a
+ * specific memory. Refer to the interrupt controller API for more details
+ * about programming the interrupt controller.
+ *
+ * In the event of a parity error is detected, the appropriate CPU parity
+ * interrupt will be raised. CPU parity interrupts are all edge triggered and
+ * are cleared by acknowledging them in the interrupt controller API.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_parity_enable(void);
+
+/*!
+ * Disables parity error detection in the L1 caches.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_parity_disable(void);
+
+/*!
+ * Returns \b true when parity error detection is enabled and \b false when it
+ * is disabled on the current CPU core.
+ *
+ * \retval true Parity error detection for L1 caches is
+ * enabled.
+ * \retval false Parity error detection for L1 caches is
+ * disabled.
+ */
+bool alt_cache_l1_parity_is_enabled(void);
+
+/*!
+ * Enables the dynamic branch predictor features on the current CPU core.
+ *
+ * This operation enables both the Branch Target Address Cache (BTAC) and
+ * the Global History Buffer (GHB). Affected caches are automatically
+ * invalidated before use.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_branch_enable(void);
+
+/*!
+ * Disables the dynamic branch predictor features on the current CPU core.
+ *
+ * This operation disables both the Branch Target Address Cache (BTAC) and
+ * the Global History Buffer (GHB).
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_branch_disable(void);
+
+/*!
+ * Returns \b true when both the dynamic predictor features are enabled and
+ * \b false when they are disabled on the current CPU core.
+ *
+ * \retval true The L1 branch predictor caches are all enabled.
+ * \retval false Some or all L1 branch predictor caches are
+ * disabled.
+ */
+bool alt_cache_l1_branch_is_enabled(void);
+
+/*!
+ * Invalidates the dynamic branch predictor feature caches on the current CPU
+ * core.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_branch_invalidate(void);
+
+/*!
+ * Enables the L1 cache data prefetch feature on the current CPU core.
+ *
+ * This allows data to be prefetched into the data cache before it is to be
+ * used. For example in a loop the current iteration may want to preload the
+ * data which will be used in the next teration. This is done by using the PLD
+ * instructions.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_prefetch_enable(void);
+
+/*!
+ * Disables the L1 cache data prefetch feature on the current CPU core.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l1_prefetch_disable(void);
+
+/*!
+ * Returns \b true if the L1 cache data prefetch feature is enabled and
+ * \b false if it is disabled on the current CPU core.
+ *
+ * \retval true The L1 data cache prefetch feature is enabled.
+ * \retval false The L1 data cache prefetch feature is disabled.
+ */
+bool alt_cache_l1_prefetch_is_enabled(void);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup CACHE_L2 L2 Cache Management API
+ *
+ * This API group provides functions to interact with various features of the
+ * L2 cache on the SoCFPGA. This includes the following features:
+ * * L2 cache
+ * * Parity error detection
+ * * Data prefetching
+ * * Interrupt Management
+ *
+ * \internal
+ * Additional features that may be implemented in the future:
+ * * Lockdown
+ * * Event counter
+ * \endinternal
+ *
+ * The API within this group affects the L2 cache which is visible to all CPUs
+ * on the system.
+ *
+ * With respect to bring-up, the L1 and L2 cache controller setups are fully
+ * independent. The L2 can be setup at any time, before or after the L1 is setup.
+ * \internal
+ * Source: Cortex-A9 MPCore TRM, section 5.3.4 "Multiprocessor bring-up".
+ * \endinternal
+ *
+ * @{
+ */
+
+/*!
+ * Initializes the L2 cache controller.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_ERROR Details about error status code
+ */
+ALT_STATUS_CODE alt_cache_l2_init(void);
+
+/*!
+ * Uninitializes the L2 cache controller.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_ERROR Details about error status code
+ */
+ALT_STATUS_CODE alt_cache_l2_uninit(void);
+
+/*!
+ * Enables the L2 cache features for data and instruction prefetching.
+ *
+ * Prefetching can be enabled or disabled while the L2 cache is enabled.
+ * \internal
+ * Source: Use the Prefetch Control Register.
+ * \endinternal
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_prefetch_enable(void);
+
+/*!
+ * Disables the L2 cache features for data and instruction prefetching.
+ *
+ * Prefetching can be enabled or disabled while the L2 cache is enabled.
+ * \internal
+ * Source: Use the Prefetch Control Register.
+ * \endinternal
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_prefetch_disable(void);
+
+/*!
+ * Returns \b true if either L2 cache data or instruction prefetch features are
+ * enabled and \b false if no prefetching features are enabled.
+ *
+ * \retval true The L2 data and instruction prefetch features
+ * are enabled.
+ * \retval false Some L2 data and instruction prefetch features
+ * are disabled.
+ */
+bool alt_cache_l2_prefetch_is_enabled(void);
+
+/*!
+ * Enables parity error detection in the L2 cache.
+ *
+ * Ideally parity should be enabled before the L2 cache is enabled. If the
+ * cache is already enabled, it will first be cleaned and disabled before
+ * parity is enabled in hardware. Afterwards, the cache will be invalidated and
+ * enabled.
+ *
+ * For a parity error to be reported, the ALT_CACHE_L2_INTERRUPT_PARRD and / or
+ * ALT_CACHE_L2_INTERRUPT_PARRT interrupt condition(s) must be enabled. This is
+ * done by calling alt_cache_l2_int_enable(). As well, the L2 cache interrupt
+ * must be enabled using the interrupt controller API. Refer to the interrupt
+ * controller API for more details about programming the interrupt controller.
+ *
+ * In the event of a parity error is detected, the appropriate L2 cache parity
+ * interrupt will be raised. To clear the parity interrupt(s), the appropriate
+ * L2 cache parity interrupt must be cleared by calling
+ * alt_cache_l2_int_status_clear().
+ *
+ * For ECC support, refer to the ECC related API documentation for more
+ * information.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_parity_enable(void);
+
+/*!
+ * Disables parity error detection in the L2 cache.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_parity_disable(void);
+
+/*!
+ * Returns \b true when parity error detection is enabled and \b false when it
+ * is disabled.
+ *
+ * \retval true The L2 cache parity error detection feature is
+ * enabled.
+ * \retval false The L2 cache parity error detection feature is
+ * disabled.
+ */
+bool alt_cache_l2_parity_is_enabled(void);
+
+/*!
+ * Enables the L2 cache.
+ *
+ * If the L2 cache is already enabled, nothing is done. Otherwise the entire
+ * contents of the cache is first invalidated before being enabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_enable(void);
+
+/*!
+ * Disables the L2 cache.
+ *
+ * If the L2 cache is already disabled, nothing is done. Otherwise the entire
+ * contents of the cache is first cleaned before being disabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_disable(void);
+
+/*!
+ * Returns \b true when the L2 cache is enabled and \b false when it is
+ * disabled.
+ *
+ * \retval true The L2 cache is enabled.
+ * \retval false The L2 cache is disabled.
+ */
+bool alt_cache_l2_is_enabled(void);
+
+/*!
+ * Flushes the L2 cache controller hardware buffers.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_sync(void);
+
+/*!
+ * Invalidates the specified contents of the L2 cache for the given memory
+ * segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * \param paddress
+ * The physical address of the memory segment to be invalidated.
+ *
+ * \param length
+ * The length of the memory segment to be invalidated.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_invalidate(void * paddress, size_t length);
+
+/*!
+ * Invalidates th entire contents of the L2 cache.
+ *
+ * Normally this is done automatically as part of alt_cache_l2_enable(), but
+ * in certain circumstances it may be necessary to invalidate it manually. An
+ * example of this situation is when the address space is remapped and the
+ * processor accesses memory from the new memory area.
+
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_invalidate_all(void);
+
+/*!
+ * Cleans the specified contents of the L2 cache for the given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * \param paddress
+ * The physical address of the memory segment to be cleaned.
+ *
+ * \param length
+ * The length of the memory segment to be cleaned.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_clean(void * paddress, size_t length);
+
+/*!
+ * Cleans the entire L2 cache. All L2 cache controller interrupts will be
+ * temporarily disabled while the clean operation is in progress and restored
+ * once the it is finished.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_clean_all(void);
+
+/*!
+ * Cleans and invalidates the specified contents of the L2 cache for the
+ * given memory segment.
+ *
+ * The memory segment address and length specified must align to the
+ * characteristics of the cache line. This means the address and length must be
+ * multiples of the cache line size. To determine the cache line size, use the
+ * \b ALT_CACHE_LINE_SIZE macro.
+ *
+ * \param paddress
+ * The physical address of the memory segment to be purged.
+ *
+ * \param length
+ * The length of the memory segment to be purged.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The memory segment is invalid.
+ */
+ALT_STATUS_CODE alt_cache_l2_purge(void * paddress, size_t length);
+
+/*!
+ * Cleans and invalidates the entire L2 cache. All L2 cache controller
+ * interrupts will be temporarily disabled while the clean and invalidate
+ * operation is in progress and restored once the it is finished.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_TMO The memory operation timed out.
+ */
+ALT_STATUS_CODE alt_cache_l2_purge_all(void);
+
+/*!
+ * This type definition enumerates all the interrupt conditions that can be
+ * generated by the L2 cache controller as register mask values.
+ */
+enum ALT_CACHE_L2_INTERRUPT_e
+{
+ /*! Decode error received on the master ports from L3. */
+ ALT_CACHE_L2_INTERRUPT_DECERR = 1 << 8,
+
+ /*! Slave error received on the master ports from L3. */
+ ALT_CACHE_L2_INTERRUPT_SLVERR = 1 << 7,
+
+ /*! Error on the L2 data RAM read. */
+ ALT_CACHE_L2_INTERRUPT_ERRRD = 1 << 6,
+
+ /*! Error on the L2 tag RAM read. */
+ ALT_CACHE_L2_INTERRUPT_ERRRT = 1 << 5,
+
+ /*! Error on the L2 data RAM write. */
+ ALT_CACHE_L2_INTERRUPT_ERRWD = 1 << 4,
+
+ /*! Error on the L2 tag RAM write. */
+ ALT_CACHE_L2_INTERRUPT_ERRWT = 1 << 3,
+
+ /*! Parity error on the L2 data RAM read. */
+ ALT_CACHE_L2_INTERRUPT_PARRD = 1 << 2,
+
+ /*! Parity error on the L2 tag RAM read. */
+ ALT_CACHE_L2_INTERRUPT_PARRT = 1 << 1,
+
+ /*! Event counter overflow or increment. */
+ ALT_CACHE_L2_INTERRUPT_ECNTR = 1 << 0
+};
+typedef enum ALT_CACHE_L2_INTERRUPT_e ALT_CACHE_L2_INTERRUPT_t;
+
+/*!
+ * Enables the L2 cache controller interrupts for the specified set of
+ * condition(s).
+ *
+ * \param interrupt
+ * A register mask of the selected L2 cache controller
+ * interrupting conditions.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_int_enable(uint32_t interrupt);
+
+/*!
+ * Disables the L2 cache controller interrupts for the specified set of
+ * condition(s).
+ *
+ * \param interrupt
+ * A register mask of the selected L2 cache controller
+ * interrupting conditions.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_int_disable(uint32_t interrupt);
+
+/*!
+ * Gets the condition(s) causing the L2 cache controller to interrupt as a
+ * register mask.
+ *
+ * \returns A register mask of the currently asserted and enabled
+ * conditions resulting in an interrupt being generated.
+ */
+uint32_t alt_cache_l2_int_status_get(void);
+
+/*!
+ * Clears the specified conditon(s) causing the L2 cache controller to
+ * interrupt as a mask. Condition(s) specified which are not causing an
+ * interrupt or condition(s) specified which are not enabled are ignored.
+ *
+ * \param interrupt
+ * A register mask of the selected L2 cache controller
+ * interrupting conditions.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_cache_l2_int_status_clear(uint32_t interrupt);
+
+/*!
+ * @}
+ */
+
+/*!
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALT_CACHE_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h
new file mode 100644
index 0000000000..a43608e9f3
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h
@@ -0,0 +1,114 @@
+/******************************************************************************
+ *
+ * Copyright 2013 Altera Corporation. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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
+ *
+ * Contains the definition of an opaque data structure that contains raw
+ * configuration information for a clock group.
+ */
+
+#ifndef __ALT_CLK_GRP_H__
+#define __ALT_CLK_GRP_H__
+
+#include "hwlib.h"
+#include "socal/alt_clkmgr.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*!
+ * This type definition enumerates the clock groups
+ */
+typedef enum ALT_CLK_GRP_e
+{
+ ALT_MAIN_PLL_CLK_GRP, /*!< Main PLL clock group */
+
+ ALT_PERIPH_PLL_CLK_GRP, /*!< Peripheral PLL clock group */
+
+ ALT_SDRAM_PLL_CLK_GRP /*!< SDRAM PLL clock group */
+
+} ALT_CLK_GRP_t;
+
+/*!
+ * This type definition defines an opaque data structure for holding the
+ * configuration settings for a complete clock group.
+ */
+typedef struct ALT_CLK_GROUP_RAW_CFG_s
+{
+ uint32_t verid; /*!< SoC FPGA version identifier. This field
+ * encapsulates the silicon identifier and
+ * version information associated with this
+ * clock group configuration. It is used to
+ * assert that this clock group configuration
+ * is valid for this device. */
+
+ uint32_t siliid2; /*!< Reserved register - reserved for future
+ * device IDs or capability flags. */
+
+ ALT_CLK_GRP_t clkgrpsel; /*!< Clock group union discriminator. */
+
+ /*!
+ * This union holds the register values for configuration of the set of
+ * possible clock groups on the SoC FPGA. The \e clkgrpsel discriminator
+ * identifies the valid clock group union data member.
+ */
+ union ALT_CLK_GROUP_RAW_CFG_u
+ {
+ /*! Clock group configuration for Main PLL group. */
+ union
+ {
+ ALT_CLKMGR_MAINPLL_t fld; /*!< Field access. */
+ ALT_CLKMGR_MAINPLL_raw_t raw; /*!< Raw access. */
+ } mainpllgrp;
+
+ /*! Clock group configuration for Peripheral PLL group. */
+ union
+ {
+ ALT_CLKMGR_PERPLL_t fld; /*!< Field access. */
+ ALT_CLKMGR_PERPLL_raw_t raw; /*!< Raw access. */
+ } perpllgrp;
+
+ /*! Clock group configuration for SDRAM PLL group. */
+ union
+ {
+ ALT_CLKMGR_SDRPLL_t fld; /*!< Field access. */
+ ALT_CLKMGR_SDRPLL_raw_t raw; /*!< Raw access. */
+ } sdrpllgrp;
+
+ } clkgrp;
+} ALT_CLK_GROUP_RAW_CFG_t;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __ALT_CLK_GRP_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h
new file mode 100644
index 0000000000..d6d96544f7
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h
@@ -0,0 +1,1434 @@
+/*! \file
+ * Contains definitions for the Altera Hardware Libraries Clock Manager
+ * Application Programming Interface
+ */
+
+/******************************************************************************
+*
+* Copyright 2013 Altera Corporation. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. 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.
+*
+* 3. The name of the author may not be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+*
+******************************************************************************/
+
+#ifndef __ALT_CLK_MGR_H__
+#define __ALT_CLK_MGR_H__
+
+#include "hwlib.h"
+#include "alt_clock_group.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*! \addtogroup CLK_MGR The Clock Manager API
+ *
+ * This module defines the Clock Manager API for accessing, configuring, and
+ * controlling the HPS clock resources.
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * This type definition is an opaque type definition for clock frequency values
+ * in Hz.
+ */
+typedef uint32_t alt_freq_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the names of the clock and PLL resources
+ * managed by the Clock Manager.
+ */
+typedef enum ALT_CLK_e
+{
+ /* Clock Input Pins */
+ ALT_CLK_IN_PIN_OSC1,
+ /*!< \b OSC_CLK_1_HPS
+ * External oscillator input:
+ * * Input Pin
+ * * Clock source to Main PLL
+ * * Clock source to SDRAM PLL
+ * and Peripheral PLL if selected via
+ * register write
+ * * Clock source for clock in safe mode
+ */
+
+ ALT_CLK_IN_PIN_OSC2,
+ /*!< \b OSC_CLK_2_HPS
+ * External Oscillator input:
+ * * Input Pin
+ * * Optional clock source to SDRAM PLL
+ * and Peripheral PLL if selected
+ * * Typically used for Ethernet
+ * reference clock
+ */
+
+
+ /* FPGA Clock Sources External to HPS */
+ ALT_CLK_F2H_PERIPH_REF,
+ /*<! Alternate clock source from FPGA
+ * for HPS Peripheral PLL. */
+
+ ALT_CLK_F2H_SDRAM_REF,
+ /*<! Alternate clock source from FPGA
+ * for HPS SDRAM PLL. */
+
+
+ /* Other Clock Sources External to HPS */
+ ALT_CLK_IN_PIN_JTAG,
+ /*!< \b JTAG_TCK_HPS
+ * * Input Pin
+ * * External HPS JTAG clock input.
+ */
+
+ ALT_CLK_IN_PIN_ULPI0,
+ /*!< \b ULPI0_CLK
+ * ULPI Clock provided by external USB0
+ * PHY
+ * * Input Pin
+ */
+
+ ALT_CLK_IN_PIN_ULPI1,
+ /*!< \b ULPI1_CLK
+ * ULPI Clock provided by external USB1
+ * PHY
+ * * Input Pin
+ */
+
+ ALT_CLK_IN_PIN_EMAC0_RX,
+ /*!< \b EMAC0:RX_CLK
+ * Rx Reference Clock for EMAC0
+ * * Input Pin
+ */
+
+ ALT_CLK_IN_PIN_EMAC1_RX,
+ /*!< \b EMAC1:RX_CLK
+ * Rx Reference Clock for EMAC1
+ * * Input Pin
+ */
+
+
+ /* PLLs */
+ ALT_CLK_MAIN_PLL,
+ /*!< \b main_pll_ref_clkin
+ * Main PLL input reference clock,
+ * used to designate the Main PLL in
+ * PLL clock selections.
+ */
+
+ ALT_CLK_PERIPHERAL_PLL,
+ /*!< \b periph_pll_ref_clkin
+ * Peripheral PLL input reference
+ * clock, used to designate the
+ * Peripheral PLL in PLL clock
+ * selections.
+ */
+
+ ALT_CLK_SDRAM_PLL,
+ /*!< \b sdram_pll_ref_clkin
+ * SDRAM PLL input reference clock,
+ * used to designate the SDRAM PLL in
+ * PLL clock selections.
+ */
+
+ /* OSC1 Clock Group - The OSC1 clock group contains those clocks which are derived
+ * directly from the osc_clk_1_HPS pin */
+ ALT_CLK_OSC1,
+ /*!< \b osc1_clk
+ * OSC1 Clock Group - The
+ * OSC1 clock group contains
+ * those clocks which are
+ * derived directly from the
+ * osc_clk_1_HPS pin.
+ * * alias for ALT_CLK_IN_PIN_OSC1
+ */
+
+ /* Main Clock Group - The following clocks are derived from the Main PLL. */
+ ALT_CLK_MAIN_PLL_C0,
+ /*!< \b Main PLL C0 Output */
+
+ ALT_CLK_MAIN_PLL_C1,
+ /*!< \b Main PLL C1 Output */
+
+ ALT_CLK_MAIN_PLL_C2,
+ /*!< \b Main PLL C2 Output */
+
+ ALT_CLK_MAIN_PLL_C3,
+ /*!< \b Main PLL C3 Output */
+
+ ALT_CLK_MAIN_PLL_C4,
+ /*!< \b Main PLL C4 Output */
+
+ ALT_CLK_MAIN_PLL_C5,
+ /*!< \b Main PLL C5 Output */
+
+ ALT_CLK_MPU,
+ /*!< \b mpu_clk
+ * Main PLL C0 Output. Clock for MPU
+ * subsystem, including CPU0 and CPU1.
+ * * Alias for \e ALT_CLK_MAIN_PLL_C0
+ */
+
+ ALT_CLK_MPU_L2_RAM,
+ /*!< \b mpu_l2_ram_clk
+ * Clock for MPU level 2 (L2) RAM
+ */
+
+ ALT_CLK_MPU_PERIPH,
+ /*!< \b mpu_periph_clk
+ * Clock for MPU snoop control unit
+ * (SCU) peripherals, such as the
+ * general interrupt controller (GIC)
+ */
+
+ ALT_CLK_L3_MAIN,
+ /*!< \b main_clk
+ * Main PLL C1 Output
+ * * Alias for \e ALT_CLK_MAIN_PLL_C1
+ */
+
+ ALT_CLK_L3_MP,
+ /*!< \b l3_mp_clk
+ * Clock for L3 Master Peripheral Switch
+ */
+
+ ALT_CLK_L3_SP,
+ /*!< \b l3_sp_clk
+ * Clock for L3 Slave Peripheral Switch
+ */
+
+ ALT_CLK_L4_MAIN,
+ /*!< \b l4_main_clk
+ * Clock for L4 main bus
+ * * Clock for DMA
+ * * Clock for SPI masters
+ */
+
+ ALT_CLK_L4_MP,
+ /*!< \b l4_mp_clk
+ * Clock for L4 master peripherals (MP) bus
+ */
+
+ ALT_CLK_L4_SP,
+ /*!< \b l4_sp_clk
+ * Clock for L4 slave peripherals (SP) bus
+ */
+
+ ALT_CLK_DBG_BASE,
+ /*!< \b dbg_base_clk
+ * Main PLL C2 Output
+ * * Alias for \e ALT_CLK_MAIN_PLL_C2
+ */
+
+ ALT_CLK_DBG_AT,
+ /*!< \b dbg_at_clk
+ * Clock for CoreSight debug Advanced
+ * Microcontroller Bus Architecture
+ * (AMBA) Trace Bus (ATB)
+ */
+
+ ALT_CLK_DBG_TRACE,
+ /*!< \b dbg_trace_clk
+ * Clock for CoreSight debug Trace
+ * Port Interface Unit (TPIU)
+ */
+
+ ALT_CLK_DBG_TIMER,
+ /*!< \b dbg_timer_clk
+ * Clock for the trace timestamp
+ * generator
+ */
+
+ ALT_CLK_DBG,
+ /*!< \b dbg_clk
+ * Clock for Debug Access Port (DAP)
+ * and debug Advanced Peripheral Bus
+ * (APB)
+ */
+
+ ALT_CLK_MAIN_QSPI,
+ /*!< \b main_qspi_clk
+ * Main PLL C3 Output. Quad SPI flash
+ * internal logic clock.
+ * * Alias for \e ALT_CLK_MAIN_PLL_C3
+ */
+
+ ALT_CLK_MAIN_NAND_SDMMC,
+ /*!< \b main_nand_sdmmc_clk
+ * Main PLL C4 Output. Input clock to
+ * flash controller clocks block.
+ * * Alias for \e ALT_CLK_MAIN_PLL_C4
+ */
+
+ ALT_CLK_CFG,
+ /*!< \b cfg_clk
+ * FPGA manager configuration clock.
+ */
+
+ ALT_CLK_H2F_USER0,
+ /*!< \b h2f_user0_clock
+ * Clock to FPGA fabric
+ */
+
+
+ /* Peripherals Clock Group - The following clocks are derived from the Peripheral PLL */
+ ALT_CLK_PERIPHERAL_PLL_C0,
+ /*!< \b Peripheral PLL C0 Output */
+
+ ALT_CLK_PERIPHERAL_PLL_C1,
+ /*!< \b Peripheral PLL C1 Output */
+
+ ALT_CLK_PERIPHERAL_PLL_C2,
+ /*!< \b Peripheral PLL C2 Output */
+
+ ALT_CLK_PERIPHERAL_PLL_C3,
+ /*!< \b Peripheral PLL C3 Output */
+
+ ALT_CLK_PERIPHERAL_PLL_C4,
+ /*!< \b Peripheral PLL C4 Output */
+
+ ALT_CLK_PERIPHERAL_PLL_C5,
+ /*!< \b Peripheral PLL C5 Output */
+
+ ALT_CLK_USB_MP,
+ /*!< \b usb_mp_clk
+ * Clock for USB
+ */
+
+ ALT_CLK_SPI_M,
+ /*!< \b spi_m_clk
+ * Clock for L4 SPI master bus
+ */
+
+ ALT_CLK_QSPI,
+ /*!< \b qspi_clk
+ * Clock for Quad SPI
+ */
+
+ ALT_CLK_NAND_X,
+ /*!< \b nand_x_clk
+ * NAND flash controller master and
+ * slave clock
+ */
+
+ ALT_CLK_NAND,
+ /*!< \b nand_clk
+ * Main clock for NAND flash
+ * controller
+ */
+
+ ALT_CLK_SDMMC,
+ /*!< \b sdmmc_clk
+ * Clock for SD/MMC logic input clock
+ */
+
+ ALT_CLK_EMAC0,
+ /*!< \b emac0_clk
+ * EMAC 0 clock - Peripheral PLL C0
+ * Output
+ * * Alias for \e ALT_CLK_PERIPHERAL_PLL_C0
+ */
+
+ ALT_CLK_EMAC1,
+ /*!< \b emac1_clk
+ * EMAC 1 clock - Peripheral PLL C1
+ * Output
+ * * Alias for \e ALT_CLK_PERIPHERAL_PLL_C1
+ */
+
+ ALT_CLK_CAN0,
+ /*!< \b can0_clk
+ * Controller area network (CAN)
+ * controller 0 clock
+ */
+
+ ALT_CLK_CAN1,
+ /*!< \b can1_clk
+ * Controller area network (CAN)
+ * controller 1 clock
+ */
+
+ ALT_CLK_GPIO_DB,
+ /*!< \b gpio_db_clk
+ * Debounce clock for GPIO0, GPIO1,
+ * and GPIO2
+ */
+
+ ALT_CLK_H2F_USER1,
+ /*!< \b h2f_user1_clock
+ * Clock to FPGA fabric - Peripheral
+ * PLL C5 Output
+ * * Alias for \e ALT_CLK_PERIPHERAL_PLL_C5
+ */
+
+
+ /* SDRAM Clock Group - The following clocks are derived from the SDRAM PLL */
+ ALT_CLK_SDRAM_PLL_C0,
+ /*!< \b SDRAM PLL C0 Output */
+
+ ALT_CLK_SDRAM_PLL_C1,
+ /*!< \b SDRAM PLL C1 Output */
+
+ ALT_CLK_SDRAM_PLL_C2,
+ /*!< \b SDRAM PLL C2 Output */
+
+ ALT_CLK_SDRAM_PLL_C3,
+ /*!< \b SDRAM PLL C3 Output */
+
+ ALT_CLK_SDRAM_PLL_C4,
+ /*!< \b SDRAM PLL C4 Output */
+
+ ALT_CLK_SDRAM_PLL_C5,
+ /*!< \b SDRAM PLL C5 Output */
+
+ ALT_CLK_DDR_DQS,
+ /*!< \b ddr_dqs_clk
+ * Clock for MPFE, single-port
+ * controller, CSR access, and PHY -
+ * SDRAM PLL C0 Output
+ * * Alias for \e ALT_CLK_SDRAM_PLL_C0
+ */
+
+ ALT_CLK_DDR_2X_DQS,
+ /*!< \b ddr_2x_dqs_clk
+ * Clock for PHY - SDRAM PLL C1 Output
+ * * Alias for \e ALT_CLK_SDRAM_PLL_C1
+ */
+
+ ALT_CLK_DDR_DQ,
+ /*!< \b ddr_dq_clk
+ * Clock for PHY - SDRAM PLL C2 Output
+ * * Alias for \e ALT_CLK_SDRAM_PLL_C2
+ */
+
+ ALT_CLK_H2F_USER2,
+ /*!< \b h2f_user2_clock
+ * Clock to FPGA fabric - SDRAM PLL C5
+ * Output
+ * * Alias for \e ALT_CLK_SDRAM_PLL_C5
+ */
+
+ /* Clock Output Pins */
+ ALT_CLK_OUT_PIN_EMAC0_TX,
+ /*!< \b EMAC0:TX_CLK
+ * Tx Reference Clock for EMAC0
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_EMAC1_TX,
+ /*!< \b EMAC1:TX_CLK
+ * Tx Reference Clock for EMAC1
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_SDMMC,
+ /*!< \b SDMMC:CLK
+ * SD/MMC Card Clock
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_I2C0_SCL,
+ /*!< \b I2C0:SCL
+ * I2C Clock for I2C0
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_I2C1_SCL,
+ /*!< \b I2C1:SCL
+ * I2C Clock for I2C1
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_I2C2_SCL,
+ /*!< \b I2C2:SCL
+ * I2C Clock for I2C2/2 wire
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_I2C3_SCL,
+ /*!< \b I2C3:SCL
+ * I2C Clock for I2C1/2 wire
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_SPIM0,
+ /*!< \b SPIM0:CLK
+ * SPI Clock
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_SPIM1,
+ /*!< \b SPIM1:CLK
+ * SPI Clock
+ * * Output Pin
+ */
+
+ ALT_CLK_OUT_PIN_QSPI,
+ /*!< \b QSPI:CLK
+ * QSPI Flash Clock
+ * * Output Pin
+ */
+
+ ALT_CLK_UNKNOWN
+} ALT_CLK_t;
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_STATUS Clock Manager Status
+ *
+ * This functional group provides status information on various aspects and
+ * properties of the Clock Manager state.
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * This type definition defines the lock condition status codes for each of the
+ * PLLs. If the PLL lock status condition is enabled (See: alt_clk_irq_enable())
+ * then it contributes to the overall \b clkmgr_IRQ signal assertion state.
+ */
+typedef enum ALT_CLK_PLL_LOCK_STATUS_e
+{
+ ALT_MAIN_PLL_LOCK_ACHV = 0x00000001, /*!< This condition is set if the Main
+ * PLL has achieved lock at least once
+ * since this condition was last
+ * cleared.
+ */
+ ALT_PERIPH_PLL_LOCK_ACHV = 0x00000002, /*!< This condition is set if the Peripheral
+ * PLL has achieved lock at least once
+ * since this condition was last
+ * cleared.
+ */
+ ALT_SDR_PLL_LOCK_ACHV = 0x00000004, /*!< This condition is set if the SDRAM
+ * PLL has achieved lock at least once
+ * since this condition was last
+ * cleared.
+ */
+ ALT_MAIN_PLL_LOCK_LOST = 0x00000008, /*!< This condition is set if the Main
+ * PLL has lost lock at least once
+ * since this condition was last
+ * cleared.
+ */
+ ALT_PERIPH_PLL_LOCK_LOST = 0x00000010, /*!< This condition is set if the Peripheral
+ * PLL has lost lock at least once
+ * since this condition was last
+ * cleared.
+ */
+ ALT_SDR_PLL_LOCK_LOST = 0x00000020 /*!< This condition is set if the SDRAM
+ * PLL has lost lock at least once
+ * since this condition was last
+ * cleared.
+ */
+} ALT_CLK_PLL_LOCK_STATUS_t;
+
+/******************************************************************************/
+/*!
+ * Clear the selected PLL lock status conditions.
+ *
+ * This function clears assertions of one or more of the PLL lock status
+ * conditions.
+ *
+ * NOTE: This function is used to clear \b clkmgr_IRQ interrupt signal source
+ * assertion conditions.
+ *
+ * \param lock_stat_mask
+ * Specifies the PLL lock status conditions to clear. \e lock_stat_mask
+ * is a mask of logically OR'ed \ref ALT_CLK_PLL_LOCK_STATUS_t
+ * values designating the PLL lock conditions to clear.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_BAD_ARG The \e lock_stat_mask argument contains an
+ * unknown condition value.
+ */
+ALT_STATUS_CODE alt_clk_lock_status_clear(ALT_CLK_PLL_LOCK_STATUS_t lock_stat_mask);
+
+/******************************************************************************/
+/*!
+ * Returns the PLL lock status condition values.
+ *
+ * This function returns the value of the PLL lock status conditions.
+ *
+ * \returns The current values of the PLL lock status conditions as defined by
+ * the \ref ALT_CLK_PLL_LOCK_STATUS_t mask bits. If the corresponding bit is set
+ * then the condition is asserted.
+ */
+uint32_t alt_clk_lock_status_get(void);
+
+/******************************************************************************/
+/*!
+ * Returns ALT_E_TRUE if the designated PLL is currently locked and ALT_E_FALSE
+ * otherwise.
+ *
+ * \param pll
+ * The PLL to return the lock status of.
+ *
+ * \retval ALT_E_TRUE The specified PLL is currently locked.
+ * \retval ALT_E_FALSE The specified PLL is currently not locked.
+ * \retval ALT_E_BAD_ARG The \e pll argument designates a non PLL clock
+ * value.
+ * \internal
+ * NOTE: This function uses the
+ * * \b hps::clkmgr::inter::mainplllocked
+ * * \b hps::clkmgr::inter::perplllocked,
+ * * \b hps::clkmgr::inter::sdrplllocked
+ *
+ * bits to determine if the PLL is locked or not.
+ * \endinternal
+ */
+ALT_STATUS_CODE alt_clk_pll_is_locked(ALT_CLK_t pll);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_SAFE_MODE Safe Mode Options
+ *
+ * When safe mode is enabled, clocks in the HPS are directly generated from the
+ * \b osc1_clk clock. Safe mode is enabled by the assertion of a safe mode
+ * request from the reset manager or by a cold reset. Assertion of the safe mode
+ * request from the reset manager sets the safe mode bit in the clock manager
+ * control register. No other control register bits are affected by the safe
+ * mode request from the reset manager.
+ *
+ * While in safe mode, clock manager register settings which control clock
+ * behavior are not changed. However, the output of the registers which control
+ * the clock manager state are forced to the safe mode values such that the
+ * following conditions occur:
+ * * All PLLs are bypassed to the \b osc1_clk clock, including their counters.
+ * * Clock dividers select their default reset values.
+ * * The flash controllers source clock selections are set to the peripheral
+ * PLL.
+ * * All clocks are enabled.
+ * * Safe mode is optionally applied to debug clocks.
+ *
+ * A write by software is the only way to clear the safe mode bit. All registers
+ * and clocks need to be configured correctly and all software-managed clocks
+ * need to be gated off before clearing safe mode. Software can then gate clocks
+ * on as required.
+ *
+ * On cold reset, all clocks are put in safe mode.
+ *
+ * On warm reset, safe mode is optionally and independently applied to debug
+ * clocks and normal (i.e.non-debug) clocks based on clock manager register
+ * settings. The default response for warm reset is to put all clocks in safe
+ * mode.
+ *
+ * The APIs in this group provide control of the Clock Manager safe mode warm
+ * reset response behavior.
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the safe mode clock domains under control of
+ * the Clock Manager.
+ */
+typedef enum ALT_CLK_SAFE_DOMAIN_e
+{
+ /*!
+ * This enumeration literal specifies the normal safe mode domain. The
+ * normal domain consists of all clocks except debug clocks.
+ */
+ ALT_CLK_DOMAIN_NORMAL,
+ /*!
+ * This enumeration literal specifies the debug safe mode domain. The debug
+ * domain consists of all debug clocks.
+ */
+ ALT_CLK_DOMAIN_DEBUG
+} ALT_CLK_SAFE_DOMAIN_t;
+
+/******************************************************************************/
+/*!
+ * Clear the safe mode status of the Clock Manager following a reset.
+ *
+ * NOTE: Safe mode should only be cleared once clocks have been correctly
+ * configured.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_clk_safe_mode_clear(void);
+
+/******************************************************************************/
+/*!
+ * Return whether the specified safe mode clock domain is in safe mode or not.
+ *
+ * \param clk_domain
+ * The safe mode clock domain to check whether in safe mode or not.
+ *
+ * \retval TRUE The safe mode clock domain is in safe mode.
+ * \retval FALSE The safe mode clock domain is not in safe mode.
+ */
+bool alt_clk_is_in_safe_mode(ALT_CLK_SAFE_DOMAIN_t clk_domain);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_BYPASS PLL Bypass Control
+ *
+ * When a PLL is in bypass, the PLL clock logic is kept in reset. In this
+ * manner, the PLL clock can be free running while it stabilizes and achieves
+ * lock. The bypass logic isolates PLL configuration registers from the clock
+ * while changes are made to the PLL settings.
+ *
+ * The bypass controls are used by software to change the source clock input
+ * reference (for Peripheral and SDRAM PLLs) and is recommended when changing
+ * settings that may affect the ability of the VCO to maintain lock. When a PLL
+ * is taken in or out of bypass the PLL output clocks will pause momentarily
+ * while the clocks are in transition, There will be no glitches or clocks
+ * shorter than the either the old or the new clock period.
+ *
+ * In summary, the PLL bypass controls permit:
+ * * Each PLL to be individually bypassed.
+ * * Bypass of all PLL clock outputs to \b osc1_clk or alternatively the PLLs
+ * reference clock input source reference clock selection.
+ * * Isolation of a the PLL VCO frequency registers (multiplier and divider),
+ phase shift registers (negative phase) , and post scale counters.
+ * * Glitch free clock transitions.
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Disable bypass mode for the specified PLL. This operation takes the PLL out
+ * of bypass mode.
+ *
+ * \param pll
+ * The PLL to take out of bypass mode.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The \e pll argument specified a non PLL clock
+ * value.
+ */
+ALT_STATUS_CODE alt_clk_pll_bypass_disable(ALT_CLK_t pll);
+
+/******************************************************************************/
+/*!
+ * Enable bypass mode for the specified PLL.
+ *
+ * \param pll
+ * The PLL to put into bypass mode.
+ *
+ * \param use_input_mux
+ * If TRUE then use the PLLs reference clock input source selection
+ * to directly drive the bypass clock. If FALSE then use bypass
+ * clock directly driven by the \b osc1_clk.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The \e pll argument specified a non PLL
+ * clock value.
+ * \retval ALT_E_INV_OPTION TRUE is an invalid option for
+ * \e use_input_mux with the \e pll selection.
+ */
+ALT_STATUS_CODE alt_clk_pll_bypass_enable(ALT_CLK_t pll,
+ bool use_input_mux);
+
+/******************************************************************************/
+/*!
+ * Return whether the specified PLL is in bypass or not.
+ *
+ * \internal
+ * This function must also test the \b clkmgr.ctrl.safemode bit in
+ * addition to the PLLs bypass bit to tell whether the bypass mode is
+ * effect or not.
+ * \endinternal
+ *
+ * \param pll
+ * The PLL to check whether in bypass mode or not.
+ *
+ * \retval ALT_E_TRUE The PLL is in bypass mode.
+ * \retval ALT_E_FALSE The PLL is not in bypass mode.
+ * \retval ALT_E_BAD_ARG The \e pll argument designates a non PLL clock
+ * value.
+ */
+ALT_STATUS_CODE alt_clk_pll_is_bypassed(ALT_CLK_t pll);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_GATE Clock Gating Control
+ *
+ * This functional group provides gating control of selected clock signals.
+ *
+ * When a clock is enabled, then its clock signal propogates to its respective
+ * clocked IP block(s). When a clock is disabled, then its clock signal is
+ * prevented from propogating to its respective clocked IP block(s).
+ *
+ * The following clocks may be gated:
+ *
+ * * Main PLL Group
+ * - l4_main_clk
+ * - l3_mp_clk
+ * - l4_mp_clk
+ * - l4_sp_clk
+ * - dbg_at_clk
+ * - dbg_clk
+ * - dbg_trace_clk
+ * - dbg_timer_clk
+ * - cfg_clk
+ * - s2f_user0_clk
+ *
+ * * SDRAM PLL Group
+ * - ddr_dqs_clk
+ * - ddr_2x_clk
+ * - ddr_dq_clk
+ * - s2f_user2_clk
+ *
+ * * Peripheral PLL Group
+ * - emac0_clk
+ * - emac1_clk
+ * - usb_mp_clk
+ * - spi_m_clk
+ * - can0_clk
+ * - can1_clk
+ * - gpio_db_clk
+ * - s2f_user1_clk
+ * - sdmmc_clk
+ * - nand_clk
+ * - nand_x_clk
+ * - qspi_clk
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Disable the specified clock. Once the clock is disabled, its clock signal does
+ * not propogate to its clocked elements.
+ *
+ * \param clk
+ * The clock to disable.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The \e clk argument designates a non gated clock
+ * value.
+ */
+ALT_STATUS_CODE alt_clk_clock_disable(ALT_CLK_t clk);
+
+/******************************************************************************/
+/*!
+ * Enable the specified clock. Once the clock is enabled, its clock signal
+ * propogates to its elements.
+ *
+ * \param clk
+ * The clock to enable.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The \e clk argument designates a non gated clock
+ * value.
+ */
+ALT_STATUS_CODE alt_clk_clock_enable(ALT_CLK_t clk);
+
+/******************************************************************************/
+/*!
+ * Return whether the specified clock is enabled or not.
+ *
+ * \param clk
+ * The clock to check whether enabled or not.
+ *
+ * \retval ALT_E_TRUE The clock is enabled.
+ * \retval ALT_E_FALSE The clock is not enabled.
+ * \retval ALT_E_BAD_ARG The \e clk argument designates a non gated clock
+ * value.
+ */
+ALT_STATUS_CODE alt_clk_is_enabled(ALT_CLK_t clk);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_CLK_SEL Clock Source Selection
+ *
+ * This API group provide access and control to the input reference clock source
+ * selection for a clock or PLL.
+ *
+ * \internal
+ * These are the clocks that have software configurable input reference clock
+ * source selection available. Each clock below is listed with its valid
+ * input reference clock source selections.
+ *
+ * + Valid reference clock input selections for \b sdram_pll_ref_clkin
+ * - osc_clk_1
+ * - osc_clk_2
+ * - f2h_sdram_ref_clk
+ *
+ * + Valid reference clock input selections for \b periph_pll_ref_clkin
+ * - osc_clk_1
+ * - osc_clk_2,
+ * - f2h_periph_ref_clk
+ *
+ * + Valid reference clock input selections for \b l4_mp_clk
+ * - periph_base_clk
+ * - main_clk
+ *
+ * + Valid reference clock input selections for \b l4_sp_clk
+ * - periph_base_clk
+ * - main_clk
+ *
+ * + Valid reference clock input selections for \b sdmmc_clk
+ * - f2h_periph_ref_clk
+ * - main_nand_sdmmc_clk
+ * - periph_nand_sdmmc_clk
+ *
+ * + Valid reference clock input selections for \b nand_clk
+ * - f2h_periph_ref_clk
+ * - main_nand_sdmmc_clk
+ * - periph_nand_sdmmc_clk
+ *
+ * + Valid reference clock input selections for \b qspi_clk
+ * - f2h_periph_ref_clk
+ * - main_qspi_clk
+ * - periph_qspi_clk
+ *
+ * \endinternal
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Get the input reference clock source selection value for the specified clock
+ * or PLL.
+ *
+ * NOTE: This function returns a clock value even though \e clk may specify a
+ * clock that does not have a selectable input reference clock source. In
+ * this case, the clock value returned is the static clock source for the
+ * specified clock. For example calling alt_clk_source_get() with \e clk
+ * set to \ref ALT_CLK_MAIN_PLL will return \ref ALT_CLK_OSC1.
+ *
+ * \param clk
+ * The clock or PLL to retrieve the input reference clock source
+ * selection value for.
+ *
+ * \returns The clock's currently selected input reference clock source.
+ */
+ALT_CLK_t alt_clk_source_get(ALT_CLK_t clk);
+
+/******************************************************************************/
+/*!
+ * Set the specified clock's input reference clock source selection.
+ *
+ * \param clk
+ * The clock or PLL to set the input reference clock source
+ * selection for.
+ *
+ * \param ref_clk
+ * The input reference clock source selection value.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The \e clk argument designates a clock that
+ * does not have a selectable input reference
+ * clock source.
+ * \retval ALT_E_INV_OPTION The \e ref_clk argument designates a clock that
+ * is an invalid reference clock source for the
+ * specified clock.
+ */
+ALT_STATUS_CODE alt_clk_source_set(ALT_CLK_t clk,
+ ALT_CLK_t ref_clk);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_FREQ Clock Frequency Control
+ *
+ * This API group provides access and control of the output frequency of a clock
+ * or PLL.
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * Set the external clock frequency value.
+ *
+ * The function is used to specify the frequency of the external clock source as
+ * a measure of Hz. The supplied frequency should be within the Fmin and Fmax
+ * values allowed for the external clock source.
+ *
+ * \param clk
+ * The external clock source. Valid external clocks are
+ * * \e ALT_CLK_OSC1
+ * * \e ALT_CLK_OSC2
+ * * \e ALT_CLK_F2H_PERIPH_REF
+ * * \e ALT_CLK_F2H_SDRAM_REF
+ *
+ * \param freq
+ * The frequency of the external clock in Hz.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG A bad argument value was passed. Either the \e clk
+ * argument is bad or not a valid external clock
+ * source
+ * \retval ALT_E_ARG_RANGE The frequency value violates the range constraints
+ * for the specified clock.
+
+ */
+ALT_STATUS_CODE alt_clk_ext_clk_freq_set(ALT_CLK_t clk,
+ alt_freq_t freq);
+
+/******************************************************************************/
+/*!
+ * Get the external clock frequency value.
+ *
+ * This function returns the frequency of the external clock source as
+ * a measure of Hz.
+ *
+ * \param clk
+ * The external clock source. Valid external clocks are
+ * * \e ALT_CLK_OSC1
+ * * \e ALT_CLK_OSC2
+ * * \e ALT_CLK_F2H_PERIPH_REF
+ * * \e ALT_CLK_F2H_SDRAM_REF
+ *
+ * \retval freq
+ * The frequency of the external clock in Hz.
+ *
+ */
+alt_freq_t alt_clk_ext_clk_freq_get(ALT_CLK_t clk);
+
+/******************************************************************************/
+/*!
+ * This type definition defines a structure to contain the generalized
+ * configuration settings for a PLL.
+ */
+typedef struct ALT_CLK_PLL_CFG_s
+{
+ ALT_CLK_t ref_clk; /*!< PLL Reference Clock Source */
+ uint32_t mult; /*!< VCO Frequency Configuration -
+ * Multiplier (M) value, range 1 to 4096
+ */
+ uint32_t div; /*!< VCO Frequency Configuration -
+ * Divider (N) value, range 1 to 64
+ */
+ uint32_t cntrs[6]; /*!< Post-Scale Counters (C0 - C5) -
+ * range 1 to 512
+ */
+ uint32_t pshift[6]; /*!< Phase Shift - 1/8 (45 degrees) of
+ * negative phase shift per increment,
+ * range 0 to 4096
+ */
+} ALT_CLK_PLL_CFG_t;
+
+/******************************************************************************/
+/*!
+ * Get the current PLL configuration.
+ *
+ * \param pll
+ * The PLL to get the configuration from.
+ *
+ * \param pll_cfg
+ * [out] Pointer to an output parameter variable for the returned
+ * PLL configuration.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_clk_pll_cfg_get(ALT_CLK_t pll,
+ ALT_CLK_PLL_CFG_t* pll_cfg);
+
+/******************************************************************************/
+/*!
+ * Set the PLL configuration using the configuration parameters specified in
+ * \e pll_cfg.
+ *
+ * \param pll
+ * The PLL to set the configuration for.
+ *
+ * \param pll_cfg
+ * Pointer to a ALT_CLK_PLL_CFG_t structure specifying the desired
+ * PLL configuration.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_clk_pll_cfg_set(ALT_CLK_t pll,
+ const ALT_CLK_PLL_CFG_t* pll_cfg);
+
+/******************************************************************************/
+/*!
+ * Get the current PLL VCO frequency configuration.
+ *
+ * \param pll
+ * The PLL to get the VCO frequency configuration for.
+ *
+ * \param mult
+ * [out] Pointer to an output variable for the returned
+ * configured PLL VCO multiplier (M) value.
+ *
+ * \param div
+ * [out] Pointer to an output variable for the returned
+ * configured PLL VCO divider (N) value.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_clk_pll_vco_cfg_get(ALT_CLK_t pll,
+ uint32_t* mult,
+ uint32_t* div);
+
+/******************************************************************************/
+/*!
+ * Set the PLL VCO frequency configuration using the supplied multiplier and
+ * divider arguments.
+ *
+ * \param pll
+ * The PLL to set the VCO frequency configuration for.
+ *
+ * \param mult
+ * The PLL VCO multiplier (M). Expected argument range 1 to 4096.
+ *
+ * \param div
+ * The PLL VCO divider (N). Expected argument range 1 to 64.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_clk_pll_vco_cfg_set(ALT_CLK_t pll,
+ uint32_t mult,
+ uint32_t div);
+
+/******************************************************************************/
+/*!
+ * Get the VCO frequency of the specified PLL.
+ *
+ * \param pll
+ * The PLL to retrieve the VCO frequency from.
+ *
+ * \param freq
+ * [out] Pointer to the an output parameter variable to return the
+ * PLL VCO frequency value. The frequency value is returned as a
+ * measures of Hz.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG A bad argument value was passed. Either
+ * the \e pll argument is invalid or a bad
+ * \e freq pointer value was passed.
+ */
+ALT_STATUS_CODE alt_clk_pll_vco_freq_get(ALT_CLK_t pll,
+ alt_freq_t* freq);
+
+/******************************************************************************/
+/*!
+ * Get the PLL frequency guard band value.
+ *
+ * \param pll
+ * The PLL from which to return the current guard band value.
+ *
+ * \returns The current guard band range in effect for the PLL.
+ */
+uint32_t alt_clk_pll_guard_band_get(ALT_CLK_t pll);
+
+/******************************************************************************/
+/*!
+ * Set the PLL frequency guard band value.
+ *
+ * Once a PLL has achieved lock, any changes to the PLL VCO frequency that are
+ * within a specific guard band range (default value 20%) of the reference
+ * period should not cause the PLL to lose lock.
+ *
+ * Programmatic changes to the PLL frequency within this guard band range are
+ * permitted to be made without the risk of breaking lock during the transition
+ * to the new frequency.
+ *
+ * The clk_mgr_pll_guard_band_set() function changes the guard band from its
+ * current value to permit a more lenient or stringent policy to be in effect in
+ * the implementation of the functions configuring PLL VCO frequency. The
+ * rationale for changing the default guard band value might be to accommodate
+ * unexpected environmental conditions (noise, temperature, and other
+ * instability factors) that may affect the PLLs ability to maintain lock during
+ * a frequency change.
+ *
+ * \param pll
+ * The PLL to set the guard band value for.
+ *
+ * \param guard_band
+ * The guard band value. Value should be 0 <= \e guard_band <= 100.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_ARG_RANGE The guard band value violates its range constraint.
+ */
+ALT_STATUS_CODE alt_clk_pll_guard_band_set(ALT_CLK_t pll,
+ uint32_t guard_band);
+
+/******************************************************************************/
+/*!
+ * Get the configured divider value for the specified clock.
+ *
+ * This function is used to get the configured values of both internal and
+ * external clock dividers. The internal divider (PLL counters C0-C5) values
+ * are retrieved by specifying the clock name that is the divider output
+ * (e.g. ALT_CLK_MPU is used to get the Main PLL C0 counter value). \n
+ * It returns the actual divider value, not the encoded bitfield stored
+ * in the register, due to the variety of different encodings.
+ *
+ * \param clk
+ * The clock divider to get the value from.
+ *
+ * \param div
+ * [out] Pointer to an output variable for the returned clock
+ * divider value.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG An invalid clock argument was specified or a
+ * clock that does not have a divider.
+ */
+ALT_STATUS_CODE alt_clk_divider_get(ALT_CLK_t clk,
+ uint32_t* div);
+
+/******************************************************************************/
+/*!
+ * Set the divider value for the specified clock.
+ *
+ * This function is used to set the values of both internal and external clock
+ * dividers. The internal divider (PLL counters C0-C5) values are set by
+ * specifying the clock name that is the divider output (e.g. ALT_CLK_MPU is
+ * used to set the Main PLL C0 counter value).
+ *
+ * \param clk
+ * The clock divider to set the value for.
+ *
+ * \param div
+ * The clock divider value. NOTE: The valid range of clock divider
+ * values depends on the clock being configured. This is the
+ * real divisor ratio, not how the divisor is coded into the
+ * register, and is always one or greater.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG An invalid clock argument was specified or a
+ * clock that does not have a divider.
+ * \retval ALT_E_ARG_RANGE The divider value violates the range constraints
+ * for the clock divider.
+ */
+ALT_STATUS_CODE alt_clk_divider_set(ALT_CLK_t clk,
+ uint32_t div);
+
+/******************************************************************************/
+/*!
+ * Get the output frequency of the specified clock.
+ *
+ * \param clk
+ * The clock to retrieve the output frequency from.
+ *
+ * \param freq
+ * [out] Pointer to the an output parameter variable to return the
+ * clock output frequency value. The frequency value is returned as
+ * a measures of Hz.
+ *
+ * \retval ALT_E_SUCCESS The operation was succesful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG A bad argument value was passed. Either
+ * the \e clk argument is invalid or a bad
+ * \e freq pointer value was passed.
+ */
+ALT_STATUS_CODE alt_clk_freq_get(ALT_CLK_t clk,
+ alt_freq_t* freq);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_INT Clock Manager Interrupt Management
+ *
+ * The functions in this group provide management of interrupts originating from
+ * the Clock Manager.
+ *
+ * The following interrupt request (IRQ) signals are sourced from the Clock
+ * Manager:
+ *
+ * * \b clkmgr_IRQ - Clock Manager lock status interrupt output. The PLL lock
+ * status interrupt is the logical \e OR of six interrupt
+ * sources defining the loss or achievement of lock status for
+ * each PLL. The six PLL lock status conditions are:
+ * - Main PLL Achieved Lock
+ * - Main PLL Lost Lock
+ * - Peripheral PLL Achieved Lock
+ * - Peripheral PLL Lost Lock
+ * - SDRAM PLL Achieved Lock
+ * - SDRAM PLL Lost Lock
+ *
+ * They are enumeratated by the type \ref ALT_CLK_PLL_LOCK_STATUS_t.
+ *
+ * Each PLL lock condition may be individually disabled/enabled
+ * as a contributor to the determination of the \b clkmgr_IRQ
+ * assertion status.
+ *
+ * The alt_clk_lock_status_clear() function is used to clear
+ * the PLL lock conditions causing the \b clkmgr_IRQ
+ * assertion.
+ *
+ * * \b mpuwakeup_IRQ - MPU wakeup interrupt output. This interrupt notifies the
+ * MPU to "wake up" after a transition of the Main PLL into
+ * or out of bypass mode has been safely achieved. The need
+ * for the "wake up" notification is because the PLL clocks
+ * pause for a short number of clock cycles during bypass
+ * state transition. ARM recommeds that the CPUs are placed
+ * in standby if the clocks are ever paused.
+ *
+ * NOTE: \b mpuwakeup_IRQ appears to be an Altera private interrupt and may not
+ * be part of the public API although clearly it has important utility in
+ * implementing safe changes to PLL settings and transitions into and out
+ * of bypass mode.
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * Disable the \b clkmgr_IRQ interrupt signal source lock status condition(s).
+ *
+ * This function disables one or more of the lock status conditions as
+ * contributors to the \b clkmgr_IRQ interrupt signal state.
+ *
+ * NOTE: A set bit for a PLL lock status condition in the mask value does not
+ * have the effect of enabling it as a contributor to the \b clkmgr_IRQ
+ * interrupt signal state. The function alt_clk_irq_enable is used to enable PLL
+ * lock status source condition(s).
+ *
+ * \param lock_stat_mask
+ * Specifies the PLL lock status conditions to disable as interrupt
+ * source contributors. \e lock_stat_mask is a mask of logically
+ * OR'ed ALT_CLK_PLL_LOCK_STATUS_t values that designate the PLL lock
+ * conditions to disable.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_BAD_ARG The \e lock_stat_mask argument contains an
+ * unknown condition value.
+ */
+ALT_STATUS_CODE alt_clk_irq_disable(ALT_CLK_PLL_LOCK_STATUS_t lock_stat_mask);
+
+/******************************************************************************/
+/*!
+ * Enable the \b clkmgr_IRQ interrupt signal source lock status condition(s).
+ *
+ * This function enables one or more of the lock status conditions as
+ * contributors to the \b clkmgr_IRQ interrupt signal state.
+ *
+ * NOTE: A cleared bit for any PLL lock status condition in the mask value does
+ * not have the effect of disabling it as a contributor to the \b clkmgr_IRQ
+ * interrupt signal state. The function alt_clk_irq_disable is used to disable
+ * PLL lock status source condition(s).
+ *
+ * \param lock_stat_mask
+ * Specifies the PLL lock status conditions to enable as interrupt
+ * source contributors. \e lock_stat_mask is a mask of logically
+ * OR'ed ALT_CLK_PLL_LOCK_STATUS_t values that designate the PLL lock
+ * conditions to enable.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_BAD_ARG The \e lock_stat_mask argument contains an
+ * unknown condition value.
+ */
+ALT_STATUS_CODE alt_clk_irq_enable(ALT_CLK_PLL_LOCK_STATUS_t lock_stat_mask);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup CLK_MGR_GROUP_CFG Clock Group Configuration
+ *
+ * This API provides the ability to safely set the configuration of a clock
+ * group with a single function call.
+ *
+ * A clock group is defined as set of clocks and signals generated from a common
+ * PLL VCO. The PLL and its derived clocks are treated as a single clock
+ * group. The clocks sourced directly or indirectly from the PLL may or may not
+ * have these features:
+ * * Clock Gates
+ * * Clock Dividers
+ * * Clock Source Selection Options
+ *
+ * The use case for application of the Clock Group Configuration functions is the
+ * ability to safely configure an entire clock group from a known good clock
+ * group configuration using the run-time function alt_clk_group_cfg_raw_set().
+ *
+ * A known good clock group configuration may be generated by one of the
+ * following methods:
+ *
+ * * As static design information generated by an ACDS clock configuration tool
+ * and passed to embedded software for dynamic loading.
+ *
+ * * By calling alt_clk_group_cfg_raw_get() at run-time from an SoC FPGA that has
+ * programmatically established a known good clock group configuration using
+ * the clock manager API configuration functions.
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*!
+ * Get the raw configuration state of the designated clock group.
+ *
+ * This function is used to capture the configuration state of the specified
+ * clock group in a private (raw) data structure. The raw data structure may be
+ * saved and used later to restore the clock group configuration using
+ * alt_clk_group_cfg_raw_get().
+ *
+ * \param clk_group
+ * The clock group configuration to capture.
+ *
+ * \param clk_group_raw_cfg
+ * [out] A pointer to a private (raw) data structure to store the
+ * captured clock group configuration.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_ERROR Details about error status code
+ */
+ALT_STATUS_CODE alt_clk_group_cfg_raw_get(ALT_CLK_GRP_t clk_group,
+ ALT_CLK_GROUP_RAW_CFG_t* clk_group_raw_cfg);
+
+/******************************************************************************/
+/*!
+ * Set the clock group configuration.
+ *
+ * This function is used to safely set the configuration state of a clock
+ * group from a raw clock group configuration specification. The raw clock
+ * group configuration specification may be a configuration previously
+ * captured with alt_clk_group_cfg_raw_get() or a group clock configuration
+ * generated by an external utility.
+ *
+ * \param clk_group_raw_cfg
+ * A pointer to the specification to use in the configuration of
+ * the clock group.
+ *
+ * \retval ALT_E_SUCCESS Successful status.
+ * \retval ALT_E_ERROR Details about error status code
+ * \retval ALT_E_BAD_VERSION The clock group configuration specification is
+ * invalid for this device.
+ */
+ALT_STATUS_CODE alt_clk_group_cfg_raw_set(const ALT_CLK_GROUP_RAW_CFG_t* clk_group_raw_cfg);
+
+ALT_STATUS_CODE alt_clk_clkmgr_init(void);
+
+/*! @} */
+
+/*! @} */
+#ifdef __cplusplus
+}
+
+#endif /* __cplusplus */
+#endif /* __ALT_CLK_MGR_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h
new file mode 100644
index 0000000000..6be93fbd32
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h
@@ -0,0 +1,1007 @@
+/******************************************************************************
+*
+* Copyright 2013 Altera Corporation. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. 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.
+*
+* 3. The name of the author may not be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+*
+******************************************************************************/
+
+#ifndef __ALT_DMA_H__
+#define __ALT_DMA_H__
+
+#include "hwlib.h"
+#include "alt_dma_common.h"
+#include "alt_dma_program.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*!
+ * \addtogroup ALT_DMA DMA Controller API
+ *
+ * This module defines the API for configuration and use of the general purpose
+ * DMA controller for the SoC. The DMA controller is an instance of the ARM
+ * Corelink DMA Controller (DMA-330).
+ *
+ * References:
+ * * ARM DDI 0424C, CoreLink DMA Controller DMA-330 Technical Reference
+ * Manual.
+ * * ARM DAI 0239A, Application Note 239 Example Programs for the CoreLink
+ * DMA Controller DMA-330.
+ * * Altera, Cyclone V Device Handbook Volume 3: Hard Processor System
+ * Technical Reference Manual, DMA Controller.
+ *
+ * @{
+ */
+
+/*!
+ * \addtogroup ALT_DMA_COMPILE DMA API Compile Options
+ *
+ * This API provides control over the compile time inclusion of selected
+ * modules. This can allow for a smaller resulting binary.
+ *
+ * @{
+ */
+
+#ifndef ALT_DMA_PERIPH_PROVISION_16550_SUPPORT
+#define ALT_DMA_PERIPH_PROVISION_16550_SUPPORT (1)
+#endif
+
+#ifndef ALT_DMA_PERIPH_PROVISION_QSPI_SUPPORT
+#define ALT_DMA_PERIPH_PROVISION_QSPI_SUPPORT (1)
+#endif
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup ALT_DMA_CSR DMA API for Configuration, Control, and Status
+ *
+ * This API provides functions for configuration, control, and status queries
+ * of the DMA controller.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the operational states that the DMA manager
+ * may have.
+ */
+typedef enum ALT_DMA_MANAGER_STATE_e
+{
+ ALT_DMA_MANAGER_STATE_STOPPED = 0, /*!< Stopped */
+ ALT_DMA_MANAGER_STATE_EXECUTING = 1, /*!< Executing */
+ ALT_DMA_MANAGER_STATE_CACHE_MISS = 2, /*!< Cache Miss */
+ ALT_DMA_MANAGER_STATE_UPDATING_PC = 3, /*!< Updating PC */
+ ALT_DMA_MANAGER_STATE_WFE = 4, /*!< Waiting for Event */
+ ALT_DMA_MANAGER_STATE_FAULTING = 15 /*!< Faulting */
+}
+ALT_DMA_MANAGER_STATE_t;
+
+/*!
+ * This type definition enumerates the operational states that a DMA channel
+ * may have.
+ */
+typedef enum ALT_DMA_CHANNEL_STATE_e
+{
+ ALT_DMA_CHANNEL_STATE_STOPPED = 0, /*!< Stopped */
+ ALT_DMA_CHANNEL_STATE_EXECUTING = 1, /*!< Executing */
+ ALT_DMA_CHANNEL_STATE_CACHE_MISS = 2, /*!< Cache Miss */
+ ALT_DMA_CHANNEL_STATE_UPDATING_PC = 3, /*!< Updating PC */
+ ALT_DMA_CHANNEL_STATE_WFE = 4, /*!< Waiting for Event */
+ ALT_DMA_CHANNEL_STATE_AT_BARRIER = 5, /*!< At Barrier */
+ ALT_DMA_CHANNEL_STATE_WFP = 7, /*!< Waiting for Peripheral */
+ ALT_DMA_CHANNEL_STATE_KILLING = 8, /*!< Killing */
+ ALT_DMA_CHANNEL_STATE_COMPLETING = 9, /*!< Completing */
+ ALT_DMA_CHANNEL_STATE_FAULTING_COMPLETING = 14, /*!< Faulting Completing */
+ ALT_DMA_CHANNEL_STATE_FAULTING = 15 /*!< Faulting */
+}
+ALT_DMA_CHANNEL_STATE_t;
+
+/*!
+ * This type definition enumerates the possible fault status that the DMA
+ * manager can have as a register mask.
+ */
+typedef enum ALT_DMA_MANAGER_FAULT_e
+{
+ /*!
+ * The DMA manager abort occured because of an instruction issued through
+ * the debug interface.
+ */
+ ALT_DMA_MANAGER_FAULT_DBG_INSTR = (int32_t)(1UL << 30),
+
+ /*!
+ * The DMA manager instruction fetch AXI bus response was not OKAY.
+ */
+ ALT_DMA_MANAGER_FAULT_INSTR_FETCH_ERR = (int32_t)(1UL << 16),
+
+ /*!
+ * The DMA manager attempted to execute DMAWFE or DMASEV with
+ * inappropriate security permissions.
+ */
+ ALT_DMA_MANAGER_FAULT_MGR_EVNT_ERR = (int32_t)(1UL << 5),
+
+ /*!
+ * The DMA manager attempted to execute DMAGO with inappropriate security
+ * permissions.
+ */
+ ALT_DMA_MANAGER_FAULT_DMAGO_ERR = (int32_t)(1UL << 4),
+
+ /*!
+ * The DMA manager attempted to execute an instruction operand that was
+ * not valid for the DMA configuration.
+ */
+ ALT_DMA_MANAGER_FAULT_OPERAND_INVALID = (int32_t)(1UL << 1),
+
+ /*!
+ * The DMA manager attempted to execute an undefined instruction.
+ */
+ ALT_DMA_MANAGER_FAULT_UNDEF_INSTR = (int32_t)(1UL << 0)
+}
+ALT_DMA_MANAGER_FAULT_t;
+
+/*!
+ * This type definition enumerates the possible fault status that a channel
+ * may have as a register mask.
+ */
+typedef enum ALT_DMA_CHANNEL_FAULT_e
+{
+ /*!
+ * The DMA channel has locked up due to resource starvation.
+ */
+ ALT_DMA_CHANNEL_FAULT_LOCKUP_ERR = (int32_t)(1UL << 31),
+
+ /*!
+ * The DMA channel abort occured because of an instruction issued through
+ * the debug interface.
+ */
+ ALT_DMA_CHANNEL_FAULT_DBG_INSTR = (int32_t)(1UL << 30),
+
+ /*!
+ * The DMA channel data read AXI bus reponse was not OKAY.
+ */
+ ALT_DMA_CHANNEL_FAULT_DATA_READ_ERR = (int32_t)(1UL << 18),
+
+ /*!
+ * The DMA channel data write AXI bus response was not OKAY.
+ */
+ ALT_DMA_CHANNEL_FAULT_DATA_WRITE_ERR = (int32_t)(1UL << 17),
+
+ /*!
+ * The DMA channel instruction fetch AXI bus response was not OKAY.
+ */
+ ALT_DMA_CHANNEL_FAULT_INSTR_FETCH_ERR = (int32_t)(1UL << 16),
+
+ /*!
+ * The DMA channel MFIFO did not have the data for the DMAST instruction.
+ */
+ ALT_DMA_CHANNEL_FAULT_ST_DATA_UNAVAILABLE = (int32_t)(1UL << 13),
+
+ /*!
+ * The DMA channel MFIFO is too small to hold the DMALD instruction data,
+ * or too small to servic the DMAST instruction request.
+ */
+ ALT_DMA_CHANNEL_FAULT_MFIFO_ERR = (int32_t)(1UL << 12),
+
+ /*!
+ * The DMA channel in non-secure state attempted to perform a secure read
+ * or write.
+ */
+ ALT_DMA_CHANNEL_FAULT_CH_RDWR_ERR = (int32_t)(1UL << 7),
+
+ /*!
+ * The DMA channel in non-secure state attempted to execute the DMAWFP,
+ * DMALDP, DMASTP, or DMAFLUSHP instruction involving a secure peripheral.
+ */
+ ALT_DMA_CHANNEL_FAULT_CH_PERIPH_ERR = (int32_t)(1UL << 6),
+
+ /*!
+ * The DMA channel in non-secure state attempted to execute the DMAWFE or
+ * DMASEV instruction for a secure event or secure interrupt (if
+ * applicable).
+ */
+ ALT_DMA_CHANNEL_FAULT_CH_EVNT_ERR = (int32_t)(1UL << 5),
+
+ /*!
+ * The DMA channel attempted to execute an instruction operand that was
+ * not valid for the DMA configuration.
+ */
+ ALT_DMA_CHANNEL_FAULT_OPERAND_INVALID = (int32_t)(1UL << 1),
+
+ /*!
+ * The DMA channel attempted to execute an undefined instruction.
+ */
+ ALT_DMA_CHANNEL_FAULT_UNDEF_INSTR = (int32_t)(1UL << 0)
+}
+ALT_DMA_CHANNEL_FAULT_t;
+
+/*!
+ * This type definition enumerates the possible DMA event-interrupt behavior
+ * option selections when a DMASEV instruction is executed.
+ */
+typedef enum ALT_DMA_EVENT_SELECT_e
+{
+ /*!
+ * If the DMA controller executes DMASEV for the event-interrupt resource
+ * then the DMA sends the event to all of the channel threads.
+ */
+ ALT_DMA_EVENT_SELECT_SEND_EVT,
+
+ /*!
+ * If the DMA controller executes DMASEV for the event-interrupt resource
+ * then the DMA sets the \b irq[N] HIGH.
+ */
+ ALT_DMA_EVENT_SELECT_SIG_IRQ
+}
+ALT_DMA_EVENT_SELECT_t;
+
+/*!
+ * This type enumerates the DMA peripheral interface MUX selection options
+ * available.
+ */
+typedef enum ALT_DMA_PERIPH_MUX_e
+{
+ /*!
+ * Accept the reset default MUX selection
+ */
+ ALT_DMA_PERIPH_MUX_DEFAULT = 0,
+
+ /*!
+ * Select FPGA as the peripheral interface
+ */
+ ALT_DMA_PERIPH_MUX_FPGA = 1,
+
+ /*!
+ * Select CAN as the peripheral interface
+ */
+ ALT_DMA_PERIPH_MUX_CAN = 2
+}
+ALT_DMA_PERIPH_MUX_t;
+
+/*!
+ * This type defines the structure used to specify the configuration of the
+ * security states and peripheral interface MUX selections for the DMA
+ * controller.
+ */
+typedef struct ALT_DMA_CFG_s
+{
+ /*!
+ * DMA Manager security state configuration.
+ */
+ ALT_DMA_SECURITY_t manager_sec;
+
+ /*!
+ * DMA interrupt output security state configurations. Security state
+ * configurations are 0-based index-aligned with the enumeration values
+ * ALT_DMA_EVENT_0 through ALT_DMA_EVENT_7 of the ALT_DMA_EVENT_t type.
+ */
+ ALT_DMA_SECURITY_t irq_sec[8];
+
+ /*!
+ * Peripheral request interface security state configurations. Security
+ * state configurations are 0-based index-aligned with the enumeration
+ * values of the ALT_DMA_PERIPH_t type.
+ */
+ ALT_DMA_SECURITY_t periph_sec[32];
+
+ /*!
+ * DMA Peripheral Register Interface MUX Selections. MUX selections are
+ * 0-based index-aligned with the enumeration values
+ * ALT_DMA_PERIPH_FPGA_4_OR_CAN0_IF1 through
+ * ALT_DMA_PERIPH_FPGA_7_OR_CAN1_IF2 of the ALT_DMA_PERIPH_t type.
+ */
+ ALT_DMA_PERIPH_MUX_t periph_mux[4];
+}
+ALT_DMA_CFG_t;
+
+/*!
+ * Initialize the DMA controller.
+ *
+ * Initializes the DMA controller by setting the necessary control values to
+ * establish the security state and MUXed peripheral request interface selection
+ * configurations before taking the DMA controller out of reset.
+ *
+ * After the DMA is initialized, the following conditions hold true:
+ * * All DMA channel threads are in the Stopped state.
+ * * All DMA channel threads are available for allocation.
+ * * DMA Manager thread is waiting for an instruction from either APB
+ * interface.
+ * * The security state configurations of the DMA Manager, interrupt outputs,
+ * and peripheral request interfaces are established and immutable until the
+ * DMA is reset.
+ * * The MUXed peripheral request interface selection configurations are
+ * established and immutable until the DMA is reset.
+ *
+ * \param dma_cfg
+ * A pointer to a ALT_DMA_CFG_t structure containing the desired
+ * DMA controller security state and peripheral request interface
+ * MUX selections.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_init(const ALT_DMA_CFG_t * dma_cfg);
+
+/*!
+ * Uninitializes the DMA controller.
+ *
+ * Uninitializes the DMA controller by killing any running channel threads and
+ * putting the DMA controller into reset.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_uninit(void);
+
+/*!
+ * Allocate a DMA channel resource for use.
+ *
+ * \param channel
+ * A DMA controller channel.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_channel_alloc(ALT_DMA_CHANNEL_t channel);
+
+/*!
+ * Allocate a free DMA channel resource for use if there are any.
+ *
+ * \param allocated
+ * [out] A pointer to an output parameter that will contain the
+ * channel allocated.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed. An unallocated channel
+ * may not be available at the time of the API
+ * call.
+ */
+ALT_STATUS_CODE alt_dma_channel_alloc_any(ALT_DMA_CHANNEL_t * allocated);
+
+/*!
+ * Free a DMA channel resource for reuse.
+ *
+ * \param channel
+ * The DMA controller channel resource to free.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed. The channel may not be in
+ * the STOPPED state.
+ */
+ALT_STATUS_CODE alt_dma_channel_free(ALT_DMA_CHANNEL_t channel);
+
+/*!
+ * Start execution of a DMA microcode program on the specified DMA channel
+ * thread resource.
+ *
+ * \param channel
+ * The DMA channel thread used to execute the microcode program.
+ *
+ * \param pgm
+ * The DMA microcode program.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_channel_exec(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Kill (abort) execution of any microcode program executing on the specified
+ * DMA channel thread resource.
+ *
+ * Terminates the channel thread of execution by issuing a DMAKILL instruction
+ * using the DMA APB slave interface.
+ *
+ * \param channel
+ * The DMA channel thread to abort any executing microcode program
+ * on.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_TMO Timeout waiting for the channel to change into
+ * KILLING or STOPPED state.
+ */
+ALT_STATUS_CODE alt_dma_channel_kill(ALT_DMA_CHANNEL_t channel);
+
+/*!
+ * Returns the current register value for the given DMA channel.
+ *
+ * \param channel
+ * The DMA channel thread to abort any executing microcode program
+ * on.
+ *
+ * \param reg
+ * Register to get the value for.
+ *
+ * \param val
+ * [out] The current value of the requested register.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The specified channel or register is invalid.
+ */
+ALT_STATUS_CODE alt_dma_channel_reg_get(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_REG_t reg, uint32_t * val);
+
+/*!
+ * Signals the occurrence of an event or interrupt, using the specified event
+ * number.
+ *
+ * Causes the CPU to issue a DMASEV instruction using the DMA APB slave
+ * interface.
+ *
+ * The Interrupt Enable Register (INTEN) register is used to control if each
+ * event-interrupt resource is either an event or an interrupt. The INTEN
+ * register sets the event-interrupt resource to function as an:
+ * * Event - The DMAC generates an event for the specified event-interrupt
+ * resource. When the DMAC executes a DMAWFE instruction for the
+ * same event-interrupt resource then it clears the event.
+ * * Interrupt - The DMAC sets the \b IRQ[N] signal high, where
+ * \e evt_num is the number of the specified event
+ * resource. The interrupt must be cleared after being handled.
+ *
+ * When the configured to generate an event, this function may be used to
+ * restart one or more waiting DMA channels (i.e. having executed a DMAWFE
+ * instruction).
+ *
+ * See the following sections from the \e ARM DDI 0424C, CoreLink DMA Controller
+ * DMA-330 Technical Reference Manual for implementation details and use cases:
+ * * 2.5.1, Issuing Instructions to the DMAC using a Slave Interface
+ * * 2.7, Using Events and Interrupts
+ *
+ * \param evt_num
+ * A DMA event-interrupt resource. Allowable event values may be
+ * ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 but ALT_DMA_EVENT_ABORT is
+ * not.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given event number is invalid.
+ */
+ALT_STATUS_CODE alt_dma_send_event(ALT_DMA_EVENT_t evt_num);
+
+/*!
+ * Returns the current operational state of the DMA manager thread.
+ *
+ * \param state
+ * [out] Pointer to an output parameter to contain the DMA
+ * channel thread state.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_manager_state_get(ALT_DMA_MANAGER_STATE_t * state);
+
+/*!
+ * Returns the current operational state of the specified DMA channel thread.
+ *
+ * \param channel
+ * The DMA channel thread to return the operational state of.
+ *
+ * \param state
+ * [out] Pointer to an output parameter to contain the DMA
+ * channel thread state.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_channel_state_get(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_CHANNEL_STATE_t * state);
+
+/*!
+ * Return the current fault status of the DMA manager thread.
+ *
+ * \param fault
+ * [out] Pointer to an output parameter to contain the DMA
+ * manager fault status.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_dma_manager_fault_status_get(ALT_DMA_MANAGER_FAULT_t * fault);
+
+/*!
+ * Return the current fault status of the specified DMA channel thread.
+ *
+ * \param channel
+ * The DMA channel thread to return the fault status of.
+ *
+ * \param fault
+ * [out] Pointer to an output parameter to contain the DMA
+ * channel fault status.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_channel_fault_status_get(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_CHANNEL_FAULT_t * fault);
+
+/*!
+ * Select whether the DMA controller sends the specific event to all channel
+ * threads or signals an interrupt using the corressponding \b irq when a DMASEV
+ * instruction is executed for the specified event-interrupt resource number.
+ *
+ * \param evt_num
+ * The event-interrupt resource number. Valid values are
+ * ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT.
+ *
+ * \param opt
+ * The desired behavior selection for \e evt_num when a DMASEV is
+ * executed.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given selection identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_event_int_select(ALT_DMA_EVENT_t evt_num,
+ ALT_DMA_EVENT_SELECT_t opt);
+
+/*!
+ * Returns the status of the specified event-interrupt resource.
+ *
+ * Returns ALT_E_TRUE if event is active or \b irq[N] is HIGH and returns
+ * ALT_E_FALSE if event is inactive or \b irq[N] is LOW.
+ *
+ * \param evt_num
+ * The event-interrupt resource number. Valid values are
+ * ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT.
+ *
+ * \retval ALT_E_TRUE Event is active or \b irq[N] is HIGH.
+ * \retval ALT_E_FALSE Event is inactive or \b irq[N] is LOW.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given event identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_event_int_status_get_raw(ALT_DMA_EVENT_t evt_num);
+
+/*!
+ * Returns the status of the specified interrupt resource.
+ *
+ * Returns ALT_E_TRUE if interrupt is active and therfore \b irq[N] is HIGH and
+ * returns ALT_E_FALSE if interrupt is inactive and therfore \b irq[N] is LOW.
+ *
+ * \param irq_num
+ * The interrupt resource number. Valid values are
+ * ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT.
+ *
+ * \retval ALT_E_TRUE Event is active or \b irq[N] is HIGH.
+ * \retval ALT_E_FALSE Event is inactive or \b irq[N] is LOW.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given event identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_int_status_get(ALT_DMA_EVENT_t irq_num);
+
+/*!
+ * Clear the active (HIGH) status of the specified interrupt resource.
+ *
+ * If the specified interrupt is HIGH, then sets \b irq[N] to LOW if the
+ * event-interrupt resource is configured (see: alt_dma_event_int_enable())
+ * to signal an interrupt. Otherwise, the status of \b irq[N] does not change.
+ *
+ * \param irq_num
+ * The interrupt resource number. Valid values are
+ * ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given event identifier is invalid.
+ */
+ALT_STATUS_CODE alt_dma_int_clear(ALT_DMA_EVENT_t irq_num);
+
+/*!
+ * @}
+ */
+
+/*!
+ * \addtogroup ALT_DMA_STD_OPS DMA API for Standard Operations
+ *
+ * The functions in this group provide common DMA operations for common bulk
+ * data transfers between:
+ * * Memory to Memory
+ * * Zero to Memory
+ * * Memory to Peripheral
+ * * Peripheral to Memory
+ *
+ * All DMA operations are asynchronous. The following are the ways to receive
+ * notification of a DMA transfer complete operation:
+ * * Use alt_dma_channel_state_get() and poll for the
+ * ALT_DMA_CHANNEL_STATE_STOPPED status.
+ * * In conjunction with the interrupt API, use DMA events to signal an
+ * interrupt. The event first must be configured to signal an interrupt
+ * using alt_dma_event_int_select(). Configure the DMA program to send an
+ * event.
+ * * Construct a custom program which waits for a particular event number by
+ * assemblying a DMAWFE using alt_dma_program_DMAWFE(). Then run the custom
+ * program on a different channel. The custom program will wait until the
+ * DMA program sends the event. Configure the DMA program to send an event.
+ *
+ * Cache related maintenance on the source and/or destinatino buffer are not
+ * handled the DMA API and are the responsibility of the programmer. This is
+ * because the DMA API does not have visibility into the current configuration
+ * of the MMU or know about any special considerations regarding the source
+ * and/or destination memory. The following are some example scenarios and
+ * cache maintenance related precautions that may need to be taken:
+ * * alt_dma_memory_to_memory(): Source buffer should be cleaned or purged,
+ * destination buffer should be invalidated.
+ * * alt_dma_zero_to_memory(): Destination buffer should be invalidated.
+ * * alt_dma_memory_to_register(): Source buffer should be cleaned or purged.
+ * * alt_dma_register_to_memory(): Destination buffer should be invalidated.
+ * * alt_dma_memory_to_periph(): Source buffer should be cleaned or purged.
+ * * alt_dma_periph_to_memory(): Destination buffer should be invalidated.
+ *
+ * @{
+ */
+
+/*!
+ * Uses the DMA engine to asynchronously copy the specified memory from the
+ * given source address to the given destination address.
+ *
+ * Overlapping memory regions are not supported.
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param dest
+ * The destination memory address to copy to.
+ *
+ * \param src
+ * The source memory address to copy from.
+ *
+ * \param size
+ * The size of the transfer in bytes.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel or event identifier (if
+ * used) is invalid, or the memory regions
+ * specified are overlapping.
+ */
+ALT_STATUS_CODE alt_dma_memory_to_memory(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ void * dest,
+ const void * src,
+ size_t size,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Uses the DMA engine to asynchronously zero out the specified memory buffer.
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param buf
+ * The buffer memory address to zero out.
+ *
+ * \param size
+ * The size of the buffer in bytes.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel or event identifier (if
+ * used) is invalid.
+ */
+ALT_STATUS_CODE alt_dma_zero_to_memory(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ void * buf,
+ size_t size,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Uses the DMA engine to asynchronously transfer the contents of a memory
+ * buffer to a keyhole register.
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param dst_reg
+ * The address of the register to write buffer to.
+ *
+ * \param src_buf
+ * The address of the memory buffer for the data.
+ *
+ * \param count
+ * The number of transfers to make.
+ *
+ * \param register_width_bits
+ * The width of the register to transfer to in bits. Valid values
+ * are 8, 16, 32, and 64.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel, event identifier (if used),
+ * or register width are invalid, or if the
+ * destination register or source buffer is
+ * unaligned to the register width.
+ */
+ALT_STATUS_CODE alt_dma_memory_to_register(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ void * dst_reg,
+ const void * src_buf,
+ size_t count,
+ uint32_t register_width_bits,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Uses the DMA engine to asynchronously transfer the contents of a keyhole
+ * register to a memory buffer.
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param dst_buf
+ * The address of the memory buffer to copy to.
+ *
+ * \param src_reg
+ * The address of the keyhole register to read from.
+ *
+ * \param count
+ * The number of transfers to make.
+ *
+ * \param register_width_bits
+ * The width of the register to transfer to in bits. Valid values
+ * are 8, 16, 32, and 64.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel, event identifier (if used),
+ * or register width are invalid, or if the
+ * destination buffer or source register is
+ * unaligned to the register width.
+ */
+ALT_STATUS_CODE alt_dma_register_to_memory(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ void * dst_buf,
+ const void * src_reg,
+ size_t count,
+ uint32_t register_width_bits,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Uses the DMA engine to asynchronously copy memory from the given source
+ * address to the specified peripheral. Because different peripheral has
+ * different characteristics, individual peripherals need to be explicitly
+ * supported.
+ *
+ * The following lists the peripheral IDs supported by this API:
+ * * ALT_DMA_PERIPH_QSPI_FLASH_TX
+ * * ALT_DMA_PERIPH_UART0_TX
+ * * ALT_DMA_PERIPH_UART1_TX
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param dest
+ * The destination peripheral to copy memory to.
+ *
+ * \param src
+ * The source memory address to copy from.
+ *
+ * \param size
+ * The size of the transfer in bytes.
+ *
+ * \param periph_info
+ * A pointer to a peripheral specific data structure. The
+ * following list shows what data structure should be used for
+ * peripherals:
+ * * ALT_DMA_PERIPH_QSPI_FLASH_TX: This parameter is ignored.
+ * * ALT_DMA_PERIPH_UART0_TX: Use a pointer to the
+ * ALT_16550_HANDLE_t used to interact with that UART.
+ * * ALT_DMA_PERIPH_UART1_TX: Use a pointer to the
+ * ALT_16550_HANDLE_t used to interact with that UART.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel, peripheral, or event
+ * identifier (if used) is invalid.
+ *
+ * \internal
+ * Priority peripheral IDs to be supported:
+ * * ALT_DMA_PERIPH_FPGA_0
+ * * ALT_DMA_PERIPH_FPGA_1
+ * * ALT_DMA_PERIPH_FPGA_2
+ * * ALT_DMA_PERIPH_FPGA_3
+ * * ALT_DMA_PERIPH_FPGA_4
+ * * ALT_DMA_PERIPH_FPGA_5
+ * * ALT_DMA_PERIPH_FPGA_6
+ * * ALT_DMA_PERIPH_FPGA_7
+ * * ALT_DMA_PERIPH_I2C0_TX
+ * * ALT_DMA_PERIPH_I2C1_TX
+ * * ALT_DMA_PERIPH_I2C2_TX
+ * * ALT_DMA_PERIPH_I2C3_TX
+ * * ALT_DMA_PERIPH_SPI0_MASTER_TX
+ * * ALT_DMA_PERIPH_SPI0_SLAVE_TX
+ * * ALT_DMA_PERIPH_SPI1_MASTER_TX
+ * * ALT_DMA_PERIPH_SPI1_SLAVE_TX
+ * \endinternal
+ */
+ALT_STATUS_CODE alt_dma_memory_to_periph(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ ALT_DMA_PERIPH_t dest,
+ const void * src,
+ size_t size,
+ void * periph_info,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Uses the DMA engine to copy memory from the specified peripheral to the
+ * given destination address. Because different peripheral has different
+ * characteristics, individual peripherals need to be explicitly supported.
+ *
+ * The following lists the peripheral IDs supported by this API:
+ * * ALT_DMA_PERIPH_QSPI_FLASH_RX
+ * * ALT_DMA_PERIPH_UART0_RX
+ * * ALT_DMA_PERIPH_UART1_RX
+ *
+ * \param channel
+ * The DMA channel thread to use for the transfer.
+ *
+ * \param program
+ * An allocated DMA program buffer to use for the life of the
+ * transfer.
+ *
+ * \param dest
+ * The destination memory address to copy to.
+ *
+ * \param src
+ * The source peripheral to copy memory from.
+ *
+ * \param size
+ * The size of the transfer in bytes.
+ *
+ * \param periph_info
+ * A pointer to a peripheral specific data structure. The
+ * following list shows what data structure should be used for
+ * peripherals:
+ * * ALT_DMA_PERIPH_QSPI_FLASH_RX: This parameter is ignored.
+ * * ALT_DMA_PERIPH_UART0_RX: Use a pointer to the
+ * ALT_16550_HANDLE_t used to interact with that UART.
+ * * ALT_DMA_PERIPH_UART1_RX: Use a pointer to the
+ * ALT_16550_HANDLE_t used to interact with that UART.
+ *
+ * \param send_evt
+ * If set to true, the DMA engine will be instructed to send an
+ * event upon completion or fault.
+ *
+ * \param evt
+ * If send_evt is true, the event specified will be sent.
+ * Otherwise the parameter is ignored.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG The given channel, peripheral, or event
+ * identifier (if used) is invalid.
+*
+ * \internal
+ * Priority peripheral IDs to be supported:
+ * * ALT_DMA_PERIPH_FPGA_0
+ * * ALT_DMA_PERIPH_FPGA_1
+ * * ALT_DMA_PERIPH_FPGA_2
+ * * ALT_DMA_PERIPH_FPGA_3
+ * * ALT_DMA_PERIPH_FPGA_4
+ * * ALT_DMA_PERIPH_FPGA_5
+ * * ALT_DMA_PERIPH_FPGA_6
+ * * ALT_DMA_PERIPH_FPGA_7
+ * * ALT_DMA_PERIPH_I2C0_RX
+ * * ALT_DMA_PERIPH_I2C1_RX
+ * * ALT_DMA_PERIPH_I2C2_RX
+ * * ALT_DMA_PERIPH_I2C3_RX
+ * * ALT_DMA_PERIPH_SPI0_MASTER_RX
+ * * ALT_DMA_PERIPH_SPI0_SLAVE_RX
+ * * ALT_DMA_PERIPH_SPI1_MASTER_RX
+ * * ALT_DMA_PERIPH_SPI1_SLAVE_RX
+ * \endinternal
+ */
+ALT_STATUS_CODE alt_dma_periph_to_memory(ALT_DMA_CHANNEL_t channel,
+ ALT_DMA_PROGRAM_t * program,
+ void * dest,
+ ALT_DMA_PERIPH_t src,
+ size_t size,
+ void * periph_info,
+ bool send_evt,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * @}
+ */
+
+/*!
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ALT_DMA_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h
new file mode 100644
index 0000000000..e82bc1ae4d
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h
@@ -0,0 +1,162 @@
+/******************************************************************************
+ *
+ * Copyright 2013 Altera Corporation. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+ *
+ ******************************************************************************/
+
+#ifndef __ALT_DMA_COMMON_H__
+#define __ALT_DMA_COMMON_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*!
+ * \addtogroup ALT_DMA_COMMON DMA Controller Common API Definitions
+ *
+ * This module contains the common definitions for the DMA controller related
+ * APIs.
+ *
+ * @{
+ */
+
+/*!
+ * This type definition enumerates the DMA controller channel threads.
+ */
+typedef enum ALT_DMA_CHANNEL_e
+{
+ ALT_DMA_CHANNEL_0 = 0, /*!< DMA Channel Thread 0 */
+ ALT_DMA_CHANNEL_1 = 1, /*!< DMA Channel Thread 1 */
+ ALT_DMA_CHANNEL_2 = 2, /*!< DMA Channel Thread 2 */
+ ALT_DMA_CHANNEL_3 = 3, /*!< DMA Channel Thread 3 */
+ ALT_DMA_CHANNEL_4 = 4, /*!< DMA Channel Thread 4 */
+ ALT_DMA_CHANNEL_5 = 5, /*!< DMA Channel Thread 5 */
+ ALT_DMA_CHANNEL_6 = 6, /*!< DMA Channel Thread 6 */
+ ALT_DMA_CHANNEL_7 = 7 /*!< DMA Channel Thread 7 */
+}
+ALT_DMA_CHANNEL_t;
+
+/*!
+ * This type definition enumerates the SoC system peripherals implementing the
+ * required request interface that enables direct DMA transfers to/from the
+ * device.
+ *
+ * FPGA soft IP interface to the DMA are required to comply with the Synopsys
+ * protocol.
+ *
+ * Request interface numbers 4 through 7 are multiplexed between the CAN
+ * controllers and soft logic implemented in the FPGA fabric. The selection
+ * between the CAN controller and FPGA interfaces is determined at DMA
+ * initialization.
+ */
+typedef enum ALT_DMA_PERIPH_e
+{
+ ALT_DMA_PERIPH_FPGA_0 = 0, /*!< FPGA soft IP interface 0 */
+ ALT_DMA_PERIPH_FPGA_1 = 1, /*!< FPGA soft IP interface 1 */
+ ALT_DMA_PERIPH_FPGA_2 = 2, /*!< FPGA soft IP interface 2 */
+ ALT_DMA_PERIPH_FPGA_3 = 3, /*!< FPGA soft IP interface 3 */
+
+ ALT_DMA_PERIPH_FPGA_4_OR_CAN0_IF1 = 4, /*!< Selectively MUXed FPGA 4 or CAN 0 interface 1 */
+ ALT_DMA_PERIPH_FPGA_5_OR_CAN0_IF2 = 5, /*!< Selectively MUXed FPGA 5 or CAN 0 interface 2 */
+ ALT_DMA_PERIPH_FPGA_6_OR_CAN1_IF1 = 6, /*!< Selectively MUXed FPGA 6 or CAN 1 interface 1 */
+ ALT_DMA_PERIPH_FPGA_7_OR_CAN1_IF2 = 7, /*!< Selectively MUXed FPGA 7 or CAN 1 interface 2 */
+
+ ALT_DMA_PERIPH_FPGA_4 = 4, /*!< Alias for ALT_DMA_PERIPH_FPGA_4_OR_CAN0_IF1 */
+ ALT_DMA_PERIPH_FPGA_5 = 5, /*!< Alias for ALT_DMA_PERIPH_FPGA_5_OR_CAN0_IF2 */
+ ALT_DMA_PERIPH_FPGA_6 = 6, /*!< Alias for ALT_DMA_PERIPH_FPGA_6_OR_CAN1_IF1 */
+ ALT_DMA_PERIPH_FPGA_7 = 7, /*!< Alias for ALT_DMA_PERIPH_FPGA_7_OR_CAN1_IF2 */
+
+ ALT_DMA_PERIPH_CAN0_IF1 = 4, /*!< Alias for ALT_DMA_PERIPH_FPGA_4_OR_CAN0_IF1 */
+ ALT_DMA_PERIPH_CAN0_IF2 = 5, /*!< Alias for ALT_DMA_PERIPH_FPGA_5_OR_CAN0_IF2 */
+ ALT_DMA_PERIPH_CAN1_IF1 = 6, /*!< Alias for ALT_DMA_PERIPH_FPGA_6_OR_CAN1_IF1 */
+ ALT_DMA_PERIPH_CAN1_IF2 = 7, /*!< Alias for ALT_DMA_PERIPH_FPGA_7_OR_CAN1_IF2 */
+
+ ALT_DMA_PERIPH_I2C0_TX = 8, /*!< I<sup>2</sup>C 0 TX */
+ ALT_DMA_PERIPH_I2C0_RX = 9, /*!< I<sup>2</sup>C 0 RX */
+ ALT_DMA_PERIPH_I2C1_TX = 10, /*!< I<sup>2</sup>C 1 TX */
+ ALT_DMA_PERIPH_I2C1_RX = 11, /*!< I<sup>2</sup>C 1 RX */
+ ALT_DMA_PERIPH_I2C2_TX = 12, /*!< I<sup>2</sup>C 2 TX */
+ ALT_DMA_PERIPH_I2C2_RX = 13, /*!< I<sup>2</sup>C 2 RX */
+ ALT_DMA_PERIPH_I2C3_TX = 14, /*!< I<sup>2</sup>C 3 TX */
+ ALT_DMA_PERIPH_I2C3_RX = 15, /*!< I<sup>2</sup>C 3 RX */
+ ALT_DMA_PERIPH_SPI0_MASTER_TX = 16, /*!< SPI 0 Master TX */
+ ALT_DMA_PERIPH_SPI0_MASTER_RX = 17, /*!< SPI 0 Master RX */
+ ALT_DMA_PERIPH_SPI0_SLAVE_TX = 18, /*!< SPI 0 Slave TX */
+ ALT_DMA_PERIPH_SPI0_SLAVE_RX = 19, /*!< SPI 0 Slave RX */
+ ALT_DMA_PERIPH_SPI1_MASTER_TX = 20, /*!< SPI 1 Master TX */
+ ALT_DMA_PERIPH_SPI1_MASTER_RX = 21, /*!< SPI 1 Master RX */
+ ALT_DMA_PERIPH_SPI1_SLAVE_TX = 22, /*!< SPI 1 Slave TX */
+ ALT_DMA_PERIPH_SPI1_SLAVE_RX = 23, /*!< SPI 1 Slave RX */
+ ALT_DMA_PERIPH_QSPI_FLASH_TX = 24, /*!< QSPI Flash TX */
+ ALT_DMA_PERIPH_QSPI_FLASH_RX = 25, /*!< QSPI Flash RX */
+ ALT_DMA_PERIPH_STM = 26, /*!< System Trace Macrocell */
+ ALT_DMA_PERIPH_RESERVED = 27, /*!< Reserved */
+ ALT_DMA_PERIPH_UART0_TX = 28, /*!< UART 0 TX */
+ ALT_DMA_PERIPH_UART0_RX = 29, /*!< UART 0 RX */
+ ALT_DMA_PERIPH_UART1_TX = 30, /*!< UART 1 TX */
+ ALT_DMA_PERIPH_UART1_RX = 31 /*!< UART 1 RX */
+}
+ALT_DMA_PERIPH_t;
+
+/*!
+ * This type enumerates the DMA security state options available.
+ */
+typedef enum ALT_DMA_SECURITY_e
+{
+ ALT_DMA_SECURITY_DEFAULT = 0, /*!< Use the default security value (e.g. reset default) */
+ ALT_DMA_SECURITY_SECURE = 1, /*!< Secure */
+ ALT_DMA_SECURITY_NONSECURE = 2 /*!< Non-secure */
+}
+ALT_DMA_SECURITY_t;
+
+/*!
+ * This type definition enumerates the DMA event-interrupt resources.
+ */
+typedef enum ALT_DMA_EVENT_e
+{
+ ALT_DMA_EVENT_0 = 0, /*!< DMA Event 0 */
+ ALT_DMA_EVENT_1 = 1, /*!< DMA Event 1 */
+ ALT_DMA_EVENT_2 = 2, /*!< DMA Event 2 */
+ ALT_DMA_EVENT_3 = 3, /*!< DMA Event 3 */
+ ALT_DMA_EVENT_4 = 4, /*!< DMA Event 4 */
+ ALT_DMA_EVENT_5 = 5, /*!< DMA Event 5 */
+ ALT_DMA_EVENT_6 = 6, /*!< DMA Event 6 */
+ ALT_DMA_EVENT_7 = 7, /*!< DMA Event 7 */
+ ALT_DMA_EVENT_ABORT = 8 /*!< DMA Abort Event */
+}
+ALT_DMA_EVENT_t;
+
+/*!
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ALT_DMA_COMMON_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h
new file mode 100644
index 0000000000..5fa876f237
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h
@@ -0,0 +1,951 @@
+/******************************************************************************
+ *
+ * Copyright 2013 Altera Corporation. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+ *
+ ******************************************************************************/
+
+#ifndef __ALT_DMA_PROGRAM_H__
+#define __ALT_DMA_PROGRAM_H__
+
+#include "hwlib.h"
+#include "alt_dma_common.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*!
+ * \addtogroup ALT_DMA_PRG DMA Controller Programming API
+ *
+ * This API provides functions for dynamically defining and assembling microcode
+ * programs for execution on the DMA controller.
+ *
+ * The microcode program assembly API provides users with the ability to develop
+ * highly optimized and tailored algorithms for data transfer between SoC FPGA
+ * IP blocks and/or system memory.
+ *
+ * The same microcode program assembly facilities are also used to implement the
+ * functions found in the HWLIB Common DMA Operations functional API.
+ *
+ * An ALT_DMA_PROGRAM_t structure is used to contain and assemble a DMA
+ * microcode program. The storage for an ALT_DMA_PROGRAM_t stucture is allocated
+ * from used specified system memory. Once a microcode program has been
+ * assembled in a ALT_DMA_PROGRAM_t it may be excecuted on a designated DMA
+ * channel thread. The microcode program may be rerun on any DMA channel thread
+ * whenever required as long as the integrity of the ALT_DMA_PROGRAM_t
+ * containing the program is maintained.
+ *
+ * @{
+ */
+
+/*!
+ * This preprocessor declares the DMA channel thread microcode instruction
+ * cache line width in bytes. It is recommended that the program buffers be
+ * sized to a multiple of the cache line size. This will allow for the most
+ * efficient microcode speed and space utilization.
+ */
+#define ALT_DMA_PROGRAM_CACHE_LINE_SIZE (32)
+
+/*!
+ * This preprocessor declares the DMA channel thread microcode instruction
+ * cache line count. Thus the total size of the cache is the cache line size
+ * multipled by the cache line count. Programs larger than the cache size risk
+ * having a cache miss while executing.
+ */
+#define ALT_DMA_PROGRAM_CACHE_LINE_COUNT (16)
+
+/*!
+ * This preprocessor definition determines the size of the program buffer
+ * within the ALT_DMA_PROGRAM_t structure. This size should provide adequate
+ * size for most DMA microcode programs. If calls within this API are
+ * reporting out of memory response codes, consider increasing the provisioned
+ * program buffersize.
+ *
+ * To specify another DMA microcode program buffer size, redefine the macro
+ * below by defining ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE to another size in
+ * your Makefile. It is recommended that the size be a multiple of the
+ * microcode engine cache line size. See ALT_DMA_PROGRAM_CACHE_LINE_SIZE for
+ * more information. The largest supported buffer size is 65536 bytes.
+ */
+#ifndef ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE
+#define ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE (ALT_DMA_PROGRAM_CACHE_LINE_SIZE * ALT_DMA_PROGRAM_CACHE_LINE_COUNT)
+#endif
+
+/*!
+ * This type defines the structure used to assemble and contain a microcode
+ * program which can be executed by the DMA controller. The internal members
+ * are undocumented and should not be altered outside of this API.
+ */
+typedef struct ALT_DMA_PROGRAM_s
+{
+ uint32_t flag;
+
+ uint16_t buffer_start;
+ uint16_t code_size;
+
+ uint16_t loop0;
+ uint16_t loop1;
+
+ uint16_t sar;
+ uint16_t dar;
+
+ /*
+ * Add a little extra space so that regardless of where this structure
+ * sits in memory, a suitable start address can be aligned to the cache
+ * line stride while providing the requested buffer space.
+ */
+ uint8_t program[ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE +
+ ALT_DMA_PROGRAM_CACHE_LINE_SIZE];
+}
+ALT_DMA_PROGRAM_t;
+
+/*!
+ * This type definition enumerates the DMA controller register names for use in
+ * microcode program definition.
+ */
+typedef enum ALT_DMA_PROGRAM_REG_e
+{
+ /*! Source Address Register */
+ ALT_DMA_PROGRAM_REG_SAR = 0x0,
+
+ /*! Destination Address Register */
+ ALT_DMA_PROGRAM_REG_DAR = 0x2,
+
+ /*! Channel Control Register */
+ ALT_DMA_PROGRAM_REG_CCR = 0x1
+}
+ALT_DMA_PROGRAM_REG_t;
+
+/*!
+ * This type definition enumerates the instruction modifier options available
+ * for use with selected DMA microcode instructions.
+ *
+ * The enumerations values are context dependent upon the instruction being
+ * modified.
+ *
+ * For the <b>DMALD[S|B]</b>, <b>DMALDP\<S|B></b>, <b>DMAST[S|B]</b>, and
+ * <b>DMASTP\<S|B></b> microcode instructions, the enumeration
+ * ALT_DMA_PROGRAM_INST_MOD_SINGLE specifies the <b>S</b> option modifier
+ * while the enumeration ALT_DMA_PROGRAM_INST_MOD_BURST specifies the <b>B</b>
+ * option modifier. The enumeration ALT_DMA_PROGRAM_INST_MOD_NONE specifies
+ * that no modifier is present for instructions where use of <b>[S|B]</b> is
+ * optional.
+ *
+ * For the <b>DMAWFP</b> microcode instruction, the enumerations
+ * ALT_DMA_PROGRAM_INST_MOD_SINGLE, ALT_DMA_PROGRAM_INST_MOD_BURST, or
+ * ALT_DMA_PROGRAM_INST_MOD_PERIPH each specify one of the corresponding
+ * options <b>\<single|burst|periph></b>.
+ */
+typedef enum ALT_DMA_PROGRAM_INST_MOD_e
+{
+ /*!
+ * This DMA instruction modifier specifies that no special modifier is
+ * added to the instruction.
+ */
+ ALT_DMA_PROGRAM_INST_MOD_NONE,
+
+ /*!
+ * Depending on the DMA microcode instruction modified, this modifier
+ * specifies <b>S</b> case for a <b>[S|B]</b> or a <b>\<single></b> for a
+ * <b>\<single|burst|periph></b>.
+ */
+ ALT_DMA_PROGRAM_INST_MOD_SINGLE,
+
+ /*!
+ * Depending on the DMA microcode instruction modified, this modifier
+ * specifies <b>B</b> case for a <b>[S|B]</b> or a <b>\<burst></b> for a
+ * <b>\<single|burst|periph></b>.
+ */
+ ALT_DMA_PROGRAM_INST_MOD_BURST,
+
+ /*!
+ * This DMA instruction modifier specifies a <b>\<periph></b> for a
+ * <b>\<single|burst|periph></b>.
+ */
+ ALT_DMA_PROGRAM_INST_MOD_PERIPH
+}
+ALT_DMA_PROGRAM_INST_MOD_t;
+
+/*!
+ * This function initializes a system memory buffer for use as a DMA microcode
+ * program buffer. This should be the first API call made on the program
+ * buffer type.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR Details about error status code
+ */
+ALT_STATUS_CODE alt_dma_program_init(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * This function verifies that the DMA microcode program buffer is no longer
+ * in use and performs any needed uninitialization steps.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR Details about error status code
+ */
+ALT_STATUS_CODE alt_dma_program_uninit(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * This function clears the existing DMA microcode program in the given
+ * program buffer.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR Details about error status code.
+ */
+ALT_STATUS_CODE alt_dma_program_clear(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * This function validate that the given DMA microcode program buffer contains
+ * a well formed program. If caches are enabled, the program buffer contents
+ * will be cleaned to RAM.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \retval ALT_E_SUCCESS The given program is well formed.
+ * \retval ALT_E_ERROR The given program is not well formed.
+ * \retval ALT_E_TMO The cache operation timed out.
+ */
+ALT_STATUS_CODE alt_dma_program_validate(const ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * This function reports the number bytes incremented for the register
+ * specified. The purpose is to determine the progress of an ongoing DMA
+ * transfer.
+ *
+ * It is implemented by calculating the difference of the programmed SAR or DAR
+ * with the current channel SAR or DAR register value.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \param channel
+ * The channel that the program is running on.
+ *
+ * \param reg
+ * Register to change the value for. Valid for only
+ * ALT_DMA_PROGRAM_REG_SAR and ALT_DMA_PROGRAM_REG_DAR.
+ *
+ * \param current
+ * The current snapshot value of the register read from the DMA
+ * channel.
+ *
+ * \param progress
+ * [out] A pointer to a memory location that will be used to store
+ * the number of bytes transfered.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR Details about error status code.
+ * \retval ALT_E_BAD_ARG The specified channel is invalid, the specified
+ * register is invalid, or the DMAMOV for the
+ * specified register has not yet been assembled
+ * in the current program buffer.
+ */
+ALT_STATUS_CODE alt_dma_program_progress_reg(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_REG_t reg,
+ uint32_t current, uint32_t * progress);
+
+/*!
+ * This function updates a pre-existing DMAMOV value affecting the SAR or DAR
+ * registers. This allows for pre-assembled programs that can be used on
+ * different source and destination addresses.
+ *
+ * \param pgm
+ * A pointer to a DMA program buffer structure.
+ *
+ * \param reg
+ * Register to change the value for. Valid for only
+ * ALT_DMA_PROGRAM_REG_SAR and ALT_DMA_PROGRAM_REG_DAR.
+ *
+ * \param val
+ * The value to update to.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR Details about error status code.
+ * \retval ALT_E_BAD_ARG The specified register is invalid or the DMAMOV
+ * for the specified register has not yet been
+ * assembled in the current program buffer.
+ */
+ALT_STATUS_CODE alt_dma_program_update_reg(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_REG_t reg, uint32_t val);
+
+/*!
+ */
+
+/*!
+ * Assembles a DMAADDH (Add Halfword) instruction into the microcode program
+ * buffer. This instruction uses 3 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA program buffer to contain the assembled instruction.
+ *
+ * \param addr_reg
+ * The channel address register (ALT_DMA_PROGRAM_REG_DAR or
+ * ALT_DMA_PROGRAM_REG_SAR) to add the value to.
+ *
+ * \param val
+ * The 16-bit unsigned value to add to the channel address
+ * register.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid channel register specified.
+ */
+// Assembler Syntax: DMAADDH <address_register>, <16-bit immediate>
+ALT_STATUS_CODE alt_dma_program_DMAADDH(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_REG_t addr_reg, uint16_t val);
+
+/*!
+ * Assembles a DMAADNH (Add Negative Halfword) instruction into the microcode
+ * program buffer. This instruction uses 3 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param addr_reg
+ * The channel address register (ALT_DMA_PROGRAM_REG_DAR or
+ * ALT_DMA_PROGRAM_REG_SAR) to add the value to.
+ *
+ * \param val
+ * The 16-bit unsigned value to add to the channel address
+ * register.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid channel register specified.
+ */
+// Assembler Syntax: DMAADNH <address_register>, <16-bit immediate>
+ALT_STATUS_CODE alt_dma_program_DMAADNH(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_REG_t addr_reg, uint16_t val);
+
+/*!
+ * Assembles a DMAEND (End) instruction into the microcode program buffer.
+ * This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMAEND
+ALT_STATUS_CODE alt_dma_program_DMAEND(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMAFLUSHP (Flush Peripheral) instruction into the microcode
+ * program buffer. This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param periph
+ * The peripheral to flush.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid peripheral specified.
+ */
+// Assembler Syntax: DMAFLUSHP <peripheral>
+ALT_STATUS_CODE alt_dma_program_DMAFLUSHP(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PERIPH_t periph);
+
+/*!
+ * Assembles a DMAGO (Go) instruction into the microcode program buffer. This
+ * instruction uses 6 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param channel
+ * The stopped channel to act upon.
+ *
+ * \param val
+ * The value to write to the channel program counter register.
+ *
+ * \param sec
+ * The security state for the operation.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid channel or security specified.
+ */
+// Assembler Syntax: DMAGO <channel_number>, <32-bit_immediate> [, ns]
+ALT_STATUS_CODE alt_dma_program_DMAGO(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_CHANNEL_t channel, uint32_t val,
+ ALT_DMA_SECURITY_t sec);
+
+/*!
+ * Assembles a DMAKILL (Kill) instruction into the microcode program buffer.
+ * This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMAKILL
+ALT_STATUS_CODE alt_dma_program_DMAKILL(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMALD (Load) instruction into the microcode program buffer.
+ * This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param mod
+ * The program instruction modifier for the type of transfer.
+ * Only ALT_DMA_PROGRAM_INST_MOD_SINGLE and
+ * ALT_DMA_PROGRAM_INST_MOD_BURST are valid options.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid instruction modifier specified.
+ */
+// Assembler Syntax: DMALD[S|B]
+ALT_STATUS_CODE alt_dma_program_DMALD(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_INST_MOD_t mod);
+
+/*!
+ * Assembles a DMALDP (Load and notify Peripheral) instruction into the
+ * microcode program buffer. This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param mod
+ * The program instruction modifier for the type of transfer.
+ * Only ALT_DMA_PROGRAM_INST_MOD_SINGLE and
+ * ALT_DMA_PROGRAM_INST_MOD_BURST are valid options.
+ *
+ * \param periph
+ * The peripheral to notify.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid instruction modifier or peripheral
+ * specified.
+ */
+// Assembler Syntax: DMALDP<S|B> <peripheral>
+ALT_STATUS_CODE alt_dma_program_DMALDP(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_INST_MOD_t mod, ALT_DMA_PERIPH_t periph);
+
+/*!
+ * Assembles a DMALP (Loop) instruction into the microcode program buffer.
+ * This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param iterations
+ * The number of iterations to run for. Valid values are 1 - 256.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid iterations specified.
+ * \retval ALT_E_BAD_OPERATION All loop registers are in use.
+ */
+// Assembler Syntax: DMALP [<LC0>|<LC1>] <loop_iterations>
+ALT_STATUS_CODE alt_dma_program_DMALP(ALT_DMA_PROGRAM_t * pgm,
+ uint32_t iterations);
+
+/*!
+ * Assembles a DMALPEND (Loop End) instruction into the microcode program
+ * buffer. This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param mod
+ * The program instruction modifier for the loop terminator. Only
+ * ALT_DMA_PROGRAM_INST_MOD_NONE, ALT_DMA_PROGRAM_INST_MOD_SINGLE
+ * and ALT_DMA_PROGRAM_INST_MOD_BURST are valid options.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid instruction modifier specified.
+ * \retval ALT_E_ARG_RANGE Loop size is too large to be supported.
+ * \retval ALT_E_BAD_OPERATION A valid DMALP or DMALPFE was not added to
+ * the program buffer before adding this
+ * DMALPEND instruction.
+ */
+// Assembler Syntax: DMALPEND[S|B]
+ALT_STATUS_CODE alt_dma_program_DMALPEND(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_INST_MOD_t mod);
+
+/*!
+ * Assembles a DMALPFE (Loop Forever) instruction into the microcode program
+ * buffer. No instruction is added to the buffer but a previous DMALPEND to
+ * create an infinite loop.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMALPFE
+ALT_STATUS_CODE alt_dma_program_DMALPFE(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMAMOV (Move) instruction into the microcode program buffer.
+ * This instruction uses 6 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param chan_reg
+ * The channel non-looping register (ALT_DMA_PROGRAM_REG_SAR,
+ * ALT_DMA_PROGRAM_REG_DAR or ALT_DMA_PROGRAM_REG_CCR) to copy
+ * the value to.
+ *
+ * \param val
+ * The value to write to the specified register.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid channel register specified.
+ */
+// Assembler Syntax: DMAMOV <destination_register>, <32-bit_immediate>
+ALT_STATUS_CODE alt_dma_program_DMAMOV(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_REG_t chan_reg, uint32_t val);
+
+/*!
+ * Assembles a DMANOP (No Operation) instruction into the microcode program
+ * buffer. This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMANOP
+ALT_STATUS_CODE alt_dma_program_DMANOP(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMARMB (Read Memory Barrier) instruction into the microcode
+ * program buffer. This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMARMB
+ALT_STATUS_CODE alt_dma_program_DMARMB(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMASEV (Send Event) instruction into the microcode program
+ * buffer. This instruction uses 2 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param evt
+ * The event to send.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid event specified.
+ */
+// Assembler Syntax: DMASEV <event_num>
+ALT_STATUS_CODE alt_dma_program_DMASEV(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_EVENT_t evt);
+
+/*!
+ * Assembles a DMAST (Store) instruction into the microcode program buffer.
+ * This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param mod
+ * The program instruction modifier for the type of transfer.
+ * Only ALT_DMA_PROGRAM_INST_MOD_SINGLE and
+ * ALT_DMA_PROGRAM_INST_MOD_BURST are valid options.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMAST[S|B]
+ALT_STATUS_CODE alt_dma_program_DMAST(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_INST_MOD_t mod);
+
+/*!
+ * Assembles a DMASTP (Store and notify Peripheral) instruction into the
+ * microcode program buffer. This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param mod
+ * The program instruction modifier for the type of transfer.
+ * Only ALT_DMA_PROGRAM_INST_MOD_SINGLE and
+ * ALT_DMA_PROGRAM_INST_MOD_BURST are valid options.
+ *
+ * \param periph
+ * The peripheral to notify.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid instruction modifier or peripheral
+ * specified.
+ */
+// Assembler Syntax: DMASTP<S|B> <peripheral>
+ALT_STATUS_CODE alt_dma_program_DMASTP(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PROGRAM_INST_MOD_t mod, ALT_DMA_PERIPH_t periph);
+
+/*!
+ * Assembles a DMASTZ (Store Zero) instruction into the microcode program
+ * buffer. This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMASTZ
+ALT_STATUS_CODE alt_dma_program_DMASTZ(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * Assembles a DMAWFE (Wait For Event) instruction into the microcode program
+ * buffer. This instruction uses 2 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param evt
+ * The event to wait for.
+ *
+ * \param invalid
+ * If invalid is set to true, the instruction will be configured
+ * to invalidate the instruction cache for the current DMA
+ * thread.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid event specified.
+ */
+// Assembler Syntax: DMAWFE <event_num>[, invalid]
+ALT_STATUS_CODE alt_dma_program_DMAWFE(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_EVENT_t evt, bool invalid);
+
+/*!
+ * Assembles a DMAWFP (Wait for Peripheral) instruction into the microcode
+ * program buffer. This instruction uses 2 bytes of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \param periph
+ * The peripheral to wait on.
+ *
+ * \param mod
+ * The program instruction modifier for the type of transfer.
+ * Only ALT_DMA_PROGRAM_INST_MOD_SINGLE,
+ * ALT_DMA_PROGRAM_INST_MOD_BURST, or
+ * ALT_DMA_PROGRAM_INST_MOD_PERIPH are valid options.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ * \retval ALT_E_BAD_ARG Invalid peripheral or instruction modifier
+ * specified.
+ */
+// Assembler Syntax: DMAWFP <peripheral>, <single|burst|periph>
+ALT_STATUS_CODE alt_dma_program_DMAWFP(ALT_DMA_PROGRAM_t * pgm,
+ ALT_DMA_PERIPH_t periph, ALT_DMA_PROGRAM_INST_MOD_t mod);
+
+/*!
+ * Assembles a DMAWMB (Write Memory Barrier) instruction into the microcode
+ * program buffer. This instruction uses 1 byte of buffer space.
+ *
+ * \param pgm
+ * The DMA programm buffer to contain the assembled instruction.
+ *
+ * \retval ALT_E_SUCCESS Successful instruction assembly status.
+ * \retval ALT_E_DMA_BUF_OVF DMA program buffer overflow.
+ */
+// Assembler Syntax: DMAWMB
+ALT_STATUS_CODE alt_dma_program_DMAWMB(ALT_DMA_PROGRAM_t * pgm);
+
+/*!
+ * \addtogroup DMA_CCR Support for DMAMOV CCR
+ *
+ * The ALT_DMA_CCR_OPT_* macro definitions are defined here to facilitate the
+ * dynamic microcode programming of the assembler directive:
+\verbatim
+
+DMAMOV CCR, [SB<1-16>] [SS<8|16|32|64|128>] [SA<I|F>]
+ [SP<imm3>] [SC<imm4>]
+ [DB<1-16>] [DS<8|16|32|64|128>] [DA<I|F>]
+ [DP<imm3>] [DC<imm4>]
+ [ES<8|16|32|64|128>]
+
+\endverbatim
+* with a DMAMOV instruction (see: alt_dma_program_DMAMOV()).
+*
+* For example the assembler directive:
+\verbatim
+DMAMOV CCR SB1 SS32 DB1 DS32
+\endverbatim
+* would be dynamically programmed with the following API call:
+\verbatim
+alt_dma_program_DMAMOV( pgm,
+ ALT_DMA_PROGRAM_REG_CCR,
+ ( ALT_DMA_CCR_OPT_SB1
+ | ALT_DMA_CCR_OPT_SS32
+ | ALT_DMA_CCR_OPT_SA_DEFAULT
+ | ALT_DMA_CCR_OPT_SP_DEFAULT
+ | ALT_DMA_CCR_OPT_SC_DEFAULT
+ | ALT_DMA_CCR_OPT_DB1
+ | ALT_DMA_CCR_OPT_DS32
+ | ALT_DMA_CCR_OPT_DA_DEFAULT
+ | ALT_DMA_CCR_OPT_DP_DEFAULT
+ | ALT_DMA_CCR_OPT_DC_DEFAULT
+ | ALT_DMA_CCR_OPT_ES8
+ )
+ );
+\endverbatim
+*
+* Each CCR option category should be specified regardless of whether it
+* specifies a custom value or the normal default value (i.e. an
+* ALT_DMA_CCR_OPT_*_DEFAULT.
+*
+* @{
+*/
+
+/*
+ * Source Address {Fixed,Incrementing}
+ */
+/*! Source Address Fixed address burst. */
+#define ALT_DMA_CCR_OPT_SAF (0 << 0)
+/*! Source Address Incrementing address burst. */
+#define ALT_DMA_CCR_OPT_SAI (1 << 0)
+/*! Source Address Default value. */
+#define ALT_DMA_CCR_OPT_SA_DEFAULT ALT_DMA_CCR_OPT_SAI
+
+/*
+ * Source burst Size (in bits)
+ */
+/*! Source burst Size of 8 bits. */
+#define ALT_DMA_CCR_OPT_SS8 (0 << 1)
+/*! Source burst Size of 16 bits. */
+#define ALT_DMA_CCR_OPT_SS16 (1 << 1)
+/*! Source burst Size of 32 bits. */
+#define ALT_DMA_CCR_OPT_SS32 (2 << 1)
+/*! Source burst Size of 64 bits. */
+#define ALT_DMA_CCR_OPT_SS64 (3 << 1)
+/*! Source burst Size of 128 bits. */
+#define ALT_DMA_CCR_OPT_SS128 (4 << 1)
+/*! Source burst Size default bits. */
+#define ALT_DMA_CCR_OPT_SS_DEFAULT ALT_DMA_CCR_OPT_SS8
+
+/*
+ * Source burst Length (in transfer(s))
+ */
+/*! Source Burst length of 1 transfer. */
+#define ALT_DMA_CCR_OPT_SB1 (0x0 << 4)
+/*! Source Burst length of 2 transfers. */
+#define ALT_DMA_CCR_OPT_SB2 (0x1 << 4)
+/*! Source Burst length of 3 transfers. */
+#define ALT_DMA_CCR_OPT_SB3 (0x2 << 4)
+/*! Source Burst length of 4 transfers. */
+#define ALT_DMA_CCR_OPT_SB4 (0x3 << 4)
+/*! Source Burst length of 5 transfers. */
+#define ALT_DMA_CCR_OPT_SB5 (0x4 << 4)
+/*! Source Burst length of 6 transfers. */
+#define ALT_DMA_CCR_OPT_SB6 (0x5 << 4)
+/*! Source Burst length of 7 transfers. */
+#define ALT_DMA_CCR_OPT_SB7 (0x6 << 4)
+/*! Source Burst length of 8 transfers. */
+#define ALT_DMA_CCR_OPT_SB8 (0x7 << 4)
+/*! Source Burst length of 9 transfers. */
+#define ALT_DMA_CCR_OPT_SB9 (0x8 << 4)
+/*! Source Burst length of 10 transfers. */
+#define ALT_DMA_CCR_OPT_SB10 (0x9 << 4)
+/*! Source Burst length of 11 transfers. */
+#define ALT_DMA_CCR_OPT_SB11 (0xa << 4)
+/*! Source Burst length of 12 transfers. */
+#define ALT_DMA_CCR_OPT_SB12 (0xb << 4)
+/*! Source Burst length of 13 transfers. */
+#define ALT_DMA_CCR_OPT_SB13 (0xc << 4)
+/*! Source Burst length of 14 transfers. */
+#define ALT_DMA_CCR_OPT_SB14 (0xd << 4)
+/*! Source Burst length of 15 transfers. */
+#define ALT_DMA_CCR_OPT_SB15 (0xe << 4)
+/*! Source Burst length of 16 transfers. */
+#define ALT_DMA_CCR_OPT_SB16 (0xf << 4)
+/*! Source Burst length default transfers. */
+#define ALT_DMA_CCR_OPT_SB_DEFAULT ALT_DMA_CCR_OPT_SB1
+
+/*
+ * Source Protection
+ */
+/*! Source Protection bits for AXI bus ARPROT[2:0]. */
+#define ALT_DMA_CCR_OPT_SP(imm3) ((imm3) << 8)
+/*! Source Protection bits default value. */
+#define ALT_DMA_CCR_OPT_SP_DEFAULT ALT_DMA_CCR_OPT_SP(0)
+
+/*
+ * Source cache
+ */
+/*! Source Cache bits for AXI bus ARCACHE[2:0]. */
+#define ALT_DMA_CCR_OPT_SC(imm4) ((imm4) << 11)
+/*! Source Cache bits default value. */
+#define ALT_DMA_CCR_OPT_SC_DEFAULT ALT_DMA_CCR_OPT_SC(0)
+
+/*
+ * Destination Address {Fixed,Incrementing}
+ */
+/*! Destination Address Fixed address burst. */
+#define ALT_DMA_CCR_OPT_DAF (0 << 14)
+/*! Destination Address Incrementing address burst. */
+#define ALT_DMA_CCR_OPT_DAI (1 << 14)
+/*! Destination Address Default value. */
+#define ALT_DMA_CCR_OPT_DA_DEFAULT ALT_DMA_CCR_OPT_DAI
+
+/*
+ * Destination burst Size (in bits)
+ */
+/*! Destination burst Size of 8 bits. */
+#define ALT_DMA_CCR_OPT_DS8 (0 << 15)
+/*! Destination burst Size of 16 bits. */
+#define ALT_DMA_CCR_OPT_DS16 (1 << 15)
+/*! Destination burst Size of 32 bits. */
+#define ALT_DMA_CCR_OPT_DS32 (2 << 15)
+/*! Destination burst Size of 64 bits. */
+#define ALT_DMA_CCR_OPT_DS64 (3 << 15)
+/*! Destination burst Size of 128 bits. */
+#define ALT_DMA_CCR_OPT_DS128 (4 << 15)
+/*! Destination burst Size default bits. */
+#define ALT_DMA_CCR_OPT_DS_DEFAULT ALT_DMA_CCR_OPT_DS8
+
+/*
+ * Destination Burst length (in transfer(s))
+ */
+/*! Destination Burst length of 1 transfer. */
+#define ALT_DMA_CCR_OPT_DB1 (0x0 << 18)
+/*! Destination Burst length of 2 transfers. */
+#define ALT_DMA_CCR_OPT_DB2 (0x1 << 18)
+/*! Destination Burst length of 3 transfers. */
+#define ALT_DMA_CCR_OPT_DB3 (0x2 << 18)
+/*! Destination Burst length of 4 transfers. */
+#define ALT_DMA_CCR_OPT_DB4 (0x3 << 18)
+/*! Destination Burst length of 5 transfers. */
+#define ALT_DMA_CCR_OPT_DB5 (0x4 << 18)
+/*! Destination Burst length of 6 transfers. */
+#define ALT_DMA_CCR_OPT_DB6 (0x5 << 18)
+/*! Destination Burst length of 7 transfers. */
+#define ALT_DMA_CCR_OPT_DB7 (0x6 << 18)
+/*! Destination Burst length of 8 transfers. */
+#define ALT_DMA_CCR_OPT_DB8 (0x7 << 18)
+/*! Destination Burst length of 9 transfers. */
+#define ALT_DMA_CCR_OPT_DB9 (0x8 << 18)
+/*! Destination Burst length of 10 transfers. */
+#define ALT_DMA_CCR_OPT_DB10 (0x9 << 18)
+/*! Destination Burst length of 11 transfers. */
+#define ALT_DMA_CCR_OPT_DB11 (0xa << 18)
+/*! Destination Burst length of 12 transfers. */
+#define ALT_DMA_CCR_OPT_DB12 (0xb << 18)
+/*! Destination Burst length of 13 transfers. */
+#define ALT_DMA_CCR_OPT_DB13 (0xc << 18)
+/*! Destination Burst length of 14 transfers. */
+#define ALT_DMA_CCR_OPT_DB14 (0xd << 18)
+/*! Destination Burst length of 15 transfers. */
+#define ALT_DMA_CCR_OPT_DB15 (0xe << 18)
+/*! Destination Burst length of 16 transfers. */
+#define ALT_DMA_CCR_OPT_DB16 (0xf << 18)
+/*! Destination Burst length default transfers. */
+#define ALT_DMA_CCR_OPT_DB_DEFAULT ALT_DMA_CCR_OPT_DB1
+
+/*
+ * Destination Protection
+ */
+/*! Destination Protection bits for AXI bus AWPROT[2:0]. */
+#define ALT_DMA_CCR_OPT_DP(imm3) ((imm3) << 22)
+/*! Destination Protection bits default value. */
+#define ALT_DMA_CCR_OPT_DP_DEFAULT ALT_DMA_CCR_OPT_DP(0)
+
+/*
+ * Destination Cache
+ */
+/*! Destination Cache bits for AXI bus AWCACHE[3,1:0]. */
+#define ALT_DMA_CCR_OPT_DC(imm4) ((imm4) << 25)
+/*! Destination Cache bits default value. */
+#define ALT_DMA_CCR_OPT_DC_DEFAULT ALT_DMA_CCR_OPT_DC(0)
+
+/*
+ * Endian Swap size (in bits)
+ */
+/*! Endian Swap: No swap, 8-bit data. */
+#define ALT_DMA_CCR_OPT_ES8 (0 << 28)
+/*! Endian Swap: Swap bytes within 16-bit data. */
+#define ALT_DMA_CCR_OPT_ES16 (1 << 28)
+/*! Endian Swap: Swap bytes within 32-bit data. */
+#define ALT_DMA_CCR_OPT_ES32 (2 << 28)
+/*! Endian Swap: Swap bytes within 64-bit data. */
+#define ALT_DMA_CCR_OPT_ES64 (3 << 28)
+/*! Endian Swap: Swap bytes within 128-bit data. */
+#define ALT_DMA_CCR_OPT_ES128 (4 << 28)
+/*! Endian Swap: Default byte swap. */
+#define ALT_DMA_CCR_OPT_ES_DEFAULT ALT_DMA_CCR_OPT_ES8
+
+/*! Default CCR register options for a DMAMOV CCR assembler directive. */
+#define ALT_DMA_CCR_OPT_DEFAULT \
+ (ALT_DMA_CCR_OPT_SB1 | ALT_DMA_CCR_OPT_SS8 | ALT_DMA_CCR_OPT_SAI | \
+ ALT_DMA_CCR_OPT_SP(0) | ALT_DMA_CCR_OPT_SC(0) | \
+ ALT_DMA_CCR_OPT_DB1 | ALT_DMA_CCR_OPT_DS8 | ALT_DMA_CCR_OPT_DAI | \
+ ALT_DMA_CCR_OPT_DP(0) | ALT_DMA_CCR_OPT_DC(0) | \
+ ALT_DMA_CCR_OPT_ES8)
+
+/*!
+ * @}
+ */
+
+/*!
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ALT_DMA_PROGRAM_H__ */
diff --git a/bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h b/bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h
new file mode 100644
index 0000000000..0a7abaef8e
--- /dev/null
+++ b/bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h
@@ -0,0 +1,1254 @@
+/*! \file
+ * Altera - GPIO Module
+ */
+
+/******************************************************************************
+*
+* Copyright 2013 Altera Corporation. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. 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.
+*
+* 3. The name of the author may not be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 AUTHOR 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.
+*
+******************************************************************************/
+
+#ifndef __ALT_GPIO_H__
+#define __ALT_GPIO_H__
+
+#include <stdint.h>
+#include "hwlib.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define ALT_GPIO_BITMASK 0x1FFFFFFF
+
+/* If the GPIO special test mode flag was not defined in the makefile, */
+ /* set the ALT_GPIO_DATAREAD_TEST_MODE flag to false to specify that */
+ /* the production code version of alt_gpio_port_data_read() is included. */
+ /* If the flag is defined as true in the makefile, then the test version */
+ /* located in the test code file is substituted instead of the version */
+ /* in this file. */
+#ifndef ALT_GPIO_DATAREAD_TEST_MODE
+#define ALT_GPIO_DATAREAD_TEST_MODE false
+#endif
+
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_API The General Purpose Input/Output Manager API
+ *
+ * This module defines the General Purpose Input/Output Manager API for
+ * accessing, configuring, and controlling the General Purpose Input/Output
+ * Manager resources. These include both the general-purpose GPIO signals and
+ * the input-only GPI signals that are shared with the DDR interface.\n \n
+ * The GPIO API presents two views or perspectives of the GPIO signals. The first
+ * is to view the GPIO signals in a traditional way, as separate GPIO ports
+ * each comprised of a number of GPIO bits. The second perspective is of a
+ * unified flat view that presents the GPIO and GPI signals as a set of indexed
+ * bits, a view that allows the programmer to mostly ignore the port and pin
+ * hardware configuration and read/write/configure the GPIO and GPI signals
+ * independently of the underlying hardware implementation.
+ *
+ * @{
+ */
+
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_API_CONFIG General-Purpose IO Configuration Functions
+ *
+ * This functional group contains functions to control, configure and manage
+ * the general-purpose IO signals as individual signals or as groups of signals.
+ * This group of functions can operate on multiple bits within the same GPIO
+ * port and accepts a bit mask to specify which bits an operation will operate on.
+ * Other bits within the same GPIO port are not changed.
+ *
+ * This example shows how multiple drivers or applications can use this feature
+ * to easily prevent conflict while accessing the same GPIO port:
+ * \verbatim
+ #define DRIVER_0_GPIO_MSK 0x0010FF03;
+ #define DRIVER_1_GPIO_MSK 0x002000F8;
+ #define DRIVER_2_GPIO_MSK 0x03C00004;
+ #define DRIVER_3_GPIO_MSK 0x000F0000;
+
+ alt_gpio_port_data_write(ALT_GPIO_PORTA, DRIVER_0_GPIO_MSK, init_val0);
+ alt_gpio_port_data_write(ALT_GPIO_PORTA, DRIVER_1_GPIO_MSK, init_val1);
+ alt_gpio_port_data_write(ALT_GPIO_PORTA, DRIVER_2_GPIO_MSK, init_val2);
+ alt_gpio_port_data_write(ALT_GPIO_PORTA, DRIVER_3_GPIO_MSK, init_val3);
+ alt_gpio_port_int_type_set(ALT_GPIO_PORTA, DRIVER_1_GPIO_MSK, config_val1);
+ \endverbatim
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * This type definition enumerates the data direction (input or output) of
+ * the GPIO signals.
+ */
+
+typedef enum ALT_GPIO_PIN_DIR_e
+{
+ /*! # */
+ ALT_GPIO_PIN_INPUT,
+ /*! # */
+ ALT_GPIO_PIN_OUTPUT
+} ALT_GPIO_PIN_DIR_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the type of interrupt source
+ * (level-triggered or edge-triggered) of the GPIO signals.
+ */
+
+typedef enum ALT_GPIO_PIN_TYPE_e
+{
+ /*! # */
+ ALT_GPIO_PIN_LEVEL_TRIG_INT,
+ /*! # */
+ ALT_GPIO_PIN_EDGE_TRIG_INT
+} ALT_GPIO_PIN_TYPE_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the polarity of the interrupt sources
+ * (falling-edge or rising-edge for edge-triggered interrupts, active-low or
+ * active-high for level-triggered interrupts) of the GPIO signals.
+ */
+
+typedef enum ALT_GPIO_PIN_POL_e
+{
+ /*! Indicates active-low for level-triggered interrupts and
+ * falling-edge for edge-triggered interrupts */
+ ALT_GPIO_PIN_ACTIVE_LOW,
+
+ /*! Indicates active-high for level-triggered interrupts and
+ * rising-edge for edge-triggered interrupt */
+ ALT_GPIO_PIN_ACTIVE_HIGH
+} ALT_GPIO_PIN_POL_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates whether or not the debounce metastability
+ * flip-flops are inserted or not. These are used to debounce signals presented
+ * to the GPIO inputs. A signal must be steady for two periods of the
+ * gpio_db_clk clock before it is considered valid. The frequency of the
+ * gpio_db_clk clock may be set using the Clock Manager API.
+ */
+
+typedef enum ALT_GPIO_PIN_DEBOUNCE_e
+{
+ /*! # */
+ ALT_GPIO_PIN_NODEBOUNCE,
+ /*! # */
+ ALT_GPIO_PIN_DEBOUNCE
+} ALT_GPIO_PIN_DEBOUNCE_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates whether or not level-sensitive interrupts
+ * are synchronized to the internal pclk_intr clock. It has no effect for GPIO
+ * signals that are selected as outputs, or if the interrupt is not enabled,
+ * or if the interrupt is set to be edge-triggered. This is a port-wide option.
+ */
+
+typedef enum ALT_GPIO_PIN_SYNC_e
+{
+ /*! # */
+ ALT_GPIO_PIN_NOSYNC,
+ /*! # */
+ ALT_GPIO_PIN_SYNC
+} ALT_GPIO_PIN_SYNC_t;
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the possible data states of the GPIO bits.
+ */
+
+typedef enum ALT_GPIO_PIN_DATA_e
+{
+ /*! # */
+ ALT_GPIO_PIN_DATAZERO,
+ /*! # */
+ ALT_GPIO_PIN_DATAONE
+} ALT_GPIO_PIN_DATA_t;
+
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the GPIO ports that the GPIO manager
+ * handles.
+ */
+
+typedef enum ALT_GPIO_PORT_e
+{
+ /*!
+ * \b Port \b A - 29-bit GPIO port A.
+ */
+ ALT_GPIO_PORTA,
+
+ /*!
+ * \b Port \b B - 29-bit GPIO port B.
+ */
+ ALT_GPIO_PORTB,
+
+ /*!
+ * \b Port \b C - 29-bit GPIO port C. \n 13 bits are used for GPIO signals,
+ * 14 bits are used for GPI-only signals that are shared
+ * with the DDR interface, 2 bits are not used. Some signals
+ * may not be connected on some versions. See the relevant
+ * pin mux data.
+ */
+ ALT_GPIO_PORTC,
+
+ /*!
+ * \b Unknown \b Port - Used to indicate an error.
+ */
+ ALT_GPIO_PORT_UNKNOWN
+} ALT_GPIO_PORT_t;
+
+
+/******************************************************************************/
+/*!
+ * This type definition enumerates the individual bits within the GPIO ports
+ * used by the GPIO manager. The bit-ordering must match the hardware
+ * bit-ordering. Since the ordering and packing of bitfields is not
+ * standardized in C/C++, the following are defined as masks. \n
+ * For example, to set bits 3 and 4 of GPIO port B outputs (assuming the bits
+ * had previously been set to outputs), the user could use the syntax: \par
+ * \b alt_gpio_port_data_write(\b ALT_GPIO_PORTB, \b ALT_GPIO_BIT3 \b | \b
+ * ALT_GPIO_BIT4);
+ */
+
+typedef enum ALT_GPIO_PORTBIT_e
+{
+ /*! # */
+ ALT_GPIO_BIT0 = ALT_TWO_TO_POW0,
+ /*! # */
+ ALT_GPIO_BIT1 = ALT_TWO_TO_POW1,
+ /*! # */
+ ALT_GPIO_BIT2 = ALT_TWO_TO_POW2,
+ /*! # */
+ ALT_GPIO_BIT3 = ALT_TWO_TO_POW3,
+ /*! # */
+ ALT_GPIO_BIT4 = ALT_TWO_TO_POW4,
+ /*! # */
+ ALT_GPIO_BIT5 = ALT_TWO_TO_POW5,
+ /*! # */
+ ALT_GPIO_BIT6 = ALT_TWO_TO_POW6,
+ /*! # */
+ ALT_GPIO_BIT7 = ALT_TWO_TO_POW7,
+ /*! # */
+ ALT_GPIO_BIT8 = ALT_TWO_TO_POW8,
+ /*! # */
+ ALT_GPIO_BIT9 = ALT_TWO_TO_POW9,
+ /*! # */
+ ALT_GPIO_BIT10 = ALT_TWO_TO_POW10,
+ /*! # */
+ ALT_GPIO_BIT11 = ALT_TWO_TO_POW11,
+ /*! # */
+ ALT_GPIO_BIT12 = ALT_TWO_TO_POW12,
+ /*! # */
+ ALT_GPIO_BIT13 = ALT_TWO_TO_POW13,
+ /*! # */
+ ALT_GPIO_BIT14 = ALT_TWO_TO_POW14,
+ /*! # */
+ ALT_GPIO_BIT15 = ALT_TWO_TO_POW15,
+ /*! # */
+ ALT_GPIO_BIT16 = ALT_TWO_TO_POW16,
+ /*! # */
+ ALT_GPIO_BIT17 = ALT_TWO_TO_POW17,
+ /*! # */
+ ALT_GPIO_BIT18 = ALT_TWO_TO_POW18,
+ /*! # */
+ ALT_GPIO_BIT19 = ALT_TWO_TO_POW19,
+ /*! # */
+ ALT_GPIO_BIT20 = ALT_TWO_TO_POW20,
+ /*! # */
+ ALT_GPIO_BIT21 = ALT_TWO_TO_POW21,
+ /*! # */
+ ALT_GPIO_BIT22 = ALT_TWO_TO_POW22,
+ /*! # */
+ ALT_GPIO_BIT23 = ALT_TWO_TO_POW23,
+ /*! # */
+ ALT_GPIO_BIT24 = ALT_TWO_TO_POW24,
+ /*! # */
+ ALT_GPIO_BIT25 = ALT_TWO_TO_POW25,
+ /*! # */
+ ALT_GPIO_BIT26 = ALT_TWO_TO_POW26,
+ /*! # */
+ ALT_GPIO_BIT27 = ALT_TWO_TO_POW27,
+ /*! # */
+ ALT_GPIO_BIT28 = ALT_TWO_TO_POW28,
+ ALT_GPIO_BIT29 = ALT_TWO_TO_POW29, /* Not currently used */
+ ALT_GPIO_BIT30 = ALT_TWO_TO_POW30, /* Not currently used */
+ ALT_GPIO_BIT31 = (int32_t) (1UL<<31), /* Not currently used */
+
+ ALT_GPIO_BITNUM_MAX = (28),
+ ALT_GPIO_BIT_MAX = (1 << ALT_GPIO_BITNUM_MAX),
+ ALT_END_OF_GPIO_PORT_SIGNALS = (32)
+} ALT_GPIO_PORTBIT_t;
+
+
+
+/******************************************************************************/
+/*!
+ * Initialize the GPIO modules before use
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_gpio_init(void);
+
+/******************************************************************************/
+/*!
+ * Uninitialize the GPIO modules & return to reset state
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ */
+ALT_STATUS_CODE alt_gpio_uninit(void);
+
+/******************************************************************************/
+/*!
+ * Sets the specified GPIO data bits to use the data direction(s)
+ * specified.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to apply this
+ * operation to. Other bits (where mask bits equal zero) are
+ * not changed. Specify mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to
+ * configure all data direction bits of the port.
+ * \param config
+ * The data-directions of the bits to be set in this operation.
+ * Individual bits are: \n \b 0 - Use as an input (default). \n
+ * \b 1 - Use as an output.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Bad input argument.
+ */
+ALT_STATUS_CODE alt_gpio_port_datadir_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Returns the data direction configuration of selected bits of the
+ * specified GPIO module.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to read and
+ * return. Other bits (where mask bits equal zero) are returned
+ * as zero. Specify mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to
+ * return all data direction bits of the port.
+ *
+ * \retval uint32_t \n Individual bits are: \n \b 0 - The signal is
+ * configured as an input.
+ * \n \b 1 - The signal is configured as an output.
+ *
+ */
+uint32_t alt_gpio_port_datadir_get(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask);
+
+/******************************************************************************/
+/*!
+ * Sets the GPIO data outputs of the specified GPIO module to a logic one or
+ * zero. Outputs are only set if the data direction for those bits is also
+ * set to configure them as outputs.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (mask bits equal one) to apply this
+ * operation to. Other bits (mask bits equal zero) are
+ * not changed.
+ * \param val
+ * The 32-bit word to write to the GPIO outputs. Only the 29 LSBs
+ * are used. Setting the three MSBs causes an error.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Bad input argument.
+ */
+ALT_STATUS_CODE alt_gpio_port_data_write(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t val);
+
+/******************************************************************************/
+/*!
+ * Returns the value of the data inputs of the specified GPIO module. This is
+ * the current logic value of the pin, whether set to be an input or an output.
+ * \n If a given signal is set to be an output, this input value can be read to
+ * determine if the pin is grounded, pulled high, or is floating.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to return. Other
+ * bits (where mask bits equal zero) are returned as zero. Specify
+ * mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to return all data bits of
+ * the port.
+ *
+ * \retval uint32_t The current value of the GPIO module input signals.
+ */
+uint32_t alt_gpio_port_data_read(ALT_GPIO_PORT_t gpio_pid, uint32_t mask);
+
+
+/*! @} */
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_INT General-Purpose IO Interrupt Functions
+ *
+ * This functional group contains functions to control and manage the
+ * interrupts of the General-Purpose IO modules.
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Sets edge-triggered or level-triggered interrupt configuration for the
+ * specified signals of the specified GPIO module.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to apply this
+ * operation to. Other bits (where mask bits equal zero) are
+ * not changed. Specify mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to
+ * configure all interrupt type bits of the port.
+ * \param config
+ * The interrupt configuration to write. Individual bits
+ * are: \n \b 0 - Set the
+ * interrupt for this bit to be level-sensitive (default). \n \b
+ * 1 - Set the interrupt for this bit to be edge-sensitive.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_type_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Returns the interrupt configuration (edge-triggered or level-triggered) for
+ * the specified bits of the specified GPIO module.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to return. Other
+ * bits (where mask bits equal zero) are returned as zero. Specify
+ * mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to return all configuration
+ * bits of the port.
+ * \retval uint32_t
+ * The current interrupt source configuration. Individual bits
+ * are: \n \b 0 - The interrupt for this bit is set to be
+ * level-sensitive. \n \b 1 -
+ * The interrupt for this bit is set to be edge-sensitive.
+ *
+ */
+uint32_t alt_gpio_port_int_type_get(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask);
+
+/******************************************************************************/
+/*!
+ * Sets the interrupt polarity of the signals of the specified GPIO register
+ * (when used as inputs) to active-high or active-low (for level-sensitive
+ * interrupts) or to rising-edge or falling-edge (for edge-sensitive interrupts).
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to apply this
+ * operation to. Other bits (where mask bits equal zero) are
+ * not changed.
+ * \param config
+ * The interrupt polarity configuration to set. Individual bits
+ * are: \n \b 0 - Set the interrupt polarity for this bit to
+ * active-low or falling-edge mode (default). \n \b 1 - Set the
+ * interrupt polarity for this bit to active-high or rising-edge mode.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_pol_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Returns the active-high or active-low polarity configuration for the
+ * possible interrupt sources of the specified GPIO module.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to return. Other
+ * bits (where mask bits equal zero) are returned as zero. Specify
+ * mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to return all the
+ * configuration bits of the port.
+ *
+ * \retval uint32_t
+ * The current polarity configuration. Individual bits are: \n
+ * \b 0 = The interrupt polarity for this bit is set to
+ * active-low or falling-edge mode. \n \b 1 = The interrupt
+ * polarity for this bit is set to active-high or rising-edge mode.
+ *
+ */
+uint32_t alt_gpio_port_int_pol_get(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask);
+
+
+/*! @} */
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_API_CONFIG General-Purpose IO Configuration Functions
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Sets the debounce configuration for input signals of the specified GPIO
+ * module. If debounce is selected, metastability flip-flops are inserted to
+ * debounce signals presented to the GPIO inputs. A signal must be steady for
+ * two periods of the gpio_db_clk clock before it is considered valid. The
+ * frequency of the gpio_db_clk clock may be set using the Clock Manager API.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to apply this
+ * operation to. Other bits (where mask bits equal zero) are
+ * not changed. Specify mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to
+ * configure the debounce setting for all bits of the port.
+ * \param config
+ * The debounce configuration to set. Individual bits are: \n
+ * \b 0 - Debounce is not selected for this signal (default). \n
+ * \b 1 - Debounce is selected for this signal.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_debounce_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Returns the debounce configuration for the input signals of the specified
+ * GPIO register. If debounce is selected, metastability flip-flops are
+ * inserted to debounce signals presented to the GPIO inputs.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits (where mask bits equal one) to return. Other
+ * bits (where mask bits equal zero) are returned as zero. Specify
+ * mask = ALT_GPIO_BITMASK (0x1FFFFFFF) to return all debounce
+ * configuration bits of the port.
+ *
+ * \retval uint32_t
+ * The current debounce configuration.Individual bits are: \n
+ * \b 0 - Debounce is not selected for this signal. \n \b 1 -
+ * Debounce is selected for this signal.
+ *
+ */
+uint32_t alt_gpio_port_debounce_get(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask);
+
+/******************************************************************************/
+/*!
+ * Sets the synchronization configuration for the signals of the specified
+ * GPIO register. This allows for synchronizing level-sensitive interrupts to
+ * an internal clock signal. This is a port-wide option that controls all
+ * level-sensitive interrupt signals of that GPIO port.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param config
+ * \n \b Any \b non-zero \b value - Synchronize to internal clock signal.
+ * \n \b Zero - Do not synchronize to internal clock signal.
+ *
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_sync_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t config);
+
+/******************************************************************************/
+/*!
+ *
+ * Returns the synchronization configuration for the signals of the
+ * specified GPIO register. This allows for synchronizing level-sensitive
+ * interrupts to the internal clock signal. This is a port-wide option that
+ * controls all level-sensitive interrupt signals of that GPIO port.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+
+
+ * \retval ALT_E_TRUE Synchronization to clock is enabled for
+ * level-sensitive interrupts.
+ * \retval ALT_E_FALSE Synchronization to clock is disabled for
+ * level-sensitive interrupts.
+ * \retval ALT_E_BAD_ARG Invalid input argument.
+ */
+ALT_STATUS_CODE alt_gpio_port_sync_get(ALT_GPIO_PORT_t gpio_pid);
+
+/******************************************************************************/
+/*!
+ * Configures a group of GPIO signals with identical setup parameters. Allows
+ * for configuring all parameters of a given port at one time.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * The group of bits to apply this operation to. Other bits (mask
+ * set to zero) are not changed.
+ * \param dir
+ * Data direction.
+ * \param type
+ * Edge-triggered or level-triggered interrupts.
+ * \param pol
+ * Active-high or active-low polarity.
+ * \param debounc
+ * Debounce signals or not.
+ * \param data
+ * Set the data output to this value.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input argument.
+
+ */
+ALT_STATUS_CODE alt_gpio_port_config(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, ALT_GPIO_PIN_DIR_t dir, ALT_GPIO_PIN_TYPE_t type,
+ ALT_GPIO_PIN_POL_t pol, ALT_GPIO_PIN_DEBOUNCE_t debounc,
+ uint32_t data);
+
+/*! @} */
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_INT General-Purpose IO Interrupt Functions
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * Enables the specified GPIO data input interrupts.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param config
+ * Individual bit interrupt enables \n
+ * \b 0 - Interrupt disabled. \n
+ * \b 1 - Interrupt enabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Bad input argument.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_enable(ALT_GPIO_PORT_t gpio_pid, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Disables the specified GPIO data module interrupt.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param config
+ * Individual bit interrupt enables \n
+ * \b 0 - Interrupt disabled. \n
+ * \b 1 - Interrupt enabled.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Bad input argument.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_disable(ALT_GPIO_PORT_t gpio_pid, uint32_t config);
+
+/******************************************************************************/
+/*!
+ * Returns the current state of the specified GPIO port interrupts enables.
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ *
+ * \retval uint32_t
+ * The interrupt enable configuration that was read. Individual bits
+ * are: \n \b 0 = The interrupt for this bit is not enabled. \n \b
+ * 1 = The interrupt for this bit is enabled.
+ */
+uint32_t alt_gpio_port_int_enable_get(ALT_GPIO_PORT_t gpio_pid);
+
+
+/******************************************************************************/
+/*!
+ * Masks or unmasks selected interrupt source bits of the data register of
+ * the specified GPIO module. Uses a second bit mask to determine which
+ * signals may be changed by this call.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param mask
+ * Which bits to change among the port \n \b 0 =
+ * Do not change this bit. \n \b 1 = Allow this bit to change.
+ * \param val
+ * The interrupt mask to write. Individual bits are: \n \b 0 =
+ * Do not mask the interrupt for this bit (default). \n \b 1 =
+ * Mask the interrupt for this bit.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_mask_set(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t mask, uint32_t val);
+
+/******************************************************************************/
+/*!
+ * Returns the interrupt mask of the specified GPIO module.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ *
+ * \retval uint32_t
+ * The interrupt mask that was read. Individual bits are: \n
+ * \b 0 = The interrupt for this bit is not masked. \n \b 1 = The
+ * interrupt for this bit is masked.
+ *
+ */
+uint32_t alt_gpio_port_int_mask_get(ALT_GPIO_PORT_t gpio_pid);
+
+/******************************************************************************/
+/*!
+ * Returns the interrupt pending status of all signals of the specified GPIO
+ * register.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+
+ * \retval uint32_t
+ * The current interrupt pending status. Individual bits are: \n
+ * \b 0 - The interrupt for this bit is not pending. \n \b 1 -
+ * The interrupt for this bit is pending.
+ *
+ */
+uint32_t alt_gpio_port_int_status_get(ALT_GPIO_PORT_t gpio_pid);
+
+/******************************************************************************/
+/*!
+ * Clear the interrupt pending status of selected signals of the
+ * specified GPIO register.
+ *
+ *
+ * \param gpio_pid
+ * The GPIO port identifier.
+ * \param clrmask
+ * The interrupt bits to clear. Individual bits are: \n \b 0 -
+ * The interrupt for this bit will not be changed. \n \b 1 -
+ * The interrupt for this bit will be cleared.
+ *
+ * \retval ALT_E_SUCCESS The operation was successful.
+ * \retval ALT_E_ERROR The operation failed.
+ * \retval ALT_E_BAD_ARG Invalid input data.
+ */
+ALT_STATUS_CODE alt_gpio_port_int_status_clear(ALT_GPIO_PORT_t gpio_pid,
+ uint32_t clrmask);
+
+/*! @} */
+
+/******************************************************************************/
+/*! \addtogroup ALT_GPIO_BITVIEW General-Purpose IO via Bit Index
+ *
+ * This functional group presents a perspective of the General-Purpose IO
+ * signals as individual GPIO and GPI bits spread across a number of signals
+ * across several GPIO ports. This allows the programmer the freedom to generally
+ * ignore the underlying port and signal structure of the GPIO hardware if
+ * desired.
+ *
+ * @{
+ */
+/******************************************************************************/
+/*!
+ * This type definition enumerates the individual bits as one flat array spread
+ * across the multiple GPIO ports handled by the GPIO manager. The bit-ordering
+ * must match the hardware bit-ordering.
+ *
+ */
+typedef enum ALT_GPIO_1BIT_e
+{
+ /*! # */
+ ALT_GPIO_1BIT_0,
+ /*! # */
+ ALT_GPIO_1BIT_1,
+ /*! # */
+ ALT_GPIO_1BIT_2,
+ /*! # */
+ ALT_GPIO_1BIT_3,
+ /*! # */
+ ALT_GPIO_1BIT_4,
+ /*! # */
+ ALT_GPIO_1BIT_5,
+ /*! # */
+ ALT_GPIO_1BIT_6,
+ /*! # */
+ ALT_GPIO_1BIT_7,
+ /*! # */
+ ALT_GPIO_1BIT_8,
+ /*! # */
+ ALT_GPIO_1BIT_9,
+ /*! # */
+ ALT_GPIO_1BIT_10,
+ /*! # */
+ ALT_GPIO_1BIT_11,
+ /*! # */
+ ALT_GPIO_1BIT_12,
+ /*! # */
+ ALT_GPIO_1BIT_13,