FreeNOS
SunxiCpuConfig.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIBARCH_ARM_SUNXI_SUNXICPUCONFIG_H
19#define __LIBARCH_ARM_SUNXI_SUNXICPUCONFIG_H
20
21#include <FreeNOS/System.h>
22#include <CoreManager.h>
24
40{
41 private:
42
44 static const Size NumberOfCores = 4;
45
47 static const Address IOBase = 0x01F01C00;
48
53 {
54 CpusRstCtrl = 0x0000,
55 Cpu0RstCtrl = 0x0040,
56 Cpu0Ctrl = 0x0044,
57 Cpu0Status = 0x0048,
58 Cpu1RstCtrl = 0x0080,
59 Cpu1Ctrl = 0x0084,
60 Cpu1Status = 0x0088,
61 Cpu2RstCtrl = 0x00C0,
62 Cpu2Ctrl = 0x00C4,
63 Cpu2Status = 0x00C8,
64 Cpu3RstCtrl = 0x0100,
65 Cpu3Ctrl = 0x0104,
66 Cpu3Status = 0x0108,
67 Cpu0PwrClamp = 0x0120,
68 Cpu1PwrClamp = 0x0124,
69 Cpu2PwrClamp = 0x0128,
70 Cpu3PwrClamp = 0x012C,
71 CpuSysRst = 0x0140,
72 ClkGating = 0x0144,
73 GenCtrl = 0x0184,
74 SuperStandby = 0x01A0,
75 EntryAddr = 0x01A4,
76 DbgExtern = 0x01E4,
77 Cnt64Ctrl = 0x0280,
78 Cnt64Low = 0x0284,
79 Cnt64High = 0x0288,
80 };
81
86 {
87 CpuCoreReset = (1 << 1)
88 };
89
90 public:
91
97 virtual Result initialize();
98
104 virtual Result discover();
105
113 virtual Result boot(CoreInfo *info);
114
115 private:
116
119
122};
123
130#endif /* __LIBARCH_ARM_SUNXI_SUNXICPUCONFIG_H */
Input/Output operations specific to the ARM architecture.
Definition ARMIO.h:40
Generic Core Manager.
Definition CoreManager.h:37
Result
Result codes.
Definition CoreManager.h:46
Allwinner sunxi CPU configuration module support.
static const Address IOBase
Physical base memory address of CPU Configuration Module.
virtual Result discover()
Discover processors.
virtual Result initialize()
Perform initialization.
Arch::IO m_io
Memory I/O object.
virtual Result boot(CoreInfo *info)
Boot a processor.
SunxiPowerManagement m_power
Power Management module.
Registers
Hardware registers.
@ Cpu1PwrClamp
CPU#0 Power Clamp.
@ Cpu2PwrClamp
CPU#0 Power Clamp.
@ Cnt64Low
64-bit Counter Low
@ Cpu1Status
CPU#1 Status.
@ Cpu1RstCtrl
CPU#1 Reset Control.
@ Cnt64Ctrl
64-bit Counter Control
@ Cpu3Ctrl
CPU#3 Control.
@ Cpu0Status
CPU#0 Status.
@ Cpu2Status
CPU#2 Status.
@ Cpu2RstCtrl
CPU#2 Reset Control.
@ Cnt64High
64-bit Counter High
@ GenCtrl
General Control.
@ Cpu0RstCtrl
CPU#0 Reset Control.
@ Cpu0PwrClamp
CPU#0 Power Clamp.
@ Cpu3Status
CPU#3 Status.
@ Cpu3RstCtrl
CPU#3 Reset Control.
@ Cpu1Ctrl
CPU#1 Control.
@ Cpu0Ctrl
CPU#0 Control.
@ CpuSysRst
CPU System Reset.
@ DbgExtern
Debug External.
@ ClkGating
CPU Clock Gating.
@ EntryAddr
Reset Entry Address.
@ Cpu2Ctrl
CPU#2 Control.
@ SuperStandby
Super Standby Flag.
@ CpusRstCtrl
CPUs Reset Control.
@ Cpu3PwrClamp
CPU#0 Power Clamp.
static const Size NumberOfCores
Number of CPU processor cores is fixed.
CpuRstCtrlFlags
CPU::X Reset Control flags.
Allwinner Power, Reset and Clock Management (PRCM) module.
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Per-Core information structure.
Definition CoreInfo.h:61