xref: /openbmc/qemu/include/hw/misc/mips_cpc.h (revision 683685e7)
11f93a6e4SLeon Alrae /*
21f93a6e4SLeon Alrae  * Cluster Power Controller emulation
31f93a6e4SLeon Alrae  *
41f93a6e4SLeon Alrae  * Copyright (c) 2016 Imagination Technologies
51f93a6e4SLeon Alrae  *
61f93a6e4SLeon Alrae  * This library is free software; you can redistribute it and/or
71f93a6e4SLeon Alrae  * modify it under the terms of the GNU Lesser General Public
81f93a6e4SLeon Alrae  * License as published by the Free Software Foundation; either
9*d136ecc0SChetan Pant  * version 2.1 of the License, or (at your option) any later version.
101f93a6e4SLeon Alrae  *
111f93a6e4SLeon Alrae  * This library is distributed in the hope that it will be useful,
121f93a6e4SLeon Alrae  * but WITHOUT ANY WARRANTY; without even the implied warranty of
131f93a6e4SLeon Alrae  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
141f93a6e4SLeon Alrae  * Lesser General Public License for more details.
151f93a6e4SLeon Alrae  *
161f93a6e4SLeon Alrae  * You should have received a copy of the GNU Lesser General Public
171f93a6e4SLeon Alrae  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
181f93a6e4SLeon Alrae  */
191f93a6e4SLeon Alrae 
201f93a6e4SLeon Alrae #ifndef MIPS_CPC_H
211f93a6e4SLeon Alrae #define MIPS_CPC_H
221f93a6e4SLeon Alrae 
23ec150c7eSMarkus Armbruster #include "hw/sysbus.h"
24db1015e9SEduardo Habkost #include "qom/object.h"
25ec150c7eSMarkus Armbruster 
261f93a6e4SLeon Alrae #define CPC_ADDRSPACE_SZ    0x6000
271f93a6e4SLeon Alrae 
281f93a6e4SLeon Alrae /* CPC blocks offsets relative to base address */
291f93a6e4SLeon Alrae #define CPC_CL_BASE_OFS     0x2000
301f93a6e4SLeon Alrae #define CPC_CO_BASE_OFS     0x4000
311f93a6e4SLeon Alrae 
321f93a6e4SLeon Alrae /* CPC register offsets relative to block offsets */
331f93a6e4SLeon Alrae #define CPC_VP_STOP_OFS     0x20
341f93a6e4SLeon Alrae #define CPC_VP_RUN_OFS      0x28
351f93a6e4SLeon Alrae #define CPC_VP_RUNNING_OFS  0x30
361f93a6e4SLeon Alrae 
371f93a6e4SLeon Alrae #define TYPE_MIPS_CPC "mips-cpc"
388063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPCState, MIPS_CPC)
391f93a6e4SLeon Alrae 
40db1015e9SEduardo Habkost struct MIPSCPCState {
411f93a6e4SLeon Alrae     SysBusDevice parent_obj;
421f93a6e4SLeon Alrae 
431f93a6e4SLeon Alrae     uint32_t num_vp;
441f93a6e4SLeon Alrae     uint64_t vp_start_running; /* VPs running from restart */
451f93a6e4SLeon Alrae 
461f93a6e4SLeon Alrae     MemoryRegion mr;
471f93a6e4SLeon Alrae     uint64_t vp_running; /* Indicates which VPs are in the run state */
48db1015e9SEduardo Habkost };
491f93a6e4SLeon Alrae 
501f93a6e4SLeon Alrae #endif /* MIPS_CPC_H */
51