From patchwork Tue Feb 14 12:02:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 5396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2930005wrn; Tue, 14 Feb 2023 04:07:15 -0800 (PST) X-Google-Smtp-Source: AK7set/CFGAtsxgq/y2NbST34PY54y7xxRvg+WgHA0TMqfdY5yHY02NuFOeXN5HCUvwGzDYNbsia X-Received: by 2002:a50:d481:0:b0:4ac:d14a:2ea6 with SMTP id s1-20020a50d481000000b004acd14a2ea6mr2031662edi.31.1676376435115; Tue, 14 Feb 2023 04:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676376435; cv=none; d=google.com; s=arc-20160816; b=eiCsmQ+1Qd3Le4rvl4N/v0Vu0HTB9sKwjcTy2m/zJk94w3EJvkEEIMJviPuPvSGtGv +Bxw4fiko3cw4XoOZ1dlGTeI15dPwaePr21m9kCSbO8GTuRWa4qAtNEgsWU4hnQAuR36 FPpd7MapnJpZ3V0BPZqQgwEBjlPas8EbF/Hr65jL9hurxYQtTaaUlhZgkTPGlSjtC21S RdzEM3UMbn0335Wut8yEzZ/6xJfR9i5+CxJuiKuSn23pApvfKp0NJKUpXawO3lUHFqJs D7ZOzSIUXfRwkN3LS6m2pvzlU6wN8zqw16S06PG5iS9iMhRy2q9sg31TPp1aacEfWth0 L4Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=I3shvzCeDJk0aJLXCz2Fi53c14j1PwpmIfo6GpvgOlk=; b=glPGJtlqK39DMSG+jQG59QHgfpPVu3VgL2J6sHS96ga6egWcRX4sn2lbS8MuHI6j5k QFxmHSbYxovWpypf0oiXMgynPqwX4tdWccCk2DnyHqiWZy5NKUPDPz33dhYihZbmhw4I iPPKxWgPbTIlRD9jkGgzVnQ5VyTAS5dmuSZHBl+/pHyHLcXKCrkPiZ1eFvzGdYc22kui RVioVGL3JlDB3OhS0INsT6B/vLBKDi51yif55kJekhy2VMMNIEQ9uOJMIZZbFJJ/EU2G Bk5eBJqA1mGY+Xv/QNRtI6snbKvNt3xbNjRqjAhgHsGswxzfLlrQQ/hwrSWX3fZM9yzo GVMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpgoiPKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a50ea86000000b004ab1b68b638si17364219edo.147.2023.02.14.04.06.51; Tue, 14 Feb 2023 04:07:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpgoiPKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbjBNMDG (ORCPT + 99 others); Tue, 14 Feb 2023 07:03:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232167AbjBNMDD (ORCPT ); Tue, 14 Feb 2023 07:03:03 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 135087EC9 for ; Tue, 14 Feb 2023 04:03:01 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id hg24-20020a05600c539800b003e1f5f2a29cso1036918wmb.4 for ; Tue, 14 Feb 2023 04:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=I3shvzCeDJk0aJLXCz2Fi53c14j1PwpmIfo6GpvgOlk=; b=GpgoiPKZCtdioxmx0gpNue68w9ZlaCkccA7QGPdTjaq0zhsTmu2n/A6Sf2DDTex1eV hPu1awwYrwjVOpeW9mbLHBdo+bqvIKl69WQgU1R/+HtrD8JTMJNZzKFn9csfK1XzQ1Qo qnf4/FEFukt4IZkJyHVEO46RyN+xTpzg4QIwqp5WJzCo0LNflou2ta2wKp9ddNuqYc/V KIM8Ufp43Szcqq94MUptQxETSi2K5Pa0kYxe/uUfYcCOUolVip300AIRHhcVCU3yvRxu y4bFXfNvH0JlzH/NinYZfnZjMZy7X+SYCLZ12KGiF3mFysT5KlLnE5gV6v+rAvv1sLJF KQpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=I3shvzCeDJk0aJLXCz2Fi53c14j1PwpmIfo6GpvgOlk=; b=bANSFs7XT0s5+FIltNxj1M7ylE36VQf4CEXjnEZCvVAhBduW9edHARLo/n6HIwpGhh MzO7/DNptAb3Q4JRPuQXhgzVGSjjlPaQ4l6dD954NTsW335yy1afoNM51iGNohYLnOb7 m7W6H/4fT2kZnIUWGJBESEamLKOL82726l8jf4MnwGZn7kS/sW2ZEUSI6IWBx3D+CFU7 EwcOwnaz/jcY72XVbGJxKJq3PFJgvsArcpwxvEaXys8piScI2afCLMr8fkimwFRHc46J nJnTjxJMnIVzmQMr3FyEaypwwsvxGA818KPhSSkR8IXCeSIJ6U0UJCkhkwoHP0wqzc1t HeDA== X-Gm-Message-State: AO0yUKUWknrFCBaBlW3yww0XlOBynT/mJmvFpdU+YNer9kDdT/xtp/Sl g+RwGzoVDFLMi2xRRGqqtxhkDA== X-Received: by 2002:a05:600c:4ab0:b0:3de:d9f:3025 with SMTP id b48-20020a05600c4ab000b003de0d9f3025mr1697260wmp.0.1676376179342; Tue, 14 Feb 2023 04:02:59 -0800 (PST) Received: from hackbox.lan ([94.52.112.99]) by smtp.gmail.com with ESMTPSA id l40-20020a05600c1d2800b003dd1b00bd9asm18834846wms.32.2023.02.14.04.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 04:02:58 -0800 (PST) From: Abel Vesa To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Adrian Hunter , Ulf Hansson , "James E . J . Bottomley" , "Martin K . Petersen" , Manivannan Sadhasivam , Eric Biggers Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Linux Kernel Mailing List , linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [RFC PATCH 0/5] Add dedicated Qcom ICE driver Date: Tue, 14 Feb 2023 14:02:48 +0200 Message-Id: <20230214120253.1098426-1-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757808096694664395?= X-GMAIL-MSGID: =?utf-8?q?1757808096694664395?= As both SDCC and UFS drivers use the ICE with duplicated implementation, while none of the currently supported platforms make use concomitantly of the ICE IP block, the new SM8550 allows both UFS and SDCC to do so. In order to support such scenario, there is a need for a unified implementation and a devicetree node to be shared between both types of storage devices. So lets drop the duplicate implementation of the ICE from both SDCC and UFS and make it a dedicated (soc) driver. This RFC should be treated as work-in-progress. Initially, its goal is to figure out what is the most agreeable implementation for both types of storage. Note that currently, only one ICE instance is supported (like the existing HW suggests) and it is laking refcounting and locking of any sort. Also missing bindings schema file for now. Any suggestions are welcome at this point, including the location of such a new driver. Abel Vesa (5): soc: qcom: Make the Qualcomm UFS/SDCC ICE a dedicated driver arm64: dts: qcom: sm8450: Add the Inline Crypto Engine node arm64: dts: qcom: sdm630: Add the Inline Crypto Engine node scsi: ufs: ufs-qcom: Switch to the new ICE API mmc: sdhci-msm: Switch to the new ICE API arch/arm64/boot/dts/qcom/sdm630.dtsi | 18 +- arch/arm64/boot/dts/qcom/sm8450-hdk.dts | 4 + arch/arm64/boot/dts/qcom/sm8450.dtsi | 24 +- drivers/mmc/host/sdhci-msm.c | 252 ++---------------- drivers/soc/qcom/Kconfig | 10 + drivers/soc/qcom/Makefile | 1 + .../ufs-qcom-ice.c => soc/qcom/qcom-ice.c} | 247 +++++++++++------ drivers/ufs/host/Kconfig | 1 - drivers/ufs/host/Makefile | 1 - drivers/ufs/host/ufs-qcom.c | 42 ++- drivers/ufs/host/ufs-qcom.h | 32 +-- include/soc/qcom/ice.h | 61 +++++ 12 files changed, 326 insertions(+), 367 deletions(-) rename drivers/{ufs/host/ufs-qcom-ice.c => soc/qcom/qcom-ice.c} (50%) create mode 100644 include/soc/qcom/ice.h