From patchwork Wed Jul 15 10:08:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329351 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=K6uSPf+G; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6Cmp3P2pz9sRf for ; Wed, 15 Jul 2020 20:10:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 76B0181C44; Wed, 15 Jul 2020 12:09:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="K6uSPf+G"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0A04181C3C; Wed, 15 Jul 2020 12:09:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0B5AD81C2E for ; Wed, 15 Jul 2020 12:09:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pg1-x541.google.com with SMTP id k27so2850793pgm.2 for ; Wed, 15 Jul 2020 03:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+vT6tXg3RzsaVu0o6uM5H17ZBy115+jPvGnVuu9Rp7M=; b=K6uSPf+GDx3YJj2cfdMRy2hDH0JEcTEAyhkLshEWEdXGMjn44OFIUXZS1zJFWKXqvm SN+a/R7lSq8FvNOcbl5aMp47YJBRDKvlorGl5ITvHD0cT4rCBDaRSN33l2Xoy+sdn4D4 SCT5N8XgwCui0fYyMMEZtoz1KBWnszwt47OwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+vT6tXg3RzsaVu0o6uM5H17ZBy115+jPvGnVuu9Rp7M=; b=B1wcP8b9cTerNVjM71Np0nnukONQaIF0DBNdlorUmgGpusFKG7oOudbMHBXSBK6X0j ls+EmokRADB5Xe1dTgWJtkmMZdIPzs5MWwzoncQR49NAbUeU4tofK6EvrrV4Yn/ZUKTG 9ruGDwh0IN0EcXIpODBI6BSNlUXfXaviAOIuCRkdz3WK4v4RVX6AttAESuYVzZSu3xf5 hF+D9HHYu5NRddQn4jPZ0/sQ6MuPHIAjv6v0QBuzxBfilCgJxOnNgHdRGVFZFS92UrK9 3zO1oYyBfAvV/q3bjFthXMZ/MIP5PpAbfs7Yiu7rH6jclkFp9E4xkLJ00kYn+7gBbnE+ odaQ== X-Gm-Message-State: AOAM533C5PRR5sYHDN/vCljC4slzk1UWPKEqaJNHqTDyAyyN9utivvNZ aynpZo1SOsgnxaEyVZdEPV3vVg== X-Google-Smtp-Source: ABdhPJxvgXx8EYMwaNtTP7QXHNepo03BTjovIsbCkYUz4WxzDGToUNOpNsi0VVCSHsyuMQr2KwWsSg== X-Received: by 2002:a62:1610:: with SMTP id 16mr8144865pfw.113.1594807786440; Wed, 15 Jul 2020 03:09:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:09:45 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 1/6] sifive: fu540: Add runtime boot mode detection Date: Wed, 15 Jul 2020 15:38:58 +0530 Message-Id: <20200715100903.161363-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add support to detect boot mode at runtime for SiFive FU540 boards. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master board/sifive/fu540/fu540.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 27ff52f903..57753ba50b 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -128,14 +129,26 @@ int board_init(void) } #ifdef CONFIG_SPL +#define MODE_SELECT_REG 0x1000 +#define MODE_SELECT_QSPI 0x6 +#define MODE_SELECT_SD 0xb +#define MODE_SELECT_MASK GENMASK(3, 0) + u32 spl_boot_device(void) { -#ifdef CONFIG_SPL_MMC_SUPPORT - return BOOT_DEVICE_MMC1; -#else - puts("Unknown boot device\n"); - hang(); -#endif + u32 mode_select = readl((void *)MODE_SELECT_REG); + u32 boot_device = mode_select & MODE_SELECT_MASK; + + switch (boot_device) { + case MODE_SELECT_QSPI: + return BOOT_DEVICE_SPI; + case MODE_SELECT_SD: + return BOOT_DEVICE_MMC1; + default: + debug("Unsupported boot device 0x%x but trying MMC1\n", + boot_device); + return BOOT_DEVICE_MMC1; + } } #endif From patchwork Wed Jul 15 10:08:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329352 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=r4rCpK19; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6Cn70Gn6z9sRf for ; Wed, 15 Jul 2020 20:10:18 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BEF6481C19; Wed, 15 Jul 2020 12:10:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="r4rCpK19"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A474781EE3; Wed, 15 Jul 2020 12:10:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 18E1E81C30 for ; Wed, 15 Jul 2020 12:09:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pl1-x641.google.com with SMTP id k5so2184136plk.13 for ; Wed, 15 Jul 2020 03:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ysdit2OgVsRcFAop2cRPXYvJt6B+pLgu58WnYXV3fZU=; b=r4rCpK19w9B+pW80uYix/TM9rVceqXFqgWPsfGNyvZzh+z/JpodOwp2GgY15gAZ4Sk /Z7G9t7BeE5dYD6U5NJEmRYgCNJUTUVd8XXM6ACyJHNqKmBr1pWe4bDGkWWjMQtRyoRU o5FPByU5kuOqlAlEyjdnuVHPxIBOGjlsRnHX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ysdit2OgVsRcFAop2cRPXYvJt6B+pLgu58WnYXV3fZU=; b=DxliQtBRN4o+xv+KPSlyLqnNI+XbMovJ35rzrfx3nFkR64enIs1awbDW9SqIwjIG5w asZLtEeW23MBj98DjjOCxwQswrT7VmL+KhbmTvz0hGhPi/DZIO+TKJMShaDM8bkFTp4G zlwr8NqL7xBewJdx1iCi/76JhxNIWHGEJTbqp0FGdy+eAdD5lbW/Ggb16fXZkHLiBjEu 0zkxH7gbg6aQQcjcUUDkWpBRPbtnAguR+3ZB3Nw28SRZj2q8euQzhPiOh01Be1bEfPG/ st1CgosEMUGgnWRtJ4o+0G7eTRHQJJo8ROpEbOp2DvcSlBYZTVOQbT5gNEt3DVm/sLLw bGoQ== X-Gm-Message-State: AOAM53040lTqP9ZJb7RJTNd2nCO/PiQJlSB1JQVT0DQSRvdiGRNKGga6 /hxyGNMYuEK5iVoZS5tQBB5Pjg== X-Google-Smtp-Source: ABdhPJys5FBfdtQQyaj5b0Ngb66QMQOqcm2/6ZW4eQGaMvhmOALGDWsHdWPwTZn8/yWO17FRtlEJRQ== X-Received: by 2002:a17:90b:4c8b:: with SMTP id my11mr9405086pjb.153.1594807795203; Wed, 15 Jul 2020 03:09:55 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:09:54 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 2/6] sifive: fu540: Add Booting from SPI Date: Wed, 15 Jul 2020 15:38:59 +0530 Message-Id: <20200715100903.161363-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add booting from SPI for SiFive Unleashed board. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master .../dts/hifive-unleashed-a00-u-boot.dtsi | 12 ++++++ configs/sifive_fu540_defconfig | 4 ++ doc/board/sifive/fu540.rst | 41 +++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index e037150520..7d838bf9de 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -16,6 +16,10 @@ spi2 = &qspi2; }; + config { + u-boot,spl-payload-offset = <0x105000>; /* loader2 @1044KB */ + }; + hfclk { u-boot,dm-spl; }; @@ -26,6 +30,14 @@ }; +&qspi0 { + u-boot,dm-spl; + + flash@0 { + u-boot,dm-spl; + }; +}; + &qspi2 { mmc@0 { u-boot,dm-spl; diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig index 9e00a56ce6..06e17860c6 100644 --- a/configs/sifive_fu540_defconfig +++ b/configs/sifive_fu540_defconfig @@ -6,6 +6,7 @@ CONFIG_SPL_DM_SPI=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_TARGET_SIFIVE_FU540=y CONFIG_ARCH_RV64I=y @@ -16,8 +17,11 @@ CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_DM_SPI_FLASH=y +CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_CLK=y CONFIG_DM_MTD=y diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst index 739eefa669..1ce9ab14f5 100644 --- a/doc/board/sifive/fu540.rst +++ b/doc/board/sifive/fu540.rst @@ -533,3 +533,44 @@ Sample boot log from HiFive Unleashed board type: 0fc63daf-8483-4772-8e79-3d69d8477de4 type: linux guid: 9faa81b6-39b1-4418-af5e-89c48f29c20d + +Booting from SPI +---------------- + +Use Building steps from "Booting from MMC using U-Boot SPL" section. + +Partition the SPI in Linux via mtdblock. (Require to boot the board in +SD boot mode by enabling MTD block in Linux) + +Use prebuilt image from here [1], which support to partition the SPI flash. + +.. code-block:: none + + # sgdisk --clear \ + > --set-alignment=2 \ + > --new=1:40:2087 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \ + > --new=2:2088:10279 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \ + > --new=3:10536:65494 --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \ + > /dev/mtdblock0 + +Program the SPI (Require to boot the board in SD boot mode) + +Execute below steps on U-Boot proper, + +.. code-block:: none + + tftpboot $kernel_addr_r u-boot-spl.bin + sf erase 0x5000 $filesize + sf write $kernel_addr_r 0x5000 $filesize + + tftpboot $kernel_addr_r u-boot.itb + sf erase 0x105000 $filesize + sf write $kernel_addr_r 0x105000 $filesize + +Power off the board + +Change DIP switches MSEL[3:0] are set to 0110 + +Power up the board. + +[1] https://github.com/amarula/bsp-sifive From patchwork Wed Jul 15 10:09:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329353 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=BSPU6GS2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6CnR2cHNz9sRf for ; Wed, 15 Jul 2020 20:10:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E186081C3C; Wed, 15 Jul 2020 12:10:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="BSPU6GS2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8920E81EE3; Wed, 15 Jul 2020 12:10:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 33A5781C3B for ; Wed, 15 Jul 2020 12:10:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1044.google.com with SMTP id mn17so2841893pjb.4 for ; Wed, 15 Jul 2020 03:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5eok8F2gRmJRoDkqTrKQg1taynuH1PJnLgNCZ5WnPOw=; b=BSPU6GS2vGMql0xZUp4xvFenjm4iShCUxSfFAY2ZvFqkjhQGmnQ2kVUSpzwjYAvxYh Hs+5sZfirc0Fg5Fiq91yd6FAOI6UWMth71BacRCaolZorBf6reAVx2TyIgLIVc8M+FWq p9RVKPKf63gDoqZP3Bhx0Jt+PWNDWkdqQlHlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5eok8F2gRmJRoDkqTrKQg1taynuH1PJnLgNCZ5WnPOw=; b=hoE9ZYqiuQNso8cc5g5LGhsG8h3d9y99sTJfoCbhFnEo6I5g5hNT3GXRkTiNQEitbM LvxJVZ9YmVDkcFShyx7OxMEYnG4+6puxSKppmoLWfOjj+TYPrimhZg7oYqn5A/8otOQY h5iGLv9arfAkKi0CQQ6KOh3gioHzYmIXrC7vvWoSGbrZQCExyhheoq021Ro0uSSIgQjG NZ4qvX66YurNfUVvaXGBv5YdebpSzpgGBNUinqCUz+2/UtVTtV8Szbi1klxt5AAuBBZD p7kboUbFDfC2yt/K7PT4fxQ0BWd5DYCIerPsSWnKTGVeI5SEC6k4LovNpoQVp7IS+8u0 BCXw== X-Gm-Message-State: AOAM5324KYVx7yzmdkE0qgkztkMGLyfr6VXBGGf4NzKeKWAqtt3o5MNM Ae0BbYzUh9XYM6CjQL05UXuY5w== X-Google-Smtp-Source: ABdhPJxUVpK3DKj6hacP3MGJvh6Kn9ztnJ2pdpoSTqqbp8SIUQiy/S7qh1w82CMoe1Hu9yiyNwEwzA== X-Received: by 2002:a17:90a:8c01:: with SMTP id a1mr8976369pjo.97.1594807811820; Wed, 15 Jul 2020 03:10:11 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:11 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 3/6] env: Enable SPI flash env for SiFive FU540 Date: Wed, 15 Jul 2020 15:39:00 +0530 Message-Id: <20200715100903.161363-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean SPI flash device on HiFive Unleashed has 32MiB Size. This patch adds SPI flash environment after U-Boot proper partition with a size of 128KiB. SPI flash partition layout(32MiB): 0 - 34 : reserved for GPT header 35 - 39 : unused 40 - 2087 : loader1 (SPL, FSBL) 2088 - 10279 : loader2 (U-Boot proper, U-Boot) 10280 - 10535 : environment 10536 - 65494 : rootfs 65528 - 65536 : distro script Note: the loader1 must start from 40th sector even though there are 6 free sectors prior since 40th sector is nearest flash sector boundary.  Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master arch/riscv/cpu/fu540/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index e9302e87c0..2dcad8e27f 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -13,3 +13,16 @@ config SIFIVE_FU540 imply SPL_CPU_SUPPORT imply SPL_OPENSBI imply SPL_LOAD_FIT + +if ENV_IS_IN_SPI_FLASH + +config ENV_OFFSET + default 0x505000 + +config ENV_SIZE + default 0x20000 + +config ENV_SECT_SIZE + default 0x10000 + +endif # ENV_IS_IN_SPI_FLASH From patchwork Wed Jul 15 10:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329354 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=YyKsD6Ne; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6Cnl2SCnz9sRf for ; Wed, 15 Jul 2020 20:10:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 195DD81C32; Wed, 15 Jul 2020 12:10:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="YyKsD6Ne"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5C12B81C3E; Wed, 15 Jul 2020 12:10:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5BA8A81C17 for ; Wed, 15 Jul 2020 12:10:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1044.google.com with SMTP id k71so2846152pje.0 for ; Wed, 15 Jul 2020 03:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fax5Sj6JL/vLwQRqAE9060jxWRK1c17Ef48egUf6kCc=; b=YyKsD6Ne1XoH6Nar+sHmj2VtStCnW2Y3l+37pXIiYZ5W3g2fHIbJJpy/JrqT+YBFki x8/oaFfP7LmNOTOZMIDad7Gm2sVkUP0neKkI58//CAkh9dcbBMbUwqqDV4hXclk+t6/p dHpTkGQwLW2iQ2b41qopZ5W9Ir7lOLA2w6Uvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fax5Sj6JL/vLwQRqAE9060jxWRK1c17Ef48egUf6kCc=; b=C+HsXt6PJ0FYkecsGCP08FDdymg/oZxO/OATZJQA/CzE0EM3ijTAYryrmKLoBKZIi7 4HYwltljJktGEoXS1v3YOwCNzebYHsq4D6pCnpA3RXDUK2z6l9WkVTUa67xAE4I1dGX5 n/XLAsjhqaPMob+iQ7zr1beWIeKM6VHQevuhe3NPqIi9qEtCq1NEH6SDt7TmPxwEgGqa CboH9QwLEvAQeB1QMiMD4BTsjQR/1LROcSKOAIwuiRh+vy/MFBxOPHMIH5QYz15mWV5D YE+QWfDQ1iTKogS5OT2scrGsBLSSfUExZsLRJzEAZw5RsLIp3dcNNPwemjmrNCtaZk99 lq2g== X-Gm-Message-State: AOAM531lBxA8giZEdTznj5DaLQWdIkr2okNnWkScpDTHbWB/8VJwf194 CwIt9eHLO620sVKGyUNx0KJ49A== X-Google-Smtp-Source: ABdhPJwuWLQj+8354U8wB/Tg7qFMLSJxJS2lnUag1Gg3pRrrqd4NOt0alw6P1i5KlS3gJu1eAvwtJQ== X-Received: by 2002:a17:90a:6acb:: with SMTP id b11mr9315482pjm.71.1594807824913; Wed, 15 Jul 2020 03:10:24 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:23 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 4/6] sifive: fu540: Mark the default env as SPI flash Date: Wed, 15 Jul 2020 15:39:01 +0530 Message-Id: <20200715100903.161363-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Mark the default U-Boot environment as SPI flash since this is an on board flash device. Reviewed-by: Bin Meng Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master board/sifive/fu540/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index 86193d7668..e1ba629e37 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -27,6 +27,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select SIFIVE_FU540 select SUPPORT_SPL + select ENV_IS_IN_SPI_FLASH select RAM select SPL_RAM if SPL imply CMD_DHCP From patchwork Wed Jul 15 10:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329355 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=Dp4Uog4I; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6Cp075cDz9sRf for ; Wed, 15 Jul 2020 20:11:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53F4181C3E; Wed, 15 Jul 2020 12:10:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Dp4Uog4I"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0668781C3E; Wed, 15 Jul 2020 12:10:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F13A81D39 for ; Wed, 15 Jul 2020 12:10:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pl1-x641.google.com with SMTP id o1so2203533plk.1 for ; Wed, 15 Jul 2020 03:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i47e+VswuZEiFW+hgamjwuJI7N9t6GVaZGVi7Z9gDk4=; b=Dp4Uog4IFZnOaKUrLcksV/uShyBLU3vTCo4RiV5zO9mX7ETIM4gkmtDv8XDZEZMqFe w7rcngwSBituqqnbXX5UkxNcSzgsW0eHdVceHIRCNYqqrAmcgvduz2aYvzQEVjHJIaEs CGdKHJ7AsgchCS2iujwEA0Hv26MIsHn6wxLQs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i47e+VswuZEiFW+hgamjwuJI7N9t6GVaZGVi7Z9gDk4=; b=D25qyFeDtRoP5h+HaC3yQRsKfTr2J/QZNzg10fNj/QNVvosB64r/X3bwapRaMcOAYo 2LdoYFYDEfP38NQYPPi6hd8xkdVxQ9jkcYSAkMjsVTcFhFaUV5ZwUe+oV1L8wanJdZmD bL0UPmAaHqtdTsRiRUPTLfSCW9xNwLD+uqno/WO7FO2AEjHvCRsdOER93ORENT/mNQbZ G9Hu0xkKG9mqDVvqPWiKgEj5GfEnNR5jeTwvtQzj2Nvp3NTHh/fcoihcWDqCVfIwMCU2 Yud5x4h4qPoRth+E3yghzlu3oAKfNnXHBR2eP+MQOShEtomc99VvCz2TUTsuNGtozzHP MRJQ== X-Gm-Message-State: AOAM532YNVt4o1847JNExkH54RwDm0uabCZpAKQblc11+q5YCHE7KbDU ivFFXe/umG5CljFrmk0yqSCO+Q== X-Google-Smtp-Source: ABdhPJxpzW2rsVUHKQSFz9nuKfnOSVGoLrEnEz7GHpcY0fzO+9d6oTNWXBrOJAzUuVBrtWpvKvdIZA== X-Received: by 2002:a17:902:8d86:: with SMTP id v6mr7883943plo.200.1594807834622; Wed, 15 Jul 2020 03:10:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:33 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 5/6] sifive: fu540: Add boot flash script offset, size Date: Wed, 15 Jul 2020 15:39:02 +0530 Message-Id: <20200715100903.161363-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean HiFive-Unleashed-A00 has SPI flash with 32MiB size. So, let's use the script offset at the end of 4K. This way it cannot overlap any offsets being used by software components in flash layout. So, SF distrocmd will pick the script at desired script address and run. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- Changes for v5: - rebase on master include/configs/sifive-fu540.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 72c841eb9b..68fda14d76 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -62,6 +62,8 @@ "kernel_addr_r=0x84000000\0" \ "fdt_addr_r=0x88000000\0" \ "scriptaddr=0x88100000\0" \ + "script_offset_f=0x1fff000\0" \ + "script_size_f=0x1000\0" \ "pxefile_addr_r=0x88200000\0" \ "ramdisk_addr_r=0x88300000\0" \ "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \ From patchwork Wed Jul 15 10:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1329356 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=Ndioc2jR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6CpC1BSZz9sRf for ; Wed, 15 Jul 2020 20:11:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 845E581EE3; Wed, 15 Jul 2020 12:11:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Ndioc2jR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 80D2D81D39; Wed, 15 Jul 2020 12:10:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6AB2881D39 for ; Wed, 15 Jul 2020 12:10:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pf1-x442.google.com with SMTP id x72so1889430pfc.6 for ; Wed, 15 Jul 2020 03:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FgNdabMkvemqpyH+/OeXBbZvLL/r0x+J6aGJf5F0f3M=; b=Ndioc2jRgnI65fK2DpXcwthLzHp5htorLP382IeQ6PAcudG055uaKZBpEjnIcdyovW LZqQvmZ1g5XMAzD5KQaukFTz/ra6qGhmUniw2Y+8zrM1uAFEm6zr9Lw1mEMHyYKS9JQW NvaK1uUZiTLhNvVg2qDjX1IPOE+kl0ezr1WIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FgNdabMkvemqpyH+/OeXBbZvLL/r0x+J6aGJf5F0f3M=; b=Hg2hkMq0zAKvrAvbgVp7vzigs1+FD2VU7Z647pKh0CwZ0V1xnQIfb8U18FzcEX7vFg 4Sx+ZFyVo82kps7nnzedyJWq1TJc2/0x+SpE567/G9zYdISlOrC8SmisV5oc1SBKAYKt 2XdiQFDvZ8K/Jod2Z4VRrtRBZhqtjw51wm1O4wYOmBbyzfUMCOg2Upe806/DZX6ZFLe1 sA84qW2Vw+4mh/mSdxwT5pROZ8XxJgSt4uOiKOT9zwfJYrcDlTFXje+GWgHe2UMOF/fg TfAXgeSNF5K/68XozwFDFJivk7XRUEVELXqRBOV/tWsNgc0pS9NbNKJtA35GaJdINsMc u+xA== X-Gm-Message-State: AOAM531q3Uk7wes+6e3CvL8r/nvXdBqXPfp46nk+xDSWW0uEE04ew9kZ FQi/8JyZr3pBfB+NE84JNOzLFg== X-Google-Smtp-Source: ABdhPJwXlMENUQrMys+UCJxs0kMbdrgxLDH1zfLnyqhT80r0DFCjBeUiHTkxHHgkflrO/GepkLI/8g== X-Received: by 2002:a63:5509:: with SMTP id j9mr7323111pgb.195.1594807846982; Wed, 15 Jul 2020 03:10:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:46 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 6/6] sifive: fu540: Enable SF distro bootcmd Date: Wed, 15 Jul 2020 15:39:03 +0530 Message-Id: <20200715100903.161363-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Enable SPI flash(SF) distro boot command in Sifive FU540. This distro boot will read the boot script at specific location at the flash and start sourcing the same. Included the SF device at the last of the target devices list since all the rest of the devices on the list have more possibility to boot the distribution due to the size of the SPI flash is concern. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- Changes for v5: - rebase on master include/configs/sifive-fu540.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 68fda14d76..f21411a701 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -43,9 +43,11 @@ #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ + func(SF, sf, 0) \ func(DHCP, dhcp, na) #include +#include #define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47" #define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985" @@ -70,7 +72,8 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ - BOOTENV + BOOTENV \ + BOOTENV_SF #define CONFIG_PREBOOT \ "setenv fdt_addr ${fdtcontroladdr};" \