Skip to contentSkip to conversation

Add Marvell Armada A38x 88F6820 SoC support

PATCH Superseded Stefan Roese 2 participants 13 messages Mar 18, 2015 – Mar 20, 2015

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Add Marvell Armada A38x 88F6820 SoC support

This patch series adds support for the Marvell Armada A38x SoC's. Specifically the 88F6820 / 88F6828.

Basic support for the DB-88F6820-GP evaluation board is added. Supporting the following interfaces:
- UART
- SPI (including SPI NOR flash)
- I2C
- Ethernet (neta)

One big part of this new SoC support is the move of the already exisiting Armada XP support into the "mach-mvebu" directory. With this move its easier to re-use this code for the A38x, which is pretty similar to the AXP.

Thanks,
Stefan

Stefan Roese (10):
arm: armada-xp: Move SoC sources to mach-mvebu
arm: armada-xp: Move SoC headers to mach-mvebu/include/mach
arm: mvebu: Move mvebu-common into mach-mvebu
arm: mvebu: Change header macros from ARMADA_XP to MVEBU
arm: mvebu: Remove unreferenced define
arm: mvebu: Only define MV88F78X60 for Armada XP
arm: mvebu: Move CONFIG_SPL_LDSCRIPT to common header
arm: mvebu: Add basic Armada 38x support
arm: mvebu: Change network init code to allow a more flexible setup
arm: mvebu: Add Armada A38x DB-88F6820-GP board support

 arch/arm/Kconfig                                   |  6 ++
 arch/arm/Makefile                                  |  5 +-
 arch/arm/cpu/armv7/Makefile                        |  1 -
 arch/arm/cpu/armv7/armada-xp/Makefile              |  9 --
 arch/arm/mach-mvebu/Makefile                       | 24 ++++++
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/cpu.c | 99 +++++++++++++++++-----
 arch/arm/{mvebu-common => mach-mvebu}/dram.c       |  0
 arch/arm/{mvebu-common => mach-mvebu}/gpio.c       |  0
 .../include/mach}/config.h                         | 15 +++-
 .../include/mach}/cpu.h                            |  6 +-
 .../include/mach}/soc.h                            | 18 ++--
 .../armv7/armada-xp => mach-mvebu}/lowlevel_spl.S  |  0
 arch/arm/{mvebu-common => mach-mvebu}/mbus.c       |  0
 .../{mvebu-common => mach-mvebu}/serdes/Makefile   |  0
 .../serdes/board_env_spec.h                        |  0
 .../serdes/high_speed_env_lib.c                    |  0
 .../serdes/high_speed_env_spec.c                   |  0
 .../serdes/high_speed_env_spec.h                   |  0
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/spl.c |  0
 arch/arm/{mvebu-common => mach-mvebu}/timer.c      |  0
 .../{mvebu-common => mach-mvebu}/u-boot-spl.lds    |  0
 board/Marvell/db-88f6820-gp/Kconfig                | 15 ++++
 board/Marvell/db-88f6820-gp/Makefile               |  7 ++
 board/Marvell/db-88f6820-gp/binary.0               | 16 ++++
 board/Marvell/db-88f6820-gp/db-88f6820-gp.c        | 78 +++++++++++++++++
 board/Marvell/db-88f6820-gp/kwbimage.cfg           | 12 +++
 board/Marvell/db-mv784mp-gp/Kconfig                |  2 +-
 board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c        |  3 +-
 board/maxbcm/Kconfig                               |  2 +-
 board/maxbcm/maxbcm.c                              |  2 +-
 configs/db-88f6820-gp_defconfig                    |  2 +
 include/configs/db-88f6820-gp.h                    | 69 +++++++++++++++
 include/configs/db-mv784mp-gp.h                    |  3 +-
 include/configs/maxbcm.h                           |  3 +-
 34 files changed, 343 insertions(+), 54 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/armada-xp/Makefile
 create mode 100644 arch/arm/mach-mvebu/Makefile
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/cpu.c (71%)
 rename arch/arm/{mvebu-common => mach-mvebu}/dram.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/gpio.c (100%)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/config.h (86%)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/cpu.h (96%)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/soc.h (86%)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/lowlevel_spl.S (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/mbus.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/Makefile (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/board_env_spec.h (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_lib.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_spec.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_spec.h (100%)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/spl.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/timer.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/u-boot-spl.lds (100%)
 create mode 100644 board/Marvell/db-88f6820-gp/Kconfig
 create mode 100644 board/Marvell/db-88f6820-gp/Makefile
 create mode 100644 board/Marvell/db-88f6820-gp/binary.0
 create mode 100644 board/Marvell/db-88f6820-gp/db-88f6820-gp.c
 create mode 100644 board/Marvell/db-88f6820-gp/kwbimage.cfg
 create mode 100644 configs/db-88f6820-gp_defconfig
 create mode 100644 include/configs/db-88f6820-gp.h
Signature · 1 line
2.3.3
#1 lore raw

PATCH 1/10 arm: armada-xp: Move SoC sources to mach-mvebu

Move arch/arm/cpu/armv7armada-xp/* -> arch/arm/mach-mvebu/*

Since this platform will be extended to support other Marvell SoC's as well, lets rename it directly to mvebu.

This will be used by the upcoming Armada 38x suport (A38x).

Cc Masahiro Yamada <[email protected]>

---

 arch/arm/Makefile                                           | 1 +
 arch/arm/cpu/armv7/Makefile                                 | 1 -
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/Makefile       | 0
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/cpu.c          | 0
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/lowlevel_spl.S | 0
 arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/spl.c          | 0
 6 files changed, 1 insertion(+), 1 deletion(-)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/Makefile (100%)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/cpu.c (100%)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/lowlevel_spl.S (100%)
 rename arch/arm/{cpu/armv7/armada-xp => mach-mvebu}/spl.c (100%)
arch/arm/Makefile +1 -0
index 08946de..a756338 100644
@@ -10,6 +10,7 @@ machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
 machine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
 # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
 machine-$(CONFIG_KIRKWOOD)		+= kirkwood
+machine-$(CONFIG_ARMADA_XP)		+= mvebu
 # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
 machine-$(CONFIG_ARCH_NOMADIK)		+= nomadik
 # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
arch/arm/cpu/armv7/Makefile +0 -1
index 1312a9d..23532d8 100644
@@ -38,7 +38,6 @@ obj-y += s5p-common/
 endif
 
 obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
-obj-$(if $(filter armada-xp,$(SOC)),y) += armada-xp/
 obj-$(CONFIG_BCM2835) += bcm2835/
 obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
 obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
arch/arm/mach-mvebu/Makefile renamed from arch/arm/cpu/armv7/armada-xp/Makefile +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/armada-xp/Makefile
rename to arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/cpu.c renamed from arch/arm/cpu/armv7/armada-xp/cpu.c +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/armada-xp/cpu.c
rename to arch/arm/mach-mvebu/cpu.c
arch/arm/mach-mvebu/lowlevel_spl.S renamed from arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S
rename to arch/arm/mach-mvebu/lowlevel_spl.S
arch/arm/mach-mvebu/spl.c renamed from arch/arm/cpu/armv7/armada-xp/spl.c +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/armada-xp/spl.c
rename to arch/arm/mach-mvebu/spl.c
Signature · 1 line
2.3.3
#2 lore raw

PATCH 2/10 arm: armada-xp: Move SoC headers to mach-mvebu/include/mach

In reply to Stefan Roese

Move arch/arm/include/asm/arch-armada-xp/*

     -> arch/arm/mach-mvebu/include/mach/*

Additionally the SYS_SOC is renamed from "armada-xp" to "mvebu". With this change all these files can better be shared with other, newer Mavell MVEBU SoC's. Like the upcoming Armada 38x support.

Cc Masahiro Yamada <[email protected]>

---

 arch/arm/Makefile                                                       | 2 +-
 .../{include/asm/arch-armada-xp => mach-mvebu/include/mach}/config.h    | 0
 arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/cpu.h  | 0
 arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/soc.h  | 0
 board/Marvell/db-mv784mp-gp/Kconfig                                     | 2 +-
 board/maxbcm/Kconfig                                                    | 2 +-
 6 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/config.h (100%)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/cpu.h (100%)
 rename arch/arm/{include/asm/arch-armada-xp => mach-mvebu/include/mach}/soc.h (100%)
arch/arm/Makefile +1 -1
index a756338..03b4970 100644
@@ -47,7 +47,7 @@ libs-y += arch/arm/imx-common/
 endif
 endif
 
-ifneq (,$(filter $(SOC), armada-xp kirkwood))
+ifneq (,$(filter $(SOC), mvebu kirkwood))
 libs-y += arch/arm/mvebu-common/
 endif
 
arch/arm/mach-mvebu/include/mach/config.h renamed from arch/arm/include/asm/arch-armada-xp/config.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/arch-armada-xp/config.h
rename to arch/arm/mach-mvebu/include/mach/config.h
arch/arm/mach-mvebu/include/mach/cpu.h renamed from arch/arm/include/asm/arch-armada-xp/cpu.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/arch-armada-xp/cpu.h
rename to arch/arm/mach-mvebu/include/mach/cpu.h
arch/arm/mach-mvebu/include/mach/soc.h renamed from arch/arm/include/asm/arch-armada-xp/soc.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/arch-armada-xp/soc.h
rename to arch/arm/mach-mvebu/include/mach/soc.h
board/Marvell/db-mv784mp-gp/Kconfig +1 -1
index 98aa10a..d0b426e 100644
@@ -7,7 +7,7 @@ config SYS_VENDOR
 	default "Marvell"
 
 config SYS_SOC
-	default "armada-xp"
+	default "mvebu"
 
 config SYS_CONFIG_NAME
 	default "db-mv784mp-gp"
board/maxbcm/Kconfig +1 -1
index d833ca0..e86aa16 100644
@@ -4,7 +4,7 @@ config SYS_BOARD
 	default "maxbcm"
 
 config SYS_SOC
-	default "armada-xp"
+	default "mvebu"
 
 config SYS_CONFIG_NAME
 	default "maxbcm"
Signature · 1 line
2.3.3
#3 lore raw

PATCH 3/10 arm: mvebu: Move mvebu-common into mach-mvebu

In reply to Stefan Roese

Now that the mach-mvebu directory exists and is used by Armada XP we can move the mvebu-common files into this directory as well.

Cc Masahiro Yamada <[email protected]>

---

 arch/arm/Makefile                                       |  4 ++--
 arch/arm/mach-mvebu/Makefile                            | 17 ++++++++++++++++-
 arch/arm/{mvebu-common => mach-mvebu}/dram.c            |  0
 arch/arm/{mvebu-common => mach-mvebu}/gpio.c            |  0
 arch/arm/{mvebu-common => mach-mvebu}/mbus.c            |  0
 arch/arm/{mvebu-common => mach-mvebu}/serdes/Makefile   |  0
 .../serdes/board_env_spec.h                             |  0
 .../serdes/high_speed_env_lib.c                         |  0
 .../serdes/high_speed_env_spec.c                        |  0
 .../serdes/high_speed_env_spec.h                        |  0
 arch/arm/{mvebu-common => mach-mvebu}/timer.c           |  0
 arch/arm/{mvebu-common => mach-mvebu}/u-boot-spl.lds    |  0
 board/maxbcm/maxbcm.c                                   |  2 +-
 include/configs/db-mv784mp-gp.h                         |  2 +-
 include/configs/maxbcm.h                                |  2 +-
 15 files changed, 21 insertions(+), 6 deletions(-)
 rename arch/arm/{mvebu-common => mach-mvebu}/dram.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/gpio.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/mbus.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/Makefile (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/board_env_spec.h (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_lib.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_spec.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/serdes/high_speed_env_spec.h (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/timer.c (100%)
 rename arch/arm/{mvebu-common => mach-mvebu}/u-boot-spl.lds (100%)
arch/arm/Makefile +2 -2
index 03b4970..a0dcaad 100644
@@ -47,8 +47,8 @@ libs-y += arch/arm/imx-common/
 endif
 endif
 
-ifneq (,$(filter $(SOC), mvebu kirkwood))
-libs-y += arch/arm/mvebu-common/
+ifneq (,$(filter $(SOC), kirkwood))
+libs-y += arch/arm/mach-mvebu/
 endif
 
 # deprecated
arch/arm/mach-mvebu/Makefile +16 -1
index 737159b..4f477cd 100644
@@ -1,9 +1,24 @@
 #
-# Copyright (C) 2014 Stefan Roese <[email protected]>
+# Copyright (C) 2014-2015 Stefan Roese <[email protected]>
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
+ifdef CONFIG_KIRKWOOD
+
+obj-y	= dram.o
+obj-y	+= gpio.o
+obj-y	+= timer.o
+
+else
+
 obj-y	= cpu.o
+obj-y	+= dram.o
+obj-y	+= gpio.o
+obj-y	+= mbus.o
+obj-y	+= timer.o
 obj-$(CONFIG_SPL_BUILD) += spl.o
 obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
+
+obj-y	+= serdes/
+endif
arch/arm/mach-mvebu/dram.c renamed from arch/arm/mvebu-common/dram.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/dram.c
rename to arch/arm/mach-mvebu/dram.c
arch/arm/mach-mvebu/gpio.c renamed from arch/arm/mvebu-common/gpio.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/gpio.c
rename to arch/arm/mach-mvebu/gpio.c
arch/arm/mach-mvebu/mbus.c renamed from arch/arm/mvebu-common/mbus.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/mbus.c
rename to arch/arm/mach-mvebu/mbus.c
arch/arm/mach-mvebu/serdes/Makefile renamed from arch/arm/mvebu-common/serdes/Makefile +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/serdes/Makefile
rename to arch/arm/mach-mvebu/serdes/Makefile
arch/arm/mach-mvebu/serdes/board_env_spec.h renamed from arch/arm/mvebu-common/serdes/board_env_spec.h +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/serdes/board_env_spec.h
rename to arch/arm/mach-mvebu/serdes/board_env_spec.h
arch/arm/mach-mvebu/serdes/high_speed_env_lib.c renamed from arch/arm/mvebu-common/serdes/high_speed_env_lib.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/serdes/high_speed_env_lib.c
rename to arch/arm/mach-mvebu/serdes/high_speed_env_lib.c
arch/arm/mach-mvebu/serdes/high_speed_env_spec.c renamed from arch/arm/mvebu-common/serdes/high_speed_env_spec.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/serdes/high_speed_env_spec.c
rename to arch/arm/mach-mvebu/serdes/high_speed_env_spec.c
arch/arm/mach-mvebu/serdes/high_speed_env_spec.h renamed from arch/arm/mvebu-common/serdes/high_speed_env_spec.h +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/serdes/high_speed_env_spec.h
rename to arch/arm/mach-mvebu/serdes/high_speed_env_spec.h
arch/arm/mach-mvebu/timer.c renamed from arch/arm/mvebu-common/timer.c +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/timer.c
rename to arch/arm/mach-mvebu/timer.c
arch/arm/mach-mvebu/u-boot-spl.lds renamed from arch/arm/mvebu-common/u-boot-spl.lds +0 -0
similarity index 100%
rename from arch/arm/mvebu-common/u-boot-spl.lds
rename to arch/arm/mach-mvebu/u-boot-spl.lds
board/maxbcm/maxbcm.c +1 -1
index 46b16ac..2fbb90c 100644
@@ -12,7 +12,7 @@
 #include <linux/mbus.h>
 
 #include "../drivers/ddr/mvebu/ddr3_hw_training.h"
-#include "../arch/arm/mvebu-common/serdes/high_speed_env_spec.h"
+#include "../arch/arm/mach-mvebu/serdes/high_speed_env_spec.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
include/configs/db-mv784mp-gp.h +1 -1
index 1683a15..860e5f6 100644
@@ -100,7 +100,7 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mvebu-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-mvebu/u-boot-spl.lds"
 
 /* SPL related SPI defines */
 #define CONFIG_SPL_SPI_SUPPORT
include/configs/maxbcm.h +1 -1
index 5999d60..90b5912 100644
@@ -100,7 +100,7 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mvebu-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-mvebu/u-boot-spl.lds"
 
 /* SPL related SPI defines */
 #define CONFIG_SPL_SPI_SUPPORT
Signature · 1 line
2.3.3
#4 lore raw

PATCH 4/10 arm: mvebu: Change header macros from ARMADA_XP to MVEBU

In reply to Stefan Roese

Since these files will be used for other MVEBU SoC's, lets reflect this in the headers marcos as well.

---

 arch/arm/mach-mvebu/include/mach/config.h | 6 +++---
 arch/arm/mach-mvebu/include/mach/cpu.h    | 6 +++---
 arch/arm/mach-mvebu/include/mach/soc.h    | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-mvebu/include/mach/config.h +3 -3
index f9fd424..01b725b 100644
@@ -12,8 +12,8 @@
  * It supports common definitions for Armada XP platforms
  */
 
-#ifndef _ARMADA_XP_CONFIG_H
-#define _ARMADA_XP_CONFIG_H
+#ifndef _MVEBU_CONFIG_H
+#define _MVEBU_CONFIG_H
 
 #include <asm/arch/soc.h>
 
@@ -83,4 +83,4 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 #endif
 
-#endif /* _ARMADA_XP_CONFIG_H */
+#endif /* __MVEBU_CONFIG_H */
arch/arm/mach-mvebu/include/mach/cpu.h +3 -3
index 4f5ff96..297ac52 100644
@@ -6,8 +6,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _ARMADA_XP_CPU_H
-#define _ARMADA_XP_CPU_H
+#ifndef _MVEBU_CPU_H
+#define _MVEBU_CPU_H
 
 #include <asm/system.h>
 
@@ -120,4 +120,4 @@ int serdes_phy_config(void);
  */
 int ddr3_init(void);
 #endif /* __ASSEMBLY__ */
-#endif /* _ARMADA_XP_CPU_H */
+#endif /* _MVEBU_CPU_H */
arch/arm/mach-mvebu/include/mach/soc.h +4 -4
index 963e7ac..202d5b8 100644
@@ -8,8 +8,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _ASM_ARCH_ARMADA_XP_H
-#define _ASM_ARCH_ARMADA_XP_H
+#ifndef _MVEBU_SOC_H
+#define _MVEBU_SOC_H
 
 #define SOC_MV78460_ID		0x7846
 
@@ -49,9 +49,9 @@
 /* Armada XP GbE controller has 4 ports */
 #define MAX_MVNETA_DEVS		4
 
-/* Kirkwood CPU memory windows */
+/* MVEBU CPU memory windows */
 #define MVCPU_WIN_CTRL_DATA	CPU_WIN_CTRL_DATA
 #define MVCPU_WIN_ENABLE	CPU_WIN_ENABLE
 #define MVCPU_WIN_DISABLE	CPU_WIN_DISABLE
 
-#endif /* _ASM_ARCH_ARMADA_XP_H */
+#endif /* _MVEBU_SOC_H */
Signature · 1 line
2.3.3
#5 lore raw

PATCH 5/10 arm: mvebu: Remove unreferenced define

In reply to Stefan Roese

MAX_MVNETA_DEVS is not used anywhere in U-Boot. So lets remove it.

---

 arch/arm/mach-mvebu/include/mach/soc.h | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/mach-mvebu/include/mach/soc.h +0 -3
index 202d5b8..f3e0398 100644
@@ -46,9 +46,6 @@
 #define SDRAM_MAX_CS		4
 #define SDRAM_ADDR_MASK		0xFF000000
 
-/* Armada XP GbE controller has 4 ports */
-#define MAX_MVNETA_DEVS		4
-
 /* MVEBU CPU memory windows */
 #define MVCPU_WIN_CTRL_DATA	CPU_WIN_CTRL_DATA
 #define MVCPU_WIN_ENABLE	CPU_WIN_ENABLE
Signature · 1 line
2.3.3
#6 lore raw

PATCH 6/10 arm: mvebu: Only define MV88F78X60 for Armada XP

In reply to Stefan Roese

This define is used by the DDR training code for Armada XP. With the upcoming addition of Armada 38x support, lets only define it for Armada XP in this common header.

---

 arch/arm/mach-mvebu/include/mach/config.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-mvebu/include/mach/config.h +3 -1
index 01b725b..86a0aed 100644
@@ -9,7 +9,7 @@
 /*
  * This file should be included in board config header file.
  *
- * It supports common definitions for Armada XP platforms
+ * It supports common definitions for MVEBU platforms
  */
 
 #ifndef _MVEBU_CONFIG_H
@@ -17,7 +17,9 @@
 
 #include <asm/arch/soc.h>
 
+#if defined(CONFIG_ARMADA_XP)
 #define MV88F78X60 /* for the DDR training bin_hdr code */
+#endif
 
 #define CONFIG_SYS_CACHELINE_SIZE	32
 
Signature · 1 line
2.3.3
#7 lore raw

PATCH 7/10 arm: mvebu: Move CONFIG_SPL_LDSCRIPT to common header

In reply to Stefan Roese

This way, new MVEBU boards don't need to specifiy the common location for the SPL linker script.

---

 arch/arm/mach-mvebu/include/mach/config.h | 5 +++++
 include/configs/db-mv784mp-gp.h           | 1 -
 include/configs/maxbcm.h                  | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/include/mach/config.h +5 -0
index 86a0aed..b326ec0 100644
@@ -85,4 +85,9 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 #endif
 
+/* Common SPL configuration */
+#ifndef CONFIG_SPL_LDSCRIPT
+#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-mvebu/u-boot-spl.lds"
+#endif
+
 #endif /* __MVEBU_CONFIG_H */
include/configs/db-mv784mp-gp.h +0 -1
index 860e5f6..24cd42f 100644
@@ -100,7 +100,6 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-mvebu/u-boot-spl.lds"
 
 /* SPL related SPI defines */
 #define CONFIG_SPL_SPI_SUPPORT
include/configs/maxbcm.h +0 -1
index 90b5912..496c2bd 100644
@@ -100,7 +100,6 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-mvebu/u-boot-spl.lds"
 
 /* SPL related SPI defines */
 #define CONFIG_SPL_SPI_SUPPORT
Signature · 1 line
2.3.3
#8 lore raw

PATCH 8/10 arm: mvebu: Add basic Armada 38x support

In reply to Stefan Roese

This patch adds support for the Marvell Armada 38x SoC family.

Supported peripherals are:
- UART
- Ethernet (mvneta)
- I2C
- SPI (including SPI NOR flash)

Tested on Marvell DB-88F6820-GP evaluation board.

---

 arch/arm/mach-mvebu/cpu.c              | 79 +++++++++++++++++++++++++++-------
 arch/arm/mach-mvebu/include/mach/soc.h |  7 +++
 2 files changed, 70 insertions(+), 16 deletions(-)
arch/arm/mach-mvebu/cpu.c +63 -16
index 1cf70a9..95df408 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Stefan Roese <[email protected]>
+ * Copyright (C) 2014-2015 Stefan Roese <[email protected]>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -40,6 +40,26 @@ void reset_cpu(unsigned long ignored)
 		;
 }
 
+enum {
+	MVEBU_SOC_AXP,
+	MVEBU_SOC_A38X,
+	MVEBU_SOC_UNKNOWN,
+};
+
+static int mvebu_soc_family(void)
+{
+	u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
+
+	if (devid == SOC_MV78460_ID)
+		return MVEBU_SOC_AXP;
+
+	if (devid == SOC_88F6810_ID || devid == SOC_88F6820_ID ||
+	    devid == SOC_88F6828_ID)
+		return MVEBU_SOC_A38X;
+
+	return MVEBU_SOC_UNKNOWN;
+}
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {
@@ -52,23 +72,48 @@ int print_cpuinfo(void)
 	case SOC_MV78460_ID:
 		puts("MV78460-");
 		break;
-	default:
-		puts("Unknown-");
+	case SOC_88F6810_ID:
+		puts("MV88F6810-");
 		break;
-	}
-
-	switch (revid) {
-	case 1:
-		puts("A0\n");
+	case SOC_88F6820_ID:
+		puts("MV88F6820-");
 		break;
-	case 2:
-		puts("B0\n");
+	case SOC_88F6828_ID:
+		puts("MV88F6828-");
 		break;
 	default:
-		puts("??\n");
+		puts("Unknown-");
 		break;
 	}
 
+	if (mvebu_soc_family() == MVEBU_SOC_AXP) {
+		switch (revid) {
+		case 1:
+			puts("A0\n");
+			break;
+		case 2:
+			puts("B0\n");
+			break;
+		default:
+			printf("?? (%x)\n", revid);
+			break;
+		}
+	}
+
+	if (mvebu_soc_family() == MVEBU_SOC_A38X) {
+		switch (revid) {
+		case MV_88F68XX_Z1_ID:
+			puts("Z1\n");
+			break;
+		case MV_88F68XX_A0_ID:
+			puts("A0\n");
+			break;
+		default:
+			printf("?? (%x)\n", revid);
+			break;
+		}
+	}
+
 	return 0;
 }
 #endif /* CONFIG_DISPLAY_CPUINFO */
@@ -145,11 +190,13 @@ int arch_cpu_init(void)
 	 */
 	mvebu_mbus_probe(NULL, 0);
 
-	/*
-	 * Now the SDRAM access windows can be reconfigured using
-	 * the information in the SDRAM scratch pad registers
-	 */
-	update_sdram_window_sizes();
+	if (mvebu_soc_family() == MVEBU_SOC_AXP) {
+		/*
+		 * Now the SDRAM access windows can be reconfigured using
+		 * the information in the SDRAM scratch pad registers
+		 */
+		update_sdram_window_sizes();
+	}
 
 	/*
 	 * Finally the mbus windows can be configured with the
arch/arm/mach-mvebu/include/mach/soc.h +7 -0
index f3e0398..212948f 100644
@@ -12,6 +12,13 @@
 #define _MVEBU_SOC_H
 
 #define SOC_MV78460_ID		0x7846
+#define SOC_88F6810_ID		0x6810
+#define SOC_88F6820_ID		0x6820
+#define SOC_88F6828_ID		0x6828
+
+/* A38x revisions */
+#define MV_88F68XX_Z1_ID	0x0
+#define MV_88F68XX_A0_ID	0x4
 
 /* TCLK Core Clock definition */
 #ifndef CONFIG_SYS_TCLK
Signature · 1 line
2.3.3
#9 lore raw

PATCH 9/10 arm: mvebu: Change network init code to allow a more flexible setup

In reply to Stefan Roese

With the introduction of the Armada 38x support, its necessary to change the mvneta ethernet driver init call from always 4 times to a configurable value. Lets make this init call more flexible by moving the actually used devices to the config header.

Additionally this patch takes care of the slightly different base addresses for the ethernet controllers on A38x.

---

 arch/arm/mach-mvebu/cpu.c                   | 20 ++++++++++++++++----
 board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c |  3 ++-
 include/configs/db-mv784mp-gp.h             |  2 +-
 include/configs/maxbcm.h                    |  2 +-
 4 files changed, 20 insertions(+), 7 deletions(-)
arch/arm/mach-mvebu/cpu.c +16 -4
index 95df408..79fccb7 100644
@@ -222,10 +222,22 @@ int arch_misc_init(void)
 #ifdef CONFIG_MVNETA
 int cpu_eth_init(bd_t *bis)
 {
-	mvneta_initialize(bis, MVEBU_EGIGA0_BASE, 0, CONFIG_PHY_BASE_ADDR + 0);
-	mvneta_initialize(bis, MVEBU_EGIGA1_BASE, 1, CONFIG_PHY_BASE_ADDR + 1);
-	mvneta_initialize(bis, MVEBU_EGIGA2_BASE, 2, CONFIG_PHY_BASE_ADDR + 2);
-	mvneta_initialize(bis, MVEBU_EGIGA3_BASE, 3, CONFIG_PHY_BASE_ADDR + 3);
+	u32 enet_base[] = { MVEBU_EGIGA0_BASE, MVEBU_EGIGA1_BASE,
+			    MVEBU_EGIGA2_BASE, MVEBU_EGIGA3_BASE };
+	u8 phy_addr[] = CONFIG_PHY_ADDR;
+	int i;
+
+	/*
+	 * Only Armada XP supports all 4 ethernet interfaces. A38x has
+	 * slightly different base addresses for its 2-3 interfaces.
+	 */
+	if (mvebu_soc_family() != MVEBU_SOC_AXP) {
+		enet_base[1] = MVEBU_EGIGA2_BASE;
+		enet_base[2] = MVEBU_EGIGA3_BASE;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(phy_addr); i++)
+		mvneta_initialize(bis, enet_base[i], i, phy_addr[i]);
 
 	return 0;
 }
board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c +2 -1
index b3dae89..00ca878 100644
@@ -86,7 +86,8 @@ int checkboard(void)
 /* Configure and enable MV88E1545 PHY */
 void reset_phy(void)
 {
-	u16 devadr = CONFIG_PHY_BASE_ADDR;
+	u8 phy_addr[] = CONFIG_PHY_ADDR;
+	u16 devadr = phy_addr[0];
 	char *name = "neta0";
 	u16 reg;
 
include/configs/db-mv784mp-gp.h +1 -1
index 24cd42f..8b94454 100644
@@ -53,7 +53,7 @@
 #define CONFIG_ENV_SECT_SIZE		(64 << 10) /* 64KiB sectors */
 
 #define CONFIG_PHY_MARVELL		/* there is a marvell phy */
-#define CONFIG_PHY_BASE_ADDR	0x10
+#define CONFIG_PHY_ADDR			{ 0x10, 0x11, 0x12, 0x13 }
 #define CONFIG_SYS_NETA_INTERFACE_TYPE	PHY_INTERFACE_MODE_QSGMII
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
 #define CONFIG_RESET_PHY_R
include/configs/maxbcm.h +1 -1
index 496c2bd..db6a400 100644
@@ -53,7 +53,7 @@
 #define CONFIG_ENV_SECT_SIZE		(64 << 10) /* 64KiB sectors */
 
 #define CONFIG_PHY_MARVELL		/* there is a marvell phy */
-#define CONFIG_PHY_BASE_ADDR	0x0
+#define CONFIG_PHY_ADDR			{ 0x0, 0x1, 0x2, 0x3 }
 #define CONFIG_SYS_NETA_INTERFACE_TYPE	PHY_INTERFACE_MODE_SGMII
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
 #define CONFIG_RESET_PHY_R
Signature · 1 line
2.3.3
#10 lore raw

PATCH 10/10 arm: mvebu: Add Armada A38x DB-88F6820-GP board support

In reply to Stefan Roese

This patch adds support for the Marvell DB-88F6820-GP Armada A38x evaluation board.

Supported peripherals are:
- UART
- Ethernet (mvneta)
- I2C
- SPI (including SPI NOR flash)

Please note that this board support right now only supports the main U-Boot. Without the bin_hdr integration (DDR training etc). This will be added in a few days / weeks to complete this board port. But till then this U-Boot version can be run on the target via the original Marvell U-Boot via this command:

tftpboot 4000000 db-88f6820-gp/u-boot.bin;go 4000000

---

 arch/arm/Kconfig                            |  6 +++
 board/Marvell/db-88f6820-gp/Kconfig         | 15 ++++++
 board/Marvell/db-88f6820-gp/Makefile        |  7 +++
 board/Marvell/db-88f6820-gp/binary.0        | 16 ++++++
 board/Marvell/db-88f6820-gp/db-88f6820-gp.c | 78 +++++++++++++++++++++++++++++
 board/Marvell/db-88f6820-gp/kwbimage.cfg    | 12 +++++
 configs/db-88f6820-gp_defconfig             |  2 +
 include/configs/db-88f6820-gp.h             | 69 +++++++++++++++++++++++++
 8 files changed, 205 insertions(+)
 create mode 100644 board/Marvell/db-88f6820-gp/Kconfig
 create mode 100644 board/Marvell/db-88f6820-gp/Makefile
 create mode 100644 board/Marvell/db-88f6820-gp/binary.0
 create mode 100644 board/Marvell/db-88f6820-gp/db-88f6820-gp.c
 create mode 100644 board/Marvell/db-88f6820-gp/kwbimage.cfg
 create mode 100644 configs/db-88f6820-gp_defconfig
 create mode 100644 include/configs/db-88f6820-gp.h
arch/arm/Kconfig +6 -0
index b9ebee1..cd728d9 100644
@@ -118,6 +118,11 @@ config KIRKWOOD
 	bool "Marvell Kirkwood"
 	select CPU_ARM926EJS
 
+config TARGET_DB_88F6820_GP
+	bool "Support DB-88F6820-GP"
+	select CPU_V7
+	select SUPPORT_SPL
+
 config TARGET_DB_MV784MP_GP
 	bool "Support db-mv784mp-gp"
 	select CPU_V7
@@ -766,6 +771,7 @@ source "board/BuR/kwb/Kconfig"
 source "board/BuR/tseries/Kconfig"
 source "board/CarMediaLab/flea3/Kconfig"
 source "board/Marvell/aspenite/Kconfig"
+source "board/Marvell/db-88f6820-gp/Kconfig"
 source "board/Marvell/db-mv784mp-gp/Kconfig"
 source "board/Marvell/gplugd/Kconfig"
 source "board/altera/socfpga/Kconfig"
board/Marvell/db-88f6820-gp/Kconfig new file +15 -0
new file mode 100644
index 0000000..b2e9115
@@ -0,0 +1,15 @@
+if TARGET_DB_88F6820_GP
+
+config SYS_BOARD
+	default "db-88f6820-gp"
+
+config SYS_VENDOR
+	default "Marvell"
+
+config SYS_SOC
+	default "mvebu"
+
+config SYS_CONFIG_NAME
+	default "db-88f6820-gp"
+
+endif
board/Marvell/db-88f6820-gp/Makefile new file +7 -0
new file mode 100644
index 0000000..58d40dd
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2015 Stefan Roese <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= db-88f6820-gp.o
board/Marvell/db-88f6820-gp/binary.0 new file +16 -0
new file mode 100644
index 0000000..57a4cbf
@@ -0,0 +1,16 @@
+--------
+WARNING:
+--------
+This file should contain the bin_hdr generated by the original Marvell
+U-Boot implementation. As this is currently not included in this
+U-Boot version, we have added this placeholder, so that the U-Boot
+image can be generated without errors.
+
+If you have a known to be working bin_hdr for your board, then you
+just need to replace this text file here with the binary header
+and recompile U-Boot.
+
+In a few weeks, mainline U-Boot will get support to generate the
+bin_hdr with the DDR training code itself. By implementing this code
+as SPL U-Boot. Then this file will not be needed any more and will
+get removed.
board/Marvell/db-88f6820-gp/db-88f6820-gp.c new file +78 -0

78 lines not on this page · raw message

board/Marvell/db-88f6820-gp/kwbimage.cfg new file +12 -0
new file mode 100644
index 0000000..e812454
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2014 Stefan Roese <[email protected]>
+#
+
+# Armada XP uses version 1 image format
+VERSION		1
+
+# Boot Media configurations
+BOOT_FROM	spi
+
+# Binary Header (bin_hdr) with DDR3 training code
+BINARY board/Marvell/db-88f6820-gp/binary.0 0000005b 00000068
configs/db-88f6820-gp_defconfig new file +2 -0
new file mode 100644
index 0000000..0d6f0de
@@ -0,0 +1,2 @@
+CONFIG_ARM=y
+CONFIG_TARGET_DB_88F6820_GP=y
include/configs/db-88f6820-gp.h new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
2.3.3
#11 lore raw

PATCH 10/10 arm: mvebu: Add Armada A38x DB-88F6820-GP board support

Hi Stefan,

include/configs/db-88f6820-gp.h line 53

Quoted 6 lines · Stefan Roese
include/configs/db-88f6820-gp.h new file +5 -0
+/* Environment in SPI NOR flash */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET		(1 << 20) /* 1MiB in */
+#define CONFIG_ENV_SIZE			(64 << 10) /* 64KiB */
+#define CONFIG_ENV_SECT_SIZE		(64 << 10) /* 64KiB sectors */

The M25P128 SPI flash chip on the DB-88F6820-GP board has 1024-page sectors, so these will need to be 256KiB instead of 64. Otherwise the SF driver complains when trying to "saveenv".

Regards,
Kevin

#12 lore raw

PATCH 10/10 arm: mvebu: Add Armada A38x DB-88F6820-GP board support

Hi Kevin,

Quoted 10 lines · Kevin Smith

include/configs/db-88f6820-gp.h line 53

Quoted 6 lines · Stefan Roese
include/configs/db-88f6820-gp.h new file +5 -0
+/* Environment in SPI NOR flash */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET		(1 << 20) /* 1MiB in */
+#define CONFIG_ENV_SIZE			(64 << 10) /* 64KiB */
+#define CONFIG_ENV_SECT_SIZE		(64 << 10) /* 64KiB sectors */

The M25P128 SPI flash chip on the DB-88F6820-GP board has 1024-page sectors, so these will need to be 256KiB instead of 64. Otherwise the SF driver complains when trying to "saveenv".

Thanks for noticing this. I didn't write to the env yet in the new U-Boot. I'll incorporate this change in the next version.

Thanks,
Stefan