2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-10-22 10:13:17 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2009
|
|
|
|
* Marvell Semiconductor <www.marvell.com>
|
|
|
|
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
|
|
|
|
*
|
|
|
|
* Header file for the Marvell's Feroceon CPU core.
|
|
|
|
*/
|
|
|
|
|
2015-04-25 04:29:47 +00:00
|
|
|
#ifndef _MVEBU_SOC_H
|
|
|
|
#define _MVEBU_SOC_H
|
2014-10-22 10:13:17 +00:00
|
|
|
|
2020-05-10 17:40:13 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
#endif
|
|
|
|
|
2015-12-25 13:41:24 +00:00
|
|
|
#define SOC_MV78230_ID 0x7823
|
2015-12-09 10:00:51 +00:00
|
|
|
#define SOC_MV78260_ID 0x7826
|
2014-10-22 10:13:17 +00:00
|
|
|
#define SOC_MV78460_ID 0x7846
|
2016-02-10 06:23:00 +00:00
|
|
|
#define SOC_88F6720_ID 0x6720
|
2015-04-25 04:29:51 +00:00
|
|
|
#define SOC_88F6810_ID 0x6810
|
|
|
|
#define SOC_88F6820_ID 0x6820
|
|
|
|
#define SOC_88F6828_ID 0x6828
|
2017-09-04 05:38:31 +00:00
|
|
|
#define SOC_98DX3236_ID 0xf410
|
|
|
|
#define SOC_98DX3336_ID 0xf400
|
|
|
|
#define SOC_98DX4251_ID 0xfc00
|
2015-04-25 04:29:51 +00:00
|
|
|
|
2016-02-10 06:23:00 +00:00
|
|
|
/* A375 revisions */
|
|
|
|
#define MV_88F67XX_A0_ID 0x3
|
|
|
|
|
2015-04-25 04:29:51 +00:00
|
|
|
/* A38x revisions */
|
|
|
|
#define MV_88F68XX_Z1_ID 0x0
|
|
|
|
#define MV_88F68XX_A0_ID 0x4
|
2018-11-27 21:32:00 +00:00
|
|
|
#define MV_88F68XX_B0_ID 0xa
|
2014-10-22 10:13:17 +00:00
|
|
|
|
|
|
|
/* SOC specific definations */
|
|
|
|
#define INTREG_BASE 0xd0000000
|
|
|
|
#define INTREG_BASE_ADDR_REG (INTREG_BASE + 0x20080)
|
2016-05-17 13:00:30 +00:00
|
|
|
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_ARMADA_3700)
|
2015-04-17 16:12:41 +00:00
|
|
|
/*
|
2015-12-03 11:39:45 +00:00
|
|
|
* The SPL U-Boot version still runs with the default
|
|
|
|
* address for the internal registers, configured by
|
|
|
|
* the BootROM. Only the main U-Boot version uses the
|
|
|
|
* new internal register base address, that also is
|
|
|
|
* required for the Linux kernel.
|
2015-04-17 16:12:41 +00:00
|
|
|
*/
|
|
|
|
#define SOC_REGS_PHY_BASE 0xd0000000
|
arm64: mvebu: Add basic support for the Marvell Armada 7K/8K SoC
Compared to the Armada 3700, the Armada 7K and 8K are much more on the
high-end side: they use a dual Cortex-A72 or a quad Cortex-A72, as
opposed to the Cortex-A53 for the Armada 3700.
The Armada 7K and 8K also use a fairly unique architecture, internally
they are composed of several components:
- One AP (Application Processor), which contains the processor itself
and a few core hardware blocks. The AP used in the Armada 7K and 8K
is called AP806, and is available in two configurations:
dual Cortex-A72 and quad Cortex-A72.
- One or two CP (Communication Processor), which contain most of the I/O
interfaces (SATA, PCIe, Ethernet, etc.). The 7K family chips have one
CP, while the 8K family chips integrate two CPs, providing two times
the number of I/O interfaces available in the CP.
The CP used in the 7K and 8K is called CP110.
All in all, this gives the following combinations:
- Armada 7020, which is a dual Cortex-A72 with one CP
- Armada 7040, which is a quad Cortex-A72 with one CP
- Armada 8020, which is a dual Cortex-A72 with two CPs
- Armada 8040, which is a quad Cortex-A72 with two CPs
This patch adds basic support for this ARMv8 based SoC into U-Boot.
Future patches will integrate other device drivers and board support,
starting with the Marvell DB-88F7040 development board.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Omri Itach <omrii@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
2016-05-25 06:13:45 +00:00
|
|
|
#elif defined(CONFIG_ARMADA_8K)
|
|
|
|
#define SOC_REGS_PHY_BASE 0xf0000000
|
2015-04-17 16:12:41 +00:00
|
|
|
#else
|
2014-10-22 10:13:17 +00:00
|
|
|
#define SOC_REGS_PHY_BASE 0xf1000000
|
2015-04-17 16:12:41 +00:00
|
|
|
#endif
|
2014-10-22 10:13:17 +00:00
|
|
|
#define MVEBU_REGISTER(x) (SOC_REGS_PHY_BASE + x)
|
|
|
|
|
|
|
|
#define MVEBU_SDRAM_SCRATCH (MVEBU_REGISTER(0x01504))
|
2015-04-25 04:29:51 +00:00
|
|
|
#define MVEBU_L2_CACHE_BASE (MVEBU_REGISTER(0x08000))
|
|
|
|
#define CONFIG_SYS_PL310_BASE MVEBU_L2_CACHE_BASE
|
2014-10-22 10:13:17 +00:00
|
|
|
#define MVEBU_TWSI_BASE (MVEBU_REGISTER(0x11000))
|
2016-04-08 13:58:28 +00:00
|
|
|
#define MVEBU_TWSI1_BASE (MVEBU_REGISTER(0x11100))
|
2014-10-22 10:13:17 +00:00
|
|
|
#define MVEBU_MPP_BASE (MVEBU_REGISTER(0x18000))
|
|
|
|
#define MVEBU_GPIO0_BASE (MVEBU_REGISTER(0x18100))
|
|
|
|
#define MVEBU_GPIO1_BASE (MVEBU_REGISTER(0x18140))
|
|
|
|
#define MVEBU_GPIO2_BASE (MVEBU_REGISTER(0x18180))
|
|
|
|
#define MVEBU_SYSTEM_REG_BASE (MVEBU_REGISTER(0x18200))
|
2015-07-16 08:40:05 +00:00
|
|
|
#define MVEBU_CLOCK_BASE (MVEBU_REGISTER(0x18700))
|
2014-10-22 10:13:17 +00:00
|
|
|
#define MVEBU_CPU_WIN_BASE (MVEBU_REGISTER(0x20000))
|
|
|
|
#define MVEBU_SDRAM_BASE (MVEBU_REGISTER(0x20180))
|
|
|
|
#define MVEBU_TIMER_BASE (MVEBU_REGISTER(0x20300))
|
|
|
|
#define MVEBU_REG_PCIE_BASE (MVEBU_REGISTER(0x40000))
|
2015-07-22 16:26:13 +00:00
|
|
|
#define MVEBU_AXP_USB_BASE (MVEBU_REGISTER(0x50000))
|
2015-06-29 12:58:15 +00:00
|
|
|
#define MVEBU_USB20_BASE (MVEBU_REGISTER(0x58000))
|
2017-01-11 15:00:45 +00:00
|
|
|
#define MVEBU_REG_PCIE0_BASE (MVEBU_REGISTER(0x80000))
|
2015-07-15 12:50:05 +00:00
|
|
|
#define MVEBU_AXP_SATA_BASE (MVEBU_REGISTER(0xa0000))
|
2015-06-29 12:58:13 +00:00
|
|
|
#define MVEBU_SATA0_BASE (MVEBU_REGISTER(0xa8000))
|
2015-07-16 08:40:05 +00:00
|
|
|
#define MVEBU_NAND_BASE (MVEBU_REGISTER(0xd0000))
|
2015-06-29 12:58:10 +00:00
|
|
|
#define MVEBU_SDIO_BASE (MVEBU_REGISTER(0xd8000))
|
2016-01-20 07:13:28 +00:00
|
|
|
#define MVEBU_LCD_BASE (MVEBU_REGISTER(0xe0000))
|
2019-04-11 10:22:50 +00:00
|
|
|
#ifdef CONFIG_ARMADA_MSYS
|
|
|
|
#define MVEBU_DFX_BASE (MBUS_DFX_BASE)
|
|
|
|
#else
|
2016-08-22 00:38:39 +00:00
|
|
|
#define MVEBU_DFX_BASE (MVEBU_REGISTER(0xe4000))
|
2019-04-11 10:22:50 +00:00
|
|
|
#endif
|
2014-10-22 10:13:17 +00:00
|
|
|
|
2015-07-01 11:28:39 +00:00
|
|
|
#define SOC_COHERENCY_FABRIC_CTRL_REG (MVEBU_REGISTER(0x20200))
|
|
|
|
#define MBUS_ERR_PROP_EN (1 << 8)
|
|
|
|
|
2015-07-01 10:44:51 +00:00
|
|
|
#define MBUS_BRIDGE_WIN_CTRL_REG (MVEBU_REGISTER(0x20250))
|
|
|
|
#define MBUS_BRIDGE_WIN_BASE_REG (MVEBU_REGISTER(0x20254))
|
|
|
|
|
2015-07-16 08:40:05 +00:00
|
|
|
#define MVEBU_SOC_DEV_MUX_REG (MVEBU_SYSTEM_REG_BASE + 0x08)
|
|
|
|
#define NAND_EN BIT(0)
|
|
|
|
#define NAND_ARBITER_EN BIT(27)
|
|
|
|
|
|
|
|
#define ARMADA_XP_PUP_ENABLE (MVEBU_SYSTEM_REG_BASE + 0x44c)
|
|
|
|
#define GE0_PUP_EN BIT(0)
|
|
|
|
#define GE1_PUP_EN BIT(1)
|
|
|
|
#define LCD_PUP_EN BIT(2)
|
|
|
|
#define NAND_PUP_EN BIT(4)
|
|
|
|
#define SPI_PUP_EN BIT(5)
|
|
|
|
|
|
|
|
#define MVEBU_CORE_DIV_CLK_CTRL(i) (MVEBU_CLOCK_BASE + ((i) * 0x8))
|
2019-04-11 10:22:51 +00:00
|
|
|
#ifdef CONFIG_ARMADA_MSYS
|
|
|
|
#define MVEBU_DFX_DIV_CLK_CTRL(i) (MVEBU_DFX_BASE + 0xf8000 + 0x250 + ((i) * 0x4))
|
|
|
|
#define NAND_ECC_DIVCKL_RATIO_OFFS 6
|
|
|
|
#define NAND_ECC_DIVCKL_RATIO_MASK (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
|
|
|
|
#else
|
2016-08-22 00:38:39 +00:00
|
|
|
#define MVEBU_DFX_DIV_CLK_CTRL(i) (MVEBU_DFX_BASE + 0x250 + ((i) * 0x4))
|
2019-04-11 10:22:51 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARMADA_MSYS
|
|
|
|
#define NAND_ECC_DIVCKL_RATIO_OFFS 6
|
|
|
|
#define NAND_ECC_DIVCKL_RATIO_MASK (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
|
|
|
|
#else
|
2015-07-16 08:40:05 +00:00
|
|
|
#define NAND_ECC_DIVCKL_RATIO_OFFS 8
|
|
|
|
#define NAND_ECC_DIVCKL_RATIO_MASK (0x3F << NAND_ECC_DIVCKL_RATIO_OFFS)
|
2019-04-11 10:22:51 +00:00
|
|
|
#endif
|
2015-07-16 08:40:05 +00:00
|
|
|
|
2014-10-22 10:13:17 +00:00
|
|
|
#define SDRAM_MAX_CS 4
|
|
|
|
#define SDRAM_ADDR_MASK 0xFF000000
|
|
|
|
|
2015-04-25 04:29:47 +00:00
|
|
|
/* MVEBU CPU memory windows */
|
2014-10-22 10:13:17 +00:00
|
|
|
#define MVCPU_WIN_CTRL_DATA CPU_WIN_CTRL_DATA
|
|
|
|
#define MVCPU_WIN_ENABLE CPU_WIN_ENABLE
|
|
|
|
#define MVCPU_WIN_DISABLE CPU_WIN_DISABLE
|
|
|
|
|
2015-12-25 13:41:20 +00:00
|
|
|
#define COMPHY_REFCLK_ALIGNMENT (MVEBU_REGISTER(0x182f8))
|
|
|
|
|
2016-01-07 13:12:04 +00:00
|
|
|
/* BootROM error register (also includes some status infos) */
|
|
|
|
#define CONFIG_BOOTROM_ERR_REG (MVEBU_REGISTER(0x182d0))
|
|
|
|
#define BOOTROM_ERR_MODE_OFFS 28
|
|
|
|
#define BOOTROM_ERR_MODE_MASK (0xf << BOOTROM_ERR_MODE_OFFS)
|
|
|
|
#define BOOTROM_ERR_MODE_UART 0x6
|
2018-08-17 08:47:42 +00:00
|
|
|
#define BOOTROM_ERR_CODE_OFFS 0
|
|
|
|
#define BOOTROM_ERR_CODE_MASK (0xf << BOOTROM_ERR_CODE_OFFS)
|
2016-01-07 13:12:04 +00:00
|
|
|
|
2016-02-10 06:23:00 +00:00
|
|
|
#if defined(CONFIG_ARMADA_375)
|
|
|
|
/* SAR values for Armada 375 */
|
|
|
|
#define CONFIG_SAR_REG (MVEBU_REGISTER(0xe8200))
|
|
|
|
#define CONFIG_SAR2_REG (MVEBU_REGISTER(0xe8204))
|
|
|
|
|
|
|
|
#define SAR_CPU_FREQ_OFFS 17
|
|
|
|
#define SAR_CPU_FREQ_MASK (0x1f << SAR_CPU_FREQ_OFFS)
|
|
|
|
|
|
|
|
#define BOOT_DEV_SEL_OFFS 3
|
|
|
|
#define BOOT_DEV_SEL_MASK (0x3f << BOOT_DEV_SEL_OFFS)
|
|
|
|
|
|
|
|
#define BOOT_FROM_UART 0x30
|
|
|
|
#define BOOT_FROM_SPI 0x38
|
|
|
|
#elif defined(CONFIG_ARMADA_38X)
|
2016-01-07 13:03:11 +00:00
|
|
|
/* SAR values for Armada 38x */
|
|
|
|
#define CONFIG_SAR_REG (MVEBU_REGISTER(0x18600))
|
2016-01-07 13:09:09 +00:00
|
|
|
|
2016-01-07 13:03:11 +00:00
|
|
|
#define SAR_CPU_FREQ_OFFS 10
|
|
|
|
#define SAR_CPU_FREQ_MASK (0x1f << SAR_CPU_FREQ_OFFS)
|
|
|
|
#define SAR_BOOT_DEVICE_OFFS 4
|
|
|
|
#define SAR_BOOT_DEVICE_MASK (0x1f << SAR_BOOT_DEVICE_OFFS)
|
2016-01-07 13:09:09 +00:00
|
|
|
|
|
|
|
#define BOOT_DEV_SEL_OFFS 4
|
2016-01-07 13:12:04 +00:00
|
|
|
#define BOOT_DEV_SEL_MASK (0x3f << BOOT_DEV_SEL_OFFS)
|
2016-01-07 13:09:09 +00:00
|
|
|
|
2017-11-24 13:01:47 +00:00
|
|
|
#define BOOT_FROM_NAND 0x0A
|
2019-05-16 10:03:58 +00:00
|
|
|
#define BOOT_FROM_SATA 0x22
|
2016-01-07 13:09:09 +00:00
|
|
|
#define BOOT_FROM_UART 0x28
|
2019-05-16 10:03:58 +00:00
|
|
|
#define BOOT_FROM_SATA_ALT 0x2A
|
2017-09-24 12:50:17 +00:00
|
|
|
#define BOOT_FROM_UART_ALT 0x3f
|
2016-01-07 13:09:09 +00:00
|
|
|
#define BOOT_FROM_SPI 0x32
|
|
|
|
#define BOOT_FROM_MMC 0x30
|
|
|
|
#define BOOT_FROM_MMC_ALT 0x31
|
2021-07-31 12:22:52 +00:00
|
|
|
|
|
|
|
#define CONFIG_SYS_TCLK ((readl(CONFIG_SAR_REG) & BIT(15)) ? \
|
|
|
|
200000000 : 250000000)
|
2019-04-11 10:22:50 +00:00
|
|
|
#elif defined(CONFIG_ARMADA_MSYS)
|
|
|
|
/* SAR values for MSYS */
|
|
|
|
#define CONFIG_SAR_REG (MBUS_DFX_BASE + 0xf8200)
|
|
|
|
#define CONFIG_SAR2_REG (MBUS_DFX_BASE + 0xf8204)
|
|
|
|
|
|
|
|
#define SAR_CPU_FREQ_OFFS 18
|
|
|
|
#define SAR_CPU_FREQ_MASK (0x7 << SAR_CPU_FREQ_OFFS)
|
|
|
|
#define SAR_BOOT_DEVICE_OFFS 11
|
|
|
|
#define SAR_BOOT_DEVICE_MASK (0x7 << SAR_BOOT_DEVICE_OFFS)
|
|
|
|
|
|
|
|
#define BOOT_DEV_SEL_OFFS 11
|
|
|
|
#define BOOT_DEV_SEL_MASK (0x7 << BOOT_DEV_SEL_OFFS)
|
|
|
|
|
|
|
|
#define BOOT_FROM_NAND 0x1
|
|
|
|
#define BOOT_FROM_UART 0x2
|
|
|
|
#define BOOT_FROM_SPI 0x3
|
2016-01-07 13:03:11 +00:00
|
|
|
#else
|
|
|
|
/* SAR values for Armada XP */
|
|
|
|
#define CONFIG_SAR_REG (MVEBU_REGISTER(0x18230))
|
|
|
|
#define CONFIG_SAR2_REG (MVEBU_REGISTER(0x18234))
|
2016-01-07 13:09:09 +00:00
|
|
|
|
2016-01-07 13:03:11 +00:00
|
|
|
#define SAR_CPU_FREQ_OFFS 21
|
|
|
|
#define SAR_CPU_FREQ_MASK (0x7 << SAR_CPU_FREQ_OFFS)
|
|
|
|
#define SAR_FFC_FREQ_OFFS 24
|
|
|
|
#define SAR_FFC_FREQ_MASK (0xf << SAR_FFC_FREQ_OFFS)
|
|
|
|
#define SAR2_CPU_FREQ_OFFS 20
|
|
|
|
#define SAR2_CPU_FREQ_MASK (0x1 << SAR2_CPU_FREQ_OFFS)
|
|
|
|
#define SAR_BOOT_DEVICE_OFFS 5
|
|
|
|
#define SAR_BOOT_DEVICE_MASK (0xf << SAR_BOOT_DEVICE_OFFS)
|
2016-01-07 13:09:09 +00:00
|
|
|
|
|
|
|
#define BOOT_DEV_SEL_OFFS 5
|
|
|
|
#define BOOT_DEV_SEL_MASK (0xf << BOOT_DEV_SEL_OFFS)
|
|
|
|
|
|
|
|
#define BOOT_FROM_UART 0x2
|
|
|
|
#define BOOT_FROM_SPI 0x3
|
2016-01-07 13:03:11 +00:00
|
|
|
#endif
|
|
|
|
|
2021-07-31 12:22:52 +00:00
|
|
|
/* TCLK Core Clock definition */
|
|
|
|
#ifndef CONFIG_SYS_TCLK
|
|
|
|
#define CONFIG_SYS_TCLK 250000000 /* 250MHz */
|
|
|
|
#endif
|
|
|
|
|
2015-04-25 04:29:47 +00:00
|
|
|
#endif /* _MVEBU_SOC_H */
|