Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2996362lqo; Tue, 21 May 2024 03:56:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOleFVoBL6oW9Ees1R7Wdq75zvpjjHQQTYaGz4fOHm/0XgcsmY3BJAuPEM5smdlzXWlYxl7bx6T+Kcs8dzYONWKws8ACeecHKvjcDtxg== X-Google-Smtp-Source: AGHT+IFXUspx46yNTe6eNGZDecckq+3QJJSEf+5j/mZIwnf4m75p+6/qKQN3YPV4iIXbkqz0OiGz X-Received: by 2002:a17:906:a013:b0:a59:aae5:5837 with SMTP id a640c23a62f3a-a5a2d5cd442mr1848033866b.44.1716288983780; Tue, 21 May 2024 03:56:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716288983; cv=pass; d=google.com; s=arc-20160816; b=gfSO2SsI0TOwKh0e/+xtc3sV4JYKLT7bc5/yBrVukRL1a19DMcj0afD5ukiL1Ma53r 01wD0kshMaP/WngBSE3kMMxC+gDgwhg9vS7lM0S67xBRwoGqTbgUwA9ftCCxWf9QCD3E HST29Lz4TVXVKque21Y8XbapUXyBC8ww+aAvbTDcvUbbltHuzRWSManLjoAdDNcazrvl kbI4vgf+Gm+swgUO8fUX/Zoq0ByQ0uc9qNnetkasqX4Ncpews3yart6JF9dqtRQPeRYv u7lMH8mhUITX1GP3gvGbffwwrNMGj23ub1C9MQakXB+RzKclvhDM6OoqN+J1Tve4tskK DrsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=2vYCajvTWRdHI9ZgbF9dMJpQiC4QbazoewYclIu2qLM=; fh=taM+Wg7/X9pM9LN6nhN/vkCvYeuaRj0wuEuDaH60A14=; b=SxL5zXkUcNVJzjrZKgPw2eTee8tJ5yXkhXGgYK+wr02pkHPhgjLRqnswBcAMccnTdU kPXE8JnBkBpTPyzwtTprnplHWw1qJHsQMkZrIdCFKD39brS/P0ClnhUIH9HN8jPZIW3u 0ljWT7+G+htp3m5FFjhgqbeZzKvAcmUFZtzWB0DWqAPeS9Kh3jzPOGmO9Cpvkdt7XUpo 8ATLzGCarfk9GtLZjwtzpo9aCkNV+Bl6KDEd3oFf2FHfArEohhqO9KWjVmXyKA7mBqt7 Sw2pBX63PXSoUszpW62GqGTIh5zu4x/U0fbjA6yesKNVPnjqdt8EPua/Yx5Zz6ZQ3Cvj lOyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Gf00FjiJ; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-184835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be1bd6si1365686766b.736.2024.05.21.03.56.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 03:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Gf00FjiJ; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-184835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 591881F2289F for ; Tue, 21 May 2024 10:56:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DC3B7581A; Tue, 21 May 2024 10:56:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Gf00FjiJ" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 C7B0073173; Tue, 21 May 2024 10:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716288959; cv=none; b=VOUejdzca46WDj3TC3MnkKUk0VMtaNcZavFmZ6c1mFzl05PTZJ+O13K/AqdR27tOK6GD0bLPL6SUEYKEpJAqeI9wj7uQ5IzAbTavvk8x02VnY633BOO9FFs1iXfCt2AwEsqmw9L2MJlUyeQe3X/CQRJZFdGFXEw04QoR+rY53t0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716288959; c=relaxed/simple; bh=CfSUXmX3U6DE+DV1pdCATn5HmKcf584OzlwIGIDkIb4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SCKycnrVRP7lzPgfVHdnScqFD8KdjdTZYYGd4LaakY0jvvQ7xbs8z9EacjgvLhfpTMvcZhHjOM45RRapLMDmTiSyqK3yguAccXwLEmBSsBM3SxBwAgFrNZAE3w1KZIeaPHrdIVYC/I0806SNFhbGjFVnRTfx85PbroA92m+gmbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Gf00FjiJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44L3usMd005035; Tue, 21 May 2024 10:55:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=qcppdkim1; bh=2vYCajvTWRdHI9ZgbF9d MJpQiC4QbazoewYclIu2qLM=; b=Gf00FjiJebcMQBhgeiIaQCkPcHRzxLOrEcmi JKeCDBcWCM+hEkDv5aHEvOdgKukhO7g1IxYVZZStC1SyBr0Q/n15NnFVgXFcqNFi eYn9dg3J7pworG8ENp3m52RKWX9wT2wXQhoI9iOnwiXHVct3kTnmPogHuhMAI6VK Cc57lILr7aq/llSlr/PD7MH7CVuXyEerJbctmt7CItMEVQ6zkric928VkUW6Jwcn wvUdWG59FwsT9fyZ+/CvXi7wQjYMopADscngnk20ahe5jGJ9u+qWvgZbqEQDB0e2 Z5w1xuLLAjcgNzdGBQr//lfGv8Xe27/2rBh52v5AHLId5oM75g== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y6pr2nhs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 May 2024 10:55:39 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44LApHco020567; Tue, 21 May 2024 10:55:35 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3y6ndkytm7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 May 2024 10:55:35 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44LApHQo020562; Tue, 21 May 2024 10:55:35 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-mdalam-blr.qualcomm.com [10.131.36.157]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 44LAtZUI024573 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 May 2024 10:55:35 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 466583) id 1CFE14135B; Tue, 21 May 2024 16:25:34 +0530 (+0530) From: Md Sadre Alam To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, manivannan.sadhasivam@linaro.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Cc: quic_srichara@quicinc.com, quic_varada@quicinc.com, quic_mdalam@quicinc.com Subject: [PATCH v6 0/8] Add QPIC SPI NAND driver Date: Tue, 21 May 2024 16:25:24 +0530 Message-Id: <20240521105532.1537845-1-quic_mdalam@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: UR4XJvet_Cf3h-Q1CMQFCkxcTxYVRUSe X-Proofpoint-GUID: UR4XJvet_Cf3h-Q1CMQFCkxcTxYVRUSe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_06,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=467 bulkscore=0 malwarescore=0 spamscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405210082 v6: * Added FIELD_PREP() and GENMASK() macro * Added qpic_spi_nand{..} structure for spi nand realted variables * Made qpic_common.c slectable based on either CONFIG_MTD_NAND_QCOM or CONFIG_SPI_QPIC_SNAND * Removed rawnand.h from qpic-common.h * Removed partitions.h and rawnand.h form spi-qpic-snand.c * Added qcom_nand_unalloc() in remove() v5: * Fixes nandbiterr issue * Added raw_read() and raw_write() API * Added qcom_ prefix to all the common API * Removed register indirection * Following tests for SPI-NAND devices passed - mtd_oobtest - mtd_pagetest - mtd_readtest - mtd_speedtest - mtd_stresstest - mtd_subpagetest - mtd_nandbiterrs - nandtest - nanddump - nandwrite - nandbiterr -i - mtd erase - mtd write - dd - hexddump v4: * In this patch series fixes kernel doc for all the cmmon api * Also fixes dm-binding commit message * Fix qpic_common.c compilation based on config v3: * In this patch series fixes multiple things like added clock-name, added _alloc_controller api instead of alloc_master, made common apis more generic etc. * Addressed all the comment from v2 patch series v2: * https://lore.kernel.org/linux-arm-msm/20240215134856.1313239-1-quic_mdalam@quicinc.com/ * In this series of patchs we have added basic working QPIC SPI NAND driver with READ, WRITE, ERASE etc functionality * Addressed all the comments given in RFC [v1] patch v1: * https://lore.kernel.org/linux-arm-msm/20231031120307.1600689-1-quic_mdalam@quicinc.com/ * Initial set of patches for handling QPIC SPI NAND. Md Sadre Alam (8): spi: dt-bindings: Introduce qcom,spi-qpic-snand mtd: rawnand: qcom: cleanup qcom_nandc driver mtd: rawnand: qcom: Add qcom prefix to common api drivers: mtd: nand: Add qpic_common API file drivers: mtd: nand: use FIELD_PREP and GENMASK spi: spi-qpic: add driver for QCOM SPI NAND flash Interface arm64: dts: qcom: ipq9574: Add SPI nand support arm64: dts: qcom: ipq9574: Disable eMMC node .../bindings/spi/qcom,spi-qpic-snand.yaml | 83 + .../boot/dts/qcom/ipq9574-rdp-common.dtsi | 43 + arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 2 +- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 27 + drivers/mtd/nand/Makefile | 8 +- drivers/mtd/nand/qpic_common.c | 740 +++++++ drivers/mtd/nand/raw/qcom_nandc.c | 1708 +++-------------- drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/spi-qpic-snand.c | 1499 +++++++++++++++ include/linux/mtd/nand-qpic-common.h | 480 +++++ 11 files changed, 3180 insertions(+), 1419 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/qcom,spi-qpic-snand.yaml create mode 100644 drivers/mtd/nand/qpic_common.c create mode 100644 drivers/spi/spi-qpic-snand.c create mode 100644 include/linux/mtd/nand-qpic-common.h -- 2.34.1