1/* 2 * Copyright (c) 2016 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#include <libnomali/nomali.h> 21#include <inttypes.h> 22 23#include "nomali_test_helpers.h" 24#include "../lib/mali_midg_regmap.h" 25 26#define TEST_ASn_STATUS(n) \ 27 NOMALI_TEST_REG("AS" # n "_STATUS", h, MMU_AS_REG(n, ASn_STATUS), \ 28 value == 0) 29 30int 31main(int argc, char **argv) 32{ 33 const nomali_config_t cfg = { 34 .type = NOMALI_GPU_T60X, 35 .ver_maj = 0, 36 .ver_min = 1, 37 .ver_status = 0, 38 }; 39 nomali_handle_t h; 40 uint32_t value; 41 42 E_NOMALI_BAIL(nomali_create(&h, &cfg)); 43 44 TEST_ASn_STATUS(0); 45 TEST_ASn_STATUS(1); 46 TEST_ASn_STATUS(2); 47 TEST_ASn_STATUS(3); 48 TEST_ASn_STATUS(4); 49 TEST_ASn_STATUS(5); 50 TEST_ASn_STATUS(6); 51 TEST_ASn_STATUS(7); 52 TEST_ASn_STATUS(8); 53 TEST_ASn_STATUS(9); 54 TEST_ASn_STATUS(10); 55 TEST_ASn_STATUS(11); 56 TEST_ASn_STATUS(12); 57 TEST_ASn_STATUS(13); 58 TEST_ASn_STATUS(14); 59 TEST_ASn_STATUS(15); 60 61 E_NOMALI_BAIL(nomali_destroy(h)); 62 63 64 return 0; 65} 66