18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Parts of this file are based on Ralink's 2.6.21 BSP 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org> 78c2ecf20Sopenharmony_ci * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 88c2ecf20Sopenharmony_ci * Copyright (C) 2013 John Crispin <john@phrozen.org> 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef _RT288X_REGS_H_ 128c2ecf20Sopenharmony_ci#define _RT288X_REGS_H_ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define RT2880_SYSC_BASE 0x00300000 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define SYSC_REG_CHIP_NAME0 0x00 178c2ecf20Sopenharmony_ci#define SYSC_REG_CHIP_NAME1 0x04 188c2ecf20Sopenharmony_ci#define SYSC_REG_CHIP_ID 0x0c 198c2ecf20Sopenharmony_ci#define SYSC_REG_SYSTEM_CONFIG 0x10 208c2ecf20Sopenharmony_ci#define SYSC_REG_CLKCFG 0x30 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#define RT2880_CHIP_NAME0 0x38325452 238c2ecf20Sopenharmony_ci#define RT2880_CHIP_NAME1 0x20203038 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#define CHIP_ID_ID_MASK 0xff 268c2ecf20Sopenharmony_ci#define CHIP_ID_ID_SHIFT 8 278c2ecf20Sopenharmony_ci#define CHIP_ID_REV_MASK 0xff 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_SHIFT 20 308c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_MASK 0x3 318c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_250 0x0 328c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_266 0x1 338c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_280 0x2 348c2ecf20Sopenharmony_ci#define SYSTEM_CONFIG_CPUCLK_300 0x3 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_I2C BIT(0) 378c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_UART0 BIT(1) 388c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_SPI BIT(2) 398c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_UART1 BIT(3) 408c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_JTAG BIT(4) 418c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_MDIO BIT(5) 428c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_SDRAM BIT(6) 438c2ecf20Sopenharmony_ci#define RT2880_GPIO_MODE_PCI BIT(7) 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define CLKCFG_SRAM_CS_N_WDT BIT(9) 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#define RT2880_SDRAM_BASE 0x08000000 488c2ecf20Sopenharmony_ci#define RT2880_MEM_SIZE_MIN 2 498c2ecf20Sopenharmony_ci#define RT2880_MEM_SIZE_MAX 128 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#endif 52