Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1942485lqa; Tue, 30 Apr 2024 04:12:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjlEZLhl7xQZ+Q4V4IBEOzmbY8uyNyysXR2BsaiQcygEPsMcaqbVEhIUP/+BvP7yT+sJLO8uoG5IUsjC/Uu0u2kTb3+rbLyUbE60+emA== X-Google-Smtp-Source: AGHT+IE8zUWPvs4fac8ANY0jk6mpjvGOoCJirabPLLqjKGRZMoekySBAV3wsDfWkBoHM/2E9hh38 X-Received: by 2002:a17:906:6acf:b0:a55:4afe:a9c5 with SMTP id q15-20020a1709066acf00b00a554afea9c5mr1528316ejs.25.1714475523323; Tue, 30 Apr 2024 04:12:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714475523; cv=pass; d=google.com; s=arc-20160816; b=Wc52emnIEIhBm7dHR4F7NPK0+wLTbGTUZXIB8w2OizQfm5vDLAJj9GTTYdeh6zLV7v kJ7XB6mc0YDt1+ZjzuCg6i4rldGe8RRahIKVD8yGVVnsnaVETvygO/9tOQ/5bev0qrwO rv1uEBZDdYPlRJs09rcR4mBorAu1yOXrmNAsvnPvkfOQ4XXe1p/eM8mJzzfLXtp3BqHT dlI+Mfp5fXigSdUBqC+H5WMgU7psjR4+EXCARFBJESMRTG4a+ijDzy2W5riTQbKJZyJ+ 6y6GkmyWxqryFYs/9glZ289Fg3h/RlrjJ1VG3yt1jOiUHtmpXeiSX7qdvCLF+5OftZnX +BlQ== 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=HfDAe/+a7cnUSWnazAEkwpfxhs4WePFrt+s3LGI2pGw=; fh=MAc09QjDjSik4AuDyYjfNYzf5L/MMPnuXYvjGiHigzc=; b=fCCdW26DGryJrzcS7QXhKkoZxm/DdiCG8mvQqSwznAWlzAZsfZ6QUb+nSj2GHxXR92 KVdWxZPVkZebPzhg7OjAUlU5/13+Y5fXJVNRtR8E7slzKYVGu9IyDPXR6XmFzfvkkZMa kr51+Jey53pIFrIeGBMIgKOzqOajNCSWmCGyaYhT3zXg6xcyeugAlFpbwvn5shhXFJ9Y Jb/KfQCgW/U2HZk2VBhVUNLeyjS9/e5FgsC9OEEO2a4ik75C6n2l6jQKgsEN3G7YKmiG lUQc9obA3YPYeeNUYewlYrRV1VtGBX/rJiwiHX5WS71/XPxxoGoddCMszhrS2hiv4w9F Ha3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="D/+3JsSU"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hp16-20020a1709073e1000b00a5565142899si15355657ejc.335.2024.04.30.04.12.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 04:12:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="D/+3JsSU"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163828-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4C5C61F23D3B for ; Tue, 30 Apr 2024 11:11:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C608E12C47A; Tue, 30 Apr 2024 11:11:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D/+3JsSU" 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 CFCCD12D20F; Tue, 30 Apr 2024 11:11:33 +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=1714475493; cv=none; b=nL0lKCTP8Iia3TSyf25ON7lvYuVVPiJDPxCqY8IVQUA0a09ju7WkNKSYzG5Gs9Zeb1qCV9ufvnfjTBxlA+aJSLd8hZeJ9dsLfX04oW+OvOGhfCV+3/GMQnzvkytNLNJGtl8CTzK2cjy3rxhn4W9W9247Et6A1BURvoqxyQnhwN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714475493; c=relaxed/simple; bh=OEZfaxKF5ZU2ktXmlXA2zI10IqUQ7mPBu+B5L+gYq0U=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=a8qSGte0vXl8JYwPZiVd5rHl9gB9O+vUfcK//ekLc+pJjXcKbKZfFDaeDliIF/xNWcqFLyNw77J2+EJdW2/EGcD5JOBmKlxb6Hzs//rNLE539E23IgwDVxZPdNIehfHccxh50aL8ozcJKu8bj8mT7JjBqRD6yTpA5JRbo5RU8VI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D/+3JsSU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 935B6C4AF19; Tue, 30 Apr 2024 11:11:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714475493; bh=OEZfaxKF5ZU2ktXmlXA2zI10IqUQ7mPBu+B5L+gYq0U=; h=From:Subject:Date:To:Cc:Reply-To:From; b=D/+3JsSU0ZQe9OSr8IWr+cPr6CkXLFAUYNYtgJfbLcYh3AA86hKZ+yKbekrEh2SO6 7HQ1PFkYANdVWbfnNdXnsxkEgETUrDOsScMOENfHxuLZIcRPpRtGyrzarEIDC3KfnS 3JAXcvv7tjbG1IxyC2IBA7VxtkSy9uYr4Hu1bAuO93xYHaF9fvfBWq9RvTRQJJiXE8 guicSscxoZKjjeuziQQ0klih8DNnYIoo1ttaWYpSMq3sEFi+ebupX6U7AYJq+JyXm+ 4UP/oLqR1nbtzVEsHss79Tn5zCEpwip168GtFfR1tazMY10Pr1SuSwJoEa8ceASmVh OZLDN08lowNCg== 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 82412C10F16; Tue, 30 Apr 2024 11:11:33 +0000 (UTC) From: Keguang Zhang via B4 Relay Subject: [PATCH v7 0/3] Add support for Loongson-1 NAND Date: Tue, 30 Apr 2024 19:11:09 +0800 Message-Id: <20240430-loongson1-nand-v7-0-60787c314fa4@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=H4sIAM7RMGYC/12OzQ6CMBAGX8X07JL+YCuefA/DoYFtaYTWtEhUw rtbiCbGyyZz2PlmJgmjw0ROu5lEnFxywWdQ+x1pOu0tgmszE055SQWT0IfgbQqegde+heoouGq VQmokyU+3iMY9NuGlzmxiGGDsIuqvhtFDvrzkTBSqogoYXNHe81bxWhfPdtCuL5owrL7OpTHE5 9Y3ydX6SeHqP2WSQEGZSjDWoKGc/pjqZVnemPQfiOwAAAA= 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=1714475491; l=2270; i=keguang.zhang@gmail.com; s=20231129; h=from:subject:message-id; bh=OEZfaxKF5ZU2ktXmlXA2zI10IqUQ7mPBu+B5L+gYq0U=; b=hwxNWFMKDlRXils8CJGuEeMePaS3aFaXpabooj7K3FH22BhA6kh2hIorxi51q3NMwq6ZjXOZY Kewg6Zw9t+vD2GXqyqj6rBUhb0xqT6M9rAKI5XP95b17Bx/XHjlcrfg 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 v7: - Rename the file to loongson,ls1b-nfc.yaml - Rename the dependency to LOONGSON1_APB_DMA - Link to v6: https://lore.kernel.org/r/20240327-loongson1-nand-v6-0-7f9311cef020@gmail.com 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,ls1b-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: d04466706db5e241ee026f17b5f920e50dee26b5 change-id: 20240316-loongson1-nand-98327d77e0f6 Best regards, -- Keguang Zhang