162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Generic definitions of Orion SoC flavors:
462306a36Sopenharmony_ci *  Orion-1, Orion-VoIP, Orion-NAS, Orion-2, and Orion-1-90.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __ASM_ARCH_ORION5X_H
1062306a36Sopenharmony_ci#define __ASM_ARCH_ORION5X_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include "irqs.h"
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/*****************************************************************************
1562306a36Sopenharmony_ci * Orion Address Maps
1662306a36Sopenharmony_ci *
1762306a36Sopenharmony_ci * phys
1862306a36Sopenharmony_ci * e0000000	PCIe MEM space
1962306a36Sopenharmony_ci * e8000000	PCI MEM space
2062306a36Sopenharmony_ci * f0000000	PCIe WA space (Orion-1/Orion-NAS only)
2162306a36Sopenharmony_ci * f1000000	on-chip peripheral registers
2262306a36Sopenharmony_ci * f2000000	PCIe I/O space
2362306a36Sopenharmony_ci * f2100000	PCI I/O space
2462306a36Sopenharmony_ci * f2200000	SRAM dedicated for the crypto unit
2562306a36Sopenharmony_ci * f4000000	device bus mappings (boot)
2662306a36Sopenharmony_ci * fa000000	device bus mappings (cs0)
2762306a36Sopenharmony_ci * fa800000	device bus mappings (cs2)
2862306a36Sopenharmony_ci * fc000000	device bus mappings (cs0/cs1)
2962306a36Sopenharmony_ci *
3062306a36Sopenharmony_ci * virt		phys		size
3162306a36Sopenharmony_ci * fec00000	f1000000	1M	on-chip peripheral registers
3262306a36Sopenharmony_ci * fee00000	f2000000	64K	PCIe I/O space
3362306a36Sopenharmony_ci * fee10000	f2100000	64K	PCI I/O space
3462306a36Sopenharmony_ci * fd000000	f0000000	16M	PCIe WA space (Orion-1/Orion-NAS only)
3562306a36Sopenharmony_ci ****************************************************************************/
3662306a36Sopenharmony_ci#define ORION5X_REGS_PHYS_BASE		0xf1000000
3762306a36Sopenharmony_ci#define ORION5X_REGS_VIRT_BASE		IOMEM(0xfec00000)
3862306a36Sopenharmony_ci#define ORION5X_REGS_SIZE		SZ_1M
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci#define ORION5X_PCIE_IO_PHYS_BASE	0xf2000000
4162306a36Sopenharmony_ci#define ORION5X_PCIE_IO_BUS_BASE	0x00000000
4262306a36Sopenharmony_ci#define ORION5X_PCIE_IO_SIZE		SZ_64K
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define ORION5X_PCI_IO_PHYS_BASE	0xf2100000
4562306a36Sopenharmony_ci#define ORION5X_PCI_IO_BUS_BASE		0x00010000
4662306a36Sopenharmony_ci#define ORION5X_PCI_IO_SIZE		SZ_64K
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci#define ORION5X_SRAM_PHYS_BASE		(0xf2200000)
4962306a36Sopenharmony_ci#define ORION5X_SRAM_SIZE		SZ_8K
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci/* Relevant only for Orion-1/Orion-NAS */
5262306a36Sopenharmony_ci#define ORION5X_PCIE_WA_PHYS_BASE	0xf0000000
5362306a36Sopenharmony_ci#define ORION5X_PCIE_WA_VIRT_BASE	IOMEM(0xfd000000)
5462306a36Sopenharmony_ci#define ORION5X_PCIE_WA_SIZE		SZ_16M
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define ORION5X_PCIE_MEM_PHYS_BASE	0xe0000000
5762306a36Sopenharmony_ci#define ORION5X_PCIE_MEM_SIZE		SZ_128M
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define ORION5X_PCI_MEM_PHYS_BASE	0xe8000000
6062306a36Sopenharmony_ci#define ORION5X_PCI_MEM_SIZE		SZ_128M
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/*******************************************************************************
6362306a36Sopenharmony_ci * Orion Registers Map
6462306a36Sopenharmony_ci ******************************************************************************/
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define ORION5X_DDR_PHYS_BASE           (ORION5X_REGS_PHYS_BASE + 0x00000)
6762306a36Sopenharmony_ci#define  ORION5X_DDR_WINS_BASE          (ORION5X_DDR_PHYS_BASE + 0x1500)
6862306a36Sopenharmony_ci#define  ORION5X_DDR_WINS_SZ            (0x10)
6962306a36Sopenharmony_ci#define ORION5X_DDR_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x00000)
7062306a36Sopenharmony_ci#define ORION5X_DEV_BUS_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x10000)
7162306a36Sopenharmony_ci#define ORION5X_DEV_BUS_VIRT_BASE	(ORION5X_REGS_VIRT_BASE + 0x10000)
7262306a36Sopenharmony_ci#define ORION5X_DEV_BUS_REG(x)		(ORION5X_DEV_BUS_VIRT_BASE + (x))
7362306a36Sopenharmony_ci#define  GPIO_VIRT_BASE			ORION5X_DEV_BUS_REG(0x0100)
7462306a36Sopenharmony_ci#define  SPI_PHYS_BASE			(ORION5X_DEV_BUS_PHYS_BASE + 0x0600)
7562306a36Sopenharmony_ci#define  I2C_PHYS_BASE			(ORION5X_DEV_BUS_PHYS_BASE + 0x1000)
7662306a36Sopenharmony_ci#define  UART0_PHYS_BASE		(ORION5X_DEV_BUS_PHYS_BASE + 0x2000)
7762306a36Sopenharmony_ci#define  UART0_VIRT_BASE		(ORION5X_DEV_BUS_VIRT_BASE + 0x2000)
7862306a36Sopenharmony_ci#define  UART1_PHYS_BASE		(ORION5X_DEV_BUS_PHYS_BASE + 0x2100)
7962306a36Sopenharmony_ci#define  UART1_VIRT_BASE		(ORION5X_DEV_BUS_VIRT_BASE + 0x2100)
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#define ORION5X_BRIDGE_VIRT_BASE	(ORION5X_REGS_VIRT_BASE + 0x20000)
8262306a36Sopenharmony_ci#define ORION5X_BRIDGE_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x20000)
8362306a36Sopenharmony_ci#define  ORION5X_BRIDGE_WINS_BASE       (ORION5X_BRIDGE_PHYS_BASE)
8462306a36Sopenharmony_ci#define  ORION5X_BRIDGE_WINS_SZ         (0x80)
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define ORION5X_PCI_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x30000)
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define ORION5X_PCIE_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x40000)
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#define ORION5X_USB0_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x50000)
9162306a36Sopenharmony_ci#define ORION5X_USB0_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x50000)
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define ORION5X_XOR_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x60900)
9462306a36Sopenharmony_ci#define ORION5X_XOR_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x60900)
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define ORION5X_ETH_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x70000)
9762306a36Sopenharmony_ci#define ORION5X_ETH_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x70000)
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci#define ORION5X_SATA_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0x80000)
10062306a36Sopenharmony_ci#define ORION5X_SATA_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0x80000)
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci#define ORION5X_CRYPTO_PHYS_BASE	(ORION5X_REGS_PHYS_BASE + 0x90000)
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define ORION5X_USB1_PHYS_BASE		(ORION5X_REGS_PHYS_BASE + 0xa0000)
10562306a36Sopenharmony_ci#define ORION5X_USB1_VIRT_BASE		(ORION5X_REGS_VIRT_BASE + 0xa0000)
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci/*******************************************************************************
10862306a36Sopenharmony_ci * Device Bus Registers
10962306a36Sopenharmony_ci ******************************************************************************/
11062306a36Sopenharmony_ci#define MPP_0_7_CTRL		ORION5X_DEV_BUS_REG(0x000)
11162306a36Sopenharmony_ci#define MPP_8_15_CTRL		ORION5X_DEV_BUS_REG(0x004)
11262306a36Sopenharmony_ci#define MPP_16_19_CTRL		ORION5X_DEV_BUS_REG(0x050)
11362306a36Sopenharmony_ci#define MPP_DEV_CTRL		ORION5X_DEV_BUS_REG(0x008)
11462306a36Sopenharmony_ci#define MPP_RESET_SAMPLE	ORION5X_DEV_BUS_REG(0x010)
11562306a36Sopenharmony_ci#define DEV_BANK_0_PARAM	ORION5X_DEV_BUS_REG(0x45c)
11662306a36Sopenharmony_ci#define DEV_BANK_1_PARAM	ORION5X_DEV_BUS_REG(0x460)
11762306a36Sopenharmony_ci#define DEV_BANK_2_PARAM	ORION5X_DEV_BUS_REG(0x464)
11862306a36Sopenharmony_ci#define DEV_BANK_BOOT_PARAM	ORION5X_DEV_BUS_REG(0x46c)
11962306a36Sopenharmony_ci#define DEV_BUS_CTRL		ORION5X_DEV_BUS_REG(0x4c0)
12062306a36Sopenharmony_ci#define DEV_BUS_INT_CAUSE	ORION5X_DEV_BUS_REG(0x4d0)
12162306a36Sopenharmony_ci#define DEV_BUS_INT_MASK	ORION5X_DEV_BUS_REG(0x4d4)
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci/*******************************************************************************
12462306a36Sopenharmony_ci * Supported Devices & Revisions
12562306a36Sopenharmony_ci ******************************************************************************/
12662306a36Sopenharmony_ci/* Orion-1 (88F5181) and Orion-VoIP (88F5181L) */
12762306a36Sopenharmony_ci#define MV88F5181_DEV_ID	0x5181
12862306a36Sopenharmony_ci#define MV88F5181_REV_B1	3
12962306a36Sopenharmony_ci#define MV88F5181L_REV_A0	8
13062306a36Sopenharmony_ci#define MV88F5181L_REV_A1	9
13162306a36Sopenharmony_ci/* Orion-NAS (88F5182) */
13262306a36Sopenharmony_ci#define MV88F5182_DEV_ID	0x5182
13362306a36Sopenharmony_ci#define MV88F5182_REV_A2	2
13462306a36Sopenharmony_ci/* Orion-2 (88F5281) */
13562306a36Sopenharmony_ci#define MV88F5281_DEV_ID	0x5281
13662306a36Sopenharmony_ci#define MV88F5281_REV_D0	4
13762306a36Sopenharmony_ci#define MV88F5281_REV_D1	5
13862306a36Sopenharmony_ci#define MV88F5281_REV_D2	6
13962306a36Sopenharmony_ci/* Orion-1-90 (88F6183) */
14062306a36Sopenharmony_ci#define MV88F6183_DEV_ID	0x6183
14162306a36Sopenharmony_ci#define MV88F6183_REV_B0	3
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci#endif
144