Bug#839595: flash-kernel: Please add support for SolidRun Clearfog
On Mon, Oct 03, 2016 at 05:53:14PM +0200, Christoph Egger wrote:
> Karsten Merker <merker@debian.org> writes:
> > The attached patch enables CONFIG_DISTRO_DEFAULTS and includes
> > the necessary headers to define the common environment (only
> > build-tested due to lack of appropriate hardware). One thing
> > that is still missing in the patch is the definition of various
> > default load addresses (fdt_addr_r, ramdisk_addr_r,
> > kernel_addr_r, pxefile_addr_r, scriptaddr). Is there an
> > "official" list of the standard load addresses for this platform
> > so that I could add them to the patch?
>
> I don't know any
>
> > Could you please build u-boot with the attached patch and
> > send the output of "env default -f -a; printenv"?
>
> => env default -f -a
> ## Resetting to default environment
> => printenv
> arch=arm
> baudrate=115200
> board=clearfog
> board_name=clearfog
> bootcmd=run distro_bootcmd
> bootdelay=3
> cpu=armv7
> fdt_high=0x10000000
> initrd_high=0x10000000
> soc=mvebu
> vendor=solidrun
>
> Environment size: 201/65532 bytes
Ok, that's only a part of what I had originally intended.
Attached is a third version of the patch. Could you try that as
well and send the output of "env default -f -a; printenv"?
I have used the values from your old environment for defining the
kernel, initrd and dtb load addresses. For the pxelinux config
files and for the bootscripts I have no indication where they
might be usually placed on this platform, so I have (more or less
randomly) placed them behind the dtb and before the kernel.
Regards,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
>From 0aaf2aa4ab30f2708637fbcc2d7633d868d9bca2 Mon Sep 17 00:00:00 2001
From: Karsten Merker <merker@debian.org>
Date: Mon, 3 Oct 2016 14:31:28 +0200
Subject: [PATCH] Enable the common distro boot environment for the clearfog
platform.
Signed-off-by: Karsten Merker <merker@debian.org>
---
configs/clearfog_defconfig | 10 +---------
include/configs/clearfog.h | 48 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index 588dfb2..b398238 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -9,10 +9,9 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SPL_MMC_SUPPORT=y
CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
+CONFIG_DISTRO_DEFAULTS=y
CONFIG_BOOTDELAY=3
CONFIG_SPL=y
-CONFIG_HUSH_PARSER=y
-CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MMC=y
@@ -22,15 +21,8 @@ CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_TFTPPUT=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
CONFIG_SPL_OF_TRANSLATE=y
CONFIG_SPI_FLASH=y
CONFIG_DEBUG_UART=y
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index 3990900..9516eb7 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -91,7 +91,7 @@
#define CONFIG_SYS_ALT_MEMTEST
/* Keep device tree and initrd in lower memory so the kernel can access them */
-#define CONFIG_EXTRA_ENV_SETTINGS \
+#define RELOCATION_LIMITS_ENV_SETTINGS \
"fdt_high=0x10000000\0" \
"initrd_high=0x10000000\0"
@@ -148,4 +148,50 @@
*/
#include "mv-common.h"
+/* Include the common distro boot environment */
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+
+#ifdef CONFIG_MMC
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#else
+#define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICES_USB(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+ BOOT_TARGET_DEVICES_MMC(func) \
+ BOOT_TARGET_DEVICES_USB(func) \
+ func(PXE, pxe, na) \
+ func(DHCP, dhcp, na)
+
+#define KERNEL_ADDR_R __stringify(0x800000)
+#define FDT_ADDR_R __stringify(0x100000)
+#define RAMDISK_ADDR_R __stringify(0x1800000)
+#define SCRIPT_ADDR_R __stringify(0x200000)
+#define PXEFILE_ADDR_R __stringify(0x300000)
+
+#define LOAD_ADDRESS_ENV_SETTINGS \
+ "kernel_addr_r=" KERNEL_ADDR_R "\0" \
+ "fdt_addr_r=" FDT_ADDR_R "\0" \
+ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
+ "scriptaddr=" SCRIPT_ADDR_R "\0" \
+ "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ RELOCATION_LIMITS_ENV_SETTINGS \
+ LOAD_ADDRESS_ENV_SETTINGS \
+ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+ "console=ttyS0,115200\0" \
+ BOOTENV
+
+#endif /* CONFIG_SPL_BUILD */
+
#endif /* _CONFIG_CLEARFOG_H */
--
2.1.4
Reply to: