18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Generic definitions of Orion SoC flavors:
38c2ecf20Sopenharmony_ci *  Orion-1, Orion-VoIP, Orion-NAS, Orion-2, and Orion-1-90.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
88c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any
98c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_ORION5X_H
138c2ecf20Sopenharmony_ci#define __ASM_ARCH_ORION5X_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include "irqs.h"
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*****************************************************************************
188c2ecf20Sopenharmony_ci * Orion Address Maps
198c2ecf20Sopenharmony_ci *
208c2ecf20Sopenharmony_ci * phys
218c2ecf20Sopenharmony_ci * e0000000	PCIe MEM space
228c2ecf20Sopenharmony_ci * e8000000	PCI MEM space
238c2ecf20Sopenharmony_ci * f0000000	PCIe WA space (Orion-1/Orion-NAS only)
248c2ecf20Sopenharmony_ci * f1000000	on-chip peripheral registers
258c2ecf20Sopenharmony_ci * f2000000	PCIe I/O space
268c2ecf20Sopenharmony_ci * f2100000	PCI I/O space
278c2ecf20Sopenharmony_ci * f2200000	SRAM dedicated for the crypto unit
288c2ecf20Sopenharmony_ci * f4000000	device bus mappings (boot)
298c2ecf20Sopenharmony_ci * fa000000	device bus mappings (cs0)
308c2ecf20Sopenharmony_ci * fa800000	device bus mappings (cs2)
318c2ecf20Sopenharmony_ci * fc000000	device bus mappings (cs0/cs1)
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci * virt		phys		size
348c2ecf20Sopenharmony_ci * fec00000	f1000000	1M	on-chip peripheral registers
358c2ecf20Sopenharmony_ci * fee00000	f2000000	64K	PCIe I/O space
368c2ecf20Sopenharmony_ci * fee10000	f2100000	64K	PCI I/O space
378c2ecf20Sopenharmony_ci * fd000000	f0000000	16M	PCIe WA space (Orion-1/Orion-NAS only)
388c2ecf20Sopenharmony_ci ****************************************************************************/
398c2ecf20Sopenharmony_ci#define ORION5X_REGS_PHYS_BASE		0xf1000000
408c2ecf20Sopenharmony_ci#define ORION5X_REGS_VIRT_BASE		IOMEM(0xfec00000)
418c2ecf20Sopenharmony_ci#define ORION5X_REGS_SIZE		SZ_1M
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define ORION5X_PCIE_IO_PHYS_BASE	0xf2000000
448c2ecf20Sopenharmony_ci#define ORION5X_PCIE_IO_BUS_BASE	0x00000000
458c2ecf20Sopenharmony_ci#define ORION5X_PCIE_IO_SIZE		SZ_64K
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define ORION5X_PCI_IO_PHYS_BASE	0xf2100000
488c2ecf20Sopenharmony_ci#define ORION5X_PCI_IO_BUS_BASE		0x00010000
498c2ecf20Sopenharmony_ci#define ORION5X_PCI_IO_SIZE		SZ_64K
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define ORION5X_SRAM_PHYS_BASE		(0xf2200000)
528c2ecf20Sopenharmony_ci#define ORION5X_SRAM_SIZE		SZ_8K
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* Relevant only for Orion-1/Orion-NAS */
558c2ecf20Sopenharmony_ci#define ORION5X_PCIE_WA_PHYS_BASE	0xf0000000
568c2ecf20Sopenharmony_ci#define ORION5X_PCIE_WA_VIRT_BASE	IOMEM(0xfd000000)
578c2ecf20Sopenharmony_ci#define ORION5X_PCIE_WA_SIZE		SZ_16M
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci#define ORION5X_PCIE_MEM_PHYS_BASE	0xe0000000
608c2ecf20Sopenharmony_ci#define ORION5X_PCIE_MEM_SIZE		SZ_128M
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define ORION5X_PCI_MEM_PHYS_BASE	0xe8000000
638c2ecf20Sopenharmony_ci#define ORION5X_PCI_MEM_SIZE		SZ_128M
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/*******************************************************************************
668c2ecf20Sopenharmony_ci * Orion Registers Map
678c2ecf20Sopenharmony_ci ******************************************************************************/
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define ORION5X_DDR_PHYS_BASE           (ORION5X_REGS_PHYS_BASE + 0x00000)
708c2ecf20Sopenharmony_ci#define  ORION5X_DDR_WINS_BASE          (ORION5X_DDR_PHYS_BASE + 0x1500)
718c2ecf20Sopenharmony_ci#define  ORION5X_DDR_WINS_SZ            (0x10)
728c2ecf20Sopenharmony_ci#define ORION5X_DDR_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x00000)
738c2ecf20Sopenharmony_ci#define ORION5X_DEV_BUS_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x10000)
748c2ecf20Sopenharmony_ci#define ORION5X_DEV_BUS_VIRT_BASE	(ORION5X_REGS_VIRT_BASE + 0x10000)
758c2ecf20Sopenharmony_ci#define ORION5X_DEV_BUS_REG(x)		(ORION5X_DEV_BUS_VIRT_BASE + (x))
768c2ecf20Sopenharmony_ci#define  GPIO_VIRT_BASE			ORION5X_DEV_BUS_REG(0x0100)
778c2ecf20Sopenharmony_ci#define  SPI_PHYS_BASE			(ORION5X_DEV_BUS_PHYS_BASE + 0x0600)
788c2ecf20Sopenharmony_ci#define  I2C_PHYS_BASE			(ORION5X_DEV_BUS_PHYS_BASE + 0x1000)
798c2ecf20Sopenharmony_ci#define  UART0_PHYS_BASE		(ORION5X_DEV_BUS_PHYS_BASE + 0x2000)
808c2ecf20Sopenharmony_ci#define  UART0_VIRT_BASE		(ORION5X_DEV_BUS_VIRT_BASE + 0x2000)
818c2ecf20Sopenharmony_ci#define  UART1_PHYS_BASE		(ORION5X_DEV_BUS_PHYS_BASE + 0x2100)
828c2ecf20Sopenharmony_ci#define  UART1_VIRT_BASE		(ORION5X_DEV_BUS_VIRT_BASE + 0x2100)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define ORION5X_BRIDGE_VIRT_BASE	(ORION5X_REGS_VIRT_BASE + 0x20000)
858c2ecf20Sopenharmony_ci#define ORION5X_BRIDGE_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x20000)
868c2ecf20Sopenharmony_ci#define  ORION5X_BRIDGE_WINS_BASE       (ORION5X_BRIDGE_PHYS_BASE)
878c2ecf20Sopenharmony_ci#define  ORION5X_BRIDGE_WINS_SZ         (0x80)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define ORION5X_PCI_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x30000)
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define ORION5X_PCIE_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x40000)
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define ORION5X_USB0_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x50000)
948c2ecf20Sopenharmony_ci#define ORION5X_USB0_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x50000)
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define ORION5X_XOR_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x60900)
978c2ecf20Sopenharmony_ci#define ORION5X_XOR_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x60900)
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#define ORION5X_ETH_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x70000)
1008c2ecf20Sopenharmony_ci#define ORION5X_ETH_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x70000)
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define ORION5X_SATA_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x80000)
1038c2ecf20Sopenharmony_ci#define ORION5X_SATA_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x80000)
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define ORION5X_CRYPTO_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x90000)
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define ORION5X_USB1_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0xa0000)
1088c2ecf20Sopenharmony_ci#define ORION5X_USB1_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0xa0000)
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/*******************************************************************************
1118c2ecf20Sopenharmony_ci * Device Bus Registers
1128c2ecf20Sopenharmony_ci ******************************************************************************/
1138c2ecf20Sopenharmony_ci#define MPP_0_7_CTRL		ORION5X_DEV_BUS_REG(0x000)
1148c2ecf20Sopenharmony_ci#define MPP_8_15_CTRL		ORION5X_DEV_BUS_REG(0x004)
1158c2ecf20Sopenharmony_ci#define MPP_16_19_CTRL		ORION5X_DEV_BUS_REG(0x050)
1168c2ecf20Sopenharmony_ci#define MPP_DEV_CTRL		ORION5X_DEV_BUS_REG(0x008)
1178c2ecf20Sopenharmony_ci#define MPP_RESET_SAMPLE	ORION5X_DEV_BUS_REG(0x010)
1188c2ecf20Sopenharmony_ci#define DEV_BANK_0_PARAM	ORION5X_DEV_BUS_REG(0x45c)
1198c2ecf20Sopenharmony_ci#define DEV_BANK_1_PARAM	ORION5X_DEV_BUS_REG(0x460)
1208c2ecf20Sopenharmony_ci#define DEV_BANK_2_PARAM	ORION5X_DEV_BUS_REG(0x464)
1218c2ecf20Sopenharmony_ci#define DEV_BANK_BOOT_PARAM	ORION5X_DEV_BUS_REG(0x46c)
1228c2ecf20Sopenharmony_ci#define DEV_BUS_CTRL		ORION5X_DEV_BUS_REG(0x4c0)
1238c2ecf20Sopenharmony_ci#define DEV_BUS_INT_CAUSE	ORION5X_DEV_BUS_REG(0x4d0)
1248c2ecf20Sopenharmony_ci#define DEV_BUS_INT_MASK	ORION5X_DEV_BUS_REG(0x4d4)
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci/*******************************************************************************
1278c2ecf20Sopenharmony_ci * Supported Devices & Revisions
1288c2ecf20Sopenharmony_ci ******************************************************************************/
1298c2ecf20Sopenharmony_ci/* Orion-1 (88F5181) and Orion-VoIP (88F5181L) */
1308c2ecf20Sopenharmony_ci#define MV88F5181_DEV_ID	0x5181
1318c2ecf20Sopenharmony_ci#define MV88F5181_REV_B1	3
1328c2ecf20Sopenharmony_ci#define MV88F5181L_REV_A0	8
1338c2ecf20Sopenharmony_ci#define MV88F5181L_REV_A1	9
1348c2ecf20Sopenharmony_ci/* Orion-NAS (88F5182) */
1358c2ecf20Sopenharmony_ci#define MV88F5182_DEV_ID	0x5182
1368c2ecf20Sopenharmony_ci#define MV88F5182_REV_A2	2
1378c2ecf20Sopenharmony_ci/* Orion-2 (88F5281) */
1388c2ecf20Sopenharmony_ci#define MV88F5281_DEV_ID	0x5281
1398c2ecf20Sopenharmony_ci#define MV88F5281_REV_D0	4
1408c2ecf20Sopenharmony_ci#define MV88F5281_REV_D1	5
1418c2ecf20Sopenharmony_ci#define MV88F5281_REV_D2	6
1428c2ecf20Sopenharmony_ci/* Orion-1-90 (88F6183) */
1438c2ecf20Sopenharmony_ci#define MV88F6183_DEV_ID	0x6183
1448c2ecf20Sopenharmony_ci#define MV88F6183_REV_B0	3
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#endif
147