18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2000, 2004, 2005  MIPS Technologies, Inc.
48c2ecf20Sopenharmony_ci *	All rights reserved.
58c2ecf20Sopenharmony_ci *	Authors: Carsten Langgaard <carstenl@mips.com>
68c2ecf20Sopenharmony_ci *		 Maciej W. Rozycki <macro@mips.com>
78c2ecf20Sopenharmony_ci * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _ASM_GT64120_H
108c2ecf20Sopenharmony_ci#define _ASM_GT64120_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <asm/addrspace.h>
138c2ecf20Sopenharmony_ci#include <asm/byteorder.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define MSK(n)			((1 << (n)) - 1)
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci *  Register offset addresses
198c2ecf20Sopenharmony_ci */
208c2ecf20Sopenharmony_ci/* CPU Configuration.  */
218c2ecf20Sopenharmony_ci#define GT_CPU_OFS		0x000
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define GT_MULTI_OFS		0x120
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* CPU Address Decode.	*/
268c2ecf20Sopenharmony_ci#define GT_SCS10LD_OFS		0x008
278c2ecf20Sopenharmony_ci#define GT_SCS10HD_OFS		0x010
288c2ecf20Sopenharmony_ci#define GT_SCS32LD_OFS		0x018
298c2ecf20Sopenharmony_ci#define GT_SCS32HD_OFS		0x020
308c2ecf20Sopenharmony_ci#define GT_CS20LD_OFS		0x028
318c2ecf20Sopenharmony_ci#define GT_CS20HD_OFS		0x030
328c2ecf20Sopenharmony_ci#define GT_CS3BOOTLD_OFS	0x038
338c2ecf20Sopenharmony_ci#define GT_CS3BOOTHD_OFS	0x040
348c2ecf20Sopenharmony_ci#define GT_PCI0IOLD_OFS		0x048
358c2ecf20Sopenharmony_ci#define GT_PCI0IOHD_OFS		0x050
368c2ecf20Sopenharmony_ci#define GT_PCI0M0LD_OFS		0x058
378c2ecf20Sopenharmony_ci#define GT_PCI0M0HD_OFS		0x060
388c2ecf20Sopenharmony_ci#define GT_ISD_OFS		0x068
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define GT_PCI0M1LD_OFS		0x080
418c2ecf20Sopenharmony_ci#define GT_PCI0M1HD_OFS		0x088
428c2ecf20Sopenharmony_ci#define GT_PCI1IOLD_OFS		0x090
438c2ecf20Sopenharmony_ci#define GT_PCI1IOHD_OFS		0x098
448c2ecf20Sopenharmony_ci#define GT_PCI1M0LD_OFS		0x0a0
458c2ecf20Sopenharmony_ci#define GT_PCI1M0HD_OFS		0x0a8
468c2ecf20Sopenharmony_ci#define GT_PCI1M1LD_OFS		0x0b0
478c2ecf20Sopenharmony_ci#define GT_PCI1M1HD_OFS		0x0b8
488c2ecf20Sopenharmony_ci#define GT_PCI1M1LD_OFS		0x0b0
498c2ecf20Sopenharmony_ci#define GT_PCI1M1HD_OFS		0x0b8
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define GT_SCS10AR_OFS		0x0d0
528c2ecf20Sopenharmony_ci#define GT_SCS32AR_OFS		0x0d8
538c2ecf20Sopenharmony_ci#define GT_CS20R_OFS		0x0e0
548c2ecf20Sopenharmony_ci#define GT_CS3BOOTR_OFS		0x0e8
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define GT_PCI0IOREMAP_OFS	0x0f0
578c2ecf20Sopenharmony_ci#define GT_PCI0M0REMAP_OFS	0x0f8
588c2ecf20Sopenharmony_ci#define GT_PCI0M1REMAP_OFS	0x100
598c2ecf20Sopenharmony_ci#define GT_PCI1IOREMAP_OFS	0x108
608c2ecf20Sopenharmony_ci#define GT_PCI1M0REMAP_OFS	0x110
618c2ecf20Sopenharmony_ci#define GT_PCI1M1REMAP_OFS	0x118
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* CPU Error Report.  */
648c2ecf20Sopenharmony_ci#define GT_CPUERR_ADDRLO_OFS	0x070
658c2ecf20Sopenharmony_ci#define GT_CPUERR_ADDRHI_OFS	0x078
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define GT_CPUERR_DATALO_OFS	0x128			/* GT-64120A only  */
688c2ecf20Sopenharmony_ci#define GT_CPUERR_DATAHI_OFS	0x130			/* GT-64120A only  */
698c2ecf20Sopenharmony_ci#define GT_CPUERR_PARITY_OFS	0x138			/* GT-64120A only  */
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/* CPU Sync Barrier.  */
728c2ecf20Sopenharmony_ci#define GT_PCI0SYNC_OFS		0x0c0
738c2ecf20Sopenharmony_ci#define GT_PCI1SYNC_OFS		0x0c8
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/* SDRAM and Device Address Decode.  */
768c2ecf20Sopenharmony_ci#define GT_SCS0LD_OFS		0x400
778c2ecf20Sopenharmony_ci#define GT_SCS0HD_OFS		0x404
788c2ecf20Sopenharmony_ci#define GT_SCS1LD_OFS		0x408
798c2ecf20Sopenharmony_ci#define GT_SCS1HD_OFS		0x40c
808c2ecf20Sopenharmony_ci#define GT_SCS2LD_OFS		0x410
818c2ecf20Sopenharmony_ci#define GT_SCS2HD_OFS		0x414
828c2ecf20Sopenharmony_ci#define GT_SCS3LD_OFS		0x418
838c2ecf20Sopenharmony_ci#define GT_SCS3HD_OFS		0x41c
848c2ecf20Sopenharmony_ci#define GT_CS0LD_OFS		0x420
858c2ecf20Sopenharmony_ci#define GT_CS0HD_OFS		0x424
868c2ecf20Sopenharmony_ci#define GT_CS1LD_OFS		0x428
878c2ecf20Sopenharmony_ci#define GT_CS1HD_OFS		0x42c
888c2ecf20Sopenharmony_ci#define GT_CS2LD_OFS		0x430
898c2ecf20Sopenharmony_ci#define GT_CS2HD_OFS		0x434
908c2ecf20Sopenharmony_ci#define GT_CS3LD_OFS		0x438
918c2ecf20Sopenharmony_ci#define GT_CS3HD_OFS		0x43c
928c2ecf20Sopenharmony_ci#define GT_BOOTLD_OFS		0x440
938c2ecf20Sopenharmony_ci#define GT_BOOTHD_OFS		0x444
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define GT_ADERR_OFS		0x470
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/* SDRAM Configuration.	 */
988c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_OFS	0x448
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OFS	0x474
1018c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_OFS		0x478
1028c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_OFS 0x47c
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* SDRAM Parameters.  */
1058c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_OFS		0x44c
1068c2ecf20Sopenharmony_ci#define GT_SDRAM_B1_OFS		0x450
1078c2ecf20Sopenharmony_ci#define GT_SDRAM_B2_OFS		0x454
1088c2ecf20Sopenharmony_ci#define GT_SDRAM_B3_OFS		0x458
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/* Device Parameters.  */
1118c2ecf20Sopenharmony_ci#define GT_DEV_B0_OFS		0x45c
1128c2ecf20Sopenharmony_ci#define GT_DEV_B1_OFS		0x460
1138c2ecf20Sopenharmony_ci#define GT_DEV_B2_OFS		0x464
1148c2ecf20Sopenharmony_ci#define GT_DEV_B3_OFS		0x468
1158c2ecf20Sopenharmony_ci#define GT_DEV_BOOT_OFS		0x46c
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci/* ECC.	 */
1188c2ecf20Sopenharmony_ci#define GT_ECC_ERRDATALO	0x480			/* GT-64120A only  */
1198c2ecf20Sopenharmony_ci#define GT_ECC_ERRDATAHI	0x484			/* GT-64120A only  */
1208c2ecf20Sopenharmony_ci#define GT_ECC_MEM		0x488			/* GT-64120A only  */
1218c2ecf20Sopenharmony_ci#define GT_ECC_CALC		0x48c			/* GT-64120A only  */
1228c2ecf20Sopenharmony_ci#define GT_ECC_ERRADDR		0x490			/* GT-64120A only  */
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* DMA Record.	*/
1258c2ecf20Sopenharmony_ci#define GT_DMA0_CNT_OFS		0x800
1268c2ecf20Sopenharmony_ci#define GT_DMA1_CNT_OFS		0x804
1278c2ecf20Sopenharmony_ci#define GT_DMA2_CNT_OFS		0x808
1288c2ecf20Sopenharmony_ci#define GT_DMA3_CNT_OFS		0x80c
1298c2ecf20Sopenharmony_ci#define GT_DMA0_SA_OFS		0x810
1308c2ecf20Sopenharmony_ci#define GT_DMA1_SA_OFS		0x814
1318c2ecf20Sopenharmony_ci#define GT_DMA2_SA_OFS		0x818
1328c2ecf20Sopenharmony_ci#define GT_DMA3_SA_OFS		0x81c
1338c2ecf20Sopenharmony_ci#define GT_DMA0_DA_OFS		0x820
1348c2ecf20Sopenharmony_ci#define GT_DMA1_DA_OFS		0x824
1358c2ecf20Sopenharmony_ci#define GT_DMA2_DA_OFS		0x828
1368c2ecf20Sopenharmony_ci#define GT_DMA3_DA_OFS		0x82c
1378c2ecf20Sopenharmony_ci#define GT_DMA0_NEXT_OFS	0x830
1388c2ecf20Sopenharmony_ci#define GT_DMA1_NEXT_OFS	0x834
1398c2ecf20Sopenharmony_ci#define GT_DMA2_NEXT_OFS	0x838
1408c2ecf20Sopenharmony_ci#define GT_DMA3_NEXT_OFS	0x83c
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci#define GT_DMA0_CUR_OFS		0x870
1438c2ecf20Sopenharmony_ci#define GT_DMA1_CUR_OFS		0x874
1448c2ecf20Sopenharmony_ci#define GT_DMA2_CUR_OFS		0x878
1458c2ecf20Sopenharmony_ci#define GT_DMA3_CUR_OFS		0x87c
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/* DMA Channel Control.	 */
1488c2ecf20Sopenharmony_ci#define GT_DMA0_CTRL_OFS	0x840
1498c2ecf20Sopenharmony_ci#define GT_DMA1_CTRL_OFS	0x844
1508c2ecf20Sopenharmony_ci#define GT_DMA2_CTRL_OFS	0x848
1518c2ecf20Sopenharmony_ci#define GT_DMA3_CTRL_OFS	0x84c
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/* DMA Arbiter.	 */
1548c2ecf20Sopenharmony_ci#define GT_DMA_ARB_OFS		0x860
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci/* Timer/Counter.  */
1578c2ecf20Sopenharmony_ci#define GT_TC0_OFS		0x850
1588c2ecf20Sopenharmony_ci#define GT_TC1_OFS		0x854
1598c2ecf20Sopenharmony_ci#define GT_TC2_OFS		0x858
1608c2ecf20Sopenharmony_ci#define GT_TC3_OFS		0x85c
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_OFS	0x864
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/* PCI Internal.  */
1658c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_OFS		0xc00
1668c2ecf20Sopenharmony_ci#define GT_PCI0_TOR_OFS		0xc04
1678c2ecf20Sopenharmony_ci#define GT_PCI0_BS_SCS10_OFS	0xc08
1688c2ecf20Sopenharmony_ci#define GT_PCI0_BS_SCS32_OFS	0xc0c
1698c2ecf20Sopenharmony_ci#define GT_PCI0_BS_CS20_OFS	0xc10
1708c2ecf20Sopenharmony_ci#define GT_PCI0_BS_CS3BT_OFS	0xc14
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci#define GT_PCI1_IACK_OFS	0xc30
1738c2ecf20Sopenharmony_ci#define GT_PCI0_IACK_OFS	0xc34
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_OFS	0xc3c
1768c2ecf20Sopenharmony_ci#define GT_PCI0_PREFMBR_OFS	0xc40
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci#define GT_PCI0_SCS10_BAR_OFS	0xc48
1798c2ecf20Sopenharmony_ci#define GT_PCI0_SCS32_BAR_OFS	0xc4c
1808c2ecf20Sopenharmony_ci#define GT_PCI0_CS20_BAR_OFS	0xc50
1818c2ecf20Sopenharmony_ci#define GT_PCI0_CS3BT_BAR_OFS	0xc54
1828c2ecf20Sopenharmony_ci#define GT_PCI0_SSCS10_BAR_OFS	0xc58
1838c2ecf20Sopenharmony_ci#define GT_PCI0_SSCS32_BAR_OFS	0xc5c
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define GT_PCI0_SCS3BT_BAR_OFS	0xc64
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define GT_PCI1_CMD_OFS		0xc80
1888c2ecf20Sopenharmony_ci#define GT_PCI1_TOR_OFS		0xc84
1898c2ecf20Sopenharmony_ci#define GT_PCI1_BS_SCS10_OFS	0xc88
1908c2ecf20Sopenharmony_ci#define GT_PCI1_BS_SCS32_OFS	0xc8c
1918c2ecf20Sopenharmony_ci#define GT_PCI1_BS_CS20_OFS	0xc90
1928c2ecf20Sopenharmony_ci#define GT_PCI1_BS_CS3BT_OFS	0xc94
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define GT_PCI1_BARE_OFS	0xcbc
1958c2ecf20Sopenharmony_ci#define GT_PCI1_PREFMBR_OFS	0xcc0
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#define GT_PCI1_SCS10_BAR_OFS	0xcc8
1988c2ecf20Sopenharmony_ci#define GT_PCI1_SCS32_BAR_OFS	0xccc
1998c2ecf20Sopenharmony_ci#define GT_PCI1_CS20_BAR_OFS	0xcd0
2008c2ecf20Sopenharmony_ci#define GT_PCI1_CS3BT_BAR_OFS	0xcd4
2018c2ecf20Sopenharmony_ci#define GT_PCI1_SSCS10_BAR_OFS	0xcd8
2028c2ecf20Sopenharmony_ci#define GT_PCI1_SSCS32_BAR_OFS	0xcdc
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#define GT_PCI1_SCS3BT_BAR_OFS	0xce4
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci#define GT_PCI1_CFGADDR_OFS	0xcf0
2078c2ecf20Sopenharmony_ci#define GT_PCI1_CFGDATA_OFS	0xcf4
2088c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_OFS	0xcf8
2098c2ecf20Sopenharmony_ci#define GT_PCI0_CFGDATA_OFS	0xcfc
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci/* Interrupts.	*/
2128c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_OFS	0xc18
2138c2ecf20Sopenharmony_ci#define GT_INTRMASK_OFS		0xc1c
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci#define GT_PCI0_ICMASK_OFS	0xc24
2168c2ecf20Sopenharmony_ci#define GT_PCI0_SERR0MASK_OFS	0xc28
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define GT_CPU_INTSEL_OFS	0xc70
2198c2ecf20Sopenharmony_ci#define GT_PCI0_INTSEL_OFS	0xc74
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define GT_HINTRCAUSE_OFS	0xc98
2228c2ecf20Sopenharmony_ci#define GT_HINTRMASK_OFS	0xc9c
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define GT_PCI0_HICMASK_OFS	0xca4
2258c2ecf20Sopenharmony_ci#define GT_PCI1_SERR1MASK_OFS	0xca8
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci/*
2298c2ecf20Sopenharmony_ci * I2O Support Registers
2308c2ecf20Sopenharmony_ci */
2318c2ecf20Sopenharmony_ci#define INBOUND_MESSAGE_REGISTER0_PCI_SIDE		0x010
2328c2ecf20Sopenharmony_ci#define INBOUND_MESSAGE_REGISTER1_PCI_SIDE		0x014
2338c2ecf20Sopenharmony_ci#define OUTBOUND_MESSAGE_REGISTER0_PCI_SIDE		0x018
2348c2ecf20Sopenharmony_ci#define OUTBOUND_MESSAGE_REGISTER1_PCI_SIDE		0x01c
2358c2ecf20Sopenharmony_ci#define INBOUND_DOORBELL_REGISTER_PCI_SIDE		0x020
2368c2ecf20Sopenharmony_ci#define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE	0x024
2378c2ecf20Sopenharmony_ci#define INBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE	0x028
2388c2ecf20Sopenharmony_ci#define OUTBOUND_DOORBELL_REGISTER_PCI_SIDE		0x02c
2398c2ecf20Sopenharmony_ci#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE	0x030
2408c2ecf20Sopenharmony_ci#define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE	0x034
2418c2ecf20Sopenharmony_ci#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE	0x040
2428c2ecf20Sopenharmony_ci#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE	0x044
2438c2ecf20Sopenharmony_ci#define QUEUE_CONTROL_REGISTER_PCI_SIDE			0x050
2448c2ecf20Sopenharmony_ci#define QUEUE_BASE_ADDRESS_REGISTER_PCI_SIDE		0x054
2458c2ecf20Sopenharmony_ci#define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE	0x060
2468c2ecf20Sopenharmony_ci#define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE	0x064
2478c2ecf20Sopenharmony_ci#define INBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE	0x068
2488c2ecf20Sopenharmony_ci#define INBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE	0x06c
2498c2ecf20Sopenharmony_ci#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE	0x070
2508c2ecf20Sopenharmony_ci#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE	0x074
2518c2ecf20Sopenharmony_ci#define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE	0x078
2528c2ecf20Sopenharmony_ci#define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE	0x07c
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci#define INBOUND_MESSAGE_REGISTER0_CPU_SIDE		0x1c10
2558c2ecf20Sopenharmony_ci#define INBOUND_MESSAGE_REGISTER1_CPU_SIDE		0x1c14
2568c2ecf20Sopenharmony_ci#define OUTBOUND_MESSAGE_REGISTER0_CPU_SIDE		0x1c18
2578c2ecf20Sopenharmony_ci#define OUTBOUND_MESSAGE_REGISTER1_CPU_SIDE		0x1c1c
2588c2ecf20Sopenharmony_ci#define INBOUND_DOORBELL_REGISTER_CPU_SIDE		0x1c20
2598c2ecf20Sopenharmony_ci#define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE	0x1c24
2608c2ecf20Sopenharmony_ci#define INBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE	0x1c28
2618c2ecf20Sopenharmony_ci#define OUTBOUND_DOORBELL_REGISTER_CPU_SIDE		0x1c2c
2628c2ecf20Sopenharmony_ci#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE	0x1c30
2638c2ecf20Sopenharmony_ci#define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE	0x1c34
2648c2ecf20Sopenharmony_ci#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE	0x1c40
2658c2ecf20Sopenharmony_ci#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE	0x1c44
2668c2ecf20Sopenharmony_ci#define QUEUE_CONTROL_REGISTER_CPU_SIDE			0x1c50
2678c2ecf20Sopenharmony_ci#define QUEUE_BASE_ADDRESS_REGISTER_CPU_SIDE		0x1c54
2688c2ecf20Sopenharmony_ci#define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE	0x1c60
2698c2ecf20Sopenharmony_ci#define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE	0x1c64
2708c2ecf20Sopenharmony_ci#define INBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE	0x1c68
2718c2ecf20Sopenharmony_ci#define INBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE	0x1c6c
2728c2ecf20Sopenharmony_ci#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE	0x1c70
2738c2ecf20Sopenharmony_ci#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE	0x1c74
2748c2ecf20Sopenharmony_ci#define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE	0x1c78
2758c2ecf20Sopenharmony_ci#define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE	0x1c7c
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci/*
2788c2ecf20Sopenharmony_ci *  Register encodings
2798c2ecf20Sopenharmony_ci */
2808c2ecf20Sopenharmony_ci#define GT_CPU_ENDIAN_SHF	12
2818c2ecf20Sopenharmony_ci#define GT_CPU_ENDIAN_MSK	(MSK(1) << GT_CPU_ENDIAN_SHF)
2828c2ecf20Sopenharmony_ci#define GT_CPU_ENDIAN_BIT	GT_CPU_ENDIAN_MSK
2838c2ecf20Sopenharmony_ci#define GT_CPU_WR_SHF		16
2848c2ecf20Sopenharmony_ci#define GT_CPU_WR_MSK		(MSK(1) << GT_CPU_WR_SHF)
2858c2ecf20Sopenharmony_ci#define GT_CPU_WR_BIT		GT_CPU_WR_MSK
2868c2ecf20Sopenharmony_ci#define GT_CPU_WR_DXDXDXDX	0
2878c2ecf20Sopenharmony_ci#define GT_CPU_WR_DDDD		1
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci#define GT_PCI_DCRM_SHF		21
2918c2ecf20Sopenharmony_ci#define GT_PCI_LD_SHF		0
2928c2ecf20Sopenharmony_ci#define GT_PCI_LD_MSK		(MSK(15) << GT_PCI_LD_SHF)
2938c2ecf20Sopenharmony_ci#define GT_PCI_HD_SHF		0
2948c2ecf20Sopenharmony_ci#define GT_PCI_HD_MSK		(MSK(7) << GT_PCI_HD_SHF)
2958c2ecf20Sopenharmony_ci#define GT_PCI_REMAP_SHF	0
2968c2ecf20Sopenharmony_ci#define GT_PCI_REMAP_MSK	(MSK(11) << GT_PCI_REMAP_SHF)
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci#define GT_CFGADDR_CFGEN_SHF	31
3008c2ecf20Sopenharmony_ci#define GT_CFGADDR_CFGEN_MSK	(MSK(1) << GT_CFGADDR_CFGEN_SHF)
3018c2ecf20Sopenharmony_ci#define GT_CFGADDR_CFGEN_BIT	GT_CFGADDR_CFGEN_MSK
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci#define GT_CFGADDR_BUSNUM_SHF	16
3048c2ecf20Sopenharmony_ci#define GT_CFGADDR_BUSNUM_MSK	(MSK(8) << GT_CFGADDR_BUSNUM_SHF)
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define GT_CFGADDR_DEVNUM_SHF	11
3078c2ecf20Sopenharmony_ci#define GT_CFGADDR_DEVNUM_MSK	(MSK(5) << GT_CFGADDR_DEVNUM_SHF)
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci#define GT_CFGADDR_FUNCNUM_SHF	8
3108c2ecf20Sopenharmony_ci#define GT_CFGADDR_FUNCNUM_MSK	(MSK(3) << GT_CFGADDR_FUNCNUM_SHF)
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define GT_CFGADDR_REGNUM_SHF	2
3138c2ecf20Sopenharmony_ci#define GT_CFGADDR_REGNUM_MSK	(MSK(6) << GT_CFGADDR_REGNUM_SHF)
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_ORDER_SHF	2
3178c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_ORDER_MSK	(MSK(1) << GT_SDRAM_BM_ORDER_SHF)
3188c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_ORDER_BIT	GT_SDRAM_BM_ORDER_MSK
3198c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_ORDER_SUB	1
3208c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_ORDER_LIN	0
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ci#define GT_SDRAM_BM_RSVD_ALL1	0xffb
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_SHF	0
3268c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_MSK	(MSK(3) << GT_SDRAM_ADDRDECODE_ADDR_SHF)
3278c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_0	0
3288c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_1	1
3298c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_2	2
3308c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_3	3
3318c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_4	4
3328c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_5	5
3338c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_6	6
3348c2ecf20Sopenharmony_ci#define GT_SDRAM_ADDRDECODE_ADDR_7	7
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_CASLAT_SHF		0
3388c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_CASLAT_MSK		(MSK(2) << GT_SDRAM_B0__SHF)
3398c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_CASLAT_2		1
3408c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_CASLAT_3		2
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_FTDIS_SHF		2
3438c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_FTDIS_MSK		(MSK(1) << GT_SDRAM_B0_FTDIS_SHF)
3448c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_FTDIS_BIT		GT_SDRAM_B0_FTDIS_MSK
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRASPRCHG_SHF	3
3478c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRASPRCHG_MSK	(MSK(1) << GT_SDRAM_B0_SRASPRCHG_SHF)
3488c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRASPRCHG_BIT	GT_SDRAM_B0_SRASPRCHG_MSK
3498c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRASPRCHG_2		0
3508c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRASPRCHG_3		1
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_B0COMPAB_SHF	4
3538c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_B0COMPAB_MSK	(MSK(1) << GT_SDRAM_B0_B0COMPAB_SHF)
3548c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_B0COMPAB_BIT	GT_SDRAM_B0_B0COMPAB_MSK
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_64BITINT_SHF	5
3578c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_64BITINT_MSK	(MSK(1) << GT_SDRAM_B0_64BITINT_SHF)
3588c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_64BITINT_BIT	GT_SDRAM_B0_64BITINT_MSK
3598c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_64BITINT_2		0
3608c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_64BITINT_4		1
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BW_SHF		6
3638c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BW_MSK		(MSK(1) << GT_SDRAM_B0_BW_SHF)
3648c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BW_BIT		GT_SDRAM_B0_BW_MSK
3658c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BW_32		0
3668c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BW_64		1
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLODD_SHF		7
3698c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLODD_MSK		(MSK(1) << GT_SDRAM_B0_BLODD_SHF)
3708c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLODD_BIT		GT_SDRAM_B0_BLODD_MSK
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_PAR_SHF		8
3738c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_PAR_MSK		(MSK(1) << GT_SDRAM_B0_PAR_SHF)
3748c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_PAR_BIT		GT_SDRAM_B0_PAR_MSK
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BYPASS_SHF		9
3778c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BYPASS_MSK		(MSK(1) << GT_SDRAM_B0_BYPASS_SHF)
3788c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BYPASS_BIT		GT_SDRAM_B0_BYPASS_MSK
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRAS2SCAS_SHF	10
3818c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRAS2SCAS_MSK	(MSK(1) << GT_SDRAM_B0_SRAS2SCAS_SHF)
3828c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRAS2SCAS_BIT	GT_SDRAM_B0_SRAS2SCAS_MSK
3838c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRAS2SCAS_2		0
3848c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SRAS2SCAS_3		1
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SIZE_SHF		11
3878c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SIZE_MSK		(MSK(1) << GT_SDRAM_B0_SIZE_SHF)
3888c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SIZE_BIT		GT_SDRAM_B0_SIZE_MSK
3898c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SIZE_16M		0
3908c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_SIZE_64M		1
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_EXTPAR_SHF		12
3938c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_EXTPAR_MSK		(MSK(1) << GT_SDRAM_B0_EXTPAR_SHF)
3948c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_EXTPAR_BIT		GT_SDRAM_B0_EXTPAR_MSK
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLEN_SHF		13
3978c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLEN_MSK		(MSK(1) << GT_SDRAM_B0_BLEN_SHF)
3988c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLEN_BIT		GT_SDRAM_B0_BLEN_MSK
3998c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLEN_8		0
4008c2ecf20Sopenharmony_ci#define GT_SDRAM_B0_BLEN_4		1
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_REFINT_SHF		0
4048c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_REFINT_MSK		(MSK(14) << GT_SDRAM_CFG_REFINT_SHF)
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NINTERLEAVE_SHF	14
4078c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NINTERLEAVE_MSK	(MSK(1) << GT_SDRAM_CFG_NINTERLEAVE_SHF)
4088c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NINTERLEAVE_BIT	GT_SDRAM_CFG_NINTERLEAVE_MSK
4098c2ecf20Sopenharmony_ci
4108c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_RMW_SHF		15
4118c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_RMW_MSK		(MSK(1) << GT_SDRAM_CFG_RMW_SHF)
4128c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_RMW_BIT		GT_SDRAM_CFG_RMW_MSK
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NONSTAGREF_SHF	16
4158c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NONSTAGREF_MSK	(MSK(1) << GT_SDRAM_CFG_NONSTAGREF_SHF)
4168c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_NONSTAGREF_BIT	GT_SDRAM_CFG_NONSTAGREF_MSK
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPCNTL_SHF	19
4198c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPCNTL_MSK	(MSK(1) << GT_SDRAM_CFG_DUPCNTL_SHF)
4208c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPCNTL_BIT	GT_SDRAM_CFG_DUPCNTL_MSK
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPBA_SHF		20
4238c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPBA_MSK		(MSK(1) << GT_SDRAM_CFG_DUPBA_SHF)
4248c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPBA_BIT		GT_SDRAM_CFG_DUPBA_MSK
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT0_SHF	21
4278c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT0_MSK	(MSK(1) << GT_SDRAM_CFG_DUPEOT0_SHF)
4288c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT0_BIT	GT_SDRAM_CFG_DUPEOT0_MSK
4298c2ecf20Sopenharmony_ci
4308c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT1_SHF	22
4318c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT1_MSK	(MSK(1) << GT_SDRAM_CFG_DUPEOT1_SHF)
4328c2ecf20Sopenharmony_ci#define GT_SDRAM_CFG_DUPEOT1_BIT	GT_SDRAM_CFG_DUPEOT1_MSK
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_SHF		0
4358c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_MSK		(MSK(3) << GT_SDRAM_OPMODE_OP_SHF)
4368c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_NORMAL	0
4378c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_NOP		1
4388c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_PRCHG	2
4398c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_MODE		3
4408c2ecf20Sopenharmony_ci#define GT_SDRAM_OPMODE_OP_CBR		4
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_ENTC0_SHF		0
4438c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_ENTC0_MSK		(MSK(1) << GT_TC_CONTROL_ENTC0_SHF)
4448c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_ENTC0_BIT		GT_TC_CONTROL_ENTC0_MSK
4458c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_SELTC0_SHF	1
4468c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_SELTC0_MSK	(MSK(1) << GT_TC_CONTROL_SELTC0_SHF)
4478c2ecf20Sopenharmony_ci#define GT_TC_CONTROL_SELTC0_BIT	GT_TC_CONTROL_SELTC0_MSK
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF	0
4518c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK	(MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF)
4528c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS3BOOTDIS_BIT	GT_PCI0_BARE_SWSCS3BOOTDIS_MSK
4538c2ecf20Sopenharmony_ci
4548c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS32DIS_SHF	1
4558c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS32DIS_MSK	(MSK(1) << GT_PCI0_BARE_SWSCS32DIS_SHF)
4568c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS32DIS_BIT	GT_PCI0_BARE_SWSCS32DIS_MSK
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS10DIS_SHF	2
4598c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS10DIS_MSK	(MSK(1) << GT_PCI0_BARE_SWSCS10DIS_SHF)
4608c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SWSCS10DIS_BIT	GT_PCI0_BARE_SWSCS10DIS_MSK
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTIODIS_SHF	3
4638c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTIODIS_MSK	(MSK(1) << GT_PCI0_BARE_INTIODIS_SHF)
4648c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTIODIS_BIT	GT_PCI0_BARE_INTIODIS_MSK
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTMEMDIS_SHF	4
4678c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTMEMDIS_MSK	(MSK(1) << GT_PCI0_BARE_INTMEMDIS_SHF)
4688c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_INTMEMDIS_BIT	GT_PCI0_BARE_INTMEMDIS_MSK
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS3BOOTDIS_SHF	5
4718c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS3BOOTDIS_MSK	(MSK(1) << GT_PCI0_BARE_CS3BOOTDIS_SHF)
4728c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS3BOOTDIS_BIT	GT_PCI0_BARE_CS3BOOTDIS_MSK
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS20DIS_SHF	6
4758c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS20DIS_MSK	(MSK(1) << GT_PCI0_BARE_CS20DIS_SHF)
4768c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_CS20DIS_BIT	GT_PCI0_BARE_CS20DIS_MSK
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS32DIS_SHF	7
4798c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS32DIS_MSK	(MSK(1) << GT_PCI0_BARE_SCS32DIS_SHF)
4808c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS32DIS_BIT	GT_PCI0_BARE_SCS32DIS_MSK
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS10DIS_SHF	8
4838c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS10DIS_MSK	(MSK(1) << GT_PCI0_BARE_SCS10DIS_SHF)
4848c2ecf20Sopenharmony_ci#define GT_PCI0_BARE_SCS10DIS_BIT	GT_PCI0_BARE_SCS10DIS_MSK
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_MASABORT0_SHF	18
4888c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_MASABORT0_MSK	(MSK(1) << GT_INTRCAUSE_MASABORT0_SHF)
4898c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_MASABORT0_BIT	GT_INTRCAUSE_MASABORT0_MSK
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_TARABORT0_SHF	19
4928c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_TARABORT0_MSK	(MSK(1) << GT_INTRCAUSE_TARABORT0_SHF)
4938c2ecf20Sopenharmony_ci#define GT_INTRCAUSE_TARABORT0_BIT	GT_INTRCAUSE_TARABORT0_MSK
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_REGNUM_SHF	2
4978c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_REGNUM_MSK	(MSK(6) << GT_PCI0_CFGADDR_REGNUM_SHF)
4988c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_FUNCTNUM_SHF	8
4998c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_FUNCTNUM_MSK	(MSK(3) << GT_PCI0_CFGADDR_FUNCTNUM_SHF)
5008c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_DEVNUM_SHF	11
5018c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_DEVNUM_MSK	(MSK(5) << GT_PCI0_CFGADDR_DEVNUM_SHF)
5028c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_BUSNUM_SHF	16
5038c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_BUSNUM_MSK	(MSK(8) << GT_PCI0_CFGADDR_BUSNUM_SHF)
5048c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_CONFIGEN_SHF	31
5058c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_CONFIGEN_MSK	(MSK(1) << GT_PCI0_CFGADDR_CONFIGEN_SHF)
5068c2ecf20Sopenharmony_ci#define GT_PCI0_CFGADDR_CONFIGEN_BIT	GT_PCI0_CFGADDR_CONFIGEN_MSK
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MBYTESWAP_SHF	0
5098c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MBYTESWAP_MSK	(MSK(1) << GT_PCI0_CMD_MBYTESWAP_SHF)
5108c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MBYTESWAP_BIT	GT_PCI0_CMD_MBYTESWAP_MSK
5118c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MWORDSWAP_SHF	10
5128c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MWORDSWAP_MSK	(MSK(1) << GT_PCI0_CMD_MWORDSWAP_SHF)
5138c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_MWORDSWAP_BIT	GT_PCI0_CMD_MWORDSWAP_MSK
5148c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SBYTESWAP_SHF	16
5158c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SBYTESWAP_MSK	(MSK(1) << GT_PCI0_CMD_SBYTESWAP_SHF)
5168c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SBYTESWAP_BIT	GT_PCI0_CMD_SBYTESWAP_MSK
5178c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SWORDSWAP_SHF	11
5188c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SWORDSWAP_MSK	(MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF)
5198c2ecf20Sopenharmony_ci#define GT_PCI0_CMD_SWORDSWAP_BIT	GT_PCI0_CMD_SWORDSWAP_MSK
5208c2ecf20Sopenharmony_ci
5218c2ecf20Sopenharmony_ci#define GT_INTR_T0EXP_SHF		8
5228c2ecf20Sopenharmony_ci#define GT_INTR_T0EXP_MSK		(MSK(1) << GT_INTR_T0EXP_SHF)
5238c2ecf20Sopenharmony_ci#define GT_INTR_T0EXP_BIT		GT_INTR_T0EXP_MSK
5248c2ecf20Sopenharmony_ci#define GT_INTR_RETRYCTR0_SHF		20
5258c2ecf20Sopenharmony_ci#define GT_INTR_RETRYCTR0_MSK		(MSK(1) << GT_INTR_RETRYCTR0_SHF)
5268c2ecf20Sopenharmony_ci#define GT_INTR_RETRYCTR0_BIT		GT_INTR_RETRYCTR0_MSK
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_ci/*
5298c2ecf20Sopenharmony_ci *  Misc
5308c2ecf20Sopenharmony_ci */
5318c2ecf20Sopenharmony_ci#define GT_DEF_PCI0_IO_BASE	0x10000000UL
5328c2ecf20Sopenharmony_ci#define GT_DEF_PCI0_IO_SIZE	0x02000000UL
5338c2ecf20Sopenharmony_ci#define GT_DEF_PCI0_MEM0_BASE	0x12000000UL
5348c2ecf20Sopenharmony_ci#define GT_DEF_PCI0_MEM0_SIZE	0x02000000UL
5358c2ecf20Sopenharmony_ci#define GT_DEF_BASE		0x14000000UL
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci#define GT_MAX_BANKSIZE		(256 * 1024 * 1024)	/* Max 256MB bank  */
5388c2ecf20Sopenharmony_ci#define GT_LATTIM_MIN		6			/* Minimum lat	*/
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci/*
5418c2ecf20Sopenharmony_ci * The gt64120_dep.h file must define the following macros
5428c2ecf20Sopenharmony_ci *
5438c2ecf20Sopenharmony_ci *   GT_READ(ofs, data_pointer)
5448c2ecf20Sopenharmony_ci *   GT_WRITE(ofs, data)	   - read/write GT64120 registers in 32bit
5458c2ecf20Sopenharmony_ci *
5468c2ecf20Sopenharmony_ci *   TIMER	- gt64120 timer irq, temporary solution until
5478c2ecf20Sopenharmony_ci *		  full gt64120 cascade interrupt support is in place
5488c2ecf20Sopenharmony_ci */
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_ci#include <mach-gt64120.h>
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_ci/*
5538c2ecf20Sopenharmony_ci * Because of an error/peculiarity in the Galileo chip, we need to swap the
5548c2ecf20Sopenharmony_ci * bytes when running bigendian.  We also provide non-swapping versions.
5558c2ecf20Sopenharmony_ci */
5568c2ecf20Sopenharmony_ci#define __GT_READ(ofs)							\
5578c2ecf20Sopenharmony_ci	(*(volatile u32 *)(GT64120_BASE+(ofs)))
5588c2ecf20Sopenharmony_ci#define __GT_WRITE(ofs, data)						\
5598c2ecf20Sopenharmony_ci	do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
5608c2ecf20Sopenharmony_ci#define GT_READ(ofs)		le32_to_cpu(__GT_READ(ofs))
5618c2ecf20Sopenharmony_ci#define GT_WRITE(ofs, data)	__GT_WRITE(ofs, cpu_to_le32(data))
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_ciextern void gt641xx_set_base_clock(unsigned int clock);
5648c2ecf20Sopenharmony_ciextern int gt641xx_timer0_state(void);
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ci#endif /* _ASM_GT64120_H */
567