summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-05-10 18:15:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-10 18:15:50 +0200
commit892f2cde39d538f678f2781502fd4417634378f5 (patch)
tree1f858c3530583c56ca9ff7b64b05e7df25eb9b73
parent066794f82b3355bd8302bdbb898569ee6fafcb0a (diff)
parent2a9a2ea03c6bf70ccec01cfa53337da379e7057f (diff)
downloadbarebox-892f2cde39d538f678f2781502fd4417634378f5.tar.gz
Merge branch 'for-next/mvebu'
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/marvell-armada-xp-db/Makefile2
-rw-r--r--arch/arm/boards/marvell-armada-xp-db/board.c31
-rw-r--r--arch/arm/boards/marvell-armada-xp-db/kwbimage.cfg3
-rw-r--r--arch/arm/boards/marvell-armada-xp-db/lowlevel.c33
-rw-r--r--arch/arm/configs/mvebu_defconfig21
-rw-r--r--arch/arm/dts/Makefile2
-rw-r--r--arch/arm/dts/armada-xp-db-bb.dts12
-rw-r--r--arch/arm/mach-mvebu/Kconfig4
-rw-r--r--images/Makefile.mvebu8
10 files changed, 105 insertions, 12 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 91f1737..cbd6bd1 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_MACH_LENOVO_IX4_300D) += lenovo-ix4-300d/
obj-$(CONFIG_MACH_LUBBOCK) += lubbock/
obj-$(CONFIG_MACH_MAINSTONE) += mainstone/
obj-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += marvell-armada-xp-gp/
+obj-$(CONFIG_MACH_MARVELL_ARMADA_XP_DB) += marvell-armada-xp-db/
obj-$(CONFIG_MACH_MB7707) += module-mb7707/
obj-$(CONFIG_MACH_MIOA701) += mioa701/
obj-$(CONFIG_MACH_MX23EVK) += freescale-mx23-evk/
diff --git a/arch/arm/boards/marvell-armada-xp-db/Makefile b/arch/arm/boards/marvell-armada-xp-db/Makefile
new file mode 100644
index 0000000..01c7a25
--- /dev/null
+++ b/arch/arm/boards/marvell-armada-xp-db/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/marvell-armada-xp-db/board.c b/arch/arm/boards/marvell-armada-xp-db/board.c
new file mode 100644
index 0000000..4591c6b
--- /dev/null
+++ b/arch/arm/boards/marvell-armada-xp-db/board.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright
+ * (C) 2019 Sascha Hauer <s.hauer@pengutronix.de>
+ */
+
+#include <common.h>
+#include <init.h>
+#include <io.h>
+
+static int pinctrl_init(void)
+{
+ if (!of_machine_is_compatible("marvell,axp-db"))
+ return 0;
+
+ /* IOMUX setup for the poor */
+ writel(0x11111111, 0xf1018000);
+ writel(0x22221111, 0xf1018004);
+ writel(0x22222222, 0xf1018008);
+ writel(0x11040000, 0xf101800c);
+ writel(0x11111111, 0xf1018010);
+ writel(0x04221130, 0xf1018014);
+ writel(0x11111113, 0xf1018018);
+ writel(0x11111101, 0xf101801c);
+
+ writel(0x7fffffe1, 0xf1020184);
+ writel(0x00010008, 0xf1020258);
+
+ return 0;
+}
+coredevice_initcall(pinctrl_init);
diff --git a/arch/arm/boards/marvell-armada-xp-db/kwbimage.cfg b/arch/arm/boards/marvell-armada-xp-db/kwbimage.cfg
new file mode 100644
index 0000000..28e60e2
--- /dev/null
+++ b/arch/arm/boards/marvell-armada-xp-db/kwbimage.cfg
@@ -0,0 +1,3 @@
+VERSION 1
+BOOT_FROM uart
+BINARY ./binary.0 0000005b 00000000
diff --git a/arch/arm/boards/marvell-armada-xp-db/lowlevel.c b/arch/arm/boards/marvell-armada-xp-db/lowlevel.c
new file mode 100644
index 0000000..4752bbf
--- /dev/null
+++ b/arch/arm/boards/marvell-armada-xp-db/lowlevel.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright
+ * (C) 2019 Sascha Hauer <s.hauer@pengutronix.de>
+ */
+
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/lowlevel.h>
+#include <io.h>
+
+extern char __dtb_armada_xp_db_bb_start[];
+
+ENTRY_FUNCTION(start_marvell_armada_xp_db, r0, r1, r2)
+{
+ void *fdt;
+ uint32_t reg;
+ void __iomem *base = mvebu_get_initial_int_reg_base();
+
+ arm_cpu_lowlevel_init();
+
+ /* enable L2 parity and ECC */
+#define L2_AUX_CONTRL_ADDRESS (base + 0x8104)
+ reg = readl(L2_AUX_CONTRL_ADDRESS);
+ reg |= 3 << 20;
+ writel(0x1a09ef00, L2_AUX_CONTRL_ADDRESS);
+
+ fdt = __dtb_armada_xp_db_bb_start + get_runtime_offset();
+
+ armada_370_xp_barebox_entry(fdt);
+}
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index cfbccb5..c830cf2 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -2,8 +2,11 @@ CONFIG_ARCH_MVEBU=y
CONFIG_MACH_GLOBALSCALE_MIRABOX=y
CONFIG_MACH_NETGEAR_RN104=y
CONFIG_MACH_LENOVO_IX4_300D=y
+CONFIG_MACH_MARVELL_ARMADA_XP_DB=y
CONFIG_MACH_MARVELL_ARMADA_XP_GP=y
+CONFIG_MACH_NETGEAR_RN2120=y
CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3=y
+CONFIG_MACH_TURRIS_OMNIA=y
CONFIG_MACH_SOLIDRUN_CUBOX=y
CONFIG_MACH_GLOBALSCALE_GURUPLUG=y
CONFIG_MACH_PLATHOME_OPENBLOCKS_A6=y
@@ -11,7 +14,6 @@ CONFIG_MACH_USI_TOPKICK=y
CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x0
CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_TLSF=y
CONFIG_KALLSYMS=y
@@ -26,48 +28,43 @@ CONFIG_BOOTM_INITRD=y
CONFIG_BOOTM_OFTREE=y
CONFIG_BOOTM_OFTREE_UIMAGE=y
CONFIG_BLSPEC=y
-CONFIG_FLEXIBLE_BOOTARGS=y
CONFIG_IMD_TARGET=y
CONFIG_CONSOLE_ACTIVATE_NONE=y
+CONFIG_CONSOLE_ALLOW_COLOR=y
+CONFIG_PBL_CONSOLE=y
CONFIG_PARTITION_DISK_EFI=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_CMD_DMESG=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
CONFIG_CMD_IMD=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_ARM_MMUINFO=y
-CONFIG_CMD_BOOT=y
CONFIG_CMD_GO=y
CONFIG_CMD_LOADS=y
CONFIG_CMD_LOADY=y
CONFIG_CMD_RESET=y
CONFIG_CMD_UIMAGE=y
CONFIG_CMD_PARTITION=y
-CONFIG_CMD_AUTOMOUNT=y
CONFIG_CMD_EXPORT=y
-CONFIG_CMD_GLOBAL=y
CONFIG_CMD_LOADENV=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_MAGICVAR=y
CONFIG_CMD_MAGICVAR_HELP=y
CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_BASENAME=y
-CONFIG_CMD_DIRNAME=y
CONFIG_CMD_FILETYPE=y
CONFIG_CMD_LN=y
CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_READLINK=y
CONFIG_CMD_SHA1SUM=y
CONFIG_CMD_SHA224SUM=y
CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_GETOPT=y
CONFIG_CMD_LET=y
CONFIG_CMD_MSLEEP=y
CONFIG_CMD_READF=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_DHCP=y
-CONFIG_CMD_HOST=y
-CONFIG_NET_CMD_IFUP=y
+CONFIG_CMD_MIITOOL=y
CONFIG_CMD_PING=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_EDIT=y
@@ -80,6 +77,8 @@ CONFIG_CMD_CRC=y
CONFIG_CMD_CRC_CMP=y
CONFIG_CMD_CLK=y
CONFIG_CMD_DETECT=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_LED=y
CONFIG_CMD_SPI=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index be3edbb..c329235 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -35,7 +35,7 @@ pbl-dtb-$(CONFIG_MACH_GW_VENTANA) += imx6q-gw54xx.dtb.o
pbl-dtb-$(CONFIG_MACH_KONTRON_SAMX6I) += imx6q-samx6i.dtb.o \
imx6dl-samx6i.dtb.o
pbl-dtb-$(CONFIG_MACH_LENOVO_IX4_300D) += armada-xp-lenovo-ix4-300d-bb.dtb.o
-pbl-dtb-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += armada-xp-gp-bb.dtb.o
+pbl-dtb-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += armada-xp-gp-bb.dtb.o armada-xp-db-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_NETGEAR_RN104) += armada-370-rn104-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_NETGEAR_RN2120) += armada-xp-rn2120-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_NITROGEN6) += imx6q-nitrogen6x.dtb.o imx6dl-nitrogen6x.dtb.o imx6qp-nitrogen6_max.dtb.o
diff --git a/arch/arm/dts/armada-xp-db-bb.dts b/arch/arm/dts/armada-xp-db-bb.dts
new file mode 100644
index 0000000..7201f4a
--- /dev/null
+++ b/arch/arm/dts/armada-xp-db-bb.dts
@@ -0,0 +1,12 @@
+/*
+ * Barebox specific DT overlay for Marvell Armada XP DB-MV784MP-GP
+ * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+ */
+
+#include "arm/armada-xp-db.dts"
+
+/ {
+ chosen {
+ stdout-path = "/soc/internal-regs/serial@12000";
+ };
+};
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index ad97e83..bab22f0 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -56,6 +56,10 @@ config MACH_LENOVO_IX4_300D
bool "Lenovo Iomega ix4-300d"
select ARCH_ARMADA_XP
+config MACH_MARVELL_ARMADA_XP_DB
+ bool "Marvell Armada XP DB"
+ select ARCH_ARMADA_XP
+
config MACH_MARVELL_ARMADA_XP_GP
bool "Marvell Armada XP GP"
select ARCH_ARMADA_XP
diff --git a/images/Makefile.mvebu b/images/Makefile.mvebu
index 8d6a5bd..846dd46 100644
--- a/images/Makefile.mvebu
+++ b/images/Makefile.mvebu
@@ -43,6 +43,14 @@ pblb-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += start_marvell_armada_xp_gp
image-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += barebox-marvell-armada-xp-gp.img
image-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += barebox-marvell-armada-xp-gp-2nd.img
+MARVELL_ARMADA_XP_DB_KWBOPTS = ${KWBOPTS} -i $(board)/marvell-armada-xp-db/kwbimage.cfg
+OPTS_start_marvell_armada_xp_db.pblb.kwbimg = $(MARVELL_ARMADA_XP_DB_KWBOPTS)
+FILE_barebox-marvell-armada-xp-db.img = start_marvell_armada_xp_db.pblb.kwbimg
+FILE_barebox-marvell-armada-xp-db-2nd.img = start_marvell_armada_xp_db.pblb
+pblb-$(CONFIG_MACH_MARVELL_ARMADA_XP_DB) += start_marvell_armada_xp_db
+image-$(CONFIG_MACH_MARVELL_ARMADA_XP_DB) += barebox-marvell-armada-xp-db.img
+image-$(CONFIG_MACH_MARVELL_ARMADA_XP_DB) += barebox-marvell-armada-xp-db-2nd.img
+
NETGEAR_RN2120_KWBOPTS = ${KWBOPTS} -i $(board)/netgear-rn2120/kwbimage.cfg
OPTS_start_netgear_rn2120.pblb.kwbimg = $(NETGEAR_RN2120_KWBOPTS)
FILE_barebox-netgear-rn2120.img = start_netgear_rn2120.pblb.kwbimg