1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020 MediaTek Inc.
5 * Author: Weijie Gao <weijie.gao@mediatek.com>
11 #define SYSCTL_BASE 0x10000000
12 #define SYSCTL_SIZE 0x100
13 #define MEMCTL_BASE 0x10000300
14 #define MEMCTL_SIZE 0x100
15 #define RBUSCTL_BASE 0x10000400
16 #define RBUSCTL_SIZE 0x100
17 #define RGCTL_BASE 0x10001000
18 #define RGCTL_SIZE 0x800
20 #define SYSCTL_EFUSE_CFG_REG 0x08
21 #define EFUSE_MT7688 0x100000
23 #define SYSCTL_CHIP_REV_ID_REG 0x0c
24 #define PKG_ID 0x10000
32 #define SYSCTL_SYSCFG0_REG 0x10
33 #define XTAL_FREQ_SEL 0x40
37 #define CHIP_MODE_M 0x0e
38 #define DRAM_TYPE 0x01
42 #define SYSCTL_ROM_STATUS_REG 0x28
44 #define SYSCTL_CLKCFG0_REG 0x2c
45 #define DIS_BBP_SLEEP 0x08
46 #define EN_BBP_CLK 0x04
47 #define CPU_PLL_FROM_BBP 0x02
48 #define CPU_PLL_FROM_XTAL 0x01
50 #define SYSCTL_RSTCTL_REG 0x34
53 #define SYSCTL_AGPIO_CFG_REG 0x3c
54 #define EPHY_GPIO_AIO_EN_S 17
55 #define EPHY_GPIO_AIO_EN_M 0x1e0000
57 #define SYSCTL_GPIO_MODE1_REG 0x60
58 #define UART2_MODE_S 26
59 #define UART2_MODE_M 0xc000000
60 #define UART1_MODE_S 24
61 #define UART1_MODE_M 0x3000000
62 #define UART0_MODE_S 8
63 #define UART0_MODE_M 0x300
65 #define SPIS_MODE_M 0x0c
67 #define RBUSCTL_DYN_CFG0_REG 0x40
69 #define CPU_FDIV_M 0xf00
71 #define CPU_FFRAC_M 0x0f
73 #define RGCTL_PMU_G0_REG 0x100
74 #define PMU_CFG_EN 0x80000000
76 #define RGCTL_PMU_G1_REG 0x104
77 #define RG_BUCK_FPWM 0x02
79 #define RGCTL_PMU_G3_REG 0x10c
80 #define NI_DDRLDO_STB 0x40000
81 #define NI_DDRLDO_EN 0x10000
82 #define RG_DDRLDO_VOSEL 0x40
84 #define RGCTL_DDR_PAD_CK_G0_REG 0x700
85 #define RGCTL_DDR_PAD_CMD_G0_REG 0x708
86 #define RGCTL_DDR_PAD_DQ_G0_REG 0x710
87 #define RGCTL_DDR_PAD_DQS_G0_REG 0x718
91 #define RGCTL_DDR_PAD_CK_G1_REG 0x704
92 #define RGCTL_DDR_PAD_CMD_G1_REG 0x70c
93 #define RGCTL_DDR_PAD_DQ_G1_REG 0x714
94 #define RGCTL_DDR_PAD_DQS_G1_REG 0x71c
101 void mt7628_ddr_init(void);
104 #endif /* _MT7628_H_ */