1 /****************************************************************************
3 * Copyright (C) 2005 - 2014 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
22 #ifndef __gc_hal_kernel_hardware_h_
23 #define __gc_hal_kernel_hardware_h_
26 #include "gc_hal_kernel_hardware_vg.h"
34 gcvHARDWARE_FUNCTION_MMU,
35 gcvHARDWARE_FUNCTION_FLUSH,
37 gcvHARDWARE_FUNCTION_NUM,
42 typedef struct _gcsHARWARE_FUNCTION
44 /* Entry of the function. */
47 /* Bytes of the function. */
52 /* gckHARDWARE object. */
58 /* Pointer to gctKERNEL object. */
61 /* Pointer to gctOS object. */
67 /* Chip characteristics. */
68 gcsHAL_QUERY_CHIP_IDENTITY identity;
69 gctBOOL allowFastClear;
70 gctBOOL allowCompression;
71 gctUINT32 powerBaseAddress;
72 gctBOOL extraEventStates;
78 gctPOINTER powerMutex;
79 gctUINT32 powerProcess;
80 gctUINT32 powerThread;
81 gceCHIPPOWERSTATE chipPowerState;
82 gctUINT32 lastWaitLink;
86 gctPOINTER globalSemaphore;
88 gctISRMANAGERFUNC startIsr;
89 gctISRMANAGERFUNC stopIsr;
90 gctPOINTER isrContext;
94 /* Whether use new MMU. It is meaningless
95 ** for old MMU since old MMU is always enabled.
100 gceHARDWARE_TYPE type;
102 #if gcdPOWEROFF_TIMEOUT
103 gctUINT32 powerOffTime;
104 gctUINT32 powerOffTimeout;
105 gctPOINTER powerOffTimer;
108 #if gcdENABLE_FSCALE_VAL_ADJUST
109 gctUINT32 powerOnFscaleVal;
111 gctPOINTER pageTableDirty;
113 #if gcdLINK_QUEUE_SIZE
114 struct _gckLINKQUEUE linkQueue;
117 gctBOOL powerManagement;
118 gctBOOL powerManagementLock;
121 gctBOOL endAfterFlushMmuCache;
123 gctUINT32 minFscaleValue;
125 gctPOINTER pendingEvent;
127 /* Function used by gckHARDWARE. */
128 gctPHYS_ADDR functionPhysical;
129 gctPOINTER functionLogical;
130 gctUINT32 functionAddress;
131 gctSIZE_T functionBytes;
133 gcsHARDWARE_FUNCTION functions[gcvHARDWARE_FUNCTION_NUM];
137 gckHARDWARE_GetBaseAddress(
138 IN gckHARDWARE Hardware,
139 OUT gctUINT32_PTR BaseAddress
143 gckHARDWARE_NeedBaseAddress(
144 IN gckHARDWARE Hardware,
146 OUT gctBOOL_PTR NeedBase
150 gckHARDWARE_GetFrameInfo(
151 IN gckHARDWARE Hardware,
152 OUT gcsHAL_FRAME_INFO * FrameInfo
159 #endif /* __gc_hal_kernel_hardware_h_ */