1/*
2 * Copyright (c) 2014-2015 ARM Limited
3 * All rights reserved
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * Authors: Andreas Sandberg
18 */
19
20#ifndef _LIBNOMALIMODEL_MALI_MIDGARD_HH
21#define _LIBNOMALIMODEL_MALI_MIDGARD_HH
22
23#include "gpu.hh"
24
25#include "gpucontrol.hh"
26#include "jobcontrol.hh"
27#include "mmu.hh"
28
29namespace NoMali {
30
31/**
32 * Base class for Midgard based GPUs
33 */
34class MaliMidgard
35    : public GPU
36{
37  public:
38    MaliMidgard(unsigned gpuType,
39                unsigned major, unsigned minor, unsigned status);
40    MaliMidgard(uint32_t gpuId);
41    virtual ~MaliMidgard();
42
43
44  protected:
45    class GPUControlSpec
46        : public GPUControl
47    {
48      public:
49        GPUControlSpec(MaliMidgard &_gpu)
50            : GPUControl(_gpu), midgard(_gpu) {}
51
52        void reset() override;
53
54      private:
55        MaliMidgard &midgard;
56    };
57
58    virtual void setupControlIdRegisters(RegVector &regs);
59
60    GPUControlSpec gpuControl;
61    JobControl jobControl;
62    MMU mmu;
63
64  private:
65    const uint32_t gpuId;
66};
67
68}
69
70#endif // _LIBNOMALIMODEL_MALI_MIDGARD_HH
71