v_mix
Vitis Drivers API Documentation
platform.c File Reference

Functions

void enable_caches ()
 Enables instruction and data caches based on the target processor architecture. More...
 
void disable_caches ()
 Disables both the data cache and instruction cache. More...
 
void init_uart ()
 Initializes the UART peripheral for standard output. More...
 
void init_platform ()
 Initializes the hardware platform. More...
 
void cleanup_platform ()
 Cleans up the platform by disabling caches. More...
 

Function Documentation

void cleanup_platform ( )

Cleans up the platform by disabling caches.

This function is typically called during the shutdown or cleanup phase of an embedded application to ensure that all processor caches are disabled, which may be necessary before powering down or resetting the system.

References disable_caches().

void disable_caches ( )

Disables both the data cache and instruction cache.

This function calls the appropriate routines to disable the data cache (DCache) and instruction cache (ICache) on the platform. It is typically used in scenarios where cache coherency is not required or when performing operations that should bypass the cache.

Referenced by cleanup_platform().

void enable_caches ( )

Enables instruction and data caches based on the target processor architecture.

This function enables the instruction and data caches for either PowerPC or MicroBlaze architectures. For PowerPC, it enables cache regions specified by CACHEABLE_REGION_MASK. For MicroBlaze, it enables instruction and/or data caches if they are configured in the hardware.

The function uses preprocessor directives to determine the target architecture and cache configuration.

Referenced by init_platform().

void init_platform ( )

Initializes the hardware platform.

This function sets up the necessary hardware components for the platform, such as enabling caches and initializing the UART. If running outside of the SDK, the user may need to call ps7_init() to initialize the processing system, which requires including "ps7_init.h" and linking with ps7_init.c.

Note: Ensure that all required initialization files are included in the project if ps7_init() is used.

References enable_caches(), and init_uart().

Referenced by main().

void init_uart ( )

Initializes the UART peripheral for standard output.

This function configures the UART hardware used for standard output, depending on the platform. If the platform uses a 16550 UART, it sets the baud rate and line control register. If the platform uses the PS7 UART, it assumes the bootrom or BSP has already configured it to 115200 bps.

Platform-specific macros (STDOUT_IS_16550, STDOUT_IS_PS7_UART) determine which UART initialization code is executed.

Referenced by init_platform().