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: 861 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DAF313F039 for ; Wed, 16 Oct 2019 16:58:44 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id 194sf18867770pfu.3 for ; Wed, 16 Oct 2019 07:58:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571237923; cv=pass; d=google.com; s=arc-20160816; b=NWe1Mxt+CLp8E5CbQe8XbDVaJ+oOxXi0bsomxI0d1Sdnj6BiQqfnYds1YtQQ9Ov0H1 S3SNYW1+lbpErpytcDbPChVHT7iq34080c1XrAKp0wiFdJco5EK7F2xfUA0hk3AAFK1B wUBfaHZhbw6AFN1QrFExnBcnfX0wwMuMTQKwRXfFqP+FQs7SxYBOph8yNyegkqdh8uEu bgFxYlrpfNVtODCd8HXetByCPQ3tF7eE6A6l4/9Vypkqzfl/N6gFBhX3OLZYygQ1DiLW DO9/qCzZ6r3R6+8Jf+KB5ifeXJb+0651Q6sUOjC+CaxyIw6wR/c8kzbTlk27UEMVp0o7 1y4w== 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=0or0KJMOgzDNfkhnupQFMwOctH362uVwYDp+Rps5t4A=; b=Rjd3oP6fw99DOL5PWfG6urF+T/bwDU/oAUDnO6AKPNnbrr4znvmwrtn6XQQayZeoiT nAjfN6YTHBYpWBcKoYpUlLkXqv7e7LXMRyhdnGexQu9ot4uVk6JUf8zA0ou7eYJEKWGI BYSnB8MYKpkjGJqzQZD7YS/Agx+62x5epJHHO3s5+M1hDh/CKdim+Yvw5zALyjXz9pVV EypXH9+3Y33UIek7R7NseL90DdkN7m0+aK9FPcg/BmKwaVnfxOTXM1GoLvq59fQhl2Ae EeWXXvLMO01Y9iqTMZS8YlGRVA512CpG9kG0E5Cg8JjkVuNg4vTzX6rB8KHw0lnUWeuz rlSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EHDGwzfT; 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=0or0KJMOgzDNfkhnupQFMwOctH362uVwYDp+Rps5t4A=; b=EkAAkxqiV2uQN4KzuV3Yt2ej8DkiaapuprLuwCI0MA/2B1XVq7/tYBIOVaR7Q8xRIu 3dBuXNcb0+llwaIpuR3bsUPNGY6BR6Yak4ONSvjDJE0nlQVj0EGGhwSv4Js6S4zcT6Az uDDKV87hnkqjP6RCOI1E1wT177aa8704ULkvk= 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=0or0KJMOgzDNfkhnupQFMwOctH362uVwYDp+Rps5t4A=; b=V4t/nNHUXeDR/nlwUJJLS2NQtwrowHCEbZP8dYvvlKp4/OWgZqiFKog1hWYRAlP8FU DiYQqxqd3A89liWRaCTebt4vNVHaLByyJcCfj/2sKrYebsOmts684iF2MUN9qEqLt9w1 EeviODkDW5xAi1UKvCpjZPnn6nZi8cr84txKWmkte9x0wSTF7rQupMXWs54PaoaQd8O3 1I5J/1CpO3X9MTNIb01JGBvpSfNEGUdQVhmGAbvx9AaIA2nwbdWwQ0DzWjpf975skD4W B9vMF2C/smx71OccVuQdAuxbJxMf51guGwCdDvyLQignfNsZvgTpaf3ktEmEeJTNO7h/ m/Dw== X-Gm-Message-State: APjAAAVbTHQD2+tQ34BIqJ8Ctg6FX8bq1URDZPueviITqDq286XxY0/H c70nnxxRdE9MGwIX3RUkMmEL+Xg1 X-Google-Smtp-Source: APXvYqzfLkKi7NPksLWlqX0nR2xFHIV6+MV5AtfCrDZxtHuGJ6i2Sb0d80Ce4CXvJiynxnJedyHdDQ== X-Received: by 2002:a63:3c19:: with SMTP id j25mr1518493pga.12.1571237923572; Wed, 16 Oct 2019 07:58:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2766:: with SMTP id o93ls881351pje.4.gmail; Wed, 16 Oct 2019 07:58:43 -0700 (PDT) X-Received: by 2002:a17:902:b097:: with SMTP id p23mr41804845plr.122.1571237923028; Wed, 16 Oct 2019 07:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571237923; cv=none; d=google.com; s=arc-20160816; b=VhPn+l2iDzRZbwlxJkO2QdF4fwYi6Lf8n4mjAII9j82SkCBng2M8UADTnfMXvjwo8H 1x1ti57zuCiJWzHFRJq6wZ3vn50t1SFWhmL1NZvN4TovShhKH1s7LozzsK9pgrM0Eko5 8IkPow04/YAHGhJEo9j5WrOQ/XKdw/X4S/aIBPZmGEK0Un8UB8rxo/xMl5q3zym2IyEL UminnHifbpjp0tFKVZucgcYboJPbWpTyj3xJqNXatoZojYiyZp/X5nv45zoIvm7Q32dw jQNPP2wdSWUXcYFBToN3ODjvCyaIhGUQQr/1VkaItykqsINIZ5NA3zOKmV/xjOjNLlsZ dx+w== 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=SOCVAvPsRYDpSRDxPEOCO6YNiPCeKidJufsPcI7teE8=; b=Al4GDSYUW87imnUCseT5Q4vMV5ZNQ2o26qBxoABHwXqULlAfqlXoBHPhdkoR34IcnI X9jF0JLBmrIBlQySTGgChJijd5PLwKgmew5c8uyZyT0wdfWCC6vLWDkD0ITraST4b+8M CZnvKMO4qaKQeuZUC7D5TbvXKbQW1i+3OF1nEm+csls3VZkmNGbQe2ShgVrbDbCGkVkF y0NK3AAk4o5zaWZcNYqsWCsceTrA352e4X4+ch0GbP7xP0NYpcRlEh4e+uU0mrLK2vGK a8Ia5XoxfPxedOoBkC14PtisCfYOvSiqtMWhq3LgmD0ZIuGTTvPGaRu1bbL09PJLA5Hv TUNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EHDGwzfT; 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 h6sor3604411pjb.11.2019.10.16.07.58.43 for (Google Transport Security); Wed, 16 Oct 2019 07:58:43 -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: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 Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 5/5] sifive: fu540: Enable spi-nor flash support 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 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EHDGwzfT; 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: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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