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

Allwinner Power, Reset and Clock Management (PRCM) module. More...

#include <SunxiPowerManagement.h>

Public Types

enum  Result { Success, IOError, InvalidArgument }
 Result codes. More...
 

Public Member Functions

Result initialize ()
 Perform initialization. More...
 
Result powerOnCore (const Size coreId)
 Power on a processor. More...
 

Private Types

enum  Registers { CpuPowerOff = 0x100, CpuPowerClamp = 0x140 }
 Hardware registers. More...
 

Private Attributes

Arch::IO m_io
 Memory I/O object. More...
 

Static Private Attributes

static const Address IOBase = 0x01F01400
 Physical base memory address of the PRCM module. More...
 
static const Size NumberOfCores = 4
 Total number of cores supported. More...
 

Detailed Description

Allwinner Power, Reset and Clock Management (PRCM) module.

Definition at line 38 of file SunxiPowerManagement.h.

Member Enumeration Documentation

◆ Registers

Hardware registers.

Enumerator
CpuPowerOff 
CpuPowerClamp 

Definition at line 53 of file SunxiPowerManagement.h.

◆ Result

Result codes.

Enumerator
Success 
IOError 
InvalidArgument 

Definition at line 64 of file SunxiPowerManagement.h.

Member Function Documentation

◆ initialize()

SunxiPowerManagement::Result SunxiPowerManagement::initialize ( )

Perform initialization.

Returns
Result code.

Definition at line 20 of file SunxiPowerManagement.cpp.

References Memory::Device, ERROR, IO::getBase(), IOBase, IOError, m_io, IO::map(), PAGESIZE, Memory::Readable, IO::setBase(), IO::Success, Success, Memory::User, and Memory::Writable.

Referenced by SunxiCpuConfig::initialize().

◆ powerOnCore()

SunxiPowerManagement::Result SunxiPowerManagement::powerOnCore ( const Size  coreId)

Power on a processor.

Parameters
coreIdNumber of the core to power on.
Returns
Result code.

Definition at line 34 of file SunxiPowerManagement.cpp.

References coreId, CpuPowerClamp, CpuPowerOff, ERROR, InvalidArgument, m_io, NumberOfCores, Success, ARMIO::unset(), and ARMIO::write().

Referenced by SunxiCpuConfig::boot().

Field Documentation

◆ IOBase

const Address SunxiPowerManagement::IOBase = 0x01F01400
staticprivate

Physical base memory address of the PRCM module.

Definition at line 43 of file SunxiPowerManagement.h.

Referenced by initialize().

◆ m_io

Arch::IO SunxiPowerManagement::m_io
private

Memory I/O object.

Definition at line 90 of file SunxiPowerManagement.h.

Referenced by initialize(), and powerOnCore().

◆ NumberOfCores

const Size SunxiPowerManagement::NumberOfCores = 4
staticprivate

Total number of cores supported.

Definition at line 46 of file SunxiPowerManagement.h.

Referenced by powerOnCore().


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