From 80af1a9ef6c81db3d8b1bd8a73ab6a94ed20a1ea Mon Sep 17 00:00:00 2001 From: Marek BehĂșn Date: Tue, 24 Apr 2018 17:21:31 +0200 Subject: arm64: mvebu: Add basic support for the Turris Mox board This adds basic support for the Turris Mox board from CZ.NIC, which is currently being crowdfunded on Indiegogo. Turris Mox is as modular router based on the Armada 3720 SOC (same as EspressoBin). The basic module can be extended by different modules. The device tree binary for the kernel can be dependent on which modules are connected, and in what order. Because of this, the board specific code creates in U-Boot a variable called module_topology, which carries this information. Signed-off-by: Marek Behun Signed-off-by: Stefan Roese --- arch/arm/mach-mvebu/Kconfig | 7 +++++++ arch/arm/mach-mvebu/Makefile | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-mvebu') diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index ec42cf9044..f431cff950 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -96,6 +96,10 @@ config TARGET_TURRIS_OMNIA bool "Support Turris Omnia" select 88F6820 +config TARGET_TURRIS_MOX + bool "Support Turris Mox" + select ARMADA_3700 + config TARGET_MVEBU_ARMADA_8K bool "Support Armada 7k/8k platforms" select ARMADA_8K @@ -133,6 +137,7 @@ config SYS_BOARD default "db-88f6820-gp" if TARGET_DB_88F6820_GP default "db-88f6820-amc" if TARGET_DB_88F6820_AMC default "turris_omnia" if TARGET_TURRIS_OMNIA + default "turris_mox" if TARGET_TURRIS_MOX default "mvebu_armada-8k" if TARGET_MVEBU_ARMADA_8K default "db-mv784mp-gp" if TARGET_DB_MV784MP_GP default "ds414" if TARGET_DS414 @@ -151,6 +156,7 @@ config SYS_CONFIG_NAME default "maxbcm" if TARGET_MAXBCM default "theadorable" if TARGET_THEADORABLE default "turris_omnia" if TARGET_TURRIS_OMNIA + default "turris_mox" if TARGET_TURRIS_MOX config SYS_VENDOR default "Marvell" if TARGET_DB_MV784MP_GP @@ -162,6 +168,7 @@ config SYS_VENDOR default "solidrun" if TARGET_CLEARFOG default "Synology" if TARGET_DS414 default "CZ.NIC" if TARGET_TURRIS_OMNIA + default "CZ.NIC" if TARGET_TURRIS_MOX config SYS_SOC default "mvebu" diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index af4ca03688..3b9a8116d8 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile @@ -7,7 +7,7 @@ ifdef CONFIG_ARM64 obj-$(CONFIG_ARMADA_3700) += armada3700/ obj-$(CONFIG_ARMADA_8K) += armada8k/ obj-y += arm64-common.o -obj-y += sata.o +obj-$(CONFIG_AHCI) += sata.o else # CONFIG_ARM64 -- cgit From e6fce12d1476eda5b595274451443c3468f844d0 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 10 May 2018 13:28:26 +1200 Subject: ARM: mvebu: a38x: move definition of PEX_CFG_DIRECT_ACCESS PEX_CFG_DIRECT_ACCESS was defined in ddr3_hws_hw_training_def.h despite only being used in the serdes code. Move this definition to ctrl_pex.h where all the other PEX defines are. Also remove the duplicate definition of PEX_DEVICE_AND_VENDOR_ID which is already defined in ctrl_pex.h. Signed-off-by: Chris Packham Signed-off-by: Stefan Roese --- arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-mvebu') diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h index 53ed4eab32..3f30b6bf97 100644 --- a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h +++ b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h @@ -46,6 +46,7 @@ /* Controller revision info */ #define PEX_DEVICE_AND_VENDOR_ID 0x000 +#define PEX_CFG_DIRECT_ACCESS(if, reg) (PEX_IF_REGS_BASE(if) + (reg)) /* PCI Express Configuration Address Register */ #define PXCAR_REG_NUM_OFFS 2 -- cgit From c4195d5553595f12a6f5e943c9ee5e68097d7c72 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 10 May 2018 13:28:27 +1200 Subject: ARM: mvebu: a38x: move sys_env_device_rev_get Move sys_env_device_rev_get() from the ddr training code to sys_env_lib.c (which currently resides with the serdes code). This brings sys_env_device_rev_get() into line with sys_env_device_id_get() and sys_env_model_get(). Signed-off-by: Chris Packham Signed-off-by: Stefan Roese --- arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c | 26 ++++++++++++++++++++++++-- arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h | 1 - 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-mvebu') diff --git a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c index d26068e1d7..d387893af3 100644 --- a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c +++ b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c @@ -12,8 +12,6 @@ #include "seq_exec.h" #include "sys_env_lib.h" -#include "../../../drivers/ddr/marvell/a38x/ddr3_a38x.h" - #ifdef CONFIG_ARMADA_38X enum unit_id sys_env_soc_unit_nums[MAX_UNITS_ID][MAX_DEV_ID_NUM] = { /* 6820 6810 6811 6828 */ @@ -234,3 +232,27 @@ u32 sys_env_device_id_get(void) return g_dev_id; } + +/* + * sys_env_device_rev_get - Get Marvell controller device revision number + * + * DESCRIPTION: + * This function returns 8bit describing the device revision as defined + * Revision ID Register. + * + * INPUT: + * None. + * + * OUTPUT: + * None. + * + * RETURN: + * 8bit desscribing Marvell controller revision number + */ +u8 sys_env_device_rev_get(void) +{ + u32 value; + + value = reg_read(DEV_VERSION_ID_REG); + return (value & (REVISON_ID_MASK)) >> REVISON_ID_OFFS; +} diff --git a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h index c5461067fd..953445b7d7 100644 --- a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h +++ b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h @@ -7,7 +7,6 @@ #define _SYS_ENV_LIB_H #include "../../../drivers/ddr/marvell/a38x/ddr3_init.h" -#include "../../../drivers/ddr/marvell/a38x/ddr3_hws_hw_training.h" /* Serdes definitions */ #define COMMON_PHY_BASE_ADDR 0x18300 -- cgit