162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Generic definitions for Marvell MV78xx0 SoC flavors: 462306a36Sopenharmony_ci * MV781x0 and MV782x0. 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#ifndef __ASM_ARCH_MV78XX0_H 862306a36Sopenharmony_ci#define __ASM_ARCH_MV78XX0_H 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#include "irqs.h" 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* 1362306a36Sopenharmony_ci * Marvell MV78xx0 address maps. 1462306a36Sopenharmony_ci * 1562306a36Sopenharmony_ci * phys 1662306a36Sopenharmony_ci * c0000000 PCIe Memory space 1762306a36Sopenharmony_ci * f0800000 PCIe #0 I/O space 1862306a36Sopenharmony_ci * f0900000 PCIe #1 I/O space 1962306a36Sopenharmony_ci * f0a00000 PCIe #2 I/O space 2062306a36Sopenharmony_ci * f0b00000 PCIe #3 I/O space 2162306a36Sopenharmony_ci * f0c00000 PCIe #4 I/O space 2262306a36Sopenharmony_ci * f0d00000 PCIe #5 I/O space 2362306a36Sopenharmony_ci * f0e00000 PCIe #6 I/O space 2462306a36Sopenharmony_ci * f0f00000 PCIe #7 I/O space 2562306a36Sopenharmony_ci * f1000000 on-chip peripheral registers 2662306a36Sopenharmony_ci * 2762306a36Sopenharmony_ci * virt phys size 2862306a36Sopenharmony_ci * fe400000 f102x000 16K core-specific peripheral registers 2962306a36Sopenharmony_ci * fee00000 f0800000 64K PCIe #0 I/O space 3062306a36Sopenharmony_ci * fee10000 f0900000 64K PCIe #1 I/O space 3162306a36Sopenharmony_ci * fee20000 f0a00000 64K PCIe #2 I/O space 3262306a36Sopenharmony_ci * fee30000 f0b00000 64K PCIe #3 I/O space 3362306a36Sopenharmony_ci * fee40000 f0c00000 64K PCIe #4 I/O space 3462306a36Sopenharmony_ci * fee50000 f0d00000 64K PCIe #5 I/O space 3562306a36Sopenharmony_ci * fee60000 f0e00000 64K PCIe #6 I/O space 3662306a36Sopenharmony_ci * fee70000 f0f00000 64K PCIe #7 I/O space 3762306a36Sopenharmony_ci * fec00000 f1000000 1M on-chip peripheral registers 3862306a36Sopenharmony_ci */ 3962306a36Sopenharmony_ci#define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 4062306a36Sopenharmony_ci#define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 4162306a36Sopenharmony_ci#define MV78XX0_CORE_REGS_VIRT_BASE IOMEM(0xfe400000) 4262306a36Sopenharmony_ci#define MV78XX0_CORE_REGS_PHYS_BASE 0xfe400000 4362306a36Sopenharmony_ci#define MV78XX0_CORE_REGS_SIZE SZ_16K 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#define MV78XX0_PCIE_IO_PHYS_BASE(i) (0xf0800000 + ((i) << 20)) 4662306a36Sopenharmony_ci#define MV78XX0_PCIE_IO_SIZE SZ_1M 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#define MV78XX0_REGS_PHYS_BASE 0xf1000000 4962306a36Sopenharmony_ci#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfec00000) 5062306a36Sopenharmony_ci#define MV78XX0_REGS_SIZE SZ_1M 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci#define MV78XX0_SRAM_PHYS_BASE (0xf2200000) 5362306a36Sopenharmony_ci#define MV78XX0_SRAM_SIZE SZ_8K 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci#define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 5662306a36Sopenharmony_ci#define MV78XX0_PCIE_MEM_SIZE 0x30000000 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci#define MV78XX0_MBUS_SRAM_TARGET 0x09 5962306a36Sopenharmony_ci#define MV78XX0_MBUS_SRAM_ATTR 0x00 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci/* 6262306a36Sopenharmony_ci * Core-specific peripheral registers. 6362306a36Sopenharmony_ci */ 6462306a36Sopenharmony_ci#define BRIDGE_VIRT_BASE (MV78XX0_CORE_REGS_VIRT_BASE) 6562306a36Sopenharmony_ci#define BRIDGE_PHYS_BASE (MV78XX0_CORE_REGS_PHYS_BASE) 6662306a36Sopenharmony_ci#define BRIDGE_WINS_CPU0_BASE (MV78XX0_CORE0_REGS_PHYS_BASE) 6762306a36Sopenharmony_ci#define BRIDGE_WINS_CPU1_BASE (MV78XX0_CORE1_REGS_PHYS_BASE) 6862306a36Sopenharmony_ci#define BRIDGE_WINS_SZ (0xA000) 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci/* 7162306a36Sopenharmony_ci * Register Map 7262306a36Sopenharmony_ci */ 7362306a36Sopenharmony_ci#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x00000) 7462306a36Sopenharmony_ci#define DDR_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x00000) 7562306a36Sopenharmony_ci#define DDR_WINDOW_CPU0_BASE (DDR_PHYS_BASE + 0x1500) 7662306a36Sopenharmony_ci#define DDR_WINDOW_CPU1_BASE (DDR_PHYS_BASE + 0x1570) 7762306a36Sopenharmony_ci#define DDR_WINDOW_CPU_SZ (0x20) 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x10000) 8062306a36Sopenharmony_ci#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x10000) 8162306a36Sopenharmony_ci#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE + 0x0030) 8262306a36Sopenharmony_ci#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE + 0x0034) 8362306a36Sopenharmony_ci#define GPIO_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0100) 8462306a36Sopenharmony_ci#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1000) 8562306a36Sopenharmony_ci#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1100) 8662306a36Sopenharmony_ci#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2000) 8762306a36Sopenharmony_ci#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2000) 8862306a36Sopenharmony_ci#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2100) 8962306a36Sopenharmony_ci#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2100) 9062306a36Sopenharmony_ci#define UART2_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2200) 9162306a36Sopenharmony_ci#define UART2_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2200) 9262306a36Sopenharmony_ci#define UART3_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2300) 9362306a36Sopenharmony_ci#define UART3_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2300) 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define GE10_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x30000) 9662306a36Sopenharmony_ci#define GE11_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x34000) 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci#define PCIE00_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x40000) 9962306a36Sopenharmony_ci#define PCIE01_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x44000) 10062306a36Sopenharmony_ci#define PCIE02_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x48000) 10162306a36Sopenharmony_ci#define PCIE03_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x4c000) 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#define USB0_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x50000) 10462306a36Sopenharmony_ci#define USB1_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x51000) 10562306a36Sopenharmony_ci#define USB2_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x52000) 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci#define XOR_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x60900) 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci#define GE00_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x70000) 11062306a36Sopenharmony_ci#define GE01_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x74000) 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci#define PCIE10_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x80000) 11362306a36Sopenharmony_ci#define PCIE11_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x84000) 11462306a36Sopenharmony_ci#define PCIE12_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x88000) 11562306a36Sopenharmony_ci#define PCIE13_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x8c000) 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define CRYPTO_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x90000) 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci#define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0xa0000) 12062306a36Sopenharmony_ci 12162306a36Sopenharmony_ci/* 12262306a36Sopenharmony_ci * Supported devices and revisions. 12362306a36Sopenharmony_ci */ 12462306a36Sopenharmony_ci#define MV78X00_Z0_DEV_ID 0x6381 12562306a36Sopenharmony_ci#define MV78X00_REV_Z0 1 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci#define MV78100_DEV_ID 0x7810 12862306a36Sopenharmony_ci#define MV78100_REV_A0 1 12962306a36Sopenharmony_ci#define MV78100_REV_A1 2 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci#define MV78200_DEV_ID 0x7820 13262306a36Sopenharmony_ci#define MV78200_REV_A0 1 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci#endif 135