From patchwork Thu Nov 8 10:28:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Lahoudere X-Patchwork-Id: 994824 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42rMfd5WHnz9sBZ for ; Thu, 8 Nov 2018 23:14:49 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 77981C21F9A; Thu, 8 Nov 2018 12:14:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3DA5AC21F60; Thu, 8 Nov 2018 12:14:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B7EAEC21EE3; Thu, 8 Nov 2018 10:28:13 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 29ED2C21D56 for ; Thu, 8 Nov 2018 10:28:13 +0000 (UTC) Received: from laptop.home (unknown [IPv6:2a01:cb19:8ad6:900:42dd:dd1c:19ee:7c60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: aragua) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id A28C5267FA3; Thu, 8 Nov 2018 10:28:12 +0000 (GMT) From: Fabien Lahoudere To: u-boot@lists.denx.de Date: Thu, 8 Nov 2018 11:28:05 +0100 Message-Id: <20181108102805.31680-1-fabien.lahoudere@collabora.com> X-Mailer: git-send-email 2.17.2 X-Mailman-Approved-At: Thu, 08 Nov 2018 12:14:43 +0000 Cc: Fabien Lahoudere Subject: [U-Boot] [PATCH 1/1] embestmx6boards: Add SPL support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In order to boot faster with falcon mode, we need to add SPL support to riotboard. Signed-off-by: Fabien Lahoudere --- arch/arm/mach-imx/mx6/Kconfig | 1 + board/embest/mx6boards/mx6boards.c | 48 ++++++++++++++++++++++++++++++ configs/riotboard_spl_defconfig | 48 ++++++++++++++++++++++++++++++ include/configs/embestmx6boards.h | 13 ++++++++ 4 files changed, 110 insertions(+) create mode 100644 configs/riotboard_spl_defconfig diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig index 06c25bae36..e7cce46e03 100644 --- a/arch/arm/mach-imx/mx6/Kconfig +++ b/arch/arm/mach-imx/mx6/Kconfig @@ -182,6 +182,7 @@ config TARGET_DISPLAY5 config TARGET_EMBESTMX6BOARDS bool "embestmx6boards" select BOARD_LATE_INIT + select SUPPORT_SPL config TARGET_GE_BX50V3 bool "General Electric Bx50v3" diff --git a/board/embest/mx6boards/mx6boards.c b/board/embest/mx6boards/mx6boards.c index 8930c36fe6..fed92aa88a 100644 --- a/board/embest/mx6boards/mx6boards.c +++ b/board/embest/mx6boards/mx6boards.c @@ -608,3 +608,51 @@ int checkboard(void) return 0; } + +#ifdef CONFIG_SPL_BUILD +#include + +void board_init_f(ulong dummy) +{ + u32 cputype = cpu_type(get_cpu_rev()); + + switch (cputype) { + case MXC_CPU_MX6SOLO: + board_type = BOARD_IS_RIOTBOARD; + break; + case MXC_CPU_MX6D: + board_type = BOARD_IS_MARSBOARD; + break; + } + arch_cpu_init(); + + /* setup GP timer */ + timer_init(); + +#ifdef CONFIG_SPL_SERIAL_SUPPORT + setup_iomux_uart(); + preloader_console_init(); +#endif +} + +void board_boot_order(u32 *spl_boot_list) +{ + spl_boot_list[0] = BOOT_DEVICE_MMC1; +} + +/* + * In order to jump to standard u-boot shell, you have to connect pin 5 of J13 + * to pin 3 (ground). + */ +int spl_start_uboot(void) +{ + int gpio_key = IMX_GPIO_NR(4, 16); + + gpio_direction_input(gpio_key); + if (gpio_get_value(gpio_key) == 0) + return 1; + else + return 0; +} + +#endif diff --git a/configs/riotboard_spl_defconfig b/configs/riotboard_spl_defconfig new file mode 100644 index 0000000000..8b5459aa1a --- /dev/null +++ b/configs/riotboard_spl_defconfig @@ -0,0 +1,48 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX6=y +CONFIG_SYS_TEXT_BASE=0x17800000 +CONFIG_SPL_GPIO_SUPPORT=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_TARGET_EMBESTMX6BOARDS=y +CONFIG_SPL_MMC_SUPPORT=y +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL=y +CONFIG_SPL_LIBDISK_SUPPORT=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,SPL,MX6S,DDR_MB=1024" +CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd" +# CONFIG_CONSOLE_MUX is not set +CONFIG_SYS_CONSOLE_IS_IN_ENV=y +CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SPL_RAW_IMAGE_SUPPORT=y +CONFIG_SPL_EXT_SUPPORT=y +CONFIG_SPL_OS_BOOT=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +CONFIG_CMD_USB=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_DM=y +CONFIG_FSL_ESDHC=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_SST=y +CONFIG_PHYLIB=y +CONFIG_MII=y +CONFIG_SPI=y +CONFIG_MXC_SPI=y +CONFIG_DM_THERMAL=y +CONFIG_USB=y +CONFIG_USB_STORAGE=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_VIDEO=y +# CONFIG_VIDEO_SW_CURSOR is not set +CONFIG_OF_LIBFDT=y +CONFIG_SPL_OF_LIBFDT=y diff --git a/include/configs/embestmx6boards.h b/include/configs/embestmx6boards.h index 71217f07e2..7e7de4dae6 100644 --- a/include/configs/embestmx6boards.h +++ b/include/configs/embestmx6boards.h @@ -109,6 +109,19 @@ #include "mx6_common.h" +#ifdef CONFIG_SPL +#include "imx6_spl.h" +/* RiOTboard */ +#define CONFIG_SYS_SPL_ARGS_ADDR 0x13000000 +#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage" +#define CONFIG_SPL_FS_LOAD_ARGS_NAME "imx6dl-riotboard.dtb" + +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* offset 69KB */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* offset 69KB */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* offset 69KB */ + +#endif + /* 256M RAM (minimum), 32M uncompressed kernel, 16M compressed kernel, 1M fdt, * 1M script, 1M pxe and the ramdisk at the end */ #define MEM_LAYOUT_ENV_SETTINGS \