| Message ID | 20190929074239.11575-6-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBEWBYHWAKGQEN5MATHY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D7B9B3F039 for <linux-amarula@patchwork.amarulasolutions.com>; Sun, 29 Sep 2019 09:43:15 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id f8sf3650358plj.10 for <linux-amarula@patchwork.amarulasolutions.com>; Sun, 29 Sep 2019 00:43:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569742994; cv=pass; d=google.com; s=arc-20160816; b=Pg5GkA/hSsHVJ0Rwt1dt3vCSlJdwU0aQIxdVXQgNoluyd3hooxNu9DgoKgihFO5Uj4 aSdCt8epS7b3KvMR5xMXQYyMKLi2QD9IielbfQS+lVaWdZMS4WghnbdHuS8bP4lVSln9 5FzSy8ITRHaoQcVVbAO6bNDXILZFQKSeIAWwgx6c4wXJrAEvPgwM5wajKFGqCS5wZEV+ Nb8PfvfOzAGd5WTHopGOG3PxvdM2/Jj95S22b94oabaspdJ3WLfGlD8HSctuy+vpXHPy ROpUqXSDT8WjkMpfSRmRvERxGBuyaz+YU9voynN0fqFzXNVKDDy4YSamNrVd3NzPTYER GeyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gkKJZGdOmKm6OaFhv9aEBuxnSqtZReJfu0ziI/hQTEg=; b=bd7BCPZdES5dAArXo/C2J2kUPxrNlKIWuc/uktjxoYRIDr034pcw019D38KEgWQskw CF+RyMedhpBMLgc52FavsdvbTVep0KcUeAtHx/bcQmlRaDbYOCrOcpc+aYOtHtAqSa3Z S/2kzJzNe5Zn6f3u3M6L5c3pDPmiYJG501gpl6SHoBNZCxyNxFEfBJb2wAIGz6YoTh/Q lxN0yWgyQppsTGwzubVenvgmvfsCFiUpIdL125VDdf462ToJSSukvE+yw+KM8F8Qt0kj nCFIN+ayOMP5oGxHbOiSCDfdOhAgkZXeTylHVgLtq62CbucovFo2j8AzIY08FGd9s2q3 ZvOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=USg1i1vl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=gkKJZGdOmKm6OaFhv9aEBuxnSqtZReJfu0ziI/hQTEg=; b=LY3cR5x3kXM9tFesAJ7CMVontZTZ1YWP/LdnDFtghtg56N4+LiwES215KoXwfVUDrJ HQla5cxq8mJqp4hbEmoyYYt3dd0HgZG6vt5j1uVtWcIG1MYCgFYwMmJQpXZ80ZSs32ni Z9RyRjEKjqOE/nqvfZYfasJgTgOlQ372vJfuk= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=gkKJZGdOmKm6OaFhv9aEBuxnSqtZReJfu0ziI/hQTEg=; b=uMRzlP8HRDM4sCn2oSBYt1gonbFGPYJECJfoQJIEIph66sk9IVSCdr6dWKJm/0bGXw 54PQSLifgM++LCO9Rx0n2Lz3UV/DmoKozJ/3bQgv/VinXIMD5r6maZ3ldfmqaF8tsQFZ 6ZaR/rY1NKrwAWZ+3gLRhZFD/i6/9wuUHebuo87hlWaQj/+c/7dNlba5hQszEnqiGuGs Ua/5MWkJE8XaG2peFs3pEwbidmi3cShOcb0c0oKyByQq0ikeMGWohWUP8yTUcnaeqbL7 2Q7sA1caEtG8lwCPLRa6oa7Izm8+7DLLSfXaVL9QVMhffaMzzxjrhr2A8wjNkOwhknIp SIfg== X-Gm-Message-State: APjAAAXTo5+mSx3Uui7i3e6jXSEdAd2/VDou+JcKRQbrYsvTSK48PM1V 8u/mVSLgQ2Ap07gKH7NnUz0xhx2y X-Google-Smtp-Source: APXvYqxldzYK7FWf53RIpJgCbRz1uAMMGSArocsEi12jrc0p3xebsEC/Tk3jFA4sk50nRGwIlj7j6g== X-Received: by 2002:a17:902:b603:: with SMTP id b3mr6001082pls.29.1569742994122; Sun, 29 Sep 2019 00:43:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:f004:: with SMTP id bt4ls2849934pjb.1.gmail; Sun, 29 Sep 2019 00:43:13 -0700 (PDT) X-Received: by 2002:a17:902:ba82:: with SMTP id k2mr13660197pls.293.1569742993648; Sun, 29 Sep 2019 00:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569742993; cv=none; d=google.com; s=arc-20160816; b=ZmQWx5a/jyJKkdSUWXmKGIJggVHFqM4Yg/CytC4Mo3wJBBAAZ69ddpBWSNcm/OimjE qPaeR84ghT1Ar/1unLdVhhDpUCmK3h/v592PaWvupNCt4u7kvsEkx2wUID0Kt5iSv7KC MwEHBLTNgDIP6+PQfofkOxBwY78ahZiqIPtavwols8tja3JpwYhNaR66MhtCdvscN3R4 spEHT/lIlYBIeD0+w5omw1WIZcbai6KNHMLcXhyaJLGanBMWorpSefykJyIXHr+PHh77 +myiWrE6ILgh7JFbHr4PCNDbGjsEpwjSUV4AXefCwaFF+hieqjdMD+dje8sNhF4NRUXb X1DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VAanRpCooQgBl0B4V+aklX/MJVMCbkOY2knjzJuYFZI=; b=j4XeYC2aEAaRuCHOKl3hm67Yro3Fo4fHO6A3VJ8XBfbfnxdHXXnOQWW9/7B1W8DPKp /6lXbp3XaqGGArUlzNahcPMr1JQfXsKy8l7eWO7znbylDxar392aba30AeQOAPL9b+uM SzqAP+SEAuuBBKJUAFqM+bs6qKO+rF1TiloNgK4OgesFnr6ebiV2b7LeAlCT9mHBfWx+ 6qfDBsuJ+AsSMirK347VQWgysfkkB4E9WRq5PEbMDHhE4PuKoSjXr3S6DXiahTyG8zor yR6cLU3y4vKRclw7k09H6HZiHx6xTHcTopTPn5AFfPkeMZJU5jLS7CWkKxuxPWm7u1jK Xkaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=USg1i1vl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y5sor13010696pjp.13.2019.09.29.00.43.13 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Sun, 29 Sep 2019 00:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:322c:: with SMTP id k41mr20154698pjb.32.1569742993301; Sun, 29 Sep 2019 00:43:13 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.31]) by smtp.gmail.com with ESMTPSA id x9sm29548432pje.27.2019.09.29.00.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2019 00:43:12 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Rick Chen <rick@andestech.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@sifive.com>, Anup Patel <anup.patel@wdc.com>, Atish Patra <atish.patra@wdc.com>, Bin Meng <bmeng.cn@gmail.com> Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH 5/5] sifive: fu540: Enable spi-nor flash support Date: Sun, 29 Sep 2019 13:12:39 +0530 Message-Id: <20190929074239.11575-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190929074239.11575-1-jagan@amarulasolutions.com> References: <20190929074239.11575-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=USg1i1vl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series | riscv: sifive/fu540: Enable SPI-NOR support | |
Commit Message
Jagan Teki
Sept. 29, 2019, 7:42 a.m. UTC
HiFive Unleashed A00 has internal is25wp256 spi-nor flash,
so enable the same. added test result log for future reference.
Tested on Sifive fuse540 board.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
.../dts/hifive-unleashed-a00-u-boot.dtsi | 1 +
board/sifive/fu540/Kconfig | 3 +++
doc/board/sifive/fu540.rst | 19 +++++++++++++++++++
3 files changed, 23 insertions(+)
Comments
On Sun, Sep 29, 2019 at 3:43 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > HiFive Unleashed A00 has internal is25wp256 spi-nor flash, What does "internal" mean? The flash is mounted "externally" to the FU540 SoC. > so enable the same. added test result log for future reference. > > Tested on Sifive fuse540 board. SiFive FU540 > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > .../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 Why cs 2? The flash is definitely on cs 0. You may find my patch series useful to solve this issue of the cs number. http://patchwork.ozlabs.org/project/uboot/list/?series=129736 > + 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 > -- With the above fixed, Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Regards, Bin
On Mon, Sep 30, 2019 at 3:35 PM Bin Meng <bmeng.cn@gmail.com> wrote: > > On Sun, Sep 29, 2019 at 3:43 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > HiFive Unleashed A00 has internal is25wp256 spi-nor flash, > > What does "internal" mean? The flash is mounted "externally" to the FU540 SoC. > > > so enable the same. added test result log for future reference. > > > > Tested on Sifive fuse540 board. > > SiFive FU540 > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > .../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 > > Why cs 2? The flash is definitely on cs 0. > > You may find my patch series useful to solve this issue of the cs number. > http://patchwork.ozlabs.org/project/uboot/list/?series=129736 I have checked this, while working on this. let me rebase again.
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