From patchwork Thu May 14 11:50:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 11548545 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10302912 for ; Thu, 14 May 2020 11:52:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1DCE2065D for ; Thu, 14 May 2020 11:52:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U0W5Hqv8"; dkim=pass (1024-bit key) header.d=sifive.com header.i=@sifive.com header.b="Jw7/raJT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1DCE2065D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Type:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C4Wn0DVJtsrYagW/LRvYjoTz0Wc573KNruenw/iPvcU=; b=U0W5Hqv8VvL+u1b4ZvFbhHvmy lhvjouf2regceJacjudUfSKiqmE4cp6l7CQ0UABQYlbegl3WtPM1+CMg4EH1qm0mxxt2AIhBOwrUz WqZ8gNZEhOY2hbsQ39Tf6m975sqRDfUi/mUPW3bawG78iQssA9BiDdthVGrG7hM9eBke4ukPscoYs RQGPipmmBkARh5syIqkF94IFQJSMpjTiFqLQdXIfOTl6n+24hqgixfqvQazJTlPEc4PqCCl5blkTZ Ddo64iIdvQ3TRi2wHqS70tZWNME9NJE217xFuCEIqKhSB9oUatlAAs7Aeo7xqDF3I0Cv9Ye6yV2wx 7Vhr/loVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZCPE-0006db-0A; Thu, 14 May 2020 11:52:04 +0000 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZCOh-0005uH-Pl; Thu, 14 May 2020 11:51:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=juvSvYhSOjQzTDfcHTSYAORi4feVzu7GZ4wWdqjnKYGpxeSZNZCV9DVKFTWjshvo2mb9+kkOzPax1LwSjqG0PAreOC2q6Hm34auyro+gjYfWenHfMdbAAm/+0Oz7Yq21MsOCEA6BoYXjRt5MOV9GcFVc+S4YpCeJlKBcj90i2vM0Lp8V89LS0ngfoRxYMEawa94RqAOQpAGxn0tyXk9Q9uUtvTpnAqdAkZKR2wUoUimz4SFgrcykisdfYwhr65M3ylR4u21t/HSwZ9D0cBsIVHNOdqvT5BLmRZm1+zp31c2g5QrMV79sxaGR9BIgRrcmCt+TjHi9azp6SJRR5y6hhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C4Wn0DVJtsrYagW/LRvYjoTz0Wc573KNruenw/iPvcU=; b=dvDh8nQaOK7OxyRR7TY7q0Xm+dS6YNd0zUsYqOXAcgqRc5p0OzfF72kOpFnnTdAduQHjJeG+15eFLiZ/quY/qnsQ3lQTwaX+uj1TPbhTRF951Bq3/EiV/e6mLD/4efBmMjfpmdMvRDqnP/obIuO+z7gqLP6T4+0imSH/rt5wPv0Qygnq4mTJm8WTEJ+0Nav3pu+DIbAy5kI3wU5GR8FBpH067is9r5l5qpdhBl5T+SbErSGBrEpM9p05MLQ0uxHtBloisUgE2hGutxY9nat8A6L5boRyAjblNqouknWqgZ4Hs0F1GpIiXB9SnQVG+35u5RYL/xFRaZX1YrpToSQe7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sifive.com; dmarc=pass action=none header.from=sifive.com; dkim=pass header.d=sifive.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C4Wn0DVJtsrYagW/LRvYjoTz0Wc573KNruenw/iPvcU=; b=Jw7/raJTlp26MWzWvuUzaEMV7EA3BNvN10RbDpOQXrhrWULXRsNADzy81kmCOSnSJ/6stMx2CVsM1y1jxk0/VzUCxD/8lNtKvcY/wgAI85sPtNHY+0bi4AgjEmeCTDCvQOuHPAERlXj5J3OzS3GUfm2dKb9yvTd4iAS68YU29fw= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=sifive.com; Received: from BYAPR13MB2614.namprd13.prod.outlook.com (2603:10b6:a03:b4::12) by BYAPR13MB2469.namprd13.prod.outlook.com (2603:10b6:a02:ca::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.14; Thu, 14 May 2020 11:51:26 +0000 Received: from BYAPR13MB2614.namprd13.prod.outlook.com ([fe80::c0fc:30a3:5e5f:c2b6]) by BYAPR13MB2614.namprd13.prod.outlook.com ([fe80::c0fc:30a3:5e5f:c2b6%7]) with mapi id 15.20.3000.013; Thu, 14 May 2020 11:51:26 +0000 From: Sagar Shrikant Kadam To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, tudor.ambarus@microchip.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: [PATCH v1 1/2] riscv: defconfig: enable spi nor on Hifive Unleashed A00 board. Date: Thu, 14 May 2020 04:50:50 -0700 Message-Id: <1589457051-5410-2-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589457051-5410-1-git-send-email-sagar.kadam@sifive.com> References: <1589457051-5410-1-git-send-email-sagar.kadam@sifive.com> X-ClientProxiedBy: BYAPR08CA0053.namprd08.prod.outlook.com (2603:10b6:a03:117::30) To BYAPR13MB2614.namprd13.prod.outlook.com (2603:10b6:a03:b4::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from gamma07.internal.sifive.com (64.62.193.194) by BYAPR08CA0053.namprd08.prod.outlook.com (2603:10b6:a03:117::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3000.25 via Frontend Transport; Thu, 14 May 2020 11:51:26 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [64.62.193.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c8bfa4b-5916-4212-5790-08d7f7fd21f1 X-MS-TrafficTypeDiagnostic: BYAPR13MB2469: X-LD-Processed: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 040359335D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: exTx+vJGMyZrR0WnFxGA8B9Am6L0bj8snIvaOGvkrerq975RwXS8Nt16LxQQmKm1Cz4O0TI+Zm+DBcbTnmpXuWVKj+SbCpzN/3/Sass2T2UDycilxM7yFAwbOJIFfIRWoXYr65zacHi9Op/v3C7cqD+yG4+hfsRhi4RgCcnAzhYCW2jQrOTjRTYKPUYEf0CtfG1eehkEZptfkyzwA8WL850VLd0oQJtC4Pt4sxK7iCqMv1Y4ZOKJ2UbHKktcLwyNLS9Lc5IJHGXeJAswqy1GxDT7prR7fr1pV6eYXKxK9KhVWcAiGv2C6eZjZVlIZyCoW3aG/F1pNJjvKxVC+xqCk54EdXeSm0Aro+blYDTpudbszd9QnR1BauQ8fziSSbCMu2bTzeV7TkKy/zu1IqV63V/j6EfKrohQgFlgx0Vcz+7hxRlkf773NNZXlQ/cRQMf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR13MB2614.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(396003)(39850400004)(376002)(346002)(136003)(8936002)(186003)(4326008)(16526019)(2906002)(5660300002)(107886003)(26005)(66946007)(8676002)(7416002)(6666004)(478600001)(2616005)(956004)(66476007)(52116002)(7696005)(86362001)(36756003)(66556008)(6486002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CymNtYVvmwJOc+LNDCMXt4+r6cGH7beR23bx9oRDHsoJ5EADt1dS/oxqksjHIfCctcpt7MY3xOXD/mswAU4zh6qIohJV1dWnLpezZRZ85fCq4fZ60mSIy5Lj7Nl0LOfdYciZdDkmIHVa+qgiepZ2U2Q3klsDXSrJL+7+6BdTjrWXsBKtKMQFhMKozjpOV+4mcFog/DDCCa+uOE3Z2q9PwXFZ6zmX9ALAbAJmKRENSEddSOJxSHBnf2Rso5pOqBEc7oGr+iPTvT2ABus+zPigg2aTitRzJ8A5UUSXmO5sAVWHM8ZbKEAmmeGIZup0GbO4ZmZadGRov7uf9NGU0wVUDehGKY/vH8btBvjwLDiQQgFYVMv0OcYRokOcL6DqgK8IQbzU7+r0lMxcOIVlyevKJ+t0RGEKqLEJMgDQ1cY85LCwqQvjJzubICMPvGnpuBqLRBDE8bk/heECPEShrOGvpO6/vSlX4WXCle5RrxEsgKI= X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8bfa4b-5916-4212-5790-08d7f7fd21f1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2020 11:51:26.7663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ywpLYx+VLUkngQDCCCkngcce1+QJecSmfk31XWKoAtZthRIQKJqtVvT6COGhFMm5Cz35IdwWyAp1mQWmC0F5Sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR13MB2469 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_045131_845587_2F1209C2 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.236.83 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.236.83 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anup.patel@wdc.com, aou@eecs.berkeley.edu, palmer@dabbelt.com, Sagar Shrikant Kadam , paul.walmsley@sifive.com Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Enable MTD based SPI-NOR framework in order to use spi flash available on HiFive Unleashed A00 board, and move SPI_SIFIVE to Kconfig.socs. The configurability of SPI_SIFIVE is retained and still can be enabled or disabled as required. Signed-off-by: Sagar Shrikant Kadam --- arch/riscv/Kconfig.socs | 1 + arch/riscv/configs/defconfig | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs index 216286d..bcb0b1a 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -7,6 +7,7 @@ config SOC_SIFIVE select CLK_SIFIVE select CLK_SIFIVE_FU540_PRCI select SIFIVE_PLIC + imply SPI_SIFIVE if SPI help This enables support for SiFive SoC platform hardware. diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index 4da4886..8e2d467 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -62,7 +62,6 @@ CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_SPI=y -CONFIG_SPI_SIFIVE=y # CONFIG_PTP_1588_CLOCK is not set CONFIG_POWER_RESET=y CONFIG_DRM=y @@ -80,6 +79,8 @@ CONFIG_USB_STORAGE=y CONFIG_USB_UAS=y CONFIG_MMC=y CONFIG_MMC_SPI=y +CONFIG_MTD=y +CONFIG_MTD_SPI_NOR=y CONFIG_RTC_CLASS=y CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_BALLOON=y From patchwork Thu May 14 11:50:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 11548543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 513DC912 for ; Thu, 14 May 2020 11:52:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E9B2206DA for ; Thu, 14 May 2020 11:52:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="neadXAXu"; dkim=pass (1024-bit key) header.d=sifive.com header.i=@sifive.com header.b="d761aF6N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E9B2206DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Type:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FuwNckBsREWK/wRm/JNwz4peDmzIsWTpLA7jtPQWozc=; b=neadXAXuWpcR7oIaKHbp6yG6J D4xy42hDkuycXG47WxysLY8EMjgpkyQpK7M4W7rmrw2TogA8LBEuvbXiFUtzEg3kQ1hq+SOKUKJiX 0+iVUuAtv4i29AHKsPFQl7D9HXz+gAD11l3APKYteRqr4Js2dLWknPnmq8JdnPkPdR9houH+JZy/e 0unzK6wjkC+avA7hNKkqIu0cVd4yJEAPWLqe/klQlGgBP7vgyINkkqlcFfoLFaCI1Ak6OYdQe3m/U a+C5OISJtKpwkRO9TGLgI7SYm7fG0joxloaVBTzIrg8knio+aPGaPUYWfqcPlTr6I5Skw7fvwz9T3 ZoZYIiAyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZCP8-0006YB-AQ; Thu, 14 May 2020 11:51:58 +0000 Received: from mail-bn8nam11on2083.outbound.protection.outlook.com ([40.107.236.83] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZCOj-0005uH-GS; Thu, 14 May 2020 11:51:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cfBqXeqYn+X58gBB0n5LvLh0NnWmRx40OzKRHcfaIApXNhtdRpBdeEyYy3OXhDSWlVgB5RBaVU9e50EHBZ4uKwvL29u3zN9vG16LXCAFSVjdJbt8A+No0t0lau4BEO6/i3KvcqHp6p2MGK4DCxtgAMkPTF4Wug/qgNIA544KX6dCGKWeLZVkTJKwrJNyRAhh2R7rkyIM44kK2L2VpDOrtoaUM2qiv6MCNJy1QeO2YjcPWS35Q5aWgzr+DDsBo/8j0qjhbT3GhhCGZAdmKNHsiTXKbF1+3O33GXRjeDWNo7ltv5+tfBlm0cwfI99757pvsNGacfYNozPIQo/ZnOSViw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FuwNckBsREWK/wRm/JNwz4peDmzIsWTpLA7jtPQWozc=; b=Dq58agJh6Yc60MsgLC7HA//h5hJuFabdPEiCnRxDtNY2/9sFkRPmCe1npc+QYyLSKHeQOeAOy97mZsmphF2UZjs6+rwu76LZiRkrRVSBVAvrku6e7pksGo+GIVHjiwoAydlVQFrHchw+6/CWTdcuiGNTDcAZG0Yq6fSTZ39jMlSVsXaF15qEACN95ooItuDNT4yECcx/zLezLn79mRvpzhLrrxyl0kmWCkJc+F8nt7ralCshT2yXXp+UGjMbWe/6oQcQgcJnPbyk7OV4n9LkwRFl/H6CddJ+NMrkA7jkEAEFUnvgkPYEgKQSY30Z8LqUc3yIZ/NXTFj/Bp9spk4nxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sifive.com; dmarc=pass action=none header.from=sifive.com; dkim=pass header.d=sifive.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FuwNckBsREWK/wRm/JNwz4peDmzIsWTpLA7jtPQWozc=; b=d761aF6NzRAiqao5PNTGdWR3DHL548ny5bvYzMrUqcs0MWLY/WfBmJt9naavEODyWJ0+K0G887cNR8WSg2XNLffbuJIEoI8DbtlVXFmE6/5dDMF3q8OmKa7YbGkRqE8m/pr4WbwF0vWbOR98H1/d7fMWna+oFeqrbkj0uHjPflg= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=sifive.com; Received: from BYAPR13MB2614.namprd13.prod.outlook.com (2603:10b6:a03:b4::12) by BYAPR13MB2469.namprd13.prod.outlook.com (2603:10b6:a02:ca::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.14; Thu, 14 May 2020 11:51:28 +0000 Received: from BYAPR13MB2614.namprd13.prod.outlook.com ([fe80::c0fc:30a3:5e5f:c2b6]) by BYAPR13MB2614.namprd13.prod.outlook.com ([fe80::c0fc:30a3:5e5f:c2b6%7]) with mapi id 15.20.3000.013; Thu, 14 May 2020 11:51:28 +0000 From: Sagar Shrikant Kadam To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, tudor.ambarus@microchip.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: [PATCH v1 2/2] spi: nor: update page program settings for is25wp256 using post bfpt fixup Date: Thu, 14 May 2020 04:50:51 -0700 Message-Id: <1589457051-5410-3-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589457051-5410-1-git-send-email-sagar.kadam@sifive.com> References: <1589457051-5410-1-git-send-email-sagar.kadam@sifive.com> X-ClientProxiedBy: BYAPR08CA0053.namprd08.prod.outlook.com (2603:10b6:a03:117::30) To BYAPR13MB2614.namprd13.prod.outlook.com (2603:10b6:a03:b4::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from gamma07.internal.sifive.com (64.62.193.194) by BYAPR08CA0053.namprd08.prod.outlook.com (2603:10b6:a03:117::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3000.25 via Frontend Transport; Thu, 14 May 2020 11:51:28 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [64.62.193.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fec432bd-7271-4dc4-ef23-08d7f7fd2324 X-MS-TrafficTypeDiagnostic: BYAPR13MB2469: X-LD-Processed: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 040359335D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vGHrCmi2SKIJBp8FybCzGXOuWFeMbBULex3iU3oBbCy6yLEDMbqIBOAqTVaYY/84WccGSx9Hw57FdHH7vlN4mm5WhUze9guHvITfJy5eu83AIPnnZYY+Yhf2AgYZli3OR4PDG3XZboUXxLx0l+Z7xzNsgb39/meMTuyzL9m74rfD+xGtlW0X9gNdcuI3tVQnR+0840y1BusYi7EuOW3x6dcYV9tQtG3Y5xjiI0/ohL5HQCiqdAaCGV6yFQ0De6SQU9qN3Z2m1QL+6bNAUspR1py3Re+/tw2068Z53XWmbpSgN7OEBl6GuTGc91OIF9/XfIQopT1PhRjCo/Bw80m6qek+DWv5Nv6ETc6o26gFVzci3xcseXmUnUUfwVCMRr6iTVEqkFVMhJ036vYiam8jhQLYvsORKYXejjy8OkEMiBr8y3RxvL2Y6P0rOwFvTMWa X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR13MB2614.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(396003)(39850400004)(376002)(346002)(136003)(8936002)(186003)(4326008)(16526019)(2906002)(5660300002)(15650500001)(107886003)(26005)(66946007)(8676002)(7416002)(6666004)(478600001)(2616005)(956004)(66476007)(52116002)(7696005)(86362001)(36756003)(66556008)(6486002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aMPpT3zStYBL+aL4e/tHVglJByIuBDDMXxdxh6s/fuaUG20pnztlcEpsasf6KRJe/ugGQgrUpcgxhcLmhclI0D11vTU7PSG3W1RQRPExinCWfRRB7zDdLN84IU9qjwU9PVlverdxc9qsQmT8tJnEzPKhY0IZHlqWIveqwPCHjsJnY9/JVK6Q0odl8iNN5feWojDh78g4NUVW7kjVzdzRRrqFanLILDCr7ZjWYKtBOsmgIX6PhKeC4/ztK8XkAy01+38y3zkbqjz5Vr6nIQB776VS2KB3RKdLTTTLMI0fmchV4vHB4QQHA/a15GZK0s4clKxrRvxsiwYvrs6MfxrZ/zGjtfiZ6WzTh7AqC5mM5ZK4RRkKcytb14HKLqPC83XlI8g8Vtg4sGVwRjufY8IBszU5Rz4R5LIisdRwjokE14aazQlF4eqkBBk7fqwbL7gNy5JMpOa7TEu+RXJlp8ZbL4FGi3RXuouFz2iLt9vvEEw= X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: fec432bd-7271-4dc4-ef23-08d7f7fd2324 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2020 11:51:28.6982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cVKPJmtl8r2oinKhCS8scHqM6/tkFz7Eowxr5pZuzgGMXsXYLndzGUYk0OeoUKcnDtUf4B1H9fuUfeB2I9j/Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR13MB2469 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_045133_572852_A935052E X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.236.83 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.236.83 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anup.patel@wdc.com, aou@eecs.berkeley.edu, palmer@dabbelt.com, Sagar Shrikant Kadam , paul.walmsley@sifive.com Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org During SFDP parsing it is seen that the IS25WP256d device is missing 4BAIT (4-Byte address instruction table), due to which it's page program capacity doesn't get correctly populated and the device gets configured with 4-byte Address Serial Input Page Program i.e. SNOR_PROTO_1_1_1 even though it can work with SNOR_PROTO_1_1_4. Here using the post bfpt fixup hooks we update the page program settings to 4-byte QUAD Input Page program operations. The patch is tested on HiFive Unleashed A00 board and it benefits few seconds of average write time for entire flash write. QUAD Input Page Program operations: > time mtd_debug write /dev/mtd0 0 33554432 rd32M Copied 33554432 bytes from rd32M to address 0x00000000 in flash real 0m 32.85s user 0m 0.00s sys 0m 31.79s Serial Input Page Program operations: > time mtd_debug write /dev/mtd0 0 33554432 rd32M Copied 33554432 bytes from rd32M to address 0x00000000 in flash real 0m 35.87s user 0m 0.00s sys 0m 35.42s Signed-off-by: Sagar Shrikant Kadam --- drivers/mtd/spi-nor/issi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c index ffcb60e..9eb6e82 100644 --- a/drivers/mtd/spi-nor/issi.c +++ b/drivers/mtd/spi-nor/issi.c @@ -23,6 +23,22 @@ is25lp256_post_bfpt_fixups(struct spi_nor *nor, BFPT_DWORD1_ADDRESS_BYTES_3_ONLY) nor->addr_width = 4; + /* + * On IS25WP256d device 4-Byte address instruction table doesn't + * get populated and so the device get's configured with 4-byte + * Address Serial Input Page Program i.e. SNOR_PROTO_1_1_1 even + * though it supports SNOR_PROTO_1_1_4, so priorotize QUAD write + * over SINGLE write if device id table holds SPI_NOR_QUAD_READ. + */ + if (strcmp(nor->info->name, "is25wp256") == 0) { + if (nor->info->flags & SPI_NOR_QUAD_READ) { + params->hwcaps.mask |= SNOR_HWCAPS_PP_1_1_4; + spi_nor_set_pp_settings + (¶ms->page_programs[SNOR_CMD_PP_1_1_4], + SPINOR_OP_PP_1_1_4, + SNOR_PROTO_1_1_4); + } + } return 0; }