drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / mips / include / asm / mach-ralink / mt7620.h
blob62f4f072c0031d913469ba9ec8b9205fb6c212c7
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
4 * Parts of this file are based on Ralink's 2.6.21 BSP
6 * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
7 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 * Copyright (C) 2013 John Crispin <john@phrozen.org>
9 */
11 #ifndef _MT7620_REGS_H_
12 #define _MT7620_REGS_H_
14 #define IOMEM(x) ((void __iomem *)(KSEG1ADDR(x)))
15 #define MT7620_SYSC_BASE IOMEM(0x10000000)
17 #define SYSC_REG_CHIP_NAME0 0x00
18 #define SYSC_REG_CHIP_NAME1 0x04
19 #define SYSC_REG_EFUSE_CFG 0x08
20 #define SYSC_REG_CHIP_REV 0x0c
21 #define SYSC_REG_SYSTEM_CONFIG0 0x10
22 #define SYSC_REG_SYSTEM_CONFIG1 0x14
24 #define MT7620_CHIP_NAME0 0x3637544d
25 #define MT7620_CHIP_NAME1 0x20203032
26 #define MT7628_CHIP_NAME1 0x20203832
28 #define CHIP_REV_PKG_MASK 0x1
29 #define CHIP_REV_PKG_SHIFT 16
30 #define CHIP_REV_VER_MASK 0xf
31 #define CHIP_REV_VER_SHIFT 8
32 #define CHIP_REV_ECO_MASK 0xf
34 #define SYSCFG0_DRAM_TYPE_MASK 0x3
35 #define SYSCFG0_DRAM_TYPE_SHIFT 4
36 #define SYSCFG0_DRAM_TYPE_SDRAM 0
37 #define SYSCFG0_DRAM_TYPE_DDR1 1
38 #define SYSCFG0_DRAM_TYPE_DDR2 2
39 #define SYSCFG0_DRAM_TYPE_UNKNOWN 3
41 #define SYSCFG0_DRAM_TYPE_DDR2_MT7628 0
42 #define SYSCFG0_DRAM_TYPE_DDR1_MT7628 1
44 #define MT7620_DRAM_BASE 0x0
45 #define MT7620_SDRAM_SIZE_MIN 2
46 #define MT7620_SDRAM_SIZE_MAX 64
47 #define MT7620_DDR1_SIZE_MIN 32
48 #define MT7620_DDR1_SIZE_MAX 128
49 #define MT7620_DDR2_SIZE_MIN 32
50 #define MT7620_DDR2_SIZE_MAX 256
52 extern enum ralink_soc_type ralink_soc;
54 static inline int is_mt76x8(void)
56 return ralink_soc == MT762X_SOC_MT7628AN ||
57 ralink_soc == MT762X_SOC_MT7688;
60 static inline int mt7620_get_eco(void)
62 return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
65 #endif