From patchwork Mon Jul 27 20:49:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 500689 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 826DC1401AF for ; Tue, 28 Jul 2015 06:56:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B03974B7AA; Mon, 27 Jul 2015 22:55:54 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nEMHZWMAtGTH; Mon, 27 Jul 2015 22:55:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B56C4B7BE; Mon, 27 Jul 2015 22:55:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30AF34B704 for ; Mon, 27 Jul 2015 22:53:17 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EEe9VkI08oxE for ; Mon, 27 Jul 2015 22:53:17 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id E9CF24B72D for ; Mon, 27 Jul 2015 22:53:09 +0200 (CEST) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3mgCyY5PJrz3hhhG; Mon, 27 Jul 2015 22:53:09 +0200 (CEST) X-Auth-Info: nUOcbX6c31RC5aaMA1jWdssHI2vYqNKjZba40MxSTZs= Received: from chi.lan (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3mgCyY3SXLzvdWS; Mon, 27 Jul 2015 22:53:09 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 27 Jul 2015 22:49:51 +0200 Message-Id: <1438030335-10631-29-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438030335-10631-1-git-send-email-marex@denx.de> References: <1438030335-10631-1-git-send-email-marex@denx.de> Cc: Marek Vasut , trini@konsulko.com Subject: [U-Boot] [PATCH 028/172] arm: socfpga: spl: Add support for booting from QSPI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Add code and configuration options to support booting from QSPI NOR. Enable support for booting from QSPI NOR. Signed-off-by: Marek Vasut --- arch/arm/mach-socfpga/spl.c | 5 ++++- configs/socfpga_arria5_defconfig | 4 ++++ configs/socfpga_cyclone5_defconfig | 4 ++++ configs/socfpga_socrates_defconfig | 4 ++++ include/configs/socfpga_common.h | 9 +++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/spl.c b/arch/arm/mach-socfpga/spl.c index bacc845..7f0ebeb 100644 --- a/arch/arm/mach-socfpga/spl.c +++ b/arch/arm/mach-socfpga/spl.c @@ -31,7 +31,10 @@ static struct nic301_registers *nic301_regs = u32 spl_boot_device(void) { -#ifdef CONFIG_SPL_MMC_SUPPORT +#ifdef CONFIG_SPL_SPI_SUPPORT + socfpga_per_reset(SOCFPGA_RESET(QSPI), 0); + return BOOT_DEVICE_SPI; +#elif CONFIG_SPL_MMC_SUPPORT socfpga_per_reset(SOCFPGA_RESET(SDMMC), 0); socfpga_per_reset(SOCFPGA_RESET(DMA), 0); return BOOT_DEVICE_MMC1; diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig index 245d53c..0204824 100644 --- a/configs/socfpga_arria5_defconfig +++ b/configs/socfpga_arria5_defconfig @@ -9,3 +9,7 @@ CONFIG_OF_CONTROL=y CONFIG_SPI_FLASH=y CONFIG_SPL_DM=y CONFIG_SPL_MMC_SUPPORT=y +CONFIG_DM_SEQ_ALIAS=y +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPL_SPI_SUPPORT=y diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 00536ff..e57270b 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -11,3 +11,7 @@ CONFIG_NETDEVICES=y CONFIG_ETH_DESIGNWARE=y CONFIG_SPL_DM=y CONFIG_SPL_MMC_SUPPORT=y +CONFIG_DM_SEQ_ALIAS=y +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPL_SPI_SUPPORT=y diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig index 11bbff1..d1ffe1d 100644 --- a/configs/socfpga_socrates_defconfig +++ b/configs/socfpga_socrates_defconfig @@ -11,3 +11,7 @@ CONFIG_NETDEVICES=y CONFIG_ETH_DESIGNWARE=y CONFIG_SPL_DM=y CONFIG_SPL_MMC_SUPPORT=y +CONFIG_DM_SEQ_ALIAS=y +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPL_SPI_SUPPORT=y diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 78432e6..dde6938 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -307,6 +307,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SPL_WATCHDOG_SUPPORT #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPL_MMC_SUPPORT +#define CONFIG_SPL_SPI_SUPPORT /* SPL SDMMC boot support */ #ifdef CONFIG_SPL_MMC_SUPPORT @@ -321,6 +322,14 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #endif #endif +/* SPL QSPI boot support */ +#ifdef CONFIG_SPL_SPI_SUPPORT +#define CONFIG_DM_SEQ_ALIAS 1 +#define CONFIG_SPL_SPI_FLASH_SUPPORT +#define CONFIG_SPL_SPI_LOAD +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x40000 +#endif + /* * Stack setup */