From patchwork Mon Apr 20 14:05:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273449 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=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=a2ihE+RU; 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 495T4W5w5kz9sR4 for ; Tue, 21 Apr 2020 00:05:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B693681CDE; Mon, 20 Apr 2020 16:05:43 +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="a2ihE+RU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0574E81CE7; Mon, 20 Apr 2020 16:05:38 +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-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (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 C147881CC0 for ; Mon, 20 Apr 2020 16:05:31 +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-x643.google.com with SMTP id f8so3992843plt.2 for ; Mon, 20 Apr 2020 07:05:31 -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; bh=8p67pl63ubqMJy97Gt3C2W5p4scIwtMtW+dm1awXctE=; b=a2ihE+RUUXvSSzm+lzVinMr398CjFydgT/7ptdEsUyMgR/AgmwSoDZJP5KX36TQEx1 Z8loVja+LqjwLR456zVtMTH0+HU2sdyudnVrwc/hrI/cY61a44aFMtagwIrdAmPOdFxl CMWw1BsdfMSd0utowc28/oLQSgyb+qfEhbtkA= 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; bh=8p67pl63ubqMJy97Gt3C2W5p4scIwtMtW+dm1awXctE=; b=fytBBYst3gL5SgTynJ3BFRn6usNrnWPnSTifGNapU+G6S0ZTaZySvq25P8fq3Bs9UM +BbuatVDhGCXGpvzyt6dp30nAk017d6DgDQO/5gB8sc5X1TwsXGUJYnocmETLef4qAXg i4QUhlIcTcZ0Bq7zKSFwsoxnlrTtA+Z9a3XlAW9yQ61ZhuP7/JrRioTDoTUnDMFVMN+d ykev5wBkJ6266gweSFZ1TfQP+TUvYzorWP2502aKPT5jHil7xi8xk2/xuAMaHY0pvQqD UWbQJrh33z/2ScFyX03ps46lVsMLBhvezQtJQy/SJlwxHD89Bb6pawBXtaE3IK0Wa1ga WUDA== X-Gm-Message-State: AGi0PuaDOZq1Ue5u42qGUwVRqLIy5Wn2eYNon/TdRGXyvhjOwLKy2429 PABXmqMPqIfbD+NRtCqhVV8WXEZHdKxrwQ== X-Google-Smtp-Source: APiQypLTxx6LqCIJk0JGnMMLg25TBCMNe2+gtiuUOs4p/MocXAY825H0PyBKCSxl4mYHkJQ1af0dbw== X-Received: by 2002:a17:902:b60d:: with SMTP id b13mr17540609pls.324.1587391530242; Mon, 20 Apr 2020 07:05:30 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id z23sm1197219pfr.136.2020.04.20.07.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 07:05:29 -0700 (PDT) From: Jagan Teki To: pragnesh.patel@sifive.com, rick@andestech.com, u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, sagar.kadam@sifive.com, paul.walmsley@sifive.com, troy.benjegerdes@sifive.com, palmerdabbelt@google.com, anup.patel@wdc.com, atish.patra@wdc.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 1/5] sifive: fu540: Add Booting from SPI Date: Mon, 20 Apr 2020 19:35:10 +0530 Message-Id: <20200420140514.25847-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com> References: <20200420140514.25847-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean U-Boot SPL 2020.04-rc4-g0b8ed9b8b6 (Apr 20 2020 - 18:31:50 +0530) Trying to boot from MMC1 U-Boot 2020.04-rc4-g0b8ed9b8b6 (Apr 20 2020 - 18:31:50 +0530) CPU: rv64imafdc Model: SiFive HiFive Unleashed A00 DRAM: 8 GiB MMC: spi@10050000:mmc@0: 0 Loading Environment from SPI Flash... SF: Detected is25wp256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB *** Warning - bad CRC, using default environment In: serial@10010000 Out: serial@10010000 Err: serial@10010000 Net: eth0: ethernet@10090000 Hit any key to stop autoboot: 0 Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- .../dts/hifive-unleashed-a00-u-boot.dtsi | 12 ++++++ board/sifive/fu540/fu540.c | 3 ++ configs/sifive_fu540_spi_defconfig | 26 +++++++++++ doc/board/sifive/fu540.rst | 43 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 configs/sifive_fu540_spi_defconfig diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index 0162f59f60..f5a208398f 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -12,6 +12,10 @@ spi2 = &qspi2; }; + config { + u-boot,spl-payload-offset = <0x105000>; /* @ 1044KB */ + }; + hfclk { u-boot,dm-spl; }; @@ -21,6 +25,14 @@ }; }; +&qspi0 { + u-boot,dm-spl; + + flash@0 { + u-boot,dm-spl; + }; +}; + &qspi2 { mmc@0 { u-boot,dm-spl; diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 131fee8898..84dd20e29d 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -129,6 +129,9 @@ void board_boot_order(u32 *spl_boot_list) u32 boot_devices[] = { #ifdef CONFIG_SPL_MMC_SUPPORT BOOT_DEVICE_MMC1, +#endif +#ifdef CONFIG_SPL_SPI_LOAD + BOOT_DEVICE_SPI, #endif }; diff --git a/configs/sifive_fu540_spi_defconfig b/configs/sifive_fu540_spi_defconfig new file mode 100644 index 0000000000..24d0a9338e --- /dev/null +++ b/configs/sifive_fu540_spi_defconfig @@ -0,0 +1,26 @@ +CONFIG_RISCV=y +CONFIG_ENV_SIZE=0x20000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_TARGET_SIFIVE_FU540=y +CONFIG_ARCH_RV64I=y +CONFIG_RISCV_SMODE=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_FIT=y +CONFIG_MISC_INIT_R=y +CONFIG_DISPLAY_CPUINFO=y +CONFIG_DISPLAY_BOARDINFO=y +CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_DM_MTD=y +CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_DM_SPI=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y +CONFIG_SPL_SPI_SUPPORT=y +CONFIG_SPL_SPI_LOAD=y +CONFIG_SPL_YMODEM_SUPPORT=y +CONFIG_SPL_CLK=y +CONFIG_SPL_GPIO_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x3000 +CONFIG_SIFIVE_FU540_DDR=y diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst index 691ef232e2..14323e0985 100644 --- a/doc/board/sifive/fu540.rst +++ b/doc/board/sifive/fu540.rst @@ -391,3 +391,46 @@ Program the SD card Change DIP switches MSEL[3:0] are set to 1011 Insert the SD card and power up the board. + +Booting from SPI +---------------- + +Use steps from "Building" section for building the U-Boot + +.. code-block:: none + + export ARCH=riscv + export CROSS_COMPILE= + make sifive_fu540_spi_defconfig + make + +Partition the SPI in Linux via mtdblock. (Require to boot +the board in SD boot mode by enabling MTD block in Linux) + +.. 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) +on U-Boot proper. + +.. code-block:: none + + sf erase 0x5000 0x100000 + tftpboot $kernel_addr_r u-boot-spl.bin + sf write $kernel_addr_r 0x5000 $filesize + + sf erase 0x105000 0x100000 + tftpboot $kernel_addr_r u-boot.itb + 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. From patchwork Mon Apr 20 14:05:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273450 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=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=TZWMWr4l; 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 495T4m09gFz9s71 for ; Tue, 21 Apr 2020 00:05:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EAD2281CD2; Mon, 20 Apr 2020 16:05:56 +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="TZWMWr4l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E3B9D81CE7; Mon, 20 Apr 2020 16:05:41 +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-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (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 A771681CE0 for ; Mon, 20 Apr 2020 16:05:35 +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-x1041.google.com with SMTP id ng8so4633653pjb.2 for ; Mon, 20 Apr 2020 07:05:35 -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; bh=E+FmdrOJFO38HAyf11+8nmtZS4UGGZB12Ul5vFvrF5M=; b=TZWMWr4lTQlW3BWreGSXX1y1qQMr4Nha7O4sy9DpCe70IVOC4uodJzeFqv1+tSfJSP Q8VAfm6fB11h+keGLqO7RzFuATuZNJF+rHVTko8yAmxc8mXC06uGGuSBmi0APwH+9cpu wpPUe92rCeqwjCRmMqewy1ySHqXjnEmRQgjX4= 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; bh=E+FmdrOJFO38HAyf11+8nmtZS4UGGZB12Ul5vFvrF5M=; b=Dg59sX5mJpLggZAGZqg11VVf0cFG7VhaSQlKBjqemSCbc7d+cgEDf75+UG8LMaUvMC SyUqC/CALXnyXTWIwmuIPe7tNPuwUdWgXy9hsaf4Kt8ZWP3mBv/Yt9nfR1U24xc5Mg00 6H8dDdJefx8w4QlquWLqA/BLeYkoxCZglbFZN267TlSiwvfdfs22SKesi6BpTAP0cx14 OSUye6qc5lYZu7Mxi5j2CpY+jRnzpC8UnLhWs2tadUW8rczSeX81L+qbCqSS0wmhVbxW iot0vcH7Zewq0+T7QevnY5gmXqzQwokhXpul63hmyVy3N3z8JKpHA+lYuyE6GcYmNEDs dByw== X-Gm-Message-State: AGi0PuaOWIvtIeXzfq7bo/kAOo96Ws/CsQh1J1mUNOLfP96Q8bUC5DmW qW6Z4+kM0Ll92AU5PgtNpGWRyA== X-Google-Smtp-Source: APiQypLYOIROYMPe8sY6O/UUN8+Zy9Cvalp1TdSWStTuF0vsMFpsDgooNlhIdjO425F4cp5iKQN0cw== X-Received: by 2002:a17:902:a503:: with SMTP id s3mr17577039plq.303.1587391534217; Mon, 20 Apr 2020 07:05:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id z23sm1197219pfr.136.2020.04.20.07.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 07:05:33 -0700 (PDT) From: Jagan Teki To: pragnesh.patel@sifive.com, rick@andestech.com, u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, sagar.kadam@sifive.com, paul.walmsley@sifive.com, troy.benjegerdes@sifive.com, palmerdabbelt@google.com, anup.patel@wdc.com, atish.patra@wdc.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 2/5] env: Enable SPI flash env for SiFive FU540 Date: Mon, 20 Apr 2020 19:35:11 +0530 Message-Id: <20200420140514.25847-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com> References: <20200420140514.25847-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean SPI flash device on HiFive Unleashed has 32MiB Size. This patch add 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 Signed-off-by: Jagan Teki --- env/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/env/Kconfig b/env/Kconfig index 0d6f559b39..67c88fd40b 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -500,6 +500,7 @@ config ENV_OFFSET default 0 if ARC default 0x140000 if ARCH_AT91 default 0x260000 if ARCH_OMAP2PLUS + default 0x505000 if TARGET_SIFIVE_FU540 help Offset from the start of the device (or partition) @@ -519,6 +520,7 @@ config ENV_SIZE default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL default 0x4000 if ARC + default 0x20000 if TARGET_SIFIVE_FU540 default 0x1f000 help Size of the environment storage area @@ -529,6 +531,7 @@ config ENV_SECT_SIZE default 0x2000 if ARCH_ROCKCHIP default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 + default 0x10000 if TARGET_SIFIVE_FU540 help Size of the sector containing the environment. From patchwork Mon Apr 20 14:05:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273451 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=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=bka7/c6w; 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 495T501ZkQz9s71 for ; Tue, 21 Apr 2020 00:06:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DCA3D81CEA; Mon, 20 Apr 2020 16:05:59 +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="bka7/c6w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C347781CE7; Mon, 20 Apr 2020 16:05:44 +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 D65FA81CE2 for ; Mon, 20 Apr 2020 16:05:39 +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 q18so1558704pgm.11 for ; Mon, 20 Apr 2020 07:05:39 -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; bh=qb1rde9bnOZobL69iTSdakVfeG5AvapoEMaD7/vFQOc=; b=bka7/c6wgPVFu7MsPgwETHtISIVfPErV7KOayTQ8z7M+OEu3vAQjFFxqR6hUG2QVKV gEH7DoIaoaP7POSNIiUVQhDAiwH7vrQr4j0z7SnBfvNim9/QT0uJzbruaYuWjWt6mZGp tcQtF5YJsk+E0fB/G5YG6D1vdS8OMuPiaq55g= 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; bh=qb1rde9bnOZobL69iTSdakVfeG5AvapoEMaD7/vFQOc=; b=tfg87g2Cqq/fLcT2IR4B89sMZ5cdIkNQOFzOsLJOEmjzSXDeXi2K42a6/6feDiU7NN tpREN7F8s1cnJf4NMzEslTszKRtTaQDEx9fBmZRCJb7c8duCjFf731BUqUluZCCsBFnm Wkqlo6uEGzQllHxhmfg2yFkROuzh5Zbo5SH+EXeXcwcDdjkFF3mXjjg52dCSWrcG/Fq8 9rOKuR0DltWek6m9Ry0IYQWtRKQFFoyni3++JeiQHSQ7pAC8ngIbhtJM7lqTnzytqK2r 1/YZp6lkJQS0XW0Ax71ciKN7PdyMXGOKfY8O4XEUF0cw4bU5UDQ1aa0Pe6pTWOghDDsZ 66tw== X-Gm-Message-State: AGi0PuZmcrzx9PV/5RbyCfdAbD0VjB7YRJa/H0Rq9rz8vKVwf6qjQERy 1SU5DC9iAOUz94BAKZI+bba9Hg== X-Google-Smtp-Source: APiQypKNfuBuwZUenDSa8JAlBzTL4MMWvvPjDSUqdhDfcuqEDHn0euyLLNsvy5cq+m3A7elze9p1PA== X-Received: by 2002:a62:1657:: with SMTP id 84mr3098543pfw.51.1587391538401; Mon, 20 Apr 2020 07:05:38 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id z23sm1197219pfr.136.2020.04.20.07.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 07:05:37 -0700 (PDT) From: Jagan Teki To: pragnesh.patel@sifive.com, rick@andestech.com, u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, sagar.kadam@sifive.com, paul.walmsley@sifive.com, troy.benjegerdes@sifive.com, palmerdabbelt@google.com, anup.patel@wdc.com, atish.patra@wdc.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 3/5] sifive: fu540: Mark the default env as SPI flash Date: Mon, 20 Apr 2020 19:35:12 +0530 Message-Id: <20200420140514.25847-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com> References: <20200420140514.25847-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 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. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- board/sifive/fu540/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index 43d01bab8d..7e49feba00 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -27,6 +27,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select GENERIC_RISCV select SUPPORT_SPL + select ENV_IS_IN_SPI_FLASH imply CMD_DHCP imply CMD_EXT2 imply CMD_EXT4 From patchwork Mon Apr 20 14:05:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273452 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=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=E7xNRlA3; 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 495T5C6XKXz9sR4 for ; Tue, 21 Apr 2020 00:06:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 855BB81CEC; Mon, 20 Apr 2020 16:06:04 +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="E7xNRlA3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB2A981CEB; Mon, 20 Apr 2020 16:05:47 +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-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (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 E0E2281CE0 for ; Mon, 20 Apr 2020 16:05:43 +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-x644.google.com with SMTP id d24so3982355pll.8 for ; Mon, 20 Apr 2020 07:05:43 -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; bh=dBEjQ7hjSgAkJvUZxt9wAMTIedFsqc60pLsW9v9UL6E=; b=E7xNRlA3c1ptXTnNOLdGgVEDsysxqu4vVuxSHpplEASQF97jZdiqIKC9XP/tsYhVux ez/sVz2WnEzI5wSoTHzQhuKpAAwOpAA/WOxmytab4N8j+GDzhMMdx1MtbgKQgYXUUhrR 8gDbQVzj2J+3jbxsKq2/xxwi4SiWyIMtTXQO0= 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; bh=dBEjQ7hjSgAkJvUZxt9wAMTIedFsqc60pLsW9v9UL6E=; b=Xdt3zYH6kg3eXW3OKC6DySAcKS6NseDyA1vNb7Wnlu132Gf6CrpFVYv2hGjPki50pU fr3BYL6bfhb57cHi/4OJjXNHB/iK22pRM1jIprkMZlgQ5ROVRFnkOiXsk6NQOKumMRtN sagqAOsSsOzLBrVeUL77G5cklO5gOFWR5V3Fqgn4Tae8ihm1M0GudwYOCA1gBsL/J23E Ke2XoWG9AQuhenfTfw2sfq8OaGLBlJqmoiJp5g7Vm9oakwaTBIIE+AiyKDUeokyUgg7M YZ2pIbO8fyhUo3GSgCo4q9J5KSIAKQkl0Fw0dLpq9kz8087GuX4v3RX2DzqeJ5c0Kybs b+SA== X-Gm-Message-State: AGi0Pua3mhQGTWwcKX3dINWdfXnDx9gjhash0KDRRVna0M9CugHJXzdw 7HtfND5BiYE2goaoxy7AcKHOHQ== X-Google-Smtp-Source: APiQypLYPCsrZS6AoiDFsXI0/oiEaVWih7Ale9ruwQ6K/vFGWmS4LMbIQ6rfK4IMIR2zoCVCxV5pZw== X-Received: by 2002:a17:90a:fd89:: with SMTP id cx9mr21208014pjb.64.1587391542433; Mon, 20 Apr 2020 07:05:42 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id z23sm1197219pfr.136.2020.04.20.07.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 07:05:41 -0700 (PDT) From: Jagan Teki To: pragnesh.patel@sifive.com, rick@andestech.com, u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, sagar.kadam@sifive.com, paul.walmsley@sifive.com, troy.benjegerdes@sifive.com, palmerdabbelt@google.com, anup.patel@wdc.com, atish.patra@wdc.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 4/5] sifive: fu540: Add boot flash script offset, size Date: Mon, 20 Apr 2020 19:35:13 +0530 Message-Id: <20200420140514.25847-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com> References: <20200420140514.25847-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 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 --- 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 Mon Apr 20 14:05:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1273453 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=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=KqD+ipUI; 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 495T5R751Tz9s71 for ; Tue, 21 Apr 2020 00:06:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B19481CF0; Mon, 20 Apr 2020 16:06:17 +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="KqD+ipUI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 52E9E81CD2; Mon, 20 Apr 2020 16:05: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 2EC6781CE9 for ; Mon, 20 Apr 2020 16:05: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 p25so4966265pfn.11 for ; Mon, 20 Apr 2020 07:05: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; bh=/X9FLB6Ssx9IwqUYf5zaM2qKPR9u5phW7ngbUAJ1eX8=; b=KqD+ipUIJL3gi7vgJaR6HP0P7tq4VpOTi94rx6XS0WJCQjAcveTmZsRFi2Z5vAcRik A7pIXRP9Ve7hu7Adjsnw9z78F4ys3+h3gXF9c5VGMKqAMDyyUVgl0CY7oiLDZXbsK9V7 0fULHhnqIDTgNDH/l+6LAz5tsgUbGCtJ0+V6k= 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; bh=/X9FLB6Ssx9IwqUYf5zaM2qKPR9u5phW7ngbUAJ1eX8=; b=YVx0aRDBKcuBv7CmpE39B4IyBmxxL4WNnmjG44M4Ud6e5axea6IT7RQKSnQGLjf+lS jCTP1O+PHi3ehfRhMAAptwEuMd67/6TMoMg16jzN++R7hwe+NT0Y8cejNzFq5QkDF4ze WclpL5FRAojppJ66nTtEsePPfS9wLVe7IK2DqXiLmf47BQLSnyQTm86Iz4Q4okNNXBiv DDcaY9mPOHaqc6SxycZWr2IW5MIEytKdoGPJeKZDPk5Bz21GHuzTYDQ0Jf820vrq0vxH NtiNb5BNR07Pz9PhJxcwQAt0ezQXCCzCjin8O23gIh6edOHpSXoTxdsBwgnJ8lxD+CYy Gr2g== X-Gm-Message-State: AGi0PuYfjvyxrbD1rQyWm/sylpbP6WExHPGnuqr/9B2KbsUHxG4tC1iW XVpoOKEDEII2qmv1ZKQQfszZMQ== X-Google-Smtp-Source: APiQypJZrmbNsLujMGRvVOUcr39OraSJ4C0RJbOd9vI38sEwAdwf+csrjXX111RzA2eEkjTLvXAY2Q== X-Received: by 2002:a62:178b:: with SMTP id 133mr16996517pfx.61.1587391546484; Mon, 20 Apr 2020 07:05:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:7ddc:e17b:a9b3:404]) by smtp.gmail.com with ESMTPSA id z23sm1197219pfr.136.2020.04.20.07.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 07:05:46 -0700 (PDT) From: Jagan Teki To: pragnesh.patel@sifive.com, rick@andestech.com, u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, sagar.kadam@sifive.com, paul.walmsley@sifive.com, troy.benjegerdes@sifive.com, palmerdabbelt@google.com, anup.patel@wdc.com, atish.patra@wdc.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 5/5] sifive: fu540: Enable SF distro bootcmd Date: Mon, 20 Apr 2020 19:35:14 +0530 Message-Id: <20200420140514.25847-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com> References: <20200420140514.25847-1-jagan@amarulasolutions.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 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 --- 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};" \