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 B205038423F for ; Thu, 12 Mar 2026 06:34:56 +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=1773297297; cv=none; b=FKEg3/k1CsqKwxDOCojkFwHJIWf8OoxHmThXyLJFRxZ8I1xAJulCGUCSJiql1C/2tXU+SXEBHeGL90jHoef/SNzPwTWKU0XlweKiuoMnBg0rZtoO3Fid6sm7aghEPwo8fEJE7I+NeBDuP02NdTyd1D2hmYr+XDXLbbNWGwDCYAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773297297; c=relaxed/simple; bh=FUxUDh7qrm0oeEUmw+VjOZXnXxJtzKNzhMYElE8ggBE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Qo2EJwzgwcCCsohCzyVzvP+nHuzKoEEO14eMuS4ElYNLzvl1ZpydpWDOKyXseqLfse2FvlVmlBhePKPhyHvD8xuQYGGVW+MnKCNLUBTmRqoUPirg92u/pCjTQiPj+JUrJrB/FQEKyvcGZdXjEGlkv88OQiCsTes7pOujMer8SBs= 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=fJUnzsgT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=U6P/DtdB; 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="fJUnzsgT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="U6P/DtdB" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62BMN2I93137216 for ; Thu, 12 Mar 2026 06:34:56 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= Gx9so5/H9hADS1SBta9ddxnmlLWWD5M+F9fr6sL/dgI=; b=fJUnzsgTR1TwQO7b fRFP7fvPGypOcU9Mps1AUjaykGTNGki9KobVoX09LAwwxETI08UCbhhWDiwdYVeQ U2NC+PwBhb66oMxrq6yTraQ91XQee4vmEuj66eB8Bhjt8PoR93CJynkuGdTqag24 flrQsP94HIA572XJR+kQ2Il1wk9vjM+GqpMPTLNsCkvMWnuSBHsyWwrhFqcBCFfU qiXBWDYQgQNjTeSJ9IEJZgtyLEdDRdWh24QTZuKZkJUdgW3bniqwpcU4KFOOECbf 7Rsw77LKDF0T4DsFhawV2dDR0IIrZd1SCT+931qJGYo//rFLnK358aDdU0W2Pq9i qaRLhQ== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cuh4w959w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Mar 2026 06:34:55 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-829ad81b132so2449751b3a.1 for ; Wed, 11 Mar 2026 23:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773297295; x=1773902095; 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=Gx9so5/H9hADS1SBta9ddxnmlLWWD5M+F9fr6sL/dgI=; b=U6P/DtdB08TBVG+0qap4aKucdjVuGRa1dDzMx7flcKNQvze0jkoY9OP+vvWW3J5JzX Sn/ERjwUHSu36uacF1w4SqFCI9HcYwowaJRs693/alshyNnQnJjGBumS1weixLwaVbyK cUrbiBKojpxW5SWlP6PP/cpF3P+ZkeLN7xns5SZZrt0chKheCv+wM3hPOuFiM4uQ09cH OVtGZfbjQ+VYIwAjXfWRWGExOEmPb/ba+ofNJwitpS7FkI9Ad9U3+HSfVg1oqvHgHICO W4em+fXTja2lHb7eTWfzkEnI1EMEiZYCRMHH0Yep0mYDn0vbNIlEqS2F+52ZYWbzQBsI 7L+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773297295; x=1773902095; 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=Gx9so5/H9hADS1SBta9ddxnmlLWWD5M+F9fr6sL/dgI=; b=UFjXzVXq3jZs+7ufsxz2mnFNFc8C2lHzv24DwMnqgbu+upjBIgkH19qwQ4//p6ymva /SHBJhS6Q/Tb4FuLeP9ahKFwW3hzDrwLrNBsAYBQeC9+YSJisavznDjl/QnrPZYY1bQM AKGhJCLGJPOgyjMZqXaue4NXHTAv6bIpIuQYOtylJ8YaM7jmetZ1pqo5F6YIqVyfpn1D yFIOGWv+B++6VjYUVTMAY4vTRu06t9Y3z/7KQSvNoD9DpJNUbxBtvc3XvrhkCigZNqlP h3VIqWQyXTcyuC1m/ehYgE4tq2d5qIKjvgQagbDXvylSqggKTiMJpzUzZb4CzUZQRz51 a6ug== X-Forwarded-Encrypted: i=1; AJvYcCXtMrazphpA5NKRLmkwkl4hEogNHmDFu/vrYAgfo/SckQHJEl6kybQT+8OenXizIu7rpPDXGXPCxvjaTpw=@vger.kernel.org X-Gm-Message-State: AOJu0Yzbcn5yN1fgppExT0pk1P6h1oy2/LdTL3WE1R7e8R5TDicAPz9R +Cs/7o2cj/3pINERqnKNdBHG0SxKg/RVTNTqITDcZCcF4zxGds5Fb8zu3dSLkzt6CznOFsMjWlm FgeqLVWMNDf9yXM4GMftvAvHjtvcUgTlkWk09+kejH0nm/41S+70sNKvlj1k7Ry/K3iU= X-Gm-Gg: ATEYQzz/V1/nF4+LOr02O27O2ZLClLYunQk2awxxhjtyZRxEmNQCK0leZQTYQTScuDw Tq0m7EFhmyVFBu8C7sr53gg0UtvHvqmsPb7KYf53fq7CcGkKYuHjYeBKJWvX8EsouTM66FIgFtq ui5NA2eKVU27ifAuxUf61e5kuHCsvf9bTkIUEjPPsXzElZWwFlMhXF2KmyEH0hCdVUPcQ273FOK 37wlhUQ295eqp2IP5BPsZhKAOdmm+fhNf7XEWlgjTELVhLcmmvn+xgmVykz/rtuldzRJcp41MIS SOsSLn0Kx3/VFCCkGW9NhcuY/70izsvJMvLJUpkvxCgdbTJ1dMoH/cijeloqzg1eHlKufQgF9fD MblOR5T4DiWqQzaoeKjnGjTtwmQj4NlqNSz1vT1TbbXCps8y211T8DSA= X-Received: by 2002:a05:6a00:1912:b0:81e:c5a:8c25 with SMTP id d2e1a72fcca58-829f7150647mr4231817b3a.44.1773297295235; Wed, 11 Mar 2026 23:34:55 -0700 (PDT) X-Received: by 2002:a05:6a00:1912:b0:81e:c5a:8c25 with SMTP id d2e1a72fcca58-829f7150647mr4231790b3a.44.1773297294709; Wed, 11 Mar 2026 23:34:54 -0700 (PDT) Received: from [192.168.1.8] ([106.222.235.28]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82a072612e2sm2132526b3a.21.2026.03.11.23.34.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Mar 2026 23:34:54 -0700 (PDT) Message-ID: <0bf0a64c-0f05-49ea-b7a2-e1b1345a3d7f@oss.qualcomm.com> Date: Thu, 12 Mar 2026 12:04:47 +0530 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 v1 2/2] arm64: dts: qcom: qcs6490-rb3gen2: Enable CAN bus controller To: Dmitry Baryshkov , Konrad Dybcio Cc: mkl@pengutronix.de, mani@kernel.org, thomas.kopp@microchip.com, mailhol@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andersson@kernel.org, konradybcio@kernel.org, linux-can@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, mukesh.savaliya@oss.qualcomm.com, anup.kulkarni@oss.qualcomm.com References: <20260108125200.2803112-1-viken.dadhaniya@oss.qualcomm.com> <20260108125200.2803112-3-viken.dadhaniya@oss.qualcomm.com> <5cdfe5a5-3c78-45a2-886c-768b224ad776@oss.qualcomm.com> <316fa702-6cd8-4842-aecf-c176a5a53e2e@oss.qualcomm.com> <5486697e-d02e-4b12-9a60-99d0de343515@oss.qualcomm.com> <2ho25tzct6t7gsuyufyg7m4a2ikmblhukb4uddwc7p35wd6yne@heippz3lh4kj> <465ab63f-3d0c-46f7-a08e-cdc5fc26b600@oss.qualcomm.com> <73nfsa3r3isf2shizemroctjpleya4wnnel634g7b5qyvvmze5@vre6wrdxxpet> Content-Language: en-US From: Viken Dadhaniya In-Reply-To: <73nfsa3r3isf2shizemroctjpleya4wnnel634g7b5qyvvmze5@vre6wrdxxpet> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: ZaRt7wrxOWJdwQn20jn8drL3wBz9mrJ2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDA1MCBTYWx0ZWRfX2351/oXk6nme KFL7XJ8o10ohZprlEf20zerHT7VXSgrzH9PdOlV5IXrVxicPk9W+Ddw5JEgRdoUuH9fb0d2d+vL f57lVXyWSaTV7+LBX9/s/8OT1YfpQE3wkoLHxZdpE6m9NqIR51L59lyfi5ROv5kbUznSvJ4oz+e 7wJRcfkZwWQ5W9w91V0+OmWD+qOZCxHgTW0dtHIkOLhhb+XRipZJP0Kx3v7kAJm/M67VLwva7mI fSnmsprkRxdrivI37bbXmIt5M5O4MmJAB+8B1rRPECg8CFTL8SaFyOfYybycsMfYEQW51/o5K6S ZPRV9uCp+P7xmnlInKgXcMg6GPU33CA7mjv8P4aBYsuhECWMpu6WUczWqqv4h9Y+QP1N+Cka9SO Vhk2aoyLmpNi6HEMLwP2ih4V+aSN0QOhlFutH+2vs5kHVqQRuwFBUJTQR3Rs8jX0Vx2LokMeWjZ E5WAVPJyDtdtFeNfYGw== X-Authority-Analysis: v=2.4 cv=YucChoYX c=1 sm=1 tr=0 ts=69b25e8f cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=Kc38NYG6zNWDZ5XZA/lzmQ==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=GPwEFdiLN6RVZEhl-y8A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-GUID: ZaRt7wrxOWJdwQn20jn8drL3wBz9mrJ2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-11_02,2026-03-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120050 On 2/18/2026 5:49 AM, Dmitry Baryshkov wrote: > On Tue, Feb 17, 2026 at 12:15:12PM +0100, Konrad Dybcio wrote: >> On 2/4/26 2:09 AM, Dmitry Baryshkov wrote: >>> On Tue, Feb 03, 2026 at 05:07:11PM +0530, Viken Dadhaniya wrote: >>>> >>>> >>>> On 1/19/2026 11:59 AM, Dmitry Baryshkov wrote: >>>>> On Mon, Jan 19, 2026 at 10:21:37AM +0530, Viken Dadhaniya wrote: >>>>>> >>>>>> >>>>>> On 1/9/2026 7:35 PM, Dmitry Baryshkov wrote: >>>>>>> On Fri, Jan 09, 2026 at 06:23:39PM +0530, Viken Dadhaniya wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 1/8/2026 7:33 PM, Dmitry Baryshkov wrote: >>>>>>>>> On Thu, Jan 08, 2026 at 06:22:00PM +0530, Viken Dadhaniya wrote: >>>>>>>>>> Enable the MCP2518FD CAN controller on the QCS6490 RB3 Gen2 platform. >>>>>>>>>> The controller is connected via SPI3 and uses a 40 MHz oscillator. >>>>>>>>>> A GPIO hog for GPIO0 is included to configure the CAN transceiver in >>>>>>>>>> Normal mode during boot. >>>>>>>>> >>>>>>>>> The main question is: what is so different between RB3 Gen2 and previous >>>>>>>>> RB boards which also incorporated this CAN controller? Are there any >>>>>>>>> board differences or is it that nobody tested the CAN beforehand? >>>>>>>>> >>>>>>>> >>>>>>>> The behavior is consistent across platforms, but I do not have details on >>>>>>>> how other platforms were tested. >>>>>>>> >>>>>>>> On the RB3Gen2 board, communication with the PCAN interface requires the >>>>>>>> CAN transceiver to be in normal mode. Since the GPIO-controller support >>>>>>>> was recently integrated into the driver, I configured the transceiver using a >>>>>>>> GPIO hog property. Without this configuration, the transceiver is not set >>>>>>>> to normal mode, and CAN communication does not work. >>>>>>> >>>>>>> How do we verify the mode on a running system? I have the boards, but I >>>>>>> don't have anything connected to them over the CAN bus. >>>>>>> >>>>>>> BTW: can you recommend any simple setup to actually test the CAN bus on >>>>>>> those devices? >>>>>>> >>>>>> >>>>>> I tested the CAN controller using the following commands: >>>>>> >>>>>> 1. Loopback Mode Testing (GPIO hog not required) >>>>>> >>>>>> ip link set can0 down >>>>>> ip link set can0 type can bitrate 500000 loopback on >>>>>> ip link set can0 up >>>>>> cansend can0 12345678#1122334455667788_B >>>>>> candump can0 >>>>>> >>>>>> 2. Testing with External CAN FD Adapter (PCAN-USB FD) >>>>> >>>>> Thanks! It's price doesn't make it esily available, but it answers the >>>>> most imporant question: by the USB CAN adapter. >>>>> >>>>> Did you add >>>>> >>>>>> A GPIO hog was required to configure the transceiver in normal mode. >>>>> >>>>> I'd phrase it differently: to pull the transceiver out of standby mode. >>>>> By using the GPIO pin you make it always stay in the normal mode. It is >>>>> fine, but it is not optimal. Instead a proper solution would be to use >>>>> the MCP251XFD_REG_IOCON_XSTBYEN bit. Could you please instead implement >>>>> support for setting that bit, based on the DT property. >>>> >>>> Thanks for the suggestion. >>>> >>>> I tested enabling IOCON.XSTBYEN, but on this hardware it doesn’t bring >>>> the transceiver out of standby by itself. With only XSTBYEN set, the bus >>>> remains inactive and no frames reach the CAN adapter. Clearing LAT0 >>>> (driving GPIO0 low) is required to put the transceiver into normal mode; >>>> data transfer works only after LAT0 is cleared. >>> >>> Why? It should be doing exactly what is required. Could you please check >>> the voltage on the pin with the XSTBYEN bit set? >> >> If I'm interpreting the datasheet correctly, XSTBYEN only muxes the pin >> into its function and does *not* actually impact the operating mode, >> which would match what Viken is observing > > See the "Family Reference Manual": > > Setting the XSTBYEN bit configures the INT0/GPIO0/XSTBY pin to > automatically control the standby pin of an external CAN transceiver. > The pin is driven high when the MCP25XXFD enters Sleep mode and driven > low when it exits Sleep mode. Standby pin control is not available in > LPM. IOCON is reset in LPM and GPIO0 will be configured as an input. I measured the standby pin voltage with only XSTBYEN=1 set (TRIS0 left at reset default of 1 = input): the pin is HIGH (~3.3V), meaning the transceiver remains in standby. The root cause is that after reset TRIS0=1 (input direction), so the pin is not driven. XSTBYEN=1 alone has no effect while the pin is configured as input. Clearing TRIS0=0 (output) atomically with XSTBYEN=1 fixes this: regmap_update_bits(priv->map_reg, MCP251XFD_REG_IOCON, MCP251XFD_REG_IOCON_XSTBYEN | MCP251XFD_REG_IOCON_TRIS0 | MCP251XFD_REG_IOCON_LAT0, MCP251XFD_REG_IOCON_XSTBYEN); After the above change: pin is LOW (~0V), IOCON = 0x03020042, transceiver active, CAN communication works. Verified on RB3 Gen2 with PCAN-USB FD. Should I send a patch implementing this, gated on a DT property such as "microchip,xstbyen"? > >> >> Konrad >