FreeNOS
Public Member Functions | Private Types | Private Attributes | Static Private Attributes
SunxiCpuConfig Class Reference

Allwinner sunxi CPU configuration module support. More...

#include <SunxiCpuConfig.h>

Inheritance diagram for SunxiCpuConfig:
CoreManager

Public Member Functions

virtual Result initialize ()
 Perform initialization. More...
 
virtual Result discover ()
 Discover processors. More...
 
virtual Result boot (CoreInfo *info)
 Boot a processor. More...
 
- Public Member Functions inherited from CoreManager
 CoreManager ()
 Constructor. More...
 
List< uint > & getCores ()
 Get list of core identities. More...
 

Private Types

enum  Registers {
  CpusRstCtrl = 0x0000, Cpu0RstCtrl = 0x0040, Cpu0Ctrl = 0x0044, Cpu0Status = 0x0048,
  Cpu1RstCtrl = 0x0080, Cpu1Ctrl = 0x0084, Cpu1Status = 0x0088, Cpu2RstCtrl = 0x00C0,
  Cpu2Ctrl = 0x00C4, Cpu2Status = 0x00C8, Cpu3RstCtrl = 0x0100, Cpu3Ctrl = 0x0104,
  Cpu3Status = 0x0108, Cpu0PwrClamp = 0x0120, Cpu1PwrClamp = 0x0124, Cpu2PwrClamp = 0x0128,
  Cpu3PwrClamp = 0x012C, CpuSysRst = 0x0140, ClkGating = 0x0144, GenCtrl = 0x0184,
  SuperStandby = 0x01A0, EntryAddr = 0x01A4, DbgExtern = 0x01E4, Cnt64Ctrl = 0x0280,
  Cnt64Low = 0x0284, Cnt64High = 0x0288
}
 Hardware registers. More...
 
enum  CpuRstCtrlFlags { CpuCoreReset = (1 << 1) }
 CPU::X Reset Control flags. More...
 

Private Attributes

Arch::IO m_io
 Memory I/O object. More...
 
SunxiPowerManagement m_power
 Power Management module. More...
 

Static Private Attributes

static const Size NumberOfCores = 4
 Number of CPU processor cores is fixed. More...
 
static const Address IOBase = 0x01F01C00
 Physical base memory address of CPU Configuration Module. More...
 

Additional Inherited Members

- Public Types inherited from CoreManager
enum  Result { Success, IOError, NotFound, InvalidArgument }
 Result codes. More...
 
- Protected Attributes inherited from CoreManager
List< uintm_cores
 List of core ids found. More...
 

Detailed Description

Allwinner sunxi CPU configuration module support.

Definition at line 39 of file SunxiCpuConfig.h.

Member Enumeration Documentation

◆ CpuRstCtrlFlags

CPU::X Reset Control flags.

Enumerator
CpuCoreReset 

Definition at line 85 of file SunxiCpuConfig.h.

◆ Registers

Hardware registers.

Enumerator
CpusRstCtrl 

CPUs Reset Control.

Cpu0RstCtrl 

CPU#0 Reset Control.

Cpu0Ctrl 

CPU#0 Control.

Cpu0Status 

CPU#0 Status.

Cpu1RstCtrl 

CPU#1 Reset Control.

Cpu1Ctrl 

CPU#1 Control.

Cpu1Status 

CPU#1 Status.

Cpu2RstCtrl 

CPU#2 Reset Control.

Cpu2Ctrl 

CPU#2 Control.

Cpu2Status 

CPU#2 Status.

Cpu3RstCtrl 

CPU#3 Reset Control.

Cpu3Ctrl 

CPU#3 Control.

Cpu3Status 

CPU#3 Status.

Cpu0PwrClamp 

CPU#0 Power Clamp.

Cpu1PwrClamp 

CPU#0 Power Clamp.

Cpu2PwrClamp 

CPU#0 Power Clamp.

Cpu3PwrClamp 

CPU#0 Power Clamp.

CpuSysRst 

CPU System Reset.

ClkGating 

CPU Clock Gating.

GenCtrl 

General Control.

SuperStandby 

Super Standby Flag.

EntryAddr 

Reset Entry Address.

DbgExtern 

Debug External.

Cnt64Ctrl 

64-bit Counter Control

Cnt64Low 

64-bit Counter Low

Cnt64High 

64-bit Counter High

Definition at line 52 of file SunxiCpuConfig.h.

Member Function Documentation

◆ boot()

SunxiCpuConfig::Result SunxiCpuConfig::boot ( CoreInfo info)
virtual

◆ discover()

SunxiCpuConfig::Result SunxiCpuConfig::discover ( )
virtual

Discover processors.

Returns
Result code.

Implements CoreManager.

Definition at line 44 of file SunxiCpuConfig.cpp.

References List< T >::append(), CoreManager::m_cores, NumberOfCores, and CoreManager::Success.

Referenced by SunxiCoreServer::discoverCores().

◆ initialize()

SunxiCpuConfig::Result SunxiCpuConfig::initialize ( )
virtual

Field Documentation

◆ IOBase

const Address SunxiCpuConfig::IOBase = 0x01F01C00
staticprivate

Physical base memory address of CPU Configuration Module.

Definition at line 47 of file SunxiCpuConfig.h.

Referenced by initialize().

◆ m_io

Arch::IO SunxiCpuConfig::m_io
private

Memory I/O object.

Definition at line 118 of file SunxiCpuConfig.h.

Referenced by boot(), and initialize().

◆ m_power

SunxiPowerManagement SunxiCpuConfig::m_power
private

Power Management module.

Definition at line 121 of file SunxiCpuConfig.h.

Referenced by boot(), and initialize().

◆ NumberOfCores

const Size SunxiCpuConfig::NumberOfCores = 4
staticprivate

Number of CPU processor cores is fixed.

Definition at line 44 of file SunxiCpuConfig.h.

Referenced by discover().


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