From mboxrd@z Thu Jan 1 00:00:00 1970 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 E5F9A1A239A for ; Thu, 29 Jan 2026 14:17:40 +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=1769696262; cv=none; b=irNdZJvVjSJGbEathpOaDMQtX4w3hpYGu24LwtCN/Ku5lPXeLCR50y6B4aB68aMvllIJ8whEDg19DlK7MCg5Qkirzg5hV4STNqlkDfh8YCkoOhYLBCvibqn7MScC2ROePbodghDxilJAgJVY9fpmI+TFPZuPLVqR3LAYzbIKYB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769696262; c=relaxed/simple; bh=QxW0f6pLDBRENUCo+Z37WURx1pG8/E2qFBSIDtV/2/c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=O2HnZ+WAnJV3OATVW9S8ZiP9Z36sDhU6iiVTucjJGMbQ87ZxO97m3lphS8Va4kaIePX46LwfGGpDtN/699gscaT3vDXSRstRKe+S3oTbROknCHkoF8Wz7s8z8ULx6B4ZfevN6VJAJg0MYXLHNcFu5pfnAzBZwELkMCKWdK7fdkM= 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=lJoRJwY/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aoOflR/V; arc=none smtp.client-ip=205.220.168.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="lJoRJwY/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aoOflR/V" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60T9vMqJ2059987 for ; Thu, 29 Jan 2026 14:17:40 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= sPxS5c0pRe16fDouaE61U8nM92dYddyMAnv3v5fItBU=; b=lJoRJwY/N5LLdmaz yP8ORpj6R15zgxFrSasCs3DZqbVnj6B09H1/2FTb+qCBPO4UkeYzaIfRSrLhhA3J S7FLdbv2Ow73wUSOeqd+AOYyiOD6MpNOVAVjH0JXAHuMzXBYprqkkGZtQ9FlheHe jcFwq0ph8mGDaTXtOtgUYDIeTGoFP8vBhONEZRQFLcehjK1KfF/X/OBvd1CCc5Lg 5GMl6pcTlzuqbKBK1yCiA1tA+6n62GZvucwd/Prj4vJQAN6M9sbraLtA9frGO3YW rO6HCj3LcbiFI1aeOQLcUq0HXhDB3agMITSEjDrZW8wlGM3QBo5EXPBu3yJWEV0e irvtfg== Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bypgrkpg1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 29 Jan 2026 14:17:40 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-5ee9e287d7aso20434137.3 for ; Thu, 29 Jan 2026 06:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769696259; x=1770301059; 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=sPxS5c0pRe16fDouaE61U8nM92dYddyMAnv3v5fItBU=; b=aoOflR/VWy8eWr4jWv93mfElXeXyuYFSDpHZ4f2JfeAVzTFVA5IscBv31r8bSswVwD AZ27DnnZRe8zYijlFCJ/7A5FXunZzx6B6pfMuFBdjqsVF0mKTNpdPCFXEjHfcZYHo3Xl O8VmX1E6bVoYpjTRkxFD4cCYPsbE2gJQrPnr4PUmyPgQVKrKiFLgn6PgGBhi4XSfHy/W brvR22eKtqWGZIPnjE38NL7MLaxE6N2a/Hc7xw/IotL/kIvEk4JM6xljaPrqJtd67KmH cKeUp3K5SJIfRzV6UANdTS50Q8T5kbRbTTj3SrWnxRb/MEiy/UB3IVMFneA4x3KhiFND NQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769696259; x=1770301059; 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=sPxS5c0pRe16fDouaE61U8nM92dYddyMAnv3v5fItBU=; b=jg8gOcNZk7CJzUSnWTGsTXn5+IKBWnEANbFtGlpcqVNiUYrZ0VroGvROpnzUcPa7zE ys0iXQIx75uSm/YPnffFqEvX1NMJWxQDsFTvO819QbHYsciuYQbsWd2rSjpZwJBRMt2P BIRVlKH7fwSWJDsyLNamgYGsWbb0We21ToxoLy8qjOIK2O0CebZKnaKmSEHG8oPDIAh7 wIX5DoWWOMP9TXni61Ig9gHURir4vPEMvW6cHvm2abne3gRF/4Kiv2pM5lsr66ZGhp6Y zLsmsKg0n3DtCRCiydcBIc/QPBZIf3HNdr6FqZ1wY3JY+qw9BCRjhg/NlMePf2YkAC+n 9TfA== X-Forwarded-Encrypted: i=1; AJvYcCV2WyFq3CFiQZzlAAatgMAK23JH+IMgtLVw0TA2ydd4RUJNcMWByM1veOeRU5iWeupJcBi7FTwhZGs3xHc=@vger.kernel.org X-Gm-Message-State: AOJu0YwaAL+8Kc9xguQsH7fy9JqpewMSX0ot3zgp530sC8Pyj7IlVMaw Zx7FHjPASOCBAyNaUeTxnn6wQ8/uZtG0JyV7IjpUu7qsI83Bs5UFjsy3Csp4pbCQMNuUGemw+gY BOQkzahLQl6bFvc47U/oHRxi1p26SU37yezus4yI9VRWZm8AH/ANbzKLZ0rNfzvbDZH4= X-Gm-Gg: AZuq6aLt7fAKOsx1SO5vm2UUrhrzXZl3c2BnI5t+mUu+RvZdIXvZZMXDianacusNDhg LkJnY0uG99QRAtN3dmBGRGzvx9X6QjlAtdU1JHnTStRtT+OMTV7SryuCOm5YjoJShZDcnVfcma2 aaeZYZa+xEh5FH5aMzqtqquj5j+nw+9LEg8S1SL5n281cC+11zDSNzL1wopuPqg6HXOGEQuDJHY mj73nofCkBH2LmX+5fgX/8PGML7uC2DjEV+bbl1KIKD6JBAwc4PyMCjxFAeFWRXEfd77Y/jmVxJ +seas/HZcnyQ06UmldIV6zCLgTfbd9pAPbGJXj2j67icqw1cso7dKTfvQnz6qtRKFVllHQURaqn Beg0IHZnIMTMJ2BGYUroF7jdMEjAedWJ0j90lmIaGHE6YP56UD+lngq5Y3+bh81jdz1s= X-Received: by 2002:a05:6102:4186:b0:5ec:95a0:6aac with SMTP id ada2fe7eead31-5f87e834e64mr1047579137.4.1769696258903; Thu, 29 Jan 2026 06:17:38 -0800 (PST) X-Received: by 2002:a05:6102:4186:b0:5ec:95a0:6aac with SMTP id ada2fe7eead31-5f87e834e64mr1047572137.4.1769696258373; Thu, 29 Jan 2026 06:17:38 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e074b2d89sm1145142e87.49.2026.01.29.06.17.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jan 2026 06:17:37 -0800 (PST) Message-ID: <42c1c820-f235-4d7b-af58-c0b9a4d331cb@oss.qualcomm.com> Date: Thu, 29 Jan 2026 15:17:35 +0100 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 , Trilok Soni , 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> <2397C90D8A633438+88e8956b-5753-4842-a1c7-b0f6a78580c1@radxa.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <2397C90D8A633438+88e8956b-5753-4842-a1c7-b0f6a78580c1@radxa.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=d7T4CBjE c=1 sm=1 tr=0 ts=697b6c04 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KV2aPqcVs2_3Sbi7RCIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-GUID: QjmvaWMC6HCqLu-vTuJPQwj1axSdIQ3P X-Proofpoint-ORIG-GUID: QjmvaWMC6HCqLu-vTuJPQwj1axSdIQ3P X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI5MDA5NyBTYWx0ZWRfX3plx18s7InW/ 7utt/NCMcoqYtgHu1FU0DJGFsQsZMjBs6GUkUhlLw4JkdXgEbABF2J2UbR/tlQP29UTEuv0w6qz ZAmN6dfB6hzFjiPEXDT0ndWzv9ALZ31ECg1gratFdS85vFN52Thkwd9XzOTXHrfKwZITPsHjrWL bkLEWItO4JB9/mX/JbW4VoU0yADeN44Trs0VNkje8n7iz+WB85tH8ff7uk7iUUfTAaWm0G5boHe G1KZ4THoaW5JkYA7k0C7BI4v/hmtGwIHcij+H9VnZydXzrVhDWZRA0lHSfMvjQ8iD1PyP8nto58 SzGOOYXGBekmVcX5MlcNIQC0CC1nse0xYCV4QTayxk6TpVP1ilVeGvRtnOEqpCORV8H6stvZwC3 um3/2mtOa8XFwBpX2enAjuE3I1AKK+z06PQD2NgpfZOu6AZ1bgiQBiisv92kAK01bdPzi0EJZzi 7CubBS0F03bKkBoJZLA== 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-29_02,2026-01-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601290097 On 1/29/26 1:47 PM, Junhao Xie wrote: > On 2026/1/29 5:43, Trilok Soni wrote: > >> 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. > > On systems booted with EL2/KVM, the SCM storage GET_INFO call currently > returns -EINVAL. If a platform does not support SPI-NOR or SCM storage, > __qcom_scm_is_call_available() will cause the initialization to bail out early. > > There is no DT-based enable/disable mechanism, and this should not affect > KVM boot flow on other platforms. > > Other QCS6490 LE platforms do not support SCM storage, as the LE firmware > does not support SPI-NOR boot. Radxa Dragon Q6A uses WP firmware and boots > from SPI-NOR. > > The root cause of SCM storage being unavailable under EL2/KVM is still under > investigation. > > [    0.770124] qcom_scm: convention: smc arm 64 > [    0.775005] qcom_scm firmware:scm: qseecom: found qseecom with version 0x1402000 > [    0.782990] qcom_scm firmware:scm: scm storage get info failed: -22 > [    0.999095] qcom_qseecom qcom_qseecom: setting up client for qcom.tz.uefisecapp I think you need to create a shmbridge when running without gunyah, see e.g. 4a7d6a78fbc6 ("firmware: qcom_scm: Add a prep version of auth_and_reset function") where the memory is bridged right before the call. Without knowing any better I would guesstimate you may need to qcom_tzalloc (which does that under the hood) the 'struct qcom_scm_storage_info info' which you pass to that func in qcom_scm_storage_init() Konrad