From eee4835d22e96d517f60a8260f002abe4a5d16d8 Mon Sep 17 00:00:00 2001 From: Konstantin Porotchkin Date: Thu, 30 Nov 2017 16:10:09 +0200 Subject: [PATCH 1/9] tools: Add Marvell recovery image download script Introduce the recovery image download script for usage with Marvell Armada SoC families (excepting 37xx family). Since Marvell BootROM uses a sliding window in UART buffer for detecting escape sequence during the boot, it's easier to interrupt the normal boot flow by sending a long stream of chained escape sequences to the serial port instead of periodically sending a single escape sequence as it is done by kwboot utility. Additional benefit of using this script is the ability to adjust the escape sequence stream length withoiut need for compilation. Signed-off-by: Konstantin Porotchkin Cc: Stefan Roese Cc: Igal Liberman Signed-off-by: Stefan Roese --- tools/mrvl_uart.sh | 119 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 tools/mrvl_uart.sh diff --git a/tools/mrvl_uart.sh b/tools/mrvl_uart.sh new file mode 100755 index 0000000000..6b04d7ae2c --- /dev/null +++ b/tools/mrvl_uart.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# +###################################################### +# Copyright (C) 2016 Marvell International Ltd. +# +# SPDX-License-Identifier: GPL-2.0 +# https://spdx.org/licenses +# +# Author: Konstantin Porotchkin kostap@marvell.com +# +# Version 0.3 +# +# UART recovery downloader for Armada SoCs +# +###################################################### + +port=$1 +file=$2 +speed=$3 + +pattern_repeat=1500 +default_baudrate=115200 +tmpfile=/tmp/xmodem.pattern +tools=( dd stty sx minicom ) + +case "$3" in + 2) + fast_baudrate=230400 + prefix="\xF2" + ;; + 4) + fast_baudrate=460800 + prefix="\xF4" + ;; + 8) + fast_baudrate=921600 + prefix="\xF8" + ;; + *) + fast_baudrate=$default_baudrate + prefix="\xBB" +esac + +if [[ -z "$port" || -z "$file" ]] +then + echo -e "\nMarvell recovery image downloader for Armada SoC family." + echo -e "Command syntax:" + echo -e "\t$(basename $0) [2|4|8]" + echo -e "\tport - serial port the target board connected to" + echo -e "\tfile - recovery boot image for target download" + echo -e "\t2|4|8 - times to increase the default serial port speed by" + echo -e "For example - load the image over ttyUSB0 @ 460800 baud:" + echo -e "$(basename $0) /dev/ttyUSB0 /tmp/flash-image.bin 4\n" + echo -e "=====WARNING=====" + echo -e "- The speed-up option is not awailable in SoC families prior to A8K+" + echo -e "- This utility is not compatible with Armada 37xx SoC family\n" +fi + +# Sanity checks +if [ -c "$port" ] +then + echo -e "Using device connected on serial port \"$port\"" +else + echo "Wrong serial port name!" + exit 1 +fi + +if [ -f "$file" ] +then + echo -e "Loading flash image file \"$file\"" +else + echo "File $file does not exist!" + exit 1 +fi + +# Verify required tools installation +for tool in ${tools[@]} +do + toolname=`which $tool` + if [ -z "$toolname" ] + then + echo -e "Missing installation of \"$tool\" --> Exiting" + exit 1 + fi +done + + +echo -e "Recovery will run at $fast_baudrate baud" +echo -e "========================================" + +if [ -f "$tmpfile" ] +then + rm -f $tmpfile +fi + +# Send the escape sequence to target board using default debug port speed +stty -F $port raw ignbrk time 5 $default_baudrate +counter=0 +while [ $counter -lt $pattern_repeat ]; do + echo -n -e "$prefix\x11\x22\x33\x44\x55\x66\x77" >> $tmpfile + let counter=counter+1 +done + +echo -en "Press the \"Reset\" button on the target board and " +echo -en "the \"Enter\" key on the host keyboard simultaneously" +read +dd if=$tmpfile of=$port &>/dev/null + +# Speed up the binary image transfer +stty -F $port raw ignbrk time 5 $fast_baudrate +sx -vv $file > $port < $port +#sx-at91 $port $file + +# return the port to the default speed +stty -F $port raw ignbrk time 5 $default_baudrate + +# Optional - fire up Minicom +minicom -D $port + From d7da5707705dbec3c524b60a224d57ddda8b9618 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 2 Dec 2017 10:46:34 +0100 Subject: [PATCH 2/9] arm64: a37xx: use disto defaults Signed-off-by: Andre Heider Reviewed-by: Konstantin Porotchkin Signed-off-by: Stefan Roese --- include/configs/mvebu_armada-37xx.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index af16b9454a..6aaf04edbe 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -44,9 +44,6 @@ /* * Other required minimal configurations */ -#define CONFIG_SYS_LONGHELP -#define CONFIG_AUTO_COMPLETE -#define CONFIG_CMDLINE_EDITING #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */ #define CONFIG_SYS_LOAD_ADDR 0x00800000 /* default load adr- 8M */ #define CONFIG_SYS_MEMTEST_START 0x00800000 /* 8M */ @@ -107,4 +104,6 @@ #define CONFIG_SUPPORT_VFAT +#include + #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */ From e1489ba89d4df187aed7e176227f47412c583002 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 2 Dec 2017 10:46:35 +0100 Subject: [PATCH 3/9] arm64: a37xx: add distro compatible env vars the values of dt_addr_r/kernel_addr_r/ramdisk_addr_r are taken from the downstream 'u-boot-2017.03-armada-17.10' release. the chosen values of scriptaddr and pxefile_addr_r are below fdt_addr_r, in 1MB steps. Signed-off-by: Andre Heider Reviewed-by: Konstantin Porotchkin Signed-off-by: Stefan Roese --- include/configs/mvebu_armada-37xx.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 6aaf04edbe..c7ccc6ef5e 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -106,4 +106,11 @@ #include +#define CONFIG_EXTRA_ENV_SETTINGS \ + "scriptaddr=0x4d00000\0" \ + "pxefile_addr_r=0x4e00000\0" \ + "fdt_addr_r=0x4f00000\0" \ + "kernel_addr_r=0x5000000\0" \ + "ramdisk_addr_r=0x8000000" + #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */ From e4e18a8acbadcbf95262867aefb33a16c4f432b4 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 2 Dec 2017 10:46:36 +0100 Subject: [PATCH 4/9] arm64: a37xx: defconfigs: enable CONFIG_DISTRO_DEFAULTS Signed-off-by: Andre Heider Reviewed-by: Konstantin Porotchkin Signed-off-by: Stefan Roese --- configs/mvebu_db-88f3720_defconfig | 1 + configs/mvebu_espressobin-88f3720_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/mvebu_db-88f3720_defconfig b/configs/mvebu_db-88f3720_defconfig index 283a964f24..5a41c5c273 100644 --- a/configs/mvebu_db-88f3720_defconfig +++ b/configs/mvebu_db-88f3720_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_MVEBU_ARMADA_37XX=y CONFIG_DEFAULT_DEVICE_TREE="armada-3720-db" +CONFIG_DISTRO_DEFAULTS=y CONFIG_DEBUG_UART=y CONFIG_AHCI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index d99c4f52d9..17043c2680 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_MVEBU_ARMADA_37XX=y CONFIG_DEFAULT_DEVICE_TREE="armada-3720-espressobin" +CONFIG_DISTRO_DEFAULTS=y CONFIG_DEBUG_UART=y CONFIG_AHCI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set From 6779d65b9f2256ecbfe957a7dd7c8de38f7f8126 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 2 Dec 2017 10:46:37 +0100 Subject: [PATCH 5/9] arm64: a37xx: use distro bootcmd Signed-off-by: Andre Heider Reviewed-by: Konstantin Porotchkin Signed-off-by: Stefan Roese --- include/configs/mvebu_armada-37xx.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index c7ccc6ef5e..9f2db099cd 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -106,11 +106,22 @@ #include +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 0) \ + func(USB, usb, 0) \ + func(SCSI, scsi, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +#include + #define CONFIG_EXTRA_ENV_SETTINGS \ "scriptaddr=0x4d00000\0" \ "pxefile_addr_r=0x4e00000\0" \ "fdt_addr_r=0x4f00000\0" \ "kernel_addr_r=0x5000000\0" \ - "ramdisk_addr_r=0x8000000" + "ramdisk_addr_r=0x8000000\0" \ + BOOTENV #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */ From 0f70d705cf359b6217db1bca5ee7e1c03dc85dea Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 23 Dec 2017 01:42:48 +0100 Subject: [PATCH 6/9] arm: mvebu: ClearFog: document boot selection switches, update UART Signed-off-by: Florian Klink Signed-off-by: Stefan Roese --- board/solidrun/clearfog/README | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README index ef1e3bf426..a7bc0d4e23 100644 --- a/board/solidrun/clearfog/README +++ b/board/solidrun/clearfog/README @@ -17,16 +17,29 @@ $ sudo dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1 Please use the correct device node for your setup instead of "/dev/sdX" here! +Boot selection: +--------------- + +Before powering up the board, boot selection should be done via the SW1 dip +switch (0: OFF, 1: ON): + + - SPI: 00010 + - SD/eMMC: 00111 + - M.2 SSD: 11100 + - UART: 01001 [1] + +[1]: According to SolidRun's manual, 11110 should be used for UART booting on + the ClearFog 'Pro' variant. + However, this doesn't work (anymore) at least on Rev. 2.1 (but '01001' as + mentionend for the 'Base' variant does). + Boot from UART: --------------- Connect the on-board micro-USB (CF Pro: CON11, CF Base: CON5) to your host. -Set the SW1 DIP switches to UART boot (0: OFF, 1: ON): - - ClearFog Base: 01001 - ClearFog Pro: 11110 +Set the SW1 DIP switches to UART boot (see above). Run the following command to initiate U-Boot download: From e7ab2ccd154215a91d29153e68cb706a1057e17f Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Thu, 28 Dec 2017 15:43:09 +0100 Subject: [PATCH 7/9] ARM: mvebu: Allow MVNETA to be selected with Armada 3700 SoCs Until now, Armada 3700 SoCs could not enable the mvneta driver, and thus did not benefit from Ethernet support. Add ARMADA_3700 in the "depends on" list of the MVNETA Kconfig entry. Signed-off-by: Miquel Raynal Acked-by: Joe Hershberger Signed-off-by: Stefan Roese --- drivers/net/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index d42d915f17..ee1cc3ab24 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -160,12 +160,12 @@ config FTMAC100 This MAC is present in Andestech SoCs. config MVNETA - bool "Marvell Armada 385 network interface support" - depends on ARMADA_XP || ARMADA_38X + bool "Marvell Armada XP/385/3700 network interface support" + depends on ARMADA_XP || ARMADA_38X || ARMADA_3700 select PHYLIB help This driver supports the network interface units in the - Marvell ARMADA XP and 38X SoCs + Marvell ARMADA XP, ARMADA 38X and ARMADA 3700 SoCs config MVPP2 bool "Marvell Armada 375/7K/8K network interface support" From 3f3946d30daf9a2dc66d03c6b2b3959ffb18ac40 Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 29 Dec 2017 15:31:56 +0100 Subject: [PATCH 8/9] pinctrl: mvebu: Make drivers depend on the pinctrl framework Armada pinctrl drivers shall not be compiled without the entire pinctrl framework and thus lack a "depends on" condition, otherwise the driver will simply not be probed. Signed-off-by: Miquel Raynal Signed-off-by: Stefan Roese --- drivers/pinctrl/mvebu/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mvebu/Kconfig b/drivers/pinctrl/mvebu/Kconfig index a9388ff7e2..07d4f3e216 100644 --- a/drivers/pinctrl/mvebu/Kconfig +++ b/drivers/pinctrl/mvebu/Kconfig @@ -1,14 +1,14 @@ if ARCH_MVEBU config PINCTRL_ARMADA_37XX - depends on ARMADA_3700 + depends on ARMADA_3700 && PINCTRL_FULL bool "Armada 37xx pin control driver" help Support pin multiplexing and pin configuration control on Marvell's Armada-37xx SoC. config PINCTRL_ARMADA_8K - depends on ARMADA_8K + depends on ARMADA_8K && PINCTRL_FULL bool "Armada 7k/8k pin control driver" help Support pin multiplexing and pin configuration control on From 0a05bf42b462c0fd0299c768560c5ad532cdf619 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Mon, 8 Jan 2018 16:17:12 +1300 Subject: [PATCH 9/9] ARM: mvebu: correct reference for "ethernet1" on DB-88F6820-AMC The DB-88F6820-AMC connects ethernet@34000 and ethernet@70000 which are labeled as eth2 and eth0 in armada-38x.dts. The ethernet@30000 (eth1) is not used on the AMC board. This eliminates the following bootup message Device 'ethernet@70000': seq 0 is in use by 'ethernet@34000' Signed-off-by: Chris Packham Signed-off-by: Stefan Roese --- arch/arm/dts/armada-385-amc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/armada-385-amc.dts b/arch/arm/dts/armada-385-amc.dts index 5e1588d574..d4d127fa02 100644 --- a/arch/arm/dts/armada-385-amc.dts +++ b/arch/arm/dts/armada-385-amc.dts @@ -53,7 +53,7 @@ aliases { ethernet0 = ð0; - ethernet1 = ð1; + ethernet1 = ð2; i2c0 = &i2c0; spi1 = &spi1; };