Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp894887lqg; Sat, 2 Mar 2024 06:14:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUu52PWHQwPrqTgoZbS3LkwIxKPTSPGW5PAm6J0JivNYdXzCP/7gTc5owOgF8BnaH8asvSkUaMqY0nAWIEHy6CYchnZMj9TZiLRG91jA== X-Google-Smtp-Source: AGHT+IFx89iGLX5d1BxGUGk7ISzlfQpAPB6UH182mmnh/pZLpgDScKp1n8ida1py64VPoKzKKxFH X-Received: by 2002:a50:d5d0:0:b0:566:ab2b:e1ce with SMTP id g16-20020a50d5d0000000b00566ab2be1cemr3118075edj.18.1709388854084; Sat, 02 Mar 2024 06:14:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709388854; cv=pass; d=google.com; s=arc-20160816; b=rZ0mVfyq0Pok9HPMJYnFZwZb3NPJKO9TAy2g/eHgP/BWH3DOyoF2aViNECnDWckiPd LMChIZZTSLwDZw4fhg7DqlnKoOAYzYCS/dmqP1TDC/PwuXpMih8UWQ7RwQC6ZHnCO73S EiODv7mGzjI2HF4AAj4pou3zglEH+pRZQFD3jQ8/VS5D+FBSTe42tru9R4/PHRV4sNIh vJ0hupOos7xC26+qrKEwLig6PTmfY6WIuNuVrNW/dYvhuUsiCARX2HNVG9P5FYZZj23N Us804kQuEvwVfx1UDdWK6Ev9Dcq6PNfYEnHCfjBXQ8rBjavM4EqWkUtQLl3o2PqA00ZK vWpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=NKIETOZ4FqtbCWIIUqHgmH6Dmy63ZDts7WC4LmwcGxU=; fh=oR0dMlcqiZQI88ODqJ7+k8J362R1TTHkNYOhrt0US68=; b=voi/GdfHuYvWRBZRtWdC5ncQxJZ48OWLImAdHU1cYQUWYtyT15G4UpBDFUZZhHShPp 8pZAuoXNQqdvLqBpU+0GnGx34xW7XGAJbRDrPl0uuteG8lliIBKeAeRHaUxlqo+G+SCc sDU2SEqXvAXAxCKcpS1kA7eq+Mp7gR8XZCKgOMZWMzadh8bP9dPUSYDX2t95iyWT57TP PrCa43TATX79g72XthYVrLcmGElxVJgWVEYfAAW2NuhBa61OXzKw26gFMdwfD42ChR8E gO+jzB2uXw5GAGKarEGy7IrZgIoKZBZ97WXsIL/whPB2uLylwIHx+VuZPGsiqUYF/DIs /P4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=lVTcx+js; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-89462-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dg16-20020a0564021d1000b005647dac6af5si2464690edb.312.2024.03.02.06.14.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 06:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89462-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=lVTcx+js; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-89462-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 988E91F21AB8 for ; Sat, 2 Mar 2024 14:14:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C35317C62; Sat, 2 Mar 2024 14:14:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="lVTcx+js" Received: from xry111.site (xry111.site [89.208.246.23]) (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 F1EC917573; Sat, 2 Mar 2024 14:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709388845; cv=none; b=uBOUqjQeXSfgBgtXk2L0CoyoBqw0YkEf35iwXTVoUPvCncd9UwfLjG3sBNie3i/k405ScI3e82lzpaGDisxGDQKkz7n7wZNvkI3x5wFqLckj14phMNwE8oI0/OmHd4qZBahpj+cDSkLBavXsMITSO0S8egMlF+kUPQMEA3+TMog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709388845; c=relaxed/simple; bh=rrs7FTnn5zBbVusszKQ43BrCp14rs9R6rlivEgH7f50=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=K1l6FPeK+N5HeKok6Y5XO+pmGol9qHIrRGs4unCNOzT9qzPMA9uprhtABBwRcIRORaJTRLgqc4IMnN4aFhQa0wWJ9msm51aWEcYpZ8NWunqi2s1w8YdJyfTeR39/BCwKDWnN1P6hzS7Q3MNclSV6fNZnzSvMjxSVRxXWqQkPLlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=lVTcx+js; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1709388840; bh=rrs7FTnn5zBbVusszKQ43BrCp14rs9R6rlivEgH7f50=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=lVTcx+jsGLuJR11oql/QnfWS3jjbEP8a5/zlWwYoC+FHZnei9srvrgdW9IH1WkzQe ppyNY4UBWnKZlEXNFuruHrQymD0WOnE3CxHu1kY7AeJ20LaEQXby6ND544Vi21k+6T KFC42n6IiUbcLE073jvAa2FovXzOa4aHx5SXz11M= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id DDCBC66B29; Sat, 2 Mar 2024 09:13:57 -0500 (EST) Message-ID: <110fa8d6be78a26ca21cd97c55903f5d62776430.camel@xry111.site> Subject: Re: [PATCH v8 4/4] riscv: dts: thead: Enable LicheePi 4A eMMC and microSD From: Xi Ruoyao To: Drew Fustini , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Guo Ren , Fu Wei , Conor Dooley , Rob Herring , Krzysztof Kozlowski Cc: Jason Kridner , Robert Nelson , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Date: Sat, 02 Mar 2024 22:13:55 +0800 In-Reply-To: <20231206-th1520_mmc_dts-v8-4-69220e373e8f@baylibre.com> References: <20231206-th1520_mmc_dts-v8-0-69220e373e8f@baylibre.com> <20231206-th1520_mmc_dts-v8-4-69220e373e8f@baylibre.com> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2023-12-06 at 00:09 -0800, Drew Fustini wrote: > Add emmc node properties for the eMMC device and add sdio0 node > properties for the microSD slot. Set the frequency for the sdhci > reference clock. Hi Drew, I've been using the emmc on LicheePi 4A for a while without any problem, but when I try the microSD slot I get: [ 0.531804] mmc1: SDHCI controller on ffe7090000.mmc [ffe7090000.mmc] us= ing ADMA 64-bit [ 0.842674] mmc1: Tuning failed, falling back to fixed sampling clock [ 0.855139] mmc1: tuning execution failed: -5 [ 0.859609] mmc1: error -5 whilst initialising SD card [ 11.359879] mmc1: Timeout waiting for hardware cmd interrupt. [ 11.365661] mmc1: sdhci: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D SDHCI REGI= STER DUMP =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ 11.372105] mmc1: sdhci: Sys addr: 0x00000001 | Version: 0x00000005 [ 11.378547] mmc1: sdhci: Blk size: 0x00007040 | Blk cnt: 0x00000000 [ 11.384989] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000010 [ 11.391432] mmc1: sdhci: Present: 0x03ff0000 | Host ctl: 0x00000017 [ 11.397873] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 11.404312] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x0000000f [ 11.410753] mmc1: sdhci: Timeout: 0x00000004 | Int stat: 0x00000000 [ 11.417192] mmc1: sdhci: Int enab: 0x00000020 | Sig enab: 0x00000020 [ 11.423633] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 11.430073] mmc1: sdhci: Caps: 0x3f69c881 | Caps_1: 0x08008177 [ 11.436513] mmc1: sdhci: Cmd: 0x00000102 | Max curr: 0x00191919 [ 11.442954] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x07725f7f [ 11.449394] mmc1: sdhci: Resp[2]: 0x32db7900 | Resp[3]: 0x00400e00 [ 11.455835] mmc1: sdhci: Host ctl2: 0x0000300b [ 11.460280] mmc1: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000008= 82220 [ 11.467416] mmc1: sdhci: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D [ 11.563828] mmc1: Tuning failed, falling back to fixed sampling clock [ 11.576053] mmc1: tuning execution failed: -5 [ 11.646438] mmc1: new high speed SDXC card at address aaaa [ 11.653170] mmcblk1: mmc1:aaaa SR256 238 GiB I can write something into the SD card and read it back though. But this makes me reluctant to use the SD card for "some real thing" afraid of a data loss. The SD card is a SanDisk Extreme Pro 256GB (rated "U3, A2, V30"). Any idea how to debug this issue further? (Maybe I should try change the SD card first but I'd like to discuss the issue before paying money for another card.) > Signed-off-by: Drew Fustini > --- > =C2=A0.../boot/dts/thead/th1520-lichee-module-4a.dtsi=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | 20 ++++++++++++++++++++ > =C2=A01 file changed, 20 insertions(+) >=20 > diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arc= h/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > index a802ab110429..1365d3a512a3 100644 > --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > @@ -29,6 +29,10 @@ &apb_clk { > =C2=A0 clock-frequency =3D <62500000>; > =C2=A0}; > =C2=A0 > +&sdhci_clk { > + clock-frequency =3D <198000000>; > +}; > + > =C2=A0&uart_sclk { > =C2=A0 clock-frequency =3D <100000000>; > =C2=A0}; > @@ -36,3 +40,19 @@ &uart_sclk { > =C2=A0&dmac0 { > =C2=A0 status =3D "okay"; > =C2=A0}; > + > +&emmc { > + bus-width =3D <8>; > + max-frequency =3D <198000000>; > + mmc-hs400-1_8v; > + non-removable; > + no-sdio; > + no-sd; > + status =3D "okay"; > +}; > + > +&sdio0 { > + bus-width =3D <4>; > + max-frequency =3D <198000000>; > + status =3D "okay"; > +}; --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University