From patchwork Thu Jul 25 20:44:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814378 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566247wrn; Thu, 25 Jul 2024 13:45:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXYvtjFVpARv7xRm+Krn5Nt8pFgxkSWvKC68AWiJihsc7RvjVATaIn1GhoGVMIcjIm3XhBt28vS0Y8kWW6jxmZQ X-Google-Smtp-Source: AGHT+IFAyDW5RDw7/9GjgOluoIKihIRGY5He/66fMlxJluYnzevdCXr5il5sFZmF208e+t+gTd+M X-Received: by 2002:a2e:9916:0:b0:2f0:2d85:2238 with SMTP id 38308e7fff4ca-2f03dbf122bmr21201721fa.44.1721940341326; Thu, 25 Jul 2024 13:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940341; cv=none; d=google.com; s=arc-20160816; b=u/d0SSO4NsEpuHe4VyM4DXg40DLlPl+/CazG2//81LGZI8ZJVnAK9Uw4rof8Ha2VFu YSZQ/RUognVrgGDv3rugp6Bg+JeAxoxcjriCQNSalSyWM5t0J0T1gJTzRyrq+0r45tFg 9dSJSfer0RtRewi9xpePQyAgJd2xN0k2A5RM2eOV/7Vh8yFbXJO8/0Kg8GP4ULthpf+c czu6ZTlV8EDZY5peNI4SX68RmrjdIb9uHxqiz4ynCG8Lcucs7mDunVf8U6TOswPt3Jwp c3qUkO1WD4GFGRenmB7tAvmnXrjjBAZAHTRKWJtu8u0ITvbBLhc6en/VLXGGbAL2KMgM A6tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zje1NFV9nziFyD0oks5YEJm/m5MnJAqw0VsMOyG/zQQ=; fh=YoIYwCmulEs0e0rn8z1+P5nxdJUlupbmsDorjA5ecO4=; b=XmJI1QuK4oFKKEs6806RlEJ29Q8yOsh3EGLCWu5Y7AzVlaCRfSaa+MpsNxmLPs1cLJ rdOBGuKfujdtXUNZFx5XYXcA64v/y4kJCl0rYPeg+jZjZWRdAe169WZxah7grpKZm8rE lBJTUjHqoeBaXBOMpb7ebMMWCpVACwjsRcMfW8Dzz8cMqz1ePIhDdHK4gp8WdxRJ4+ru vDEk+zrleNXFivGVlls5KYYw36kT6LLLkN70oJ/+atBpuCgXv4/Z+NG0tBEuvXPzneC9 0+Gb6JbIZ8tWdUKSdnbwD3GgiZ5gNWo+iuDRgGm/ncPvYnp9g1QMtbdK3hKYoczCskN1 XDdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZZtJxiKU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d169bd8si6104451fa.480.2024.07.25.13.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZZtJxiKU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8E9BF883A4; Thu, 25 Jul 2024 22:45:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZZtJxiKU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D3BF88385; Thu, 25 Jul 2024 22:45:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7171988363 for ; Thu, 25 Jul 2024 22:45:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-2610623f445so466467fac.1 for ; Thu, 25 Jul 2024 13:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940322; x=1722545122; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zje1NFV9nziFyD0oks5YEJm/m5MnJAqw0VsMOyG/zQQ=; b=ZZtJxiKUzSdfGOh+JnszPaLw6yLn1YrNABGpbzgGgH+/rOUQnv/wbgsbY0Qof55sOo A12Mcw4bFkkofiOT2oAMaLhNh/0roDtiWwMG1izQvqhTxRvGBhEQf61gUhSyvESdyYJw 59nS+f+COmGQjQck6pglpBwh5xDyg6VUZ+WfRjYufLrqMheDB4CGnScVJ0JRU8rwne/3 YqxOBbLWspEvwmXUderzGnaOAB/ZdCHIvPRzJy5FFW1+sGhJdhjapuv2S7Z4vzcu9YIs 2xOHTXW+FLZK+Ji6Nz2+TCLIU4cmULb15jhmPYuXzB6iW3sxyRkqlJDeAFaBJqfCi+OK cXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940322; x=1722545122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zje1NFV9nziFyD0oks5YEJm/m5MnJAqw0VsMOyG/zQQ=; b=FU8tgmaraAi3gibIgQSbe7fT0VE2k2ilFSHAgZ7PvctvCCU32rCELOXi+8mEdXJsTZ PAYwAh+P5uFY0cV4ZdAbYw2/sNFaCQ6Iylq1STm0s7FqeDbDEPq1FASJgh+eEvrWTsM1 /toLVGhaii+Y5suhz05jSIP0dOgEGmPPSmAJrAw34KAFLqgzQVkNHywbjoM3tNtbtLfn 7l5l8JIAEFWWIdRIdo2aFp2RCl5plQ4gUQiSgUWvvH0m3fs4yC+ATdB4RPZJGB/0dARV eI2Mi1dP5Hx9MLktgo2z8gkqwYnf025skVT34HRDke7Vxm26S2mTLIcBgVmlLdhngV1u UASA== X-Forwarded-Encrypted: i=1; AJvYcCXOeomP9bvJU/WbUICc03Y4QHkGYvhIHg+02itqSitLkGhtC1YkcKcNQLbqg295bP2EZxfQHwcaM21SRA2SiU6V4Kogsw== X-Gm-Message-State: AOJu0YzKxIp1l5p9dwzGYfe3ag1gjHBWodWsY7df/s9tp7TukJyZeofj 06vdeLyMmUC1SEBDdYqbWWqhcfzMM3t9MRcdanDlRfRP8VrvAECiXzp1xrFEZrs= X-Received: by 2002:a05:6871:813:b0:260:eb3a:1bc with SMTP id 586e51a60fabf-266ede1179amr4183243fac.41.1721940322088; Thu, 25 Jul 2024 13:45:22 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2653e7c8aa6sm417228fac.32.2024.07.25.13.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:21 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 01/38] mmc: dw_mmc: Remove unused version field from struct dwmci_host Date: Thu, 25 Jul 2024 15:44:43 -0500 Message-Id: <20240725204520.18134-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Nobody seems to use it, so just remove it. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin include/dwmmc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/dwmmc.h b/include/dwmmc.h index 136a95b8cdb6..39024fb38aaa 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -163,7 +163,6 @@ struct dwmci_host { void *ioaddr; unsigned int quirks; unsigned int caps; - unsigned int version; unsigned int clock; unsigned int bus_hz; unsigned int div; From patchwork Thu Jul 25 20:44:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814379 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566297wrn; Thu, 25 Jul 2024 13:45:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWnAGAuecEPCWDfMYusR3vAjk23ixIiyGYohgZ1KhGnMyO2nYkoGP646jZVLWdpidsOWcV8YTTHQNYk3YZFf+C2 X-Google-Smtp-Source: AGHT+IF+NkuoZ7bAR4lqJQalH3HG/LurXVbsN1fd3oqxeRIA/lOilKq6E+u0hkd7/f9NZwfXxw4b X-Received: by 2002:a05:6512:2c90:b0:52c:d27b:ddcb with SMTP id 2adb3069b0e04-52fd6018cc4mr2318027e87.3.1721940353066; Thu, 25 Jul 2024 13:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940353; cv=none; d=google.com; s=arc-20160816; b=ts86I1lZ6q4dYteFjRiTWDI83WzdD7bsjEWZ6aghbQmTS/oiLARWUFwmwmVDtcaywE jEtNtNkF7IIGXdHyBhCAa50lphNe7ZuJYDg5kmJadJiuCYw9pGnlybhNNK/X/WP2Npuz 6ays/NGBS+ZbJdz0XFX/GqfWFganB4UOPELa9rpvKQs+lQW2/vmxTQw9HFV65d8hp5ry sZk8Rg8cJZJ9fS86d/A2qObCr2IlpGks52YfYxIW2s2RKlXieoKAy58DKTu2riFLW3MW GxDHJnWY+E18eSUpA7+uocdJOXrG35pfS8nkfVr585DcD0tSZNYiQfIO8VfPzUQXifpk Dz0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=epxP9uFws1EL9nsnErzdeDit6llhPxNdDYaSskV6G/g=; fh=DccRGvNaes5pYH1Phjq5WjQEXE3u1OsSfSgIBaIiMKA=; b=ARwC6IxcOCXpFmiOxNe9okbaY+9Mchx1pmoZ56JGioJin+dk6JIpPLxT011eHWBHvH PvIh+nH8Bb/WGd9iduEjwQABPExPx91nwM2rcs8h5ZOvbFvipnen+/hFyFZzJfOi3s3/ bCMKtTpwGXMlpHH7T7PFQFunTPhfcf+Y3BRfBahMsZfdKUaOr4Kg6zGyc2Zv+0o0g3BI l+wQh57N24Y35MgCnBxNP6vouO2beco8wjTW/nxg91qcCNCMH7CFSNc3TOXOU9GD6TE2 DhUA8RvHHTwGb/F4iaW8DyFk4tmOiUxR1JmRICCrnDTlMHYdJH/CxehiYlbT+ZHRlYs6 02Bw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3gS8CO+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5b94a1fsi675251e87.5.2024.07.25.13.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:53 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3gS8CO+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E74C58842C; Thu, 25 Jul 2024 22:45:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="W3gS8CO+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD63288365; Thu, 25 Jul 2024 22:45:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 21CE888370 for ; Thu, 25 Jul 2024 22:45:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5d5af7ae388so130898eaf.0 for ; Thu, 25 Jul 2024 13:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940323; x=1722545123; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=epxP9uFws1EL9nsnErzdeDit6llhPxNdDYaSskV6G/g=; b=W3gS8CO+wg9EnnOqnowry7yN+XRcj2YOND6Uk23K9fxu0mg0lNT4WMDcWWSMkDBGa1 58e5p5gy/wn524CqQeNZ9e6Q0APrgTIymW8WFs6Kc3BMN1oF8TTJmAl9RP1phc3wV9c2 ldoNSpiDKXivgQZpns3PAUQBsZ60gXee02tDqjBYv/yFjwk2zwuH6g+IBknEhIR3/ibW fcJnJdNUzxIc4Mk7h6P6HB8wWP0kdL0g5hKwIhSYKZhX/ZVKYHzn2DuzNRIpLhdL87V/ c0tISG+czwyhnzFbTTSPa+AYaZw2jJo1E8JhYBwQSRkGiSW8sm3cVGwXLdEzxGLOGX0a Z14w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940323; x=1722545123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=epxP9uFws1EL9nsnErzdeDit6llhPxNdDYaSskV6G/g=; b=ZP9uY0bd9K7kTkGRg0EMfD9pQLt2l6kmKoboGAza+NGiezT0XXN1qo/bCaoTgnVCH9 aoWYrHJdI9ssCzQ1G1L168sMtB6sLSBGU079iChbeVwEnDtB56qgmoORAQWAmtFIcgpF h/4JdDMVBrNK0ajY2gx5t7ZuyYPdWYcS1xLfu1qaWYu2+bCEJbduKHNJr9iVhDwbU0yP /jJXycLcDV8GgIdjYuWR6ptQQEb4I09ofmWukr8yzMiufTr8ilai/BNPhwWknuQ5xz/C W9+98pxMbKaNC3PRJlhRPO9WfV/lY+z9Fu7qMGCAnD7GQgoaXByMsEmV/7BeReH2dfWg +wsg== X-Forwarded-Encrypted: i=1; AJvYcCX8yWuLidkgULsq3BeNT/mvTfHgH8RZtutUyVKWckx1vyFq66oXYjEqA2VAtmOxvBaXPIoDyPs2Cq6lXD50jULUc/uTTA== X-Gm-Message-State: AOJu0YwnzYoqWnMrglojcKM0faYWOIJYxerzBhKNekJCzFaICKU1iTMY 6vuzZleab1ZSJMHSGDjSuIEFRYkDCLhWqqN+5Xt52rd3VRgFbs4QxGFJOr4LkeU= X-Received: by 2002:a05:6870:289b:b0:25e:ba6f:a93f with SMTP id 586e51a60fabf-2648e8d17a1mr3563888fac.13.1721940322841; Thu, 25 Jul 2024 13:45:22 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930795a43sm457531a34.80.2024.07.25.13.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:22 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 02/38] mmc: dw_mmc: Move struct idmac to dw_mmc.c Date: Thu, 25 Jul 2024 15:44:44 -0500 Message-Id: <20240725204520.18134-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean struct idmac is only used in dw_mmc.c, so move it there from dwmmc.h to avoid cluttering the interface in the header. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 7 +++++++ include/dwmmc.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index f4ecd7422cef..45665e517068 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -20,6 +20,13 @@ #define PAGE_SIZE 4096 +struct dwmci_idmac { + u32 flags; + u32 cnt; + u32 addr; + u32 next_addr; +} __aligned(ARCH_DMA_MINALIGN); + static int dwmci_wait_reset(struct dwmci_host *host, u32 value) { unsigned long timeout = 1000; diff --git a/include/dwmmc.h b/include/dwmmc.h index 39024fb38aaa..7e4acf096dce 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -198,13 +198,6 @@ struct dwmci_host { bool fifo_mode; }; -struct dwmci_idmac { - u32 flags; - u32 cnt; - u32 addr; - u32 next_addr; -} __aligned(ARCH_DMA_MINALIGN); - static inline void dwmci_writel(struct dwmci_host *host, int reg, u32 val) { writel(val, host->ioaddr + reg); From patchwork Thu Jul 25 20:44:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814380 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566355wrn; Thu, 25 Jul 2024 13:46:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSsubkM6K/veAnxy10tEREmPvDdyK3ljidVgaVQifj9VC7T2lMIqbQ1cS6bJ6gJln96E/QcJXw4cPHHekIyZTm X-Google-Smtp-Source: AGHT+IFhi5ZaCiIoNTEK4VGhyMg4oVuGlr9YYg2CNY48aheiu771Od0iptyZYtpT4MYTudD6q6X3 X-Received: by 2002:ac2:4e09:0:b0:52e:be49:9d32 with SMTP id 2adb3069b0e04-52fd3f78a06mr2823495e87.47.1721940364712; Thu, 25 Jul 2024 13:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940364; cv=none; d=google.com; s=arc-20160816; b=oi00DzV2NeZDVBGIupbDvpi1oMeSslAL8E2BH/BfaO6Z6vcBdL7ErqCHMIowQm5Kkm 73aj42zEtXciSYlT56eO4wXFKwTp7rz3oeRkjq+BIsYB2HX34hwSLsaw1icoBTm1eUw0 EWPKDQegofGfoCgx1yKghCz8dJ3RC4dAcGTRv3/eFDnKzRCi67Px17DhSYr/Xp4rBapG nx1Va1n6f33EpXVtLKzKgOHfpHMi1KF8Wm/Bh8MS3YLwwHYntEQlzC1W+nt1ugGc4e4f j0wAULZ32cyVUpMGVTU48gjmQ43lzmr1kB9LpFiXmO2kHM/lfJECfy1UiuPtGZVNpqQl sjcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AEaa0UgmA69sOJlXSnUibgJNWjLQa8i6ZNCcPfHIwDw=; fh=QQhRsY+g6U1du57yqTOg2GHH1d71LnG5bpIp0iOYzr4=; b=d8DgJJQKea2s7Z5rYvXYErD25Qjt1DiYWUNjZglR0A1qN2HmCwG8i/oknbHtgF90rY lfJJ6in5AhzuazfBZo1oxqcjLOy0HtHHLA4NMOQkdz8xtia8f9ZN4vyiHGgexOWHfc9Y JK139BQ7/WaiG0i9Tc3c/omZdnPyPlJbo6/Jp57Y4GMNnhJ0s5KYQpY4btJLdvdFRSKH zG4avpHB63F5N4DjmX1QWD4zeOuCgeP5ra4d3Gd9/Bf6Mb8JJ7Ekgr2mo6mbTuzHwZ9i Sx8iYk92lkjsEMdcE7L4k60GTam9fvGMTdR96Hf6eFGrljLot+sYIAi4HLm586ppncHn IrKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R3NLLRQo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5b9dd89si683377e87.186.2024.07.25.13.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R3NLLRQo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55877884AC; Thu, 25 Jul 2024 22:45:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="R3NLLRQo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 077CC88370; Thu, 25 Jul 2024 22:45:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D1D6E88100 for ; Thu, 25 Jul 2024 22:45:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7093472356dso192395a34.0 for ; Thu, 25 Jul 2024 13:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940323; x=1722545123; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AEaa0UgmA69sOJlXSnUibgJNWjLQa8i6ZNCcPfHIwDw=; b=R3NLLRQo//LXglPTVb03qNy0zQ68bXGDXjYVe3G1y+oJjHIvoM61rGUHXlgUN+UPe5 Pa5HdcGcfdzRJoJyY5rYranNX6qrnlyO/Kd4y1HuvIHcBL5EPVAJwMJdQ50anE+Oj/O2 neKU9F05O/F2HaxJij8ZC5JJGz6/yCP2a60B7NPuO/0u0OR+pkHfUyrYNmuoSbOsIjz+ pZL/7KxKWto4QyLl4gmrpqUWy1jLdeF2OsuAX3PqTcjuYxkKKWPb8qNWAu8O6HwZfurK Si+RxniVuXdaAx6B51nDBOUdTTFCvKDXDA+LFdsZhwG+wx/VcrlMwEGbaI4sQjKVsLtN 8R8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940323; x=1722545123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AEaa0UgmA69sOJlXSnUibgJNWjLQa8i6ZNCcPfHIwDw=; b=fxIv7Cx4P6ka3rTfvbAm6xcEy78GDIV09CE9u8iAWT92JYrzflBphqfZaJ6j4CKpum ADNNDj9fO//Ch6Pi1EvRgDE8F6UKIkVbMVLhuxIrKmqRk+tm8bDZGHiJBZRjnUiJKw/E e1qSoz9YrjcQkV7vb8ZuusinlwcLPOdfGpQDd+7CWE5WixyIoNLb66TOuWOYRMb7o9DQ +6O0PsXsv1hfy+Xh9YZfq4DKuBPYKVq1IeGLjdpv+q4eVZFm5TK1RXNL03BMGtymyKfP 6u02LPjrFQUrPtAiNTtR1WUWKzZfFh8idXQZZWRIw6/58EyK2KVUdC7D1IY/5yQbBIx1 KZpA== X-Forwarded-Encrypted: i=1; AJvYcCX2EBu511H34Zj9Js+biO5oMfMRUV5Z19r8x4I8n+m6O/qijXVM2Osf7on0JgKzWMlg7uNxq0hG55rYyGC+0o1nLJh6eg== X-Gm-Message-State: AOJu0YyL12PB3Q7ky1NIK3atzZFSA2gZ0vnZOANLU735dzkmBDN0YriU 0S6sGo+k1om/6khSNok2uMKsquelnXpk8YZ/bAbayIIHxot5875QYqyshESyKHk= X-Received: by 2002:a05:6830:6d0b:b0:709:2752:4523 with SMTP id 46e09a7af769-7092e6c7fd5mr6331598a34.8.1721940323589; Thu, 25 Jul 2024 13:45:23 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778069sm454759a34.59.2024.07.25.13.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:23 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 03/38] mmc: dw_mmc: Extract waiting for data busy into a separate routine Date: Thu, 25 Jul 2024 15:44:45 -0500 Message-Id: <20240725204520.18134-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Waiting for data busy is a logically separate operation and should be implemented as a separate routine. Follow Linux kernel example and extract it from dwmci_send_cmd(). This way it doesn't clutter dwmci_send_cmd() function, and can be reused later in other cases. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 45665e517068..395b699b0a0a 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -245,6 +245,21 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host, return mode; } +static void dwmci_wait_while_busy(struct dwmci_host *host, struct mmc_cmd *cmd) +{ + unsigned int timeout = 500; /* msec */ + ulong start; + + start = get_timer(0); + while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) { + if (get_timer(start) > timeout) { + debug("%s: Timeout on data busy, continue anyway\n", + __func__); + break; + } + } +} + #ifdef CONFIG_DM_MMC static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) @@ -259,19 +274,11 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac, cur_idmac, data ? DIV_ROUND_UP(data->blocks, 8) : 0); int ret = 0, flags = 0, i; - unsigned int timeout = 500; u32 retry = 100000; u32 mask, ctrl; - ulong start = get_timer(0); struct bounce_buffer bbstate; - while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) { - if (get_timer(start) > timeout) { - debug("%s: Timeout on data busy, continue anyway\n", __func__); - break; - } - } - + dwmci_wait_while_busy(host, cmd); dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_ALL); if (data) { From patchwork Thu Jul 25 20:44:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814381 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566413wrn; Thu, 25 Jul 2024 13:46:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlEw0fPtRubQJs+BGrezfbZPdX8oG35wB7+YZUat1vOOg+eF2rdj0/6DiLGlfrHJQRr+lTDaEa9/IDdOVPext4 X-Google-Smtp-Source: AGHT+IEDL7xU3fmJc1bg7Ak878qehiWbtDjfTUrAAEauzQwpejEUeLuiTNwWhlw4/dMzJuRrSMkN X-Received: by 2002:a2e:b4a8:0:b0:2ef:22ef:a24e with SMTP id 38308e7fff4ca-2f039c8a75emr25929251fa.10.1721940375079; Thu, 25 Jul 2024 13:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940375; cv=none; d=google.com; s=arc-20160816; b=pM9yYkJ73bVTXHRA0yM1ZCS2kCyXyu7QjP8FrAJmfizNH6H47vemkymsr06BHs7hqe /OEbidy+MbhrMyxWNrjxXkz50QVrrpB91V8N6wLcaalDDjxxf0QYNlLaTLLQlseFTmBP CYSiAtAWwC8+ADmujRxWVjIXYGs23MJrWp2IySj6GTZSDr6scWwQKc4g0A5Jz/blu2uv dbw+YsbB+Kg6QLBjlKUhS0Z7id59f2vOBsrJ7DimIy4m4hQUnNV8/wE4RTE9Zq6Vpw8J TTToFmLQnxQlP+nhXmaDx4kPcB+u1nvLoufowqOe+33lG6dk0ZTmBbZ1kNzgrD4QSiyZ +ZZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z75UPHN+6qAxv6CWvtIqKhekWJ1e75T2VKkNBWB9X+g=; fh=j7QF0xU6/NQHErJcspxAlwEdxmB5npPBUimZiZMgMxc=; b=hMdVSvsfoJ8rWoOiAzVBV9qEY2DXW+V2CxDMgMMgBPF3CZT3E+f6w4cSsJch71N1Xq JVM2ToyRTeAwqpD5nrhxF66HbEpTGogtu2zEniOewdhy9VxT+oE0d7WU9SrL7OZF5g43 N30BDo+anRTEhexM3YrFmpiGaTXxEhzm2DKHlkZbLeDz8DzYU4P866LJYDUYrXzpwvEX QnTBZXXJEcjpbbcipRXT5D4jHkaYQqcYecegAxQOtPA2b61JzNJXnV36xQ9JkEjcyD+v UVi7cnWv+l7L8r4l8Tob3d5ybWfTKYJr5Gq6pOMUT9dwSMOZCY0blVvFOql9ofNDcGwS KbBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tbD3zK2A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d08bdbesi6288381fa.49.2024.07.25.13.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tbD3zK2A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2FB588327; Thu, 25 Jul 2024 22:45:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tbD3zK2A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8143883A4; Thu, 25 Jul 2024 22:45:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8AA76879AF for ; Thu, 25 Jul 2024 22:45:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3db14339fb0so176404b6e.2 for ; Thu, 25 Jul 2024 13:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940324; x=1722545124; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z75UPHN+6qAxv6CWvtIqKhekWJ1e75T2VKkNBWB9X+g=; b=tbD3zK2AGDgAMvxtt4EPxGXK7cdnX+78hhK9yfozqMW9qAuNpT/n+X2mOOr2Rd+qZv nlh47lmKaJq53vqHY9A+UquErSe4w8tsdJf9EyMjqFuhpVdWRI5rtAMXpOrBsoZToq4P HVVOSKF5bar00djGtABiW+MyguuEY84ov9Pb/ZGy5h9W7N6caFr028ubDp5pXn4rPTUl jMyfpck2pIDOy3RyATyI/xcZC0j1V75+kIGcHfPqmpvJXJfRmMiim67+QMUmGwB7Mb10 1llknyNbwnkCDNyYWgMN3XClrCubdoKgeL1HEh9i1dwacX7Y+CXnd1FWx0T1MLXHffDa VuQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940324; x=1722545124; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z75UPHN+6qAxv6CWvtIqKhekWJ1e75T2VKkNBWB9X+g=; b=NpQJ+TlkkAYx5KmEkKJ7qBay9B8/kEaR1sI9UrDMmW8pvEmThH+eUvcDciu84oOqrP gzkRWI/4/Mx5oksa2itNOPLN8M6s+7rdRTm0yWiVVm1GfwjRCsssPdzV0H72wy5Vk2v7 TxP7dmvCvkJa6JN08HVJspJQo7QD3BmUMNaQIicvbkVOd96ffJ6+h60EnP9r0hjuY9dc l+D8YinSr08FtJjfQRztSBXbksxzd687lp1NL4+6cRjKWo03Z2JpCLhnuG4gTkp9MuPU AKPfZ4oiWbq9KpKycueHZOr3P5yfkhdRbOpdZiBc+/5eKvp+Ubu8npCoKjhbsntphJp7 VyeA== X-Forwarded-Encrypted: i=1; AJvYcCU6HFz5Vd1A7HI9WS5JiurbslgX1GvgQrE7zMKmoV+ucxI5iHsa32CxJ/gcToX3qzPR9yX5NKhgVWDV+DKNSoxBlaePwg== X-Gm-Message-State: AOJu0YzU/brcWyYj3JztgPvww7J03zpwt5udVk9zBFAeH/5qcTgGX21G /gZr2y1fNmsgYjFSVswNbxHu4Np5JKHNPHzGoCPOch3OGUSVgxZj1R2+ENU0o+I= X-Received: by 2002:a05:6808:ecf:b0:3da:a9f1:4876 with SMTP id 5614622812f47-3db10ef68efmr4119873b6e.11.1721940324350; Thu, 25 Jul 2024 13:45:24 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1341ebbasm431299b6e.20.2024.07.25.13.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:24 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 04/38] mmc: dw_mmc: Extract FIFO init into a separate routine Date: Thu, 25 Jul 2024 15:44:46 -0500 Message-Id: <20240725204520.18134-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Move FIFO threshold initialization into a separate function to make dwmci_init() more readable. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 395b699b0a0a..4a9e57165fbb 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -538,6 +538,20 @@ static int dwmci_set_ios(struct mmc *mmc) return 0; } +static void dwmci_init_fifo(struct dwmci_host *host) +{ + if (!host->fifoth_val) { + u32 fifo_size; + + fifo_size = dwmci_readl(host, DWMCI_FIFOTH); + fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1; + host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) | + TX_WMARK(fifo_size / 2); + } + + dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); +} + static int dwmci_init(struct mmc *mmc) { struct dwmci_host *host = mmc->priv; @@ -562,16 +576,7 @@ static int dwmci_init(struct mmc *mmc) dwmci_writel(host, DWMCI_IDINTEN, 0); dwmci_writel(host, DWMCI_BMOD, 1); - - if (!host->fifoth_val) { - uint32_t fifo_size; - - fifo_size = dwmci_readl(host, DWMCI_FIFOTH); - fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1; - host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) | - TX_WMARK(fifo_size / 2); - } - dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); + dwmci_init_fifo(host); dwmci_writel(host, DWMCI_CLKENA, 0); dwmci_writel(host, DWMCI_CLKSRC, 0); From patchwork Thu Jul 25 20:44:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814382 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566486wrn; Thu, 25 Jul 2024 13:46:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/QosBbHLhLfMiSO1TmjSTZ1UTuCblZFZqMviX5QzSWCixk8BJkIQP9vKiRp6JmIoLP/xcqHIbdUN52SarVDOX X-Google-Smtp-Source: AGHT+IHXhGSv5kEklXyLOzxQoznPlovV1lFPFbadvNX7oWkA2fW+XvL92D5xL/LfGLiflFmiZQ25 X-Received: by 2002:a05:651c:548:b0:2ef:2dfd:15e3 with SMTP id 38308e7fff4ca-2f039c9eaa0mr32762661fa.19.1721940390681; Thu, 25 Jul 2024 13:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940390; cv=none; d=google.com; s=arc-20160816; b=dLbnHn60GZlLPtg7ePc3GhiGhqVD9N1/xn5Yck/u6aQ7aB3zYBlJhEJdKpdUOgyOxB lN2GQ/HNaYK9nfgZ9hu5/3M+lrEUIbrwGDzc7Q6rJ/jGgUrRsPPQnBcJWHq9JudtFY7j B2ZJtHAUh89wZ4Te1WwE2hfzqL7F4ZLDOSGZ0ehnp8K7MhbZ/aEGnyd2eu3Fn7YIe8i9 5CwuofxpXLA66Ks/0+5C6knp2extdeHaiMnqi3kBdMPFwnxqW+GuCmAmHjBo4zSzoijw mUYeMDdGtB1rtv3TDDRSdsK7Sfj/FK9zPTj+/KRrrXxFa1wgyTgWcd7eC308V9xiBl9h jH4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DYiQ9pkdgiLeGne+YAOXNl8tNbMdErDeetuqURGS3/Y=; fh=xtB5Q/6lJ6fru2K4+M69oHLr1R+flNGXw86X+oIAHok=; b=jny3lKKrEazdgQGnIJslvKqDZ9gIN1D9KNznwtjRYZwf8lb0dQqmpK1vZZvOqok8tP 7yEQw6QQrgG0LvtMrYd4FZun7gSCAkI0BXtsEJjDUAs4k3WkIwjx+OtXYDXoPcRzuAZP SNFZdr7CIg8ujQx3CgNW738S88TlvxBOpm4ICi5haIkBFgunCgKwek01YkiGcwzLfPM3 j1jxnsaV1DWQi0a2qIrA2a5aHzwpxoBN/Seq9YT76QzOjR9IL+Mkftn2w+od+HZ8aL+M tMq4BWGzUMn6C3MWEnkmxwG/6W1imw++0WwJAhiTahBt8giNR64F9kuuQbvNJa6paK8E T9MA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h8bRruzB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d169a66si6042121fa.485.2024.07.25.13.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:30 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h8bRruzB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 64C8E8853E; Thu, 25 Jul 2024 22:45:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="h8bRruzB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B5FC883A4; Thu, 25 Jul 2024 22:45:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5A5C788327 for ; Thu, 25 Jul 2024 22:45:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-260f4c9dfe2so319403fac.0 for ; Thu, 25 Jul 2024 13:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940325; x=1722545125; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DYiQ9pkdgiLeGne+YAOXNl8tNbMdErDeetuqURGS3/Y=; b=h8bRruzBqLmVW3z6Oh0N2ht0rO2GwdeepX0fDmGZcdL7Y0YF49wqUbtqh8oY/dfqY/ l9Y5Uek2nXS7W/G3iKUtUa+F+ofEdRm1BuJ/u2EtoG5ndFpUIA4Yj3LXPrG5tyk1+1iX rdsh8cZZHaeqSpzZWMQfzGKSMuDBT+fap00fKvjPb4GqB0C9sq4R1xY+itbZrG8e5PBl g1p9+5vCsZxUBYb0P9jvQ5pV/T3U4HptlJFHj7bv0Sz8y2nFPlouaOs5FNcLRM/11KQH lm9LRxRwJsvfV7KyMFVKvLX5OSxa/h4KLCQ15petVj8Fj0A9Q2zeGnUGthrsGafoIDcb 5y0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940325; x=1722545125; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DYiQ9pkdgiLeGne+YAOXNl8tNbMdErDeetuqURGS3/Y=; b=e3bv8Kw/5gy1iHQ5P/wTbQlY59z521pvrFJq6JRI5LXGC2M/T6StZOs9QpsRd+rR1J cX4vro4/RhDuAunq7Je9YF06Hk19Uv3DrajGYQtBd5m/5cNksuzbsAHbsS72oxoMZLCP GoEqFkPQLMU7cOqyXPDIqguXjenhO54uYG1TBq6YruOF0IF6WVHPWp5iiXjRqx1QoLF/ 12ZEMpL3ekWOPxURZ+hlQsalUyx6Q+Qo8wi0oA8mk0Hxm3UeNLfTgrV34ZLQcbCsDgDU TuRbqZlxFLj08uToXUsdHXPkOIJodQtfKAWV7YCzU12a/hJxDrAS2w9i3w35vRKCai6D C98w== X-Forwarded-Encrypted: i=1; AJvYcCVjr1vJpNRVAT1Xs3rRGLZokOqBKo/TZQbSfhN36jr20BZxjX/GlC8HyLm7qo/QQDB0EuKJwGgX8jRyXc4XhF+WamRASA== X-Gm-Message-State: AOJu0YyrRgXUi3k2WTlrdfpvl2FhVKcYzrnjq5ZOXuPHky0qbAfOUU05 9N3dzHw7CCFm6nzG+bqt2u2JOc9qfpBj4UaZHocakoBsb4lvz4y8Qr/+od1/HSE= X-Received: by 2002:a05:6870:970d:b0:265:5e05:766c with SMTP id 586e51a60fabf-2655e05aaeemr1769209fac.2.1721940325000; Thu, 25 Jul 2024 13:45:25 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2653e735b1asm416165fac.19.2024.07.25.13.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:24 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 05/38] mmc: dw_mmc: Extract divider update to a separate function Date: Thu, 25 Jul 2024 15:44:47 -0500 Message-Id: <20240725204520.18134-6-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Extract the clock divider update into dwmci_update_div() function. It's a procedure recommended in TRM, so it's better to keep it in a dedicated function to make the code clearer. While at it also extract the clock control code into a separate routine to avoid code duplication in dwmci_setup_bus(). No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Moved CLKSRC after disabling the clock as recommended in TRM, to avoid possible glitch - Extracted div update into a separate function with corresponding comment - Changed the patch subject and reworked the commit message drivers/mmc/dw_mmc.c | 81 +++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 4a9e57165fbb..b9c14fe6857b 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -410,11 +410,56 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, return ret; } -static int dwmci_setup_bus(struct dwmci_host *host, u32 freq) +static int dwmci_control_clken(struct dwmci_host *host, bool on) { - u32 div, status; + const u32 val = on ? DWMCI_CLKEN_ENABLE | DWMCI_CLKEN_LOW_PWR : 0; + const u32 cmd_only_clk = DWMCI_CMD_PRV_DAT_WAIT | DWMCI_CMD_UPD_CLK; int timeout = 10000; + u32 status; + + dwmci_writel(host, DWMCI_CLKENA, val); + + /* Inform CIU */ + dwmci_writel(host, DWMCI_CMD, DWMCI_CMD_START | cmd_only_clk); + do { + status = dwmci_readl(host, DWMCI_CMD); + if (timeout-- < 0) { + debug("%s: Timeout!\n", __func__); + return -ETIMEDOUT; + } + } while (status & DWMCI_CMD_START); + + return 0; +} + +/* + * Update the clock divider. + * + * To prevent a clock glitch keep the clock stopped during the update of + * clock divider and clock source. + */ +static int dwmci_update_div(struct dwmci_host *host, u32 div) +{ + int ret; + + /* Disable clock */ + ret = dwmci_control_clken(host, false); + if (ret) + return ret; + + /* Set clock to desired speed */ + dwmci_writel(host, DWMCI_CLKDIV, div); + dwmci_writel(host, DWMCI_CLKSRC, 0); + + /* Enable clock */ + return dwmci_control_clken(host, true); +} + +static int dwmci_setup_bus(struct dwmci_host *host, u32 freq) +{ + u32 div; unsigned long sclk; + int ret; if ((freq == host->clock) || (freq == 0)) return 0; @@ -437,35 +482,9 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq) else div = DIV_ROUND_UP(sclk, 2 * freq); - dwmci_writel(host, DWMCI_CLKENA, 0); - dwmci_writel(host, DWMCI_CLKSRC, 0); - - dwmci_writel(host, DWMCI_CLKDIV, div); - dwmci_writel(host, DWMCI_CMD, DWMCI_CMD_PRV_DAT_WAIT | - DWMCI_CMD_UPD_CLK | DWMCI_CMD_START); - - do { - status = dwmci_readl(host, DWMCI_CMD); - if (timeout-- < 0) { - debug("%s: Timeout!\n", __func__); - return -ETIMEDOUT; - } - } while (status & DWMCI_CMD_START); - - dwmci_writel(host, DWMCI_CLKENA, DWMCI_CLKEN_ENABLE | - DWMCI_CLKEN_LOW_PWR); - - dwmci_writel(host, DWMCI_CMD, DWMCI_CMD_PRV_DAT_WAIT | - DWMCI_CMD_UPD_CLK | DWMCI_CMD_START); - - timeout = 10000; - do { - status = dwmci_readl(host, DWMCI_CMD); - if (timeout-- < 0) { - debug("%s: Timeout!\n", __func__); - return -ETIMEDOUT; - } - } while (status & DWMCI_CMD_START); + ret = dwmci_update_div(host, div); + if (ret) + return ret; host->clock = freq; From patchwork Thu Jul 25 20:44:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814383 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566508wrn; Thu, 25 Jul 2024 13:46:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYz17wDmEd8Fr5+BW6YR+LeZsLu75i9tIqFav/1fDvESyoOZurzbtCfbhRGEopA58yj/pWYjBclW7ZvFmZwhJ7 X-Google-Smtp-Source: AGHT+IExQnl9ODgIf/hdPRGzKs2luRSofqLFj//WBiLWlepMiqrwfq196KFwY3vhGh94zjwiZr7i X-Received: by 2002:a05:6512:131d:b0:52e:f907:1023 with SMTP id 2adb3069b0e04-52fd3f821aamr2414051e87.49.1721940395316; Thu, 25 Jul 2024 13:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940395; cv=none; d=google.com; s=arc-20160816; b=KySoVTXL+eY5aTW30b5YI8SDHm+HJXYUNNZ8H2Z1qMZwvVkymc5Upc8/0LJqA60wX7 YRk10Ogy16FtXD4uqAJ92MFmRoy6QOpIwBpZ3tTmeuL+VJdVQzJVq5qwPzlmpyAlPoIY j1XHgZpsPVVMclW9GLC15H9We5zk8ziO5kwpHTx8UrQtC6FyYcbLlN4PWGA1h75PVCIW kJooOLCJrtJvLgQue+mcqlyv5nZd1SDnlEAY0kdzB5F8FTVaPbP3JBZOqUOJwGMAidfW fQiYrabzQozJjWfR58PZrYU/rdYOzdB+Wbt0S3sSy7LIpMgxJElcG3Lf3YdT5kdB2QwI IIzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JyruwuYRaqPCXBmGPbE2CxHwcU1xW7seIdaP81obB0o=; fh=VKXBVEXCDz5vGfpQWPCVU2Ps/W7ke7shMxeFk2H5S0g=; b=L9BGLKNbkX9Xdg16W1VZjA/ytMseThzh4ocAq5ea9u1vHDF9OIiNOwFy28NLiddMYx 4t9YWxJG/qJ4Cfzi8iDWg3iDmDnfonq4W0KgBk3DQojIhS4wITNiQxCZiGorcCcJ5noC gR/+2x5KTKR9edtfUofJA5D54/h3uOoKl2t1ZmGPGjl6XUR0RT9YWUgVHkjcIiGZjl17 QlqDXQCEjS87ZsG6VMXODJBeopTDhtHSk7rHd9S+hqPULoIId5nqThWpSBbihQIA2cb8 sJ6t6KUIP0wL0pkQ7mCUmpuphH6Rl/47WuKffg8z0uRBbk5uwHB31z2l9fU115vRvvYZ NcIw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8VLEwOX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfba56si646559e87.417.2024.07.25.13.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8VLEwOX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 25AAB88365; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="d8VLEwOX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DF7E88363; Thu, 25 Jul 2024 22:45:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F3D9688365 for ; Thu, 25 Jul 2024 22:45:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3cabac56b38so189912b6e.3 for ; Thu, 25 Jul 2024 13:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940326; x=1722545126; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JyruwuYRaqPCXBmGPbE2CxHwcU1xW7seIdaP81obB0o=; b=d8VLEwOXA6CeLFu/YwHvclpztygdGsU4vgZ40EFVTuS/aynvPoCcD5UIRtu9k1E2eQ rlJ1f+KA0Yj5UimNHoPgHhMTObeEJ7djF4uQUUZp1dDZe1etljuGKg5PMNthqXpGxjS2 qeXcoCsXxUrHUYkVVURMuYb4aT+9OPX0puGgvUT2E4D+wTrRaLgx9lSMjEEajv6BevGC kmWFUiheA5fjUgrUnsUHsFHAj4p4TO/i40vSVKGA/f3qvT6zuxmvU9Pq0pZF3zgTIwf/ GxXdTcjWq/1qgzz+LJ+c0cqo7XQEGRVzbaBvVBc9ucbkczitiZXjHeFnsiTspMUZwU0s P6bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940326; x=1722545126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JyruwuYRaqPCXBmGPbE2CxHwcU1xW7seIdaP81obB0o=; b=G4LCNJeZQ450KuBWviM1TAt8JI8nThRYm9ZDfSBXESvdpVyYxO71h/MRFqzuHlP4FF dFh6BwhZ9JGpgaw+No5OQIWTwD4LzDe6yAFsnCh6i39jQx3KDtDc17yHzlzcK4xOGH4N YECSxvlUecSdpptcqVMX+y3OqpVVCSEnyu7n9pIe7bNzHZ4F/k/D+bhC4O2B9TyN8/Va LCvl50obgirT5fju/ya2Y/2TleFd+lTg565T7tT50daP/tFVXxvZS8Anda4/sYJzp8dd f6kwhLousuItN1oVcgwx3Ote2ramHVcLyyziq5foTHi6/jkydGd6XpZYHZTG+j9gLrZt 0J2A== X-Forwarded-Encrypted: i=1; AJvYcCVo3u++DWhNY7Is5JJbmwpDg+8Cvmnebi6sutMmynutwShR8AML1jWuNMqAMoWB+V4buDnXeLiqu9AkNOmXclamLbbUsg== X-Gm-Message-State: AOJu0YxMc0S/bnRvk93jICzND/XQ7kYNEYkoikqaolWG1AbnG9KIw8WY F36hzc3s/x63rQkkGRe3IqFDDnONtXyz9rYJMo+iazWtA15VTwssXU2Q6oOJ4z0= X-Received: by 2002:a05:6808:2129:b0:3da:e0bf:e117 with SMTP id 5614622812f47-3db10ed1271mr5446031b6e.9.1721940325734; Thu, 25 Jul 2024 13:45:25 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1341dde2sm430223b6e.17.2024.07.25.13.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:25 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 06/38] mmc: dw_mmc: Extract FIFO data transfer into a separate routine Date: Thu, 25 Jul 2024 15:44:48 -0500 Message-Id: <20240725204520.18134-7-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean FIFO data transfer is implemented as quite a massive chunk of code. Extract it into a dedicated function to make dwmci_data_transfer() easier to read and reduce the indentation level of the code. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/dw_mmc.c | 107 +++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index b9c14fe6857b..b99f63a6f8bd 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -139,25 +139,67 @@ static unsigned int dwmci_get_timeout(struct mmc *mmc, const unsigned int size) return timeout; } -static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) +static int dwmci_data_transfer_fifo(struct dwmci_host *host, + struct mmc_data *data, u32 mask) { - struct mmc *mmc = host->mmc; + const u32 fifo_depth = (((host->fifoth_val & RX_WMARK_MASK) >> + RX_WMARK_SHIFT) + 1) * 2; + const u32 int_rx = mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO); + const u32 int_tx = mask & DWMCI_INTMSK_TXDR; int ret = 0; - u32 timeout, mask, size, i, len = 0; - u32 *buf = NULL; - ulong start = get_timer(0); - u32 fifo_depth = (((host->fifoth_val & RX_WMARK_MASK) >> - RX_WMARK_SHIFT) + 1) * 2; + u32 len = 0, size, i; + u32 *buf; + + size = (data->blocksize * data->blocks) / 4; + if (!host->fifo_mode || !size) + return 0; - size = data->blocksize * data->blocks; if (data->flags == MMC_DATA_READ) buf = (unsigned int *)data->dest; else buf = (unsigned int *)data->src; - timeout = dwmci_get_timeout(mmc, size); + if (data->flags == MMC_DATA_READ && int_rx) { + dwmci_writel(host, DWMCI_RINTSTS, int_rx); + while (size) { + ret = dwmci_fifo_ready(host, DWMCI_FIFO_EMPTY, &len); + if (ret < 0) + break; + + len = (len >> DWMCI_FIFO_SHIFT) & DWMCI_FIFO_MASK; + len = min(size, len); + for (i = 0; i < len; i++) + *buf++ = dwmci_readl(host, DWMCI_DATA); + size = size > len ? (size - len) : 0; + } + } else if (data->flags == MMC_DATA_WRITE && int_tx) { + while (size) { + ret = dwmci_fifo_ready(host, DWMCI_FIFO_FULL, &len); + if (ret < 0) + break; + + len = fifo_depth - ((len >> DWMCI_FIFO_SHIFT) & + DWMCI_FIFO_MASK); + len = min(size, len); + for (i = 0; i < len; i++) + dwmci_writel(host, DWMCI_DATA, *buf++); + size = size > len ? (size - len) : 0; + } + dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_TXDR); + } - size /= 4; + return ret; +} + +static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) +{ + struct mmc *mmc = host->mmc; + int ret = 0; + u32 timeout, mask, size; + ulong start = get_timer(0); + + size = data->blocksize * data->blocks; + timeout = dwmci_get_timeout(mmc, size); for (;;) { mask = dwmci_readl(host, DWMCI_RINTSTS); @@ -168,50 +210,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) break; } - if (host->fifo_mode && size) { - len = 0; - if (data->flags == MMC_DATA_READ && - (mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO))) { - dwmci_writel(host, DWMCI_RINTSTS, - mask & (DWMCI_INTMSK_RXDR | - DWMCI_INTMSK_DTO)); - while (size) { - ret = dwmci_fifo_ready(host, - DWMCI_FIFO_EMPTY, - &len); - if (ret < 0) - break; - - len = (len >> DWMCI_FIFO_SHIFT) & - DWMCI_FIFO_MASK; - len = min(size, len); - for (i = 0; i < len; i++) - *buf++ = - dwmci_readl(host, DWMCI_DATA); - size = size > len ? (size - len) : 0; - } - } else if (data->flags == MMC_DATA_WRITE && - (mask & DWMCI_INTMSK_TXDR)) { - while (size) { - ret = dwmci_fifo_ready(host, - DWMCI_FIFO_FULL, - &len); - if (ret < 0) - break; - - len = fifo_depth - ((len >> - DWMCI_FIFO_SHIFT) & - DWMCI_FIFO_MASK); - len = min(size, len); - for (i = 0; i < len; i++) - dwmci_writel(host, DWMCI_DATA, - *buf++); - size = size > len ? (size - len) : 0; - } - dwmci_writel(host, DWMCI_RINTSTS, - DWMCI_INTMSK_TXDR); - } - } + ret = dwmci_data_transfer_fifo(host, data, mask); /* Data arrived correctly. */ if (mask & DWMCI_INTMSK_DTO) { From patchwork Thu Jul 25 20:44:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814384 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566557wrn; Thu, 25 Jul 2024 13:46:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXvrCfzOy/LoZiU6b6rRHCYfSXoVzNgP9LGSx/OBxT8LQII9C/AJZw7j+f7mDb6tQishga3s1Pwy03YbPFK8atX X-Google-Smtp-Source: AGHT+IHoa/hX12RENN6nmp6s75hDKChG7/f/MeLAof5YV3u2pqxHamBoCxMW7sduUOBUXQINURf9 X-Received: by 2002:a05:6512:54f:b0:52c:dd25:9ac6 with SMTP id 2adb3069b0e04-52fd6038916mr2693437e87.29.1721940406614; Thu, 25 Jul 2024 13:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940406; cv=none; d=google.com; s=arc-20160816; b=X7ET5FmdbWRScexstyI3S0mXbXEu0Dm9BBKM7/0YSFvCQ4YmQVGBV0E4p7yBRm8S7J B93YTKw7cHFNTRjxs9uacJz//fsLsOkU0hnbsqcQyZtBPXnb9X5BhhU4xpPlE7zDA/1p EBMfMNYRxn3fZL87EIS9hIwbPqEXYtXm9+fffoU/kFlw+a1gnWmbIryf1JW+Wf9Jmatv EPHrW02QQNHkFFQJt1rAkkGj1Y4+gQ5DLhK5DASmWnOLVge0Egh/87/NHQIePOsKyPim uURb9L1kmJvJTWYWkxKK7U0tVTIL1NV9Vwx4h6ZF8rpBX00Mq+Onenta43q0G4J3cmx0 IiZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YZy7bY3iVSg1wM0zqnDmY47LgMxJoEvXU8nrH0f8DpQ=; fh=ioZ/hbPGBXdD/9EavbkUPrITn/mPMTXxaIx/i6dUsTA=; b=MX7MKV19zZn+xH54QnDKY7cUC888GTIuTGVUONqxMsjTQG9Ziu2hz2TU+g3Hdt3Zao J7hEF0Zg3ddV/aziBfzA3gX29+rythMO5M+EuqZTNqQq37y80C/gWGDX9BHgv+c4C97v dx1JrOJrCc1WHdhEv3lo1sVWeu93aeLnVX1VKVTNhnwa03qVnqCL24PJPKESsmPz57ns Wx5qJOTFHjpD73cRjlIYvqHzZUuRqs9RqEkv8NbVJrpWXStp37snE3iCKo2zhBaKjXpt Tkp3NcEr0XUD6RL+MDQmykErOZB04Qr7+LH9LMItEpFmCI7TV3vmAjJjj1Mqeau+KfoA 2qGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Azokvtah; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bef04asi667320e87.278.2024.07.25.13.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Azokvtah; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82C8488578; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Azokvtah"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB3788842C; Thu, 25 Jul 2024 22:45:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A576A883BB for ; Thu, 25 Jul 2024 22:45:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-703775e4d5dso178452a34.0 for ; Thu, 25 Jul 2024 13:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940326; x=1722545126; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YZy7bY3iVSg1wM0zqnDmY47LgMxJoEvXU8nrH0f8DpQ=; b=Azokvtahcps5O9YP9xEQ2WISQHKp14L7KExEzjREj6lO4pac/YZVZyFqB8V57KDGy1 MzPeE1/JC6lRhq+T6EYhTzfSxOiZb6fhm2831118MPAfgd/KPcBb3i88fiFHe6JrFhdM 6T2puyQVQ++dKunAjjDUzmb03YbmLUAAYGOCig42Ih0I4UGSnNiqBS4xIIHYfDjChzbL WAEjNpiHM/B9fnQLLIWW357uOwciZ6zBo+BGMp5haaAM1v49ummerHGKmbcdek8A4COu nXfMQonapVNdeI5bFJlFpz4SmNDbLz3LAqXaHS3LVz7yDSvEdMkj+xbO2DWjCTInCK6T QehQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940326; x=1722545126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YZy7bY3iVSg1wM0zqnDmY47LgMxJoEvXU8nrH0f8DpQ=; b=RZY/DkmIqELrX7YExP5PGlU14pcRf7G2Ki0xaoCge4B5XnivcCZlKTin02PfqhiEkT xrZwOTUNu4ZN9mRJ4GVeK23DN3DKMrHcmV9e8DjrLjPzkyce4oXVd+lhjLncOOh2KUsh nTDeGsbcdU35gVhaJbyM1ZusdU4imS0QP1JFGLu4lHlKVJWUHvBjjv1WpdVXxHj64M8I 7ca60tZk2Wp6h070qtJhAjVkSg9eauvRHBXbL/EkIwM0FeNg2ljwp+BOgyNP88S9XJwG REts1xbvNMIjQ50A40f/bnXJt2+Fb6oJS2VMboRHXIF40SwtHRRDxLfSdluq3vssI2rD cPhQ== X-Forwarded-Encrypted: i=1; AJvYcCXrnfB1HZaY9Us8cXxmNpNu7ycIFSqymMwlSt2G18cTBkSnBZsmOloqlWtRWGMYfcc0HZvB1dE9f9zrAsRhK0oxc4KYkQ== X-Gm-Message-State: AOJu0YyOQTu3CsPRd+Q+qu21rdUOq243WCX6EQoT15jG3ShfgG21Pf82 2hWE3XESW8zmoUDPRsz1gDzz51Q932tdULgqckO/qFWrVoFAMTqhPHaSTDGFarQ= X-Received: by 2002:a05:6830:f93:b0:708:b286:f6f1 with SMTP id 46e09a7af769-70932223625mr3830304a34.13.1721940326438; Thu, 25 Jul 2024 13:45:26 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a35fsm452471a34.6.2024.07.25.13.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:26 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 07/38] mmc: dw_mmc: Extract DMA transfer handling code into a separate routine Date: Thu, 25 Jul 2024 15:44:49 -0500 Message-Id: <20240725204520.18134-8-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Make dwmci_send_cmd() easier to read by moving the DMA transfer handling code into a dedicated function. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 51 ++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index b99f63a6f8bd..8fc26399034b 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -232,6 +232,33 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) return ret; } +static int dwmci_dma_transfer(struct dwmci_host *host, uint flags, + struct bounce_buffer *bbstate) +{ + int ret; + u32 mask, ctrl; + + if (flags == MMC_DATA_READ) + mask = DWMCI_IDINTEN_RI; + else + mask = DWMCI_IDINTEN_TI; + + ret = wait_for_bit_le32(host->ioaddr + DWMCI_IDSTS, + mask, true, 1000, false); + if (ret) + debug("%s: DWMCI_IDINTEN mask 0x%x timeout\n", __func__, mask); + + /* Clear interrupts */ + dwmci_writel(host, DWMCI_IDSTS, DWMCI_IDINTEN_MASK); + + ctrl = dwmci_readl(host, DWMCI_CTRL); + ctrl &= ~DWMCI_DMA_EN; + dwmci_writel(host, DWMCI_CTRL, ctrl); + + bounce_buffer_stop(bbstate); + return ret; +} + static int dwmci_set_transfer_mode(struct dwmci_host *host, struct mmc_data *data) { @@ -274,7 +301,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, data ? DIV_ROUND_UP(data->blocks, 8) : 0); int ret = 0, flags = 0, i; u32 retry = 100000; - u32 mask, ctrl; + u32 mask; struct bounce_buffer bbstate; dwmci_wait_while_busy(host, cmd); @@ -382,26 +409,8 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) { ret = dwmci_data_transfer(host, data); - - /* only dma mode need it */ - if (!host->fifo_mode) { - if (data->flags == MMC_DATA_READ) - mask = DWMCI_IDINTEN_RI; - else - mask = DWMCI_IDINTEN_TI; - ret = wait_for_bit_le32(host->ioaddr + DWMCI_IDSTS, - mask, true, 1000, false); - if (ret) - debug("%s: DWMCI_IDINTEN mask 0x%x timeout.\n", - __func__, mask); - /* clear interrupts */ - dwmci_writel(host, DWMCI_IDSTS, DWMCI_IDINTEN_MASK); - - ctrl = dwmci_readl(host, DWMCI_CTRL); - ctrl &= ~(DWMCI_DMA_EN); - dwmci_writel(host, DWMCI_CTRL, ctrl); - bounce_buffer_stop(&bbstate); - } + if (!host->fifo_mode) + ret = dwmci_dma_transfer(host, data->flags, &bbstate); } udelay(100); From patchwork Thu Jul 25 20:44:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814385 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566599wrn; Thu, 25 Jul 2024 13:46:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWkBzVNgTYAfkG6CM/xm+oFAnwJNKXqH2KGFye+YfJnwoptm0b2NTSZx6foQ3WN3n9lLI7uvlhe0GWZzkkQkOJI X-Google-Smtp-Source: AGHT+IHL9CYyN2/CIQtDPF1xO7+XvjWP5NpKD+kilkFFWExtDisopu8ri1gJLgEASlF6OiNH/FJV X-Received: by 2002:a2e:3c12:0:b0:2f0:25dc:186d with SMTP id 38308e7fff4ca-2f03db6d150mr23446281fa.1.1721940417117; Thu, 25 Jul 2024 13:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940417; cv=none; d=google.com; s=arc-20160816; b=JhRHfm8OdWdFDUAMJLeLu64spZWZyw4607AfKQvqfLxbctu8CoHCghn088xRBm3Psg MyjttLaNkVr0Js6WOrgPG6qXWtoerH1T/Qm8t/FPWSjQh2Ts3aA7zglFHB6ZNUcaMiUz 9paaZEN8TIkUYwVFagSW0GYyzuuDnRRnw7AucmvJ4I1G1hSel9U1dH2kt80/x9l5bNQD pwCAaQyYpPNItgkXKiTALXrtcgZ+Q4qQIGwSlLTcqqoKKVpHw8Leh4paCaByZIYBVp1W YzUm5KNih79QauakOxQr8Co+HVCe3M77+YtaDjwwLi7nZJ3R+WJNBnW5SBpBx2Un2iv9 FXmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ruvCrl4J6m5yDHflv99YfWUnqYW+PtjzSr6qfo4u14c=; fh=wSP/B204CIN4t4qPvXVBagltkwe2xcrt2AcQYVqokKo=; b=wWDsg+HLWP8lNUzmz5KUHkopFAQHHW2toxekrX6t8b2ERsnWKNcxPualIyHZhkFkNk xtWVg9WxEuD2zq92gvTP5Nl8VQBqniiCpfqUftojEDDgkwzJo3i5PxA9sPappnJdcluo 8V2abcpvFbPB7DPGMb7/ofuCFKQpNQI8jNgUbDjOdOmktsUdxzvTbAh1tTvpCzj7gcoD 1iqgUcVDjbvr6+/dRNkakGaxPPhCaucsps6b+AMXklBNmU8Hik5w+QGmrCcvyYX/siNH 9o7cBYbpkQ5iuG9SokpkA00z+RClyDja0vAdjE3Di0TlzPJRFCYTyDKuWp9eYDPuvhWQ iDSg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AtTPphZG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d1834a9si5828131fa.579.2024.07.25.13.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:46:57 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AtTPphZG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E56A1885A8; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="AtTPphZG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD847884E2; Thu, 25 Jul 2024 22:45:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 841EA88297 for ; Thu, 25 Jul 2024 22:45:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3dab336717fso205640b6e.0 for ; Thu, 25 Jul 2024 13:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940327; x=1722545127; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ruvCrl4J6m5yDHflv99YfWUnqYW+PtjzSr6qfo4u14c=; b=AtTPphZGtn2lM1qftGNgLgEgMb1HO6xQe31rxtM9eEjT7Iv/30IsNfkbO/Feeg9HNF JcVsLGBLZ25aGDrThdcazAr+Dq//Jwy8z2sZuR6t3aGYpKWMcxodXxsfNESQIEtFBpyE sl9Ldney4Whv1W9kl5aR9WRaGyBUfgQX3kE0byNpAYxuyLiqNpuMnfZ1ZXEXw0L2L/iJ Jo6WSwOX8XPqCva7iGFqOQoIXlvfwtxD7+RU7sXmzdf6XvE9vJvbjhH8nCNN8C2X8ORs rd1NeuvAMjFvLgCsWx/0eqvDru5HM7BkqKPWASu3kS2baR5B+T48WgnYgCp7WqjsneRB idNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940327; x=1722545127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ruvCrl4J6m5yDHflv99YfWUnqYW+PtjzSr6qfo4u14c=; b=lSFNOYPNbWJllLIRte4/xV4kUD2xJmzMZY8Lh8w4Ay8v0H9xwjtfSUrsNXta6Z0qGA LNLKTMc121ZuSKG/oh76l+JesGpmpqXVQuNo/Lw/dhyWfYD365m50v3okUhK/hqdJ9Wj Em5FqehjF+fob3CGnHUJr8XBAzc945te34RaCtxuJD9iTPnHjmu0vO4girXh/pjMY8N/ o+bfzxN8y26XJ5BSl9WbLLUofSKS5BPFW8Y8CqdUcfiLTCZIECmmUX09CEM+UB6s5Y/3 xf0veN9bD+H8gVEzeftrwc1NkOb/JlwRFIKm1OymSk4LH7GACEKlzZUQ4Em6hp+HO8v9 35uQ== X-Forwarded-Encrypted: i=1; AJvYcCXBpV/98miLMFs+3eHUisiY8xL48liZ9RsfK9ecEYiGxhO3F/abbFiv3DsCYBABSXUwb2OC68u6ZggWnO4a5CG5K0Wphw== X-Gm-Message-State: AOJu0YwQ83F3v0LrAoEsTnREYiT/LLEthp/DubX7IQfFju1wN7bfC45b 7nebqEsYoFM27qNBBwc2bNOZwU8XSkTs8d7GfHS5WxC6AZzwbodtUKGMPyYndb4= X-Received: by 2002:a05:6808:171c:b0:3da:a032:24bc with SMTP id 5614622812f47-3db1109b545mr4554198b6e.33.1721940327224; Thu, 25 Jul 2024 13:45:27 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db135544f3sm422923b6e.51.2024.07.25.13.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:26 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 08/38] mmc: dw_mmc: Extract setting the DMA descriptor into a separate routine Date: Thu, 25 Jul 2024 15:44:50 -0500 Message-Id: <20240725204520.18134-9-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Make dwmci_prepare_data() function easier to read by extracting the preparation of IDMAC descriptor into a dedicated function. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - Rebased on top of the most recent master Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 8fc26399034b..d73d58bcf7d7 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -53,46 +53,57 @@ static void dwmci_set_idma_desc(struct dwmci_idmac *idmac, desc->next_addr = (ulong)desc + sizeof(struct dwmci_idmac); } -static void dwmci_prepare_data(struct dwmci_host *host, - struct mmc_data *data, +static void dwmci_prepare_desc(struct mmc_data *data, struct dwmci_idmac *cur_idmac, void *bounce_buffer) { - unsigned long ctrl; - unsigned int i = 0, flags, cnt, blk_cnt; + struct dwmci_idmac *desc = cur_idmac; ulong data_start, data_end; + unsigned int blk_cnt, i; + data_start = (ulong)cur_idmac; blk_cnt = data->blocks; - dwmci_wait_reset(host, DWMCI_CTRL_FIFO_RESET); - - /* Clear IDMAC interrupt */ - dwmci_writel(host, DWMCI_IDSTS, 0xFFFFFFFF); + for (i = 0;; i++) { + unsigned int flags, cnt; - data_start = (ulong)cur_idmac; - dwmci_writel(host, DWMCI_DBADDR, (ulong)cur_idmac); - - do { - flags = DWMCI_IDMAC_OWN | DWMCI_IDMAC_CH ; - flags |= (i == 0) ? DWMCI_IDMAC_FS : 0; + flags = DWMCI_IDMAC_OWN | DWMCI_IDMAC_CH; + if (i == 0) + flags |= DWMCI_IDMAC_FS; if (blk_cnt <= 8) { flags |= DWMCI_IDMAC_LD; cnt = data->blocksize * blk_cnt; } else cnt = data->blocksize * 8; - dwmci_set_idma_desc(cur_idmac, flags, cnt, - (ulong)bounce_buffer + (i * PAGE_SIZE)); + dwmci_set_idma_desc(desc, flags, cnt, + (ulong)bounce_buffer + i * PAGE_SIZE); + desc++; - cur_idmac++; if (blk_cnt <= 8) break; blk_cnt -= 8; - i++; - } while(1); + } - data_end = (ulong)cur_idmac; + data_end = (ulong)desc; flush_dcache_range(data_start, roundup(data_end, ARCH_DMA_MINALIGN)); +} + +static void dwmci_prepare_data(struct dwmci_host *host, + struct mmc_data *data, + struct dwmci_idmac *cur_idmac, + void *bounce_buffer) +{ + unsigned long ctrl; + + dwmci_wait_reset(host, DWMCI_CTRL_FIFO_RESET); + + /* Clear IDMAC interrupt */ + dwmci_writel(host, DWMCI_IDSTS, 0xFFFFFFFF); + + dwmci_writel(host, DWMCI_DBADDR, (ulong)cur_idmac); + + dwmci_prepare_desc(data, cur_idmac, bounce_buffer); ctrl = dwmci_readl(host, DWMCI_CTRL); ctrl |= DWMCI_IDMAC_EN | DWMCI_DMA_EN; From patchwork Thu Jul 25 20:44:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814386 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566636wrn; Thu, 25 Jul 2024 13:47:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMpfvWbuvus59CFYIMrUpY7jtVUMZf55Jnvn7eiiZuuTDfV1oRhhiv0ALqKhBjM0AwMSr9m5oe+JtK3MJGsNT1 X-Google-Smtp-Source: AGHT+IFY3b0VfX9pDW51tODgjovUpeyknbOyrBxX/Ti/mc1QGbJTRc8gBZ+kSNqzNZ01MNIPYffK X-Received: by 2002:a2e:9b15:0:b0:2ee:d5c3:388b with SMTP id 38308e7fff4ca-2f039d92040mr29197821fa.39.1721940428646; Thu, 25 Jul 2024 13:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940428; cv=none; d=google.com; s=arc-20160816; b=JJ1jtlralt5WFCDAiO+7378Ie6axesWB8bgrwY/JJQG1tN3wCCq6EeWVlL52HTSat2 nEqDqXj9hf8kFH4+stifdvRC5g1RWcWl75m+NuIZ/qAg3qXoG+pLKVRlMi+gGRiwxfrw ulkNTfW1PJLnCzQx53lPtL+vdkaj4al4PK/00bbxLgHFblWUJLTTRUilQ9lpxFTMqVNm +Ebrh6/DROeoyT+xnKMiVVirhrCUqBn/8jdtOjgUHPiUoseno5SAbhi/pjiEWeCzH3oE s+XPJcSGbX/iHFnz6vy1/IcngcIRIlhNiDg56uRIsNgEaxxaMetg3XuXa4IozCHL9K11 HJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XYuRs6bkhwN0qlbOF9g9zQ6AC9ywRIb96YslnQYh20M=; fh=uji+twC10Tbq4QAz22onFpk5e+GgI953OGc8BRMEjHI=; b=rbh5V5RH3jVhBbsdW5dmpKLi+tlT5WRDQONvRL3MGMdstnkX++MRgdIe9tgtSl1c1G b6WipqoE2Gq0f2XwDplLk3NUqHypLgV69KYVJz5+duIMjxltetu9Hkv9FxZmfODvzJj2 mGRpZscVkuKm/H9baCaQlYy2l80nGQhjzj2YHFT9d6CsWRlAZgloJk5w0Qrfjt8jzjxb pIUHGKhwNhc+WlNE4TosAARP4WyFFkFU9kWGc/LCdaW586SLX/Dq2FdbMUw0yoVxvHvl FHW62+m2ljJHmiRMi0WURTR7C3tBCFGHft086FvddjHdEoVMIqGcA/aO3Y8sGrFQJfpq WRcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muZZtIvR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d1aa763si5609241fa.659.2024.07.25.13.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muZZtIvR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F25F885EC; Thu, 25 Jul 2024 22:45:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="muZZtIvR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A53928855B; Thu, 25 Jul 2024 22:45:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 46CDE88363 for ; Thu, 25 Jul 2024 22:45:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-5d5bc93e09dso186820eaf.3 for ; Thu, 25 Jul 2024 13:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940328; x=1722545128; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XYuRs6bkhwN0qlbOF9g9zQ6AC9ywRIb96YslnQYh20M=; b=muZZtIvRwG8ivyHLZS2o8d+sGS/HToUe5EP+zRvNHuIpo2D6IOBnkjkLwh2XL3vsW2 +cGIdpaZk7zAT2UaRwYLf8nIM7DbUBIsFY4EVjr9M0YW6DrRJEPiZcVO2we/wcCtxQ2A k8iMeeMS05HgqI1Y3R4w1pmClJ1nAvBYyhRpi8YVhiz06EZviRxOVC3JNr65pn1esk1n ZeZRpNx354wXEfLkasOdOr2kNOfbs33HoPodm7OiPtAtN6WAdCH38+R+BHjUS+BK5MD4 yNmZqK9CaJJuRXjOpt//owtFNc4DP5zpqkLvYcmtDXh3S2O3d4No1E9EeUF89MB6MPG3 JHbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940328; x=1722545128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XYuRs6bkhwN0qlbOF9g9zQ6AC9ywRIb96YslnQYh20M=; b=t4P5zlNQOVi/67IgtlRBx3efLLuqXEC24Yb7hCPK2iNQcKaYr1Dxk2vXcbbZBJuL1m F9DRblIO2tS0YCL8KeGDebaIq6VQh2VQym5v2B/HN8HIjs4dK+PWo6ZGG4Jhdz1rrSj9 1AWhKQ5ujEITD1Ul05u3SmFvjgoInU+p8UJODhK2df0bNYmMFfO7lrhYMc+N7sYfpEi5 I8Ihri/tueC5akWS60fbmEZUqtgmo43639eRg+HCw3lLXHfcrxC+DztN+7VaQTj4ScP9 elDqkQt75loS7m3w3ZGS5CKMTj0DLu3yCslZmMV7dHrtNoZYwOM6hnx6pWUliVcM98HP kh7g== X-Forwarded-Encrypted: i=1; AJvYcCWY7GHOhh4r4PdK4HM+EgiZuyzCowMElZNr6l6Ueh9T48BVu1XnOB0C/WHbUI+GVPs5wiGaExsbG7eKSS6AWx+uv5A2JQ== X-Gm-Message-State: AOJu0Yyp9TaXC0df4Pdb+uCP9u9ykHzrsGpZp68w6JSM0qSE1kp6wkal ++SA4oyLvWtKksL5xSLj6q7ra8iumd/sDwAmlu1kPFoJ1/q5qeaL1w1qvla+tro= X-Received: by 2002:a05:6820:4b83:b0:5d5:bce7:677 with SMTP id 006d021491bc7-5d5bce7099dmr1759491eaf.7.1721940327989; Thu, 25 Jul 2024 13:45:27 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b36ca84csm249978eaf.48.2024.07.25.13.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:27 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 09/38] mmc: dw_mmc: Improve 32-bit IDMAC descriptor namings Date: Thu, 25 Jul 2024 15:44:51 -0500 Message-Id: <20240725204520.18134-10-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Prepare for adding 64-bit IDMAC descriptors by renaming current 32-bit descriptor and its fields accordingly. While at it, make use of virt_to_phys() to make it more obvious in which places the physical addresses have to be used. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/dw_mmc.c | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index d73d58bcf7d7..3e7073f7de1b 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -20,11 +20,12 @@ #define PAGE_SIZE 4096 -struct dwmci_idmac { - u32 flags; - u32 cnt; - u32 addr; - u32 next_addr; +/* Internal DMA Controller (IDMAC) descriptor for 32-bit addressing mode */ +struct dwmci_idmac32 { + u32 des0; /* Control descriptor */ + u32 des1; /* Buffer size */ + u32 des2; /* Buffer physical address */ + u32 des3; /* Next descriptor physical address */ } __aligned(ARCH_DMA_MINALIGN); static int dwmci_wait_reset(struct dwmci_host *host, u32 value) @@ -42,22 +43,23 @@ static int dwmci_wait_reset(struct dwmci_host *host, u32 value) return 0; } -static void dwmci_set_idma_desc(struct dwmci_idmac *idmac, - u32 desc0, u32 desc1, u32 desc2) +static void dwmci_set_idma_desc32(struct dwmci_idmac32 *desc, u32 control, + u32 buf_size, u32 buf_addr) { - struct dwmci_idmac *desc = idmac; + phys_addr_t desc_phys = virt_to_phys(desc); + u32 next_desc_phys = desc_phys + sizeof(struct dwmci_idmac32); - desc->flags = desc0; - desc->cnt = desc1; - desc->addr = desc2; - desc->next_addr = (ulong)desc + sizeof(struct dwmci_idmac); + desc->des0 = control; + desc->des1 = buf_size; + desc->des2 = buf_addr; + desc->des3 = next_desc_phys; } static void dwmci_prepare_desc(struct mmc_data *data, - struct dwmci_idmac *cur_idmac, + struct dwmci_idmac32 *cur_idmac, void *bounce_buffer) { - struct dwmci_idmac *desc = cur_idmac; + struct dwmci_idmac32 *desc32 = cur_idmac; ulong data_start, data_end; unsigned int blk_cnt, i; @@ -65,6 +67,7 @@ static void dwmci_prepare_desc(struct mmc_data *data, blk_cnt = data->blocks; for (i = 0;; i++) { + phys_addr_t buf_phys = virt_to_phys(bounce_buffer); unsigned int flags, cnt; flags = DWMCI_IDMAC_OWN | DWMCI_IDMAC_CH; @@ -76,22 +79,22 @@ static void dwmci_prepare_desc(struct mmc_data *data, } else cnt = data->blocksize * 8; - dwmci_set_idma_desc(desc, flags, cnt, - (ulong)bounce_buffer + i * PAGE_SIZE); - desc++; + dwmci_set_idma_desc32(desc32, flags, cnt, + buf_phys + i * PAGE_SIZE); + desc32++; if (blk_cnt <= 8) break; blk_cnt -= 8; } - data_end = (ulong)desc; + data_end = (ulong)desc32; flush_dcache_range(data_start, roundup(data_end, ARCH_DMA_MINALIGN)); } static void dwmci_prepare_data(struct dwmci_host *host, struct mmc_data *data, - struct dwmci_idmac *cur_idmac, + struct dwmci_idmac32 *cur_idmac, void *bounce_buffer) { unsigned long ctrl; @@ -308,7 +311,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, { #endif struct dwmci_host *host = mmc->priv; - ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac, cur_idmac, + ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac32, cur_idmac, data ? DIV_ROUND_UP(data->blocks, 8) : 0); int ret = 0, flags = 0, i; u32 retry = 100000; From patchwork Thu Jul 25 20:44:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814387 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566696wrn; Thu, 25 Jul 2024 13:47:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVvFULK+NS4TqR0NF0UaHfZDn8r8r63z4Euh1XPqJKgAVQB1cstieRzyPE3tqGkmZmGDv+x9LRqSD+BHyotIS5m X-Google-Smtp-Source: AGHT+IHH48xPOrhFBTRFthS95ItjK9/lWL5pe+uP+WEr6Bzdn9bFAdxPzv/I7AYx9nL3n63Jl2wq X-Received: by 2002:a2e:a378:0:b0:2ef:2272:1784 with SMTP id 38308e7fff4ca-2f039dfc0c3mr27065511fa.47.1721940438402; Thu, 25 Jul 2024 13:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940438; cv=none; d=google.com; s=arc-20160816; b=t1O9uQjaRN9lyj7XsHaconLFSjRNtC3zplTdgR5PcZ+Y3kiImtCA09lhkiGvrEk0hM Hmiz2F49RlWWHsrhlPhF8FyWlmBweYkV9wBR5JlvmPlRsvtb4kEkj4oApWljFQYZDEhc jFR4hsvrm8GWkeyejlh9shpngLvdnUH/k5kpaJdi9Dd4aJKL9uT6hzyQusTr00G7n8Qs LSu3FtOfJEw1f+w7OWCTLofnPpxmht004O7rwMoBUkQQTFP8ydLQANT/H8Y+2S1PBoK8 SjffK4GNuGWeQSru3uuEBEGJt4vR7MCB4bsQsMn4NrQgZZNz3C3ajeIZgWZBk/L86UVr vt8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CmxR4ZcvXF6SEzeL0PPd0fSfnMc5LWimR4ObImxmFdw=; fh=Etun+VgSaOkohR4k82WuK+p99Wk/919x3oRS1oqMDgE=; b=zuKceKDD+v/yPXRMXlgq35CXO4Lrwpgxk1U9OBkg9gEO5MHyKicgrl5rz/5ffTDBOi L4UUeJrQI6biF+oSQmnflqxtPlGmy6pm0i4t7stBs3YupUD8E4Z71ou3stj2zFokiN9H Tu7jM976+nb/CTkBfg+TcaSdaBfGo1xqdw1rZQH9/0V07qHZ3NwxqyshhHXrpsuwMEtN oAZcQNAC6cg3dmpleSGo7SxZ2BgPCOqTZdx5X4KnSTDs9foF8npc5L1o1AziTaRHeAn1 qwf9NMmHNoBjnyexsPcmTzpH4jpb7xb7uFawuEfm0S1GUGcqrPwlUI3BtzU5Rbn2JDjf abzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=knezVozX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d192b9fsi5754361fa.628.2024.07.25.13.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=knezVozX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0E5BF88297; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="knezVozX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A760F884A7; Thu, 25 Jul 2024 22:45:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 22796884A7 for ; Thu, 25 Jul 2024 22:45:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-708adad61f8so197543a34.1 for ; Thu, 25 Jul 2024 13:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940329; x=1722545129; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CmxR4ZcvXF6SEzeL0PPd0fSfnMc5LWimR4ObImxmFdw=; b=knezVozXg8fEiu0P12o6vDnnYnQHoQaRVX7swyJOeAnuolwPIJdKPo8wKntof4mHLY Xo0CstPJ6hhuslH8gydHk5FzwiLdZ79mJBR9GtVrRLkQAPljLI/yNvk1nsjwUTdq5UtU 9FJcSZ/bEBEbEEbgdYGJcZcFp5H2U/y6lJ4Qt5CaUb1lB3Fk0ZRun/XrP/jSqY00iepF 6l3A52gNdNJfydJCNgDmXG0rN9mTkPrxlWPSy37OhMDyBm5g6H61RE7waLvLQD+IxCPM pphx2MWOhDPxdUCVtLzCb4deiridvpCv8ccXp/g+hbnMCJ6VlquCJ1NeBur1wT3ln0c8 ausg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940329; x=1722545129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CmxR4ZcvXF6SEzeL0PPd0fSfnMc5LWimR4ObImxmFdw=; b=jahx6HTnYtNjCvf5q4tly1H3PHW93Kv+Vb6WLUTPHLNYzSSwbMF3rY360bGqHtTM7A fXzVfE58Pc0mUJZ1ncwmSMWqjJ6Mv0Hrueht8VhV8jB1J6x8XmzT/uYfraScOBJ/VXmk PTUt1XL651QMEff98bNcHgMy8mj/zbPkbF4sT0j8ySDYO7APFWjLMXp92ZEeZIclXc2R Y+Vcs6KRaPYJaH8CkOckVozdr4zAijLUsNo9zAEPWTdmJ/y0hWiNz2qCLkVfIXaHI5JQ bOBTC36nXr4ZBpoKDWej5bXwOBo8asajgIlyWWnBui1WzESAQxQhkIg3EYTZM3WL3s1x se5w== X-Forwarded-Encrypted: i=1; AJvYcCW7qcoqwRFg7Xv91gMTWKaxPVS3mMSxxavLZtZFN769/NXPMsrp7e1VhJ58+b9ZyKiWSavmwGlO7jkOu1XnQ+Vl2tPkeQ== X-Gm-Message-State: AOJu0YzKwYX30TCCxdWq3k090w7+qlqYYf33oMY0+ojO1ntqYl6t3PMH XJtJYHz6ySfNuM4t8rIS9kE6nPc/ipVpgzKBDV19CmYe5+aX8ZJqhFpaIYGHP60= X-Received: by 2002:a05:6830:710a:b0:704:4938:e4fb with SMTP id 46e09a7af769-709324c4a94mr4002275a34.24.1721940328831; Thu, 25 Jul 2024 13:45:28 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930787545sm451759a34.74.2024.07.25.13.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:28 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 10/38] mmc: dw_mmc: Add support for 64-bit IDMAC Date: Thu, 25 Jul 2024 15:44:52 -0500 Message-Id: <20240725204520.18134-11-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Some DW MMC blocks (e.g. those on modern Exynos chips) support 64-bit DMA addressing mode. 64-bit DW MMC variants differ from their 32-bit counterparts: - the register layout is a bit different (because there are additional IDMAC registers present for storing upper part of 64-bit addresses) - DMA descriptor structure is bigger and different from 32-bit one Introduce all necessary changes to enable support for 64-bit DMA capable DW MMC blocks. Next changes were made: 1. Check which DMA address mode is supported in current IP-core version. HCON register (bit 27) indicates whether it's 32-bit or 64-bit addressing. Add boolean .dma_64bit_address field to struct dwmci_host and store the result there. dwmci_init_dma() function is introduced for doing so, which is called on driver's init. 2. Add 64-bit DMA descriptor (struct dwmci_idmac64) and use it in dwmci_prepare_desc() in case if .dma_64bit_address field is true. A new dwmci_set_idma_desc64() function was added for populating that descriptor. 3. Add registers for 64-bit DMA capable blocks. To make the access to IDMAC registers universal between 32-bit / 64-bit cases, a new struct dwmci_idmac_regs (and corresponding host->regs field) was introduced, which abstracts the hardware by being set to appropriate offset constants on init. All direct calls to IDMAC registers were correspondingly replaced by accessing host->regs. 4. Allocate and use 64-bit DMA descriptors buffer in case when IDMAC is 64-bit capable. Extract all the code (except for the IDMAC descriptors buffer allocation) from dwmci_send_cmd() to dwmci_send_cmd_common(), so that it's possible to keep IDMAC buffer (either 32-bit or 64-bit) on stack during send_cmd routine. The insights for this implementation were taken from Linux kernel DW MMC driver. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/dw_mmc.c | 152 ++++++++++++++++++++++++++++++++++--------- include/dwmmc.h | 39 ++++++++++- 2 files changed, 160 insertions(+), 31 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 3e7073f7de1b..55eb8a54f594 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -28,6 +28,39 @@ struct dwmci_idmac32 { u32 des3; /* Next descriptor physical address */ } __aligned(ARCH_DMA_MINALIGN); +/* Internal DMA Controller (IDMAC) descriptor for 64-bit addressing mode */ +struct dwmci_idmac64 { + u32 des0; /* Control descriptor */ + u32 des1; /* Reserved */ + u32 des2; /* Buffer sizes */ + u32 des3; /* Reserved */ + u32 des4; /* Lower 32-bits of Buffer Address Pointer 1 */ + u32 des5; /* Upper 32-bits of Buffer Address Pointer 1 */ + u32 des6; /* Lower 32-bits of Next Descriptor Address */ + u32 des7; /* Upper 32-bits of Next Descriptor Address */ +} __aligned(ARCH_DMA_MINALIGN); + +/* Register offsets for DW MMC blocks with 32-bit IDMAC */ +static const struct dwmci_idmac_regs dwmci_idmac_regs32 = { + .dbaddrl = DWMCI_DBADDR, + .idsts = DWMCI_IDSTS, + .idinten = DWMCI_IDINTEN, + .dscaddrl = DWMCI_DSCADDR, + .bufaddrl = DWMCI_BUFADDR, +}; + +/* Register offsets for DW MMC blocks with 64-bit IDMAC */ +static const struct dwmci_idmac_regs dwmci_idmac_regs64 = { + .dbaddrl = DWMCI_DBADDRL, + .dbaddru = DWMCI_DBADDRU, + .idsts = DWMCI_IDSTS64, + .idinten = DWMCI_IDINTEN64, + .dscaddrl = DWMCI_DSCADDRL, + .dscaddru = DWMCI_DSCADDRU, + .bufaddrl = DWMCI_BUFADDRL, + .bufaddru = DWMCI_BUFADDRU, +}; + static int dwmci_wait_reset(struct dwmci_host *host, u32 value) { unsigned long timeout = 1000; @@ -55,11 +88,27 @@ static void dwmci_set_idma_desc32(struct dwmci_idmac32 *desc, u32 control, desc->des3 = next_desc_phys; } -static void dwmci_prepare_desc(struct mmc_data *data, - struct dwmci_idmac32 *cur_idmac, - void *bounce_buffer) +static void dwmci_set_idma_desc64(struct dwmci_idmac64 *desc, u32 control, + u32 buf_size, u64 buf_addr) +{ + phys_addr_t desc_phys = virt_to_phys(desc); + u64 next_desc_phys = desc_phys + sizeof(struct dwmci_idmac64); + + desc->des0 = control; + desc->des1 = 0; + desc->des2 = buf_size; + desc->des3 = 0; + desc->des4 = buf_addr & 0xffffffff; + desc->des5 = buf_addr >> 32; + desc->des6 = next_desc_phys & 0xffffffff; + desc->des7 = next_desc_phys >> 32; +} + +static void dwmci_prepare_desc(struct dwmci_host *host, struct mmc_data *data, + void *cur_idmac, void *bounce_buffer) { struct dwmci_idmac32 *desc32 = cur_idmac; + struct dwmci_idmac64 *desc64 = cur_idmac; ulong data_start, data_end; unsigned int blk_cnt, i; @@ -79,34 +128,47 @@ static void dwmci_prepare_desc(struct mmc_data *data, } else cnt = data->blocksize * 8; - dwmci_set_idma_desc32(desc32, flags, cnt, - buf_phys + i * PAGE_SIZE); - desc32++; + if (host->dma_64bit_address) { + dwmci_set_idma_desc64(desc64, flags, cnt, + buf_phys + i * PAGE_SIZE); + desc64++; + } else { + dwmci_set_idma_desc32(desc32, flags, cnt, + buf_phys + i * PAGE_SIZE); + desc32++; + } if (blk_cnt <= 8) break; blk_cnt -= 8; } - data_end = (ulong)desc32; + if (host->dma_64bit_address) + data_end = (ulong)desc64; + else + data_end = (ulong)desc32; flush_dcache_range(data_start, roundup(data_end, ARCH_DMA_MINALIGN)); } static void dwmci_prepare_data(struct dwmci_host *host, struct mmc_data *data, - struct dwmci_idmac32 *cur_idmac, + void *cur_idmac, void *bounce_buffer) { + const u32 idmacl = virt_to_phys(cur_idmac) & 0xffffffff; + const u32 idmacu = (u64)virt_to_phys(cur_idmac) >> 32; unsigned long ctrl; dwmci_wait_reset(host, DWMCI_CTRL_FIFO_RESET); /* Clear IDMAC interrupt */ - dwmci_writel(host, DWMCI_IDSTS, 0xFFFFFFFF); + dwmci_writel(host, host->regs->idsts, 0xffffffff); - dwmci_writel(host, DWMCI_DBADDR, (ulong)cur_idmac); + dwmci_writel(host, host->regs->dbaddrl, idmacl); + if (host->dma_64bit_address) + dwmci_writel(host, host->regs->dbaddru, idmacu); - dwmci_prepare_desc(data, cur_idmac, bounce_buffer); + dwmci_prepare_desc(host, data, cur_idmac, bounce_buffer); ctrl = dwmci_readl(host, DWMCI_CTRL); ctrl |= DWMCI_IDMAC_EN | DWMCI_DMA_EN; @@ -257,13 +319,13 @@ static int dwmci_dma_transfer(struct dwmci_host *host, uint flags, else mask = DWMCI_IDINTEN_TI; - ret = wait_for_bit_le32(host->ioaddr + DWMCI_IDSTS, + ret = wait_for_bit_le32(host->ioaddr + host->regs->idsts, mask, true, 1000, false); if (ret) debug("%s: DWMCI_IDINTEN mask 0x%x timeout\n", __func__, mask); /* Clear interrupts */ - dwmci_writel(host, DWMCI_IDSTS, DWMCI_IDINTEN_MASK); + dwmci_writel(host, host->regs->idsts, DWMCI_IDINTEN_MASK); ctrl = dwmci_readl(host, DWMCI_CTRL); ctrl &= ~DWMCI_DMA_EN; @@ -300,20 +362,10 @@ static void dwmci_wait_while_busy(struct dwmci_host *host, struct mmc_cmd *cmd) } } -#ifdef CONFIG_DM_MMC -static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, - struct mmc_data *data) +static int dwmci_send_cmd_common(struct dwmci_host *host, struct mmc_cmd *cmd, + struct mmc_data *data, void *cur_idmac) { - struct mmc *mmc = mmc_get_mmc_dev(dev); -#else -static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, - struct mmc_data *data) -{ -#endif - struct dwmci_host *host = mmc->priv; - ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac32, cur_idmac, - data ? DIV_ROUND_UP(data->blocks, 8) : 0); - int ret = 0, flags = 0, i; + int ret, flags = 0, i; u32 retry = 100000; u32 mask; struct bounce_buffer bbstate; @@ -432,6 +484,28 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, return ret; } +#ifdef CONFIG_DM_MMC +static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, + struct mmc_data *data) +{ + struct mmc *mmc = mmc_get_mmc_dev(dev); +#else +static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, + struct mmc_data *data) +{ +#endif + struct dwmci_host *host = mmc->priv; + const size_t buf_size = data ? DIV_ROUND_UP(data->blocks, 8) : 0; + + if (host->dma_64bit_address) { + ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac64, idmac, buf_size); + return dwmci_send_cmd_common(host, cmd, data, idmac); + } else { + ALLOC_CACHE_ALIGN_BUFFER(struct dwmci_idmac32, idmac, buf_size); + return dwmci_send_cmd_common(host, cmd, data, idmac); + } +} + static int dwmci_control_clken(struct dwmci_host *host, bool on) { const u32 val = on ? DWMCI_CLKEN_ENABLE | DWMCI_CLKEN_LOW_PWR : 0; @@ -593,6 +667,27 @@ static void dwmci_init_fifo(struct dwmci_host *host) dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); } +static void dwmci_init_dma(struct dwmci_host *host) +{ + int addr_config; + + if (host->fifo_mode) + return; + + addr_config = (dwmci_readl(host, DWMCI_HCON) >> 27) & 0x1; + if (addr_config == 1) { + host->dma_64bit_address = true; + host->regs = &dwmci_idmac_regs64; + debug("%s: IDMAC supports 64-bit address mode\n", __func__); + } else { + host->dma_64bit_address = false; + host->regs = &dwmci_idmac_regs32; + debug("%s: IDMAC supports 32-bit address mode\n", __func__); + } + + dwmci_writel(host, host->regs->idinten, DWMCI_IDINTEN_MASK); +} + static int dwmci_init(struct mmc *mmc) { struct dwmci_host *host = mmc->priv; @@ -615,16 +710,13 @@ static int dwmci_init(struct mmc *mmc) dwmci_writel(host, DWMCI_TMOUT, 0xFFFFFFFF); - dwmci_writel(host, DWMCI_IDINTEN, 0); dwmci_writel(host, DWMCI_BMOD, 1); dwmci_init_fifo(host); + dwmci_init_dma(host); dwmci_writel(host, DWMCI_CLKENA, 0); dwmci_writel(host, DWMCI_CLKSRC, 0); - if (!host->fifo_mode) - dwmci_writel(host, DWMCI_IDINTEN, DWMCI_IDINTEN_MASK); - return 0; } diff --git a/include/dwmmc.h b/include/dwmmc.h index 7e4acf096dce..de18fda68ac8 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -44,12 +44,22 @@ #define DWMCI_UHS_REG 0x074 #define DWMCI_BMOD 0x080 #define DWMCI_PLDMND 0x084 +#define DWMCI_DATA 0x200 +/* Registers to support IDMAC 32-bit address mode */ #define DWMCI_DBADDR 0x088 #define DWMCI_IDSTS 0x08C #define DWMCI_IDINTEN 0x090 #define DWMCI_DSCADDR 0x094 #define DWMCI_BUFADDR 0x098 -#define DWMCI_DATA 0x200 +/* Registers to support IDMAC 64-bit address mode */ +#define DWMCI_DBADDRL 0x088 +#define DWMCI_DBADDRU 0x08c +#define DWMCI_IDSTS64 0x090 +#define DWMCI_IDINTEN64 0x094 +#define DWMCI_DSCADDRL 0x098 +#define DWMCI_DSCADDRU 0x09c +#define DWMCI_BUFADDRL 0x0a0 +#define DWMCI_BUFADDRU 0x0a4 /* Interrupt Mask register */ #define DWMCI_INTMSK_ALL 0xffffffff @@ -142,6 +152,29 @@ /* quirks */ #define DWMCI_QUIRK_DISABLE_SMU (1 << 0) +/** + * struct dwmci_idmac_regs - Offsets of IDMAC registers + * + * @dbaddrl: Descriptor base address, lower 32 bits + * @dbaddru: Descriptor base address, upper 32 bits + * @idsts: Internal DMA status + * @idinten: Internal DMA interrupt enable + * @dscaddrl: IDMAC descriptor address, lower 32 bits + * @dscaddru: IDMAC descriptor address, upper 32 bits + * @bufaddrl: Current data buffer address, lower 32 bits + * @bufaddru: Current data buffer address, upper 32 bits + */ +struct dwmci_idmac_regs { + u32 dbaddrl; + u32 dbaddru; + u32 idsts; + u32 idinten; + u32 dscaddrl; + u32 dscaddru; + u32 bufaddrl; + u32 bufaddru; +}; + /** * struct dwmci_host - Information about a designware MMC host * @@ -157,6 +190,8 @@ * @fifoth_val: Value for FIFOTH register (or 0 to leave unset) * @mmc: Pointer to generic MMC structure for this device * @priv: Private pointer for use by controller + * @dma_64bit_address: Whether DMA supports 64-bit address mode or not + * @regs: Registers that can vary for different DW MMC block versions */ struct dwmci_host { const char *name; @@ -196,6 +231,8 @@ struct dwmci_host { /* use fifo mode to read and write data */ bool fifo_mode; + bool dma_64bit_address; + const struct dwmci_idmac_regs *regs; }; static inline void dwmci_writel(struct dwmci_host *host, int reg, u32 val) From patchwork Thu Jul 25 20:44:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814389 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566775wrn; Thu, 25 Jul 2024 13:47:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6aaeBRw45GPOoBpDf5DG/At8vYQPf+a71B9WweI0He838bLdHE/VAzYYGwznlFrgMgTZ71309a3fLBYHyXv4k X-Google-Smtp-Source: AGHT+IF5hfki9RNaq1bB/rVTQIhn2Nghe53HyF/sg3l9HurF9XheJa0J/aCwjZ1llv83INDYGrn4 X-Received: by 2002:ac2:5393:0:b0:52e:a03f:ef53 with SMTP id 2adb3069b0e04-52fd6035f1dmr2295730e87.24.1721940458390; Thu, 25 Jul 2024 13:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940458; cv=none; d=google.com; s=arc-20160816; b=Snf9RFpkMA2yYN73YjPR4phvh/KUcwfUKs77i+73xtYwFUOYT9cmKrejjt9ih6VSsl tzLhxJTdFkRroA9+lyOrFgk+C2V4ONXUzGxViDokCzKDG1fCOEwu2kMVyApxxjSx+5x8 spzkw+LhaLR3eHalqIRbza5mIQqoPK4IqBdE9GXSc0mAqd0aIZtkmlNA3a2yKZtufNqw 7b3ZyccLgH8O+5KB1Wj8B25+tjDqimOhqJiiBRK4aX1IcTIQqNxjLrDLT8kaiwzvrW2S LzJdardSPcTI/4qI4LTpfHp/+fdGWpYDhkI4m/ojhYSUSmadPyR2EYsI2WEEokj2tS69 zigA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CxAnAZ6fqQhAdImBp1oa5WKCrx2+oZt0LTxNSPanv5M=; fh=Ww+kyM764B5CoVN0r5Pa+B5Pwef+Nf8GXLaZTdo5IoQ=; b=xrcQ4U2FwsSO5zJQ/i1JKK2LggFEftcVXXmiZ24EneN6S277/wEBtllwZIfikgMu8V AO9UjkuAg9rv9BjNvWCDMvGHmGCWhwspuubX7yE5rWIXkcE/9rw2pfbZUAwSZPTV7tw2 mgI18cdo21AxY+HXfHGYGneI5s0xlHaF3YXhaW4aAARLmnZ0eDPolfq3bdNY84esnG9X DLEpeKn8h3pvQRg9qcj7idgrHm0t38gNYyyciscOQNEfYpkJgoeIhzuoQeW3hkZOlI8D OmhxZ1yO+o5RZ9tppwV1Lq2YLK80bktN+0nfORVc20sLxtGKwIxkbJTi5P24wPO2aNQL /2hQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITO6hTvs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5c052b1si663960e87.481.2024.07.25.13.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITO6hTvs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD1DB88636; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ITO6hTvs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 15DD088548; Thu, 25 Jul 2024 22:45:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB73F884F4 for ; Thu, 25 Jul 2024 22:45:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3daf0e73a5bso195655b6e.0 for ; Thu, 25 Jul 2024 13:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940330; x=1722545130; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CxAnAZ6fqQhAdImBp1oa5WKCrx2+oZt0LTxNSPanv5M=; b=ITO6hTvsmh41ht2UIPbmtD/cbYt41DYjgIZvfZGjsG9tutByVdCR92cktGOIeZZT7S Pc1aIkARRMCgBJbCfq/s4CZ6SFOZvzjFBUFHa/0XCQ2t/I7pFuWsr2Qdval4GJjo/VP6 vYpIlv5ALfG5/TjqIDziUAQuFp6aDnfVDClR0SCsFH6OJji9pAMzPQzpmYEAsiA9FifO XH5MDCgMFLPatDyOfvBYAMlvtm4ljF7x9HztwlahJctNK0dal+FHYfsdlAMNbq0Pk5eP kWsUtBA5kRKRkt9Xht8ExbQL3z2ixjl/ehAZfTMP19/YdRoY1MskAeWz/C9fvzVQpvMF 9yxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940330; x=1722545130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CxAnAZ6fqQhAdImBp1oa5WKCrx2+oZt0LTxNSPanv5M=; b=L1lFF2Frk7tfn8HDEQLq3QF9xX24mkAkfSaicVCgxN9/K02w4ySnooZEMOzmxOOvN3 3yKP2+H8HIGKVKWYE1OJRdrEcN+jPuNkAaoyPCPEt/Tet83ZI/XiAG/VnE81eZwtLDQD wJzGYPV737+jeY1JbG05luQnNUC5AQ2CihZiIQSbcF799t+j32T7xMfJV+ufLGQPlTLG Hd/wHxFyU29zkbk/Nl/cwr7BlVR8ONYQbTsnYKJwa1SYLIrMmMvagM75qTkjoddxQkA+ jjVF16vy/G1UxKpg34i4lRHvtzp0p+f6VIShP3Fgz6Tl9q7Uor0nRDc/Ycg2WrVxoeZK xH1w== X-Forwarded-Encrypted: i=1; AJvYcCXcDLK5lTbuqmkmviEh6OKyEbx8LXuYeukPSHspWoADPM2zwkeTaNEkGb+Ib6XKAm1yNDg/un2H+/jh1liQXP57KRXmVg== X-Gm-Message-State: AOJu0YyjR4mwBVOb/jvkqGDNCwiz3mqdeIkrM5TkG4lEgQLImgCilsrg 9KR7xW+C5748roYfE0Xd0/7otriWgu8plAhPQWao+H6S1SuLmU5Vi0OClQspa/I= X-Received: by 2002:a05:6808:1883:b0:3d8:a93a:33bd with SMTP id 5614622812f47-3db14184235mr3653248b6e.34.1721940329605; Thu, 25 Jul 2024 13:45:29 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1341ebbasm431332b6e.20.2024.07.25.13.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:29 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 11/38] mmc: dw_mmc: Replace fifoth_val property with fifo-depth Date: Thu, 25 Jul 2024 15:44:53 -0500 Message-Id: <20240725204520.18134-12-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Replace fifoth_val property with its fifo-depth counterpart in all DW MMC drivers. fifo-depth is a common property used in upstream Linux kernel. The FIFOTH register value will be calculated using fifo-depth value in DW MMC core (dw_mmc.c). This change reduces code duplication in platform drivers, and pulls common FIFOTH register value calculation into core dw_mmc driver where it belongs. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/dw_mmc.c | 21 +++++++++++++-------- drivers/mmc/exynos_dw_mmc.c | 10 +++++----- drivers/mmc/ftsdc010_mci.h | 1 - drivers/mmc/hi6220_dw_mmc.c | 7 +++---- drivers/mmc/nexell_dw_mmc.c | 5 +---- drivers/mmc/rockchip_dw_mmc.c | 5 +---- drivers/mmc/snps_dw_mmc.c | 6 ++---- drivers/mmc/socfpga_dw_mmc.c | 4 ++-- include/dwmmc.h | 4 ++-- 9 files changed, 29 insertions(+), 34 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 55eb8a54f594..47dcc37c2c7c 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -218,8 +218,6 @@ static unsigned int dwmci_get_timeout(struct mmc *mmc, const unsigned int size) static int dwmci_data_transfer_fifo(struct dwmci_host *host, struct mmc_data *data, u32 mask) { - const u32 fifo_depth = (((host->fifoth_val & RX_WMARK_MASK) >> - RX_WMARK_SHIFT) + 1) * 2; const u32 int_rx = mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO); const u32 int_tx = mask & DWMCI_INTMSK_TXDR; int ret = 0; @@ -254,8 +252,8 @@ static int dwmci_data_transfer_fifo(struct dwmci_host *host, if (ret < 0) break; - len = fifo_depth - ((len >> DWMCI_FIFO_SHIFT) & - DWMCI_FIFO_MASK); + len = host->fifo_depth - ((len >> DWMCI_FIFO_SHIFT) & + DWMCI_FIFO_MASK); len = min(size, len); for (i = 0; i < len; i++) dwmci_writel(host, DWMCI_DATA, *buf++); @@ -655,16 +653,23 @@ static int dwmci_set_ios(struct mmc *mmc) static void dwmci_init_fifo(struct dwmci_host *host) { - if (!host->fifoth_val) { + u32 fifo_thr, fifoth_val; + + if (!host->fifo_depth) { u32 fifo_size; + /* + * Automatically detect FIFO depth from FIFOTH register. + * Power-on value of RX_WMark is FIFO_DEPTH-1. + */ fifo_size = dwmci_readl(host, DWMCI_FIFOTH); fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1; - host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) | - TX_WMARK(fifo_size / 2); + host->fifo_depth = fifo_size; } - dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); + fifo_thr = host->fifo_depth / 2; + fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_thr - 1) | TX_WMARK(fifo_thr); + dwmci_writel(host, DWMCI_FIFOTH, fifoth_val); } static void dwmci_init_dma(struct dwmci_host *host) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index a51f762988da..377c9e6d90b9 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -150,8 +150,8 @@ static int do_dwmci_init(struct dwmci_host *host) return exynos_dwmci_core_init(host); } -static int exynos_dwmci_get_config(const void *blob, int node, - struct dwmci_host *host, +static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, + int node, struct dwmci_host *host, struct dwmci_exynos_priv_data *priv) { int err = 0; @@ -200,7 +200,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, priv->sdr_timing = DWMMC_MMC2_SDR_TIMING_VAL; } - host->fifoth_val = fdtdec_get_int(blob, node, "fifoth_val", 0); + host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); host->bus_hz = fdtdec_get_int(blob, node, "bus_hz", 0); host->div = fdtdec_get_int(blob, node, "div", 0); @@ -216,8 +216,8 @@ static int exynos_dwmmc_probe(struct udevice *dev) struct dwmci_host *host = &priv->host; int err; - err = exynos_dwmci_get_config(gd->fdt_blob, dev_of_offset(dev), host, - priv); + err = exynos_dwmci_get_config(dev, gd->fdt_blob, dev_of_offset(dev), + host, priv); if (err) return err; err = do_dwmci_init(host); diff --git a/drivers/mmc/ftsdc010_mci.h b/drivers/mmc/ftsdc010_mci.h index 782d92be2f5f..36187cfa04f6 100644 --- a/drivers/mmc/ftsdc010_mci.h +++ b/drivers/mmc/ftsdc010_mci.h @@ -28,7 +28,6 @@ struct ftsdc010_chip { int dev_index; int dev_id; int buswidth; - u32 fifoth_val; struct mmc *mmc; void *priv; bool fifo_mode; diff --git a/drivers/mmc/hi6220_dw_mmc.c b/drivers/mmc/hi6220_dw_mmc.c index c68a9157bfcc..0302f5c296b9 100644 --- a/drivers/mmc/hi6220_dw_mmc.c +++ b/drivers/mmc/hi6220_dw_mmc.c @@ -36,7 +36,7 @@ struct hi6220_dwmmc_priv_data { struct hisi_mmc_data { unsigned int clock; bool use_fifo; - u32 fifoth_val; + u32 fifo_depth; }; static int hi6220_dwmmc_of_to_plat(struct udevice *dev) @@ -125,7 +125,7 @@ static int hi6220_dwmmc_probe(struct udevice *dev) host->mmc = &plat->mmc; host->fifo_mode = mmc_data->use_fifo; - host->fifoth_val = mmc_data->fifoth_val; + host->fifo_depth = mmc_data->fifo_depth; host->mmc->priv = &priv->host; upriv->mmc = host->mmc; host->mmc->dev = dev; @@ -158,8 +158,7 @@ static const struct hisi_mmc_data hi6220_mmc_data = { static const struct hisi_mmc_data hi3798mv2x_mmc_data = { .clock = 50000000, .use_fifo = false, - // FIFO depth is 256 - .fifoth_val = MSIZE(4) | RX_WMARK(0x7f) | TX_WMARK(0x80), + .fifo_depth = 256, }; static const struct udevice_id hi6220_dwmmc_ids[] = { diff --git a/drivers/mmc/nexell_dw_mmc.c b/drivers/mmc/nexell_dw_mmc.c index 2e1ce54c7d50..80df617e07e9 100644 --- a/drivers/mmc/nexell_dw_mmc.c +++ b/drivers/mmc/nexell_dw_mmc.c @@ -186,10 +186,7 @@ static int nexell_dwmmc_probe(struct udevice *dev) struct dwmci_host *host = &priv->host; struct udevice *pwr_dev __maybe_unused; - host->fifoth_val = MSIZE(0x2) | - RX_WMARK(priv->fifo_size / 2 - 1) | - TX_WMARK(priv->fifo_size / 2); - + host->fifo_depth = priv->fifo_size; host->fifo_mode = priv->fifo_mode; dwmci_setup_cfg(&plat->cfg, host, priv->max_freq, priv->min_freq); diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 1a10b7057a47..b2a46a95481c 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -138,10 +138,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev) if (ret < 0) return ret; #endif - host->fifoth_val = MSIZE(0x2) | - RX_WMARK(priv->fifo_depth / 2 - 1) | - TX_WMARK(priv->fifo_depth / 2); - + host->fifo_depth = priv->fifo_depth; host->fifo_mode = priv->fifo_mode; #if CONFIG_IS_ENABLED(MMC_PWRSEQ) diff --git a/drivers/mmc/snps_dw_mmc.c b/drivers/mmc/snps_dw_mmc.c index 9bdbe5070b1d..f30331e51f7e 100644 --- a/drivers/mmc/snps_dw_mmc.c +++ b/drivers/mmc/snps_dw_mmc.c @@ -81,7 +81,7 @@ static int snps_dwmmc_of_to_plat(struct udevice *dev) host->ioaddr = dev_read_addr_ptr(dev); /* - * If fifo-depth is unset don't set fifoth_val - we will try to + * If fifo-depth is unset don't set fifo_depth - we will try to * auto detect it. */ ret = dev_read_u32(dev, "fifo-depth", &fifo_depth); @@ -89,9 +89,7 @@ static int snps_dwmmc_of_to_plat(struct udevice *dev) if (fifo_depth < FIFO_MIN || fifo_depth > FIFO_MAX) return -EINVAL; - host->fifoth_val = MSIZE(0x2) | - RX_WMARK(fifo_depth / 2 - 1) | - TX_WMARK(fifo_depth / 2); + host->fifo_depth = fifo_depth; } host->buswidth = dev_read_u32_default(dev, "bus-width", 4); diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c index f738019b8357..3147d3019c0a 100644 --- a/drivers/mmc/socfpga_dw_mmc.c +++ b/drivers/mmc/socfpga_dw_mmc.c @@ -134,8 +134,8 @@ static int socfpga_dwmmc_of_to_plat(struct udevice *dev) * We only have one dwmmc block on gen5 SoCFPGA. */ host->dev_index = 0; - host->fifoth_val = MSIZE(0x2) | - RX_WMARK(fifo_depth / 2 - 1) | TX_WMARK(fifo_depth / 2); + + host->fifo_depth = fifo_depth; priv->drvsel = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), "drvsel", 3); priv->smplsel = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), diff --git a/include/dwmmc.h b/include/dwmmc.h index de18fda68ac8..7bb456e792b4 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -187,7 +187,7 @@ struct dwmci_idmac_regs { * @dev_index: Arbitrary device index for use by controller * @dev_id: Arbitrary device ID for use by controller * @buswidth: Bus width in bits (8 or 4) - * @fifoth_val: Value for FIFOTH register (or 0 to leave unset) + * @fifo_depth: Depth of FIFO, bytes (or 0 for automatic detection) * @mmc: Pointer to generic MMC structure for this device * @priv: Private pointer for use by controller * @dma_64bit_address: Whether DMA supports 64-bit address mode or not @@ -204,7 +204,7 @@ struct dwmci_host { int dev_index; int dev_id; int buswidth; - u32 fifoth_val; + u32 fifo_depth; struct mmc *mmc; void *priv; From patchwork Thu Jul 25 20:44:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814388 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566743wrn; Thu, 25 Jul 2024 13:47:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV2D1zg5+3jRtpiAGJG/YRwZy1WJ6/leAbyDE5+vx2fyLbtxsjCs6QojHL8qSKpngSGSla9NDFq5ZwgmkwG+aX7 X-Google-Smtp-Source: AGHT+IHSSik4R4sa6ZtBV12Mtef2LfNUMb0dMZrqO6qXyLfq5P+dfI+NucSMdQwFPLT2WaEOWQ/H X-Received: by 2002:a05:6512:250e:b0:52c:e4bf:d55d with SMTP id 2adb3069b0e04-52fd6018c2bmr2570122e87.8.1721940448844; Thu, 25 Jul 2024 13:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940448; cv=none; d=google.com; s=arc-20160816; b=0ro8n2zLICfxiUhFr1uo+S6DQjPPD8CKsSo4Db6GxYVllhEbZwSZJwtbX/hjjK0eeR H7hQbw7msN837UQsdX7UrP9DObPh1dvrccFYge82Pqn7wIjJ6FIudSpbG7+nvG1sspHt iWNBa9kVe+e2ioj/zRe0oLPiVZcofQDleYvxkcdQhAXbtctBjWLWu2gGL+hDVz2iVsCG 6ItioF8sx6TQw8y6+aaoIGy6yS/UrSjK6LX3Khbr+zUtkYSdkVBC1nuKmw0l08zlsESE Akmuw4MWn1OL6gYgHL2NiJWFgsYN2fxsq6HtxGpbnCYRQevId0VbWdf/eJPQqyysqpNo MPBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a40G8u2EgFrHAXbrmp88TxBHu1vZu19Kz53BjR3d9mY=; fh=poTxWQwf6Heylr38AGYEuaUdcI/w23QwhmqlY5A3YSo=; b=wDXcV3IO1XCfK+a9Nvw8bOV5o1xJ/wVK7W7gTr7dL32+4T6FCkxxAfhs95+EN4xnpw eDOqD9kEV8aqJCUrox0p2kLzpJbWAqgJPif2ZSy9GyPffWNzOQEu1X9Rj8Snsl6YJ/1h S0bXDlD5bbpMdWjR87CUGclvCIdAfG3eyWwsc8w0wDOvJt52pxfUXybC72GL2OpWikoR DnEvs1GRCytho+bX0v0rtfHCc8Scnz91zfm9BJqUnKP8KMb37LG01qYTc4hOi5eDMAYp LpDqr/qkEMwPmPPgxp7tGUI58xn/aheO1qhc0smk9NpEQcyX0i46nJjllqqDneOOoDSO gr9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fZv1UzUK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfb6f6si677559e87.388.2024.07.25.13.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fZv1UzUK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A08E88621; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="fZv1UzUK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AE2D8859B; Thu, 25 Jul 2024 22:45:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 99B8E88548 for ; Thu, 25 Jul 2024 22:45:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-70938328a0aso163460a34.1 for ; Thu, 25 Jul 2024 13:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940330; x=1722545130; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a40G8u2EgFrHAXbrmp88TxBHu1vZu19Kz53BjR3d9mY=; b=fZv1UzUKXTIS993+bXWkfm0ilAgnUpyPDPifFK3YoTO+6BXHx5NV/N5kO/ZfM2MM9F wTo33PcSgjM33vjycZnzqnhfpuNZPUUP1ryeNROkmTx86Ea24s+H7XR1mutwgvshYUac SCDov+GESFysJ5tIRk3VSnQFK6vqxIi2ebkGjrqszF3L725Eqb+qj38srtGBRyK7M1nA 3FtcTs8KQXhDBE1G7FpnisjzxxX0a0Mn7W8dRgIukBGybGFM11eOQQY2cq7wZtUWSZVp FnMY/9jUlpRQbHTfXhyCpbpjPeK2bzQFjc4HlORMgQwLXMsFlRIm33mhs8b1DFwigTNH fh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940330; x=1722545130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a40G8u2EgFrHAXbrmp88TxBHu1vZu19Kz53BjR3d9mY=; b=iFUDGSgAj8qq3yNr2y+Qhv4rhFi0IoiFvMMPZGH+pup2pRmalEW3aB6d2LRdzwhxFO A9Gu1G9yg7WC7Ltjd16sZDGsfrKyEg9bo4b+G84d9qD4PuES48pMaNOOqa592BhG/c5X c0+Ycl6OC98Pb6VVm/nJNN//PjUlL7rKdBFk38sQTturIlGS6/tOPkjXjj7DcLmPTQBm YIMe4aMcrNxZDwVx0v9/FQDMZ9vjDMXcqjV454zJQ5xE8Fg+FyiC0KnPPtoWqpB2bvWx BZwzNwt63CEyymVEzhwswASBZUP5XxaDD1bNFDgT6BRFpljnxfnj2mHu56dErRtfQaMP HIAQ== X-Forwarded-Encrypted: i=1; AJvYcCXCeDRgNpf2Q7Vevcvrk3otd5VYRrpnF+vQIbkOHJNW1Q+s05iLe9/aCjOEs4/VKKQcU/jCo4HkMr69AE3G5vMnRNsJaw== X-Gm-Message-State: AOJu0Yw6rFRVS7Gvgqw5GK7FYyRsmOI9FuqLk/M9EHePMypJzkV2kT0a jwDhQ8+XtXkr/1vr48FcJ6HZJWFbIHFHMIrGBPxnvGjwDDAFQI8nrcRZ9oMxKrU= X-Received: by 2002:a05:6830:6993:b0:709:2fa3:1329 with SMTP id 46e09a7af769-70932247385mr3607070a34.18.1721940330319; Thu, 25 Jul 2024 13:45:30 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a6d9sm457584a34.9.2024.07.25.13.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:30 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 12/38] mmc: dw_mmc: Fix kernel-doc comments in dwmmc.h Date: Thu, 25 Jul 2024 15:44:54 -0500 Message-Id: <20240725204520.18134-13-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Rework kernel-doc comments in dwmmc.h header so it's actually possible to generate a proper documentation from it usin scripts/kernel-doc script, with no errors. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) include/dwmmc.h | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/include/dwmmc.h b/include/dwmmc.h index 7bb456e792b4..77c8989148a1 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -182,6 +182,7 @@ struct dwmci_idmac_regs { * @ioaddr: Base I/O address of controller * @quirks: Quick flags - see DWMCI_QUIRK_... * @caps: Capabilities - see MMC_MODE_... + * @clock: Current clock frequency (after internal divider), Hz * @bus_hz: Bus speed in Hz, if @get_mmc_clk() is NULL * @div: Arbitrary clock divider value for use by controller * @dev_index: Arbitrary device index for use by controller @@ -190,6 +191,10 @@ struct dwmci_idmac_regs { * @fifo_depth: Depth of FIFO, bytes (or 0 for automatic detection) * @mmc: Pointer to generic MMC structure for this device * @priv: Private pointer for use by controller + * @clksel: (Optional) Platform function to run when speed/width is changed + * @board_init: (Optional) Platform function to run on init + * @cfg: Internal MMC configuration, for !CONFIG_BLK cases + * @fifo_mode: Use FIFO mode (not DMA) to read and write data * @dma_64bit_address: Whether DMA supports 64-bit address mode or not * @regs: Registers that can vary for different DW MMC block versions */ @@ -210,9 +215,12 @@ struct dwmci_host { int (*clksel)(struct dwmci_host *host); void (*board_init)(struct dwmci_host *host); - /** - * Get / set a particular MMC clock frequency + * @get_mmc_clk: (Optional) Platform function to get/set a particular + * MMC clock frequency + * + * @host: DWMMC host + * @freq: Frequency the host is trying to achieve * * This is used to request the current clock frequency of the clock * that drives the DWMMC peripheral. The caller will then use this @@ -220,16 +228,12 @@ struct dwmci_host { * required MMC bus clock frequency. If you want to handle the * clock external to DWMMC, use @freq to select the frequency and * return that value too. Then DWMMC will put itself in bypass mode. - * - * @host: DWMMC host - * @freq: Frequency the host is trying to achieve */ unsigned int (*get_mmc_clk)(struct dwmci_host *host, uint freq); #ifndef CONFIG_BLK struct mmc_config cfg; #endif - /* use fifo mode to read and write data */ bool fifo_mode; bool dma_64bit_address; const struct dwmci_idmac_regs *regs; @@ -267,6 +271,10 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg) #ifdef CONFIG_BLK /** * dwmci_setup_cfg() - Set up the configuration for DWMMC + * @cfg: Configuration structure to fill in (generally &plat->mmc) + * @host: DWMMC host + * @max_clk: Maximum supported clock speed in Hz (e.g. 150000000) + * @min_clk: Minimum supported clock speed in Hz (e.g. 400000) * * This is used to set up a DWMMC device when you are using CONFIG_BLK. * @@ -291,28 +299,23 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg) * struct rockchip_mmc_plat *plat = dev_get_plat(dev); * * See rockchip_dw_mmc.c for an example. - * - * @cfg: Configuration structure to fill in (generally &plat->mmc) - * @host: DWMMC host - * @max_clk: Maximum supported clock speed in HZ (e.g. 150000000) - * @min_clk: Minimum supported clock speed in HZ (e.g. 400000) */ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host, u32 max_clk, u32 min_clk); /** * dwmci_bind() - Set up a new MMC block device + * @dev: Device to set up + * @mmc: Pointer to mmc structure (normally &plat->mmc) + * @cfg: Empty configuration structure (generally &plat->cfg). This is + * normally all zeroes at this point. The only purpose of passing + * this in is to set mmc->cfg to it. * * This is used to set up a DWMMC block device when you are using CONFIG_BLK. * It should be called from your driver's bind() method. * * See rockchip_dw_mmc.c for an example. * - * @dev: Device to set up - * @mmc: Pointer to mmc structure (normally &plat->mmc) - * @cfg: Empty configuration structure (generally &plat->cfg). This is - * normally all zeroes at this point. The only purpose of passing - * this in is to set mmc->cfg to it. * Return: 0 if OK, -ve if the block device could not be created */ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg); @@ -320,12 +323,12 @@ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg); #else /** * add_dwmci() - Add a new DWMMC interface + * @host: DWMMC host structure + * @max_clk: Maximum supported clock speed in Hz (e.g. 150000000) + * @min_clk: Minimum supported clock speed in Hz (e.g. 400000) * * This is used when you are not using CONFIG_BLK. Convert your driver over! * - * @host: DWMMC host structure - * @max_clk: Maximum supported clock speed in HZ (e.g. 150000000) - * @min_clk: Minimum supported clock speed in HZ (e.g. 400000) * Return: 0 if OK, -ve on error */ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk); From patchwork Thu Jul 25 20:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814390 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566810wrn; Thu, 25 Jul 2024 13:47:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUNkIKXhm9mFi2CpJIJAkaGyXpMPqvPDUEYKHeEvchQh3bGTUMFVa1lHpcjFTGKCRz3X4ZFVzLWNsJ1FMq1hNMv X-Google-Smtp-Source: AGHT+IGka6TvdSyi8zFeSaSssrhHAxN+S01IC0EKCqX9HuwE7ZqgC8w+eKN69HLq+Vi4n99wLfkP X-Received: by 2002:a2e:8808:0:b0:2ef:18b7:4408 with SMTP id 38308e7fff4ca-2f039c4e399mr29436801fa.5.1721940468597; Thu, 25 Jul 2024 13:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940468; cv=none; d=google.com; s=arc-20160816; b=IjIsFheBbBrtKcEowT8EOD+5zXGikfLL11eeLuphRZvWMChIcJiF1XWh5yXHortmSY vrJvzaJo4By4sSOsRHZawh9Krj0PNe3d8F0rzzEB7c3fImHLcVmFLI9wzlibV5PceE1l SNTxfop5qORmEv/KwD9i1ymndLylUpObDlDEBEHYjzo3DLIDiZItfSwt+MrrxZDwZky1 g2tAE7cF98TN6aX+Pf2rEMcHx6vzpCMe2lWAL/6NzGTAw04mYETvyiQzG+9fCQzzlOk7 fb9yo+nphqAyVIHxioCNlcl/Whz6TCVt+l4fi58iWvzB2gNdS2fTgfBQpE/C3g8AehFx T8EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OIHOBfSnlWIxNFku9QoIOH1bwkOR7KLwevCNk0BvPNw=; fh=QZWa1O0tylTdsASMZ1cRESZmPSYPJ6weo5fV1CParB8=; b=ZO1z/wDD4mT2vNjUrVOvohdlUeBQH/i91hkrv/RRm6gTXP57gyOqIkocpIaiZ9DYr7 lBQlCZpqLjgLEt2ouIYaCt5aF8q5cO9+IxgsEjbzK4Bp5pit6vVIUBpzbtUXZaMDtKPv 0+lATvpEmyFnvkS1spgaZ9Wiq8ctSGuVLm6XYzxLeDG1PW8cMugcxyyqViIA7GiYU7UZ 3dXWXZ9ZWNSy2PKlOhMEOHrOc7IMJMzaANbwYscr1ZCrjq/APcBx4xeFpDLozWp1czlY 4d7Wk3vd0sVtAO/C8JmPS8Kqtw37itfjJeoRSivTFVqvk0+gg2Ip3LBGvj5Inkh+019h 3d3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxqNRlGq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d1520b8si6040641fa.341.2024.07.25.13.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxqNRlGq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4327488570; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sxqNRlGq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89C1A88585; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 76B10883BB for ; Thu, 25 Jul 2024 22:45:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-261112c303bso418176fac.1 for ; Thu, 25 Jul 2024 13:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940331; x=1722545131; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OIHOBfSnlWIxNFku9QoIOH1bwkOR7KLwevCNk0BvPNw=; b=sxqNRlGqaikriX9bTryGIz7tck1UVR0XHRcMgXRwM3/bBjg+D+8+65E/rTV9U7BlQb W7mA8Njv20y7/ahXQOCxy0WTi7ORqtAhRTNjSYuKQ7kIvtC9YiYJxsA0jWQoaefvTbfs Mec+YQ0oLtvq9NLxa9VwqADqe11JHH/dpwJYgupRwTPwVPjYIe0g1M8NX38nmTmjWaep PttIqte9GHApNPkDvyJATDRbF2UOA+g8XghQAbcNraJPz/VP3Cmg6aFBgVzyhCasdNFs NGOAPxq4zBNII6/P5DBKDrLZcI0qPJ6IS8o7h+pZzm+b4BGTbTz6eutc6UfjB7KHGKwt TVQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940331; x=1722545131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OIHOBfSnlWIxNFku9QoIOH1bwkOR7KLwevCNk0BvPNw=; b=XUBBcMpwMBv1L5hvGCjhdVcR9xf/4Ha2TsU4UXtMtZKkSu+vj174VpPRnxYZtKYHa/ EGVmztNa9f4V2RJyS2lE72SpnWR4qe0EQHMVpd0YrNzVCCk19jCaBF989k0a7y1JnpjD KLT0Xom4clapJvGr9+C3yEHLTMMwPLvELrPeLswpamg727nj6/xuuSLg08FUy+1vZqj3 /rZHLmNX+GScus1+aYBziE/t0SuaFPqYrUv0H59Uv9MlYA1AgLvmr/aEWX2tn0PmxwW0 02zVgJ28867HaB8HHDbu1AiB9xr2Ts9aq4sRjUGIah4H1MCVhExsgzdK7t9uim/opQR0 6hXA== X-Forwarded-Encrypted: i=1; AJvYcCVig2MBhHrWIp03d6+upPl9e77b0asZ0HGwAJEJxKKhtYMUOFqEbbHR1b8tuk6eqHvoK+G6fQINIJ+3p+qe3IB0sagCaQ== X-Gm-Message-State: AOJu0Yzdy2iuk/HzGuRKeiUfh5yX6TS0HWPaCPHcG0N+Uw8eQI/e07ZE 6UQfFNQwGN9+jcHxTge7RIb3LipM4z2YuOc8o8zDeLnIirO+3sQT8XXOoztSqr0= X-Received: by 2002:a05:6870:d62c:b0:25e:1cdf:c604 with SMTP id 586e51a60fabf-266edde0cd1mr3978094fac.31.1721940331017; Thu, 25 Jul 2024 13:45:31 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a055sm453325a34.2.2024.07.25.13.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:30 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 13/38] mmc: dw_mmc: Improve coding style Date: Thu, 25 Jul 2024 15:44:55 -0500 Message-Id: <20240725204520.18134-14-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Fix most of checkpatch warnings and other obvious style issues. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v4: - Rebased on top of the most recent master Changes in v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 68 ++++++++++---------- include/dwmmc.h | 149 ++++++++++++++++++++++--------------------- 2 files changed, 110 insertions(+), 107 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 47dcc37c2c7c..8551eac70185 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -125,8 +125,9 @@ static void dwmci_prepare_desc(struct dwmci_host *host, struct mmc_data *data, if (blk_cnt <= 8) { flags |= DWMCI_IDMAC_LD; cnt = data->blocksize * blk_cnt; - } else + } else { cnt = data->blocksize * 8; + } if (host->dma_64bit_address) { dwmci_set_idma_desc64(desc64, flags, cnt, @@ -150,10 +151,8 @@ static void dwmci_prepare_desc(struct dwmci_host *host, struct mmc_data *data, flush_dcache_range(data_start, roundup(data_end, ARCH_DMA_MINALIGN)); } -static void dwmci_prepare_data(struct dwmci_host *host, - struct mmc_data *data, - void *cur_idmac, - void *bounce_buffer) +static void dwmci_prepare_data(struct dwmci_host *host, struct mmc_data *data, + void *cur_idmac, void *bounce_buffer) { const u32 idmacl = virt_to_phys(cur_idmac) & 0xffffffff; const u32 idmacu = (u64)virt_to_phys(cur_idmac) >> 32; @@ -277,7 +276,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) for (;;) { mask = dwmci_readl(host, DWMCI_RINTSTS); - /* Error during data transfer. */ + /* Error during data transfer */ if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) { debug("%s: DATA ERROR!\n", __func__); ret = -EINVAL; @@ -286,16 +285,15 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) ret = dwmci_data_transfer_fifo(host, data, mask); - /* Data arrived correctly. */ + /* Data arrived correctly */ if (mask & DWMCI_INTMSK_DTO) { ret = 0; break; } - /* Check for timeout. */ + /* Check for timeout */ if (get_timer(start) > timeout) { - debug("%s: Timeout waiting for data!\n", - __func__); + debug("%s: Timeout waiting for data!\n", __func__); ret = -ETIMEDOUT; break; } @@ -317,8 +315,8 @@ static int dwmci_dma_transfer(struct dwmci_host *host, uint flags, else mask = DWMCI_IDINTEN_TI; - ret = wait_for_bit_le32(host->ioaddr + host->regs->idsts, - mask, true, 1000, false); + ret = wait_for_bit_le32(host->ioaddr + host->regs->idsts, mask, true, + 1000, false); if (ret) debug("%s: DWMCI_IDINTEN mask 0x%x timeout\n", __func__, mask); @@ -334,7 +332,7 @@ static int dwmci_dma_transfer(struct dwmci_host *host, uint flags, } static int dwmci_set_transfer_mode(struct dwmci_host *host, - struct mmc_data *data) + struct mmc_data *data) { unsigned long mode; @@ -380,12 +378,12 @@ static int dwmci_send_cmd_common(struct dwmci_host *host, struct mmc_cmd *cmd, } else { if (data->flags == MMC_DATA_READ) { ret = bounce_buffer_start(&bbstate, - (void*)data->dest, + (void *)data->dest, data->blocksize * data->blocks, GEN_BB_WRITE); } else { ret = bounce_buffer_start(&bbstate, - (void*)data->src, + (void *)data->src, data->blocksize * data->blocks, GEN_BB_READ); } @@ -420,9 +418,9 @@ static int dwmci_send_cmd_common(struct dwmci_host *host, struct mmc_cmd *cmd, if (cmd->resp_type & MMC_RSP_CRC) flags |= DWMCI_CMD_CHECK_CRC; - flags |= (cmd->cmdidx | DWMCI_CMD_START | DWMCI_CMD_USE_HOLD_REG); + flags |= cmd->cmdidx | DWMCI_CMD_START | DWMCI_CMD_USE_HOLD_REG; - debug("Sending CMD%d\n",cmd->cmdidx); + debug("Sending CMD%d\n", cmd->cmdidx); dwmci_writel(host, DWMCI_CMD, flags); @@ -436,7 +434,7 @@ static int dwmci_send_cmd_common(struct dwmci_host *host, struct mmc_cmd *cmd, } if (i == retry) { - debug("%s: Timeout.\n", __func__); + debug("%s: Timeout\n", __func__); return -ETIMEDOUT; } @@ -449,14 +447,14 @@ static int dwmci_send_cmd_common(struct dwmci_host *host, struct mmc_cmd *cmd, * below shall be debug(). eMMC cards also do not favor * CMD8, please keep that in mind. */ - debug("%s: Response Timeout.\n", __func__); + debug("%s: Response Timeout\n", __func__); return -ETIMEDOUT; } else if (mask & DWMCI_INTMSK_RE) { - debug("%s: Response Error.\n", __func__); + debug("%s: Response Error\n", __func__); return -EIO; } else if ((cmd->resp_type & MMC_RSP_CRC) && (mask & DWMCI_INTMSK_RCRC)) { - debug("%s: Response CRC Error.\n", __func__); + debug("%s: Response CRC Error\n", __func__); return -EIO; } @@ -555,24 +553,24 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq) unsigned long sclk; int ret; - if ((freq == host->clock) || (freq == 0)) + if (freq == host->clock || freq == 0) return 0; + /* - * If host->get_mmc_clk isn't defined, - * then assume that host->bus_hz is source clock value. - * host->bus_hz should be set by user. + * If host->get_mmc_clk isn't defined, then assume that host->bus_hz is + * source clock value. host->bus_hz should be set by user. */ - if (host->get_mmc_clk) + if (host->get_mmc_clk) { sclk = host->get_mmc_clk(host, freq); - else if (host->bus_hz) + } else if (host->bus_hz) { sclk = host->bus_hz; - else { - debug("%s: Didn't get source clock value.\n", __func__); + } else { + debug("%s: Didn't get source clock value\n", __func__); return -EINVAL; } if (sclk == freq) - div = 0; /* bypass mode */ + div = 0; /* bypass mode */ else div = DIV_ROUND_UP(sclk, 2 * freq); @@ -596,7 +594,7 @@ static int dwmci_set_ios(struct mmc *mmc) struct dwmci_host *host = (struct dwmci_host *)mmc->priv; u32 ctype, regs; - debug("Buswidth = %d, clock: %d\n", mmc->bus_width, mmc->clock); + debug("Bus width = %d, clock: %d\n", mmc->bus_width, mmc->clock); dwmci_setup_bus(host, mmc->clock); switch (mmc->bus_width) { @@ -710,10 +708,10 @@ static int dwmci_init(struct mmc *mmc) /* Enumerate at 400KHz */ dwmci_setup_bus(host, mmc->cfg->f_min); - dwmci_writel(host, DWMCI_RINTSTS, 0xFFFFFFFF); + dwmci_writel(host, DWMCI_RINTSTS, 0xffffffff); dwmci_writel(host, DWMCI_INTMASK, 0); - dwmci_writel(host, DWMCI_TMOUT, 0xFFFFFFFF); + dwmci_writel(host, DWMCI_TMOUT, 0xffffffff); dwmci_writel(host, DWMCI_BMOD, 1); dwmci_init_fifo(host); @@ -747,7 +745,7 @@ static const struct mmc_ops dwmci_ops = { #endif void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host, - u32 max_clk, u32 min_clk) + u32 max_clk, u32 min_clk) { cfg->name = host->name; #ifndef CONFIG_DM_MMC @@ -783,7 +781,7 @@ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk) dwmci_setup_cfg(&host->cfg, host, max_clk, min_clk); host->mmc = mmc_create(&host->cfg, host); - if (host->mmc == NULL) + if (!host->mmc) return -1; return 0; diff --git a/include/dwmmc.h b/include/dwmmc.h index 77c8989148a1..a99b2f3bf0cc 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -15,31 +15,31 @@ #define DWMCI_CTRL 0x000 #define DWMCI_PWREN 0x004 #define DWMCI_CLKDIV 0x008 -#define DWMCI_CLKSRC 0x00C +#define DWMCI_CLKSRC 0x00c #define DWMCI_CLKENA 0x010 #define DWMCI_TMOUT 0x014 #define DWMCI_CTYPE 0x018 -#define DWMCI_BLKSIZ 0x01C +#define DWMCI_BLKSIZ 0x01c #define DWMCI_BYTCNT 0x020 #define DWMCI_INTMASK 0x024 #define DWMCI_CMDARG 0x028 -#define DWMCI_CMD 0x02C +#define DWMCI_CMD 0x02c #define DWMCI_RESP0 0x030 #define DWMCI_RESP1 0x034 #define DWMCI_RESP2 0x038 -#define DWMCI_RESP3 0x03C +#define DWMCI_RESP3 0x03c #define DWMCI_MINTSTS 0x040 #define DWMCI_RINTSTS 0x044 #define DWMCI_STATUS 0x048 -#define DWMCI_FIFOTH 0x04C +#define DWMCI_FIFOTH 0x04c #define DWMCI_CDETECT 0x050 #define DWMCI_WRTPRT 0x054 #define DWMCI_GPIO 0x058 -#define DWMCI_TCMCNT 0x05C +#define DWMCI_TCMCNT 0x05c #define DWMCI_TBBCNT 0x060 #define DWMCI_DEBNCE 0x064 #define DWMCI_USRID 0x068 -#define DWMCI_VERID 0x06C +#define DWMCI_VERID 0x06c #define DWMCI_HCON 0x070 #define DWMCI_UHS_REG 0x074 #define DWMCI_BMOD 0x080 @@ -47,7 +47,7 @@ #define DWMCI_DATA 0x200 /* Registers to support IDMAC 32-bit address mode */ #define DWMCI_DBADDR 0x088 -#define DWMCI_IDSTS 0x08C +#define DWMCI_IDSTS 0x08c #define DWMCI_IDINTEN 0x090 #define DWMCI_DSCADDR 0x094 #define DWMCI_BUFADDR 0x098 @@ -63,94 +63,94 @@ /* Interrupt Mask register */ #define DWMCI_INTMSK_ALL 0xffffffff -#define DWMCI_INTMSK_RE (1 << 1) -#define DWMCI_INTMSK_CDONE (1 << 2) -#define DWMCI_INTMSK_DTO (1 << 3) -#define DWMCI_INTMSK_TXDR (1 << 4) -#define DWMCI_INTMSK_RXDR (1 << 5) -#define DWMCI_INTMSK_RCRC (1 << 6) -#define DWMCI_INTMSK_DCRC (1 << 7) -#define DWMCI_INTMSK_RTO (1 << 8) -#define DWMCI_INTMSK_DRTO (1 << 9) -#define DWMCI_INTMSK_HTO (1 << 10) -#define DWMCI_INTMSK_FRUN (1 << 11) -#define DWMCI_INTMSK_HLE (1 << 12) -#define DWMCI_INTMSK_SBE (1 << 13) -#define DWMCI_INTMSK_ACD (1 << 14) -#define DWMCI_INTMSK_EBE (1 << 15) - -/* Raw interrupt Regsiter */ -#define DWMCI_DATA_ERR (DWMCI_INTMSK_EBE | DWMCI_INTMSK_SBE | DWMCI_INTMSK_HLE |\ - DWMCI_INTMSK_FRUN | DWMCI_INTMSK_EBE | DWMCI_INTMSK_DCRC) -#define DWMCI_DATA_TOUT (DWMCI_INTMSK_HTO | DWMCI_INTMSK_DRTO) +#define DWMCI_INTMSK_RE BIT(1) +#define DWMCI_INTMSK_CDONE BIT(2) +#define DWMCI_INTMSK_DTO BIT(3) +#define DWMCI_INTMSK_TXDR BIT(4) +#define DWMCI_INTMSK_RXDR BIT(5) +#define DWMCI_INTMSK_RCRC BIT(6) +#define DWMCI_INTMSK_DCRC BIT(7) +#define DWMCI_INTMSK_RTO BIT(8) +#define DWMCI_INTMSK_DRTO BIT(9) +#define DWMCI_INTMSK_HTO BIT(10) +#define DWMCI_INTMSK_FRUN BIT(11) +#define DWMCI_INTMSK_HLE BIT(12) +#define DWMCI_INTMSK_SBE BIT(13) +#define DWMCI_INTMSK_ACD BIT(14) +#define DWMCI_INTMSK_EBE BIT(15) + +/* Raw interrupt register */ +#define DWMCI_DATA_ERR (DWMCI_INTMSK_EBE | DWMCI_INTMSK_SBE | \ + DWMCI_INTMSK_HLE | DWMCI_INTMSK_FRUN | \ + DWMCI_INTMSK_EBE | DWMCI_INTMSK_DCRC) +#define DWMCI_DATA_TOUT (DWMCI_INTMSK_HTO | DWMCI_INTMSK_DRTO) + /* CTRL register */ -#define DWMCI_CTRL_RESET (1 << 0) -#define DWMCI_CTRL_FIFO_RESET (1 << 1) -#define DWMCI_CTRL_DMA_RESET (1 << 2) -#define DWMCI_DMA_EN (1 << 5) -#define DWMCI_CTRL_SEND_AS_CCSD (1 << 10) -#define DWMCI_IDMAC_EN (1 << 25) +#define DWMCI_CTRL_RESET BIT(0) +#define DWMCI_CTRL_FIFO_RESET BIT(1) +#define DWMCI_CTRL_DMA_RESET BIT(2) +#define DWMCI_DMA_EN BIT(5) +#define DWMCI_CTRL_SEND_AS_CCSD BIT(10) +#define DWMCI_IDMAC_EN BIT(25) #define DWMCI_RESET_ALL (DWMCI_CTRL_RESET | DWMCI_CTRL_FIFO_RESET |\ DWMCI_CTRL_DMA_RESET) /* CMD register */ -#define DWMCI_CMD_RESP_EXP (1 << 6) -#define DWMCI_CMD_RESP_LENGTH (1 << 7) -#define DWMCI_CMD_CHECK_CRC (1 << 8) -#define DWMCI_CMD_DATA_EXP (1 << 9) -#define DWMCI_CMD_RW (1 << 10) -#define DWMCI_CMD_SEND_STOP (1 << 12) -#define DWMCI_CMD_ABORT_STOP (1 << 14) -#define DWMCI_CMD_PRV_DAT_WAIT (1 << 13) -#define DWMCI_CMD_UPD_CLK (1 << 21) -#define DWMCI_CMD_USE_HOLD_REG (1 << 29) -#define DWMCI_CMD_START (1 << 31) +#define DWMCI_CMD_RESP_EXP BIT(6) +#define DWMCI_CMD_RESP_LENGTH BIT(7) +#define DWMCI_CMD_CHECK_CRC BIT(8) +#define DWMCI_CMD_DATA_EXP BIT(9) +#define DWMCI_CMD_RW BIT(10) +#define DWMCI_CMD_SEND_STOP BIT(12) +#define DWMCI_CMD_ABORT_STOP BIT(14) +#define DWMCI_CMD_PRV_DAT_WAIT BIT(13) +#define DWMCI_CMD_UPD_CLK BIT(21) +#define DWMCI_CMD_USE_HOLD_REG BIT(29) +#define DWMCI_CMD_START BIT(31) /* CLKENA register */ -#define DWMCI_CLKEN_ENABLE (1 << 0) -#define DWMCI_CLKEN_LOW_PWR (1 << 16) +#define DWMCI_CLKEN_ENABLE BIT(0) +#define DWMCI_CLKEN_LOW_PWR BIT(16) -/* Card-type registe */ +/* Card type register */ #define DWMCI_CTYPE_1BIT 0 -#define DWMCI_CTYPE_4BIT (1 << 0) -#define DWMCI_CTYPE_8BIT (1 << 16) +#define DWMCI_CTYPE_4BIT BIT(0) +#define DWMCI_CTYPE_8BIT BIT(16) -/* Status Register */ -#define DWMCI_FIFO_EMPTY (1 << 2) -#define DWMCI_FIFO_FULL (1 << 3) -#define DWMCI_BUSY (1 << 9) +/* Status register */ +#define DWMCI_FIFO_EMPTY BIT(2) +#define DWMCI_FIFO_FULL BIT(3) +#define DWMCI_BUSY BIT(9) #define DWMCI_FIFO_MASK 0x1fff #define DWMCI_FIFO_SHIFT 17 -/* FIFOTH Register */ +/* FIFOTH register */ #define MSIZE(x) ((x) << 28) #define RX_WMARK(x) ((x) << 16) #define TX_WMARK(x) (x) #define RX_WMARK_SHIFT 16 #define RX_WMARK_MASK (0xfff << RX_WMARK_SHIFT) -#define DWMCI_IDMAC_OWN (1 << 31) -#define DWMCI_IDMAC_CH (1 << 4) -#define DWMCI_IDMAC_FS (1 << 3) -#define DWMCI_IDMAC_LD (1 << 2) +#define DWMCI_IDMAC_OWN BIT(31) +#define DWMCI_IDMAC_CH BIT(4) +#define DWMCI_IDMAC_FS BIT(3) +#define DWMCI_IDMAC_LD BIT(2) -/* Bus Mode Register */ -#define DWMCI_BMOD_IDMAC_RESET (1 << 0) -#define DWMCI_BMOD_IDMAC_FB (1 << 1) -#define DWMCI_BMOD_IDMAC_EN (1 << 7) +/* Bus Mode register */ +#define DWMCI_BMOD_IDMAC_RESET BIT(0) +#define DWMCI_BMOD_IDMAC_FB BIT(1) +#define DWMCI_BMOD_IDMAC_EN BIT(7) /* UHS register */ -#define DWMCI_DDR_MODE (1 << 16) +#define DWMCI_DDR_MODE BIT(16) /* Internal IDMAC interrupt defines */ -#define DWMCI_IDINTEN_RI BIT(1) -#define DWMCI_IDINTEN_TI BIT(0) +#define DWMCI_IDINTEN_RI BIT(1) +#define DWMCI_IDINTEN_TI BIT(0) +#define DWMCI_IDINTEN_MASK (DWMCI_IDINTEN_TI | DWMCI_IDINTEN_RI) -#define DWMCI_IDINTEN_MASK (DWMCI_IDINTEN_TI | \ - DWMCI_IDINTEN_RI) - -/* quirks */ -#define DWMCI_QUIRK_DISABLE_SMU (1 << 0) +/* Quirks */ +#define DWMCI_QUIRK_DISABLE_SMU BIT(0) /** * struct dwmci_idmac_regs - Offsets of IDMAC registers @@ -230,6 +230,7 @@ struct dwmci_host { * return that value too. Then DWMMC will put itself in bypass mode. */ unsigned int (*get_mmc_clk)(struct dwmci_host *host, uint freq); + #ifndef CONFIG_BLK struct mmc_config cfg; #endif @@ -253,6 +254,7 @@ static inline void dwmci_writeb(struct dwmci_host *host, int reg, u8 val) { writeb(val, host->ioaddr + reg); } + static inline u32 dwmci_readl(struct dwmci_host *host, int reg) { return readl(host->ioaddr + reg); @@ -269,6 +271,7 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg) } #ifdef CONFIG_BLK + /** * dwmci_setup_cfg() - Set up the configuration for DWMMC * @cfg: Configuration structure to fill in (generally &plat->mmc) @@ -301,7 +304,7 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg) * See rockchip_dw_mmc.c for an example. */ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host, - u32 max_clk, u32 min_clk); + u32 max_clk, u32 min_clk); /** * dwmci_bind() - Set up a new MMC block device @@ -321,6 +324,7 @@ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host, int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg); #else + /** * add_dwmci() - Add a new DWMMC interface * @host: DWMMC host structure @@ -332,6 +336,7 @@ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg); * Return: 0 if OK, -ve on error */ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk); + #endif /* !CONFIG_BLK */ #ifdef CONFIG_DM_MMC From patchwork Thu Jul 25 20:44:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814391 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566864wrn; Thu, 25 Jul 2024 13:47:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUow/iSCEBsI9c7q2DXAoPAR2bnf2QZMJ/kP0JzYxPrA+07PyGeossbpfxHL09Jm5ws25+3SiOdqwcyl3wqha9D X-Google-Smtp-Source: AGHT+IENDh69cAxOm+IjZieilnBswv9tUvxZR6keBXvqPJhDpVjHwnOSWtbiHFAtaeLGJjhEUdjb X-Received: by 2002:a2e:908d:0:b0:2ef:2ac1:6d2b with SMTP id 38308e7fff4ca-2f039ce471amr29619071fa.24.1721940478860; Thu, 25 Jul 2024 13:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940478; cv=none; d=google.com; s=arc-20160816; b=ImLdhQtL5vWxKSWM0IjyApJOQoG3gBB/6gmlx/r8Us4s06Rh/SjUMt+BhL0oevN5jL 1ELUZv0ETn35X2/Lnsf1TbkLu3U5jWU9Ur3ceH3CRcfStdA9RwNQiLJtfOgE5tf3GrzM bfzPM61nf37QLU/dury1BxqfQ8mxxBADIJQwyJAxrZ4p7024FjO31Pbx8bw0oS8SvX5y lQJYKXkIRb05HqAXkm+G6UACxNNwgjLk1V9E1PV1AwnBfMJqLHmucATqiQxlnl6hGmcu GLKHDD/8qeF4dtPfAArmE2034wZcGPsYzKZwrZ/FnIORuMjuUe8+UHj2OU/WRKpwvuf/ RqTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xJGaOMwU445ML0HgraJoN3ascBCpNEQ+adW3cTEC6Nc=; fh=mYtWzKBsL6++pDAAYuxCY8GUIo/MkZEn6LVWWwKAEUo=; b=YJHl+Oy+XXljfcZyvD7h7nmaFYmtEZ4gxVYRV9h+Zfag5wVFBdYntduTuFELvtNzyT ft4sP2Gq9OSrpHzyS5vdAfItdqxfcoSWsY7EtlxTHTngX5Vmfdsa0Jn81m6f3H7xMIBV Bp9D+IcX7pXcH5zUZmf+gxanSxphe82SQdsIBk0K6kQ2ioMpaSQtuU9jEDgAhl8s6od+ /u0KDcD80upLtkT2NbUvssOWClrLQtWsgNQEREfqHqi0YhxiaD8XrmcCLu6OHWNiUmDh nwR4rsKvEv50vWYDVmNVR6VDvYG5M0IG58ebaOvVRZ87HxFH4sx64YKmxT0FGDPg+odu GA9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QkFYxkwZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d169804si6073831fa.482.2024.07.25.13.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QkFYxkwZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A5B888609; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QkFYxkwZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C179088585; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 020BF8858C for ; Thu, 25 Jul 2024 22:45:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7092fb4317dso293139a34.0 for ; Thu, 25 Jul 2024 13:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940332; x=1722545132; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xJGaOMwU445ML0HgraJoN3ascBCpNEQ+adW3cTEC6Nc=; b=QkFYxkwZl0m6X6JaB/bij8uW+veSOqd6VfrDhCZI7ezr1H5QgNnYd517uxP/GJLb/E /+9BL4Cf3K8K6TYdp34blB1MPAfICQeOUGuxtAzBPqshNqQFds5AOcqfkfXXjI9iB25M /Nm9H/v3jgkSd39xXHkmWbfhrk06MGUGugYnSmP9bMMXyPAbj6KIuTkUgqu/GSghmUyE v9Pe+mEJ4BVZXWePGXSeyzaYdy3pAtuFzFQl6l7OR+Q8rW3fGBTxMnmTPTajAfiHBnlc nIQKe/H5oL1TroP6fq31w8CRglP1Y3U1Ty/pnAV3oDwY69GuV2+zgN5Rwi2ZNKptw9bx rAGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940332; x=1722545132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xJGaOMwU445ML0HgraJoN3ascBCpNEQ+adW3cTEC6Nc=; b=OQaCLnHeYltqNodCaAjci4h8+YtcXPN/Akd7Ukazlz4ZyG9Vd8pE0MpR7k6DsrOOVc Jyk5SlzpajRfFA3BStQUlhaVOu14wg+eBKUUEhgfvIRaah8XoRcQT+5KuDIlJa/JGchn JG9A0G7cVEO5ADPGzTGc9sg+r3r814xF1ijGR+Gaiu70mPu8NhPRwIIV8zMtht2sV9wY EtjJJIdnbhtihRjX+tnnag7zsJvSDv0osaCpKxXEzkje/FIUxjRenhBql5ssbuXrXpjn HfAUfWTJ7L6tqXW48nthSR01enpfmHE/3ngljBuO2PyCmLHxBi2LzxIP9eFLU/u4LMYa hPLg== X-Forwarded-Encrypted: i=1; AJvYcCWZZ2bz66fMspIKrYtQ0cF9E0yquMq6uWDZB34uokv4CUWftMqezW5NO56rpA58GfQlYYPBf1GuYJ9OipQRIiwceJb2Zg== X-Gm-Message-State: AOJu0Yw0xwdbvj5jrz8O6iWXMSBw3JMqx9sH1hKLQf/2RiFi73PEe7c3 X2leNvkdHzwu1ZuplTWiJfLzCINhYOMFXvS44mbe4EYzN7WgO0uTEtNHLTTe+Ws= X-Received: by 2002:a05:6830:6217:b0:700:d506:cfe9 with SMTP id 46e09a7af769-7093223d036mr4183726a34.19.1721940331702; Thu, 25 Jul 2024 13:45:31 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b35d06c3sm246029eaf.23.2024.07.25.13.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:31 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 14/38] arm: dts: exynos: Add upstream DW MMC properties to all Exynos dts Date: Thu, 25 Jul 2024 15:44:56 -0500 Message-Id: <20240725204520.18134-15-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Some device tree properties for DW MMC block were updated in Linux kernel. Let's follow its example and rework corresponding properties in all Exynos device trees. Don't remove outdated properties yet, it'll be done later once DW MMC driver is updated accordingly to read the updated properties instead of outdated ones. Next properties are added: * samsung,dw-mshc-ciu-div and samsung,dw-mshc-sdr-timing: They were derived from outdated samsung,timing property. * fifo-depth (generic replacement for fifoth_val): FIFO depth was calculated from fifoth_val (using expressions from FIFOTH register description in TRM): fifo-depth = ((fifoth_val >> 16) + 1) * 2 * bus-width: generic replacement for samsung,bus-width * clock-frequency: generic replacement for bus_hz * non-removable: generic replacement for samsung,removable = <0> No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) arch/arm/dts/exynos4210-origen.dts | 1 + arch/arm/dts/exynos4210-trats.dts | 2 ++ arch/arm/dts/exynos4210-universal_c210.dts | 2 ++ arch/arm/dts/exynos4412-odroid.dts | 6 ++++++ arch/arm/dts/exynos4412-trats2.dts | 8 ++++++++ arch/arm/dts/exynos5250-arndale.dts | 6 ++++++ arch/arm/dts/exynos5250-smdk5250.dts | 7 +++++++ arch/arm/dts/exynos5250-snow.dts | 7 +++++++ arch/arm/dts/exynos5250-spring.dts | 4 ++++ arch/arm/dts/exynos5420-smdk5420.dts | 7 +++++++ arch/arm/dts/exynos5422-odroidxu3.dts | 2 ++ arch/arm/dts/exynos54xx.dtsi | 7 +++++++ 12 files changed, 59 insertions(+) diff --git a/arch/arm/dts/exynos4210-origen.dts b/arch/arm/dts/exynos4210-origen.dts index 65a5fcd67eff..a4915de2c49c 100644 --- a/arch/arm/dts/exynos4210-origen.dts +++ b/arch/arm/dts/exynos4210-origen.dts @@ -26,6 +26,7 @@ &sdhci2 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; cd-gpios = <&gpk2 2 0>; status = "okay"; diff --git a/arch/arm/dts/exynos4210-trats.dts b/arch/arm/dts/exynos4210-trats.dts index 05989ee97e5b..4fbdf4730994 100644 --- a/arch/arm/dts/exynos4210-trats.dts +++ b/arch/arm/dts/exynos4210-trats.dts @@ -241,6 +241,7 @@ &sdhci0 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 2 0>; status = "okay"; @@ -248,6 +249,7 @@ &sdhci2 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; cd-gpios = <&gpx3 4 0>; status = "okay"; diff --git a/arch/arm/dts/exynos4210-universal_c210.dts b/arch/arm/dts/exynos4210-universal_c210.dts index 610a8ad2e71e..1b3ac1fee15f 100644 --- a/arch/arm/dts/exynos4210-universal_c210.dts +++ b/arch/arm/dts/exynos4210-universal_c210.dts @@ -236,6 +236,7 @@ &sdhci0 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 2 0>; status = "okay"; @@ -243,6 +244,7 @@ &sdhci2 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; cd-gpios = <&gpx3 4 0>; status = "okay"; diff --git a/arch/arm/dts/exynos4412-odroid.dts b/arch/arm/dts/exynos4412-odroid.dts index ce08e8dc1ebb..24e96ed05868 100644 --- a/arch/arm/dts/exynos4412-odroid.dts +++ b/arch/arm/dts/exynos4412-odroid.dts @@ -243,9 +243,15 @@ &mshc_0 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <2 1 0>; + samsung,dw-mshc-ciu-div = <0>; + samsung,dw-mshc-sdr-timing = <2 1>; samsung,removable = <0>; + non-removable; fifoth_val = <0x203f0040>; + fifo-depth = <0x80>; + clock-frequency = <400000000>; bus_hz = <400000000>; div = <0x3>; index = <4>; diff --git a/arch/arm/dts/exynos4412-trats2.dts b/arch/arm/dts/exynos4412-trats2.dts index c4db137e01f6..30758ffa1ef9 100644 --- a/arch/arm/dts/exynos4412-trats2.dts +++ b/arch/arm/dts/exynos4412-trats2.dts @@ -109,6 +109,7 @@ sdhci@12510000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 4 0>; status = "disabled"; @@ -432,6 +433,7 @@ &sdhci0 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 4 0>; status = "disabled"; @@ -439,6 +441,7 @@ &sdhci2 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; cd-gpios = <&gpk2 2 0>; status = "okay"; @@ -446,9 +449,14 @@ &mshc_0 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <2 1 0>; + samsung,dw-mshc-ciu-div = <0>; + samsung,dw-mshc-sdr-timing = <2 1>; samsung,removable = <0>; + non-removable; fifoth_val = <0x203f0040>; + clock-frequency = <400000000>; bus_hz = <400000000>; div = <0x3>; index = <4>; diff --git a/arch/arm/dts/exynos5250-arndale.dts b/arch/arm/dts/exynos5250-arndale.dts index 60309c61f302..7f84589c97a2 100644 --- a/arch/arm/dts/exynos5250-arndale.dts +++ b/arch/arm/dts/exynos5250-arndale.dts @@ -28,7 +28,10 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; }; mmc@12210000 { @@ -37,7 +40,10 @@ mmc@12220000 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 2>; }; mmc@12230000 { diff --git a/arch/arm/dts/exynos5250-smdk5250.dts b/arch/arm/dts/exynos5250-smdk5250.dts index afe0cca48a93..882db2d1f608 100644 --- a/arch/arm/dts/exynos5250-smdk5250.dts +++ b/arch/arm/dts/exynos5250-smdk5250.dts @@ -146,8 +146,12 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; samsung,removable = <0>; + non-removable; }; mmc@12210000 { @@ -156,7 +160,10 @@ mmc@12220000 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 2>; samsung,removable = <1>; }; diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts index e41f2d3041e2..bcf04d5c07c0 100644 --- a/arch/arm/dts/exynos5250-snow.dts +++ b/arch/arm/dts/exynos5250-snow.dts @@ -302,8 +302,12 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; samsung,removable = <0>; + non-removable; }; mmc@12210000 { @@ -312,7 +316,10 @@ mmc@12220000 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 2>; samsung,removable = <1>; }; diff --git a/arch/arm/dts/exynos5250-spring.dts b/arch/arm/dts/exynos5250-spring.dts index 77e7a6b9e45a..7270a546a795 100644 --- a/arch/arm/dts/exynos5250-spring.dts +++ b/arch/arm/dts/exynos5250-spring.dts @@ -104,8 +104,12 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; samsung,removable = <0>; + non-removable; }; mmc@12210000 { diff --git a/arch/arm/dts/exynos5420-smdk5420.dts b/arch/arm/dts/exynos5420-smdk5420.dts index 7a5da674fbed..1f27baafebaf 100644 --- a/arch/arm/dts/exynos5420-smdk5420.dts +++ b/arch/arm/dts/exynos5420-smdk5420.dts @@ -107,8 +107,12 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; samsung,removable = <0>; + non-removable; samsung,pre-init; }; @@ -118,7 +122,10 @@ mmc@12220000 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 2>; samsung,removable = <1>; }; diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index 9d055d066fd3..767b3e415d58 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -281,10 +281,12 @@ mmc@12200000 { fifoth_val = <0x201f0020>; + fifo-depth = <0x40>; }; mmc@12220000 { fifoth_val = <0x201f0020>; + fifo-depth = <0x40>; }; emmc-reset { diff --git a/arch/arm/dts/exynos54xx.dtsi b/arch/arm/dts/exynos54xx.dtsi index 221da8b4850b..fd74166c7e48 100644 --- a/arch/arm/dts/exynos54xx.dtsi +++ b/arch/arm/dts/exynos54xx.dtsi @@ -120,8 +120,12 @@ mmc@12200000 { samsung,bus-width = <8>; + bus-width = <8>; samsung,timing = <1 3 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; samsung,removable = <0>; + non-removable; samsung,pre-init; }; @@ -131,7 +135,10 @@ mmc@12220000 { samsung,bus-width = <4>; + bus-width = <4>; samsung,timing = <1 2 3>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 2>; samsung,removable = <1>; }; From patchwork Thu Jul 25 20:44:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814394 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567000wrn; Thu, 25 Jul 2024 13:48:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUCMxUGwBNLNo9Qqr43wkqcJ9Kgo7YTdMS4F6OjoAFOCacZ/OpcUyQLVCvwqwQNvD42KEfM7/DmqqLPJCxgBZ3e X-Google-Smtp-Source: AGHT+IHqcWgu7Ms7ilIkyK9p/I4RNMOf9/Pl+szHg+eYaHzfrIyS/ejdO0wHSxafzgxeiG+5Ng+U X-Received: by 2002:a2e:a202:0:b0:2ef:23ec:9363 with SMTP id 38308e7fff4ca-2f039df3c05mr26184951fa.45.1721940508351; Thu, 25 Jul 2024 13:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940508; cv=none; d=google.com; s=arc-20160816; b=Vb8786yOyaOJVx6eHCXHLLpqFoXRq4PIfVfKJKKOxOwvTlcsTQp+UiU3PrISdy1beY ET8aRySLYf7BC1Gx4uL5qOEMidHyzrf7jRVuJluyMasAf7jcUi7/MOgQKvcfAyDlGqW4 SX4sPpg/gS83CTMriTvBcN6jqu4vX8B63fvQ7OeEjTa21haS/9f2eerSGySlK93lkxKW NX9sk4JuCk6tdIKZioBQhZQGErQj3DsVnUuBD1tojxN6EM4gYnRFFiG8zB1HzcXT4EDO HFBbbTOwIrhS79QSv/Mcn8DC84o01OSeKdis5qtkXprwEb7x8SXyrqLYd/OUK+apDVrU N9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7O+j1XkcM7xvkRySBd00VSnTG+7noLEDlPYfT97OsBI=; fh=waxWDitXnDxrS4A0u9m9dgjcaUG+oPJiB+06HIAkZWY=; b=MgrBFEDqEtLuftBIW6tRViQLKJvZgfW/tRK9QPCkK4ImtpjsWB7DqHrMe0JNRHGHiZ nCAYqtzZDM1c+9KAGL7hM1xYcQGn+3HV1sFRTaN6VJfKQsstHelKN6tcXIQGGm0YjEik bX+CAq1dfG2OvNthmoHrcCdM2lzt6d7tkAsNNVPI9JG8P0wasCvYkLPUBL1xmLpFGtqH SCuShE1e+jL6ljFvLVcqpBsPKkvpa8mYfHGRGvC+W2u3ctLRk1ntiCcPwu55/PQCkl/M VWPewm6ipelYQNy/nH/NJQTx5EaDstRN4yr/c8XjsSh5+N0gITu46GjgyD6kxLQTnhdp wpPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aqPF2H4f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d13b209si5878031fa.269.2024.07.25.13.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aqPF2H4f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9106885C5; Thu, 25 Jul 2024 22:45:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="aqPF2H4f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 14EA888548; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B5FDB88599 for ; Thu, 25 Jul 2024 22:45:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3d92e1bc90dso112946b6e.0 for ; Thu, 25 Jul 2024 13:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940332; x=1722545132; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7O+j1XkcM7xvkRySBd00VSnTG+7noLEDlPYfT97OsBI=; b=aqPF2H4fI67GF9IYDZX2EdJRh/4TecHkdlIsOEAAVKwVMCTKUJSsLj7WVlK+Dc08mF iZXSKUCfsMkfAbcQFpjQ4bu+px2h+TMBEs6HAN7euziuao1/E3M223pe1LKgRqlUm54E g900X1nFgHFDAYxiJHFp+vARWTLo05wWdNsygCXIvnd1u/8U9Swx4RYd4TK+GIYmjh7s u/yDcEJi5CETd+afpp0j6k+S5jHIkgcNSVK0tTUjPrch2VpRmHKZUAfZpkUzFKVQ58k8 7gH/PDDwnmFx1t6YywOZt7YCuBa4YVFgY+bRmdVXFvB+cuSv7JjNYeT23q3mr6SnliyU 4hRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940332; x=1722545132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7O+j1XkcM7xvkRySBd00VSnTG+7noLEDlPYfT97OsBI=; b=iEZwqQ9exbQmgJAw7w9eEp1JOtDiIJfmkw7JHxQ+UyqsDSNUbiHjaq7oLfYirTD/Ad iCxVfDQqo3UC251P4IXO/p61rBaMIB2wiYEja79QZpv5uQFbZ8r+IKhS/geLyqNGvzLo jc4/zGjAdOCZAod26vhZkCWJ00YiICp7a5j06Jxi9vmPccI1XSA8j2JKE9Sj9frVdVV0 Kxl/yQYsEoY109tvPy0ymDy8/Ix6qSJzGiFMrIuqbz2i+IYiC997ihtFEgQdyKEn2oC2 bEzUH7JXZzvchgOV76X1XUMg2W6HThTEHW0PQdMSxQCdRPB97S6iRZn3CvYDpYE0Hshc Hi8A== X-Forwarded-Encrypted: i=1; AJvYcCVLu/8Y5liEiECOF3RTmKVG5bmiKG++hIHr7/DjK4//RISgf4Rcf+XqrIkO/fERZdmxVDnuPitUlBhvIE5G5t0gj1SDhQ== X-Gm-Message-State: AOJu0YxhSBxYt8MGPIYiq5EWb1qWealWdgaiB6pNRUKek9n5jQQd4qrm zh3ml8SlRaIOvSS8ktrhFPBP8A+QYUTOtWdefitSR8ERgVMUcJdondvWX3nSfEE= X-Received: by 2002:a05:6808:2012:b0:3d9:4221:606b with SMTP id 5614622812f47-3db10c2fa4amr1461521b6e.8.1721940332421; Thu, 25 Jul 2024 13:45:32 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db13520c1esm436442b6e.40.2024.07.25.13.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:32 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 15/38] dt-bindings: exynos: Update bindings doc for DW MMC controller Date: Thu, 25 Jul 2024 15:44:57 -0500 Message-Id: <20240725204520.18134-16-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Update the bindings doc for Exynos DW MMC block to follow the upstream example and reflect the latest changes made in corresponding Linux kernel bindings. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) doc/device-tree-bindings/exynos/dwmmc.txt | 46 +++++++++++++---------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/doc/device-tree-bindings/exynos/dwmmc.txt b/doc/device-tree-bindings/exynos/dwmmc.txt index 694d1959162c..d90792be8599 100644 --- a/doc/device-tree-bindings/exynos/dwmmc.txt +++ b/doc/device-tree-bindings/exynos/dwmmc.txt @@ -12,7 +12,9 @@ SOC specific and Board specific properties are channel specific. Required SoC Specific Properties: - compatible: should be - - samsung,exynos-dwmmc: for exynos platforms + - samsung,exynos4412-dw-mshc: for Exynos4 platforms + - samsung,exynos-dwmmc: for Exynos5 platforms + - samsung,exynos7-dw-mshc-smu: for Exynos7 platforms (with SMU block) - reg: physical base address of the controller and length of memory mapped region. @@ -23,32 +25,38 @@ Required Board Specific Properties: - #address-cells: should be 1. - #size-cells: should be 0. -- samsung,bus-width: The width of the bus used to interface the devices +- bus-width: The width of the bus used to interface the devices supported by DWC_mobile_storage (SD-MMC/EMMC/SDIO). . Typically the bus width is 4 or 8. -- samsung,timing: The timing values to be written into the - Drv/sample clock selection register of corresponding channel. - . It is comprised of 3 values corresponding to the 3 fileds - 'SelClk_sample', 'SelClk_drv' and 'DIVRATIO' of CLKSEL register. - . SelClk_sample: Select sample clock among 8 shifted clocks. - . SelClk_drv: Select drv clock among 8 shifted clocks. - . DIVRATIO: Clock Divide ratio select. - . The above 3 values are used by the clock phase shifter. +- samsung,dw-mshc-ciu-div: The divider value for the card interface unit (ciu) + clock (0..7). +- samsung,dw-mshc-sdr-timing: The timing values for single data rate (SDR) mode + operation. + . First value is CIU clock phase shift value for TX mode (0..7). + . Second value is CIU clock phase shift value for RX mode (0..7). +- samsung,dw-mshc-ddr-timing: The timing values for double data rate (DDR) mode + operation. If missing, values from samsung,dw-mshc-sdr-timing are used. + . First value is CIU clock phase shift value for TX mode (0..7). + . Second value is CIU clock phase shift value for RX mode (0..7). Example: mmc@12200000 { - samsung,bus-width = <8>; - samsung,timing = <1 3 3>; - samsung,removable = <1>; -} + bus-width = <8>; + non-removable; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <1 3>; + samsung,dw-mshc-ddr-timing = <0 2>; +}; + In the above example, . The bus width is 8 - . Timing is comprised of 3 values as explained below + . Divider value for CLKSEL register is 3. The CIU clock rate will be + calculated as SDCLKIN / (3 + 1). + . SDR and DDR timings are comprised of 2 values as explained below 1 - SelClk_sample 3 - SelClk_drv - 3 - DIVRATIO - . The 'removable' flag indicates whether the the particilar device + . The 'non-removable' flag indicates whether the particular device cannot be removed (always present) or it is a removable device. - 1 - Indicates that the device is removable. - 0 - Indicates that the device cannot be removed. + Flag is present - Indicates that the device cannot be removed. + Flag is not present - Indicates that the device is removable. From patchwork Thu Jul 25 20:44:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814393 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566939wrn; Thu, 25 Jul 2024 13:48:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXnreS+vRf2fa3du2Zb/rMGaoFTGftiPyWD2N5b+FDCheJxU7Y7bd7OylLb0NW6egCkgDimnrkmaDW5yzKXyoHb X-Google-Smtp-Source: AGHT+IE6ZetUr6nEyYDh1xfjzzqOObgjVCV9aMiWAwwvQH5cL2xMzM8rej9tvE1OyZ8H2OUDJKeL X-Received: by 2002:a05:6512:131d:b0:52e:f907:1023 with SMTP id 2adb3069b0e04-52fd3f821aamr2415283e87.49.1721940498558; Thu, 25 Jul 2024 13:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940498; cv=none; d=google.com; s=arc-20160816; b=Z0LHJx5DBctsYDkMsIOcbUs+sx4bv8zL55J1NdfcfwFzCzGfTSXhp5Lw1AA+pmpbs8 pLegXPUvEXwdfD/wv3ehT8NLODyHcLMzFgldPAaag4iwOuymCQAWk+Da2MEvIMsd9UsJ 0M2mG3Pog091bb6fdFC+3rdLiP9lWlhHVqxeXb50ATjmonEAJ4uNy+s4Fm12x+Bc/lgV jgtFZsi0DgNWQBbfosLUPrCLVZ+K0ov+Haby+q5+HW5jTnBbX8jJOXp9HTyBSZIUC3Hy cBgI4FQ+wOnsLj6IDVjGUQWvwuCsp3r6PyCPc0+AF0Q1RwTnlmisLba+1WjdDCTdYbO6 YbBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kYqZyVAHZrNM0H2n8OxL4kFCb9lPiM+vnuEfsBZOrHI=; fh=vRPaOe+DPjSDQrGIdLDU4+2Egs3G3l3zzXVkYsfMvBo=; b=kYFDQdY9XqhmHosJ8MkD7QAZg41oVd4+vSvChMMebiYobkdfVVN0CYZu0fWV/thx8m UJZfehgCbLMjThBblNQd9lkk2WGc+Kf8IbvaAbPrZvGgzSmaCVLaY4jDf0UO+FWUu7JI NZeHWNmUpIo1j0QufPLzeSGFwpXqICFuv1l3Y2Q4IiuEZbrkXxyj57/byqMNZ0Wgqip6 jFFTEMfoDl1w7unxZlegl+2MnkcSCsy1ZAwjswYckW/mR1FL0hDNpI+eSSF+83rQcygF 9agfug8A0wpa7y2hJUoKdr1SQoWAJzuLeGYCinHqVsrAqv1o3r0VjKsvwJllxE0rZBFS DhBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qvyb4ty1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5c04bf6si650289e87.456.2024.07.25.13.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:18 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qvyb4ty1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 534EC8869E; Thu, 25 Jul 2024 22:45:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qvyb4ty1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DC6E8851E; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 88CA188548 for ; Thu, 25 Jul 2024 22:45:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3db157cb959so187236b6e.0 for ; Thu, 25 Jul 2024 13:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940333; x=1722545133; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kYqZyVAHZrNM0H2n8OxL4kFCb9lPiM+vnuEfsBZOrHI=; b=qvyb4ty13rY7yZGqEeH4d2bSFUWLthM7b6TnzojuOBtczdYRtfxq5ZY3FnVEhXvZf0 VsD/EKhmEb47oa5NvZbSxsvN16qbIafjUmDlrcrHXgMeoTodmHecWXJwb/y+90m8phfM BY7lDjG0W5g8vXGgsbsBGWLVNBpQ624RX4QSbROok5qWWC+ha0iPFtdd/06ACRs9iIMn r9ECnzkCFun1d5BW0G99Nqd8Kxj36uiHmNRablhzCgTfXdyQr63pFaKbfc03vEslVDxE p15P89k9l4cCiC+RHRc6tLIWlKz4jd6P99mCmmAHAc+Gbtte8ovOHgaTy/ZcOm+aDVwA mQnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940333; x=1722545133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kYqZyVAHZrNM0H2n8OxL4kFCb9lPiM+vnuEfsBZOrHI=; b=uIXQNhQVoNU4pSh7mlV8A4EP5pC/FoDIE/e+RLaGOlakiWf+useY//hAQLZABTUvkI 4D3Kc+lMN3Ck3Unz1HC34FLpIYIcdv3j5jjkgmLJZta09SPPlhAIhTHGIgkQ22eaLMmw ZePi/HuAVPf3Fh5/YT2aibinVRWZg5fxUGIGhHk2WTlxlbb2IJrRo6zsHlrJ8Z2NvBj0 Qn97n2xVRdszzhsTMReIEu49N8RhCzL3khjlC0z99nI7qGsHvL6Iu7PbZb9uovVayT5O j9exdM+zt1ueKUWg3rVkq+lgL4lkq8ybqdZaBMf5UyDrUhPLBOHk07fIpSj3pT2ORKh+ MlIA== X-Forwarded-Encrypted: i=1; AJvYcCVVn10Xqkof8D6YQuJKK01nwiMCsUX+hmkbcNzn7EGtG/886rx1gPfazVOn/QI4XOa4DgjWoJiVxiFUnUzCyCkj5x3D8g== X-Gm-Message-State: AOJu0Ywz5vee3YbkpxyOderO7Y7ve96yqTbcFFzZB+3vkErTVcDN56/5 Dja4Fd7jtg5VJtVxwo6uITSp+lMP/At0Wep69+6aw7sBLc+fWfL01ZEK5RWc7dM= X-Received: by 2002:a05:6808:222a:b0:3d6:317b:a95c with SMTP id 5614622812f47-3db14157118mr3798997b6e.38.1721940333288; Thu, 25 Jul 2024 13:45:33 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db133fc6d4sm437317b6e.7.2024.07.25.13.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:33 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 16/38] arm: exynos: Add header guard for dwmmc.h Date: Thu, 25 Jul 2024 15:44:58 -0500 Message-Id: <20240725204520.18134-17-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add missing header guard to prevent possible build errors. Fixes: 77b55e8cfcee ("ARM: exynos: move SoC sources to mach-exynos") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) arch/arm/mach-exynos/include/mach/dwmmc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-exynos/include/mach/dwmmc.h b/arch/arm/mach-exynos/include/mach/dwmmc.h index 59c28ed54c58..811e9a04c6e3 100644 --- a/arch/arm/mach-exynos/include/mach/dwmmc.h +++ b/arch/arm/mach-exynos/include/mach/dwmmc.h @@ -4,6 +4,9 @@ * Jaehoon Chung */ +#ifndef __ASM_ARM_ARCH_DWMMC_H +#define __ASM_ARM_ARCH_DWMMC_H + #define DWMCI_CLKSEL 0x09C #define DWMCI_SET_SAMPLE_CLK(x) (x) #define DWMCI_SET_DRV_CLK(x) ((x) << 16) @@ -25,3 +28,5 @@ /* CLKSEL Register */ #define DWMCI_DIVRATIO_BIT 24 #define DWMCI_DIVRATIO_MASK 0x7 + +#endif /* __ASM_ARM_ARCH_DWMMC_H */ From patchwork Thu Jul 25 20:44:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814392 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566896wrn; Thu, 25 Jul 2024 13:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCej9shT61RZcu+SIfwN81bjm1MVL05t0jgF9sGBo4+37dLGxv9JrW0Smsz2f1ycoPrcN6rEyFj7h7Pmmebyu+ X-Google-Smtp-Source: AGHT+IEafTX/iyG4hAwr/0l4aRpTu3YMQdu6BkmnR+rm2YWL0KuOLpj6SyjvuKeKD/GgdjXM7N1f X-Received: by 2002:a2e:b8c1:0:b0:2ee:7c12:7b36 with SMTP id 38308e7fff4ca-2f03db7eb92mr28712611fa.19.1721940488840; Thu, 25 Jul 2024 13:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940488; cv=none; d=google.com; s=arc-20160816; b=WvMPao2a+P+JRGaJCQNAitpnV0AOC19scT/kddFor5Y3FcSq9Bk8RaI6TY9uU9Xt/J eSJWGoUqhoCFmM/JQBCYr+EKkGdUhzi9JoHwoAYl6RkqfSX4kO+sYn97IojlR/z/zZBE bQYYdPPJmI1qCge0DUUelib6HpZRNoVULjJOfsmE71Lkxrc8K/L8BD7Jwpk7/gq2J5ad d1PXf3HDSNFt9Wrahk5LcHVp4j0w3fb7eD4QqYnHXQFLEYI8umN4tYt2Ir4WmJUea2T8 Sh197zbxETUOaq1x1iPYtPGH2UmTTtH6DZRyLvtG1Y0LtbfCmcBARuYTEcURCJ+OxqyD 9aIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; fh=cPdG/mRRsGcV6XN2PUX41Xfl+BEGQS+AR4skRZZ7VTA=; b=zmKU/p29JGO4JGJBshJjTdasLLowT/Lo0xkNeB3dht60pD0Ncb0ACZa9Ee/uxzwEPf gMAkmhPk4VlbR8ZTXiml05+CrEAjL2nQU6tefbMDyhJ4zPT61edQcosav7ZIjqz7tsbu wZRAUBvFDkDMF+VyM+o1oC0/x+Tk5UHQD6S9ZTI1uzJuArqeOIylY3dNBco0AYvBxmGK s1WTs9dCFyM4OXiQcPdky0lk4vhTrwHezunvVmR38YE0StDepV7UavHZJ3OD7yRR+hm2 sRQlwmX8DnCOYUdi8D6r7+WNRn5D6nkImJtH2F06M35U77mnecm7aTqeu2Z1mL81xLhT 5V0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8KxWYhZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d08d324si6142231fa.9.2024.07.25.13.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8KxWYhZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F07CB8863C; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="L8KxWYhZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08DF88860C; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7633088403 for ; Thu, 25 Jul 2024 22:45:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-260e6298635so299979fac.1 for ; Thu, 25 Jul 2024 13:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940334; x=1722545134; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; b=L8KxWYhZIGiASGM0OblrQuoxvgeFIzBmXglOZ2i0u6COu+6nZ4ezSbO0nD35njunjf y4r4SLJAV/C9dIBB46yh5Chh2pvTMMpUjNouKmU2lGAPM+EGkgSYwLI9QE2bXZmiIBoq axmatO9FFpBqfs9X3n9oayubdmy53ko9OwnkrqwjX2LazHgnADMwBBCtNI5gJXR76fg1 DrJifbs9N1l4N8hzkrZU5ZwESjJtnKptDTkPdgvYi8pCI9T2aEv9L/+nq3K+afUxvl7m Gwi3dSWHl937YpIQ9d8dykI1PRP5FLoqW2kf2TNoxdgg6oubjbmbvrmLkt0JqdIcecFn hW5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940334; x=1722545134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; b=acwMQCOAO3c0JcXwVHuAxGqocQi2mOGR8v3Anz7n+nS9gc4bcXfBoHWgInxaX7t3f/ cJFRgobXKp/Kfhb1lE907vpU3D7v3oOSD1KIJ5MwTVLB/uA8ZADnJT/jhWaaBkpoPY2y bntiOyMmhLthgxR6B3qsdfEAWQvri5L6QnLffK832qPU1axHazlaxBNhm/o4ZWgxTeiR 0L6Lj/6ck6WciGZXfKYGaWmsBbQy1RiUoKQspIAym/XglaBo9ZKIee1llhjzdvLZkwxy iPm6iBWy970xoUcorVjmRM8N3a6tNoKh63TjvNOygF0Mpg9qkPh3rSRiCtq/+5edqNX2 YkVg== X-Forwarded-Encrypted: i=1; AJvYcCUrPYo9ksLsBNeEbnRvl9yTDdSh26Au6K09DbhzbHwy2yC2Fe62iOMG4+1xFpIVB+rrE10i7eSiRRk5RzaA+qe8tPPvSA== X-Gm-Message-State: AOJu0YwXsMNgfvpgRJvExtJ5PIkTxv7JQHKEGWM15LrpGxztjVh4ciAt UScZ6vIkHmDscbMF/IFgra/csVufWNiHiE+3UnIC0/5qji4fHRambS9ApJhRjSs= X-Received: by 2002:a05:6870:3a27:b0:261:184f:4ef1 with SMTP id 586e51a60fabf-2648e8ebaafmr2413298fac.15.1721940334044; Thu, 25 Jul 2024 13:45:34 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093070671fsm458194a34.21.2024.07.25.13.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:33 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 17/38] mmc: exynos_dw_mmc: Fix obtaining the base address of controller Date: Thu, 25 Jul 2024 15:44:59 -0500 Message-Id: <20240725204520.18134-18-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Getting the base address with outdated fdtdec_get_addr() API and further casting it to (void *) leads to next build warning on ARM64 platforms: In function 'exynos_dwmci_get_config': warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] host->ioaddr = (void *)base; Use livetree API instead (dev_read_addr_ptr()), which handles this correctly. Fixes: a082a2dde061 ("EXYNOS5: DWMMC: Added FDT support for DWMMC") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 377c9e6d90b9..a86d58663c1b 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, struct dwmci_exynos_priv_data *priv) { int err = 0; - u32 base, timing[3]; + u32 timing[3]; /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); @@ -173,12 +173,11 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4); /* Set the base address from the device node */ - base = fdtdec_get_addr(blob, node, "reg"); - if (!base) { + host->ioaddr = dev_read_addr_ptr(dev); + if (!host->ioaddr) { printf("DWMMC%d: Can't get base address\n", host->dev_index); return -EINVAL; } - host->ioaddr = (void *)base; /* Extract the timing info from the node */ err = fdtdec_get_int_array(blob, node, "samsung,timing", timing, 3); From patchwork Thu Jul 25 20:45:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814395 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567038wrn; Thu, 25 Jul 2024 13:48:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYna/G+7ziYV4rKmLIpyZbef3bIQThZl6vvCNelK79B/u0burVYuNDS3+QW6WLDMA2rGD+F++tykGS7B2D14zV X-Google-Smtp-Source: AGHT+IE6XQjRBOYXJfkGSrVg285ECPhYNhqL+Ovw2ENvAbBVvL8Eek1ZHGrd8Bpsi2hmIlxZPwTO X-Received: by 2002:a05:651c:541:b0:2ef:a504:65b8 with SMTP id 38308e7fff4ca-2f039cb7d36mr34084651fa.13.1721940518206; Thu, 25 Jul 2024 13:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940518; cv=none; d=google.com; s=arc-20160816; b=s7ZCrA58JZuYcv9HMsIGzhRGNWL7cHcIp9VkedjYxsLkbHgwbAsb9pBHcQrPHaBg2f t4DV3zdzuavHp5SCi7rrQv3jlUjbtVPYVsH3jcDHxcXg1Ajey+2z0bMhy2p8WrPguxsf bHFcEgD3dPGsN2+iH6MSPC7c0MMLQRKef5wwqq3jtf9u7uUit6feiB7scjxPXRcfcMCu YejD3Q7H/s8SkKcDnR8lm7BosKLyZg/5oJNmLvcyN7cDoWClJSRdDFodNE78GLEnAu2r nTxAgzOX/ITd5rMrCnS+p+SMBJq0AliBnVsks45YrKKjE86j7emOKeOp88hBLX0GyQh9 6+dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UKZxndUm2Msgg2mExU+W8UaV4CoWdCztEVfBzyKLJLg=; fh=W7sjkx7URgFqavx9S9P+TNW0/5i8VmrK1b0nrENkxNY=; b=IlpxU9STuTzpLiEphB6E0q5mZwX5fID/BJYgv9ab9gKa0/w0+oaAGN2F3W2upoFSso tjAY8IjWWm13jvv644QaIa2iUdIa+eb/4pUwYmx9cnIHaIJuIGv7/c8x6KSfdNF4PySh S7at6e2BsISIiUupRMwR9arK1/2lVBbBtHD4jLNJpePT+aiiaTs5v+8moS0uYzbhIA1V Ymm+33NEPh+NFIS8H4GHyYwWxRIYZ6imrYL6wUBZvEcN5529EGAYVu60csaR0oymP+hD tauGBOzcufVekOFnZdGol0JIRMOhEwkT+RmrP0v2rwGRgcpd8hRbwJVrPf6MmirhPD/e dPcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z4l6rPUG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d169bf3si6031441fa.468.2024.07.25.13.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z4l6rPUG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10C64886DD; Thu, 25 Jul 2024 22:45:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z4l6rPUG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A11C488636; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 50628884CC for ; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-704494efa7cso175192a34.3 for ; Thu, 25 Jul 2024 13:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940334; x=1722545134; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UKZxndUm2Msgg2mExU+W8UaV4CoWdCztEVfBzyKLJLg=; b=Z4l6rPUGSpw7T6VbXNuFIpWKpQq+8gqymKCZGtoN2tFBLHVcJj2+mjmkHEcQNvGALA +deWUbhlgjB75sxGsYjbtkI/2NWcltCZvpttnagDmIjBFS8C2bXFrbxqczJhc/8Wo0GW 6tLRYJlYuwlrJt/xTKpbJ1m0OMZ6UzkIgkDnqYPzVHsk2x1AHQKXPs1QouMsfMAL9EL3 k86OPidBNYBoPFC6vz3popO4zQW+1Z4b4fLz7JD0hBtgxo644+at/W9D/HwX2capKqxU MSEtPhFUzramYvxAKRoTPd97tco8pBlxuPCcJuySK6FFwkRh7dRhuuTBCbmf14U9JHgy FI3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940334; x=1722545134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UKZxndUm2Msgg2mExU+W8UaV4CoWdCztEVfBzyKLJLg=; b=uQAyQ7f7e2Pvso6o5NzGHlehQ0untJkFqI5et3Exx76/ueFPxBPcwqyoRe2q6PvHyD OtlYRgkuq/+XpH/DNENAj58vA/YqCdsjMywvcrxk106iFhw+jmaZ8d/SHXtlny+8hiVU jHOLfLXZ5HURAr4FeVaWDv3M29QM6/ciOPRNMiMi4Jerjs7xDsXWrXndRh22qXhfWSdr OO9AyBUfyZ1jdpnkX99JiEzWxj4gLlgTv5ekOcAexYOM2yhOX8uYYHdJuUHVq+g3ggVe RFQyBWxyAXrJMIxHTez5CLQzXgB345bk3KEoTScYUjCn8a5nW/I/jip5W0PAyN70HmgX FSew== X-Forwarded-Encrypted: i=1; AJvYcCUgLO1pw1Xrw9pBN6I6E1WztrIWmlcBSngJnXBq28YfyCO5QYG4t8PL8kXr3nlBRxAn9AV51zsp+sA/Xwr9wySKsjB0EA== X-Gm-Message-State: AOJu0Yz5nFNmVPJno9N1mfk2r2CxUMSumuqU6/xL9ZLpN1CFHMRHM+8s FJpIUn+7NqG+sVrwZwcQkS70IH9MpnYRDwi4unq140L8cu7kqpeL8hmtPiXOYQM= X-Received: by 2002:a05:6830:63ca:b0:703:63d3:9ef7 with SMTP id 46e09a7af769-7093223cc11mr4167637a34.14.1721940334705; Thu, 25 Jul 2024 13:45:34 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930720f62sm453467a34.37.2024.07.25.13.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:34 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 18/38] mmc: exynos_dw_mmc: Fix getting private data in exynos_dwmci_board_init() Date: Thu, 25 Jul 2024 15:45:00 -0500 Message-Id: <20240725204520.18134-19-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean In case of CONFIG_DM_MMC, host->priv actually holds (struct udevice *), and not (struct dwmci_exynos_priv_data *). This makes *priv pointer invalid and may lead to Synchronous Abort during its dereference later in exynos_dwmci_board_init(). Fix it by extracting exynos_dwmmc_get_priv() helper from exynos_dwmci_clksel() and using it for getting the private data in exynos_dwmci_board_init() Fixes: 3537ee879e04 ("mmc: exynos_dw_mmc: support the Driver mode for Exynos") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index a86d58663c1b..aa542c13fea8 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -41,18 +41,24 @@ struct dwmci_exynos_priv_data { u32 sdr_timing; }; +static struct dwmci_exynos_priv_data *exynos_dwmmc_get_priv( + struct dwmci_host *host) +{ +#ifdef CONFIG_DM_MMC + return container_of(host, struct dwmci_exynos_priv_data, host); +#else + return host->priv; +#endif +} + /* * Function used as callback function to initialise the * CLKSEL register for every mmc channel. */ static int exynos_dwmci_clksel(struct dwmci_host *host) { -#ifdef CONFIG_DM_MMC - struct dwmci_exynos_priv_data *priv = - container_of(host, struct dwmci_exynos_priv_data, host); -#else - struct dwmci_exynos_priv_data *priv = host->priv; -#endif + struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); + dwmci_writel(host, DWMCI_CLKSEL, priv->sdr_timing); return 0; @@ -82,7 +88,7 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) static void exynos_dwmci_board_init(struct dwmci_host *host) { - struct dwmci_exynos_priv_data *priv = host->priv; + struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) { dwmci_writel(host, EMMCP_MPSBEGIN0, 0); From patchwork Thu Jul 25 20:45:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814396 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567077wrn; Thu, 25 Jul 2024 13:48:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVAAepOcOol6Bbr9ht+Srd7CLRvoVlliL+ezuiksmZNOT+I9As2ZXpVcbojCQpzjSZf5lGr4nHDvHKSVbSfvvnG X-Google-Smtp-Source: AGHT+IEkImar5qvtIKkQXSnE7bbVnf6A13DXNmnvELotlxlGdHNx2ZZxAqOPJKtMveo2oX4SpW1A X-Received: by 2002:a2e:99c7:0:b0:2ef:205d:4847 with SMTP id 38308e7fff4ca-2f03dbf2cd8mr22005551fa.46.1721940528268; Thu, 25 Jul 2024 13:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940528; cv=none; d=google.com; s=arc-20160816; b=JFLfeGUZT7wyYgJda/E6YPNMLYZyuPo1rYcyigRS+7AW9M6I46LWmL7vECxWrXfgb1 JeZZIarGOKZUDRyk6h+DGkEib2HK6SyixCnUNe/1ZHkQaIjvQrpvQmGzd4o9It8fwUGV QFVEoXZpTMtjLEQXhLJE3dZhgn0ORUPPhNTOAv19dtaNQORDU7iH6+SSMzuXneOI4BHl DuLG8AlpabkAZxC+c2gkkSs31QcdOig0m3XKzW4EWgRbDMtVI9pvVnsW3nkIvr3W1Z2x LuVbTRJzrN++AdiJQRAU348TUIFfpIZ+eCFwrOC6la5wWC93/Vo8sWMAToVuK3aiF9r1 3tkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZV+9/tuIYxOCUWV8xGDM20QwAQGvcpEliEOoPAYw3+k=; fh=pHSBvYO3kheOVOwnelT1WsOX9Cfrr2Ymt6ubUUDTrWY=; b=zNYJAIf2qPNczHaQww5OVtOzx5i/GMmGbJki5jnde+BJIxPtSnbWGTdLKyh58/2T4+ 5mRf4gKd8rFgUJ2xYuG5ChJLon/sHrAqaPwNEZblwdR9luvtByQbteARkgGpsolPboym o/nu+OwVlVFAJsJgXYdp8JJmAKOhTr4L/378GgE7QNIyJFdhucr8ycKHE/VwJPRTO9c6 tTs6ZwGCvDNDbSr66TTcdbiP7tcYUbEntyTNL3qDHV2RwIwW5UP/GgRcximKu/9LcrPL GLz2gAlUX5kpuyFQmPnRDiWkXykb572Yo1FTaCNsrJBMBACRy55R6Wpv8yixFMYL+F2F Q0NQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HEVZXp4f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d151f3bsi5974151fa.385.2024.07.25.13.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:48 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HEVZXp4f; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6829E88701; Thu, 25 Jul 2024 22:45:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HEVZXp4f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0B65884A7; Thu, 25 Jul 2024 22:45:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 97C488859B for ; Thu, 25 Jul 2024 22:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-7044bda722fso184479a34.2 for ; Thu, 25 Jul 2024 13:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940335; x=1722545135; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZV+9/tuIYxOCUWV8xGDM20QwAQGvcpEliEOoPAYw3+k=; b=HEVZXp4fWtYLn1Gtv5T/SHJl8wKxrh9UkgsT8Kp+K2+cupXxV5iSezq+CmLls3n+iv aMnyH8RnX0EgeS8tXxCRynCGEZvcvCA73gaG6XI3Zs19GiWeM9UqLTss9XzfCO0YR5iq 9mAGMep0lCc7934Qc2hls8Yxm462Mi1JKBEvlyC++Xy5JCOMkNbqwEXSQXP5ruptE5px cwz/o5AT59N3lUODuk+wnPV14HglUVd1twxujTwpPU6ESf+/uECHJvrTvCBr8BS2l2jq vzR4wgwqvKvUqizmsEd9eOBfpCsNY2hoABhkWehsn07L5UnXPH0pV1dfu22xoGjkuyQi vlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940335; x=1722545135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZV+9/tuIYxOCUWV8xGDM20QwAQGvcpEliEOoPAYw3+k=; b=WE6szn7ky7oHo4Mt/R4S/80SsxldHZg/kYNm1i8Wz0yXikN67tveMrjkmg95ML0YMW l651W0t3KaMVRdfX0T1jGfrNGYoBuhlKAM2FZCAhSZOloPGANIT0evNfkFmfhhJ8oHBm HXpvq2CFWJL2UsXdUAP34/XhReUDkyfDyjMDfHHlYvh7RxsiEcXmifPc/EK8YaKMSlfp ehrMmVglG/hU2Ytp4R/CclEXXUEVlW9e/MXQAyNbTLAT7ENsPyzpMKLEMiaOYvdDjz3g j5ClsF33OT81ay5R07oAgwtKHUdaQgAnGttmdBD1t3HhWZL5mfn8LAj0GSpJ+V2pH+Xq V+xA== X-Forwarded-Encrypted: i=1; AJvYcCWQPZOK2l/ua3i+qdisgDF4W8doH2vtiz+onq3KOonf9t8hjgJF5nKnq4zopOqAFqSX8GjXxF2v73yohzDM896Ao76QUw== X-Gm-Message-State: AOJu0YwclZVeGjTzABbQoozu/Fd3l15iFlK6UyLoHuyD0ReQp7+YzOYX JkWlw2/ErGOQNx5IXCBAYDbaDB+jH+tqO9ZCk6bb0WUK/pKACiWpaNnptTfqXuA= X-Received: by 2002:a05:6830:6286:b0:704:4d36:f450 with SMTP id 46e09a7af769-7092e6bcef8mr5031737a34.9.1721940335376; Thu, 25 Jul 2024 13:45:35 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a657sm459573a34.13.2024.07.25.13.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:35 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 19/38] mmc: exynos_dw_mmc: Don't call pinmux functions on ARM64 chips Date: Thu, 25 Jul 2024 15:45:01 -0500 Message-Id: <20240725204520.18134-20-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Pinmux configuration on ARM64 platforms must be performed during startup in pinctrl driver using info from device tree. exynos_pinmux_config() and pinmux_decode_periph_id() are only available on ARM32 platforms, so don't call those functions on ARM64 platforms. Instead of the latter function, use "non-removable" property from device tree to derive the dev_index value. This fixes next linking errors on ARM64 platforms: ld: drivers/mmc/exynos_dw_mmc.o: in function `exynos_dwmci_get_config': undefined reference to `pinmux_decode_periph_id' ld: drivers/mmc/exynos_dw_mmc.o: in function `do_dwmci_init': undefined reference to `exynos_pinmux_config' Fixes: a082a2dde061 ("EXYNOS5: DWMMC: Added FDT support for DWMMC") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index aa542c13fea8..ed2752391603 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -144,6 +144,7 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) static int do_dwmci_init(struct dwmci_host *host) { +#ifdef CONFIG_CPU_V7A int flag, err; flag = host->buswidth == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; @@ -152,6 +153,7 @@ static int do_dwmci_init(struct dwmci_host *host) printf("DWMMC%d not configure\n", host->dev_index); return err; } +#endif return exynos_dwmci_core_init(host); } @@ -163,6 +165,7 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, int err = 0; u32 timing[3]; +#ifdef CONFIG_CPU_V7A /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); @@ -174,6 +177,12 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, printf("DWMMC%d: Can't get the dev index\n", host->dev_index); return -EINVAL; } +#else + if (dev_read_bool(dev, "non-removable")) + host->dev_index = 0; /* eMMC */ + else + host->dev_index = 2; /* SD card */ +#endif /* Get the bus width from the device node (Default is 4bit buswidth) */ host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4); From patchwork Thu Jul 25 20:45:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814398 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567175wrn; Thu, 25 Jul 2024 13:49:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWxaY73bW3RmYp+P9mZPXURSDTfzRZ5rVEi1QMWoGHYlU0I0mTpI70btUFxMdqpKlsyagFVUUtMSza++jfA5njk X-Google-Smtp-Source: AGHT+IHnlu9aYd4sl9ultMd6Jr0e0YNkR8RXt2qhyHtoF+MMZcpon6Tk/UKyCAjLnwSgKEFJoJ2r X-Received: by 2002:a2e:9382:0:b0:2ee:88d8:e807 with SMTP id 38308e7fff4ca-2f03db7e0d0mr20515971fa.16.1721940550451; Thu, 25 Jul 2024 13:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940550; cv=none; d=google.com; s=arc-20160816; b=o8vgEqnlPP1+c4Kh7m48D2NexOcZiotiEIwrLcQJBvNhgSIqhvevCwTLkl+FdzRq/h z16v9OStY/+nnMeHf86uDsMTrjsdYQDxq19L/b0YbzRP/V5IiABHu+YwcpJMFyXRqnSB yTvnoOBNUQUxEMPgtXJDvwlXA2rBQk5ZL8ZbY+a+7+b54SBxnb6Q5Po3HO9rKTgj9ZLz XhkeFQyETYRJ2DGqkkBMND7EA89RFnmsIhhDIFh47XzDcAbU3pHXFYQkv6LEcdrirKV/ agIm1wh8vjOfTJ2gYsjXCw0JCpas5pDltAP+jdcGCsFETSF6RR2ph8BgdPok5JDpkOzT qh8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SDSW/FQ0raQJfa8ItZTqmxPmyzRYX/IJa/0gNS33P20=; fh=tc1uCTLO6ybx4bfyl8cYnfORLl545EtLy7MIbirwSSc=; b=TjqjosVkcrPmc39Fl4k3olQlhQo8hKle+nM/KvlJ5HC79VMOOAFKk0A5JogVUeGMzw fZHnDUCKh3TWirr9E8jQptsJCxOAoOpKbya6asH6f6v5bzeucOJ4fIZcK3KUVZTq8gDp cfuv4pMBYvDQCxHcAJaepyerVYJrk016d//cvfPRhhpHpBAgSK/DEbbQt7ARDeYokF7r 0QBsIhTL9BwxY9b+/0jEKt1fvqn0m0hv2En0Jg4mp0QnP6i5xKYjSiRvhyZpeAD1ziz2 PzMz5bQYcToRsQAUddYMxpopGaCqMRHB3RmvuGo0Yfsjg22lJ+1U7aLrK3W2OHobYXy1 Q+AA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lhzV/thR"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d187f5bsi6047291fa.584.2024.07.25.13.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:10 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lhzV/thR"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DA0988732; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="lhzV/thR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58E7F882EF; Thu, 25 Jul 2024 22:45:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B379885C5 for ; Thu, 25 Jul 2024 22:45:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5d5c2ac3410so72574eaf.2 for ; Thu, 25 Jul 2024 13:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940336; x=1722545136; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SDSW/FQ0raQJfa8ItZTqmxPmyzRYX/IJa/0gNS33P20=; b=lhzV/thRiNik8TzS7YfKKzr+soLxq0+Jj7HJMyUR7MYyJxPnME+BHFXMGrVvgT8AJY ATHpI5bU3IfmmM0c4oGVcSOn2YjBQV9rzVEcqFDnbwDNCTZkdSqM0PH/kMbO+vQQEMQD Q84CX7R3O4pr/gGlq/35g7wjPp1dFWjXe4RXwP9DqTCBp3rNIRLAd7yGapE1v78VuDEE /fJo09n4IXgJl6Hbx4VfyUPlVXeK44Jgf+by+JvRI7+odG+3KMcQhKJ3YaWO6Svis2mg sr5VdiYz3rHlEUFVoC7RQ7ZnEte+xzkIuiWm59YITHZObcNW8r+Xp9bQ27x27qm/fCER Z1xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940336; x=1722545136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SDSW/FQ0raQJfa8ItZTqmxPmyzRYX/IJa/0gNS33P20=; b=V3Of63rrhLUs1MdIhpC3uH31ysGvbuPPxadt9+pjKEIj5NQaFXG2Li8B1CSZLoJtfd uxfxpcYtHbsLa7V4TLrqzYS1Do3yRWAQSZTArxkrgbGT7hc56PLfDkg1pKEh+MNsLacU CYmB0erdx4/XbzwLWSZOKWy7Ky/AU0ntKUeqWh9T8RUFkf4Ni0Ak2HfWR/UWsgdHIZ7H YYmuR6zBs6HmfEQuLBUEwqnVQzF7p2HDhd7SOHB2KP4YwsmiX7FDPREmQdHAKX1Jj9fj VePifniPlYuU2pUz2YdWtdymM8+dLIfsfngfsaqwrpM6b8R3oLNICgv2XYLLbfiqCJFs 7Khw== X-Forwarded-Encrypted: i=1; AJvYcCWkPF0ezu9pHw5o52zSRk78NcoRmqnXWefYEvK5tslvz2xpsTRDyH9VoLLo4s4wRmQV83PehUR9jIVdI+o/vmVOfRIH/g== X-Gm-Message-State: AOJu0YypAqpPJZoziOnP0+DM6VZqkdQChhtn1QuW8o+8vzupR6QMerpz +/5oPbOqKrKK9UmVZr4rR3d/UOiCX5VO2S8npX07jFqedukbKwD6AD788zZl6N8= X-Received: by 2002:a4a:ee17:0:b0:5d5:b226:2ffa with SMTP id 006d021491bc7-5d5b42f7cf8mr4252972eaf.7.1721940336205; Thu, 25 Jul 2024 13:45:36 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b346d58csm266472eaf.6.2024.07.25.13.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:35 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 20/38] mmc: exynos_dw_mmc: Obtain and use CIU clock via CCF API Date: Thu, 25 Jul 2024 15:45:02 -0500 Message-Id: <20240725204520.18134-21-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean New Exynos chips should implement clock drivers using CCF framework. In that case corresponding CCF functions can be used to get/set the clock rates. Moreover, already existing get_mmc_clk() and set_mmc_clk() calls are only implemented for CONFIG_CPU_V7A (i.e. ARM32 chips). In case of ARM64 chips that config option is not defined, so build will crash on linking stage, with errors like these: ld: drivers/mmc/exynos_dw_mmc.o: in function `exynos_dwmci_get_sclk': undefined reference to `get_mmc_clk' ld: drivers/mmc/exynos_dw_mmc.o: in function `exynos_dwmci_set_sclk': undefined reference to `set_mmc_clk' Fix that issue by using CCF clocks API on ARM64 platforms for getting and setting the source clock (sclk = SDCLKIN = CIU) rate. To implement this, first extract the existing ARM32 clock control code into helper functions with more generic signatures to abstract getting/setting the sclk rate. Then add CCF clock support to those functions for ARM64 platforms. Fixes: a082a2dde061 ("EXYNOS5: DWMMC: Added FDT support for DWMMC") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 87 +++++++++++++++++++++++++++++++++---- 1 file changed, 79 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index ed2752391603..4d28ede0d756 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -4,6 +4,7 @@ * Jaehoon Chung */ +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include #define DWMMC_MAX_CH_NUM 4 @@ -38,6 +40,7 @@ struct dwmci_exynos_priv_data { #ifdef CONFIG_DM_MMC struct dwmci_host host; #endif + struct clk clk; u32 sdr_timing; }; @@ -51,6 +54,61 @@ static struct dwmci_exynos_priv_data *exynos_dwmmc_get_priv( #endif } +/** + * exynos_dwmmc_get_sclk - Get source clock (SDCLKIN) rate + * @host: MMC controller object + * @rate: Will contain clock rate, Hz + * + * Return: 0 on success or negative value on error + */ +static int exynos_dwmmc_get_sclk(struct dwmci_host *host, unsigned long *rate) +{ +#ifdef CONFIG_CPU_V7A + *rate = get_mmc_clk(host->dev_index); +#else + struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); + + *rate = clk_get_rate(&priv->clk); +#endif + + if (IS_ERR_VALUE(*rate)) + return *rate; + + return 0; +} + +/** + * exynos_dwmmc_set_sclk - Set source clock (SDCLKIN) rate + * @host: MMC controller object + * @rate: Desired clock rate, Hz + * + * Return: 0 on success or negative value on error + */ +static int exynos_dwmmc_set_sclk(struct dwmci_host *host, unsigned long rate) +{ + int err; + +#ifdef CONFIG_CPU_V7A + unsigned long sclk; + unsigned int div; + + err = exynos_dwmmc_get_sclk(host, &sclk); + if (err) + return err; + + div = DIV_ROUND_UP(sclk, rate); + set_mmc_clk(host->dev_index, div); +#else + struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); + + err = clk_set_rate(&priv->clk, rate); + if (err < 0) + return err; +#endif + + return 0; +} + /* * Function used as callback function to initialise the * CLKSEL register for every mmc channel. @@ -68,6 +126,7 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) { unsigned long sclk; int8_t clk_div; + int err; /* * Since SDCLKIN is divided inside controller by the DIVRATIO @@ -77,7 +136,13 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) */ clk_div = ((dwmci_readl(host, DWMCI_CLKSEL) >> DWMCI_DIVRATIO_BIT) & DWMCI_DIVRATIO_MASK) + 1; - sclk = get_mmc_clk(host->dev_index); + + err = exynos_dwmmc_get_sclk(host, &sclk); + if (err) { + printf("DWMMC%d: failed to get clock rate (%d)\n", + host->dev_index, err); + return 0; + } /* * Assume to know divider value. @@ -107,19 +172,19 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) static int exynos_dwmci_core_init(struct dwmci_host *host) { - unsigned int div; - unsigned long freq, sclk; + unsigned long freq; + int err; if (host->bus_hz) freq = host->bus_hz; else freq = DWMMC_MAX_FREQ; - /* request mmc clock vlaue of 52MHz. */ - sclk = get_mmc_clk(host->dev_index); - div = DIV_ROUND_UP(sclk, freq); - /* set the clock divisor for mmc */ - set_mmc_clk(host->dev_index, div); + err = exynos_dwmmc_set_sclk(host, freq); + if (err) { + printf("DWMMC%d: failed to set clock rate on probe (%d); " + "continue anyway\n", host->dev_index, err); + } host->name = "EXYNOS DWMMC"; #ifdef CONFIG_EXYNOS5420 @@ -230,6 +295,12 @@ static int exynos_dwmmc_probe(struct udevice *dev) struct dwmci_host *host = &priv->host; int err; +#ifndef CONFIG_CPU_V7A + err = clk_get_by_index(dev, 1, &priv->clk); /* ciu */ + if (err) + return err; +#endif + err = exynos_dwmci_get_config(dev, gd->fdt_blob, dev_of_offset(dev), host, priv); if (err) From patchwork Thu Jul 25 20:45:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814397 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567120wrn; Thu, 25 Jul 2024 13:48:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU0O0RhrK86ooWe0B2QN0yLDQwvyclu8AYPZ0yRBQUzfk6BRQJpP4WCb7Y2uqKr1E6na7ZGYvfXBQUl3ffGrzFD X-Google-Smtp-Source: AGHT+IH4mnyK891vl1zuApuARb+K55V5yITPgq4sklkHCo35HhhpCXEGbgIfcNDzsk3iiLLcTflx X-Received: by 2002:ac2:4f0f:0:b0:52f:154:661b with SMTP id 2adb3069b0e04-52fd6087755mr2708707e87.11.1721940539460; Thu, 25 Jul 2024 13:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940539; cv=none; d=google.com; s=arc-20160816; b=Mgmnz+exnpbnjJuFyOC8zFq4quZDw3Vqb9UWk3F3xPtPmGwGRH/jWCC7R8Mshl2ZbG MkBZshNpGDiLYieBGHjkajgGCCIDMERfCdRTTk0VGBkN/LlezeTbr1UeHHzNhyZA6hZy imQRP1hhVif1yGJA/0XMVhV38hQq3dOKIrew4x4pojUcL8Hkjb3fk4PsUUEz4w3IuFZu 8Nl6HsydP/JotHKCGGDPQAbqpR9FoJLePPFg79mQxcALCDI44TRE4KwACwmzNjaOS9zy YV5Uk8ZW7gZAkJGD+X6PYT3MDZ/2e2RZGymjXVOSzsF/6bAS8odAU8bqRJ2ms+UJV5bb c8rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tDZzEFSNRWDHk7xL6UtbRz9f/m5h3OBvk0iGJDKDqCA=; fh=OTySlVJDlw8wUxLaVKD1AktpNzgvWiOA+77NIBDm/CU=; b=PGH7DUBwAofHGxkw8ujOTDWbDd9z3P1K/Ru8sjeHcI4vf0FiB2K3pMry42hXXte/oE RwieWjuBQfRReklqE1ZNvvDcRxZP/QRsBdxHwcFSI0kzttzPPjR4giRYQYIGOJDk2WxR MC8DAG9DAYbySp+J3Xu/b/ziOtqNNA4eRqGpfcxBU+tMFFeTCbR4ML+nYaL6B/t2dIqB fJrwDtXq7nc9QJP/YPo/W4+n5EIkSQOPT0OqSRrLN+s7dF1bzFR7zXMqotXXVPI/kAhL AQqaCc5WWj5mesc+1wRjh+T+gMU0Mnzy6MJwtTEsdh93QQZxkfM4cdxUkKe3Q9Iaci/Z ToRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ibGIwNJ0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfbd68si671384e87.422.2024.07.25.13.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ibGIwNJ0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C54368871C; Thu, 25 Jul 2024 22:45:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ibGIwNJ0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8784E88403; Thu, 25 Jul 2024 22:45:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1DED188599 for ; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3db130a872fso195076b6e.2 for ; Thu, 25 Jul 2024 13:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940337; x=1722545137; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tDZzEFSNRWDHk7xL6UtbRz9f/m5h3OBvk0iGJDKDqCA=; b=ibGIwNJ0szbBS7VC3u0nnoj7voA/NPvsV5Sf167E4DLLSM8/qL3996QZcGETzgnr07 BxEG0jIRUOgJCm21D53+6PRTR645f1KEoLmkTfh25gHpfKw3CYmPPDk6KuC04EKE2z3u 3s3MnztZe1AD9qkz0xWM5aujRPkMjFm+mIjX3bPniVKwmdJu+QIgAkdshSV7OJ1evSpl B4qQVQ8q/MJ8WFgi9tFg4L1RllMKHTbiriQWCGKMJz5PiHL3iVg/jZn9JB1G1rdu9fLX 2G8kF9QbORxYV08o6dHKCt7uXeBbXIA7LW2uRaW+/sPCbtphdT34DezH5DW9iWNrXQMu xfSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940337; x=1722545137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tDZzEFSNRWDHk7xL6UtbRz9f/m5h3OBvk0iGJDKDqCA=; b=gukJKVVrEBjL2l/M0z5k5DIUaNKIdvQvAsCXc6/aZ6jQ7TKXrCgRsIv/oBLzH/kKH6 RIOtWdAvQa+k6n4zAJF5RAwIOj4b5ydjvwwLi0YsUHgADpObdHepZ3zTUCWflsJHuegO 0Bf4xTLpnFj6pjhpumAismgLinQuvlQ6PgV8szoERIYon2K8b8G/nz7lVNFJ5fKjn10m oSnXwlX65RojXukSwClfQgylvwQYa4GgOrOAUy/Rkwh44fgNOTtmeG0wOPeG0yeVMJu9 26VBZfVLT+P/+l1jHrTbWvdOMFEVxfkq2nxiDh1HuwgF4fG2V56Fd3MWO7tJ2gfRAaWj hq+g== X-Forwarded-Encrypted: i=1; AJvYcCXJgEJtBRhCfZ/IG1xH7mYQqORCKKH/eFUY31R/PnKXgnPFP4tkhf1NYptIbAKfu7ds/oUX4xJ/MbPZB3vpCOF/7GeYjA== X-Gm-Message-State: AOJu0YzRMNPY0SLrocZX6/c4oYV2Ta/G/YStch+8MioP6NVu9DI4rIQy DbsUox1HPL/YYUTSS4mjBJTUtxFVbTK+r0WpVYAVeSx7Do3wkxQQHJp+gnuAx5w= X-Received: by 2002:a05:6808:171c:b0:3da:a793:f116 with SMTP id 5614622812f47-3db140ecf9fmr3574750b6e.26.1721940336851; Thu, 25 Jul 2024 13:45:36 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1341dde2sm430303b6e.17.2024.07.25.13.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:36 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 21/38] mmc: exynos_dw_mmc: Use .of_to_plat for device tree parsing Date: Thu, 25 Jul 2024 15:45:03 -0500 Message-Id: <20240725204520.18134-22-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean exynos_dwmci_get_config() is called from the probe function and used to read data from device tree. Make use of .of_to_plat driver callback instead, and convert exynos_dwmci_get_config() to match its signature. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 4d28ede0d756..09a59fdf0120 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -223,10 +223,13 @@ static int do_dwmci_init(struct dwmci_host *host) return exynos_dwmci_core_init(host); } -static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, - int node, struct dwmci_host *host, - struct dwmci_exynos_priv_data *priv) +#ifdef CONFIG_DM_MMC +static int exynos_dwmmc_of_to_plat(struct udevice *dev) { + const void *blob = gd->fdt_blob; + struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); + struct dwmci_host *host = &priv->host; + int node = dev_of_offset(dev); int err = 0; u32 timing[3]; @@ -286,7 +289,6 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, return 0; } -#ifdef CONFIG_DM_MMC static int exynos_dwmmc_probe(struct udevice *dev) { struct exynos_mmc_plat *plat = dev_get_plat(dev); @@ -301,10 +303,6 @@ static int exynos_dwmmc_probe(struct udevice *dev) return err; #endif - err = exynos_dwmci_get_config(dev, gd->fdt_blob, dev_of_offset(dev), - host, priv); - if (err) - return err; err = do_dwmci_init(host); if (err) return err; @@ -335,6 +333,7 @@ U_BOOT_DRIVER(exynos_dwmmc_drv) = { .name = "exynos_dwmmc", .id = UCLASS_MMC, .of_match = exynos_dwmmc_ids, + .of_to_plat = exynos_dwmmc_of_to_plat, .bind = exynos_dwmmc_bind, .ops = &dm_dwmci_ops, .probe = exynos_dwmmc_probe, From patchwork Thu Jul 25 20:45:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814399 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567210wrn; Thu, 25 Jul 2024 13:49:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX170bCYe6LGdNWFG7hJXEnYowOiJbYkGhr/7ujE2M2wJ0isLCF+fDv9mt0Wj1EAjsNBc49r5neowed8X+dIyyw X-Google-Smtp-Source: AGHT+IGIVXxkzEmC/fwPaEuZiI01BR8Evy5fs2sh4RdTYwuQ7Eg1rjSyFG+y3La3c4JOqXqrUALw X-Received: by 2002:a2e:8ed4:0:b0:2ef:22ed:3818 with SMTP id 38308e7fff4ca-2f03dbe1887mr22052951fa.32.1721940559876; Thu, 25 Jul 2024 13:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940559; cv=none; d=google.com; s=arc-20160816; b=QK4D9STMM4WDAJzUdKnNW9hDOVLKUL82oWoTnq7WUkWMUi3qhkKKrH8cb7SxlC6mf0 V9eS3AbbjWOTbVU34AvdyYtTCie3QCacheIFDTFM6098ZlSxdGE7PXL6R/BrQryOA860 e/oUjHJ/MXp3NVp+KBvaxJHEoqB/5XGEe6xMXBIQKDHL/IPG6sMxnrmrGZw9lVBtxYPp E+eXLioJUMk/Iie2/dg9WZwCzwF1uispT17AK1ssqhNlo1FmWAZzPbc6KnPYXG1SLCda lFHd03KSb5qXT6NTuE14TvHSHxTI4infCopATNr3s5EWkq6UKd7QnyylZSxIq+o5QL0/ Gf4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; fh=X4lW+c7jYyx9d+RmLZUX+9QEQn0UCpyMDbNUusZzgBU=; b=VMpfeZL1UtbPWuC2Tq7m+QksKQKg5x1aLFH5diax1uihtz6EDWLVO823FOcl7e2cjH t0g5c+SRTKBhI9KAVDG5Djtw2DHqsyhf7Y8nnwoyFPnjV+KcgBLX8GidIXvreaNQwP4j j/NsZWp2UjJXoroMmrpnBKuCKLe908pfcBrpxUp3k1pybpINbzIA8U3im3VbnYWhb/nd 5h0cyUg9esQJUjXuU4yqNPcwqGW1BNyWVYerMqOEkeDQMgrxM73ub6ktlkdbqBhGhRau HPC7/ScEXmR+bpEKgX6FTbvrbo65j74AKLPs4UKvwKG4ocxgDmg2coY8MWCpAxAum4qq l1UQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9aA87y0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d152339si5768011fa.354.2024.07.25.13.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9aA87y0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B44388744; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="K9aA87y0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2BEC8859B; Thu, 25 Jul 2024 22:45:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D38F888580 for ; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7037a208ff5so205003a34.0 for ; Thu, 25 Jul 2024 13:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940337; x=1722545137; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; b=K9aA87y02K0RMPATTulcjDPyHb0Hk80CzSgjbwf5Zs0YdGNYkMtXB9413U78eY5FCj y19tp8jc+VJTcc0BvWCYPuqYj9d3VUcdIq7JEtKybT6D8EYpZOxUjRfvoBTBbUasgDnq ji3vP9CoOBItboleBeXYfayNgw+hqVpkvLO2S4AyaaIIyXN+kAvSsps+X3ciRIvn20+C /lynSvbOJEylb3/9vvETtDSnvl75ZoV7J6BgUF7G43BinZDuIyJz4UtY5emta6z/3xN/ Ohod2JEpV/Aqyi9zZcgINbRQRoDY7/zudBeT2KtNiue0TQujoQLhbYox/mUn6O3rH5yZ 5idw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940337; x=1722545137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; b=w7LRb67o1IhDIIzl75tF12VMUO+fblCAvlGHHEa85lcgWbz0mSzq3N3EbBJ6/puvJJ 9swwpx6bco/4FZefRWBjq0HjA+bNp2I3Yo5S4ycEcICEe3EGcLSvm7CoPF97cenBfdfu TcpNZlEGEFpQee6nr/7aRrLn1aOf26t0XRqbgne0GWVHmygqFCDE23iG5skSFBryVe/t afT39Nud9R8UI0Hae+K2lI4Kvsozmnp34UXvv6CXDyoyr3FgJCLa370g7xjOEkruYu1c fUo7lG84+z2IAgqJ03xS4XQaI6+/D0He+gfLHE6pgyYr12MFIBl8uxDUrSjUfYoY+Hse j0iw== X-Forwarded-Encrypted: i=1; AJvYcCXB2HDYGoH6LHW/d1OqEVB3Rjy3sXk8jhP2y2vpF7aT7wEli/n0uf5oDVyGNacjwMA9U3DOsmWzcv2uR6+nDB6FNBsu4w== X-Gm-Message-State: AOJu0YxjHAHrWSpM1PgWjmun98aEVe4odc84CztjKPjo8Z5wHSIhT7S0 84OIFdVsyN0Z+58UTeG7Kj8Q02iL76TXdkHSqeyv7VViZpXLyAtN0oKSKpPsEFI= X-Received: by 2002:a05:6830:3c0a:b0:703:6003:11f4 with SMTP id 46e09a7af769-7093222f9d4mr4003657a34.14.1721940337568; Thu, 25 Jul 2024 13:45:37 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778280sm447440a34.64.2024.07.25.13.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:37 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 22/38] mmc: exynos_dw_mmc: Convert to use livetree API Date: Thu, 25 Jul 2024 15:45:04 -0500 Message-Id: <20240725204520.18134-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Update the driver to use livetree API instead of FDT one. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Moved exynos_dwmmc_of_to_plat() under #ifdef CONFIG_DM_MMC stanza drivers/mmc/exynos_dw_mmc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 09a59fdf0120..50d0208b29fd 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -6,9 +6,7 @@ #include #include -#include #include -#include #include #include #include @@ -226,18 +224,19 @@ static int do_dwmci_init(struct dwmci_host *host) #ifdef CONFIG_DM_MMC static int exynos_dwmmc_of_to_plat(struct udevice *dev) { - const void *blob = gd->fdt_blob; struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; - int node = dev_of_offset(dev); int err = 0; u32 timing[3]; #ifdef CONFIG_CPU_V7A + const void *blob = gd->fdt_blob; + int node = dev_of_offset(dev); + /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); - host->dev_index = fdtdec_get_int(blob, node, "index", host->dev_id); + host->dev_index = dev_read_u32_default(dev, "index", host->dev_id); if (host->dev_index == host->dev_id) host->dev_index = host->dev_id - PERIPH_ID_SDMMC0; @@ -253,7 +252,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) #endif /* Get the bus width from the device node (Default is 4bit buswidth) */ - host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4); + host->buswidth = dev_read_u32_default(dev, "samsung,bus-width", 4); /* Set the base address from the device node */ host->ioaddr = dev_read_addr_ptr(dev); @@ -263,7 +262,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } /* Extract the timing info from the node */ - err = fdtdec_get_int_array(blob, node, "samsung,timing", timing, 3); + err = dev_read_u32_array(dev, "samsung,timing", timing, 3); if (err) { printf("DWMMC%d: Can't get sdr-timings for devider\n", host->dev_index); @@ -283,8 +282,8 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); - host->bus_hz = fdtdec_get_int(blob, node, "bus_hz", 0); - host->div = fdtdec_get_int(blob, node, "div", 0); + host->bus_hz = dev_read_u32_default(dev, "bus_hz", 0); + host->div = dev_read_u32_default(dev, "div", 0); return 0; } From patchwork Thu Jul 25 20:45:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814400 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567247wrn; Thu, 25 Jul 2024 13:49:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyXD4DjyD5cQ9uPVa5RQJeMUH/LOz0Gu2q8k+z20L9YnxCZKvVI37PxiEERETh6uvzhWXfX/jps2DPqaChKbZu X-Google-Smtp-Source: AGHT+IFDX5XnTcBfmh+31I9SYijfB8zZ2Y31ZNkiIho/9yZunytTahfCdjqoxmbXEYAKVhLAT13V X-Received: by 2002:a2e:8e6b:0:b0:2ee:8d04:7689 with SMTP id 38308e7fff4ca-2f03db7e170mr19709271fa.20.1721940568540; Thu, 25 Jul 2024 13:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940568; cv=none; d=google.com; s=arc-20160816; b=ecZrrv1fZN3184sWO3WQesyDQPtcl50XYwAybTi+PWox3tH6jfjxPpdjnhw87559Ho 7r67+m13LZfPgwutHPgl6LlzGk/BEuBiU0VH8sjWg1aJxOlRrXPlkji52NQ4El1a1Scc 9olO/mG+Sit8A2qutUADUE4Bj7BbLGB9YQQld/rLbbxdnEqgSKrAn6wkVwhKelttkFig IuYPbv8pXnr3kWYZ7vO0tazw3TsCfrWj0Y73pQPjA5k+4OUkoe6wT4AOGn6NWSpu1ysQ mXF5HG5DX3fIAu+UKKHIQyQS/44BZtWIYvxsaS4dhGnhj0wUfCKqG+vtH2t8jSsPfj1Z kJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C9ZIgLBY2XnIbIK9fr9v41CY3z5s1kiYpWDyp+lFXSs=; fh=/+km0qbHdTIZbTeQ12MsaLTeUrttKZW+8A9swLwLB8c=; b=lmN3aXxkiLz2KbfGR72nmgCRNawx4OIUMNxFXZdBBTjGL8mhddKcb39GVjB3EJB2gY DWU4DjvUjzN2Hf7QIK8uMCtJ/AVc1QgI6t4rxTwS+PmlscLQ/d6g2Sv4GhUsp73D7zhB eoAEWNzYpew3Y4jdET+0kN3B3VcXYem4iKTW3f6iEd6edVSgEUIuLjvIauw48XYHHV7U /hRm5A0fjOGjHOH8Io1dHalPqOY5KYLcEnhhj9Mv1XBnoiHgaq1IFtY5SqhyECl2DjwR 3yDyXKH7BqCuNL6zNS0OQPYKHmCICjIqyGJw9dfKm8SvSxDgzYp+ffauTSITC50um6yr W1Rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9A+jaC0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d16b68esi5949311fa.510.2024.07.25.13.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9A+jaC0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC4168875C; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="h9A+jaC0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D95A788580; Thu, 25 Jul 2024 22:45:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7AB6D8863C for ; Thu, 25 Jul 2024 22:45:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-709339c91f9so178368a34.0 for ; Thu, 25 Jul 2024 13:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940338; x=1722545138; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C9ZIgLBY2XnIbIK9fr9v41CY3z5s1kiYpWDyp+lFXSs=; b=h9A+jaC0gBezTSgjiwLtdq3OndsSXnIJt2VdTrU8D0v/64akjX0sVPcNMxvjPGheRn V2Z4uGyKxNrWhRcmx6op5QQWXVUd79ThzzxfGnsSXoRfbMuzSVHXtHpkGM2rakJop2ps r+MRnggm2DO5X7qNgRisW4HfcTg9+7OGitp0aJ/sbYvWTrdqu7rYUKFdDm4Wrs2x726x 7xN4JQ0lQ16D81m8ANv/35tPtXPoCTKT1Bvc4ES59FsNh371mxjxXcFzuTZy+9sHNloD bxKJLiO4PEq6O1d6L7pSLyrNzbkR2Nu+zsDiKGRuQHg0fDHoukywIupydUf41rLk3E6O 04SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940338; x=1722545138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C9ZIgLBY2XnIbIK9fr9v41CY3z5s1kiYpWDyp+lFXSs=; b=gZ321Rln6jTs8IM4KajUhsZzcAZ/l7p8Nx2yEbGrIT+wiHoXKA/6wsTdUXgdSHS0C/ 4A5gdxjv6aaR2zp5Y/F5D4NpTlekraUlDMvItvQAg4ffVxumf/6YVgJMUvipAQcCv1y2 eG/0oexbYAglvWe1yh6x77C8fMji2uhp9HR/w+Wt8zN+d6ohDtpmLb0CvqTFq1wJ6i+M r4uKD/2rjfr9jExbkRpTPwmwmxwPPJtyr3d/rd5gJuICerb4pifvqknM1rVpLBvD+Xxt fTnhaRLREybxymNJkjlylzqMHlk/nAd4LGByMAKNCAbL7E3ZHqOxq/6GWxJCi5Ty5g6p +xWQ== X-Forwarded-Encrypted: i=1; AJvYcCW6lUYit84OLTgWM095kmT11R3+islUMM/Gh5HZdX/d7OoID1PSvzWyJtY0obopTEt0Vqoe1XJR5ownIV+d8xwgjCKg+w== X-Gm-Message-State: AOJu0YyELh5TssKH6hqaVbDGf4DfOrb6+lIl32Ia1/nk7oZYJ/o7f6R0 v65yPFqw/u/JGpGsfTYyonpVKSL2oOkTL8jnF88WLkPri8ToWF/1qt9Hp5k3ubE= X-Received: by 2002:a05:6830:601c:b0:707:1794:6ec1 with SMTP id 46e09a7af769-7092e6ff277mr5197675a34.20.1721940338268; Thu, 25 Jul 2024 13:45:38 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093070671fsm458214a34.21.2024.07.25.13.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:38 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 23/38] mmc: exynos_dw_mmc: Read upstream SDR timing properties Date: Thu, 25 Jul 2024 15:45:05 -0500 Message-Id: <20240725204520.18134-24-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The obsolete "samsung,timing" dts property is now split into "samsung,dw-mshc-ciu-div" (for holding the internal DW MMC divider value) and "samsung,dw-mshc-sdr-timing" (for actual timing values) in upstream Linux kernel. Rework the driver to make use of new properties instead of the old one. All affected dts files were already updated accordingly. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 50d0208b29fd..4108af47e518 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -227,7 +227,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; int err = 0; - u32 timing[3]; + u32 div, timing[2]; #ifdef CONFIG_CPU_V7A const void *blob = gd->fdt_blob; @@ -262,16 +262,16 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } /* Extract the timing info from the node */ - err = dev_read_u32_array(dev, "samsung,timing", timing, 3); + div = dev_read_u32_default(dev, "samsung,dw-mshc-ciu-div", 0); + err = dev_read_u32_array(dev, "samsung,dw-mshc-sdr-timing", timing, 2); if (err) { - printf("DWMMC%d: Can't get sdr-timings for devider\n", - host->dev_index); + printf("DWMMC%d: Can't get sdr-timings\n", host->dev_index); return -EINVAL; } - priv->sdr_timing = (DWMCI_SET_SAMPLE_CLK(timing[0]) | - DWMCI_SET_DRV_CLK(timing[1]) | - DWMCI_SET_DIV_RATIO(timing[2])); + priv->sdr_timing = DWMCI_SET_SAMPLE_CLK(timing[0]) | + DWMCI_SET_DRV_CLK(timing[1]) | + DWMCI_SET_DIV_RATIO(div); /* sdr_timing didn't assigned anything, use the default value */ if (!priv->sdr_timing) { From patchwork Thu Jul 25 20:45:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814401 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567289wrn; Thu, 25 Jul 2024 13:49:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmOQHZU0UaYJSfIMTSgWLKs1f+nxuyN1Fj8Ux08uoPgsbgmZ7vjeCN+SS2pqsDnmtDpZ/XAYTR9uG1WneQzbBJ X-Google-Smtp-Source: AGHT+IHEcoMhiZ2hgHZ5uNtKPXWGbuR9RCpGmeDzxQ1OdfUtl/JiaVqFMYalOwbRAc2MXN39E0lO X-Received: by 2002:a2e:9cd3:0:b0:2ec:5685:f061 with SMTP id 38308e7fff4ca-2f03db71aecmr26422671fa.21.1721940578110; Thu, 25 Jul 2024 13:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940578; cv=none; d=google.com; s=arc-20160816; b=JyI70mX+9q3n63EeAZhWA08w8D3RtPd9mM9x/PRxwhRthfw0GdqEZ8lT+ZT6he/VMz Pa5hkRRZnfMdeNPpL9LSd0BsmN9GyV9NnB9M8yZuPiUU65FUHuWXyTxGkPleCxfk4gfG kmAhV6/2rVlfVbEoOWDHsLTDsieuAFFf9l4covWASz7LsO8vq5jEOiysRhfgK8XM56rK xTv8luj+6v7Ay6FwEzLAnppUtitJ8Ex2+TdTo++8jhyFtGkX5sIwSlguvfwznd8v9C+5 jwV9exILpq+Hx8Q8U+O4lgcj33cOufiU1Zjglo7/2wiigxqjtylNXROZLN8GOOwlPprv PgJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9ZFPb823dbyYcmoeeDpUw9xWqzzl5NwxCUroELGCpog=; fh=Ui++Ezk7VIhDpHir9YhSTF+LdGLsJu/AkQcHkzLryBE=; b=CQ0UVAZfW9Dw2VG6mSaa2Bgoy7hi4JcJRYhmFUiyOq45QNfc6K8SMdPuOj0K4VT56s uH+BGwDXGVQCcYtvyWnxaUo+hgCeNCvqCKBEwiwUC7WN1c46ebjeO85Hz2Y6TQH5xx+3 Omh9fJ3sESLv+BJ3f0/KMJ7BKmu+zBRy9rka+uIE6FQ8xSYCgg8Bg8pxOPp1dU6+stav TWl+Io3cwAyyvIBgPVC9YEYmeuK9f+vo+bgHI+USluOZw2p2Je/UiRt1LKBfjXESpPO6 w8eVXwSivBhVhLoRvL42wRkpQoc9zh9b0wBeRApDk1cF+fZAIyI1QvrvSZ4oPCWA0USv Gbsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=abqXxXCL; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d152ecasi6208391fa.400.2024.07.25.13.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=abqXxXCL; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5132688792; Thu, 25 Jul 2024 22:45:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="abqXxXCL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 97AB5885CF; Thu, 25 Jul 2024 22:45:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 72EDE88570 for ; Thu, 25 Jul 2024 22:45:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3db145c8010so178589b6e.3 for ; Thu, 25 Jul 2024 13:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940339; x=1722545139; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9ZFPb823dbyYcmoeeDpUw9xWqzzl5NwxCUroELGCpog=; b=abqXxXCL54RI3MTOP1kK2zbKNHroz5jyvbbMrCxtSEOt4Rnsbx36dhX7vrrTGBgdCm tvSWRUwglPMyIM1vkhiucKR4bPE48jjPK2lQHGAZlS3sMbUsObJJppfoJ8DWq2JANKRT l6/oLR3eisAsEsLPcpm0SSxbisRprpBmlBa2G2cYuW/w3+ulEbYxglBV4y862olgEkkb uZmBTAdMLJOwD8L+zz95vYkOiuUAnTsqTyVVlSIX2DV5kG6sFVK1S/SgjSSFUBJ0Km17 aCjH+/mVmYDxXqqShD1cQ8FSv42ANGyBJq/Vk4CSUITg682webjxXI9PBnNU03u5bguj J+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940339; x=1722545139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ZFPb823dbyYcmoeeDpUw9xWqzzl5NwxCUroELGCpog=; b=TgNbuKTqSu5BpqrUJXlm+BaFJO0VPSawDCUrNrlS3BMhH5Qj1jFVl86f5xRw0gfiDs pXUw/5bIznklf1zHIhyeL6njRW284cQmgwzUE8ETjiOSjtXVlSDSA871uP1Ol8vGY6JH bCxT7+ysIhPdRIRGJS2ckDuAfkuaHNGLRX2w4JkDNdnU7ma2qy2tw7sogM3XO+fV9LuW txS6UNwRBFb5ikaKHkA+G7Uxrbql9KABjVcPBacoLJtD+zlWKoQ6++ON1u3e1RmFjsL8 gLLPHbToeaIeQh3Dh43J4UIGq85K/tM+wodQKSAEQny7nqsuL22/69KGE5TwaTDIQf2J TUeA== X-Forwarded-Encrypted: i=1; AJvYcCVReB4qex/rmWm8cSTj9qS1IUaXjKrJrwsL8GN8UExoxfTN7teB6vgvLePzhnW+Y4WC/KZ9XlmdNBbfPxWh0OR5GXQPkg== X-Gm-Message-State: AOJu0YwskXpe5KY0uj9h6WQbuYcXkdTiXfGAC7JeNSUzjgRSsaucpYjQ Kn+L93sB3v7ueBz6X/5Ak1BHtMtg6bfOpxVAicEswC2Wszqma4oLskNcmZO53Uk= X-Received: by 2002:a05:6808:14c7:b0:3d9:ad9d:622f with SMTP id 5614622812f47-3db14125766mr2973491b6e.27.1721940339193; Thu, 25 Jul 2024 13:45:39 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1357a2casm426513b6e.56.2024.07.25.13.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:38 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 24/38] mmc: exynos_dw_mmc: Abstract CLKSEL register Date: Thu, 25 Jul 2024 15:45:06 -0500 Message-Id: <20240725204520.18134-25-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean CLKSEL register offset may vary between different Exynos chips, e.g. on ARM64 vs ARM32 chips. Provide a way to specify its offset value for each compatible instead of hard-coding its value in read/write calls. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 4108af47e518..fd2ced3d711d 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -33,6 +33,11 @@ struct exynos_mmc_plat { }; #endif +/* Chip specific data */ +struct exynos_dwmmc_variant { + u32 clksel; /* CLKSEL register offset */ +}; + /* Exynos implmentation specific drver private data */ struct dwmci_exynos_priv_data { #ifdef CONFIG_DM_MMC @@ -40,6 +45,7 @@ struct dwmci_exynos_priv_data { #endif struct clk clk; u32 sdr_timing; + const struct exynos_dwmmc_variant *chip; }; static struct dwmci_exynos_priv_data *exynos_dwmmc_get_priv( @@ -115,13 +121,14 @@ static int exynos_dwmci_clksel(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); - dwmci_writel(host, DWMCI_CLKSEL, priv->sdr_timing); + dwmci_writel(host, priv->chip->clksel, priv->sdr_timing); return 0; } unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) { + struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); unsigned long sclk; int8_t clk_div; int err; @@ -132,7 +139,7 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) * clock value to calculate the CLKDIV value. * as per user manual:cclk_in = SDCLKIN / (DIVRATIO + 1) */ - clk_div = ((dwmci_readl(host, DWMCI_CLKSEL) >> DWMCI_DIVRATIO_BIT) + clk_div = ((dwmci_readl(host, priv->chip->clksel) >> DWMCI_DIVRATIO_BIT) & DWMCI_DIVRATIO_MASK) + 1; err = exynos_dwmmc_get_sclk(host, &sclk); @@ -229,6 +236,8 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) int err = 0; u32 div, timing[2]; + priv->chip = (struct exynos_dwmmc_variant *)dev_get_driver_data(dev); + #ifdef CONFIG_CPU_V7A const void *blob = gd->fdt_blob; int node = dev_of_offset(dev); @@ -322,9 +331,22 @@ static int exynos_dwmmc_bind(struct udevice *dev) return dwmci_bind(dev, &plat->mmc, &plat->cfg); } +static const struct exynos_dwmmc_variant exynos4_drv_data = { + .clksel = DWMCI_CLKSEL, +}; + +static const struct exynos_dwmmc_variant exynos5_drv_data = { + .clksel = DWMCI_CLKSEL, +}; + static const struct udevice_id exynos_dwmmc_ids[] = { - { .compatible = "samsung,exynos4412-dw-mshc" }, - { .compatible = "samsung,exynos-dwmmc" }, + { + .compatible = "samsung,exynos4412-dw-mshc", + .data = (ulong)&exynos4_drv_data, + }, { + .compatible = "samsung,exynos-dwmmc", + .data = (ulong)&exynos5_drv_data, + }, { } }; From patchwork Thu Jul 25 20:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814402 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567361wrn; Thu, 25 Jul 2024 13:49:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVoMn1xRtBakdNkS7T7g71E0bpDY9m6MLGyxZToV7CLbtCyStwiQEP+rLwg0D+/KFmy79QG13tqbjlmUWb99rl1 X-Google-Smtp-Source: AGHT+IGrLnPhI8PLi7wZ7QRa5ua4mbLBX+b2Id1Dgo0Mqj6dmXboB5oEWJxkSoXEvkp48xMm08aa X-Received: by 2002:a05:6512:2393:b0:52e:7f23:5d98 with SMTP id 2adb3069b0e04-52fd41f8641mr1103672e87.8.1721940594679; Thu, 25 Jul 2024 13:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940594; cv=none; d=google.com; s=arc-20160816; b=oT9fiko3gFTasp1mEQ4RBz3nruOvP6Gdytn0/cL2WfTEHhj3rDEaZ9RUVrgPkFmKRw 6kuHEfw6NcRHOKe9tLYAI54N5FraGZWAbas1+RbhlX7mIStRF+0RQLlT1mxd1PWA5c8q wTLhx9Rb2dlHkR0+FX+EEzpS6GIb2lPiXivxvXgE4oLCucHkDtkgwtw0guGSz6n49ab1 zMHFVg5OpxTE4W1pUWJWNjYQCzDi9wG8VaQiZLvOyNc8P9pZJwn+19Hcqw3XQWse6NZb IgTcHVRFDDcsITvTOh6kwhsdpbp2hL2TXsXBMUjxIfnC2HSA+7i0opcFb7dXJfYil6qu bksQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G/Ea6ucmu4BNaMXb/iQjPm7+dfFKyLqVIq9Zyi01YvI=; fh=wMqnGo6GrPTaxj5NnNLPYU3uHOG61kNvjkeJHWmmefI=; b=iwiSOASH4N7cYn9VPnlyH1ZaklHDWVqLBJAs3BZVjV4kcUQ/odLemS93tmXDu0852t 9HeMtKD9PtUxV/SbZw8pfBkH8kPGPak/P6hgyylRYKlt1dQCql2Lgv0P3cmRTMnR2/Oc SoIiTTVM3gsMPln4X2AOgXwioJgb2ZRGIHYK48CKW3/CMclhNqxasSYK39zmiwQOOrUz XikM153LR6sxsESt86rET0AoRZwlpgmjaJ1d2t/KiuozPBphu2ScyYbNcRgZyOFqU6JW IsL8EHMYLOcyTuYzrNWtjQCfIsy4URHOsxTaj8lGpF6AGlzWtYDGQJ08+yUPRMYKbh+j OEpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=saHpOj+y; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bee8d2si659621e87.250.2024.07.25.13.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=saHpOj+y; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59A5A88585; Thu, 25 Jul 2024 22:45:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="saHpOj+y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7DA7088609; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4A8B088599 for ; Thu, 25 Jul 2024 22:45:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3d9dbbaa731so172078b6e.3 for ; Thu, 25 Jul 2024 13:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940340; x=1722545140; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G/Ea6ucmu4BNaMXb/iQjPm7+dfFKyLqVIq9Zyi01YvI=; b=saHpOj+yJNjjULMbuCYL4km1Z1dLPZ/WMVzxn7mfDOtZKAQnpMXH6qCvc/vuaqbNfn b1bFQdVmaDoYQVgUeNNuG3+qXZKT+YmmWkwwtWJHopzZLDMCJB8+JgcmpR+XXivOwP8v NA+3xzDdxl3U2/bI5oGgwmERrnMAVBGCa7UR1105Cb4D2wogyS+b0/xlYXFXHXYdgO4I loE/kVq5VGM4JO2EvAb4PCKKFstOswY8NdzFq0ViztLSPG7iCzMJP75ks19QJVURlTQn nuAnJwtkRjB/+w7/jHrDhheObbhz5I5RqOzrck5HSPT8ms6RsBnSTN7skjyYOHCe2ew+ eHOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940340; x=1722545140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G/Ea6ucmu4BNaMXb/iQjPm7+dfFKyLqVIq9Zyi01YvI=; b=koD4m//GF2CpyULBkMt+1R5dwEEuLHXUjmjy8IpskzfRdO7dTvj+Bc73PzxSAAV5mJ 05TvhdmqXghf1mX8uoJkjhX2O+XqeQjw0eQH3pbN8GDtaE7oweV5TU1WWxJw7JYaIqJW N9iHYueIWnSlbTtzHjhastzBjxwguo1oGS8F6bLABeEqmKuhK8Hl22ZcBh7Inl1njcD2 ZzGE700m3Wg4tyajiSs8OkRX+fmGZnO3IsCinFNvL0pTdmHiG7AHUQuyTwiWQd+s/dwz B2W9rZKqCYUTzE1j+1Mo6nlHXss10QqQUzglFOW04b58HQ5plwY7sTD9W2nN+FSTMdcx qfhQ== X-Forwarded-Encrypted: i=1; AJvYcCVSBxsCbP1rBFJFynj8cccxLkSFzr+dwmK6Q8kTq+GpAQLGKRLSHAZ43EP2efKqrnDrWGcOJqdtEhYPzn6l/T9vh19k0A== X-Gm-Message-State: AOJu0YzZC7CeUJL8/xoJzF0KyaYoY37VJKI7yVXG2ZkqIZDJXc+m+N5x UGYoj9hOlOCntP3l8WAXJzsYVlIEgsXwvT+Ww6N6869lUrgxzfjX3OW89pTv734= X-Received: by 2002:a05:6808:158f:b0:3d9:dbdb:cdac with SMTP id 5614622812f47-3db141d531emr3082067b6e.32.1721940339916; Thu, 25 Jul 2024 13:45:39 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db13523daesm431948b6e.45.2024.07.25.13.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:39 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 25/38] mmc: exynos_dw_mmc: Refactor fixed CIU clock divider Date: Thu, 25 Jul 2024 15:45:07 -0500 Message-Id: <20240725204520.18134-26-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Some chips like Exynos4412 have fixed internal CIU clock divider. Instead of reading it from non-standard "div" dts property, store its value in the driver internally, in static chip data associated with corresponding compatible. This makes it possible to avoid using host->div for storing it, so the latter can be removed safely. Also create a helper function called exynos_dwmmc_get_ciu_div() for getting the current div value: in case the fixed div is provided in the chip data it will be used, otherwise the current div value is being read from CLKSEL register. The insights for this change were taken from dw_mmc-exynos.c driver in Linux kernel. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/ca_dw_mmc.c | 2 +- drivers/mmc/exynos_dw_mmc.c | 43 +++++++++++++++++++++++++------------ include/dwmmc.h | 2 -- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/ca_dw_mmc.c b/drivers/mmc/ca_dw_mmc.c index 54a2ba4795e3..1af5ec0532ea 100644 --- a/drivers/mmc/ca_dw_mmc.c +++ b/drivers/mmc/ca_dw_mmc.c @@ -86,7 +86,7 @@ unsigned int ca_dwmci_get_mmc_clock(struct dwmci_host *host, uint freq) clk_div = 1; } - return SD_SCLK_MAX / clk_div / (host->div + 1); + return SD_SCLK_MAX / clk_div; } static int ca_dwmmc_of_to_plat(struct udevice *dev) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index fd2ced3d711d..b5c8f592c7e8 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -23,6 +23,8 @@ #define DWMMC_MMC0_SDR_TIMING_VAL 0x03030001 #define DWMMC_MMC2_SDR_TIMING_VAL 0x03020001 +#define EXYNOS4412_FIXED_CIU_CLK_DIV 4 + #ifdef CONFIG_DM_MMC #include DECLARE_GLOBAL_DATA_PTR; @@ -36,6 +38,7 @@ struct exynos_mmc_plat { /* Chip specific data */ struct exynos_dwmmc_variant { u32 clksel; /* CLKSEL register offset */ + u8 div; /* (optional) fixed clock divider value: 0..7 */ }; /* Exynos implmentation specific drver private data */ @@ -126,12 +129,18 @@ static int exynos_dwmci_clksel(struct dwmci_host *host) return 0; } -unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) +/** + * exynos_dwmmc_get_ciu_div - Get internal clock divider value + * @host: MMC controller object + * + * Returns: Divider value, in range of 1..8 + */ +static u8 exynos_dwmmc_get_ciu_div(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); - unsigned long sclk; - int8_t clk_div; - int err; + + if (priv->chip->div) + return priv->chip->div + 1; /* * Since SDCLKIN is divided inside controller by the DIVRATIO @@ -139,9 +148,17 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) * clock value to calculate the CLKDIV value. * as per user manual:cclk_in = SDCLKIN / (DIVRATIO + 1) */ - clk_div = ((dwmci_readl(host, priv->chip->clksel) >> DWMCI_DIVRATIO_BIT) - & DWMCI_DIVRATIO_MASK) + 1; + return ((dwmci_readl(host, priv->chip->clksel) >> DWMCI_DIVRATIO_BIT) + & DWMCI_DIVRATIO_MASK) + 1; +} +unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) +{ + unsigned long sclk; + u8 clk_div; + int err; + + clk_div = exynos_dwmmc_get_ciu_div(host); err = exynos_dwmmc_get_sclk(host, &sclk); if (err) { printf("DWMMC%d: failed to get clock rate (%d)\n", @@ -149,11 +166,7 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) return 0; } - /* - * Assume to know divider value. - * When clock unit is broken, need to set "host->div" - */ - return sclk / clk_div / (host->div + 1); + return sclk / clk_div; } static void exynos_dwmci_board_init(struct dwmci_host *host) @@ -270,8 +283,10 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) return -EINVAL; } - /* Extract the timing info from the node */ - div = dev_read_u32_default(dev, "samsung,dw-mshc-ciu-div", 0); + if (priv->chip->div) + div = priv->chip->div; + else + div = dev_read_u32_default(dev, "samsung,dw-mshc-ciu-div", 0); err = dev_read_u32_array(dev, "samsung,dw-mshc-sdr-timing", timing, 2); if (err) { printf("DWMMC%d: Can't get sdr-timings\n", host->dev_index); @@ -292,7 +307,6 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); host->bus_hz = dev_read_u32_default(dev, "bus_hz", 0); - host->div = dev_read_u32_default(dev, "div", 0); return 0; } @@ -333,6 +347,7 @@ static int exynos_dwmmc_bind(struct udevice *dev) static const struct exynos_dwmmc_variant exynos4_drv_data = { .clksel = DWMCI_CLKSEL, + .div = EXYNOS4412_FIXED_CIU_CLK_DIV - 1, }; static const struct exynos_dwmmc_variant exynos5_drv_data = { diff --git a/include/dwmmc.h b/include/dwmmc.h index a99b2f3bf0cc..8c2500da9efe 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -184,7 +184,6 @@ struct dwmci_idmac_regs { * @caps: Capabilities - see MMC_MODE_... * @clock: Current clock frequency (after internal divider), Hz * @bus_hz: Bus speed in Hz, if @get_mmc_clk() is NULL - * @div: Arbitrary clock divider value for use by controller * @dev_index: Arbitrary device index for use by controller * @dev_id: Arbitrary device ID for use by controller * @buswidth: Bus width in bits (8 or 4) @@ -205,7 +204,6 @@ struct dwmci_host { unsigned int caps; unsigned int clock; unsigned int bus_hz; - unsigned int div; int dev_index; int dev_id; int buswidth; From patchwork Thu Jul 25 20:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814403 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567432wrn; Thu, 25 Jul 2024 13:50:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVFgrUCdnulyJzIjKv88J68C0K893zBti2wwyT2+b316vNGlh2bIwIyftqw/STdU4iGP0FNMEhsJxZhqHzcC0hS X-Google-Smtp-Source: AGHT+IHqK3aIxNWPXtkXm22Bqla0e3Kd5sM60Jf9cS0gndDoiLK7EjB7bHyriSH2gNEbjvehR37o X-Received: by 2002:a2e:9990:0:b0:2ef:2b08:1742 with SMTP id 38308e7fff4ca-2f03dbf3baamr19688951fa.48.1721940605474; Thu, 25 Jul 2024 13:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940605; cv=none; d=google.com; s=arc-20160816; b=R4nncZuw05ZlNfHOJlz3dPGiU427sxst3x0HA4DJWjRnwMNLX1L5Os/ViVpprLDeRs cWx2wlXPIVEFb/30wWlNa65lBZ4ag4vLoLYXTjyP6i1+FDk/fLSgqHNExirJIfzr8lZ6 Wa2Kxz2B71PqUrvoO0ssvfxc5bcihLcvUC5+uOOLGF3k0QqELAW52MYgmqLZBZhVQYu6 4rH+OpTm5jkInK0ivgMONoIyBkLGaH98c7unvB1N1KuWoLtJDDhvtLd1RTUIhE6mol4G 5KLhzY8wbe5UnYzaPz0g+TqdMC/P+URDuig6p3t3ZwUbaiW1GAbv4bbaMxnupT1G0uhk HjnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AERAu0i38gJcVIJ0Ys3xnnSmu2uda0nUAbxFeiNbb+E=; fh=6Tff3JCR6bZrBqF3lZDCJuq/pIezefnGHb1Bv9lC10w=; b=w+hAsNsr1XdNR6aVky6xJvDlZu0EbdDrygaQUhIBkKCidibWfCZxgibw3M20dVVENS 2JTTHGenNCqo5MbiqcvtKPKDN3hbRGq5j+a2G3PxnlP7icE/BI4w1yRbCyb3YiSnC2lz l4pFnESvOWRjTtiPAYwrejxV0HCcZ3cpqvkEHJG54djELSyxZPCKv+B9E39PfS2fsR0V zk4h45HY+CcJ8aKrx5e/8GtkQnoklJvSmMlbjAx1FqiYG8KcWZc5tyi1rNDR3i9mfjHr zKZoGxSPcqbMM66hi3GvkC1QVBpjZ6paP8CvWFFRzUh3VRFJiSsCQGv/N7lbc76UY2/a scPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BwoX+MNg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d13ea87si6045421fa.302.2024.07.25.13.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BwoX+MNg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B24A4886BB; Thu, 25 Jul 2024 22:45:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BwoX+MNg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EC1088667; Thu, 25 Jul 2024 22:45:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ED9818859B for ; Thu, 25 Jul 2024 22:45:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-70936061d0dso201399a34.2 for ; Thu, 25 Jul 2024 13:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940341; x=1722545141; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AERAu0i38gJcVIJ0Ys3xnnSmu2uda0nUAbxFeiNbb+E=; b=BwoX+MNg8IZ0R3Ib4vKar5gRrfkCzTllCk+4gGWHo+xJoGP9rbZA4d6M/ZPxz8rbMp aMAjMB5nJRm70q+fDAn13m+9agjAurbEkqdrhbHsoZK81uXTnnFFJmrCWMAGaW95dieJ xQU98LrRLOE/wZ0EmLo7C0B4BpBOBkV9+VL4OzexSCWTX3ShMptMNyRZ1FgRdKrE1WJx kLMtflaWwdlMMxzogBIq0EamEJC0TKbfIps7L+3tw2hCPIA2F8oMjTe9ziYO9/NAqsSc kBDOfwduIv3GFFL9J4a5pG8Q+/TUjnWxDd/bLj95Sq7D0/u9j5FWbCxA9GjxumIhj9zJ WOpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940341; x=1722545141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AERAu0i38gJcVIJ0Ys3xnnSmu2uda0nUAbxFeiNbb+E=; b=Jozl+7ssdoRwtpJOMIQHQQKlDa46pkajUMEn0Kvha01jAwl9vM6KhFkS37vI3GD5hS qACABF3Jh9m1aTCXnABQeKMqtfKPHEJlHvcxHKGOkMIGcDtuaL22prl3CdjFh4FwSYpB 5re/SVxxfqOr3L/3xC4AAwFcnTKawuvOxgPilB1uw6y9t5I2ZFwwUrS7ox8TVPTfwLJz HhLOJ5f2wBqi3ZmQc0izZGlgFslT2jtrqcm6WVocXQdOhX+aUbs9MiGKzN6Mhyh6c3II iBBad62cSdrD7HtHulh3DGVShIZQ68R70GfZwn8PtkQTNDVQsz1v6ZTya1xxplftw9qJ RBiA== X-Forwarded-Encrypted: i=1; AJvYcCXEW2TE8mpGBvWdRhNhNsGRcq1kNCiKlaWxmqIyxhhDIm9E0evcHkMoBv0r4JrCk/iE1n6gI/7Ku92KkjBngbb9V3CRaA== X-Gm-Message-State: AOJu0YzKN9R7Esd0yirrDOPReWZdxgb2SrfwL5Cf+xEli7PqDzG0ehyq zm08GJ4YNKdVGy6yLsM40e/J+bMEdicbY72rER7IvcFzqqQrl1wPrfXO6jESFeo= X-Received: by 2002:a05:6830:730d:b0:703:6ec7:64e1 with SMTP id 46e09a7af769-70932010b81mr3558145a34.0.1721940340651; Thu, 25 Jul 2024 13:45:40 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930720f62sm453503a34.37.2024.07.25.13.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:40 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 26/38] mmc: exynos_dw_mmc: Read common bus-width property Date: Thu, 25 Jul 2024 15:45:08 -0500 Message-Id: <20240725204520.18134-27-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Instead of using non-standard "samsung,bus-width" dts property, read common "bus-width" property used in upstream Linux kernel. It's safe to do so, as "bus-width" property was already added to corresponding nodes in all affected Exynos device tree files. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 2 +- drivers/mmc/s5p_sdhci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index b5c8f592c7e8..612c2d0c615d 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -274,7 +274,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) #endif /* Get the bus width from the device node (Default is 4bit buswidth) */ - host->buswidth = dev_read_u32_default(dev, "samsung,bus-width", 4); + host->buswidth = dev_read_u32_default(dev, "bus-width", 4); /* Set the base address from the device node */ host->ioaddr = dev_read_addr_ptr(dev); diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index 80dbb38c9b36..278019f02abb 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -166,7 +166,7 @@ static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host) host->index = dev_id - PERIPH_ID_SDMMC0; /* Get bus width */ - bus_width = fdtdec_get_int(blob, node, "samsung,bus-width", 0); + bus_width = fdtdec_get_int(blob, node, "bus-width", 0); if (bus_width <= 0) { debug("MMC: Can't get bus-width\n"); return -EINVAL; From patchwork Thu Jul 25 20:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814404 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567474wrn; Thu, 25 Jul 2024 13:50:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVaKpHqlS0nM5aEv3CVL/zJFl8aIVKIz1roGIwdyGDSUPTy3b0T44oDGf428SZxnOqfOid6nnlWGUE+okg7PKdS X-Google-Smtp-Source: AGHT+IFj9NlRyhVfQXf8S0N+l3rV1voHEA1yDVV6Li7hKxvbfFq+NvIPCRF/fs0ExWp9ynF+sraW X-Received: by 2002:a05:6512:2c0b:b0:52e:7a8c:35a0 with SMTP id 2adb3069b0e04-52fd608773fmr2092688e87.7.1721940615932; Thu, 25 Jul 2024 13:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940615; cv=none; d=google.com; s=arc-20160816; b=A7Bnk+pT2EXDSOWCV4jXGzl2z2aADhLLmBuqYe5dnDusH8+GcbujX9RKGyF890iXAo el99ytCpBb1jC3B6NYeMA/8Nx1zMgb0PNc069Z4qCDhcDNqqflzNWhE8pT0o35OuEUJJ 8rZUufS9tIAdM5RY1iaf5oqr+MipU7h5oXmppRI5lJx7zSC4+rZqtUNIUS8yUqp3e4Cq 47cA9ov/qpl+kebwTmBVro7wBjs9+LsBgBDPbsnV78lRlrOzz7n5MICLEBBZb/6BH6MI 2Tb//T7bHAbbSLusMjTbDftxsz5Bd7kV92dM17A96UzSzld+Waw8hWc7XgEZgTlaxPmu TEeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XNDumY49CDktTqx3IPFl3vyE5aLeGsbRRyWHKlFDfo4=; fh=sAoK1xs12mwzXoOSaH9kYtSYu8JJvPQt40sejs5yN8s=; b=0ULq4H6uTss924bYTP6J7pK77iOCVRadg9sxCXm/5Qw8LIF/3uv1U4J1Qba3TEnaq1 gNx6k1TLkyckSK5n8KR/QtQFHdgrf3T+J+6XuZ3UHAqFHdBOpD/sGJPhgonUmMEoeuPD ahk0453k8dHOzXswz156VHGfGKEQYFmbRM2peu35G7obNx4lv5rmlSBmah5Titx7n1q6 NMt1Zqpdwz2CGLxvxgZ1yR+X0EVpVgOrcAbz0KAvhDm56dPjMuJGdh21KqrVjL8jiZG2 QG8COqJbQQvjfb13muN/JSgDEhgGpa/4vPLHoirCWKGRtEZ6vdxoSQRCp0/K9ZLg1ZaX S+0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dm9lN+Mu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5b94f14si662473e87.101.2024.07.25.13.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dm9lN+Mu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12E3F88700; Thu, 25 Jul 2024 22:45:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Dm9lN+Mu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A1429886A6; Thu, 25 Jul 2024 22:45:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E4EA885C5 for ; Thu, 25 Jul 2024 22:45:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-70448cae1e0so164421a34.3 for ; Thu, 25 Jul 2024 13:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940341; x=1722545141; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XNDumY49CDktTqx3IPFl3vyE5aLeGsbRRyWHKlFDfo4=; b=Dm9lN+MuEOdNlaarrlMACxf0UncSois4k4/ShyYL1y/F9Lu3iUKY6kQt+7crjwKerB Q2MVn6Es14SIVE7G5KgVlsyAuK0vx1X67nosJ58Qn+N+Km2PYVxQbU0QusovtG2yyxSv fHEVnOSGRHRYnPTeDKKQhEuclcgZaRZEbw+yADHAzEkcbTHvgOG4oGBD54ewD9GEW6i4 6Q79S6L1zo2dfDuM38ClDZojUo6a6WfZ+LtRTdB/tue1Q88FRuFWicKNsy0V1tKq3cQa VoCHnQEmPD+PKiJXqCBF0kNGyxHeh7cttNT4wrTUiu9miwGjBuUh7nspKsRD4Ubb4+++ VCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940341; x=1722545141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XNDumY49CDktTqx3IPFl3vyE5aLeGsbRRyWHKlFDfo4=; b=hpmWXvJNV12Nyc/zMEFWCpOQum5lxoxo9mpEPLTQ6WSsFBVB0NrsUJuuWtJrP5jXZp MmjhqfICw1c0HdrkbwxG1UIHCm8FRp8Rw31Stn+jEMZgEzmm/q5O68b20Cp32dRxb+0/ pvp1O7TVsXK21Ox6XTL8OByM/UjEDkaXmgSL0atrewB8/XeYGatcabM2t+oW5nPR5gHe T0k9RzFP5jDE+zctHn56oTma/4mAOSomaiplsFC1So4eZHJkmAkB/wQB50N4CMSh7FXT HqhNC4fhsXUbzVHkWZuUEOo3YhI5kX3BejjTDvEtL2zbwzVwc06LBXeA0qwLqPd+FfSW hMpg== X-Forwarded-Encrypted: i=1; AJvYcCWQEgHMvWVxZxB5aTuFbGtjFFwtF91blJxWxVBE72YBZnMXh8EmS9/kWL/oEcfz+58iNW8BG4kJ8g97S74hFb5Lfi09kg== X-Gm-Message-State: AOJu0YyTtH+t5lLDCi16sSFr0s9fjsRJ/rzAMS/QDWAl16oNQh6v8Ot8 swrlq5FebXXgrilQ5vNCE+Pf1yUVFrdjYCB8KBfTUYwAetcvZk4b90OhAFaMV2M= X-Received: by 2002:a05:6830:6181:b0:703:64ad:83e7 with SMTP id 46e09a7af769-709324fe04cmr4093479a34.30.1721940341393; Thu, 25 Jul 2024 13:45:41 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093072b795sm460388a34.42.2024.07.25.13.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:41 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 27/38] mmc: exynos_dw_mmc: Read common clock-frequency property Date: Thu, 25 Jul 2024 15:45:09 -0500 Message-Id: <20240725204520.18134-28-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Instead of using non-standard "bus_hz" dts property, read common "clock-frequency" property used in upstream Linux kernel. It's safe to do so, as "clock-frequency" property was already added to corresponding nodes in all affected Exynos device tree files. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 612c2d0c615d..bed8bd8a0fcf 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -306,7 +306,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); - host->bus_hz = dev_read_u32_default(dev, "bus_hz", 0); + host->bus_hz = dev_read_u32_default(dev, "clock-frequency", 0); return 0; } From patchwork Thu Jul 25 20:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814405 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567534wrn; Thu, 25 Jul 2024 13:50:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW0O2pH11SSyMncFF4ie/eeLM1U0g9w6d9m1cfByReq3lkDureJaKbqAG39+7UUU3MF0iHqNqMn3nhBIoZ8MIJ2 X-Google-Smtp-Source: AGHT+IFPppikhLkPcVvb9+aX+B5VJLAr5I5xXPwLzPS1P1yv7VE/v5BQ5JjCKsuiEZILtIUgy0Ma X-Received: by 2002:a2e:a0d1:0:b0:2f0:2068:f2a with SMTP id 38308e7fff4ca-2f039d5771bmr24180501fa.40.1721940626361; Thu, 25 Jul 2024 13:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940626; cv=none; d=google.com; s=arc-20160816; b=hvEq8B9uF8Glm7BQhb21ksPNjdevT+zRhmmKwy9ynvHQPNiFir7Y7AsO0Lyq08Bcrm 9xue9jC63Fjt1CTFB6mqKFBsGopfDRfXB2mLYfJuZ4vBX51536k5ntrmxBrXVtlXnqWn N+3ogcX10rAWRXEQDDQmW+7gjpS9uDYSA1Sy/0h/WQQ7LDxaRVObvVTiLUowpIgL45m2 9/P+obkciKvUwSwunhHqC6Wd2lJ437R/qKTM4gWz3JBh3bFhFHNQNIiIPd96vZFtuhKL zWTK17XR4DeQn8PxV8+JnUg0WO/Hqoqzy3Cm6dnB9KGi9Bk7yZoVj8W9p/SCGAzBfpwC 3ryQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; fh=38Zfqwyk8YwmoGMZx7ROtFX6d7qj4a4AqMqHtT+gHDQ=; b=zATm5KvJhcxtQnCthd97Bv7zPRanmyg9r19eOJl4Y+y6hMSEjMS1rV2WEosrTQKyEf KWFE9rSSYka3Rlfs/CzDSRBaldSWphPud6TFLBWvX0JS3Zvs79mwfYLq3ieiSeqfHfHP G3EFE+/rgj/wMUWY+kYwiYBy8/bQeDyw2ypfqTl2puudv/ESbf5t1KRD/rVYHDehGHV6 nZI33ZCurkzORNUg1ssZGjpOGSki0Qj62lBPNaLeyN4CwBPawfywvadry+a4cp/Y1StE ggSTgxY5jDR7b6z1Sg5Hft3WL2ILdN8bWDYUSFOcDg3dRgGAnW/HyP9PPbJ8M/vE8uEN 4jcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D27TE+3e; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d13b9c2si6235831fa.318.2024.07.25.13.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D27TE+3e; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 638B28871A; Thu, 25 Jul 2024 22:45:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="D27TE+3e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 817A788708; Thu, 25 Jul 2024 22:45:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5AC02885E4 for ; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7092fb4317dso293278a34.0 for ; Thu, 25 Jul 2024 13:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940342; x=1722545142; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; b=D27TE+3eQBSlU8alX97A2gha9LVVZfx/5oZuFViCB4kmgtZOBsjowA6W1N+WRXr7ug 7jtzssRuLcSLy7FR7lgmNBVcCFrWnNo5et2DHdGwbtgPRxcmYQTgTQ/rczv3lnFjGWx4 50VyfTW/ZU0xdrq/09FI5cszYJzs7XEqMlVo8uKSrg69sOgTVTaTKkPi52fGTzWIRkxq yRBAmItEtnu1zximFyZrQwX0gmop5ZI8UPFJcKeXijsDMAFQTiat5rvpZonjLaXwhsXT WWrih29L2iEm8pcQOoeKKR5YAzhARcvBp74+YVJyidPFoQ+BozLmOTHqjuCj5tWYDChA DDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940342; x=1722545142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; b=rM4Ydd1juC9N5SlXGuhwHAfnoS1UyHuVcj+60F4ChGLHd7/Y2Tu9/QTNP81oiijv/U mT1FB8jtj1FrpSeVhDCWP2ZAZmKJwo+3N/9KKGtTrMvmug/SBV9WGdKDZ6EbLo9tOC5X 7C2Gv7ktn7Z8G/b94bdNTtRZbCtYsVSoIJzwqIgEqo/sTlbiXcUthaYKFWA/A61t7wsa aTqz/9uxaD3aeorkTv1nUrNykE8JnHYlvlsmgD7MFiZLxC9s95nACbfPcQIibOOqDvL1 zf81zU8IpKAvNIsvaIJhV2v6VB+wFoG8xR84hV2ZJBqhJGGaBEV26SxFIPh4RTyPYWgD 6y9A== X-Forwarded-Encrypted: i=1; AJvYcCWsxizjxnkoqjfDbAaiKYY5qv/A8AtKjHyKUFbRwlS1uGU1NGSLAT/u8E4XLG0bcHJAHlrlVV3jXzLUf4fxIcqFbbQ4ug== X-Gm-Message-State: AOJu0YzISJQzTTI+3teE1C5r4ccBLDfJQUTXbV3GE4rTI+h1kmeoM0cc Ydskj39k/NzsCYLjUVLtZfvKE7xuIsSX0BkXK1VzezK3NCGg2284dHcseQn0MrQ= X-Received: by 2002:a05:6830:6014:b0:703:5d37:7387 with SMTP id 46e09a7af769-709324ea60bmr4125338a34.30.1721940342073; Thu, 25 Jul 2024 13:45:42 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778451sm452717a34.61.2024.07.25.13.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:41 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 28/38] mmc: exynos_dw_mmc: Move quirks from struct dwmci_host to chip data Date: Thu, 25 Jul 2024 15:45:10 -0500 Message-Id: <20240725204520.18134-29-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean host->quirks field is only used internally in exynos_dw_mmc.c driver. To avoid cluttering the scope of struct dwmci_host, move quirks field into Exynos driver's chip data, where it can be statically defined. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 13 ++++++++----- include/dwmmc.h | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index bed8bd8a0fcf..b9d655c0d5c8 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -25,6 +25,9 @@ #define EXYNOS4412_FIXED_CIU_CLK_DIV 4 +/* Quirks */ +#define DWMCI_QUIRK_DISABLE_SMU BIT(0) + #ifdef CONFIG_DM_MMC #include DECLARE_GLOBAL_DATA_PTR; @@ -39,6 +42,7 @@ struct exynos_mmc_plat { struct exynos_dwmmc_variant { u32 clksel; /* CLKSEL register offset */ u8 div; /* (optional) fixed clock divider value: 0..7 */ + u32 quirks; /* quirk flags - see DWMCI_QUIRK_... */ }; /* Exynos implmentation specific drver private data */ @@ -173,7 +177,7 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); - if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) { + if (priv->chip->quirks & DWMCI_QUIRK_DISABLE_SMU) { dwmci_writel(host, EMMCP_MPSBEGIN0, 0); dwmci_writel(host, EMMCP_SEND0, 0); dwmci_writel(host, EMMCP_CTRL0, @@ -205,11 +209,7 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) } host->name = "EXYNOS DWMMC"; -#ifdef CONFIG_EXYNOS5420 - host->quirks = DWMCI_QUIRK_DISABLE_SMU; -#endif host->board_init = exynos_dwmci_board_init; - host->caps = MMC_MODE_DDR_52MHz; host->clksel = exynos_dwmci_clksel; host->get_mmc_clk = exynos_dwmci_get_clk; @@ -352,6 +352,9 @@ static const struct exynos_dwmmc_variant exynos4_drv_data = { static const struct exynos_dwmmc_variant exynos5_drv_data = { .clksel = DWMCI_CLKSEL, +#ifdef CONFIG_EXYNOS5420 + .quirks = DWMCI_QUIRK_DISABLE_SMU, +#endif }; static const struct udevice_id exynos_dwmmc_ids[] = { diff --git a/include/dwmmc.h b/include/dwmmc.h index 8c2500da9efe..6edb9e1a59c5 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -149,9 +149,6 @@ #define DWMCI_IDINTEN_TI BIT(0) #define DWMCI_IDINTEN_MASK (DWMCI_IDINTEN_TI | DWMCI_IDINTEN_RI) -/* Quirks */ -#define DWMCI_QUIRK_DISABLE_SMU BIT(0) - /** * struct dwmci_idmac_regs - Offsets of IDMAC registers * @@ -180,7 +177,6 @@ struct dwmci_idmac_regs { * * @name: Device name * @ioaddr: Base I/O address of controller - * @quirks: Quick flags - see DWMCI_QUIRK_... * @caps: Capabilities - see MMC_MODE_... * @clock: Current clock frequency (after internal divider), Hz * @bus_hz: Bus speed in Hz, if @get_mmc_clk() is NULL @@ -200,7 +196,6 @@ struct dwmci_idmac_regs { struct dwmci_host { const char *name; void *ioaddr; - unsigned int quirks; unsigned int caps; unsigned int clock; unsigned int bus_hz; From patchwork Thu Jul 25 20:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814406 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567565wrn; Thu, 25 Jul 2024 13:50:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVsQ/AFyddT9by7Qf7WqBChAHnhziLAe5l56fZ2yGAE1W60uq+25vFZ+Aqji63QUbT358noORSWqqTJlt+z89/q X-Google-Smtp-Source: AGHT+IG7qtK0MTc/1r+kMTf3kj3AgHv0TkgfShGBXlrNsmELernZ+8eZrHlYUUHer6kigx86FYs6 X-Received: by 2002:a05:6512:3b0e:b0:52c:8df9:2e6f with SMTP id 2adb3069b0e04-52fd3f8ec42mr3055763e87.42.1721940635946; Thu, 25 Jul 2024 13:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940635; cv=none; d=google.com; s=arc-20160816; b=ajJGKHwsO3iA4oG+ysJoEmjIhYlM2anMAzl6mhuabQZCiBdwDITr1YLDHCrI7fR08D LHryxyd94esNQ37iuxeXmhO+uF8qlIBZxhlIyiCbiO0shjDDMHjSMe8jt6Gz37m+de2d hZHdJuaRxaLBZaQIazNLjfcOC1I6BjuYLLTCXj7lzH7E3+PGR6P931dtIkfdL16xUkBm mFUphvNb1jHcsc96WOXPZHNah8dOPECsCec/RSIRxGV1TOF3vxXlHkV7E/7/nMg94GEw Qg8/2JhS9KNQdxtYRYOJNA70FbvUoBqSuG4jX1Za1sbciOO72mNeu681NBc4aHk23qaU i2Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s2Pqoyr35+7fx/+L9NHlNn9vjAMBq6pejH5ouGBVKPI=; fh=kIP0lsadriTHrMtXsSbuPh+PiAovIqHnrGC9g+/ykCY=; b=IvHenfxgnmFFLTpGMh/3P/6yI2qO+zn04o+7ajZwcnaCK1fCYBkzOTbSZSK40PrYBA BgYh6Zq2dUu1n54ElKJW3TUzFKXwdnHO3+jCd8KKec1uSC7csTOso0as7Gsm5IUdO7hy szc0QR74plQ3hoM7JKpjtE3KlatWbKpLrda1BmoH3hhPUZ6tCYn8q6jv/bJupJP1gE8B oplD57V+Fjbfrr0/wfWh/lQBbZAFd1rilN6NAuZ0a1jpIb/7HUFuHax09g7c57o4qsOw eSxYPGEhQB9w0UnX+Xaqr5yBJ3azyA8eFumfcbKetO3TI5LHooiyab3GLCljJq/CKnhu /TAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fFnagMNs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfbd45si680604e87.398.2024.07.25.13.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fFnagMNs; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B65578875D; Thu, 25 Jul 2024 22:45:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="fFnagMNs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20A5E88730; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F16F88863E for ; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-708adad61f8so197679a34.1 for ; Thu, 25 Jul 2024 13:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940343; x=1722545143; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s2Pqoyr35+7fx/+L9NHlNn9vjAMBq6pejH5ouGBVKPI=; b=fFnagMNsYO+3prDgSATE8fYe1kxmqZEZdVemd/27cBHUTqY+qOEKaZI/BdTDyX00zc vJ0DdHBKzgiLhpYkVT/Aeh8fToKZoOeR78f0DoJ3eQx6Ui672ILfcx3QPuFtSmgeJUnK EwUFiHXh1t1ixyAR+zAQiC6K9aPC2rAiB6J0u82AUCDpLK+nBjEoPuYjFlttJy64cFhw 3LOad0ZNiAW8+SAPF+iqajgPJ1W0rbQq5aYLu2tFJb+5zNsKYjqzkYFzWAxeW2vqNfvU WWca2WwdmlP4kFXLOND3Yyj/66S9eTLow9xzpreyGndG1k+6DgIdeiIH2Kr5Wan+C1Be FLoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940343; x=1722545143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s2Pqoyr35+7fx/+L9NHlNn9vjAMBq6pejH5ouGBVKPI=; b=FQ12BL1wvOb5qJMF8hDLXXtOvft0sFeLYi6p4He1Du7hztw+XFBg5im05ch826l1k7 RiGEMcBDNqPMuQk/mDSvc2VNTwQHajp7h4eJTYqvm4UpgRe8lOtD6oWHF959Jzj1Ppg1 c4VTi985MyMTPhzRjvV3gfl5VURAt6Oj+USWLkZWR8AcpqtNxbyfEL+TTyuDZ/kS8sHv HJjkZm3Vfm/lkLTDOkur+CSCwXCuuSaS3bsN5Qz7Lup46MmNX2iMiMfck4snoJjcmQTd /Zjm8Ae0h4TWQ0NMGeWAIlj3qKVb1a3zTX5nXs0uLd8R9mnFYAuG2LlxeMst3PcYAo7N z0kA== X-Forwarded-Encrypted: i=1; AJvYcCXRB+2sbujBVu0Bt6/RwDx0swZue+Xy7udsDoJQCLrmI0/TW4coEytenuralrSFxeAcVwMY7wlE/n/H19adZ7iVeW75fg== X-Gm-Message-State: AOJu0YwUO7hSY/H/94/5uMg4ITWx/gTgiLnbPlsAlbEda5QIav1S9KjB vwStoll2COhKju7mSvAR+7SXq9Ym7WXPAsJefraqrGI8KTv7KT0O5wFPx/4KR/c= X-Received: by 2002:a05:6830:388a:b0:709:30eb:dfcb with SMTP id 46e09a7af769-7093223599emr4099788a34.18.1721940342772; Thu, 25 Jul 2024 13:45:42 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b349a4desm249334eaf.11.2024.07.25.13.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:42 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 29/38] mmc: exynos_dw_mmc: Read and use DDR timing when available Date: Thu, 25 Jul 2024 15:45:11 -0500 Message-Id: <20240725204520.18134-30-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean DDR timing values should be defined in "samsung,dw-mshc-ddr-timing" dts property, and used when DDR MMC mode is selected. Read that value from dts and use it. If it's not available, use SDR timing values instead. This change is following upstream Linux kernel implementation. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index b9d655c0d5c8..32f3ea168b6c 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -52,6 +52,7 @@ struct dwmci_exynos_priv_data { #endif struct clk clk; u32 sdr_timing; + u32 ddr_timing; const struct exynos_dwmmc_variant *chip; }; @@ -127,8 +128,14 @@ static int exynos_dwmmc_set_sclk(struct dwmci_host *host, unsigned long rate) static int exynos_dwmci_clksel(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); + u32 timing; - dwmci_writel(host, priv->chip->clksel, priv->sdr_timing); + if (host->mmc->selected_mode == MMC_DDR_52) + timing = priv->ddr_timing; + else + timing = priv->sdr_timing; + + dwmci_writel(host, priv->chip->clksel, timing); return 0; } @@ -305,6 +312,17 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) priv->sdr_timing = DWMMC_MMC2_SDR_TIMING_VAL; } + err = dev_read_u32_array(dev, "samsung,dw-mshc-ddr-timing", timing, 2); + if (err) { + debug("DWMMC%d: Can't get ddr-timings, using sdr-timings\n", + host->dev_index); + priv->ddr_timing = priv->sdr_timing; + } else { + priv->ddr_timing = DWMCI_SET_SAMPLE_CLK(timing[0]) | + DWMCI_SET_DRV_CLK(timing[1]) | + DWMCI_SET_DIV_RATIO(div); + } + host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); host->bus_hz = dev_read_u32_default(dev, "clock-frequency", 0); From patchwork Thu Jul 25 20:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814407 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567614wrn; Thu, 25 Jul 2024 13:50:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWKzxrt1r43fmL1EAkov+dBK+V5K5yIk1lQ7pUUYwA22RcEaGVzHIFIFDvdlhrmRjZX/ZBQXRUrFUWJINObHKuK X-Google-Smtp-Source: AGHT+IEgcnUe9P3mDoctlsZjWptIb3YG1nMEQLoLrRRiWZ8wz2a9Q5wTqF5nFNgxAxv35wwQbMpT X-Received: by 2002:a2e:959a:0:b0:2f0:20cd:35fc with SMTP id 38308e7fff4ca-2f039c517e9mr28001361fa.7.1721940646075; Thu, 25 Jul 2024 13:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940646; cv=none; d=google.com; s=arc-20160816; b=SHVV/azhqj0K7ddB3QElDSVEqzuPmGryWlxHZF2ZLhnjVCaW+TjOEeBH3nf+TkrNJH ZqhiGaM8QdOd4SybnjTEs8YYyrIgJ0qfJxaD7nr7WcWzpli7ALUhmzFYNpERowvb+KVQ pxV+sU5uyfbJf/PTEdVfEXNR22KbeyeA0ydInvTw7hZb6tlXSHnykTemlXHATCPdBIdd az9lJibIKyhEqgpRfxgmG2rtMKanCSTIIhx/nOBsZfQynN4bY4/OZOXxXpjB+xIp/fze X/30zCmg/eH1EBvcdeuJyF1hIGjrW6iONTiva7YJfKjxsd8UBSUYXI6QRHI7Cck4b62s 8naw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dYl84zpmq8oB0F/2M/jvoXCLKz/Vg/dfNowtvf55vCo=; fh=HLrvRTVfMc3cpAcGTZxRkgE3RaNTPwzrYqWzAOaIc3w=; b=YZaRE6gKzy1/yhAZK8W7PAUL66Py9KAuHq2U1MHwL55tsWc2bkpgswOSL9jb6IfTGC Mrw8Tgo0sPlXbvwNTJNB0tk8mhfBz8mO+d2J1YHMliS1iHysZAcQvq2f26W6qKSu4K+K 5eoSMAu3viwST+NEtWhjE4nGLiBWgvUwbSPo3pE9Y8YjLV4JVP/H5S/kHFqfA4IBSsux 0gwedc66lHFcyUBkI2pyxuK/5uLQ8THTiHeKXhwtmaOwZxHytuRE8uwre2V4mXeZHMfs Sd5VlZ7ipdBZU890b8W6UrN3kpK+vO07tAfJAPbUJrURqlFjwrK8hoDRnDQP7CMmkfzx 2TRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yTpH8G+E; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d1698f5si6079571fa.489.2024.07.25.13.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yTpH8G+E; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10221887BE; Thu, 25 Jul 2024 22:45:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="yTpH8G+E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E1CC988755; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B59FC886BB for ; Thu, 25 Jul 2024 22:45:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5ce74defe41so224066eaf.0 for ; Thu, 25 Jul 2024 13:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940343; x=1722545143; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dYl84zpmq8oB0F/2M/jvoXCLKz/Vg/dfNowtvf55vCo=; b=yTpH8G+Ehki1WHHN32LCvWLv9RdhhsJyZG2MeryHnLxk02CQwSYXmG3+ICEBsStFl1 m9NPNpF2dRV+TYbeXb10ge82ZgvSxX0jEvTB05L0qwm6aXQtlMzD9nKrdLirv8ij9Hrh 8ZfZjoBtWQBfgEsPqDOzcfoWZAIbg4weO4FwDec+oLPB3VhQylolJWhU+/Z8zE3aSy+9 YhTc82Wzc2Yi8HbJpM/XMcOwnCiRo1ouCFTHRPwEr+ne8IfxGtr1iiV6ghslFhKPbNVl t0a+T+42dSVhJCNgNWKTijtJkhP7kSSc0+PZIYFs4hrbHyzK63OwqnWN5flz2nlJVJZB r7Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940343; x=1722545143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dYl84zpmq8oB0F/2M/jvoXCLKz/Vg/dfNowtvf55vCo=; b=X0as0SXDS5nV4PZ8kLnpjdk2Vy823SxRtP/EvZRU6+Pw2mM0Ve6dk76ILolZHz8IGT hzx6hfb1Oh848tdsyOLqRbZ140F07a1xsVbd2URrYameKWoBQxkSItoVBPiEfLezVpML LDW9kX6Ey7piFokugY9zQ7aEdHxeTyQJN9B6g/sxA6F1KjTM9zst8ZiUGnUz0fTMkYxU 9RuTA7DHfWjlS6sexG1eUlZScNh2CshLN3y3SMNydBIfqmX6imHU4wgqlxh8DijWyJ5G zcAz2f/PJA/GGoWe5T4BHuGYAZ51XyAn7t4HPww4XbE6aGH3j6vh9aLAvOSUJ7686nQe koJQ== X-Forwarded-Encrypted: i=1; AJvYcCVGmk0r7hEaGf1q2qsVawM38GXoi/nzGbcZ/UZlZKl0uDrFPI2bIrZPECK5qCZrlmAtHYJBf0Xai1NrrwLWQspUzyiwrg== X-Gm-Message-State: AOJu0YzNsHB/hK4ht+VCuQNbigNsGX+C4aX3vslSniw/nUl54z93q2Lx CI6lkv1qVYgEUhppGJ0ETybuOB21ngFGCb6zqe74EfJtfpRxUTjmfSkeLftAqE8= X-Received: by 2002:a05:6820:4b83:b0:5ce:a225:cbb2 with SMTP id 006d021491bc7-5d5b3b4943emr3901652eaf.1.1721940343498; Thu, 25 Jul 2024 13:45:43 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b346db58sm233296eaf.4.2024.07.25.13.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:43 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 30/38] mmc: exynos_dw_mmc: Set requested freq in get_mmc_clk() callback Date: Thu, 25 Jul 2024 15:45:12 -0500 Message-Id: <20240725204520.18134-31-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean By now exynos_dw_mmc driver was relying on the correct CIU clock frequency being set on driver init. But dw_mmc core is actually trying to change CIU clock rate dynamically, on init and in set_ios() callback, which it's requesting via host->get_mmc_clk() callback (the name is misleading: although it's called "get_mmc_clk()", it can actually request both get and set operations). Implement setting the requested rate for CIU clock in Exynos driver to achieve the correct dw_mmc core driver operation at all times. DDR mode requires the clock to be twice as fast (when 8 bit bus is used), so handle this too, to make DDR function properly. This change makes the eMMC throughput on E850-96 board twice as fast. That's because "clock-frequency" is set to 800 MHz in E850-96 device tree, but for DDR52 mode it should be 416 MHz (and TRM states it should be 400 MHz for DDR50/8bit mode). The dw_mmc core is requesting 52 MHz bus_hz for DDR52 mode, and DDR+8bit mode means it should be x2 fast, so: f_ciu = 2 * ciu_div * f_bus = 2 * 4 * 52e6 = 416 MHz, where f_ciu - freq of clock fed to DW MMC block from CMU (SDCLKIN), Hz f_bus - freq of clock fed to the card (CCLKIN), Hz ciu_div - value of internal divider (in DW MMC block). Another way to work that around would be overriding the "clock-frequency" property in corresponding dts. But setting the clock frequency dynamically as it's done here looks much neater. This implementation follows what's done in Linux kernel dw_mmc-exynos driver in .set_ios() callback for MMC_TIMING_MMC_DDR52 case. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 32f3ea168b6c..ee3ae9f5e650 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -169,7 +169,17 @@ unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) u8 clk_div; int err; + /* Should be double rate for DDR mode */ + if (host->mmc->selected_mode == MMC_DDR_52 && host->mmc->bus_width == 8) + freq *= 2; + clk_div = exynos_dwmmc_get_ciu_div(host); + err = exynos_dwmmc_set_sclk(host, freq * clk_div); + if (err) { + printf("DWMMC%d: failed to set clock rate (%d); " + "continue anyway\n", host->dev_index, err); + } + err = exynos_dwmmc_get_sclk(host, &sclk); if (err) { printf("DWMMC%d: failed to get clock rate (%d)\n", From patchwork Thu Jul 25 20:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814408 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567655wrn; Thu, 25 Jul 2024 13:50:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFFHM8lwCf4vYcOFV5s3qBV2hELCxwY8i05AmXisMPyJm0ZtiehrubtONmuIbIQmxhMf3o3Isus1RgaChoNp5M X-Google-Smtp-Source: AGHT+IFmke5Xd/SYGn9brJegBiZHp5DerQEK8koaDC/OcBpUPf4HwCJYJiOTLQ/0aBTFYs3604XH X-Received: by 2002:a2e:87d3:0:b0:2ef:27ab:40e6 with SMTP id 38308e7fff4ca-2f039e14a53mr26742441fa.49.1721940655547; Thu, 25 Jul 2024 13:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940655; cv=none; d=google.com; s=arc-20160816; b=ET+JiNJUFAXRTahJvycPt9a0jTI0q5LAZy/yfIQO32TXNvkhAd5J4vXDgPmZz2T3M7 D2Ya9Bov/EdjGimAR3PQmSyyaRKP0PvIVx59eKMl21bTDvPA5b5Q//23ZVcDRaf6ZpfM Jkcs8hCrEtoencH+78UdkGGAbdwUfodFDDKSL+9s1kCgr4TaosxIdc5yrEv0dnTck7Ws +BoRkMpPM7ns/w87QjzaMmeSMERum4AIgFjvzZ0fpIL4Mud/WXmzAVh3ml3C+TmbFokv qAiQ6iKrUio9xn4KJQAEKGxA07YrzecuDuNPpE34IxAawYFhewqw09ptOTMSYNeJQPEk QgFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=//uH7yJGSDY8rN70UBA8TlyadKbabT684utf6tf0WQs=; fh=7uV3t3mvWKeWVZfXpiMdD+hqTvqEo4d11c0pul09fqs=; b=XW/ftmAS9+/sQunjRCAaW6Jpjhd3OKJcafOu4ZwC3niFEqe/b993lB+xl9HIo+mIFm fav66sMlMy8747OOHu1O7vtby1tlg2uTemXVkckBxPDayI7q5gOrUBIh26nkqLK1dCwI p7dktpZdNDtPWcK/t/o37zJs5EiOF3oCLQncJzPdvHeSFKfALCfOiWlPpJsmpKO8IuX/ TuLC6HNl3LZP6mo2+HyHrj90j3cXHHXFCS8LZY4BOj8Kr7CyLl8B/Evt805FHuhKqmi7 JavrFFH3FRIPo1WxuJlOlbhvDCIgXR8GtUCMvRxmwSWSFuBCVpvKZD9r3b2k1zz5/nPv IFJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bF7YsR1U; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d0c1135si5864221fa.192.2024.07.25.13.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bF7YsR1U; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6669F887D2; Thu, 25 Jul 2024 22:45:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bF7YsR1U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D6BB887BE; Thu, 25 Jul 2024 22:45:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 62D12886FF for ; Thu, 25 Jul 2024 22:45:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-708adad61f8so197704a34.1 for ; Thu, 25 Jul 2024 13:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940344; x=1722545144; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=//uH7yJGSDY8rN70UBA8TlyadKbabT684utf6tf0WQs=; b=bF7YsR1UmUiLxBRCEkG94yMLxDlFdXkqYqr/0MB5zOq8IjB6fvFBGmHvcHHE2guolf /80+h2tczGOgA6wVv27S7GFgouDOoDI/Ds0yYX4XhFPAtKY2kwVGXTS8Vh0Q0DZnd7KF 7ZlTpn1Gw3nTQiePXMWeSjoLU9VRG3yLwJ8ryO3rm9N25dGyHdUY6c734/Gec1bFtZ3I vxyK3FRvTwLd8Yi60hRC77r0EkRFiOwE9E8ZxCi9XQg/0Q7djgTFHFlw6MZUZtFth9kS n6Wz4hIjw1qHAXF3fCOUzOKRk5hukRgX8sLsbs6Lg920ekfSAvtNYtlOHEBps4MX4FQ7 02SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940344; x=1722545144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=//uH7yJGSDY8rN70UBA8TlyadKbabT684utf6tf0WQs=; b=mOmvoatxQZKhKDJ2llMEcF7J+FmajeBnQ5ovtqQbbcQUDXiYy++cbeDR19r8FxdccF qJEnn7wwI2IhYY3XdPrwcdOuIXwCEVYobI5UixE93yik14unoCnSXef5um35QYo3AVp+ GEHiaRdYlPr2Jx9WgqADdH05pIr0dBIwWfPEU8BnRGKeyUsMrYAjy0DRKQDSbsGyF/+Z zFsWNFd1pevUXPay/o3iyoZkUU/g0Ywe/2thMDpgkYGkQMJMODqFLHA6Afw9xKJ7ADLR afGUrDRf6SjVOq+MqGfdIZTmw8HLa7EhbOqmSVYrQD5h6zB00zxM6nBuyYqiyJreqwAx yctw== X-Forwarded-Encrypted: i=1; AJvYcCVjGG4cystOVIq0ijeLWgadFxQ6Vo1unWZzH/tHcoCqXxVFd90S2DCTWHeQA0XQtCpGQ0IHpDiZQW3y0AMXE+4ETExkTQ== X-Gm-Message-State: AOJu0YwQ+lwN5QBCBEl3OR8nNEZBspM63bHFtEKsZaRSaoJi4mB2qrSw 1TVzNCaXbekM/8tKsttzxnzX8/0pUaSxnrcntBzM8taVr3cmOkj8kg9vQWsQ6/A= X-Received: by 2002:a05:6830:6005:b0:703:7821:da7 with SMTP id 46e09a7af769-709324c47demr3979632a34.25.1721940344174; Thu, 25 Jul 2024 13:45:44 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930705e89sm453505a34.18.2024.07.25.13.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:43 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 31/38] mmc: exynos_dw_mmc: Add support for ARM64 Exynos chips Date: Thu, 25 Jul 2024 15:45:13 -0500 Message-Id: <20240725204520.18134-32-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add the compatible entry and corresponding chip data for Exynos7 compatible chips, which covers modern ARM64 based Exynos chips. They have some differences w.r.t. old ARM32 Exynos chips: - CLKSEL register offset is different - 64-bit IDMAC descriptor and 64-bit IDMAC registers are used (implemented in dw_mmc core driver) In terms of the driver implementation, the CIU clock is obtained via CCF framework (as opposed to ad-hoc clock driver implementation for ARM32 chips). Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) arch/arm/mach-exynos/include/mach/dwmmc.h | 1 + drivers/mmc/exynos_dw_mmc.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/mach-exynos/include/mach/dwmmc.h b/arch/arm/mach-exynos/include/mach/dwmmc.h index 811e9a04c6e3..7cb71be0d9fd 100644 --- a/arch/arm/mach-exynos/include/mach/dwmmc.h +++ b/arch/arm/mach-exynos/include/mach/dwmmc.h @@ -8,6 +8,7 @@ #define __ASM_ARM_ARCH_DWMMC_H #define DWMCI_CLKSEL 0x09C +#define DWMCI_CLKSEL64 0x0a8 #define DWMCI_SET_SAMPLE_CLK(x) (x) #define DWMCI_SET_DRV_CLK(x) ((x) << 16) #define DWMCI_SET_DIV_RATIO(x) ((x) << 24) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index ee3ae9f5e650..29241edf7915 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -385,6 +385,11 @@ static const struct exynos_dwmmc_variant exynos5_drv_data = { #endif }; +static const struct exynos_dwmmc_variant exynos7_smu_drv_data = { + .clksel = DWMCI_CLKSEL64, + .quirks = DWMCI_QUIRK_DISABLE_SMU, +}; + static const struct udevice_id exynos_dwmmc_ids[] = { { .compatible = "samsung,exynos4412-dw-mshc", @@ -392,6 +397,9 @@ static const struct udevice_id exynos_dwmmc_ids[] = { }, { .compatible = "samsung,exynos-dwmmc", .data = (ulong)&exynos5_drv_data, + }, { + .compatible = "samsung,exynos7-dw-mshc-smu", + .data = (ulong)&exynos7_smu_drv_data, }, { } }; From patchwork Thu Jul 25 20:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814409 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567693wrn; Thu, 25 Jul 2024 13:51:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUoqVUQQqQJPEBuW+KHbTsIsO2DLSMj6Z5Pe7eNF8+ATr7iqBEoqhVfxSUOzjT0SDg/KD+2wLPPU+20U+zOHJS6 X-Google-Smtp-Source: AGHT+IHo0mMgBUYM36UbibYjEadhCS41LG/EXWJENNNEMMKTnDieSTLH0dj1MWYRli+Jkg6nQpw7 X-Received: by 2002:a2e:b058:0:b0:2ef:26ec:44ea with SMTP id 38308e7fff4ca-2f03dbe9478mr21562431fa.39.1721940665790; Thu, 25 Jul 2024 13:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940665; cv=none; d=google.com; s=arc-20160816; b=zs0rbujpoYcaBaiPbR7PkEOTB1xS1wJmu2dk5iWozwJKrMrOer4vUkFpE3dAYRgn2A z4l4C8loqwHE32gFlAO1nfijyTQWy5kpBhtcQrReac69NKG2qyrUiGqPUurdGEMtLasE xVCDR01D/gLdu1+qBSoH7afU8k+xqCzmM4s9pqkl/lbZuOdlN7z4s0yNiXZQD4snZ6p0 8DnSv9sZapH8qV984BjkLhyy0PP/cpwU9oCd1ZrxAhVQvwXbEUt9r8qkmbzpFsZAkY9A EDVsAIAMAAswP2dAcvwKnz773RRfEYGWWOrROd8Ahd42ddbaUXcZZv7Bindk+T5JyT/A Af4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kD77CVfMk1cUO1TrAtNGPeBZuXDZ/fZHKeorr0i7dQY=; fh=Rl4+viPwhTZistbOYP/3i24+h7A34IGp4yesHhay4Yo=; b=F3pzEJ9PsysltEJOv6PJ0j/P4KVtYGPTZ5Wcp5R1nCgYyn4GUxNqZyRTR+1OykPnti cpiBKybfiNsFV9GGRT+zEgoll9f7Yt95cYn8ALzv5iLP2wrrt1yN4+niWp5q9wqisnkD Ni6KDN1kzwRX+SZ4ju7Ez0z0BdwGlgOTdDFJzWDtv0SDf5YSVB7klX/J+4iwwk7CABts 1TnPsbg/e1su6DVsCZXI9wIyGrHpXPaFZ3VRlwYlaaQGpCIHTev6r0+1wdRa0M0+MeQN b5TQEd0ywExwTmtTTVKKVrqbLas9tH1lXSXCO6OwZAIHy17u97iQkMh3+MCKvYzjmIfA Ddsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DsRg6ywl; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d14abadsi6166561fa.247.2024.07.25.13.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DsRg6ywl; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B71CC887E3; Thu, 25 Jul 2024 22:45:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DsRg6ywl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44316886F0; Thu, 25 Jul 2024 22:45:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1441088722 for ; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-70936061d0dso201434a34.2 for ; Thu, 25 Jul 2024 13:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940345; x=1722545145; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kD77CVfMk1cUO1TrAtNGPeBZuXDZ/fZHKeorr0i7dQY=; b=DsRg6ywlRVMi7HRbe8WSxZktz+igo0toTP0w1Cv2g76t6mLJTNt30Wb6U7bsj8sQVx QQOxg3GNa2Nf32xcK76dgqZll9Sz2LDhrKjX+Bh1GNrjFGDn9Inzjb3ALCrz98iLU0rv UTIID+wtiqrMpsc4qAMWf2POOwLqYzzTPykmZCAjA1LF6/epvstAFM6nuwVa2Ku06KAs DuMi1XWDYzYeRixlnfBfhzGBgwEDP93CB92Ud1cBZPzTsOEY7HhpLouHz0D23/8b8kio uPKpWG9JmfikjIpnJqki2jDNTL9ZFgSTWXMvSgZcZJVVdU2rjC/rc2Zp8qTp6cByicxC aqWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940345; x=1722545145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kD77CVfMk1cUO1TrAtNGPeBZuXDZ/fZHKeorr0i7dQY=; b=UWfV1WeFsPhVY4o9MhfreqwGauD3LIDkiSC4rO/NlrEiGfCt6ST7gB4cXZwgWhoeoC bx7OMgNItVOUP38EKy8s3HZMIzoPiyc5PR1RC+5UA0JAWd6fyam7iMR18DAmqMjs9SP9 jg/35ByGRCRCMEpIC0uKcRKCnb0k7KNMy1k1HM9Qgip7eRkUHxaDbVFrKluHoJUb9Wi7 y/MXsMQHgK1OkWr3+VAKDEs6d0nc4D65K37fEGnwfpsoOzLBfBySsDMxtesenFWeCOlQ KlPXpbKD9KozozTFf7O0JzPGMGy5xZu76QcFRINPeDNGCE3xOjH+sBln/vy/0NRxmOEU oeGg== X-Forwarded-Encrypted: i=1; AJvYcCUDTPSffpdkqjB5k+Igv4A8cSqoydZUHrOg57AGjik+1Drrf0XeyWl7b1ksJiMZeLCzyVR+O6aoVKlU2IUC3Ct2ByBSaQ== X-Gm-Message-State: AOJu0YzlXtVymfSln9R87lvHOT1NkuI3ScZEOj0f1ZeBOKh5yQ8Me78Z JGtgjFO+tTRjE5hoLJZz4HMJZJESUygeWaf0IacpxmrWrRLvn94dGIxWR6har98= X-Received: by 2002:a05:6830:6217:b0:700:d506:cfe9 with SMTP id 46e09a7af769-7093223d036mr4184298a34.19.1721940344826; Thu, 25 Jul 2024 13:45:44 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930729601sm463428a34.40.2024.07.25.13.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:44 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 32/38] mmc: exynos_dw_mmc: Pull all init code into probe function Date: Thu, 25 Jul 2024 15:45:14 -0500 Message-Id: <20240725204520.18134-33-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean There is no logical sense to split the initialization code between multiple functions. Pull both do_dwmci_init() and exynos_dwmci_core_init() into exynos_dwmmc_probe() to make the code more simple and obvious. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 86 +++++++++++++++---------------------- 1 file changed, 35 insertions(+), 51 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 29241edf7915..41fb32c579ef 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -209,55 +209,6 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) exynos_dwmci_clksel(host); } -static int exynos_dwmci_core_init(struct dwmci_host *host) -{ - unsigned long freq; - int err; - - if (host->bus_hz) - freq = host->bus_hz; - else - freq = DWMMC_MAX_FREQ; - - err = exynos_dwmmc_set_sclk(host, freq); - if (err) { - printf("DWMMC%d: failed to set clock rate on probe (%d); " - "continue anyway\n", host->dev_index, err); - } - - host->name = "EXYNOS DWMMC"; - host->board_init = exynos_dwmci_board_init; - host->caps = MMC_MODE_DDR_52MHz; - host->clksel = exynos_dwmci_clksel; - host->get_mmc_clk = exynos_dwmci_get_clk; - -#ifndef CONFIG_DM_MMC - /* Add the mmc channel to be registered with mmc core */ - if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { - printf("DWMMC%d registration failed\n", host->dev_index); - return -1; - } -#endif - - return 0; -} - -static int do_dwmci_init(struct dwmci_host *host) -{ -#ifdef CONFIG_CPU_V7A - int flag, err; - - flag = host->buswidth == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; - err = exynos_pinmux_config(host->dev_id, flag); - if (err) { - printf("DWMMC%d not configure\n", host->dev_index); - return err; - } -#endif - - return exynos_dwmci_core_init(host); -} - #ifdef CONFIG_DM_MMC static int exynos_dwmmc_of_to_plat(struct udevice *dev) { @@ -345,6 +296,7 @@ static int exynos_dwmmc_probe(struct udevice *dev) struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; + unsigned long freq; int err; #ifndef CONFIG_CPU_V7A @@ -353,9 +305,41 @@ static int exynos_dwmmc_probe(struct udevice *dev) return err; #endif - err = do_dwmci_init(host); - if (err) +#ifdef CONFIG_CPU_V7A + int flag; + + flag = host->buswidth == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; + err = exynos_pinmux_config(host->dev_id, flag); + if (err) { + printf("DWMMC%d not configure\n", host->dev_index); return err; + } +#endif + + if (host->bus_hz) + freq = host->bus_hz; + else + freq = DWMMC_MAX_FREQ; + + err = exynos_dwmmc_set_sclk(host, freq); + if (err) { + printf("DWMMC%d: failed to set clock rate on probe (%d); " + "continue anyway\n", host->dev_index, err); + } + + host->name = "EXYNOS DWMMC"; + host->board_init = exynos_dwmci_board_init; + host->caps = MMC_MODE_DDR_52MHz; + host->clksel = exynos_dwmci_clksel; + host->get_mmc_clk = exynos_dwmci_get_clk; + +#ifndef CONFIG_DM_MMC + /* Add the mmc channel to be registered with mmc core */ + if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { + printf("DWMMC%d registration failed\n", host->dev_index); + return -1; + } +#endif dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); host->mmc = &plat->mmc; From patchwork Thu Jul 25 20:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814410 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567740wrn; Thu, 25 Jul 2024 13:51:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIW7K6cXB2df44s+EUlloU38yFgjfwB8HK63Z0GrBM6SBZtUmiD8Xz8Z/tMw7eSxrbqWK/rvUEvnsOgvy/VbSu X-Google-Smtp-Source: AGHT+IEvm/MPHCz7XWnyOyxaOYgeh7Wszyrz3CURCwjOqyBp1FMn8M4PZrIpbRQCbY/fMtZZyB9m X-Received: by 2002:a2e:bc25:0:b0:2ef:2638:48cd with SMTP id 38308e7fff4ca-2f039dbab7fmr32850281fa.30.1721940675850; Thu, 25 Jul 2024 13:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940675; cv=none; d=google.com; s=arc-20160816; b=uV1/iAe6xsCd4A1ij69vbpnrvd9pIoUZT5UWuhqqSRgbnRzZT4Q1IDiJOsvFMoN1Hl Axf08Di0uEVdHeobxmjFquy16gW3Lt4ltdFEzWtRycd3pEYBoiEH7pzmeTEKyhUNgh9q 4EYL6EFFOPfpPIpPIATy+P+IJT1+ZtdBWpoQR7qnEO715ALFVQvD2VhIvdWT87H5BgAx 8LiVPraBAxR5zvdXxPMQHa37z3L/6XUWAKvxWbQH7XcP1k3Lh5F0ub4hW42VA1UfmTZo eMcDqhuDQHShjqMA0kOk8AgneQugNu3zbWJNhHNaAXnGX1c22x6aRzMmN0TrghC4AIQr Wd5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; fh=Glaeo6dkD4kxCDpm0MiIA8BqF1Lm8ZD6EYKrbuWnPt4=; b=YIe1eJl/NQY/UZXIU/wECiZyxg1iXs+H5RzxVgU0V5zCNVzJBCmdkM4CYVzH35vQLz A4grVqIemRuHr3jDRxuo3tS3XxFTn0FontNRnFLaCp6ICqq87EzbmF/ISMdhUgYoJgih sjJ3wWyi1nda6LkqbpjvzbOMOK7sIjYT3UwMH36iDFWt4f2NTZYyftLfj1hKb8DKqn7j Vt+L15TaxQzYiE3AXzCKcWD4cqh3UszGGga1Tdu7j404EGjhZx6ieFS+rG7D6tqvoX2q jes7u0yTDylng8H5wCSlNYzq5FDIbvaOPrilELGrkwo8I4mBFTVoLg16nN7B4bBrEYHk TR0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o45cOfVQ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d0bbdcasi6319351fa.151.2024.07.25.13.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o45cOfVQ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1492F887F5; Thu, 25 Jul 2024 22:45:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="o45cOfVQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D16188585; Thu, 25 Jul 2024 22:45:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A3E5D8875B for ; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7037c464792so175957a34.2 for ; Thu, 25 Jul 2024 13:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940345; x=1722545145; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; b=o45cOfVQ4aQmmZ+soFaSMDqI84b61948X/dmAnmzIAqJjzSHaLZ8NEW58Boyssw2kS bjt9sOxpki7+EbcIP5qOBT0klcxnyGyT3xpVoJhafrTDfBeQ+iFClG5UQiFbOML3aw00 edFHCc3WZ0UfjfMCPrQpociZjQn1oi5Y9S4q9RaprqSuomCS2i0JdMl9/d8lT9afYda8 2X7XvX3FvyiEGS2WxVwBY+gHE2WEylH7RMrwJXXiLrLZWQ28TTAQwvAfFrXaHePIZuQR i8seN6Z7OD0a+THI1sBq75rVFtOh2biEQQbtDGqL0KL/VoNaVtAr27vKpdFE0GwlT/Y6 mM6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940345; x=1722545145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+XUQL7vLaVVGvE2U+OSGmb2jWwlqvKIeMENURlbclfE=; b=JvAKU736FdYmSbfGWDbMFhGGgkL/zivmrbN7na2bXHjTb6ZcZKcY+WmTUa7th3fb/i wvg9DXsNlWYrBcXZpARynrkPuhr/JuvY5sWOkwz6myLXCwEV5Y/yXVlUZ0bZO4W5azNM Z5TG3DQMGgRfsjuDgFACqKEZMRxPTG3mzAvcmjtC/E7zQvrrmt2ZKW1dPKlrRZeJoaPF 1hYH+dMcuOPUhRF3qQ27e1R0jztoayJWeRvyj8+boaUUp16Y/xnD6SQ9/UXHjLArX45Z iUucWnBcn9aZIs6qoCMVb/mA5e+fUroBSOgXWdhd8aQY2c9x3rwamsJpfgaetV2dZI3O TAAw== X-Forwarded-Encrypted: i=1; AJvYcCWj+rAaHlZbYLO9U8Xo3NhOuKiIo9/2iAmY6W2Zb2fcnxAPfhOPqX4YFYrswPExJobP2mVq2SHtAim8iZOe94x3WODKbg== X-Gm-Message-State: AOJu0YxtEkweo63xiYm072MYSpZqsr8Y3rEfrsdNlnGgotbd/Ubufz2G SsHnlpdtmz/HUFvcplmM9G0uX6eT6k8r9OFe00mhr37yfaZqQD5RL/e5MK3zrWQ= X-Received: by 2002:a05:6830:6119:b0:703:6d44:41a5 with SMTP id 46e09a7af769-7093210e9aamr3676879a34.6.1721940345488; Thu, 25 Jul 2024 13:45:45 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093071e976sm448354a34.34.2024.07.25.13.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:45 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 33/38] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Thu, 25 Jul 2024 15:45:15 -0500 Message-Id: <20240725204520.18134-34-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean add_dwmci() is already calling dwmci_setup_cfg() internally, there is no needed to call dwmci_setup_cfg() again in case when add_dwmci() is used (for non-DM cases). Fix it by calling dwmci_setup_cfg() only in DM cases, when add_dwmci() wasn't called. Also, this assignment: host->mmc = &plat->mmc; is wrong in non-DM case when add_dwmci() was called, as it's creating mmc object internally. Fix that by pulling that assignment into DM case, when add_dwmci() isn't called. While at it, add also this missing assignment: host->mmc->dev = dev; Fixes: 3537ee879e04 ("mmc: exynos_dw_mmc: support the Driver mode for Exynos") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 41fb32c579ef..43111b749a6b 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -333,19 +333,21 @@ static int exynos_dwmmc_probe(struct udevice *dev) host->clksel = exynos_dwmci_clksel; host->get_mmc_clk = exynos_dwmci_get_clk; -#ifndef CONFIG_DM_MMC - /* Add the mmc channel to be registered with mmc core */ - if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { +#ifdef CONFIG_BLK + dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); + host->mmc = &plat->mmc; +#else + err = add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); + if (err) { printf("DWMMC%d registration failed\n", host->dev_index); - return -1; + return err; } #endif - dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); - host->mmc = &plat->mmc; host->mmc->priv = &priv->host; - host->priv = dev; upriv->mmc = host->mmc; + host->mmc->dev = dev; + host->priv = dev; return dwmci_probe(dev); } From patchwork Thu Jul 25 20:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814411 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567778wrn; Thu, 25 Jul 2024 13:51:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUSAkyMM72TFocbjXctx5u6b4MR1IaBaGM0a0DiligZsgq7c0itrMG5LO5l6wylU+vu9ttjhwBi7vfR43RrywfH X-Google-Smtp-Source: AGHT+IGgn73hDzRmXvv08YqAq5klw3kdTYRXwiin2eKi2qFz90o4Gs64k2UAJ6tmxPS/T9sskIZc X-Received: by 2002:a19:f70d:0:b0:52c:e0fb:92c0 with SMTP id 2adb3069b0e04-52fd60439a8mr1768211e87.34.1721940685682; Thu, 25 Jul 2024 13:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940685; cv=none; d=google.com; s=arc-20160816; b=SwbRzT4DyDre/WyWD4sfckDgm6T3lSnJNlixWyYjO3wk/PKaPzMIVccJtGgbs5FghR hyt94zPeKhp3IaWlANANCLWCFXkk4TzFMwe9NmIJAZ8lkIG79B3JlxNLFlVyubhhJlqI HppfGwH1xEOLDnzKS+h66YMiKQxkiZFdMimWnyhzS19wutmvu6+Sbo8PSSeFWUUVyYek Tup6+ldOQYrrCgJuGENyYw1KWZQb/EgBj/lG5/Jy/8DGfh8o3LDFfrRSqkS2aAJT4xkh ueNamR8+mu9aSK38d0OwgoT1MHUg+z8L7eEIQeAxiH254xZVCAGVwDVdkHMsjky4svzr Y0ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ncm51mb4XPPkXlgtosrF2Gll54fHmWIKTQhB9ftYqo4=; fh=3gLtazIZOp01KCYTYahwU4ng/gBfg9vCb6sqHgVjNjA=; b=WU5b0pEd47shGBYvGG0bEj+GXnHSk0Fqm+LeD9PVuKGfXYnaTlEMi9OcSfzPKnr9ii FRPqcjJjAwfwiMm/pxm3wNQ9IAcvwFdri6brwp5+O4FUO2v788yK+k1Vw8PhJg9NHPHb 4xQvxWpQ/38Ecr1c52dSk+tDu2uPA3YaSLvBsEzR8gEPM+IuwtXkvEDbvrrP9cJFZUW6 IvIQPSAQW+pXFKQ1Y2bZ6z46BwUAxHZFsDwvIEEL4ONqVhdrl8XVrk8+2p9GE49fprS5 aJudHcGC1XLLmNZH+91oJ9PKNX2Dj5sEaM3nX73cIToZU54S6PsrNjpFJCTeQvT7vIiE LRkQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SxUty/Ni"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5c1928dsi673086e87.584.2024.07.25.13.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SxUty/Ni"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F63C88808; Thu, 25 Jul 2024 22:45:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SxUty/Ni"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9CA0B88717; Thu, 25 Jul 2024 22:45:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 68CEA88599 for ; Thu, 25 Jul 2024 22:45:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5d5bb03fe42so162485eaf.3 for ; Thu, 25 Jul 2024 13:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940346; x=1722545146; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ncm51mb4XPPkXlgtosrF2Gll54fHmWIKTQhB9ftYqo4=; b=SxUty/Nin2ZugX+bdWetbR5UYiD3z+ho92B6MwmLn2rCig852fw1KVWGJr+SL11b95 yfABdlgKLyOKF9NV/UNBeFNc1RVkfynrxR/qKUinMgLlLNNLcfWEZRfMjbHBsSjI/sw+ 0uq7dX3YlelgdejNSZ9uW3jG21xO+j2dl7uWGzoI9Z8xmRlX7Nk2M89AG4PhOu+udQg3 DfVFf3ejBAPAzKM+eIj4BUARkV0YyQvg1gT14tKZewCMkEkNu8lB80xfgCSoaZ30vT6A ewkP+YF62RAFuewmexpDj2jh+Yp4fmlvV4nvzSx3vODLa/8ek2shyfTs9FVVIZH3p6yg RHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940346; x=1722545146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ncm51mb4XPPkXlgtosrF2Gll54fHmWIKTQhB9ftYqo4=; b=fY3dugUQkgqUd3IE+ifV0gEj5NB+oLEYjqPYGrt+wN8Gyu/12LxDmP7LUzPBVcfEll FIBHqZVCTMYBpyghC1F/byPG1fAY7N+nahGkYaAat3ZOv9CvkNhV1xnfcCcmj+c3lq1E sYHU232R+4Lz9WBST3WJ6lqZgWyCNyJtQV/VzwrVOow+jYT+EFprGdNhQW2W3WfskPox +FUUgtYnv2jYkiFBjxQuOkmHcy/CkFa490PokxTm3feKT3MODW3+LGKRkYmHJ+/HhrdF IFq0zWwhfFR+aQKi1I4BLxCwI4NQ7SDFMHxMtLb6sq+kQbDalKfjT2WiXq8D6T9a6YDo ASwQ== X-Forwarded-Encrypted: i=1; AJvYcCVjM8qI4VitKW3cM3qNGppIqC2rSHHFvItocLLDTy5PtQ0znN4BgveCrIPrw6iDdkw6ircTv+5ggHdoQaJVmgs2yyjiEw== X-Gm-Message-State: AOJu0Yx4Rvm1cys27lkJOZaOrkYq2kkW68/evXrKfGYWArYehrJrIewU Vk65+QBmB5P/l02Frok1J7G2YQb5obM5c1l9ZLMBvGZ0uF+youSEB4vTOEJS4r0= X-Received: by 2002:a05:6820:1b09:b0:5cf:24e0:b78 with SMTP id 006d021491bc7-5d5adac7d98mr5521860eaf.3.1721940346177; Thu, 25 Jul 2024 13:45:46 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d5b2c639f9sm258109eaf.0.2024.07.25.13.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:45 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 34/38] mmc: exynos_dw_mmc: Use dev->name as driver's displayed name Date: Thu, 25 Jul 2024 15:45:16 -0500 Message-Id: <20240725204520.18134-35-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Reduce U-Boot footprint by reusing dev->name as a driver's displayed name. This changes boot device name (and "mmc info" output) from "EXYNOS DWMMC" to something like "mmc@12100000". Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 43111b749a6b..a9e240fd91d6 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -327,7 +327,7 @@ static int exynos_dwmmc_probe(struct udevice *dev) "continue anyway\n", host->dev_index, err); } - host->name = "EXYNOS DWMMC"; + host->name = dev->name; host->board_init = exynos_dwmci_board_init; host->caps = MMC_MODE_DDR_52MHz; host->clksel = exynos_dwmci_clksel; From patchwork Thu Jul 25 20:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814412 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567823wrn; Thu, 25 Jul 2024 13:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjNABmT0t1KRBROIYJ0rBvzuvCIBPwISdYJTIUKlTDXm/TkuUh1cx3/jMfcyC13Gqtn8o3EdCxDRCB0hsGuXvi X-Google-Smtp-Source: AGHT+IE8R2IoSMprm5dFVdMaexcqb1BoA0WMZzOU8wlD9bkr5kJ1xU/f5lFHxNAC5dKfxSK2Txjv X-Received: by 2002:a05:6512:ba1:b0:52c:dc57:868b with SMTP id 2adb3069b0e04-52fd6029cf7mr2424047e87.13.1721940696162; Thu, 25 Jul 2024 13:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940696; cv=none; d=google.com; s=arc-20160816; b=jqmNrb7soUAIQtGFzEUsQtmY0yKAEWoyQJH75ZK3cQAPrLQq79w4/kpIJG4DM5IlqG KZYBlN5zH8uJfRJ6asVzNPzZpNhsvPxtcNex6LYvJreC1TZRyIYaNN2eQXC4m+ZpBXEq w7ccG+tqTLlA1QOMnrq+QbKBahzQYxLuxI1pFPRJY6hvzHZ1n0aHLqjFzbN1l3pV+p8D cvAkyjuGX8bjmSN4KcFZYh/Aa+ef9DmZWWpGEabMkKmriGdLRG+0c+pBTN9jjTqQS72J FK9SK8OFuydo0al/4atB5FzpC2eYlsln1S6zEwNismjE2oJkKLWw+0WSh9Z0Y75ThRLc jdJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2Ix4IK7FRWBNKNDuDV+PLj0LmMNAY8rZDUVuOqiCEbI=; fh=QQ9TO9RX6XIRwefh2k4fOBveVZB2eSdkvZQK4SUaQpA=; b=dtxmSdXqECBaO0Z02cpSPOcNUSV2v8Guu8qjjd/nk9hsi8BdVyl3QBp6LW5jDuuc6K txC6rwNwzuePSTRhkJ5EB65dXu7ErxYLW877x6LCVoQX6He89ndshgrkgVSyyODMgsUQ r8v1aNZzgr4/bWSt7AktUrStXkYwK2uQjNGq5rwOW63LH908+3eJ9GNsryO8iEBoTuo/ d3Gc1/PGW6iqnPyhuR8/6oO50I/Pbk2uFBNWo53Lxce+M94tAmDk7zLZgKEs/f52fFLT 6Ssrg7m1AG0e8rbJ1B71XWt42IiVVSQXnJaZLFgXeh44ts9DLMCRFB+SKsJMHJ7mCVOF T/YQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9iu748L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfb701si647599e87.350.2024.07.25.13.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9iu748L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BAB058883F; Thu, 25 Jul 2024 22:45:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="q9iu748L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3B11188599; Thu, 25 Jul 2024 22:45:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 171A18863E for ; Thu, 25 Jul 2024 22:45:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3db13410adfso169867b6e.2 for ; Thu, 25 Jul 2024 13:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940347; x=1722545147; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Ix4IK7FRWBNKNDuDV+PLj0LmMNAY8rZDUVuOqiCEbI=; b=q9iu748LiMSpOACbX+IUArfRz0+IhfNyBcRmAd1T4F4uPoMF9Je9l2sM9LamnJk6OL 4MkWVv/rxDsQhQEQ0zJeoJdz5zCH5UFdfIYZDqAiEmcRjFlG1M5Gfh8gBLpX2vjuABX/ jXXrtDH5pjk0e8UN2+cNmzwUJ86CzFAuxL5Qu1tyPDM1E+l/Ob60Z8Ykc19C0/AXe+JX JwaPW86swK7+UJmEfTOtJx5doZZZLlOCGTnjZeJGupOFcxY3l+d+lw54QhLA6LGDtHuP rfwwtiw6hpnxHC2YE4mocfuFHkOeaS3nAHbqaEulQodSHfBt7HQM6sNKzrv1WTmJwCkh 0m6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940347; x=1722545147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Ix4IK7FRWBNKNDuDV+PLj0LmMNAY8rZDUVuOqiCEbI=; b=dpJ2B0bxhLCX5A0a/hgqWurMPkJoP96pbvA5YTbvFui7JTeoEPp5p6U5EXKIInQ0ep xQTWlHlBxbYoyFCKeFFO3Z2A9zmfq1B0xsbw2gUBDInXocPywamkVcpvMOawJjhUcEN+ YET6RLuuezdKBfYshwS/IbKlhWToJNwY/gSMYSaA9fdqXdyHGoHVSR5kFq9sFwz17nkU xOlvyNAjIZ5oUafYdXALZx+nqESIvzFXKRdVPN3lK0zeekMovwxWfpJ8RLQiqdNg0xP8 pPN7IR9EM248HqmcyTzYkwBvB8IX886yUwVEg3pV++KHw5bp5QuhZNGUImeYoQti4iXq p5zg== X-Forwarded-Encrypted: i=1; AJvYcCWvJW270pqjQKlTeIY4Rt1pbI9jpW/068OHdk8rx0k+mSWjG8RxJhsB1eBnu8jeZQqYjzNXsvafTSGNxnEK/mM+3nbnSw== X-Gm-Message-State: AOJu0YxCApouSJ67J9l7b4cfAFQBOlKR+G+wNQNvWBOcDh+KSZLJCvfp dm9DjGZx+KDWGfnAq4USkdyLL/mgq5ef/SAEjhKILc0arBGaezupzaQkpYTkpPQ= X-Received: by 2002:a05:6808:1597:b0:3d9:38e2:5392 with SMTP id 5614622812f47-3db14183ce5mr3237268b6e.36.1721940346875; Thu, 25 Jul 2024 13:45:46 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db1351d859sm429765b6e.39.2024.07.25.13.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:46 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 35/38] mmc: exynos_dw_mmc: Improve coding style Date: Thu, 25 Jul 2024 15:45:17 -0500 Message-Id: <20240725204520.18134-36-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Fix most of checkpatch warnings and other obvious style issues. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) arch/arm/mach-exynos/include/mach/dwmmc.h | 36 +++++++++++++---------- drivers/mmc/exynos_dw_mmc.c | 26 ++++++---------- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/dwmmc.h b/arch/arm/mach-exynos/include/mach/dwmmc.h index 7cb71be0d9fd..75d84988b7d6 100644 --- a/arch/arm/mach-exynos/include/mach/dwmmc.h +++ b/arch/arm/mach-exynos/include/mach/dwmmc.h @@ -7,24 +7,28 @@ #ifndef __ASM_ARM_ARCH_DWMMC_H #define __ASM_ARM_ARCH_DWMMC_H -#define DWMCI_CLKSEL 0x09C -#define DWMCI_CLKSEL64 0x0a8 -#define DWMCI_SET_SAMPLE_CLK(x) (x) -#define DWMCI_SET_DRV_CLK(x) ((x) << 16) -#define DWMCI_SET_DIV_RATIO(x) ((x) << 24) +#include -#define EMMCP_MPSBEGIN0 0x1200 -#define EMMCP_SEND0 0x1204 -#define EMMCP_CTRL0 0x120C +#define DWMCI_CLKSEL 0x09c +#define DWMCI_CLKSEL64 0x0a8 +#define DWMCI_SET_SAMPLE_CLK(x) (x) +#define DWMCI_SET_DRV_CLK(x) ((x) << 16) +#define DWMCI_SET_DIV_RATIO(x) ((x) << 24) -#define MPSCTRL_SECURE_READ_BIT (0x1<<7) -#define MPSCTRL_SECURE_WRITE_BIT (0x1<<6) -#define MPSCTRL_NON_SECURE_READ_BIT (0x1<<5) -#define MPSCTRL_NON_SECURE_WRITE_BIT (0x1<<4) -#define MPSCTRL_USE_FUSE_KEY (0x1<<3) -#define MPSCTRL_ECB_MODE (0x1<<2) -#define MPSCTRL_ENCRYPTION (0x1<<1) -#define MPSCTRL_VALID (0x1<<0) +/* Protector Register */ +#define DWMCI_EMMCP_BASE 0x1000 +#define EMMCP_MPSBEGIN0 (DWMCI_EMMCP_BASE + 0x0200) +#define EMMCP_SEND0 (DWMCI_EMMCP_BASE + 0x0204) +#define EMMCP_CTRL0 (DWMCI_EMMCP_BASE + 0x020c) + +#define MPSCTRL_SECURE_READ_BIT BIT(7) +#define MPSCTRL_SECURE_WRITE_BIT BIT(6) +#define MPSCTRL_NON_SECURE_READ_BIT BIT(5) +#define MPSCTRL_NON_SECURE_WRITE_BIT BIT(4) +#define MPSCTRL_USE_FUSE_KEY BIT(3) +#define MPSCTRL_ECB_MODE BIT(2) +#define MPSCTRL_ENCRYPTION BIT(1) +#define MPSCTRL_VALID BIT(0) /* CLKSEL Register */ #define DWMCI_DIVRATIO_BIT 24 diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index a9e240fd91d6..c8bf89d6d355 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -45,7 +45,7 @@ struct exynos_dwmmc_variant { u32 quirks; /* quirk flags - see DWMCI_QUIRK_... */ }; -/* Exynos implmentation specific drver private data */ +/* Exynos implementation specific driver private data */ struct dwmci_exynos_priv_data { #ifdef CONFIG_DM_MMC struct dwmci_host host; @@ -121,10 +121,7 @@ static int exynos_dwmmc_set_sclk(struct dwmci_host *host, unsigned long rate) return 0; } -/* - * Function used as callback function to initialise the - * CLKSEL register for every mmc channel. - */ +/* Configure CLKSEL register with chosen timing values */ static int exynos_dwmci_clksel(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); @@ -163,7 +160,7 @@ static u8 exynos_dwmmc_get_ciu_div(struct dwmci_host *host) & DWMCI_DIVRATIO_MASK) + 1; } -unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) +static unsigned int exynos_dwmci_get_clk(struct dwmci_host *host, uint freq) { unsigned long sclk; u8 clk_div; @@ -204,7 +201,6 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID); } - /* Set to timing value at initial time */ if (priv->sdr_timing) exynos_dwmci_clksel(host); } @@ -214,8 +210,8 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) { struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; - int err = 0; u32 div, timing[2]; + int err; priv->chip = (struct exynos_dwmmc_variant *)dev_get_driver_data(dev); @@ -223,9 +219,8 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) const void *blob = gd->fdt_blob; int node = dev_of_offset(dev); - /* Extract device id for each mmc channel */ + /* Obtain device ID for current MMC channel */ host->dev_id = pinmux_decode_periph_id(blob, node); - host->dev_index = dev_read_u32_default(dev, "index", host->dev_id); if (host->dev_index == host->dev_id) host->dev_index = host->dev_id - PERIPH_ID_SDMMC0; @@ -241,10 +236,6 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) host->dev_index = 2; /* SD card */ #endif - /* Get the bus width from the device node (Default is 4bit buswidth) */ - host->buswidth = dev_read_u32_default(dev, "bus-width", 4); - - /* Set the base address from the device node */ host->ioaddr = dev_read_addr_ptr(dev); if (!host->ioaddr) { printf("DWMMC%d: Can't get base address\n", host->dev_index); @@ -255,17 +246,17 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) div = priv->chip->div; else div = dev_read_u32_default(dev, "samsung,dw-mshc-ciu-div", 0); + err = dev_read_u32_array(dev, "samsung,dw-mshc-sdr-timing", timing, 2); if (err) { printf("DWMMC%d: Can't get sdr-timings\n", host->dev_index); return -EINVAL; } - priv->sdr_timing = DWMCI_SET_SAMPLE_CLK(timing[0]) | DWMCI_SET_DRV_CLK(timing[1]) | DWMCI_SET_DIV_RATIO(div); - /* sdr_timing didn't assigned anything, use the default value */ + /* sdr_timing wasn't set, use the default value */ if (!priv->sdr_timing) { if (host->dev_index == 0) priv->sdr_timing = DWMMC_MMC0_SDR_TIMING_VAL; @@ -284,6 +275,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) DWMCI_SET_DIV_RATIO(div); } + host->buswidth = dev_read_u32_default(dev, "bus-width", 4); host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); host->bus_hz = dev_read_u32_default(dev, "clock-frequency", 0); @@ -396,8 +388,8 @@ U_BOOT_DRIVER(exynos_dwmmc_drv) = { .of_match = exynos_dwmmc_ids, .of_to_plat = exynos_dwmmc_of_to_plat, .bind = exynos_dwmmc_bind, - .ops = &dm_dwmci_ops, .probe = exynos_dwmmc_probe, + .ops = &dm_dwmci_ops, .priv_auto = sizeof(struct dwmci_exynos_priv_data), .plat_auto = sizeof(struct exynos_mmc_plat), }; From patchwork Thu Jul 25 20:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814413 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567859wrn; Thu, 25 Jul 2024 13:51:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUtHUnGgVyfezkZ0Xqh5/0dCNrACfEBIBMxiRUi9mPB+NSsJS++1fcPdWte1l6979CuIAHwJN7bqyRdrfJeYfwq X-Google-Smtp-Source: AGHT+IG2h2Knu2DopqI6uqP8N6MyTDDnEDFHOH+fifWazIu3m1hs2GSPX3ImARTtU63JlvKh0H8i X-Received: by 2002:a2e:87d8:0:b0:2ef:2450:81f3 with SMTP id 38308e7fff4ca-2f03db6ce42mr21944421fa.6.1721940707822; Thu, 25 Jul 2024 13:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940707; cv=none; d=google.com; s=arc-20160816; b=LF6AmSRlxpatFnNQ7QS9+LV3HqwOYMLAHHtlMZRFZ22APGsJ0tFkeoJG6FgoVJSK3/ eE3B5zpTUgM3uPIhFFu9DSldvGhQpIinqvY3iQNIwK/TSr2lNzg+Lf0TybbFQb7hXlZi igS5roHBQStEI5Ahn+tt6yEriyuReMnq35hMrlXikxPEqaPMBezZ9cTQUq3YisliZYF2 UO1kpZQYb5FTtRALbpOPmiRgOIkA6JDsoDa/rVsKEYYgrPu6Y+P/LXHudni2q4VRe3U7 6yHsrxp0DyaoZCSrxEjEM6njqUmdF8hTBcmRQSFkv7ImNAeCQzq/mlTdCHnyl0l+3KFN FR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MRWZ3XISpHkNgfnMrf60r5EK2Iftgh+Qw3jGTgAaHvI=; fh=lKAGI6pSrDy9F8fYnxQJLCdA+EQMUm8hAH7FmtMCTr8=; b=PLa41CbeQQuTFHZv2KLJg5nCfaJil1nSTyC7JM52lu5j+vNmb22pTpfpk2AFCHa7Z8 Sk6br406UAO6fpte42XTPQXeOJHBKSwVyYXH1isK0VzzyNKurt7SdN0mm0BhuWdTrc3j VruiKfY13V8HwqlKJnZtiHCyFnX1AtHOvuXSQoJli29ePcxIw37ZwyQ2Kz9ZwRlHGUiA O7vRdYiZ5kB1igWCOLaBzmhw6R2tUhCc9c6bv18uobXBYHNeMnhe34aF1puGwqr22ANh NxTqeNn+iaBw2tUI80DFc509VngG/1Havh4pYrFNc3xovF+lElgDqO8l2320Ni7Uj03f R9KQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CGR6jgde; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d13e93asi6285171fa.241.2024.07.25.13.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CGR6jgde; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A9EB88850; Thu, 25 Jul 2024 22:45:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="CGR6jgde"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 518678863E; Thu, 25 Jul 2024 22:45:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D7D7188403 for ; Thu, 25 Jul 2024 22:45:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-70938328a0aso163572a34.1 for ; Thu, 25 Jul 2024 13:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940347; x=1722545147; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MRWZ3XISpHkNgfnMrf60r5EK2Iftgh+Qw3jGTgAaHvI=; b=CGR6jgdeu2OM8vbBwErBhmIrHKhiVU9m5aKgAj27uZrWdMpctVRR6crKlfPRZe8NU4 /ih8H4CN6Zc3CG3+Nw21bXmevAc+OOYA2hPDhqUZA32hudUob+ZG4VJ4A6KlxOp6vETZ 0ko9aAGNHH7UnUG4iwfajoRYZn3WIbRPlnNxQkV2JrGmCsvNhjWMuOazoOc6ejPDvNE3 ad9MHSouz701R7mK28hGvdGlZ7/gCLFxgWxsplrlBjHjsW5aUaHj4qyslCSVpK+JD6ni abQAvf+++bd9rXPTV3LRgl95EtGM5txMjJEhnPeMIxjjvQWW3tkeyQGLZ/W0kY0ioDs2 M4YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940347; x=1722545147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MRWZ3XISpHkNgfnMrf60r5EK2Iftgh+Qw3jGTgAaHvI=; b=oPvUEmi5xv4cnpjQClL8tD0VMWoBFdpx3Eh4RjgEggCd3Te91wA1AG/rGUZhHCZ0wa KxELvnqZYI25p39ndy39zkuZHDbfzoaY2s/2910jBpwmRpeEo3C/NsyCzwI1T+eJzIN6 uUiURUu/0VGE6j56/VVJLTmy2gefvmw6V/PPZT/5acjxHxqNBqhOC8lmPtFom4lBapa+ ZjUjPH3WdZGqHHUdi77f4sDpfI4L2KD8t9eLaKrg2DrIvXUU1TBow1NUbCSHKkQmcT4x Pliov+Q6OPYX5napx7F3WChnYxGSSJzXsHr3xyWquSbFb6H5A45EBVH6qihS6ZoMa0F8 QBDQ== X-Forwarded-Encrypted: i=1; AJvYcCXj+9YCwlFNX8UeXxU5Kc93SUjbmrBVM8s+/l3G43bp3rBvCEiCYBaVlnhZjsQsHu7/miriV+JF0vwnXpi7gbIw+k7/NQ== X-Gm-Message-State: AOJu0YzJY7McBdb4+GPOWsqzKU63+r2x6MGxqsWidAn06V/QPL3jNnuu 18Tcfx24WhEWgHn/P85/A9w4w6ejYals6lgijTdjFfLEOy2Jx/WGjx4hoe22eHA= X-Received: by 2002:a05:6830:d86:b0:709:396c:c455 with SMTP id 46e09a7af769-709396cc7bdmr608798a34.24.1721940347644; Thu, 25 Jul 2024 13:45:47 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778050sm445393a34.62.2024.07.25.13.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:47 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 36/38] arm: dts: exynos: Remove outdated DW MMC properties in all Exynos dts Date: Thu, 25 Jul 2024 15:45:18 -0500 Message-Id: <20240725204520.18134-37-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Upstream properties were added to device trees to follow current Linux kernel. DW MMC driver was updated accordingly. Safely remove outdated MMC properties. Details on removed properties are as follows: * samsung,removable: replaced by non-removable * samsung,bus-width: replaced by bus-width * samsung,timing: - replaced by samsung,dw-mshc-ciu-div and samsung,dw-mshc-sdr-timing in dw_mmc nodes - removed from sdhci nodes (it's neither described in bindings, nor it's used in s5p_sdhci.c driver) * fifoth_val: replaced by fifo-depth * bus_hz: replaced by clock-frequency * div: the fixed CIU clock divider value was moved to the chip data in exynos_dw_mmc.c driver No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) arch/arm/dts/exynos4210-origen.dts | 2 -- arch/arm/dts/exynos4210-trats.dts | 4 ---- arch/arm/dts/exynos4210-universal_c210.dts | 4 ---- arch/arm/dts/exynos4412-odroid.dts | 8 -------- arch/arm/dts/exynos4412-trats2.dts | 12 ------------ arch/arm/dts/exynos5250-arndale.dts | 4 ---- arch/arm/dts/exynos5250-smdk5250.dts | 6 ------ arch/arm/dts/exynos5250-snow.dts | 6 ------ arch/arm/dts/exynos5250-spring.dts | 3 --- arch/arm/dts/exynos5420-smdk5420.dts | 6 ------ arch/arm/dts/exynos5422-odroidxu3.dts | 2 -- arch/arm/dts/exynos54xx.dtsi | 6 ------ 12 files changed, 63 deletions(-) diff --git a/arch/arm/dts/exynos4210-origen.dts b/arch/arm/dts/exynos4210-origen.dts index a4915de2c49c..40289c8c4aaf 100644 --- a/arch/arm/dts/exynos4210-origen.dts +++ b/arch/arm/dts/exynos4210-origen.dts @@ -25,9 +25,7 @@ }; &sdhci2 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; cd-gpios = <&gpk2 2 0>; status = "okay"; }; diff --git a/arch/arm/dts/exynos4210-trats.dts b/arch/arm/dts/exynos4210-trats.dts index 4fbdf4730994..88e9c0ed2bb0 100644 --- a/arch/arm/dts/exynos4210-trats.dts +++ b/arch/arm/dts/exynos4210-trats.dts @@ -240,17 +240,13 @@ }; &sdhci0 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 2 0>; status = "okay"; }; &sdhci2 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; cd-gpios = <&gpx3 4 0>; status = "okay"; }; diff --git a/arch/arm/dts/exynos4210-universal_c210.dts b/arch/arm/dts/exynos4210-universal_c210.dts index 1b3ac1fee15f..c87b92be609d 100644 --- a/arch/arm/dts/exynos4210-universal_c210.dts +++ b/arch/arm/dts/exynos4210-universal_c210.dts @@ -235,17 +235,13 @@ }; &sdhci0 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 2 0>; status = "okay"; }; &sdhci2 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; cd-gpios = <&gpx3 4 0>; status = "okay"; }; diff --git a/arch/arm/dts/exynos4412-odroid.dts b/arch/arm/dts/exynos4412-odroid.dts index 24e96ed05868..6822c6aaaa8a 100644 --- a/arch/arm/dts/exynos4412-odroid.dts +++ b/arch/arm/dts/exynos4412-odroid.dts @@ -234,26 +234,18 @@ }; &sdhci2 { - samsung,bus-width = <4>; - samsung,timing = <1 2 3>; cd-inverted; cd-gpios = <&gpk2 2 0>; status = "okay"; }; &mshc_0 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <2 1 0>; samsung,dw-mshc-ciu-div = <0>; samsung,dw-mshc-sdr-timing = <2 1>; - samsung,removable = <0>; non-removable; - fifoth_val = <0x203f0040>; fifo-depth = <0x80>; clock-frequency = <400000000>; - bus_hz = <400000000>; - div = <0x3>; index = <4>; status = "okay"; }; diff --git a/arch/arm/dts/exynos4412-trats2.dts b/arch/arm/dts/exynos4412-trats2.dts index 30758ffa1ef9..2b71d328cd0e 100644 --- a/arch/arm/dts/exynos4412-trats2.dts +++ b/arch/arm/dts/exynos4412-trats2.dts @@ -108,9 +108,7 @@ }; sdhci@12510000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 4 0>; status = "disabled"; }; @@ -432,33 +430,23 @@ }; &sdhci0 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; pwr-gpios = <&gpk0 4 0>; status = "disabled"; }; &sdhci2 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; cd-gpios = <&gpk2 2 0>; status = "okay"; }; &mshc_0 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <2 1 0>; samsung,dw-mshc-ciu-div = <0>; samsung,dw-mshc-sdr-timing = <2 1>; - samsung,removable = <0>; non-removable; - fifoth_val = <0x203f0040>; clock-frequency = <400000000>; - bus_hz = <400000000>; - div = <0x3>; index = <4>; fifo-depth = <0x80>; status = "okay"; diff --git a/arch/arm/dts/exynos5250-arndale.dts b/arch/arm/dts/exynos5250-arndale.dts index 7f84589c97a2..4c894f1712fa 100644 --- a/arch/arm/dts/exynos5250-arndale.dts +++ b/arch/arm/dts/exynos5250-arndale.dts @@ -27,9 +27,7 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; }; @@ -39,9 +37,7 @@ }; mmc@12220000 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 2>; }; diff --git a/arch/arm/dts/exynos5250-smdk5250.dts b/arch/arm/dts/exynos5250-smdk5250.dts index 882db2d1f608..f9f54cb63871 100644 --- a/arch/arm/dts/exynos5250-smdk5250.dts +++ b/arch/arm/dts/exynos5250-smdk5250.dts @@ -145,12 +145,9 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; - samsung,removable = <0>; non-removable; }; @@ -159,12 +156,9 @@ }; mmc@12220000 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 2>; - samsung,removable = <1>; }; mmc@12230000 { diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts index bcf04d5c07c0..ab7b5212ba7c 100644 --- a/arch/arm/dts/exynos5250-snow.dts +++ b/arch/arm/dts/exynos5250-snow.dts @@ -301,12 +301,9 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; - samsung,removable = <0>; non-removable; }; @@ -315,12 +312,9 @@ }; mmc@12220000 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 2>; - samsung,removable = <1>; }; mmc@12230000 { diff --git a/arch/arm/dts/exynos5250-spring.dts b/arch/arm/dts/exynos5250-spring.dts index 7270a546a795..9c478837ba44 100644 --- a/arch/arm/dts/exynos5250-spring.dts +++ b/arch/arm/dts/exynos5250-spring.dts @@ -103,12 +103,9 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; - samsung,removable = <0>; non-removable; }; diff --git a/arch/arm/dts/exynos5420-smdk5420.dts b/arch/arm/dts/exynos5420-smdk5420.dts index 1f27baafebaf..6ba1306e862a 100644 --- a/arch/arm/dts/exynos5420-smdk5420.dts +++ b/arch/arm/dts/exynos5420-smdk5420.dts @@ -106,12 +106,9 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; - samsung,removable = <0>; non-removable; samsung,pre-init; }; @@ -121,12 +118,9 @@ }; mmc@12220000 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 2>; - samsung,removable = <1>; }; mmc@12230000 { diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index 767b3e415d58..ef25cf774470 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -280,12 +280,10 @@ }; mmc@12200000 { - fifoth_val = <0x201f0020>; fifo-depth = <0x40>; }; mmc@12220000 { - fifoth_val = <0x201f0020>; fifo-depth = <0x40>; }; diff --git a/arch/arm/dts/exynos54xx.dtsi b/arch/arm/dts/exynos54xx.dtsi index fd74166c7e48..5915ed697791 100644 --- a/arch/arm/dts/exynos54xx.dtsi +++ b/arch/arm/dts/exynos54xx.dtsi @@ -119,12 +119,9 @@ }; mmc@12200000 { - samsung,bus-width = <8>; bus-width = <8>; - samsung,timing = <1 3 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 3>; - samsung,removable = <0>; non-removable; samsung,pre-init; }; @@ -134,12 +131,9 @@ }; mmc@12220000 { - samsung,bus-width = <4>; bus-width = <4>; - samsung,timing = <1 2 3>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <1 2>; - samsung,removable = <1>; }; mmc@12230000 { From patchwork Thu Jul 25 20:45:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814414 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567909wrn; Thu, 25 Jul 2024 13:51:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXYNbFxJkjd4zo2e2uPkcuBMt15c4vsYXDbzXh4fnWWuvB0LR9QWqDkElXPjF9M+qwK5eycbBP/DSFznzgTcD3a X-Google-Smtp-Source: AGHT+IH7gQcyKn7JONl4oK+id0vNTgjWKfim4CCQu2WtgxJlAwkBsQnuuzTJJ/Xkim3HlXWrDBiE X-Received: by 2002:a05:6512:3504:b0:52e:fada:f002 with SMTP id 2adb3069b0e04-52fd601909dmr2820166e87.10.1721940718623; Thu, 25 Jul 2024 13:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940718; cv=none; d=google.com; s=arc-20160816; b=IvHNeDeGK7rOh1P3UC8HEKANdUet8DSPEuXmqMQ3vVwcYIKhBStioU/AcHPUcc9mV1 RcpMDhPuHAGiKCclUSWuh1Q9mlA2C9c/vJi61JUo+sYY+3eUpucEqrWGnrmf3cs9jIs8 IWF8oKiPs2fVpQkOBCPuie2Z9uiv5Bo0Qnzvs/6hAs2XW8eJgnuWnb00UtptsjEproQb bp1A7WzXQtfjCvpS7Cxc9nMYuKFud6IySrWX0kO/jzrcN483HyRJAHjsAGqcAAd9GB8W 6pUWiwh3P1DjoinFjTyIoDlgceM0WCTn0sqxpGDzm6rikz8sOcZWTVaGb6EdsYWPKLfx PoeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GYwd63sn6oUaTgmZWLPulXms68qGB5K03DSi54RRJeI=; fh=Np1qwCZ5pKhXvFkBknAInVrwM4ZJuDNnPQIUDgmlRz8=; b=AWSYu5LAHAvnLr/YUyshva3/R+m1dRff6HIssZDcpU+lqodeQyXCeZ6TqnTSL/OSKt eT5B0THDM9+YRK7tauWmLEcLvGfkSXlKulJ0HZhbsM7wN3JKkul+2RCnopaibOWlmVY4 7p9vnSXdpYWkc8ZRMgGElAtzEhyJ9o6OSA3sX9tdnd7ylPk4qw8IY2wXqSYn6yGvjIR+ vNNNtDyQoCiOy+yQR28eThHkrAaiSb9GJDk0C6LxeeLgojkdaof3gJSqOZv1cXcoxCIR HEij2hJRm1YaXm4SA4t/DN1/PCqukOJbXxYpKYW4FFbDGcQc4GBYz81eW/MamdGne7SH h22g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+iPiVwb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5beeebbsi684942e87.289.2024.07.25.13.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+iPiVwb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72EB988861; Thu, 25 Jul 2024 22:45:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="h+iPiVwb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADE5A88403; Thu, 25 Jul 2024 22:45:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 922AC88585 for ; Thu, 25 Jul 2024 22:45:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-260f033fda3so392174fac.3 for ; Thu, 25 Jul 2024 13:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940348; x=1722545148; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GYwd63sn6oUaTgmZWLPulXms68qGB5K03DSi54RRJeI=; b=h+iPiVwbTgc+E7DgSXwLkaiB7YhCHtp5pry+j4dK1l6D1Yv2Aj7L3DLL8l6yfjX1uN oj3f3CsMvx0vOdNzJl7FEs70YC/nVxgNEJp21Bm1eM6Pgcxzr8MraqwCELh5tWr/icLb CUag06851cExWfjB+mGuXcywpGloz8++gX02lTvXnZig7XDIHHGFO+uhciddJSyfjGwy 1QCbSL4FkkvqPmpw/JfhRyngCto0hFLqw7TSMb60OeGxnphMtNQrCI3jCKjBYX2665Zy 5/h3VRpjjLP2A2MMHyYAeMciUkjW8wcWK4CJEO/jgmFeqpRtRaw65E0x2eDmqK+AEnBz /v2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940348; x=1722545148; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GYwd63sn6oUaTgmZWLPulXms68qGB5K03DSi54RRJeI=; b=xSV+JrwbXfcyyWBQ7VyuC0QRu6Dm9VINEkCG2cIoksqsLWglR8RdHEo3DphA6CRIaG ys3sP76IcDr72vaQKn7wY8Q7sG0sNQ+J/HDMNCf2Fg0fhgXkZT1E1OToQDbdTjcYN6wq QGXqvKux9mnfzxVeFCzcJhRH2IklU3YmrB200o+9CPHQix/7iuoTdiXGG+t9HZJib7u9 Wz2ld5awyBT/sBN6KCvpQB7QmRbDShWKnpwKdTzDNUJbfWm6+0v5BpOO400Lx1sMO4HR Xh01nc4YOt/4lrsUjpj1ue9tVlq2RfGok6QEDCOwdakN8yvzVcD8aPJ47TIKTCSedkAq B1Qw== X-Forwarded-Encrypted: i=1; AJvYcCVTRf+oqn7raQBEh17QLl7kto2/D0LnuDYeul3Jpe549n4MxR1ZoXiS1rgwXKEmtLUTp/KsmOY2XjMX6Z49TTjWdn1XhA== X-Gm-Message-State: AOJu0Yz50Xv+8wWNECyvSnhc7gKKiMnnk3O2np0glZew18b3tle/Nr5Z bl1UHfGYperRZpKzCqh4uKhY4O086La7WQFR48L+C3AQBvC+3sYdHhFBq6C74AA= X-Received: by 2002:a05:6871:2001:b0:25e:5ff:758b with SMTP id 586e51a60fabf-264a0ba5543mr4917426fac.4.1721940348310; Thu, 25 Jul 2024 13:45:48 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a348sm452395a34.3.2024.07.25.13.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:48 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 37/38] configs: e850-96: Enable MMC Date: Thu, 25 Jul 2024 15:45:19 -0500 Message-Id: <20240725204520.18134-38-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Enable MMC subsystem and DW MMC driver support to make eMMC functional. Also enable a couple of related commands so the user can make use of eMMC from U-Boot shell. Signed-off-by: Sam Protsenko --- Changes in v4: - Rebased on top of the most recent master Changes in v3: - (none) Changes in v2: - (none) configs/e850-96_defconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configs/e850-96_defconfig b/configs/e850-96_defconfig index 2949da24267f..e5d90996234e 100644 --- a/configs/e850-96_defconfig +++ b/configs/e850-96_defconfig @@ -9,12 +9,20 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xf8c00000 CONFIG_DEFAULT_DEVICE_TREE="exynos/exynos850-e850-96" CONFIG_SYS_LOAD_ADDR=0x80000000 +CONFIG_ANDROID_BOOT_IMAGE=y # CONFIG_AUTOBOOT is not set # CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_CMD_ABOOTIMG=y +CONFIG_CMD_CLK=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y +CONFIG_CMD_TIME=y CONFIG_CMD_RNG=y # CONFIG_NET is not set CONFIG_CLK_EXYNOS850=y -# CONFIG_MMC is not set +CONFIG_MMC_DW=y CONFIG_SOC_SAMSUNG=y CONFIG_EXYNOS_PMU=y CONFIG_EXYNOS_USI=y From patchwork Thu Jul 25 20:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814415 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567950wrn; Thu, 25 Jul 2024 13:52:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0rvSrdbZlYO6aYGuwSanvrC+kmAiySks2Z5UzL/vsua0hGpRHZKxVSPga3uCIfOzd/wBOStL+ZN5O/jCI1YR6 X-Google-Smtp-Source: AGHT+IEoGTRUwlnGtGqg18G7ReMOtEC/pgoCpbw/jVZJeQOsdHm4NBwJvwclMoGS/Hu134WQ7mjR X-Received: by 2002:a05:6512:3b8c:b0:52c:8a12:3d3b with SMTP id 2adb3069b0e04-52fd3f85e2emr2785284e87.56.1721940728660; Thu, 25 Jul 2024 13:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940728; cv=none; d=google.com; s=arc-20160816; b=pH/gc2xmcZYL3oIpuMFPJPrUyQBK6ciIGm6N/tqwB9/jWsRyOh/5Wfg3Pf5Il07Qt2 LTYsuBFL6u8aKEPiQOK6mrP7oWZ1p1fe0bsnyQSdcfns4HtfBR6AhtKiKx9kdtW+BtcT MNUmA6W/D8l4XtQsSgILMWLT9oQgyuW/3/LA5hF24b4nq5hWJtE79TeQ5HnF7s+BGaqS AJo9zsutc+grfGtR0Lt1amhg3S9f2VKZ/fVd/IQo9GrDGWk2IAIq6npZRkcd+d54TiRS wKlkDcRgMDNxd+mpeKgk0KFqS6eDnlHMloD4YMu/1YRGD5F1r9lQfC0i9Jbq3gbpLUp3 UO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i2jJkirKL9JcIEYinkc0nyP8OCxqu/mQlYDf10jkd3E=; fh=cm8Ivtgxha2JJ0pzkQewF0TVSA9ebkBQf1Q4cEmIh/0=; b=rUlmt0cLMIbGnHLjQrZWO4R8s65GoZAw7jcHMTa+9DqGOogeaiz3yNCdeyFGzWmH5X G31nw+k0bRnI5uAPnzIRvQFjnn8+duzaFlrt3iyBB8w+aDZGXlGt2BjgcSz02KPL5re/ 3bExyFU/vCgHQdPLYUAQ0RmfjVh1bUe6fEGsMB6lSrBRxXmem/q6rtWvAsjGjx5gGwT+ t68oEWJTBW8L3vlP4WDGKSa0FCEgh2mZwZ7bcLrjFP/A6qH/hZAHy6QvUyrxvwLSlizL CYxHqwRKI/NQdIDiNKqkKVJYy0VIdB7Yz3MMnaCAbyhyvZlXtlRTIX2RTS6nzPLD/cWj niXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tpuji5X3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 2adb3069b0e04-52fd5bfb735si643868e87.359.2024.07.25.13.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tpuji5X3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C385E88871; Thu, 25 Jul 2024 22:45:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Tpuji5X3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 752A788403; Thu, 25 Jul 2024 22:45:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2480C886CC for ; Thu, 25 Jul 2024 22:45:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7093705c708so276333a34.1 for ; Thu, 25 Jul 2024 13:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940349; x=1722545149; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i2jJkirKL9JcIEYinkc0nyP8OCxqu/mQlYDf10jkd3E=; b=Tpuji5X3+cl7B2SPGxNITHbg4zomwwf+m9WS8qU4l8QE99MRauNURJjmM+0FSOPY0E wc7hFXP/OiO7KjhQ07lEmJyfiOpZmRqYfqoMLEifbH++o+Av4APmuOAnNvziUUJg6jWe jjwyd1lHY4rqa8piBZbG4UVJjjFvSVjBM5LqskIj+j5m7sW9RpP4M97LSyQySeiJEE2X TgS81mn9l03P+tuirgqN4q2w0F2VO4CUpygDIjo82enoGnpN8r1UVXEeFO/OuosNvnm0 wzIVVB1W/aD0R9s+In9rnoBBvwlegtTdACW3N4xaxN9DnG05uxBXg1vPQca9keBcfZSz 4m2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940349; x=1722545149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i2jJkirKL9JcIEYinkc0nyP8OCxqu/mQlYDf10jkd3E=; b=jB6NwQPTzECx4Xvfo177t4j6WNK2LaHhqiU9hu4NjyzpBLpTnKxMjqGlXeBBgsDF/U 3MLy+6CMBod11bLU7vG72kBqSvGnpmoCOzF2lnjsgtsKAxGZeP9QtzMAPKeBPSc05xEl Kqo/2IwsPy8uVFzH7a22r9D7XJTuws8a0SKgkbs5jyFPUNwuLIijqDBI9xCFR59gSh4C G7Iy1EOK1Zd5Rn3Tn8f3o2UeYlMIlq8HhDyTp1UMk1GkH/1/rFFfJFRv2jDezYfV8EB/ Ma2JpmU9125ApCHgHH7UZrRIRfYqXfse7zlMfPMMRtgWCzZksoxG5lQgPRmlHJISV12Y 2tDQ== X-Forwarded-Encrypted: i=1; AJvYcCXGFuiczI7AFdi4ZDqWGIXqs8ezn6kKqQBypR3cm2g3Gs28rRgEfi0Zpv817RlelNmP9RkJFGc6PCX+0YdffgFGizl7tg== X-Gm-Message-State: AOJu0YzAhF98SR89n9tRu5advYQTf0xT69cuQkN//EzxvDXfcZ7HhQNe b9WCWAyXGxo9sqfyLUp4BitdFEdtnMdL/CUMkzAuEMat94mSW0ZE/bc42EAg3yM= X-Received: by 2002:a05:6830:378d:b0:703:638a:7dd2 with SMTP id 46e09a7af769-7092e6c3321mr4985485a34.10.1721940348973; Thu, 25 Jul 2024 13:45:48 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930785d30sm455770a34.69.2024.07.25.13.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:48 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 38/38] doc: samsung: Mention enabled eMMC in E850-96 board doc Date: Thu, 25 Jul 2024 15:45:20 -0500 Message-Id: <20240725204520.18134-39-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean eMMC is enabled on E850-96 board now. Mention that in the board documentation. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) doc/board/samsung/e850-96.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/board/samsung/e850-96.rst b/doc/board/samsung/e850-96.rst index 0cb95473e536..0a7b6fc0c9dd 100644 --- a/doc/board/samsung/e850-96.rst +++ b/doc/board/samsung/e850-96.rst @@ -47,12 +47,13 @@ Build Procedure --------------- .. warning:: - At the moment both eMMC and USB features are not enabled in U-Boot. Flashing + At the moment USB is not enabled in U-Boot for this board. Although eMMC is + enabled, you won't be able to flash images over USB (fastboot). So flashing U-Boot binary **WILL** effectively brick your board. The ``dltool`` [8]_ can be used then to perform USB boot and flash LittleKernel bootloader binary [7]_ to unbrick and revive the board. Flashing U-Boot binary might be helpful for developers or anybody who want to check current state of U-Boot enablement on - E850-96 (which is mostly serial console and related blocks). + E850-96 (which is mostly serial console, eMMC and related blocks). Build U-Boot binary from source code (using AArch64 baremetal GCC toolchain):