From patchwork Thu Nov 8 16:57:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 995030 X-Patchwork-Delegate: jagannadh.teki@gmail.com 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=none (p=none dis=none) header.from=st.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42rTzF6cnrz9s8J for ; Fri, 9 Nov 2018 03:59:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9A7A8C21FDD; Thu, 8 Nov 2018 16:58:39 +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 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 21A05C21FF4; Thu, 8 Nov 2018 16:58:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D36DAC2200C; Thu, 8 Nov 2018 16:58:07 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 2C640C21FE2 for ; Thu, 8 Nov 2018 16:58:03 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wA8Grfi6031198; Thu, 8 Nov 2018 17:57:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nmq948kty-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Nov 2018 17:57:59 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 14C2A31; Thu, 8 Nov 2018 16:57:59 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E782C5A0B; Thu, 8 Nov 2018 16:57:58 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 17:57:58 +0100 Received: from localhost (10.201.23.85) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 17:57:58 +0100 From: Patrick Delaunay To: Date: Thu, 8 Nov 2018 17:57:19 +0100 Message-ID: <1541696240-11680-2-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541696240-11680-1-git-send-email-patrick.delaunay@st.com> References: <1541696240-11680-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-08_08:, , signatures=0 Cc: Marek Vasut , Michal Simek , Miquel Raynal , U-Boot STM32 Subject: [U-Boot] [PATCH 1/2] spl_spi: Read default speed and mode values from DT 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case of DT boot, don't read default speed and mode for SPI from CONFIG_*, instead read from DT node. Signed-off-by: Christophe Kerello Signed-off-by: Patrick Delaunay --- common/spl/spl_spi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 8cd4830..3cefc9a 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -78,11 +78,18 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, /* * Load U-Boot image from SPI flash into RAM */ - +#ifdef CONFIG_DM_SPI_FLASH + /* In DM mode defaults will be taken from DT */ + flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, + CONFIG_SF_DEFAULT_CS, + 0, + 0); +#else flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS, CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE); +#endif if (!flash) { puts("SPI probe failed.\n"); return -ENODEV; From patchwork Thu Nov 8 16:57:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 995029 X-Patchwork-Delegate: jagannadh.teki@gmail.com 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=none (p=none dis=none) header.from=st.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42rTy11d5xz9s1x for ; Fri, 9 Nov 2018 03:58:33 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D29C4C21FEA; Thu, 8 Nov 2018 16:58:22 +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 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 2C792C21FE3; Thu, 8 Nov 2018 16:58:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5EF58C21F02; Thu, 8 Nov 2018 16:58:01 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 1B6E1C21F6A for ; Thu, 8 Nov 2018 16:58:01 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wA8Grx6j031572; Thu, 8 Nov 2018 17:58:00 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nmq948ku2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Nov 2018 17:58:00 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3DC7531; Thu, 8 Nov 2018 16:58:00 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2C1255A0B; Thu, 8 Nov 2018 16:58:00 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 17:58:00 +0100 Received: from localhost (10.201.23.85) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 17:58:00 +0100 From: Patrick Delaunay To: Date: Thu, 8 Nov 2018 17:57:20 +0100 Message-ID: <1541696240-11680-3-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541696240-11680-1-git-send-email-patrick.delaunay@st.com> References: <1541696240-11680-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-08_08:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 2/2] splash: sf: Read default speed and mode values from DT 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case of DT boot, don't read default speed and mode for SPI from CONFIG_*, instead read from DT node. Signed-off-by: Patrick Delaunay --- common/splash_source.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/splash_source.c b/common/splash_source.c index 62763b9..f0b3407 100644 --- a/common/splash_source.c +++ b/common/splash_source.c @@ -25,10 +25,18 @@ static struct spi_flash *sf; static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size) { if (!sf) { +#ifdef CONFIG_DM_SPI_FLASH + /* In DM mode defaults will be taken from DT */ + sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, + CONFIG_SF_DEFAULT_CS, + 0, + 0); +#else sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS, CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE); +#endif if (!sf) return -ENODEV; }