RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Functions
tms570_hwinit.h File Reference

This header file provides interfaces of the hardware initialization support. More...

#include <bspopts.h>
#include <stdint.h>
#include <bsp/start.h>

Go to the source code of this file.

Functions

void _esmCcmErrorsClear_ (void)
 
void _coreEnableEventBusExport_ (void)
 
void _errata_CORTEXR4_66_ (void)
 
void _errata_CORTEXR4_57_ (void)
 
void _coreEnableRamEcc_ (void)
 
void _coreDisableRamEcc_ (void)
 
void _mpuInit_ (void)
 
void tms570_memory_init (uint32_t ram)
 
void tms570_trim_lpo_init (void)
 Adjust Low-Frequency (LPO) oscilator (HCG:trimLPO)
 
void tms570_flash_init (void)
 Setup Flash memory parameters and timing (HCG:setupFlash)
 
void tms570_periph_init (void)
 Power-up all peripherals and enable their clocks (HCG:periphInit)
 
void tms570_system_hw_init (void)
 TMS570 system hardware initialization (HCG:systemInit)
 
void tms570_esm_init (void)
 Error signaling module initialization (HCG:esmInit)
 
void tms570_emif_sdram_init (void)
 Initialize the External Memory InterFace (EMIF) peripheral.
 
void tms570_pll_init (void)
 Initialize PLLs source divider/multipliers.
 
void tms570_map_clock_init (void)
 Initialize the tms570 Global Clock Manager (GCM) registers which sub-divide the input clock source (generally PLL) into the various peripheral clocks (VCLK1-3, etc).
 
void tms570_pinmux_init (void)
 Initialize the tms570 PINMUX peripheral. This maps signals to pin terminals.
 

Detailed Description

This header file provides interfaces of the hardware initialization support.

Function Documentation

◆ tms570_esm_init()

void tms570_esm_init ( void  )

Error signaling module initialization (HCG:esmInit)

  • Disable error pin channels
  • Disable interrupts
  • Clear error status flags
  • Setup LPC preload
  • Reset error pin
  • Clear interrupt level
  • Set interrupt level
  • Enable error pin channels
  • Enable interrupts

◆ tms570_flash_init()

void tms570_flash_init ( void  )

Setup Flash memory parameters and timing (HCG:setupFlash)

  • Setup flash read mode, address wait states and data wait states
  • Setup flash access wait states for bank 7
  • Disable write access to flash state machine registers
  • Setup flash bank power modes

◆ tms570_map_clock_init()

void tms570_map_clock_init ( void  )

Initialize the tms570 Global Clock Manager (GCM) registers which sub-divide the input clock source (generally PLL) into the various peripheral clocks (VCLK1-3, etc).

Initialize the tms570 Global Clock Manager (GCM) registers which sub-divide the input clock source (generally PLL) into the various peripheral clocks (VCLK1-3, etc).

Initialize Clock Tree:

  • Disable / Enable clock domain
  • Setup RTICLK1 and RTICLK2 clocks
  • Setup asynchronous peripheral clock sources for AVCLK1 and AVCLK2
  • Setup synchronous peripheral clock dividers for VCLK1, VCLK2, VCLK3

Initialize Clock Tree:

  • Disable / Enable clock domain
  • Wait for until clocks are locked
  • Map device clock domains to desired sources and configure top-level dividers
  • All clock domains are working off the default clock sources until now
  • The below assignments can be easily modified using the HALCoGen GUI
  • Setup GCLK, HCLK and VCLK clock source for normal operation, power down mode and after wakeup
  • Setup synchronous peripheral clock dividers for VCLK1, VCLK2, VCLK3
  • Setup RTICLK1 and RTICLK2 clocks
  • Setup asynchronous peripheral clock sources for AVCLK1 and AVCLK2

◆ tms570_periph_init()

void tms570_periph_init ( void  )

Power-up all peripherals and enable their clocks (HCG:periphInit)

  • Disable Peripherals before peripheral powerup
  • Release peripherals from reset and enable clocks to all peripherals
  • Power-up all peripherals
  • Enable Peripherals

◆ tms570_pinmux_init()

void tms570_pinmux_init ( void  )

Initialize the tms570 PINMUX peripheral. This maps signals to pin terminals.

Initialize the tms570 PINMUX peripheral. This maps signals to pin terminals.

  • set ECLK pins functional mode
  • set ECLK pins default output value
  • set ECLK pins output direction
  • set ECLK pins open drain enable
  • set ECLK pins pullup/pulldown enable
  • set ECLK pins pullup/pulldown select
  • Setup ECLK

◆ tms570_pll_init()

void tms570_pll_init ( void  )

Initialize PLLs source divider/multipliers.

Initialize PLLs source divider/multipliers.

Initialize PLLs source divider/multipliers.

  • Setup pll control register 1:
    • Disable reset on oscillator slip (ROS)
    • Enable bypass on pll slip TODO: desired: switches to OSC when PLL slip detected
    • setup Pll output clock divider to max before Lock
    • Disable reset on oscillator fail
    • Setup reference clock divider
    • Setup Pll multiplier
    • PLL1: 16MHz OSC in -> 300MHz PLL1 out
  • Setup pll control register 2
    • Setup spreading rate
    • Setup bandwidth adjustment
    • Setup internal Pll output divider
    • Setup spreading amount
  • Setup pll2 control register :
    • setup Pll output clock divider to max before Lock
    • Setup reference clock divider
    • Setup internal Pll output divider
    • Setup Pll multiplier
  • Configure PLL control registers

Initialize Pll1:

Initialize Pll2:

  • Enable PLL(s) to start up or Lock

◆ tms570_system_hw_init()

void tms570_system_hw_init ( void  )

TMS570 system hardware initialization (HCG:systemInit)

  • Set up flash address and data wait states based on the target CPU clock frequency The number of address and data wait states for the target CPU clock frequency are specified in the specific part's datasheet.
  • Configure the LPO such that HF LPO is as close to 10MHz as possible
  • Wait for PLLs to start up and map clock domains to desired clock sources

◆ tms570_trim_lpo_init()

void tms570_trim_lpo_init ( void  )

Adjust Low-Frequency (LPO) oscilator (HCG:trimLPO)

Initialize Lpo:

Load TRIM values from OTP if present else load user defined values