NoMali.py revision 11619
113454Spau.cabre@metempsy.com# Copyright (c) 2014-2016 ARM Limited 213454Spau.cabre@metempsy.com# All rights reserved. 313454Spau.cabre@metempsy.com# 413454Spau.cabre@metempsy.com# The license below extends only to copyright in the software and shall 513454Spau.cabre@metempsy.com# not be construed as granting a license to any other intellectual 613454Spau.cabre@metempsy.com# property including but not limited to intellectual property relating 713454Spau.cabre@metempsy.com# to a hardware implementation of the functionality of the software 813454Spau.cabre@metempsy.com# licensed hereunder. You may use the software subject to the license 913454Spau.cabre@metempsy.com# terms below provided that you ensure that this notice is replicated 1013454Spau.cabre@metempsy.com# unmodified and in its entirety in all distributions of the software, 1113454Spau.cabre@metempsy.com# modified or unmodified, in source code or in binary form. 1213454Spau.cabre@metempsy.com# 1313454Spau.cabre@metempsy.com# Redistribution and use in source and binary forms, with or without 1413454Spau.cabre@metempsy.com# modification, are permitted provided that the following conditions are 1513454Spau.cabre@metempsy.com# met: redistributions of source code must retain the above copyright 1613454Spau.cabre@metempsy.com# notice, this list of conditions and the following disclaimer; 1713454Spau.cabre@metempsy.com# redistributions in binary form must reproduce the above copyright 1813454Spau.cabre@metempsy.com# notice, this list of conditions and the following disclaimer in the 1913454Spau.cabre@metempsy.com# documentation and/or other materials provided with the distribution; 2013454Spau.cabre@metempsy.com# neither the name of the copyright holders nor the names of its 2113454Spau.cabre@metempsy.com# contributors may be used to endorse or promote products derived from 2213454Spau.cabre@metempsy.com# this software without specific prior written permission. 2313454Spau.cabre@metempsy.com# 2413454Spau.cabre@metempsy.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2513454Spau.cabre@metempsy.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2613454Spau.cabre@metempsy.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2713454Spau.cabre@metempsy.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2813454Spau.cabre@metempsy.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2913454Spau.cabre@metempsy.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3013454Spau.cabre@metempsy.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3113454Spau.cabre@metempsy.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3213454Spau.cabre@metempsy.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3313454Spau.cabre@metempsy.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3413454Spau.cabre@metempsy.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3513454Spau.cabre@metempsy.com# 3613454Spau.cabre@metempsy.com# Authors: Andreas Sandberg 3713454Spau.cabre@metempsy.com 3813454Spau.cabre@metempsy.comfrom m5.params import * 3913454Spau.cabre@metempsy.comfrom Device import BasicPioDevice 4013454Spau.cabre@metempsy.comfrom Gic import * 4113454Spau.cabre@metempsy.com 4213454Spau.cabre@metempsy.comclass NoMaliGpuType(Enum): vals = [ 4313454Spau.cabre@metempsy.com 'T60x', 4413454Spau.cabre@metempsy.com 'T62x', 4513454Spau.cabre@metempsy.com 'T760', 4613454Spau.cabre@metempsy.com ] 4713454Spau.cabre@metempsy.com 4813454Spau.cabre@metempsy.comclass NoMaliGpu(PioDevice): 4913454Spau.cabre@metempsy.com type = 'NoMaliGpu' 5013626Sjairo.balart@metempsy.com cxx_header = "dev/arm/gpu_nomali.hh" 5113454Spau.cabre@metempsy.com 5213454Spau.cabre@metempsy.com pio_addr = Param.Addr("Device base address") 5313454Spau.cabre@metempsy.com 5413454Spau.cabre@metempsy.com platform = Param.RealView(Parent.any, "Platform this device is part of.") 5513454Spau.cabre@metempsy.com 5613454Spau.cabre@metempsy.com gpu_type = Param.NoMaliGpuType("T760", "GPU type") 5713626Sjairo.balart@metempsy.com ver_maj = Param.UInt32(0, "GPU Version (Major)") 5813454Spau.cabre@metempsy.com ver_min = Param.UInt32(0, "GPU Version (Minor)") 5913454Spau.cabre@metempsy.com ver_status = Param.UInt32(0, "GPU Version (Status)") 6013454Spau.cabre@metempsy.com 6113454Spau.cabre@metempsy.com int_gpu = Param.UInt32("Interrupt number for GPU interrupts") 6213685Sjavier.bueno@metempsy.com int_job = Param.UInt32("Interrupt number for JOB interrupts") 6313454Spau.cabre@metempsy.com int_mmu = Param.UInt32("Interrupt number for MMU interrupts") 6413626Sjairo.balart@metempsy.com 6513626Sjairo.balart@metempsy.comclass CustomNoMaliGpu(NoMaliGpu): 6613454Spau.cabre@metempsy.com """Base class for custom NoMali implementation that need to override 6713454Spau.cabre@metempsy.com configuration registers. See CustomNoMaliT760 for a usage example. 6813454Spau.cabre@metempsy.com 6913685Sjavier.bueno@metempsy.com """ 7013454Spau.cabre@metempsy.com 7113454Spau.cabre@metempsy.com type = 'CustomNoMaliGpu' 7213454Spau.cabre@metempsy.com cxx_header = "dev/arm/gpu_nomali.hh" 7313685Sjavier.bueno@metempsy.com 7413626Sjairo.balart@metempsy.com gpu_id = Param.UInt32("") 7513454Spau.cabre@metempsy.com l2_features = Param.UInt32("") 7613454Spau.cabre@metempsy.com tiler_features = Param.UInt32("") 7713626Sjairo.balart@metempsy.com mem_features = Param.UInt32("") 7813685Sjavier.bueno@metempsy.com mmu_features = Param.UInt32("") 7913685Sjavier.bueno@metempsy.com as_present = Param.UInt32("") 8013454Spau.cabre@metempsy.com js_present = Param.UInt32("") 8113454Spau.cabre@metempsy.com 8213685Sjavier.bueno@metempsy.com thread_max_threads = Param.UInt32("") 8313685Sjavier.bueno@metempsy.com thread_max_workgroup_size = Param.UInt32("") 8413685Sjavier.bueno@metempsy.com thread_max_barrier_size = Param.UInt32("") 8513626Sjairo.balart@metempsy.com thread_features = Param.UInt32("") 8613454Spau.cabre@metempsy.com 8713454Spau.cabre@metempsy.com texture_features = VectorParam.UInt32("") 8813454Spau.cabre@metempsy.com js_features = VectorParam.UInt32("") 8913454Spau.cabre@metempsy.com 9013454Spau.cabre@metempsy.com shader_present = Param.UInt64("") 9113626Sjairo.balart@metempsy.com tiler_present = Param.UInt64("") 9213626Sjairo.balart@metempsy.com l2_present = Param.UInt64("") 9313454Spau.cabre@metempsy.com 9413454Spau.cabre@metempsy.comclass CustomNoMaliT760(CustomNoMaliGpu): 9513454Spau.cabre@metempsy.com """Example NoMali T760 r0p0-0 configuration using the defaults from 9613454Spau.cabre@metempsy.com the NoMali library. 9713626Sjairo.balart@metempsy.com 9813626Sjairo.balart@metempsy.com """ 9913685Sjavier.bueno@metempsy.com 10013626Sjairo.balart@metempsy.com gpu_id = 0x07500000 10113626Sjairo.balart@metempsy.com 10213626Sjairo.balart@metempsy.com l2_features = 0x07130206 10313626Sjairo.balart@metempsy.com tiler_features = 0x00000809 10413626Sjairo.balart@metempsy.com mem_features = 0x00000001 10513454Spau.cabre@metempsy.com mmu_features = 0x00002830 10613454Spau.cabre@metempsy.com as_present = 0x000000ff 10713454Spau.cabre@metempsy.com js_present = 0x00000007 10813454Spau.cabre@metempsy.com 10913626Sjairo.balart@metempsy.com thread_max_threads = 0x00000100 11013626Sjairo.balart@metempsy.com thread_max_workgroup_size = 0x00000100 11113454Spau.cabre@metempsy.com thread_max_barrier_size = 0x00000100 11213626Sjairo.balart@metempsy.com thread_features = 0x0a040400 11313626Sjairo.balart@metempsy.com 11413454Spau.cabre@metempsy.com texture_features = [ 11513454Spau.cabre@metempsy.com 0x00fe001e, 11613454Spau.cabre@metempsy.com 0x0000ffff, 11713454Spau.cabre@metempsy.com 0x9f81ffff, 11813454Spau.cabre@metempsy.com ] 11913454Spau.cabre@metempsy.com js_features = [ 12013454Spau.cabre@metempsy.com 0x0000020e, 12113626Sjairo.balart@metempsy.com 0x000001fe, 12213626Sjairo.balart@metempsy.com 0x0000007e, 12313454Spau.cabre@metempsy.com ] 12413454Spau.cabre@metempsy.com 12513454Spau.cabre@metempsy.com shader_present = 0x0000000f 12613454Spau.cabre@metempsy.com tiler_present = 0x00000001 12713454Spau.cabre@metempsy.com l2_present = 0x00000001 12813454Spau.cabre@metempsy.com