From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (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 C3AB335CBC5 for ; Thu, 5 Feb 2026 07:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770277808; cv=none; b=CSMtjfU1SKiAsmuRbbByO3cmfkQCd41tWwpgezJ34xzc8s+fB6tsFzsP9Z+wtfJ4UW0hFl7razNw0xJ2Zf9OLj4oOvsa761WkSKHmN/US7ENBRApTGjiPwiesTWnUXZKZhA0meHZpN6IHoIJIHME/MDG4lp8OZQHLewJUug7LzI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770277808; c=relaxed/simple; bh=YXAjK+kHr7RRp8uV4R9UZ+srsvhC5cUBXR6u9xlEOnw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U6RKjEsksG4bpUEBaeVLfCJaVXewMcYqkS3b/SmPaEUnQW1DvDJF0k7X/FdDnvHnUm1BDgaIeFJn5/TobIsq3h8MPw09vO68vErq9/KSnfEXcgbARSi7zPT3+xVgwQ1y8xdnPz6kdxKf0Rne4TQ8BDM/zV3H9pJ3IgYLsgmvvzc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (4096-bit key) header.d=canonical.com header.i=@canonical.com header.b=Ta84+AVh; arc=none smtp.client-ip=185.125.188.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=canonical.com header.i=@canonical.com header.b="Ta84+AVh" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 985E33F784 for ; Thu, 5 Feb 2026 07:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20251003; t=1770277806; bh=UnRqSzV04ruJ+1tCzWkMo0BH08JoWQU7+eTA9S+H8e8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ta84+AVhL6Dlqmmid5hcUlKj6SgrnUM3SoD+ZriQoNXHeg9c4FKKWRSjj6P8UtC1k /9t6NOsVD5UbOFNyqnGOgN9jfjkSilhPYfi9rCloUBk6a5K6gA9g115cGr7Q9XTUtY jzuc79hWrfb4gS9GQcxw0fkcx2B9UK4IsuDjm78EjtPWiY69/nIgjyJewFLP03r0tS gpB1W8r9X9m5LynrUoI4ETvAt5P3V6AhMkhAcZi6O3UNhF1MeA+Mu0KZX+ejS8o2TK ojYtgkRgk7bTv393JGWv8+EVhShMUpBxtZ9nTL51+NirTyC3dI7OvD09RhT1kBkRyg qclWD58iqVI/rsI4gQ609240BuP0tdiRpoTxRw1u2mu4tfoNYH8OMPmemD/lF1iK7S x0ZBoGOHKEhLcgfjzAVjsEeNSWBdL2ykPtxPWR/v9+uqpHrAYfywlUSFi+bz5ce9qH aQzV7383kc86DqTTnbbR4QXa3oBtw6ZMdZlG4AnBut0W41g8JsxSFHIbPbhKEt3QF4 zhJVd1ohXSAvmjTTLuXbEWDuROY6+lMc7g9oyvbr0TC2wkTsTkgoMSQ7fE/pLz8txo wP929/fLtlPiOJwQ9a6dJeD5laduKOc4x59SOsShU3n1cHowEXLyPUZd1j9P6cJ0d3 v3fjZWLdRuFBWj7mmPDamVKU= Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-435aadfaf4eso468184f8f.2 for ; Wed, 04 Feb 2026 23:50:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770277806; x=1770882606; 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=UnRqSzV04ruJ+1tCzWkMo0BH08JoWQU7+eTA9S+H8e8=; b=dDevxOJuXVlccbx2WjeQRfPQQ5kP4s6FcNDV7EXmAGrO9irWGYlDbrqmzvcDNp5Z6t lETJe1visuPM2zeWrQ7yneEcz+TSSgEUTwFs+oDXLJtM6qL0roNVAyCGDVnpPDKmwKPF N70n3xGqpqX6tQw/eoBR5f+orezHGHUvZtdcTzEBYkMzcXg9EEgSGz6o3qhQf9O3WAkr 3DEWLM2vmOy+BfVqgmlV5Qmx/IMEFUMJyLpaDcI79BuKseQjBBSwzZyFyphL2iUqhjtM iH/q+FQsaR3GfgVXPUm4uLNlO0+KgxBLTfEooc/EzXeBDz/wa0PtEM4MP6hva5HKgHnE GXdA== X-Forwarded-Encrypted: i=1; AJvYcCVPZYKdEu6v/YwQSX2/U7e9+UmkcJkVjSI8QSzL6oQH+Tzgqp3/E7X8rAMxmlfyY5ZaC0iWRwCTqDABHgg=@vger.kernel.org X-Gm-Message-State: AOJu0YxXPMc/mlt6ajEACKYJRC7O8HSLd0D3JsZGGhmTatIXuGkxqaZE E07TK/rfrtXAI0Wo++lPw1LrSaHi/qHZb26JMIHgLcs/YmIYWvlOz2U61GQH/MIRAcWacAI/+Db nvx7pzS0HHWZ1HtlL2IzJmzoFs4L2EMs5DIkjUpluRYkKkfWNRAyt8NH9NKOm4RT6EOk6zpRoiq N/ZZJRqnUcKdkPbA== X-Gm-Gg: AZuq6aLpaZbOsrJvPG5HWDOqe8uZAzfcpUJR5FnIsMn0FOz5KPEOLPxqhcJU/Y37AZ9 NbthZJxIjBivQu8T89wewbi9agUotDLp856KRBcrUiZjp/bPFcRc2sISMCt5muCJ+W0MD5DkOav lCPjsXhmLelKD6/KLArMTpbaEbMkifnvZxMYxj25T/Vmj3BxAx+VTlYrj+WR/fHsL4Uz1RwzDNY M09qwHCI81JH39sXd4mPjnCu4oPOc5fTvTt4rvoYMlo4grfgYm7BE391l3BxLdQ0FKAoshqKOG2 FjPFobprRVvrY/SaU4A/WCR6MveZp8t9N8LCUi16GMpmwL5a+KQGXXMCr461bQgxu8QV9lSiXM8 xS5/a0cL8NuN1cTh1MU4ezir5xJ+m67c1zUWWAURDsO4buNuVxKYVNRy4ttiyuYhNdT1E4Uktq2 m9dcPUqEk= X-Received: by 2002:a05:6000:2505:b0:435:95dc:b8ca with SMTP id ffacd0b85a97d-43618052805mr7916338f8f.40.1770277804623; Wed, 04 Feb 2026 23:50:04 -0800 (PST) X-Received: by 2002:a05:6000:2505:b0:435:95dc:b8ca with SMTP id ffacd0b85a97d-43618052805mr7916240f8f.40.1770277803126; Wed, 04 Feb 2026 23:50:03 -0800 (PST) Received: from [192.168.123.154] (ip-005-147-080-091.um06.pools.vodafone-ip.de. [5.147.80.91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43617e38ec5sm12764912f8f.14.2026.02.04.23.50.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Feb 2026 23:50:02 -0800 (PST) Message-ID: <3166f7d5-b526-411d-b337-27981a7ed14d@canonical.com> Date: Thu, 5 Feb 2026 08:50:01 +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 1/1] riscv: dts: starfive: Milk-V Mars CM Lite broken-cd To: E Shattow , Emil Renner Berthing , Conor Dooley Cc: Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260204101602.30184-1-heinrich.schuchardt@canonical.com> <46d5d249-8cf2-46d1-a90c-1f2c5f146e15@canonical.com> Content-Language: en-US From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/5/26 00:16, E Shattow wrote: > Hi, > > I think the correct fix will be device tree overlays per-carrier board > and not this one-size-fits-all workaround with the System-on-Module. > Review below: > > On 2/4/26 08:38, Heinrich Schuchardt wrote: >> On 2/4/26 11:16, Heinrich Schuchardt wrote: >>> The card detect GPIO depends on support by the base board. >>> >>> Detecting an SD-card did not work for me with a Milk-V Mars CM Lite >>> mounted on an Waveshare CM4-IO-BASE-A board. >> >> The schematic of the Waveshare CM4-IO-BASE-A board is available at >> https://files.waveshare.com/upload/a/aa/CM4-IO-BASE-A_V4_SchDoc.pdf >> showing pin 76 is not connected. >> >> In https://forums.raspberrypi.com/viewtopic.php?t=291041 the Raspberry >> Foundation explicitly wrote that pin 76 should not be connected when >> using a compute module socket. >> >> E. Shattow pointed me to a board >> https://github.com/NabuCasa/yellow/releases/download/v1.3c/ >> Yellow_v1.3c_Schematic_git.8957b440adda.pdf >> that actually disregarded this advice and uses pin 76 actually as cd- >> gpio. This usage of GPIO 41 is a property of the specific base board and >> not of the Milk-V Mars CM and should be described in a device-tree >> overlay if needed. >> >> Best regards >> >> Heinrich >> >>> >>> According to [1] SD_SDIO0_CD_GPIO41 is connected to pin 76 reserved. >>> The Raspberry Pi Compute Module 4 IO Board documentation marks that >>> pin as >>> reserved. The Raspberry Pi Compute Module 5 IO Board documentation >>> marks the pin as VBAT. >>> >>> Remove the cd-gpios definition and add broken-cd. >>> >>> [1]  https://github.com/milkv-mars/mars-files/blob/main/Mars- >>> CM_Hardware_Schematices/Milk-V_Mars-CM_SCH_V1.0-2023-0905_Lite.pdf >>> >>> Signed-off-by: Heinrich Schuchardt >>> --- >>>   arch/riscv/boot/dts/starfive/jh7110-milkv-marscm-lite.dts | 2 +- >>>   1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-marscm-lite.dts >>> b/arch/riscv/boot/dts/starfive/jh7110-milkv-marscm-lite.dts >>> index 63aa94d65ab55..566b0bdc2800d 100644 >>> --- a/arch/riscv/boot/dts/starfive/jh7110-milkv-marscm-lite.dts >>> +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-marscm-lite.dts >>> @@ -13,7 +13,7 @@ / { >>>     &mmc0 { >>>       bus-width = <4>; > > + /* Schematic signal SD_SDIO0_CD_GPIO41 to CM4 connector pin 76*/ > + /* Raspberry Pi CM4 specification pin 76 reserved do not connect */ > >>> -    cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>; >>> +    broken-cd; > > All schematic documents for Mars CM Lite list this signal name as > `SD_SDIO0_CD_GPIO41`. > >>>       disable-wp; >>>   }; >>> > > The carrier board I have a schematic document for - Home Assistant > Yellow PoE rev 1.3 - lists this as SD_DETECT, apparently ignoring the > Raspberry Pi Foundation document about CM4 Compute IO specification that > explicitly says do not connect this pin to anything. > > The carrier board I do not have a schematic document for - DFRobot > Compute Module 4 IoT Router Board Mini - only has SD Card and is > operational as-is. > > The compatibility issue for carrier boards that more strictly follow the > Raspberry Pi CM4 IO specification may be better handled by device tree > overlays. Though this is not convenient for users and requires more > developer effort, overlays would be best to adopt dtbo per-carrier board > to describe hardware accurately. > > What is needed to introduce overlays? > > - E Device-tree overlays would have to be applied by the firmware, typically U-Boot. The firmware has no way to determine if it is running on an IO-board with or without a card detect switch. So the selection of an overlay will be a manual process. In many cases users will not know about the issue of card detect switches and if their board has one or not. The default value without any overlay should be one that allows to use the SD-card on all IO-boards, i.e. 'broken-cd'. This is also the value used be the board support package https://github.com/milkv-mars/mars-buildroot-sdk/blob/1fd6bac9f2efde47fbb8afd28d2903c49f893e3f/linux/arch/riscv/boot/dts/starfive/jh7110-milkv-mars-cm-sdcard.dts#L265 Best regards Heinrich