From patchwork Wed Jan 22 09:47:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Gupta X-Patchwork-Id: 13947056 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 70755210F7A; Wed, 22 Jan 2025 09:47:39 +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=1737539260; cv=none; b=lQJrfLxDudNTQ8nfFA89D66K4HfCX5RSuJ95D7MNHmKDdmvigWbeKvK8dpv9ot9PRYM0RCuNAgTPE6gaVgRJ05ZW2svC/G0df3+7PEuHdpq9eivSJECamAhSmyFQ0aYsCwDDMtdPWZknxb75XhTMdsuZ2gS3wldCr0LufSqaP1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737539260; c=relaxed/simple; bh=7ThAnBLDuyNLes3909bR3KbZBieJGPGTusa9FxiaGpQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q78Fyoit5GmlVBEdA8gj2aEENbwe2VLf4FfKt7PxeVZT6nEGqsEEQwUbB4BX1jHmkWksNXGnVz/5E9a8sNxRCAvIh1Y/HdgYcv9nbW3mH64Xbt6Z4WtVW4cboRcbscOSoipmH9Iw/aiOunR9vawgDqls/VBYsschIfci4l9rXuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Lzb1ml2d; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Lzb1ml2d" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50M4Z4Pd019857; Wed, 22 Jan 2025 09:47:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=kjU5fQuo+P+ke+jm/8Etxacy ahCtxiZnRKj3JClFncw=; b=Lzb1ml2dmG0gxeB/PtICl5ly/Kg3b3x2r0HSDjAZ BYL2/aQt2wsQaNK+AH9R0IErFlNKnzYehy80rc6Fv7Uis9vgQp4dLQEwZTAjSIvt aXLN/B/XH6TREmw8ts2bBmZO8a+vT30XssBmEJqIfi83rJmG8qEkaSwkJgu2Tbzg C2jKub4cuVoCHErUK5uZj5T0YGlLIANw4wGwSwYupU/+JGhzWM9UndFB+N31o2jO eWQShYEttqpGpbTFDSTL8MVmJeSucSyeZoTIrd4UUbNxBd0rEZVoS+9JE1Bu3pPo m92vJEjXRRQ/l//BP29ZRytpoBW/5yl9ZmByblJcpkKJXw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44ass6gq4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:35 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 50M9lY5T012094 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:34 GMT Received: from hu-sachgupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 22 Jan 2025 01:47:29 -0800 From: Sachin Gupta To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Bhupesh Sharma CC: , , , , , , , , , , , , Subject: [PATCH V3 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Date: Wed, 22 Jan 2025 15:17:04 +0530 Message-ID: <20250122094707.24859-2-quic_sachgupt@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250122094707.24859-1-quic_sachgupt@quicinc.com> References: <20250122094707.24859-1-quic_sachgupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: w0M2PPkWl0XkyIA0YB887CywsXELyj62 X-Proofpoint-ORIG-GUID: w0M2PPkWl0XkyIA0YB887CywsXELyj62 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-22_04,2025-01-22_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 mlxscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 mlxlogscore=754 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501220071 Document the 'dll-hsr-list' property for MMC device tree bindings. The 'dll-hsr-list' property defines the DLL configurations for HS400 and HS200 modes. Signed-off-by: Sachin Gupta --- Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml index 8b393e26e025..65dc3053df75 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml @@ -133,6 +133,11 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 description: platform specific settings for DLL_CONFIG reg. + qcom,dll-hsr-list: + maxItems: 10 + $ref: /schemas/types.yaml#/definitions/uint32 + description: platform specific settings for DLL registers. + iommus: minItems: 1 maxItems: 8 From patchwork Wed Jan 22 09:47:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Gupta X-Patchwork-Id: 13947057 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 1D95E2045B8; Wed, 22 Jan 2025 09:47:46 +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=1737539268; cv=none; b=jQGkvikAKg92N6dWu4FB0ReGegKFRRkcnv/56qHQ+DCN0eS56JP//fWP/2i5FFBfMIyFoywk3d56bY+Hab+78n/wAem+bwR6+R5zG64KnNx1m+mcIx350M93Dq2k+XO9d0GSHoMf1XcPIU9l8jFwfwHx8nHr/sfIapNu8jYXYX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737539268; c=relaxed/simple; bh=2vHIPKLtZ2t+xF8Jk0+RscKZ/NTrz1FN3rJXy+dFbF0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l8djlLnzJTowqveJqi6fwYTEVz46iXkm+y6sOhdt9ZUq9nSelVYUqlgHEx3gFC8M1vOtHKYNDDTWyN05aWAw29QL6VlRqAovKPY93xl35qkQTGxbCEVzHXKfjF3n/oCwr27H3L80ATc/UezilYTA598B/F5jtxxgsq1pkzT2E14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=eWdtcwzf; arc=none smtp.client-ip=205.220.180.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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="eWdtcwzf" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50M9Cr37011285; Wed, 22 Jan 2025 09:47:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=9+GVJilRkjRmijSx4TTaZJD8 Ux7+0yDr0iqhNkEInGw=; b=eWdtcwzflZQ1et3oRrSfhlZVSni4LAcyVtCHoMb9 MNLAu3Q8d172wOSh/3lKhK505N6G+nKi4Ax8OF53bzkc558fqOmSkpa5NDPn8XV5 TVztji7b9mT21R4sG3hzEGT7MSUxtKV1GCmGRObv85NNbSiHKsQHclHqueDIn9JT XzGqouzFpcCVU2wa9ms5jONuIg/RdXWZJXehfX5CYv8/37wipy7JgfflsOgJIFyO oEZ1oXEvFp7kCypZVpxvk5aoeyuvlFpa8kV2IKvd1lu6EELv5ooyH7Ci+mX/2MQd McDlGFGxSACrpCSKH36KOhj2w84YT4LZfXT6KAh7KMZGhg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44awuh02vg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:41 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 50M9le7U015288 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:40 GMT Received: from hu-sachgupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 22 Jan 2025 01:47:34 -0800 From: Sachin Gupta To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Bhupesh Sharma CC: , , , , , , , , , , , , Subject: [PATCH V3 2/4] mmc: sdhci-msm: Add core_major, minor to msm_host structure Date: Wed, 22 Jan 2025 15:17:05 +0530 Message-ID: <20250122094707.24859-3-quic_sachgupt@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250122094707.24859-1-quic_sachgupt@quicinc.com> References: <20250122094707.24859-1-quic_sachgupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: BthDaR5UUmn2pRRGUnAnOYSxcj0F2xGX X-Proofpoint-ORIG-GUID: BthDaR5UUmn2pRRGUnAnOYSxcj0F2xGX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-22_04,2025-01-22_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501220071 This change adds the core_major and core_minor variables to the msm_host structure, allowing these variables to be accessed more easily throughout the msm_host context. This update is necessary for an upcoming follow-up patch. Signed-off-by: Sachin Gupta --- drivers/mmc/host/sdhci-msm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index e00208535bd1..2a5e588779fc 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -273,6 +273,8 @@ struct sdhci_msm_host { bool tuning_done; bool calibration_done; u8 saved_tuning_phase; + u8 core_major; + u16 core_minor; bool use_cdclp533; u32 curr_pwr_state; u32 curr_io_level; @@ -2557,6 +2559,10 @@ static int sdhci_msm_probe(struct platform_device *pdev) core_major = (core_version & CORE_VERSION_MAJOR_MASK) >> CORE_VERSION_MAJOR_SHIFT; core_minor = core_version & CORE_VERSION_MINOR_MASK; + + msm_host->core_major = core_major; + msm_host->core_minor = core_minor; + dev_dbg(&pdev->dev, "MCI Version: 0x%08x, major: 0x%04x, minor: 0x%02x\n", core_version, core_major, core_minor); From patchwork Wed Jan 22 09:47:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Gupta X-Patchwork-Id: 13947058 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 B65062045B8; Wed, 22 Jan 2025 09:47:53 +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=1737539275; cv=none; b=V7u1LfA+SeYZvRMM9kTxmU+ZFQVb2ZXqNYq2CkKC+Jb0VHjwyZh6umBzu7yLipdUxWzIrMnYGRwsX4A9fbnPHqViu/FNOtCwbGWx6OCH1QExmM3aYmkkX3oC3biPt+AD+PcQ/DXjTGYtJNFzBVgYVuKhROCc4cIuaPa+2fkJO5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737539275; c=relaxed/simple; bh=6MQTm0M+4JRN14R2eEGNkVlhwNA6fJMYo9T+BuvkwLU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Aj91igv6T7yI9Ddk4x/FBytE/X9Ao6xMFMJCxIJG86QgJvv6eqtNb3RaManJObu2sDdPGblVg5qvjrt3HgvhQOEChn85oWgzxnwQgbvslwRan3NX3/k8z886kIyij2cIbWNLcgR9u484VNySPPUgEdOacwLKANDvMt2bezUIv9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DTPX4dLb; arc=none smtp.client-ip=205.220.180.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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DTPX4dLb" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50M50qjZ028601; Wed, 22 Jan 2025 09:47:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=x0hjGoAlxes+TCXc/ILkT4sj QR0wC/aPxjbcWnB/3mI=; b=DTPX4dLbS7p03atc9cNCBgT/QDuhHQg6f81LGVnR MjvNeb+Se8wlk1xTRq4AEI8MzYYAwKvfCBs3RAlZQNX6wrbjZAb7quXHl3p3/Lvx VwHZ9AAyqt6cOnGHXP/eBPW8vlNt577wXWoIgBPqHq1cEffyTKoXyaE3VvUh07l3 isK0S67ZVp244XHbcISXVgDBkZAboT3YAe6SFwdlBt9IobHfRiJop/xmLmG9epom OdaZ0umxOYdJuSV1I/3i/RjIvtb/OIbtNvSHQjZ0HmO1oZmw61KzmtpcOihqUgvj yALCvQ3Zv/ds+Abe/2sGcix9jxpDkGTTpr22FV/kkq6RRw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44at5dgnch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:48 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 50M9lkAC011432 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:46 GMT Received: from hu-sachgupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 22 Jan 2025 01:47:40 -0800 From: Sachin Gupta To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Bhupesh Sharma CC: , , , , , , , , , , , , Subject: [PATCH V3 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Date: Wed, 22 Jan 2025 15:17:06 +0530 Message-ID: <20250122094707.24859-4-quic_sachgupt@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250122094707.24859-1-quic_sachgupt@quicinc.com> References: <20250122094707.24859-1-quic_sachgupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: y0dLewZrzgBIgPzxfH6XQbnPM8oUwb7l X-Proofpoint-GUID: y0dLewZrzgBIgPzxfH6XQbnPM8oUwb7l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-22_04,2025-01-22_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501220071 This update introduces the capability to configure HS200 and HS400 DLL settings via the device tree and parsing it. Signed-off-by: Sachin Gupta --- drivers/mmc/host/sdhci-msm.c | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 2a5e588779fc..cc7756a59c55 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -256,6 +256,19 @@ struct sdhci_msm_variant_info { const struct sdhci_msm_offset *offset; }; +/* + * DLL registers which needs be programmed with HSR settings. + * Add any new register only at the end and don't change the + * sequence. + */ +struct sdhci_msm_dll { + u32 dll_config[2]; + u32 dll_config_2[2]; + u32 dll_config_3[2]; + u32 dll_usr_ctl[2]; + u32 ddr_config[2]; +}; + struct sdhci_msm_host { struct platform_device *pdev; void __iomem *core_mem; /* MSM SDCC mapped address */ @@ -264,6 +277,7 @@ struct sdhci_msm_host { struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/ /* core, iface, cal and sleep clocks */ struct clk_bulk_data bulk_clks[4]; + struct sdhci_msm_dll dll; #ifdef CONFIG_MMC_CRYPTO struct qcom_ice *ice; #endif @@ -292,6 +306,7 @@ struct sdhci_msm_host { u32 dll_config; u32 ddr_config; bool vqmmc_enabled; + bool artanis_dll; }; static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host) @@ -2400,6 +2415,74 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host) return ret; } +static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name, + u32 **bw_vecs, int *len) +{ + struct device_node *np = dev->of_node; + u32 *arr = NULL; + int ret = 0; + int sz; + + if (!np) + return -ENODEV; + + if (!of_get_property(np, prop_name, &sz)) + return -EINVAL; + + sz = sz / sizeof(*arr); + if (sz <= 0) + return -EINVAL; + + arr = devm_kzalloc(dev, sz * sizeof(*arr), GFP_KERNEL); + if (!arr) + return -ENOMEM; + + ret = of_property_read_u32_array(np, prop_name, arr, sz); + if (ret) { + dev_err(dev, "%s failed reading array %d\n", prop_name, ret); + *len = 0; + return ret; + } + + *bw_vecs = arr; + *len = sz; + ret = 0; + + return ret; +} + +static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host) +{ + int dll_table_len, dll_reg_count; + u32 *dll_table = NULL; + int i; + + msm_host->artanis_dll = false; + + if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list", + &dll_table, &dll_table_len)) + return -EINVAL; + + dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32); + + if (dll_table_len != dll_reg_count) { + dev_err(dev, "Number of HSR entries are not matching\n"); + return -EINVAL; + } + + for (i = 0; i < 2; i++) { + msm_host->dll.dll_config[i] = dll_table[i]; + msm_host->dll.dll_config_2[i] = dll_table[i + 1]; + msm_host->dll.dll_config_3[i] = dll_table[i + 2]; + msm_host->dll.dll_usr_ctl[i] = dll_table[i + 3]; + msm_host->dll.ddr_config[i] = dll_table[i + 4]; + } + + msm_host->artanis_dll = true; + + return 0; +} + static int sdhci_msm_probe(struct platform_device *pdev) { struct sdhci_host *host; @@ -2446,6 +2529,9 @@ static int sdhci_msm_probe(struct platform_device *pdev) msm_host->saved_tuning_phase = INVALID_TUNING_PHASE; + if (sdhci_msm_dt_parse_dll_info(&pdev->dev, msm_host)) + goto pltfm_free; + ret = sdhci_msm_gcc_reset(&pdev->dev, host); if (ret) goto pltfm_free; From patchwork Wed Jan 22 09:47:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Gupta X-Patchwork-Id: 13947059 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 8828A21127E; Wed, 22 Jan 2025 09:47: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=1737539279; cv=none; b=bCuM3AIxdF2jkYWoqA5QJWoZLkRhFbf7dxHBM1t1LX6hBj7Q9/1vA56b/Z0wJ3N4W0fhhCZtYCI2CO+G3fxAN8AuN8gn7aDnjPSlf9AUDXiK95eSNf3+YAb0w+KqvshOr2GQlMjU4PmIAYptF3bJN8JIRShMZG5NqsFVKMjOIwE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737539279; c=relaxed/simple; bh=RltWS3odla8Xp7YHVwZ+kpLqUMDsDKyu4GqI/llHI8Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nmf1eNVtVFsCb5u4oNZz9eX43WzxZcXD+uMPCQ1SJSApnd+v51lb1FU8roCCKIBQgF2qxnU+LC2VxT+R6YBKJ2gXw/e51XeYQ14RmmspujuRK6tBkl7wAx3IIXrg/ryzZD3SCUoQW1/Ob2tut490BJAG4x4Y/b6cRvn7T/gNx00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=V3vxLzMe; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="V3vxLzMe" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50M9QWCs029827; Wed, 22 Jan 2025 09:47:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=V4kPluLrC1oqmOXr743d2A/a +i+Ptwv9VmhBK4u0PnU=; b=V3vxLzMeVVzqDrfJsTJp4pl9ocn8B135yhxGIAiQ 7jHjmj8rk6bGNDt4ilNsnWD1iBc9rd92a5G/cpPb2ECX8ubMQurIxMzDRj8qr1O2 xEnZMWnxZPLJJ11fKY7qAocmyMpgQJf26+I6aZCQU/a9zCOXHt6w9GDpE0eeiDmx AoOfVs85Rnc4EVQMXz2KP8NG7M9bTC91isvAOrfjUIxXPFXNyZHe51lbMqMGrC2Z dNL/M/riNzevHD3XUv41z0dLM6lbOvcAxUGuX7Fb7ytZJvb7aFwmGR0mf2V5izAB jR3f9MsY7BASjUZnd0zUtcuYVr6ptk4s3g7Q31MXj1LDig== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44ax1yr1u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:53 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 50M9lqox012219 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2025 09:47:52 GMT Received: from hu-sachgupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 22 Jan 2025 01:47:46 -0800 From: Sachin Gupta To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Bhupesh Sharma CC: , , , , , , , , , , , , Subject: [PATCH V3 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Date: Wed, 22 Jan 2025 15:17:07 +0530 Message-ID: <20250122094707.24859-5-quic_sachgupt@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250122094707.24859-1-quic_sachgupt@quicinc.com> References: <20250122094707.24859-1-quic_sachgupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: S41j86cScUfDe-Obc5zKJ3bGNNsVaFlf X-Proofpoint-GUID: S41j86cScUfDe-Obc5zKJ3bGNNsVaFlf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-22_04,2025-01-22_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 spamscore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501220071 With the current DLL sequence stability issues for data transfer seen in HS400 and HS200 modes. "mmc0: cqhci: error IRQ status: 0x00000000 cmd error -84 data error 0" Rectify the DLL programming sequence as per latest hardware programming guide Signed-off-by: Sachin Gupta --- drivers/mmc/host/sdhci-msm.c | 270 ++++++++++++++++++++++++++++++++--- 1 file changed, 252 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index cc7756a59c55..17f17a635d83 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -28,6 +28,7 @@ #define CORE_VERSION_MAJOR_SHIFT 28 #define CORE_VERSION_MAJOR_MASK (0xf << CORE_VERSION_MAJOR_SHIFT) #define CORE_VERSION_MINOR_MASK 0xff +#define SDHCI_MSM_MIN_V_7FF 0x6e #define CORE_MCI_GENERICS 0x70 #define SWITCHABLE_SIGNALING_VOLTAGE BIT(29) @@ -118,7 +119,8 @@ #define CORE_PWRSAVE_DLL BIT(3) #define DDR_CONFIG_POR_VAL 0x80040873 - +#define DLL_CONFIG_3_POR_VAL 0x10 +#define TCXO_FREQ 19200000 #define INVALID_TUNING_PHASE -1 #define SDHCI_MSM_MIN_CLOCK 400000 @@ -309,6 +311,16 @@ struct sdhci_msm_host { bool artanis_dll; }; +enum dll_init_context { + DLL_INIT_NORMAL, + DLL_INIT_FROM_CX_COLLAPSE_EXIT, +}; + +enum mode { + HS400, // equivalent to SDR104 mode for DLL. + HS200, // equivalent to SDR50 mode for DLL. +}; + static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -793,6 +805,211 @@ static int msm_init_cm_dll(struct sdhci_host *host) return 0; } +static unsigned int sdhci_msm_get_min_clock(struct sdhci_host *host) +{ + return SDHCI_MSM_MIN_CLOCK; +} + +static unsigned int sdhci_msm_get_clk_rate(struct sdhci_host *host, u32 req_clk) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + struct clk *core_clk = msm_host->bulk_clks[0].clk; + unsigned int sup_clk; + + if (req_clk < sdhci_msm_get_min_clock(host)) + return sdhci_msm_get_min_clock(host); + + sup_clk = clk_get_rate(core_clk); + + if (host->clock != msm_host->clk_rate) + sup_clk = sup_clk / 2; + + return sup_clk; +} + +/* Initialize the DLL (Programmable Delay Line) */ +static int sdhci_msm_configure_dll(struct sdhci_host *host, enum dll_init_context + init_context, enum mode index) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + const struct sdhci_msm_offset *msm_offset = msm_host->offset; + struct mmc_host *mmc = host->mmc; + u32 ddr_cfg_offset, core_vendor_spec, config; + void __iomem *ioaddr = host->ioaddr; + unsigned long flags, dll_clock; + int rc = 0, wait_cnt = 50; + + dll_clock = sdhci_msm_get_clk_rate(host, host->clock); + spin_lock_irqsave(&host->lock, flags); + + core_vendor_spec = readl_relaxed(ioaddr + msm_offset->core_vendor_spec); + + /* + * Always disable PWRSAVE during the DLL power + * up regardless of its current setting. + */ + core_vendor_spec &= ~CORE_CLK_PWRSAVE; + writel_relaxed(core_vendor_spec, ioaddr + msm_offset->core_vendor_spec); + + if (msm_host->use_14lpp_dll_reset) { + /* Disable CK_OUT */ + config = readl_relaxed(ioaddr + msm_offset->core_dll_config); + config &= ~CORE_CK_OUT_EN; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* Disable the DLL clock */ + config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2); + config |= CORE_DLL_CLOCK_DISABLE; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2); + } + + /* + * Write 1 to DLL_RST bit of DLL_CONFIG register + * and Write 1 to DLL_PDN bit of DLL_CONFIG register. + */ + config = readl_relaxed(ioaddr + msm_offset->core_dll_config); + config |= (CORE_DLL_RST | CORE_DLL_PDN); + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* + * Configure DLL_CONFIG_3 and USER_CTRL + * (Only applicable for 7FF projects). + */ + if (msm_host->core_minor >= SDHCI_MSM_MIN_V_7FF) { + writel_relaxed(msm_host->dll.dll_config_3[index], + ioaddr + msm_offset->core_dll_config_3); + writel_relaxed(msm_host->dll.dll_usr_ctl[index], + ioaddr + msm_offset->core_dll_usr_ctl); + } + + /* + * Set DDR_CONFIG since step 7 is setting TEST_CTRL that can be skipped. + */ + ddr_cfg_offset = msm_host->updated_ddr_cfg ? msm_offset->core_ddr_config + : msm_offset->core_ddr_config_old; + + config = msm_host->dll.ddr_config[index]; + writel_relaxed(config, ioaddr + ddr_cfg_offset); + + /* Set DLL_CONFIG_2 */ + if (msm_host->use_14lpp_dll_reset) { + u32 mclk_freq; + int cycle_cnt; + + /* + * Only configure the mclk_freq in normal DLL init + * context. If the DLL init is coming from + * CX Collapse Exit context, the host->clock may be zero. + * The DLL_CONFIG_2 register has already been restored to + * proper value prior to getting here. + */ + if (init_context == DLL_INIT_NORMAL) { + cycle_cnt = readl_relaxed(ioaddr + + msm_offset->core_dll_config_2) + & CORE_FLL_CYCLE_CNT ? 8 : 4; + + mclk_freq = DIV_ROUND_CLOSEST_ULL(dll_clock * cycle_cnt, TCXO_FREQ); + + if (dll_clock < 100000000) { + pr_err("%s: %s: Non standard clk freq =%u\n", + mmc_hostname(mmc), __func__, dll_clock); + rc = -EINVAL; + goto out; + } + + config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2); + config = (config & ~GENMASK(17, 10)) | + FIELD_PREP(GENMASK(17, 10), mclk_freq); + writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2); + } + /* wait for 5us before enabling DLL clock */ + udelay(5); + } + + /* + * Update the lower two bytes of DLL_CONFIG only with + * HSR values. Since these are the static settings. + */ + config = (readl_relaxed(ioaddr + msm_offset->core_dll_config)); + config |= (msm_host->dll.dll_config[index] & 0xffff); + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* Wait for 52us */ + spin_unlock_irqrestore(&host->lock, flags); + udelay(60); + spin_lock_irqsave(&host->lock, flags); + + /* + * Write 0 to DLL_RST bit of DLL_CONFIG register + * and Write 0 to DLL_PDN bit of DLL_CONFIG register. + */ + config &= ~CORE_DLL_RST; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + config &= ~CORE_DLL_PDN; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + /* Write 1 to DLL_RST bit of DLL_CONFIG register */ + config |= CORE_DLL_RST; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* Write 0 to DLL_RST bit of DLL_CONFIG register */ + config &= ~CORE_DLL_RST; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* Set CORE_DLL_CLOCK_DISABLE to 0 */ + if (msm_host->use_14lpp_dll_reset) { + config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2); + config &= ~CORE_DLL_CLOCK_DISABLE; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2); + } + + /* Set DLL_EN bit to 1. */ + config = readl_relaxed(ioaddr + msm_offset->core_dll_config); + config |= CORE_DLL_EN; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* + * Wait for 8000 input clock. Here we calculate the + * delay from fixed clock freq 192MHz, which turns out 42us. + */ + spin_unlock_irqrestore(&host->lock, flags); + udelay(50); + spin_lock_irqsave(&host->lock, flags); + + /* Set CK_OUT_EN bit to 1. */ + config |= CORE_CK_OUT_EN; + writel_relaxed(config, ioaddr + msm_offset->core_dll_config); + + /* + * Wait until DLL_LOCK bit of DLL_STATUS register + * becomes '1'. + */ + while (!(readl_relaxed(ioaddr + msm_offset->core_dll_status) & + CORE_DLL_LOCK)) { + /* max. wait for 50us sec for LOCK bit to be set */ + if (--wait_cnt == 0) { + dev_err(mmc_dev(mmc), "%s: DLL failed to LOCK\n", + mmc_hostname(mmc)); + rc = -ETIMEDOUT; + goto out; + } + /* wait for 1us before polling again */ + udelay(1); + } + +out: + if (core_vendor_spec & CORE_CLK_PWRSAVE) { + /* Reenable PWRSAVE as needed */ + config = readl_relaxed(ioaddr + msm_offset->core_vendor_spec); + config |= CORE_CLK_PWRSAVE; + writel_relaxed(config, ioaddr + msm_offset->core_vendor_spec); + } + spin_unlock_irqrestore(&host->lock, flags); + return rc; +} + static void msm_hc_select_default(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -915,14 +1132,31 @@ static void sdhci_msm_hc_select_mode(struct sdhci_host *host) msm_hc_select_default(host); } +static int sdhci_msm_init_dll(struct sdhci_host *host, enum dll_init_context init_context) +{ + if (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104 || + host->mmc->ios.timing == MMC_TIMING_MMC_HS400) + return sdhci_msm_configure_dll(host, init_context, HS400); + + return sdhci_msm_configure_dll(host, init_context, HS200); +} + +static int sdhci_msm_dll_config(struct sdhci_host *host, enum dll_init_context init_context) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + + return msm_host->artanis_dll ? sdhci_msm_init_dll(host, init_context) : + msm_init_cm_dll(host); +} + static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + const struct sdhci_msm_offset *msm_offset = msm_host->offset; u32 config, calib_done; int ret; - const struct sdhci_msm_offset *msm_offset = - msm_host->offset; pr_debug("%s: %s: Enter\n", mmc_hostname(host->mmc), __func__); @@ -930,7 +1164,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) * Retuning in HS400 (DDR mode) will fail, just reset the * tuning block and restore the saved tuning phase. */ - ret = msm_init_cm_dll(host); + ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL); if (ret) goto out; @@ -1018,7 +1252,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) return ret; } -static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host) +static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host, enum mode index) { struct mmc_host *mmc = host->mmc; u32 dll_status, config, ddr_cfg_offset; @@ -1041,7 +1275,11 @@ static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host) ddr_cfg_offset = msm_offset->core_ddr_config; else ddr_cfg_offset = msm_offset->core_ddr_config_old; - writel_relaxed(msm_host->ddr_config, host->ioaddr + ddr_cfg_offset); + + if (msm_host->artanis_dll) + writel_relaxed(msm_host->dll.ddr_config[index], host->ioaddr + ddr_cfg_offset); + else + writel_relaxed(msm_host->ddr_config, host->ioaddr + ddr_cfg_offset); if (mmc->ios.enhanced_strobe) { config = readl_relaxed(host->ioaddr + @@ -1098,11 +1336,10 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + const struct sdhci_msm_offset *msm_offset = msm_host->offset; struct mmc_host *mmc = host->mmc; - int ret; u32 config; - const struct sdhci_msm_offset *msm_offset = - msm_host->offset; + int ret; pr_debug("%s: %s: Enter\n", mmc_hostname(host->mmc), __func__); @@ -1110,7 +1347,8 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host) * Retuning in HS400 (DDR mode) will fail, just reset the * tuning block and restore the saved tuning phase. */ - ret = msm_init_cm_dll(host); + ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL); + if (ret) goto out; @@ -1130,7 +1368,7 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host) if (msm_host->use_cdclp533) ret = sdhci_msm_cdclp533_calibration(host); else - ret = sdhci_msm_cm_dll_sdc4_calibration(host); + ret = sdhci_msm_cm_dll_sdc4_calibration(host, HS400); out: pr_debug("%s: %s: Exit, ret %d\n", mmc_hostname(host->mmc), __func__, ret); @@ -1169,7 +1407,8 @@ static int sdhci_msm_restore_sdr_dll_config(struct sdhci_host *host) return 0; /* Reset the tuning block */ - ret = msm_init_cm_dll(host); + ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL); + if (ret) return ret; @@ -1238,7 +1477,7 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode) retry: /* First of all reset the tuning block */ - rc = msm_init_cm_dll(host); + rc = sdhci_msm_dll_config(host, DLL_INIT_NORMAL); if (rc) return rc; @@ -1767,11 +2006,6 @@ static unsigned int sdhci_msm_get_max_clock(struct sdhci_host *host) return clk_round_rate(core_clk, ULONG_MAX); } -static unsigned int sdhci_msm_get_min_clock(struct sdhci_host *host) -{ - return SDHCI_MSM_MIN_CLOCK; -} - /* * __sdhci_msm_set_clock - sdhci_msm clock control. *