18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Generic definitions for Marvell Dove 88AP510 SoC
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
58c2ecf20Sopenharmony_ci * License version 2.  This program is licensed "as is" without any
68c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_DOVE_H
108c2ecf20Sopenharmony_ci#define __ASM_ARCH_DOVE_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include "irqs.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/*
158c2ecf20Sopenharmony_ci * Marvell Dove address maps.
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * phys		virt		size
188c2ecf20Sopenharmony_ci * c8000000	fdb00000	1M	Cryptographic SRAM
198c2ecf20Sopenharmony_ci * e0000000	@runtime	128M	PCIe-0 Memory space
208c2ecf20Sopenharmony_ci * e8000000	@runtime	128M	PCIe-1 Memory space
218c2ecf20Sopenharmony_ci * f1000000	fec00000	1M	on-chip south-bridge registers
228c2ecf20Sopenharmony_ci * f1800000	fe400000	8M	on-chip north-bridge registers
238c2ecf20Sopenharmony_ci * f2000000	fee00000	1M	PCIe-0 I/O space
248c2ecf20Sopenharmony_ci * f2100000	fef00000	1M	PCIe-1 I/O space
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define DOVE_CESA_PHYS_BASE		0xc8000000
288c2ecf20Sopenharmony_ci#define DOVE_CESA_VIRT_BASE		IOMEM(0xfdb00000)
298c2ecf20Sopenharmony_ci#define DOVE_CESA_SIZE			SZ_1M
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define DOVE_PCIE0_MEM_PHYS_BASE	0xe0000000
328c2ecf20Sopenharmony_ci#define DOVE_PCIE0_MEM_SIZE		SZ_128M
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define DOVE_PCIE1_MEM_PHYS_BASE	0xe8000000
358c2ecf20Sopenharmony_ci#define DOVE_PCIE1_MEM_SIZE		SZ_128M
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define DOVE_BOOTROM_PHYS_BASE		0xf8000000
388c2ecf20Sopenharmony_ci#define DOVE_BOOTROM_SIZE		SZ_128M
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define DOVE_SCRATCHPAD_PHYS_BASE	0xf0000000
418c2ecf20Sopenharmony_ci#define DOVE_SCRATCHPAD_VIRT_BASE	IOMEM(0xfdd00000)
428c2ecf20Sopenharmony_ci#define DOVE_SCRATCHPAD_SIZE		SZ_1M
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define DOVE_SB_REGS_PHYS_BASE		0xf1000000
458c2ecf20Sopenharmony_ci#define DOVE_SB_REGS_VIRT_BASE		IOMEM(0xfec00000)
468c2ecf20Sopenharmony_ci#define DOVE_SB_REGS_SIZE		SZ_1M
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define DOVE_NB_REGS_PHYS_BASE		0xf1800000
498c2ecf20Sopenharmony_ci#define DOVE_NB_REGS_VIRT_BASE		IOMEM(0xfe400000)
508c2ecf20Sopenharmony_ci#define DOVE_NB_REGS_SIZE		SZ_8M
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define DOVE_PCIE0_IO_PHYS_BASE		0xf2000000
538c2ecf20Sopenharmony_ci#define DOVE_PCIE0_IO_BUS_BASE		0x00000000
548c2ecf20Sopenharmony_ci#define DOVE_PCIE0_IO_SIZE		SZ_64K
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define DOVE_PCIE1_IO_PHYS_BASE		0xf2100000
578c2ecf20Sopenharmony_ci#define DOVE_PCIE1_IO_BUS_BASE		0x00010000
588c2ecf20Sopenharmony_ci#define DOVE_PCIE1_IO_SIZE		SZ_64K
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/*
618c2ecf20Sopenharmony_ci * Dove Core Registers Map
628c2ecf20Sopenharmony_ci */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* SPI, I2C, UART */
658c2ecf20Sopenharmony_ci#define DOVE_I2C_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x11000)
668c2ecf20Sopenharmony_ci#define DOVE_UART0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x12000)
678c2ecf20Sopenharmony_ci#define DOVE_UART0_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x12000)
688c2ecf20Sopenharmony_ci#define DOVE_UART1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x12100)
698c2ecf20Sopenharmony_ci#define DOVE_UART1_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x12100)
708c2ecf20Sopenharmony_ci#define DOVE_UART2_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x12200)
718c2ecf20Sopenharmony_ci#define DOVE_UART2_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x12200)
728c2ecf20Sopenharmony_ci#define DOVE_UART3_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x12300)
738c2ecf20Sopenharmony_ci#define DOVE_UART3_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x12300)
748c2ecf20Sopenharmony_ci#define DOVE_SPI0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x10600)
758c2ecf20Sopenharmony_ci#define DOVE_SPI1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x14600)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* North-South Bridge */
788c2ecf20Sopenharmony_ci#define BRIDGE_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x20000)
798c2ecf20Sopenharmony_ci#define BRIDGE_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x20000)
808c2ecf20Sopenharmony_ci#define  BRIDGE_WINS_BASE       (BRIDGE_PHYS_BASE)
818c2ecf20Sopenharmony_ci#define  BRIDGE_WINS_SZ         (0x80)
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/* Cryptographic Engine */
848c2ecf20Sopenharmony_ci#define DOVE_CRYPT_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x30000)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/* PCIe 0 */
878c2ecf20Sopenharmony_ci#define DOVE_PCIE0_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x40000)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/* USB */
908c2ecf20Sopenharmony_ci#define DOVE_USB0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x50000)
918c2ecf20Sopenharmony_ci#define DOVE_USB1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x51000)
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci/* XOR 0 Engine */
948c2ecf20Sopenharmony_ci#define DOVE_XOR0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x60800)
958c2ecf20Sopenharmony_ci#define DOVE_XOR0_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x60800)
968c2ecf20Sopenharmony_ci#define DOVE_XOR0_HIGH_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x60A00)
978c2ecf20Sopenharmony_ci#define DOVE_XOR0_HIGH_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x60A00)
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci/* XOR 1 Engine */
1008c2ecf20Sopenharmony_ci#define DOVE_XOR1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x60900)
1018c2ecf20Sopenharmony_ci#define DOVE_XOR1_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x60900)
1028c2ecf20Sopenharmony_ci#define DOVE_XOR1_HIGH_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x60B00)
1038c2ecf20Sopenharmony_ci#define DOVE_XOR1_HIGH_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x60B00)
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci/* Gigabit Ethernet */
1068c2ecf20Sopenharmony_ci#define DOVE_GE00_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x70000)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* PCIe 1 */
1098c2ecf20Sopenharmony_ci#define DOVE_PCIE1_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0x80000)
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/* CAFE */
1128c2ecf20Sopenharmony_ci#define DOVE_SDIO0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x92000)
1138c2ecf20Sopenharmony_ci#define DOVE_SDIO1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x90000)
1148c2ecf20Sopenharmony_ci#define DOVE_CAM_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x94000)
1158c2ecf20Sopenharmony_ci#define DOVE_CAFE_WIN_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0x98000)
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci/* SATA */
1188c2ecf20Sopenharmony_ci#define DOVE_SATA_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xa0000)
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci/* I2S/SPDIF */
1218c2ecf20Sopenharmony_ci#define DOVE_AUD0_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xb0000)
1228c2ecf20Sopenharmony_ci#define DOVE_AUD1_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xb4000)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* NAND Flash Controller */
1258c2ecf20Sopenharmony_ci#define DOVE_NFC_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xc0000)
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci/* MPP, GPIO, Reset Sampling */
1288c2ecf20Sopenharmony_ci#define DOVE_MPP_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0200)
1298c2ecf20Sopenharmony_ci#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
1308c2ecf20Sopenharmony_ci#define DOVE_RESET_SAMPLE_LO	(DOVE_MPP_VIRT_BASE + 0x014)
1318c2ecf20Sopenharmony_ci#define DOVE_RESET_SAMPLE_HI	(DOVE_MPP_VIRT_BASE + 0x018)
1328c2ecf20Sopenharmony_ci#define DOVE_GPIO_LO_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0400)
1338c2ecf20Sopenharmony_ci#define DOVE_GPIO_HI_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0420)
1348c2ecf20Sopenharmony_ci#define DOVE_GPIO2_VIRT_BASE    (DOVE_SB_REGS_VIRT_BASE + 0xe8400)
1358c2ecf20Sopenharmony_ci#define DOVE_MPP_GENERAL_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xe803c)
1368c2ecf20Sopenharmony_ci#define  DOVE_AU1_SPDIFO_GPIO_EN	(1 << 1)
1378c2ecf20Sopenharmony_ci#define  DOVE_NAND_GPIO_EN		(1 << 0)
1388c2ecf20Sopenharmony_ci#define DOVE_MPP_CTRL4_VIRT_BASE	(DOVE_GPIO_LO_VIRT_BASE + 0x40)
1398c2ecf20Sopenharmony_ci#define  DOVE_SPI_GPIO_SEL		(1 << 5)
1408c2ecf20Sopenharmony_ci#define  DOVE_UART1_GPIO_SEL		(1 << 4)
1418c2ecf20Sopenharmony_ci#define  DOVE_AU1_GPIO_SEL		(1 << 3)
1428c2ecf20Sopenharmony_ci#define  DOVE_CAM_GPIO_SEL		(1 << 2)
1438c2ecf20Sopenharmony_ci#define  DOVE_SD1_GPIO_SEL		(1 << 1)
1448c2ecf20Sopenharmony_ci#define  DOVE_SD0_GPIO_SEL		(1 << 0)
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* Power Management */
1478c2ecf20Sopenharmony_ci#define DOVE_PMU_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0000)
1488c2ecf20Sopenharmony_ci#define DOVE_PMU_SIG_CTRL	(DOVE_PMU_VIRT_BASE + 0x802c)
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci/* Real Time Clock */
1518c2ecf20Sopenharmony_ci#define DOVE_RTC_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xd8500)
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/* AC97 */
1548c2ecf20Sopenharmony_ci#define DOVE_AC97_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xe0000)
1558c2ecf20Sopenharmony_ci#define DOVE_AC97_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xe0000)
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/* Peripheral DMA */
1588c2ecf20Sopenharmony_ci#define DOVE_PDMA_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xe4000)
1598c2ecf20Sopenharmony_ci#define DOVE_PDMA_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xe4000)
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define DOVE_GLOBAL_CONFIG_1	(DOVE_SB_REGS_VIRT_BASE + 0xe802C)
1628c2ecf20Sopenharmony_ci#define  DOVE_TWSI_ENABLE_OPTION1	(1 << 7)
1638c2ecf20Sopenharmony_ci#define DOVE_GLOBAL_CONFIG_2	(DOVE_SB_REGS_VIRT_BASE + 0xe8030)
1648c2ecf20Sopenharmony_ci#define  DOVE_TWSI_ENABLE_OPTION2	(1 << 20)
1658c2ecf20Sopenharmony_ci#define  DOVE_TWSI_ENABLE_OPTION3	(1 << 21)
1668c2ecf20Sopenharmony_ci#define  DOVE_TWSI_OPTION3_GPIO		(1 << 22)
1678c2ecf20Sopenharmony_ci#define DOVE_SSP_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xec000)
1688c2ecf20Sopenharmony_ci#define DOVE_SSP_CTRL_STATUS_1	(DOVE_SB_REGS_VIRT_BASE + 0xe8034)
1698c2ecf20Sopenharmony_ci#define  DOVE_SSP_ON_AU1		(1 << 0)
1708c2ecf20Sopenharmony_ci#define  DOVE_SSP_CLOCK_ENABLE		(1 << 1)
1718c2ecf20Sopenharmony_ci#define  DOVE_SSP_BPB_CLOCK_SRC_SSP	(1 << 11)
1728c2ecf20Sopenharmony_ci/* Memory Controller */
1738c2ecf20Sopenharmony_ci#define DOVE_MC_PHYS_BASE       (DOVE_NB_REGS_PHYS_BASE + 0x00000)
1748c2ecf20Sopenharmony_ci#define  DOVE_MC_WINS_BASE      (DOVE_MC_PHYS_BASE + 0x100)
1758c2ecf20Sopenharmony_ci#define  DOVE_MC_WINS_SZ        (0x8)
1768c2ecf20Sopenharmony_ci#define DOVE_MC_VIRT_BASE	(DOVE_NB_REGS_VIRT_BASE + 0x00000)
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/* LCD Controller */
1798c2ecf20Sopenharmony_ci#define DOVE_LCD_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x10000)
1808c2ecf20Sopenharmony_ci#define DOVE_LCD1_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x20000)
1818c2ecf20Sopenharmony_ci#define DOVE_LCD2_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x10000)
1828c2ecf20Sopenharmony_ci#define DOVE_LCD_DCON_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x30000)
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci/* Graphic Engine */
1858c2ecf20Sopenharmony_ci#define DOVE_GPU_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x40000)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci/* Video Engine */
1888c2ecf20Sopenharmony_ci#define DOVE_VPU_PHYS_BASE	(DOVE_NB_REGS_PHYS_BASE + 0x400000)
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci#endif
191