From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 A4959337BAA for ; Wed, 28 Jan 2026 21:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769636591; cv=none; b=mFN42dVKAVNJ4GW7phdBwXONQ6TeNFAl3oYd25E7yH17Mmj7fAdXHXgFaR1hcD6dYh1f0Uq+cBVUDjvcPPk00t1JVYWor674RurLx+bAesHwtL/4IhcZRlpkeLnjTTDi9NiEm13cKLHdwFCu1bnaTvCH9EpssZs8qEbk/W6ehJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769636591; c=relaxed/simple; bh=Z9jI3SbKMM6MP6CDPde2yJcyGBPqAJJ0bkp7IRWWQLA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eWBOp8EZb31paGAAo/Hp3ne5ZTtG3GQF2N9e+S/Pxfv4NYetap6/x/AsfB8ODyzm6C1E/M7Svap9UQwy2DPvtCQvOLpClvQKd6K0dSvkbGLgvFSF97wrsPP+YqPPFI4oakXuQubGEvIlNjdsEmPH7n3BWFw+7hshZ2AlVrLz8qg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=gCJYk2cg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ATCQx+AP; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="gCJYk2cg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ATCQx+AP" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60SH4BvO1407533 for ; Wed, 28 Jan 2026 21:43:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 694p56qmOVCQOsKwAm7dFp6MAQxFwO6++hWNZYgjm9E=; b=gCJYk2cgjy0uoyQT BO1Lro3w9aF0v5JgMJ0dKpha4oR4iOuuASg/JKOYPf0fcPfyioXf6hAJGbsY5V3K zTguP+7J+atDGPaAfQzNPh6JT423pZ5njoiwrIWYqC/Uluva99Ncwrgm5mS+8p7G U2aQcjQcaiKctzbgbX/op9t/blcH3iknjdccraDN8ay9xeUmzs1XoLR1iBFvQLif yCI/jNzXhhafjYRI/m1vnbsz02Slo0RRyAhLXk83A7OztSbTHyjs5WHrQ0QCs1/m lxiROXsjuJNSvnesy1ei012chuYNnYIA5B6WDs7FhUNMPlVei2QIUWsXCL/7LL1w 2RPUDA== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4byphggt75-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 28 Jan 2026 21:43:08 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-2b6f0b345e3so2532337eec.0 for ; Wed, 28 Jan 2026 13:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769636587; x=1770241387; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=694p56qmOVCQOsKwAm7dFp6MAQxFwO6++hWNZYgjm9E=; b=ATCQx+APpQl6iHbdIn119d9EvCaDCj+QL+p20artC6cwhsv4j4nUW11lQDCbtg0xgG knITBUEBO/nCuNuPrR9Mp4B7BUZsBnQHUXjiFYBGlmWc9ajUc6gp7XWmbnxUjmYEUu1X e8K/sn4nk4n0l+vouBJzGcofzbO+PEg6GrWPi8A8zbtjsGQJE0srdQ4ED37bZ50Cha4h XoUnydIezfIICRM0N3+fBW9ysMr2B0UDG04agi8Z2YPkJDQOry3xUO6fLmSl1qgf8uP0 AQTUWka1eed6AZsCgI3C8avaa2WXl82+s87wWo5z8u6SDewLehRtQ0GM7d5Qi8I0MnJm 4r+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769636587; x=1770241387; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=694p56qmOVCQOsKwAm7dFp6MAQxFwO6++hWNZYgjm9E=; b=f13HEVvOSCaaqnslD3IdpBKyrXKaZu8e1mk6WvDKAcvRIZrjS2KheDNvvi6inETf4J cEHp7F9Y8/6ohcpkeyuqjnx6fcK8XQuxylMzWm+sQGG5pyR0FYb9camOSeckHGABmj9n RuLGqTz91ehxo5Tf/68rJKivtTiI4s3F7OUymx+fcPFr2WlM5SgnWHwbiVR7z1EsLhe4 e0jb1qEPuIkX8Q+vu1yAOjt2ls4oc7I7JypC1sdsywM0xOKEf5PszMlV2G86yPcx2EKY F91zPQUuP/GibG/RIcRLD72uSiYnJo64Ck/i/XgX/B2wXy1EFOCRvZKn9jQ6DWZMx0mG QSyA== X-Forwarded-Encrypted: i=1; AJvYcCW+FJECkPOxYlMj6f/fasLneXMEdcYnrfhdN3kFmhrXmiayMaSbNdHonCV5IbDdpcmpmY5DmrJIGX1bX9s=@vger.kernel.org X-Gm-Message-State: AOJu0YxdNzp1wEclIyD+zKKfch/WzUs4WuNGWapEru7OGMECWHPCWf2A yIp3LnS72wi1yZNiRdssy2ThPuxXsa2eOWpFWPIFc3Q3Ga2Bx3EVIFuHfVcCSDvPrZCdKTevVkU m7XpSace+l5iCQkiI2o6BMyudbUlyo5mF2UFYXbjFHupweXi5T4Z5pqf6zZuCexw6vKg= X-Gm-Gg: AZuq6aLx3BSTok1yM/wJPfiV2AXkDIrEgiNFbrmNoFAGk+QCxOFalYBu+ZGmLrLEH+H I4O1UfXd/U+1XLXCkQFaPeWHVlxq4O09F3hcpEgJ5GBN1SWri9Au6J4i7wojPuDlsvhbebZSe26 2VrgC+Uc/XDZ3kc0rvHKTJ95FKwr/oB8vWxGUHEI6V76+24PCpIkojvxN8D7pjxitRj2LtR7WxE PhoTz+IEOnqsv+T9cfJPfc1r9sUIq1tLYK3QeRof99tqUIQ1/SNWC+zSTk+8xpIsUb0aohtFtHC 9w9rn6PBVtc4Sqg7YoRrJMrIEL52y1U9sOz+u9K668fngtHKUsLTZvMqVG+WuAY3ZKSZU+5XkuW ZOr60ViAwbh2bgGPcVsncfd8pqBrSMAgQL6bF330wL5LmIP/dA6Pfxas+/xFaqvGn3qCP X-Received: by 2002:a05:7300:6428:b0:2ae:824e:31ba with SMTP id 5a478bee46e88-2b78d8cb64emr3980096eec.7.1769636587366; Wed, 28 Jan 2026 13:43:07 -0800 (PST) X-Received: by 2002:a05:7300:6428:b0:2ae:824e:31ba with SMTP id 5a478bee46e88-2b78d8cb64emr3980081eec.7.1769636586750; Wed, 28 Jan 2026 13:43:06 -0800 (PST) Received: from [10.134.65.116] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a1adc5ecsm4795082eec.24.2026.01.28.13.43.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jan 2026 13:43:06 -0800 (PST) Message-ID: Date: Wed, 28 Jan 2026 13:43:05 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/2] mtd: devices: Qualcomm SCM storage support To: Junhao Xie , Bjorn Andersson , Konrad Dybcio , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Xilin Wu References: <20260126-scm-storage-v2-v2-0-fa045c7e7699@radxa.com> Content-Language: en-US From: Trilok Soni In-Reply-To: <20260126-scm-storage-v2-v2-0-fa045c7e7699@radxa.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 9L04H3ig-4bnHyZS8G6XUhUZlHfXyJNc X-Proofpoint-GUID: 9L04H3ig-4bnHyZS8G6XUhUZlHfXyJNc X-Authority-Analysis: v=2.4 cv=J/inLQnS c=1 sm=1 tr=0 ts=697a82ec cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=ksxQWNrZAAAA:8 a=y_qrqjq6FbBQszKUsJIA:9 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 a=l7WU34MJF0Z5EO9KEJC3:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI4MDE3OSBTYWx0ZWRfX+g+sxSOJnfHf cSOjVqfgEelTgErExzDqk/qwUPEPEez3CJQpD5Vy4RvGIQNY2mZoF0HencT48Qtsk1MefXXUzHe ngHsYusJPDPniakyH037SGeDO02FSRLhhn8QMB8QvONXlNlsOURlicOqZwbCPUZUPYfZmRzsDhN jUwOdTr6fLw2SdlnP/anDi0KyXzazpG2XO1qJRQniG8Qzv2jlKzuul/A2YGbXZV3yQiwIDAFWA3 xX6G2JTEsWnsbQr9Dj6pyBB4141IqyNqVslfK23UB2z8GlLtXKH5LgAerE7+gqmfZMhcAJPGp4X 7nmSP2uuJvaK5xAEdelImLA7N6jSYRthDNc99ZCJuphbo4K9I/Ez+2P8DtMxgR3Ds8UUuZt8z/4 Lx5io7H0jw7jYyKQ2Fv//qlO/5ftvM/cL8RfRy4dUKCcW/vj4Kw+3Fbu+HSCrgFp4iPc+1OHluT aE7YLW55ioKtzozfVDg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-28_06,2026-01-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 spamscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601280179 On 1/26/2026 3:44 AM, Junhao Xie wrote: > This patch series adds support for accessing storage devices managed by > Qualcomm TrustZone firmware via SCM (Secure Channel Manager) by > introducing a new MTD driver. > > On some Qualcomm platforms, firmware or BIOS-related storage (typically > SPI NOR flash) is not directly accessible from the non-secure world. > All read, write, and erase operations must be performed through SCM > interfaces provided by the secure firmware. As a result, existing MTD > SPI NOR drivers cannot be used directly on these systems. > > This series introduces a new MTD device driver that exposes such > firmware-managed storage as a standard MTD device in the Linux kernel. > The driver is built on top of the existing Qualcomm SCM infrastructure > and integrates with the MTD subsystem to provide a uniform interface to > userspace. > > This driver has been tested on Radxa Dragon Q6A, based on the Qualcomm > QCS6490 SoC, with a Winbond W25Q256JWPIQ SPI NOR flash device. > > Note that this platform previously used the standard Qualcomm Linux > firmware, which allowed direct access to the QSPI controller without > needing this driver. However, we plan to migrate to a Windows-compatible > firmware which is more feature-complete but restricts direct access. > Device tree changes for this transition will be sent separately. > > If kernel boots with EL2, access to the SCM storage will be denied. This > needs more investigation. So you plan to enable this driver only w/ the Gunyah based configuration and disable for the KVM one through the devicetree overlay ? I just don't want to break the KVM boot flow on other platforms supporting qcs6490. > > Changes in v2: > - Convert enum qcom_scm_storage_result to macro definitions > - Use __qcom_scm_is_call_available() instead of a machine allowlist > - Add missing __packed annotations and endianness handling > - Introduce struct qcom_scm_storage_payload to improve readability > - Always compiled-in qcom_scm_storage_send_cmd() and qcom_scm_storage_init() > https://lore.kernel.org/lkml/F138514E18CB55B6+20251218180205.930961-1-bigfoot@radxa.com/ > > Tested-by: Xilin Wu > Signed-off-by: Junhao Xie > --- > Junhao Xie (2): > firmware: qcom: scm: Add SCM storage interface support > mtd: devices: Add Qualcomm SCM storage driver > > drivers/firmware/qcom/qcom_scm.c | 161 ++++++++++++++++++++ > drivers/firmware/qcom/qcom_scm.h | 3 + > drivers/mtd/devices/Kconfig | 17 +++ > drivers/mtd/devices/Makefile | 1 + > drivers/mtd/devices/qcom_scm_storage.c | 265 +++++++++++++++++++++++++++++++++ > include/linux/firmware/qcom/qcom_scm.h | 34 +++++ > 6 files changed, 481 insertions(+) > --- > base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377 > change-id: 20260126-scm-storage-v2-0a4f3e900b88 > > Best regards,