From patchwork Wed Oct 16 14:58:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1177979 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 (no SPF record) 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=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="EHDGwzfT"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46tb8t0cLnz9sPT for ; Thu, 17 Oct 2019 02:01:18 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C59C2C21E30; Wed, 16 Oct 2019 14:59:41 +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_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID 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 020BFC21DD7; Wed, 16 Oct 2019 14:59:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 34FABC21D65; Wed, 16 Oct 2019 14:58:44 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id 19EEFC21E0D for ; Wed, 16 Oct 2019 14:58:44 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id w3so7539772pgt.5 for ; Wed, 16 Oct 2019 07:58:44 -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=SOCVAvPsRYDpSRDxPEOCO6YNiPCeKidJufsPcI7teE8=; b=EHDGwzfT27IML7GyB24yLn3/VN4CDNcPC18wSXWTgKWldD7jDYzrqAkb/wpWTqPP5P fksc8XtLvI8ckoi+BhUat0A+np2sHHpeCqpPLuesPGa6aan8BBVacxgmgdl3ygFSMuDW bSZ+endI5EXOaa5oORppmYCtY2MIX20zM5S5Q= 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=SOCVAvPsRYDpSRDxPEOCO6YNiPCeKidJufsPcI7teE8=; b=NmnuTHDQwt8yQfIUnjPuMueqJyHHoavNHkUjni7HYebBqWPBf+rAJ8ZjsErOFBpMoq XlRs5ApmBoJcHo+lO1E3wbwQiptcv/jjufTXtvuBXKV8tDZqDto1cUinI5FILOlg1ZoZ mbfM852w/dZbDGR0HWPRT0Snd1PMIuDL3eTg9siwOODCdvQgBkSvrci5radfMDQc3B4W Oz5WD9NX3IKrdl+Q6zJ3IfHC+GSzLIAm/SJ+GEIotZBx8bSVUwh5it/bEn4LfUbQbGKq d5LryENyd1BGJXBKrTAGUBhOx0X92pKLerZVIa4YMH0XLIJp8hwO/Bff804M6sczAA+C pfuw== X-Gm-Message-State: APjAAAU/fkpNNss/8nik/J1ntiUW3qCaC7vVBskmjyGdX5NB1Hv3zKQI ipWGjk/WmRSok7UMCuRUKxuSng== X-Google-Smtp-Source: APXvYqx4YU5be+apUEfP94aIFyVAaJsOZIjSTtIbWkns5fkm4SiFD3DE9XIB6mvQHOBUScXCtzjDag== X-Received: by 2002:a17:90a:e98d:: with SMTP id v13mr5579095pjy.64.1571237922600; Wed, 16 Oct 2019 07:58:42 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.31]) by smtp.gmail.com with ESMTPSA id q29sm5534110pgc.36.2019.10.16.07.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 07:58:42 -0700 (PDT) From: Jagan Teki To: Rick Chen , Paul Walmsley , Palmer Dabbelt , Anup Patel , Atish Patra , Bin Meng Date: Wed, 16 Oct 2019 20:28:14 +0530 Message-Id: <20191016145814.19036-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191016145814.19036-1-jagan@amarulasolutions.com> References: <20191016145814.19036-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com Subject: [U-Boot] [PATCH v2 5/5] sifive: fu540: Enable spi-nor flash 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" HiFive Unleashed A00 support is25wp256 spi-nor flash, So enable the same and add test result log for future reference. Tested on SiFive FU540 board. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- .../dts/hifive-unleashed-a00-u-boot.dtsi | 1 + board/sifive/fu540/Kconfig | 3 +++ doc/board/sifive/fu540.rst | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index 25ec8265a5..d7a64134db 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -5,6 +5,7 @@ / { aliases { + spi0 = &qspi0; spi2 = &qspi2; }; }; diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index 5d65080429..c5a1bca03c 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -26,6 +26,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply CMD_FS_GENERIC imply CMD_NET imply CMD_PING + imply CMD_SF imply CLK_SIFIVE imply CLK_SIFIVE_FU540_PRCI imply DOS_PARTITION @@ -40,6 +41,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply SIFIVE_SERIAL imply SPI imply SPI_SIFIVE + imply SPI_FLASH + imply SPI_FLASH_ISSI imply MMC imply MMC_SPI imply MMC_BROKEN_CD diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst index 91b94ee06f..2e70cad02e 100644 --- a/doc/board/sifive/fu540.rst +++ b/doc/board/sifive/fu540.rst @@ -366,3 +366,22 @@ load uImage. Please press Enter to activate this console. / # + +Sample spi nor flash test +------------------------- + +.. code-block:: none + + => sf probe 0:2 + SF: Detected is25wp256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB + => sf erase 0x1000000 0x100000 + SF: 1048576 bytes @ 0x1000000 Erased: OK + => mw.b 0xc0000000 0xaa 0x100000 + => sf write 0xc0000000 0x1000000 0x100000 + device 0 offset 0x1000000, size 0x100000 + SF: 1048576 bytes @ 0x1000000 Written: OK + => sf read 0xf0000000 0x1000000 0x100000 + device 0 offset 0x1000000, size 0x100000 + SF: 1048576 bytes @ 0x1000000 Read: OK + => cmp.b 0xf0000000 0xc0000000 0x100000 + Total of 1048576 byte(s) were the same