FreeNOS
|
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... | |
Allwinner System Control (SYSCON) module.
Definition at line 38 of file SunxiSystemControl.h.
|
private |
EMAC Clock Register flags.
Enumerator | |
---|---|
EmacClockDefault | |
EmacClockMask | |
EmacClockPhyShift | |
EmacClockLedPoll | |
EmacClockShutdown | |
EmacClockSelect | |
EmacClockRmiiEn |
Definition at line 58 of file SunxiSystemControl.h.
|
private |
Result codes.
Enumerator | |
---|---|
Success | |
IOError | |
InvalidArgument |
Definition at line 74 of file SunxiSystemControl.h.
SunxiSystemControl::Result SunxiSystemControl::initialize | ( | ) |
Perform initialization.
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().
SunxiSystemControl::Result SunxiSystemControl::setupEmac | ( | const uint | phyAddr | ) |
Setup EMAC mode.
phyAddr | PHY address |
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().
|
staticprivate |
Physical base memory address of the SYSCON module.
Definition at line 43 of file SunxiSystemControl.h.
Referenced by initialize().
|
private |
Memory I/O object.
Definition at line 100 of file SunxiSystemControl.h.
Referenced by initialize(), and setupEmac().