The Pedigree Project  0.1
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Prcm Class Reference

#include <Prcm.h>

+ Collaboration diagram for Prcm:

Public Types

enum  Clock { FCLK_32K = 0, SYS_CLK = 1, L3_CLK_DIV1 = 1, L3_CLK_DIV2 = 2 }
 
enum  ModuleBases {
  IVA2_CM = 0x0000, OCP_System_Reg_CM = 0x0800, MPU_CM = 0x0900, CORE_CM = 0x0A00,
  SGX_CM = 0x0B00, WKUP_CM = 0x0C00, Clock_Control_Reg_CM = 0x0D00, DSS_CM = 0x0E00,
  CAM_CM = 0x0F00, PER_CM = 0x1000, EMU_CM = 0x1100, Global_Reg_CM = 0x1200,
  NEON_CM = 0x1300, USBHOST_CM = 0x1400
}
 
enum  Registers_PER {
  CM_FCLKEN_PER = 0x00, CM_ICLKEN_PER = 0x10, CM_IDLEST_PER = 0x20, CM_AUTOIDLE_PER = 0x30,
  CM_CLKSEL_PER = 0x40, CM_SLEEPDEP_PER = 0x44, CM_CLKSTCRL_PER = 0x48, CM_CLKSTST_PER = 0x4C
}
 
enum  Register_CORE {
  CM_FCLKEN1_CORE = 0x00, CM_FCLKEN3_CORE = 0x08, CM_ICLKEN1_CORE = 0x10, CM_ICLKEN3_CORE = 0x18,
  CM_IDLEST1_CORE = 0x20, CM_IDLEST3_CORE = 0x28, CM_AUTOIDLE1_CORE = 0x30, CM_AUTOIDLE3_CORE = 0x38,
  CM_CLKSEL_CORE = 0x40, CM_CLKSTCTRL_CORE = 0x48, CM_CLKSTST_CORE = 0x4C
}
 
enum  Registers_PLL {
  CM_CLKEN_PLL = 0x00, CM_CLKEN2_PLL = 0x04, CM_IDLEST_CKGEN = 0x20, CM_IDLEST2_CKGEN = 0x24,
  CM_AUTOIDLE_PLL = 0x30, CM_AUTOIDLE2_PLL = 0x34, CM_CLKSEL1_PLL = 0x40, CM_CLKSEL2_PLL = 0x44,
  CM_CLKSEL3_PLL = 0x48, CM_CLKSEL4_PLL = 0x4C, CM_CLKSEL5_PLL = 0x50, CM_CLKOUT_CTRL = 0x70
}
 

Public Member Functions

void initialise (uintptr_t base)
 
void SelectClockPER (size_t clock, Clock which)
 
void SetFuncClockPER (size_t clock, bool enabled)
 
void SetIfaceClockPER (size_t clock, bool enabled)
 
void SetFuncClockCORE (size_t n, size_t clock, bool enabled)
 
void SetIfaceClockCORE (size_t n, size_t clock, bool enabled)
 
void WaitCoreIdleStatus (size_t n, size_t clock, bool waitForOn)
 
void WaitPllIdleStatus (size_t n, size_t clock, bool waitForOn)
 
void SelectClockCORE (size_t clock, Clock which)
 
void SetClockPLL (size_t n, size_t value)
 
void SelectClockPLL (size_t n, size_t value)
 

Static Public Member Functions

static Prcminstance ()
 

Private Attributes

MemoryRegion m_Base
 

Static Private Attributes

static Prcm m_Instance
 

Detailed Description

PRCM - Power, Reset and Clock Management - abstraction

Todo:

Power management

Reset

Definition at line 27 of file Prcm.h.

Member Function Documentation

void Prcm::initialise ( uintptr_t  base)

Initialises the PRCM from a specific base

Todo:
Proper initialisation

Definition at line 36 of file Prcm.cc.

References PhysicalMemoryManager::continuous, PhysicalMemoryManager::instance(), VirtualAddressSpace::KernelMode, and VirtualAddressSpace::Write.

Referenced by ArmBeagle::initialise2().

+ Here is the caller graph for this function:

void Prcm::SelectClockCORE ( size_t  clock,
Clock  which 
)

Handle source clock selection for CORE

Definition at line 78 of file Prcm.cc.

References ERROR.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::SelectClockPER ( size_t  clock,
Clock  which 
)

Handle source clock selection for PER

Definition at line 50 of file Prcm.cc.

References ERROR.

Referenced by GPTimer::initialise().

+ Here is the caller graph for this function:

void Prcm::SelectClockPLL ( size_t  n,
size_t  value 
)

Clock selection for PLL. The register contents must be set by the programmer.

Definition at line 308 of file Prcm.cc.

References ERROR.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::SetClockPLL ( size_t  n,
size_t  value 
)

Enables or disables a PLL clock (programmer chooses value)

Definition at line 335 of file Prcm.cc.

References ERROR, and WARNING.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::SetFuncClockCORE ( size_t  n,
size_t  clock,
bool  enabled 
)

Handle functional clock enable/disable for CORE

Definition at line 166 of file Prcm.cc.

References ERROR, and WARNING.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::SetFuncClockPER ( size_t  clock,
bool  enabled 
)

Handle functional clock enable/disable for PER

Definition at line 110 of file Prcm.cc.

References ERROR.

Referenced by GPTimer::initialise().

+ Here is the caller graph for this function:

void Prcm::SetIfaceClockCORE ( size_t  n,
size_t  clock,
bool  enabled 
)

Handle interface clock enable/disable for CORE

Definition at line 200 of file Prcm.cc.

References ERROR, and WARNING.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::SetIfaceClockPER ( size_t  clock,
bool  enabled 
)

Handle interface clock enable/disable for PER

Definition at line 138 of file Prcm.cc.

References ERROR.

Referenced by GPTimer::initialise().

+ Here is the caller graph for this function:

void Prcm::WaitCoreIdleStatus ( size_t  n,
size_t  clock,
bool  waitForOn 
)

Waits for a bit in the IDLEST CORE register to change state.

Todo:
delays or something

Definition at line 234 of file Prcm.cc.

References ERROR, and WARNING.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:

void Prcm::WaitPllIdleStatus ( size_t  n,
size_t  clock,
bool  waitForOn 
)

Waits for a bit in the IDLEST PLL register to change state.

Todo:
delays or something

Definition at line 269 of file Prcm.cc.

References ERROR, and WARNING.

Referenced by UsbUlpi::initialise().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files: