RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
hwinit-lc4357-hdk.c File Reference

This source file contains parts of the system initialization. More...

#include <bsp/tms570.h>
#include <bsp/tms570_hwinit.h>
#include <bsp/tms570-pinmux.h>

Typedefs

typedef enum Tms570ClockDisableSources Tms570ClockDisableSources
 
typedef enum Tms570GhvClockSources Tms570GhvClockSources
 

Enumerations

enum  Tms570ClockDisableSources {
  TMS570_CLKDIS_SRC_OSC = 0x01 , TMS570_CLKDIS_SRC_PLL1 = 0x02 , TMS570_CLKDIS_SRC_RESERVED = 0x04 , TMS570_CLKDIS_SRC_EXT_CLK1 = 0x08 ,
  TMS570_CLKDIS_SRC_LOW_FREQ_LPO = 0x10 , TMS570_CLKDIS_SRC_HIGH_FREQ_LPO = 0x20 , TMS570_CLKDIS_SRC_PLL2 = 0x40 , TMS570_CLKDIS_SRC_EXT_CLK2 = 0x80
}
 
enum  Tms570GhvClockSources {
  TMS570_SYS_CLK_SRC_OSC = 0U , TMS570_SYS_CLK_SRC_PLL1 = 1U , TMS570_SYS_CLK_SRC_EXTERNAL1 = 3U , TMS570_SYS_CLK_SRC_LPO_LOW = 4U ,
  TMS570_SYS_CLK_SRC_LPO_HIGH = 5U , TMS570_SYS_CLK_SRC_PLL2 = 6U , TMS570_SYS_CLK_SRC_EXTERNAL2 = 7U , TMS570_SYS_CLK_SRC_VCLK = 9U
}
 

Functions

void tms570_pinmux_init (void)
 Initialize the tms570 PINMUX peripheral. This maps signals to pin terminals.
 
void tms570_emif_sdram_init (void)
 Initialize the External Memory InterFace (EMIF) peripheral.
 
void tms570_pll_init (void)
 Setup all system PLLs (HCG:setupPLL)
 
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).
 

Detailed Description

This source file contains parts of the system initialization.

Enumeration Type Documentation

◆ Tms570ClockDisableSources

Enumerator
TMS570_CLKDIS_SRC_OSC 

External high-speed oscillator as clock source.

TMS570_CLKDIS_SRC_RESERVED 

reserved. not tied to actual clock source

◆ Tms570GhvClockSources

Enumerator
TMS570_SYS_CLK_SRC_OSC 

Alias for oscillator clock Source

TMS570_SYS_CLK_SRC_PLL1 

Alias for Pll1 clock Source

TMS570_SYS_CLK_SRC_EXTERNAL1 

Alias for external clock Source

TMS570_SYS_CLK_SRC_LPO_LOW 

Alias for low power oscillator low clock Source

TMS570_SYS_CLK_SRC_LPO_HIGH 

Alias for low power oscillator high clock Source

TMS570_SYS_CLK_SRC_PLL2 

Alias for Pll2 clock Source

TMS570_SYS_CLK_SRC_EXTERNAL2 

Alias for external 2 clock Source

TMS570_SYS_CLK_SRC_VCLK 

Alias for synchronous VCLK1 clock Source

Function Documentation

◆ 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 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

◆ tms570_pll_init()

void tms570_pll_init ( void  )

Setup all system PLLs (HCG:setupPLL)

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