18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Generic definitions for Marvell MV78xx0 SoC flavors:
38c2ecf20Sopenharmony_ci *  MV781x0 and MV782x0.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
68c2ecf20Sopenharmony_ci * License version 2.  This program is licensed "as is" without any
78c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_MV78XX0_H
118c2ecf20Sopenharmony_ci#define __ASM_ARCH_MV78XX0_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include "irqs.h"
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/*
168c2ecf20Sopenharmony_ci * Marvell MV78xx0 address maps.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * phys
198c2ecf20Sopenharmony_ci * c0000000	PCIe Memory space
208c2ecf20Sopenharmony_ci * f0800000	PCIe #0 I/O space
218c2ecf20Sopenharmony_ci * f0900000	PCIe #1 I/O space
228c2ecf20Sopenharmony_ci * f0a00000	PCIe #2 I/O space
238c2ecf20Sopenharmony_ci * f0b00000	PCIe #3 I/O space
248c2ecf20Sopenharmony_ci * f0c00000	PCIe #4 I/O space
258c2ecf20Sopenharmony_ci * f0d00000	PCIe #5 I/O space
268c2ecf20Sopenharmony_ci * f0e00000	PCIe #6 I/O space
278c2ecf20Sopenharmony_ci * f0f00000	PCIe #7 I/O space
288c2ecf20Sopenharmony_ci * f1000000	on-chip peripheral registers
298c2ecf20Sopenharmony_ci *
308c2ecf20Sopenharmony_ci * virt		phys		size
318c2ecf20Sopenharmony_ci * fe400000	f102x000	16K	core-specific peripheral registers
328c2ecf20Sopenharmony_ci * fee00000	f0800000	64K	PCIe #0 I/O space
338c2ecf20Sopenharmony_ci * fee10000	f0900000	64K	PCIe #1 I/O space
348c2ecf20Sopenharmony_ci * fee20000	f0a00000	64K	PCIe #2 I/O space
358c2ecf20Sopenharmony_ci * fee30000	f0b00000	64K	PCIe #3 I/O space
368c2ecf20Sopenharmony_ci * fee40000	f0c00000	64K	PCIe #4 I/O space
378c2ecf20Sopenharmony_ci * fee50000	f0d00000	64K	PCIe #5 I/O space
388c2ecf20Sopenharmony_ci * fee60000	f0e00000	64K	PCIe #6 I/O space
398c2ecf20Sopenharmony_ci * fee70000	f0f00000	64K	PCIe #7 I/O space
408c2ecf20Sopenharmony_ci * fec00000	f1000000	1M	on-chip peripheral registers
418c2ecf20Sopenharmony_ci */
428c2ecf20Sopenharmony_ci#define MV78XX0_CORE0_REGS_PHYS_BASE	0xf1020000
438c2ecf20Sopenharmony_ci#define MV78XX0_CORE1_REGS_PHYS_BASE	0xf1024000
448c2ecf20Sopenharmony_ci#define MV78XX0_CORE_REGS_VIRT_BASE	IOMEM(0xfe400000)
458c2ecf20Sopenharmony_ci#define MV78XX0_CORE_REGS_PHYS_BASE	0xfe400000
468c2ecf20Sopenharmony_ci#define MV78XX0_CORE_REGS_SIZE		SZ_16K
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define MV78XX0_PCIE_IO_PHYS_BASE(i)	(0xf0800000 + ((i) << 20))
498c2ecf20Sopenharmony_ci#define MV78XX0_PCIE_IO_SIZE		SZ_1M
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define MV78XX0_REGS_PHYS_BASE		0xf1000000
528c2ecf20Sopenharmony_ci#define MV78XX0_REGS_VIRT_BASE		IOMEM(0xfec00000)
538c2ecf20Sopenharmony_ci#define MV78XX0_REGS_SIZE		SZ_1M
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci#define MV78XX0_PCIE_MEM_PHYS_BASE	0xc0000000
568c2ecf20Sopenharmony_ci#define MV78XX0_PCIE_MEM_SIZE		0x30000000
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/*
598c2ecf20Sopenharmony_ci * Core-specific peripheral registers.
608c2ecf20Sopenharmony_ci */
618c2ecf20Sopenharmony_ci#define BRIDGE_VIRT_BASE	(MV78XX0_CORE_REGS_VIRT_BASE)
628c2ecf20Sopenharmony_ci#define BRIDGE_PHYS_BASE	(MV78XX0_CORE_REGS_PHYS_BASE)
638c2ecf20Sopenharmony_ci#define  BRIDGE_WINS_CPU0_BASE  (MV78XX0_CORE0_REGS_PHYS_BASE)
648c2ecf20Sopenharmony_ci#define  BRIDGE_WINS_CPU1_BASE  (MV78XX0_CORE1_REGS_PHYS_BASE)
658c2ecf20Sopenharmony_ci#define  BRIDGE_WINS_SZ         (0xA000)
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/*
688c2ecf20Sopenharmony_ci * Register Map
698c2ecf20Sopenharmony_ci */
708c2ecf20Sopenharmony_ci#define DDR_VIRT_BASE		(MV78XX0_REGS_VIRT_BASE + 0x00000)
718c2ecf20Sopenharmony_ci#define DDR_PHYS_BASE           (MV78XX0_REGS_PHYS_BASE + 0x00000)
728c2ecf20Sopenharmony_ci#define  DDR_WINDOW_CPU0_BASE	(DDR_PHYS_BASE + 0x1500)
738c2ecf20Sopenharmony_ci#define  DDR_WINDOW_CPU1_BASE	(DDR_PHYS_BASE + 0x1570)
748c2ecf20Sopenharmony_ci#define  DDR_WINDOW_CPU_SZ      (0x20)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define DEV_BUS_PHYS_BASE	(MV78XX0_REGS_PHYS_BASE + 0x10000)
778c2ecf20Sopenharmony_ci#define DEV_BUS_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x10000)
788c2ecf20Sopenharmony_ci#define  SAMPLE_AT_RESET_LOW	(DEV_BUS_VIRT_BASE + 0x0030)
798c2ecf20Sopenharmony_ci#define  SAMPLE_AT_RESET_HIGH	(DEV_BUS_VIRT_BASE + 0x0034)
808c2ecf20Sopenharmony_ci#define  GPIO_VIRT_BASE		(DEV_BUS_VIRT_BASE + 0x0100)
818c2ecf20Sopenharmony_ci#define  I2C_0_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x1000)
828c2ecf20Sopenharmony_ci#define  I2C_1_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x1100)
838c2ecf20Sopenharmony_ci#define  UART0_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x2000)
848c2ecf20Sopenharmony_ci#define  UART0_VIRT_BASE	(DEV_BUS_VIRT_BASE + 0x2000)
858c2ecf20Sopenharmony_ci#define  UART1_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x2100)
868c2ecf20Sopenharmony_ci#define  UART1_VIRT_BASE	(DEV_BUS_VIRT_BASE + 0x2100)
878c2ecf20Sopenharmony_ci#define  UART2_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x2200)
888c2ecf20Sopenharmony_ci#define  UART2_VIRT_BASE	(DEV_BUS_VIRT_BASE + 0x2200)
898c2ecf20Sopenharmony_ci#define  UART3_PHYS_BASE	(DEV_BUS_PHYS_BASE + 0x2300)
908c2ecf20Sopenharmony_ci#define  UART3_VIRT_BASE	(DEV_BUS_VIRT_BASE + 0x2300)
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define GE10_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x30000)
938c2ecf20Sopenharmony_ci#define GE11_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x34000)
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define PCIE00_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x40000)
968c2ecf20Sopenharmony_ci#define PCIE01_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x44000)
978c2ecf20Sopenharmony_ci#define PCIE02_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x48000)
988c2ecf20Sopenharmony_ci#define PCIE03_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x4c000)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define USB0_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x50000)
1018c2ecf20Sopenharmony_ci#define USB1_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x51000)
1028c2ecf20Sopenharmony_ci#define USB2_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x52000)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define GE00_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x70000)
1058c2ecf20Sopenharmony_ci#define GE01_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0x74000)
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define PCIE10_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x80000)
1088c2ecf20Sopenharmony_ci#define PCIE11_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x84000)
1098c2ecf20Sopenharmony_ci#define PCIE12_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x88000)
1108c2ecf20Sopenharmony_ci#define PCIE13_VIRT_BASE	(MV78XX0_REGS_VIRT_BASE + 0x8c000)
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define SATA_PHYS_BASE		(MV78XX0_REGS_PHYS_BASE + 0xa0000)
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/*
1158c2ecf20Sopenharmony_ci * Supported devices and revisions.
1168c2ecf20Sopenharmony_ci */
1178c2ecf20Sopenharmony_ci#define MV78X00_Z0_DEV_ID	0x6381
1188c2ecf20Sopenharmony_ci#define MV78X00_REV_Z0		1
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#define MV78100_DEV_ID		0x7810
1218c2ecf20Sopenharmony_ci#define MV78100_REV_A0		1
1228c2ecf20Sopenharmony_ci#define MV78100_REV_A1		2
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#define MV78200_DEV_ID		0x7820
1258c2ecf20Sopenharmony_ci#define MV78200_REV_A0		1
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#endif
128