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

Allwinner System Control (SYSCON) module. More...

#include <SunxiSystemControl.h>

Public Types

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

Public Member Functions

Result initialize ()
 Perform initialization. More...
 
Result setupEmac (const uint phyAddr)
 Setup EMAC mode. More...
 

Private Types

enum  Registers { EmacClock = 0x30 }
 Hardware registers. More...
 
enum  EmacClockFlags {
  EmacClockDefault = 0x58000, EmacClockMask = 0xffff8000, EmacClockPhyShift = 20, EmacClockLedPoll = (1 << 17),
  EmacClockShutdown = (1 << 16), EmacClockSelect = (1 << 15), EmacClockRmiiEn = (1 << 13)
}
 EMAC Clock Register flags. More...
 

Private Attributes

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

Static Private Attributes

static const Address IOBase = 0x01C00000
 Physical base memory address of the SYSCON module. More...
 

Detailed Description

Allwinner System Control (SYSCON) module.

Definition at line 38 of file SunxiSystemControl.h.

Member Enumeration Documentation

◆ EmacClockFlags

EMAC Clock Register flags.

Enumerator
EmacClockDefault 
EmacClockMask 
EmacClockPhyShift 
EmacClockLedPoll 
EmacClockShutdown 
EmacClockSelect 
EmacClockRmiiEn 

Definition at line 58 of file SunxiSystemControl.h.

◆ Registers

Hardware registers.

Enumerator
EmacClock 

Definition at line 50 of file SunxiSystemControl.h.

◆ Result

Result codes.

Enumerator
Success 
IOError 
InvalidArgument 

Definition at line 74 of file SunxiSystemControl.h.

Member Function Documentation

◆ initialize()

SunxiSystemControl::Result SunxiSystemControl::initialize ( )

Perform initialization.

Returns
Result code.

Definition at line 21 of file SunxiSystemControl.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 Sun8iEmac::initialize().

◆ setupEmac()

SunxiSystemControl::Result SunxiSystemControl::setupEmac ( const uint  phyAddr)

Setup EMAC mode.

Parameters
phyAddrPHY address
Returns
Result code.

Definition at line 35 of file SunxiSystemControl.cpp.

References DEBUG, EmacClock, EmacClockDefault, EmacClockLedPoll, EmacClockMask, EmacClockPhyShift, EmacClockRmiiEn, EmacClockSelect, EmacClockShutdown, m_io, ARMIO::read(), Success, and ARMIO::write().

Referenced by Sun8iEmac::resetPhy().

Field Documentation

◆ IOBase

const Address SunxiSystemControl::IOBase = 0x01C00000
staticprivate

Physical base memory address of the SYSCON module.

Definition at line 43 of file SunxiSystemControl.h.

Referenced by initialize().

◆ m_io

Arch::IO SunxiSystemControl::m_io
private

Memory I/O object.

Definition at line 100 of file SunxiSystemControl.h.

Referenced by initialize(), and setupEmac().


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