Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp213978lqe; Wed, 27 Mar 2024 03:47:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWK8oHcaX2NLWjajHJ3RDSFjOJ3Q6gARYiMsyojd/H2i9bg2Z55uybPlCRfmAtIE6TNAFNtt9ZGjI/fD80kLzB+HtXbFWIJ8Dc2BR6CGQ== X-Google-Smtp-Source: AGHT+IFQZlP6YcllO8nQNGtax+EnRPNtbV1JBJTzD8uCNGi6W1y0okqxw9BqdVtHf5jYgFt4RmIw X-Received: by 2002:a17:90a:460e:b0:2a0:8845:137a with SMTP id w14-20020a17090a460e00b002a08845137amr3795511pjg.2.1711536425088; Wed, 27 Mar 2024 03:47:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711536425; cv=pass; d=google.com; s=arc-20160816; b=rYKmCXCi/kgJS1nc65DNY4MysgT4B/MdvhUwO3F2abXc0Jyng+8gwIbnnKA/bR3n5p Mo2QogdEZ4bM8uaLnBEfY5uROu8yjGDDRMQzQ/DJqLE93G0nAJixHjngRi6nXbGj3IHm jMj7Q+3Vks/VON2/6WgfEOHztr6+JS26IWojdFNRNECFgFoP+gpjAJei6W00Uj5/Ir9i q+1i6MRiIF6UV3tUKLLoinGQp5n6OLzvUeUJ8amejqXI4DZBySYDt8Z2iBM/4rPRb13+ lbTbW9A4nh2pkbBftjVs57WmYiiQW2EpnnQN/lJ2TcVjtDWn0KGEvHu7wTX1Wr/sA1x7 o4Ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:from:dkim-signature; bh=6g75OZ3cg8vbuWf/zL6YJiwVcu4XE15NfueWRmbgpFM=; fh=MAc09QjDjSik4AuDyYjfNYzf5L/MMPnuXYvjGiHigzc=; b=uHhhfMPB7QJkYgf+UXZWSKHyalcy+LgQS6UcxsPy2rHQDBdUPPNwEgXmdH7y8b6rxv oZ4XHqANvdI0BUC3mxus/JPZdjgNTHd+1JVpHRJcp3B2XqbzshUYEGIVeBJ24aHL+RB7 yWKHWxiv4H7lYa0KC/z6EICx3/4p/8bbKZBAqI2OYFWjaB6cRhvkPJ2HPghPG4gosp/J /abqrXHg/nqoK57m0A80vtekDsiI6wcn29WX/9TerWV+2ji7Yj25MpS/CN3Q6Rb/FhN5 7QgzV5Bgw0qiyk0/LiYzGBCrTXrxvC7e94qNoXHgycrlpn86sQDdilmwSkojrJdWMgJ5 eg4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YcIj3Gx1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120687-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id nv5-20020a17090b1b4500b002a08f67ad73si1249792pjb.15.2024.03.27.03.47.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 03:47:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120687-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YcIj3Gx1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120687-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E69C429CA7E for ; Wed, 27 Mar 2024 10:45:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C558453394; Wed, 27 Mar 2024 10:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YcIj3Gx1" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E24A6225D9; Wed, 27 Mar 2024 10:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711536292; cv=none; b=TO1zgNbdeVLsRXXWSZ3QJAo7/OffaS1H6TddtbZgcQrya+v3NfWFyA07an4C0Kc0ANRsujUh8va6+Uhkuaviy7hXAEtZ+Fox26TtmE3++rhH+MpMZLi6Wsm5FLlqqfu4/hxUl0+vbLgT5q5Tz44f7hpb3qxayIFw6KQXHnstoIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711536292; c=relaxed/simple; bh=5LDshXlu0PfiuyoM4qYt8E3ozT2zpeM2FAiCZBLBCNs=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=mWZ0TwLyDcHlGFT4gZE35b9xVNafT8Lu9uypMu9T9SqjBQouufX3wkeEVbapuizoK3e3yrTASXzh/eboXv0LQ7S4WFII44eax/1xH3xZgT+LUXEog2D8P5KLzuMhjGE3RQs8JGxSAwMaZyJi1ti3bsxvRIUMN8PFQ2jI2dGNjvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YcIj3Gx1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 9AC9AC433C7; Wed, 27 Mar 2024 10:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711536291; bh=5LDshXlu0PfiuyoM4qYt8E3ozT2zpeM2FAiCZBLBCNs=; h=From:Subject:Date:To:Cc:Reply-To:From; b=YcIj3Gx1N7OWP4vqM44BuQyumKsHRw6KseVbyAmED9ONAHzDYw/If8qCmwVIgm3t7 6s+BW6eutu/q6ksvVSX/clWxXSRPvZgfsPFurLBbOIJ2KJqG6LqA02wH8+gDaTcLet a2vysw7wwWEqAjb7gs/Q/GwtzXtFGSjlheWsclE1zcNMCsIlQoP9dNQhUqpdTwczXu io2bJFX2uCmSSZrrxPlYZgmf+SL8NM8f6wFd/1SmeC8OWJ/oXjLxI1M/7fVeoQN1T0 gjKNn1guYI+tg2MQ/qVuj7IjUG+qx74T0iai8lBTWyJbE3S5nNx/9GbE+q0bNbobFq 00pAfb5uSHVgA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8813CCD11DF; Wed, 27 Mar 2024 10:44:51 +0000 (UTC) From: Keguang Zhang via B4 Relay Subject: [PATCH v6 0/3] Add support for Loongson-1 NAND Date: Wed, 27 Mar 2024 18:43:58 +0800 Message-Id: <20240327-loongson1-nand-v6-0-7f9311cef020@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAG74A2YC/zWNyw7CIBBFf6WZtUN4VLCu/A/jgpSBElswoMbY9 N9FEzc3OYt7zgqVSqQKx26FQs9YY04N9K6DcbIpEEbXGCSXPVdC45xzCjUngckmh8NBSeOMIe4 1tNOtkI+vn/B8aexLXvA+FbJ/jeD7trKXQjEzcIMCrxQercXe3+IpLDbObMwLbNsHP9fsmqAAA AA= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Keguang Zhang X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711536289; l=2068; i=keguang.zhang@gmail.com; s=20231129; h=from:subject:message-id; bh=5LDshXlu0PfiuyoM4qYt8E3ozT2zpeM2FAiCZBLBCNs=; b=3RTvOkvFiswtfYQcWbIvcSER2itdIL0AeQVtEs/e5MrHwNDzLk5E+H6/2S30psHNXdtb6+jed pv25qL0eBUqAmGtwVhy5+Sj4Dx+dqMpuibTVWD+W7vTe++nIoskh5DK X-Developer-Key: i=keguang.zhang@gmail.com; a=ed25519; pk=FMKGj/JgKll/MgClpNZ3frIIogsh5e5r8CeW2mr+WLs= X-Endpoint-Received: by B4 Relay for keguang.zhang@gmail.com/20231129 with auth_id=102 X-Original-From: Keguang Zhang Reply-To: keguang.zhang@gmail.com Add the driver and dt-binding document for Loongson-1 NAND. And modify nand_read_subpage() to allow subpage read by a single operation. Changes in v6: - Amend Kconfig - Add the dt-binding document - Modify nand_read_subpage() to allow subpage read by a single operation - Add DT support for driver - Use DT data instead of platform data - Remove MAX_ID_SIZE - Remove case NAND_OP_CMD_INSTR in ls1x_nand_set_controller() - Move ECC configuration to ls1x_nand_attach_chip() - Rename variable "nand" to "ls1x" - Rename variable "nc" to "nfc" - Some minor fixes - Link to v5: https://lore.kernel.org/all/20210520224213.7907-1-keguang.zhang@gmail.com Changes in v5: - Update the driver to fit the raw NAND framework. - Implement exec_op() instead of legacy cmdfunc(). - Use dma_request_chan() instead of dma_request_channel(). - Some minor fixes and cleanups. Changes in v4: - Retrieve the controller from nand_hw_control. Changes in v3: - Replace __raw_readl/__raw_writel with readl/writel. - Split ls1x_nand into two structures: ls1x_nand_chip and ls1x_nand_controller. Changes in v2: - Modify the dependency in Kconfig due to the changes of DMA module. Signed-off-by: Keguang Zhang --- Keguang Zhang (3): dt-bindings: mtd: Add Loongson-1 NAND Controller mtd: rawnand: Enable monolithic read when reading subpages mtd: rawnand: Add Loongson-1 NAND Controller driver .../devicetree/bindings/mtd/loongson,ls1x-nfc.yaml | 66 ++ drivers/mtd/nand/raw/Kconfig | 7 + drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/loongson1_nand.c | 748 +++++++++++++++++++++ drivers/mtd/nand/raw/nand_base.c | 5 +- include/linux/mtd/rawnand.h | 5 + 6 files changed, 830 insertions(+), 2 deletions(-) --- base-commit: 084c8e315db34b59d38d06e684b1a0dd07d30287 change-id: 20240316-loongson1-nand-98327d77e0f6 Best regards, -- Keguang Zhang