From patchwork Mon Jul 22 17:57: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: 813743 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985008wro; Mon, 22 Jul 2024 10:57:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmTZBWzaj3lkaBq3czyGFyk/Na08LuLAgYFsFoDk6s7IHMyMitKU0uS3pLBmjJXqnYrd65nrAruBspVpm8k4hf X-Google-Smtp-Source: AGHT+IE90lcR8xRWhovi3wWeTPx47zTeBsN/19H5/apU3m+LhkzUNKlSyNoFJOYcopDasjMlJ9l6 X-Received: by 2002:a2e:95c2:0:b0:2ef:564c:a590 with SMTP id 38308e7fff4ca-2ef564ca663mr17969091fa.29.1721671076030; Mon, 22 Jul 2024 10:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671075; cv=none; d=google.com; s=arc-20160816; b=RPimPxWFFCOlQJAYdkgNcs1DikH8x7EweXC87RR4uG1ZpN5DnsvmedryRqLajjNahI 1bTL4dLpA9bnbUZU7vT2edX7HN7HP5MmitKQ50EptjNB6zAOFNVXqZtK61RYH2da/KL8 3szAQvdAH9CNb/3dv2rQCVm8gUqrVLkc0TpDMCliegXqQhRxeRgHRjliKd0bBROh/4w3 03TE2FEHHVay3VdQRih87t48z10P1zfkqjZXsdW7UTxOWkdjRr6eYpc5rcCGcqfrpLNC hqG5pN64BQxry8o+61rP6w3QnSDt96Vn98S8Sonp99ocs42AFlzuG1o0x3VgQxC2hiDr vaIw== 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=NSBVy9oWXcI2pI2rEMN0Pvt5bavsExjgOlPx2QiKQJk=; fh=qPfdy8JsdiHEDgU/UpVpfn33AzNu3Fh4SaPGXEe4kOg=; b=RLARjGJBEnm2FY1RClF/jEuo3rOmWQIASH7GVxsMShZr88pkZ3SGBcFKtQD4oXahkH rd5L6hNg/EC+Q0Eb6ulWVoQ4044y503jt8loRQJr0JTqm/zybTF2dzNzHqz9IhcvAcWy olxVPp1absBZo86LzI8IXVhCMtwDLIgZqNYOAGgnJM1U1cqyMAfExdqH421XZVXPzn5V k5koWQQS49Oq1g0LITzNo2MzEusJBWDOv+DPIMaoNxB+d2MQTPBALJaGvi9ZHnB8HfvT HEpL+RN0PbgnpQLCpj8NiiIT4oc/RnGnlhbmzG5EYzMDSdBNUqScZ8T9AZ0SzLgL00AA uVhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pGqZ6AhO; 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 4fb4d7f45d1cf-5a3b89549c7si4301332a12.515.2024.07.22.10.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:55 -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=pGqZ6AhO; 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 B1574884BE; Mon, 22 Jul 2024 19:57: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="pGqZ6AhO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B23387E30; Mon, 22 Jul 2024 19:57: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-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 2FF4288005 for ; Mon, 22 Jul 2024 19:57: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-oi1-x236.google.com with SMTP id 5614622812f47-3d93147ac6bso2630897b6e.0 for ; Mon, 22 Jul 2024 10:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671062; x=1722275862; 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=NSBVy9oWXcI2pI2rEMN0Pvt5bavsExjgOlPx2QiKQJk=; b=pGqZ6AhOTNS7JsV3bd08DbT6P805ZVWHYb+b5wJCWk5wGjuP3JBeTGAo/6WGl6ubE9 j8KnS+LcUr+0g2EP9Pssd2V/JHSBt2A2/6wuq1/1bu55Ttn6V7D+ORu4VLZxpjTQCgQD ngFao48FNeHKlY/O3ehPuvCoOmQSTpBx8PZ1/7LtKE0UzeQfsx0KrQZF3umQdTpAOmlC rjeHnD5TZwI+MOdlOsl9JL5s/Dei8cfooLFOFrISykT1/mzL/BgNa8OF9HcGzNDeE4dW riFKYHn2ghYptC5ZD6a0WhZFkpCko+o4vHjM/A3D0oiZV6LtVLslit83B4rinov/FRrf s/+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671062; x=1722275862; 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=NSBVy9oWXcI2pI2rEMN0Pvt5bavsExjgOlPx2QiKQJk=; b=rx0zIaYs71eAJ62vMApUm5gcf0m/Y6olgC8L6ItwIx4dIvxKMrmu7vj894hq59DqAr DfvrHU+21EBnPBhcQiyJ5T6SpIWtZ9VhlumC+apDZDsnYY+SipwWy54OC/x+3RTHl5RT QxEko7P/B95aW1ETutPhM1A5SdlnODaPytSUw9xuhsyOjMBQRLjUU5NMg3/hFnqmNrxt JJwyFRod7Hcxl8j5YO6xlXJpDnOyYzSOUTwBFEd6AJ2txxp7hkVePb+/EQRChd3A9U2i ullb+rHyRTpopvckqwAS/YTYOTPy/p4OEZ1MpP3XP11uv/quUvpAMx9qQ4CH1qfrKwBe d5tw== X-Forwarded-Encrypted: i=1; AJvYcCUuHBCUpIaPXJAuyGgegwIT9ot4qetzv5tlfV6YMiaNo2uFgGkJdoQAX43K5s1rThNJKLzERXJQco8ltE/52ZVW0vzPrw== X-Gm-Message-State: AOJu0YyOUK3ubV/GXHWuOXRz2+0Cnqw72Gw6PDwnOr584SPaUpwkz4Ke j3dYfPXD4dDp008lJCvgDLdOUE1+F1l+xjDdIT8sMBU/D5AMMSvAF4NQfUWlrEI= X-Received: by 2002:a05:6808:23d0:b0:3d9:4163:654f with SMTP id 5614622812f47-3dae97fad21mr9094454b6e.32.1721671061960; Mon, 22 Jul 2024 10:57:41 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae09cef7asm1614286b6e.42.2024.07.22.10.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:41 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 01/38] mmc: dw_mmc: Remove unused version field from struct dwmci_host Date: Mon, 22 Jul 2024 12:57:03 -0500 Message-Id: <20240722175740.6985-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813744 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985076wro; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXoRyI9DGn91nZtbEljkKZveFQLRbG28/bWKgWTVutyHa8GuuYPjGtG4MW4rFFvnwL87TefZ+7aMZmUWrWkFhv1 X-Google-Smtp-Source: AGHT+IGpG9xThtHCUYyg/NYZNKC6689A0SMpyZtlu7ArkEFNL7Mrrj6JATkHXfN3+QOI6wPO4icq X-Received: by 2002:a2e:be26:0:b0:2ef:29cd:3191 with SMTP id 38308e7fff4ca-2ef29cd333emr41177671fa.35.1721671086619; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671086; cv=none; d=google.com; s=arc-20160816; b=Kw1mPVNRdugc/Ce9PooFnOylg2rT/OVYhe3CVWFMzN11N8cmXrVY9nJScKyiA+surA K/5ildLr+xcSuSAl0ewR1nLsl5B3e0wYObryJxXb302CMnfVxB55g2d2Gqv3EwWhzWas djBc6YA6hiRMUl1GYNH5fHPCxz1lR+iAwsEIOvFY6kAR+SKRDz841ujTgZTt+pWSaRa8 +5kxH+t2FoBPlpHJIHrxsExLll5NxjtyFwrJLESvMzKMd5s8zkoFD1D5Qd3ig47UBLIU ZFf1nWRLxpisBqdS76HTzI1hGh+wI5EMKFkfJ+9JeNNSGXaLfvH/RL/+97rRERWcFMbI bUjw== 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=XGaz0fs9yegy5kcV14Vpei8PrOBWPisherUF76538uE=; fh=x/jSookzKP/mQAheQqBzE4hjf6eLAKXOQrEtCt8caW0=; b=wuAlf+ai6hyv3wBke2oPa+WR53nHFI2cdzYjk2hK5CtkeDg2f1iz5WQmo0OVTVdEKC KiMFw14t6bPK6NghBk7eT1n6J2atrsYJ0KgaOyk0Lcqdmt8rciRjZ14dWHFNi4pYw0p+ H5XkrPJMcntPD6naTAeMfAVB0MDRDGgaWNfPwHwlanB6WpyRX5ZipPVLHU5emoBJDSNS 6Fi+tIazF7Z3xBrTeMw2sTJYKc4c2UjnIPTfwbgv40Mhe9KY+E8PvFAMGilAkLFxl7DI C6nde/2z2Mq/mRiLsIAEVl7kfqH6p4O70Akxm6tRpyq2snN8nPtijr2N9JEAVuZ3rigi zsDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2Uk2D0X; 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 4fb4d7f45d1cf-5a7448b48d4si2106564a12.569.2024.07.22.10.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:06 -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=w2Uk2D0X; 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 1E6398841D; Mon, 22 Jul 2024 19:57: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=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="w2Uk2D0X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04C23884CC; Mon, 22 Jul 2024 19:57:47 +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-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (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 14217883BB for ; Mon, 22 Jul 2024 19:57: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-xc32.google.com with SMTP id 006d021491bc7-5c7b6c6a581so2073132eaf.0 for ; Mon, 22 Jul 2024 10:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671063; x=1722275863; 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=XGaz0fs9yegy5kcV14Vpei8PrOBWPisherUF76538uE=; b=w2Uk2D0XWfPis60l/uDtdYWAChlC1r2Df65BpVFGg12g93fQs1cMt2eV6bAHvCABGM p+PC/sN647CNbFVZJ9mlPTu9M9Bdx9zZgO9h7KndV3XwVmHXoxv8FsRgQg+PROfdJS3g SvUo4AoFRQnIsgYf/fCeRYGP9PWL9GzNwv6I9PuwUs+/IFsHeR4QCJISwlKasL+yv2X/ URMeYZhzhP8v3MwVP7vfcs3w+EKbGECQB3hvDgckEgcrsTZTpvKi+422Nw6NWyGs8jmA zYL80sS6Lcr+1rpnWjzSbnZp99BpYSx/2UYoML7Gxvx40EVluWVfAD5g17yqRAkcsZE4 r1MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671063; x=1722275863; 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=XGaz0fs9yegy5kcV14Vpei8PrOBWPisherUF76538uE=; b=b9s1E9p+d4H2Gcfbc+NlxXL14Bb9bvmGjjCDh8oX/e+m0D9Arz6duin/dBeYOoTHSW BkNX7tQmzNc/01NBvceJ0pueFsfVkX5bxHROYSQsb4ADYxp9fyZ+mKPJIzeEUL3K3I9J joxR9tZzx82MEQNmfYLNF1GXcpet+RMDvf4pA6CL3mIfnVUGA1sHaCOvl8Y+/Lvk/yPR Sd/Fv6EWaBTNi+R165PMPcellCaKLYmL1pTCLdkYkKhv1tHAcN7yIGME3gKra+VrLWOK twH6Ehx+1C6trn9gLugs0yyy8ssyS4XonFHIHhWXrckaEBq9pA8ovZ10USdFOioJuDBd RvpA== X-Forwarded-Encrypted: i=1; AJvYcCXFm2/2q9rgQ0v1Ql4B2bjzQFzcRzf55CCeM7CvjK8OwbW802rsdhWr1xV+4AuHbVFALooKUELYkUbJoiUXUc8ELG1HOw== X-Gm-Message-State: AOJu0YzOrIUEXlq4Jt9zJj7sepop8jP3q17YXMPZosbyHPSB/EnD5fV2 tWWwUVvX0RIdNss8tz/bl3nD7wcRujXF9TKOZ+dc31E4VahjAlveJN1u9m3o7i0= X-Received: by 2002:a05:6820:278c:b0:5c4:396e:4217 with SMTP id 006d021491bc7-5d58b5b5a1fmr838230eaf.0.1721671062667; Mon, 22 Jul 2024 10:57:42 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55aad172csm1473828eaf.38.2024.07.22.10.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:42 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 02/38] mmc: dw_mmc: Move struct idmac to dw_mmc.c Date: Mon, 22 Jul 2024 12:57:04 -0500 Message-Id: <20240722175740.6985-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 e6107c770fe3..9d668b3d8813 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 Mon Jul 22 17:57: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: 813745 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985130wro; Mon, 22 Jul 2024 10:58:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW3ZtPAYi5CDa+WvddJ5N6uF29STJj/rqfGrt5tp4TrsUDHXUPdi3O3uOPBHjEHas4hypj7BU0ZSAnom63r3Fdw X-Google-Smtp-Source: AGHT+IFGb5tAu3Nm2w61tIV8MVDADU3QeT344mBsvboOqVyuXayTCwZH/6z1fmGpMG0cMVTyWy/P X-Received: by 2002:a17:907:3ea1:b0:a77:e140:a66d with SMTP id a640c23a62f3a-a7a4c584042mr445789366b.67.1721671097152; Mon, 22 Jul 2024 10:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671097; cv=none; d=google.com; s=arc-20160816; b=Xkz7H44cv05krw3F6+gG8mmYFDoD4LR28Vi0tA0T/w6oiq9IJD1epUE/zsolyYEq6I hWENaLhJEeyny52KKcy4GU55TPD4QCRQoIBSwArkYL92d5raZy2Q5iwlDP02WnyvGgRI X5Yam0VpZ6b5fDkSMhoKq3ZYR92SkrgSFeE3C+NENSyg244o0YJL8hceQ/tUtza5a4vL F5/EYp0HWREo/bZZtKSzmwBwYvRQutyYLBl2TbLVqLwFi3LAAjDXmZ3I5Xu7C1wWk9ud 32bW/r+TQl+cuf9j3Z7/5vI2KCq0Qywm/WWL8cHygA2rboONCSz2gCLggiNr926nukiY gO0g== 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=WrsM4fGIRFJZwpxDjdxpd7RZs/pDRwGsYnn/StKH7jY=; fh=JOrBZ1G1B8MOmqrQBJoCfuhIhJA9QmjNmSCPIT6v1d0=; b=ZCiq4u1hbZomOpTVIij8bhCcc0KrnYqU8fgXxBLSGq0JyesLu1cticQcI7vrbx1GWi cmflk7Rx7H2V4e7g1votH0L7T9vt4KFkrDwsKmKPLF5B0THP5UGAdrqdS5e6nAAMrL6Q /SeEqSQUawFvSJZL7XN3ITvPiP5dV/YiWYEHWhOmeGXu+Sp2rjqmTIMTwY6euh2jpogS cVScGAlvL2uWbV4/acWR3d6y6LlUFQxulpSYY4QwU46uQWhjwYq51eSxFWfMPU2eFG9z ecVQNR3GlgIwf3TtS3hEe7d9bgyLlNfw/cpTW7n9a9IwmJeCGKbFYZFwej9TKHU+BoR5 G+DA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oaZeHI/+"; 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 a640c23a62f3a-a7a3c8c575csi428716566b.283.2024.07.22.10.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:17 -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="oaZeHI/+"; 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 797B8884F1; Mon, 22 Jul 2024 19:57: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=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="oaZeHI/+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 17B6A883D9; Mon, 22 Jul 2024 19:57:47 +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-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) (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 B73D5883DE for ; Mon, 22 Jul 2024 19:57: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-xc29.google.com with SMTP id 006d021491bc7-5d5846f7985so402993eaf.0 for ; Mon, 22 Jul 2024 10:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671063; x=1722275863; 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=WrsM4fGIRFJZwpxDjdxpd7RZs/pDRwGsYnn/StKH7jY=; b=oaZeHI/+8HxdtzURHq/2zB2gITqIiAwXGGk7Jja0zVrjpjktgUFd4b5Xxf+AN1sw2L 7NG/yRHem9vLR+s3Yj+xKaN3t+mDRUnb3SsxfHWGATAdte1o54G3/eLEmlp9GZBgy0ZB wDx6GPJwCHkEYuaHHBBU4SuC7VUcLBgjaW60bK2PdCeKFJbRjdRdcHaMQUEtopom9FE7 GrGtYjkjClCaHuArkTALCh9SbZ0YiL5ZWwsj1hCUssqIIV8gIAoihiRsyHnhrylhyDs6 eVFI2GpiuxpW6CIyOgsorV5lQWNLqajYzj1Pv0l/297ISLVN4l9yRBbvrAddgT1/9W0m VICA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671063; x=1722275863; 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=WrsM4fGIRFJZwpxDjdxpd7RZs/pDRwGsYnn/StKH7jY=; b=No66tRbkAhPb7sXpyMZQJXF8mSw9wHMtVuCyM4Gj7XJsB3z64vErsCmWHJtJC8prOT By3RlPGdxKdrjAtdTzRFLrx74MbaeUIEfeDz+KHqxCiSl4CkoIHw+Jy3tTOa525yuqxN QqBoKxY/gDh7eR6XtTGVABRgT9cg9UBq59EQTKo02DTeBIiK20q5nK7/QBUVS72ZEa8q QtLuWq+PgrR/UE/94/01GPL2p1H/JykBB5FosNY2MeEEFuIMvuyczsg7a41tVoKxZtOD UHz03nWCXnNJ722vu+eCGh0Rb5Zca9l4tDH0KD4gEvel67M+05uNHblrAGwn9D3b/DRe 6LxA== X-Forwarded-Encrypted: i=1; AJvYcCXKcTucEIjEG2kRfaA+Al6bGo+jIvlfRcM7Iwpx5xIoE4pqhbWy98+ufiVN9MFXYm/dR15uszAS7VL6QyEL8n0tlwrRMQ== X-Gm-Message-State: AOJu0YwKdukAwx2M+DEKpxTNiBJ+zgupAVgKUPqabv31Y2bwwyqiob+/ 0+Wfom2UnouxPbkU/vtFb+RaWYzptSNe5ai1zr3nd0m66kvUAFApwBcy2OLnRO0= X-Received: by 2002:a05:6820:4c0a:b0:5c4:e036:e383 with SMTP id 006d021491bc7-5d56500366cmr10446736eaf.8.1721671063387; Mon, 22 Jul 2024 10:57:43 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55a831b79sm1480335eaf.17.2024.07.22.10.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:43 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 03/38] mmc: dw_mmc: Extract waiting for data busy into a separate routine Date: Mon, 22 Jul 2024 12:57:05 -0500 Message-Id: <20240722175740.6985-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 9d668b3d8813..a82f6a96db39 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -246,6 +246,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) @@ -260,19 +275,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 Mon Jul 22 17:57: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: 813747 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985281wro; Mon, 22 Jul 2024 10:58:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUoBl4cuB0dxneCrzs9LIsZ43oNpRlAFLMBXaK3//bGZGU+pym2OmocZk3KtZDBkNWveQZqHgbEvA8KWIfEBOKM X-Google-Smtp-Source: AGHT+IGYwotiacEed2b+vUdAzkyeCwstfc4MhzgRSi7XCuqmm6ile8TQ+UmHRPymRfXPI+1bi9Xg X-Received: by 2002:a17:907:94c9:b0:a77:cd3c:e9b4 with SMTP id a640c23a62f3a-a7a87c827a0mr47498966b.24.1721671108300; Mon, 22 Jul 2024 10:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671108; cv=none; d=google.com; s=arc-20160816; b=fbN8jq1tga1831X3BEmtwL2UGyAQMS0ammRgXBgisLDRc/LV/rXCuV0Og90Q1U2F3i K18IUrrWQWO+QgtTJaMZFD2fsmcIQgo/hdttXR5M9mcU18xfDRYmvuURG6XMcL4nVosh 1tCeDxvWLr3TtPbA+4SGcjwqzzgTF7aUxXRYxSlsIoKP5vYYkSs4HxyiGPqtMBZ4SrCx zyLdl86uBFHvhG0P0UPMP4bZUGGT2W2rhCZPie7/3HolkZCh2Ds8igHo+mmbkHdGpMWF Ou80NeF+U3ib65vFtLQ0wQDbwVcPt/FANaYhD8bTWrfNZAiNGnBW5fK82S+EFvLRX4kG ii0A== 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=/szNzAHh4ooOhxwkHsXehb7GdYF2Vg4+vJOe1XuY3No=; fh=0h4nz7OaoGDIEMJdQWrzXR3Y8HVoPTSOy7Ty5MvPLxE=; b=zLgVrAy1ynwlHTi5Fo5ixwnA74F94MTo7nTDZNndXoTm+vYhXzaQvQmPmhyJSYGvje S/Vz8br81rAU6w/BsCnZHGa5rExLy9im2fMH8AFcG+W9jckujKy68h4YT4wjk+dxgiT1 FKyF7iNeVogxmMPg06TrpQJnjjJ4MDAZv0oOE3Gm+sf+BAIT4Km01DMAlvNgk9Uv6p7r GZ+Xlqs+Or3FdS6iVX+j9MeLLz4ha+Z8VRJmjT97iQO04IcDGjeaWGFQwA6cWGkKNBUb UGYJVYtoeoAqvW+En/Px8IVIqdP+Sxq3tM/mLDtLVM0W3XUe0Yi6R07a6mVTcAHX5MCq 9AuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z2FOb3rE; 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 a640c23a62f3a-a7a3c7894easi415136766b.80.2024.07.22.10.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58: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=Z2FOb3rE; 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 DD06688403; Mon, 22 Jul 2024 19:57: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=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="Z2FOb3rE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEB578841D; Mon, 22 Jul 2024 19:57:47 +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 83CD987E30 for ; Mon, 22 Jul 2024 19:57: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-oo1-xc31.google.com with SMTP id 006d021491bc7-5d569bee00aso1210151eaf.1 for ; Mon, 22 Jul 2024 10:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671064; x=1722275864; 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=/szNzAHh4ooOhxwkHsXehb7GdYF2Vg4+vJOe1XuY3No=; b=Z2FOb3rE2lFEeOrOWdiw07jaOy0qIJ3iE0351D/JtDpkatcZ5FRGui0+t4y9Yo+VP/ 3AX9WkJy2RgZ8NIg3RrzpQaphKXa6oOZQ2BpLOXOcx7CxqlAO/nXySeTNy6JHSNMhQbM b25GVAy5epv9mFlVCeo5x4XvWTo9GStnUyg8oMuIqn9fVAT812wSCbhuiLEkn38Kpi37 X5W+O8kb2Nj87WX+MF7VSR0a3jlR1aWCkFDq8if/FJN2cEedNdx8xL3oezew8AIQqrt7 twGartUkScWIPcGKghHJ0Ts9Qivq7K0INiOUQZrzN+G0xahkEG8sh4qcWh2FMu8VPMvT po7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671064; x=1722275864; 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=/szNzAHh4ooOhxwkHsXehb7GdYF2Vg4+vJOe1XuY3No=; b=ea4YPsHqNpoL0KpLafa+o1RhnXgPX/zXgwvBIIjT4KAB2ZIRKU33cchwnO6l8KdDMV g2Db1QsWQW6TQDXkwNtn1YChJ93fpHhx5Dez8MPvyfHm429V37JvgnNLn+zc7VksnOHS p01z8dQCPBVgK2tqhSi7yJPT++QPUVoU+L2aGa+bu5jfADeFbimpKyuPSM9+ruZNDeGP /bO8ZTfRdrn3hLyi6D24Fda5unKebc3slCBDRgIVZyAyb98fskDSB/VQ0G7C5kcROzmJ xPMt9kc5V0gtH+ahUaVyBkmXBQvTOru7EfoxOfOJFKu2WGRO7d7Nt7csWBI4J52j0wci 7MVQ== X-Forwarded-Encrypted: i=1; AJvYcCVd8RAnHxTJ/AjUIKqDv+//d3dRlL4sQbS0XRkKjgRTiW3iLP6Qnph6ObqRcb9HEIWSEloGNs2LnY49RFZOWBoBTBD4bQ== X-Gm-Message-State: AOJu0YxKL++USkD5xmtYCXxeiMJOdEYEPiSGeR59Oj9p1McDgZ7uAj88 pLa7ttf2lS8txX1oQ+d2TdsG+nk/NBjiDjK8n1P2+lBKuWviEf8qRIZggTJHJ/o= X-Received: by 2002:a05:6820:210c:b0:5c7:b679:4503 with SMTP id 006d021491bc7-5d564cfc023mr10902978eaf.0.1721671064336; Mon, 22 Jul 2024 10:57:44 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55d4eb2e7sm1325847eaf.46.2024.07.22.10.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:43 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 04/38] mmc: dw_mmc: Extract FIFO init into a separate routine Date: Mon, 22 Jul 2024 12:57:06 -0500 Message-Id: <20240722175740.6985-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 a82f6a96db39..cbfb8d3b8683 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -540,6 +540,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; @@ -564,16 +578,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 Mon Jul 22 17:57: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: 813746 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985242wro; Mon, 22 Jul 2024 10:58:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCURrCRuRuWDSLEc6i8CZqL878UoQX/YgrN8eg1vXwP8QgPxrokAJTEo/JXOrKeVvVUC2sc8R/JRHe1ciWZl4nzs X-Google-Smtp-Source: AGHT+IFcvm2RZu8rcgh24XmBiS7DAbgrQNigvMNUl8w6f5aEZ8U49dRvVK50z9usgKYr04NhmsN7 X-Received: by 2002:a50:a453:0:b0:5a2:594b:be56 with SMTP id 4fb4d7f45d1cf-5a8ff210564mr940990a12.12.1721671119096; Mon, 22 Jul 2024 10:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671119; cv=none; d=google.com; s=arc-20160816; b=aXZkK3EqqYHxrC2GeRRHesH4i+3SPVW/7YMqm+T80ulZ8F0d2AgU0zCCrJbmBYLSLz Jc7U/mteIBv+zQpJ5fPQR3LMDYAuDWidnIVfh5fnwdPIlwtz8A6Y26nhE3Q4DotkY6Fn IRJK0JI+k2ObosFhPCwx4E13ubb4IU1Q5KjKGg/G9wkOTqYdSLrEXFuPenGLY9UNZBBE gK4eteS7mCrQsd6J+gpfcDVgb/BArKmTEe6s7P42XvNgpcFhGRvz/pJ5/4YQF5ZUwo08 5tUCWuQkyqqjkjeHiH+o8adymH5V4PNjIxud46lnfuRAJDP36I2NQIMXGqzOqWTk1jih 0h4g== 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=0SOWexDhZKgy98qvHFC6VGW70pjGoZQlJAvCc0MDcpk=; fh=31wjvyyGWjJMFCXIkFpqmsFu3Vb+A+PSH+Fe3XHFFDs=; b=TV77EMJnYlxj2UTjO5JChNiK8NAlmTUL+y4qiXGlW90C7tzMBNnw0lpX8YRM+JWeB3 oLP6RQKd/CLQHvqaY6BfHQsy39HB0BbfXXuRQc8Dv5WTAGyGafQx6UoTqJn1RdrK500+ Hw7YfObvzSZ3ov6i/LcH34YSGHO/OIZV8+zaMieBDo3SXn7aoGs3CmfLv8ysoQSlwG4+ 1k1GMmCDgPkgjaSOrbsVqDlgnEun8aHjZ7gfO6W2hkDTfsqnCTTluxFWCmGNvkqKLUZ4 yrI3qMNSvcV+SR8ZIzWUhSlfqOZivF1UXngsTU6vQpyIWLyMsetIBOEunRAuu3fb7tlL wbYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cp+o7Z1T; 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 4fb4d7f45d1cf-5a30ce93ba1si4688948a12.688.2024.07.22.10.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:39 -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=Cp+o7Z1T; 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 439C78855C; Mon, 22 Jul 2024 19:57: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=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="Cp+o7Z1T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 874E5884FD; Mon, 22 Jul 2024 19:57: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-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (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 4C3A188453 for ; Mon, 22 Jul 2024 19:57: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-x335.google.com with SMTP id 46e09a7af769-706dea920f3so2179527a34.1 for ; Mon, 22 Jul 2024 10:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671065; x=1722275865; 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=0SOWexDhZKgy98qvHFC6VGW70pjGoZQlJAvCc0MDcpk=; b=Cp+o7Z1TqsjGoGoWLaA7/2BiB9K18mnl5xZJMyDQtytWuq/5YjLrJYnk10ogZihz3h JitY3IdK7CT6TnA65sSJ9LrhR9I7izEc6K/H1P5dnD0wxq2zNabE08RLPaUOk2e103Wm jFtPu8ZfPnuQhKeH9a0QInvuNf8LFYIRCrgCMbvDoJEgpXQ1S74yBTGwrtVTHEhkPxMC xTG/TJTtCf9FjdCB3Cq2WYEITgvBdKH2g8d66KXAglx9rJDGwEPbzOj0oRrxga8MrABP m7GcmaQuoi8XA+Osr5ebi0pF3w+vtQsXxYdmDRjUAAXaMCLgAeHTS1IqKboVjLMJu3kk TH4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671065; x=1722275865; 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=0SOWexDhZKgy98qvHFC6VGW70pjGoZQlJAvCc0MDcpk=; b=BnSWQKekeU2NQvLy2kdpCEKCfj/gqCY38upoNP/ZqfSwsq1DM3URYzZl1mxzjyI3R1 5CzUxZUSMfZRJaJQtTtVuvjUPpUgpPokCgWLQNOcj1W0Ml+lOTHh3AoGFczxSk4O1Kf9 jUnMcHFd7XVF9KA9AU3yXraB/11wLniuc39xQ6lxRuRTy6lwvIhSRgc/WVAoK4DaTISy yQ5Yjh6Zz1aTr2FXbfgYd6q4lwQ/IQ4lOmf86ZoA0ufZJak8LOdPkjkGfTLf5InhaB1O wCDMfj0MS5bOrGuumvdtq7SSMXFoieul9f2RQSJxypA010DjQPSYpzXxTn4IKz2ixccU ZWbg== X-Forwarded-Encrypted: i=1; AJvYcCWUBmxEtWjBeCyUYew7Zdva2KsdFjLrEv3x3V3nK9EtcMhiaGjpepDhSwPNASeEXVUUCxejNS7yPhp8/qlPJuClzNlNxg== X-Gm-Message-State: AOJu0YwcDvxkH2eyBvliJmg/DKBrs21EcMIEt1zALEGRwcZX/3GpLIZM gVth9+A+fNkFhcmoCQdV7g8ReH8rM3REFdwXlAYdkB2iD8XPcQsnCXFg7TU3SQ4= X-Received: by 2002:a05:6830:2aa7:b0:703:644c:84fc with SMTP id 46e09a7af769-708fdbe2457mr3225644a34.11.1721671065029; Mon, 22 Jul 2024 10:57:45 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60c2be3sm1624885a34.23.2024.07.22.10.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:44 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 05/38] mmc: dw_mmc: Extract divider update to a separate function Date: Mon, 22 Jul 2024 12:57:07 -0500 Message-Id: <20240722175740.6985-6-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 cbfb8d3b8683..7bf3279ee9ec 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -412,11 +412,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; @@ -439,35 +484,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 Mon Jul 22 17:57: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: 813749 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985347wro; Mon, 22 Jul 2024 10:59:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW2QsakOq/hWY0fdAWrrCPERyGwzPeNaDfmgDCKdjimigErBH5oI/LesTkSxxnMGGN9a1ktnkjt+RVDCEqy01SA X-Google-Smtp-Source: AGHT+IF6rLEyP5zPOR0vsNtaxk9PQnzRVIty1MrmZC5WxxnDP71Zu6rZvMxGVrrcISMxLZEHd6Bm X-Received: by 2002:a17:907:3e1a:b0:a77:d4e1:f66e with SMTP id a640c23a62f3a-a7a41b96178mr851632766b.20.1721671140518; Mon, 22 Jul 2024 10:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671140; cv=none; d=google.com; s=arc-20160816; b=0k46vFhTfZ761p+jw8/3N0ESej1HmiyGKBK7Tz3KLeq1KgwiXaSx8IhBafUFmMQ+Ht FbaWnsXyALOMclbqyE0g6CwipwqbnZAg1ijC/PTrY1988+v0i8Ju3Aq2J47yeuYk7NFQ /IbQY8UBgbbbYzMDrqq7thLVa2RuH1m9WdXsKLzCz7LiUmlqTep1CL5YVuVGEUdW3uNk COfWrkKUHsPVI6mG5HSgJJHBpuSFcGVZop17uBL4fIpfrTthapTSqvBgplohFXV+Payz wmiPsyN6m2/HL8w8xy9sgJE3Y/OmDDFY350I6DqLjNa7AO0M0q238ygThgnl9puqfYD6 kIFw== 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=5Sb+eA0nsKjqJFteQS72+wjT8H0sZbUzKqM2Sbywazg=; fh=54w9GA0IChQG9lpc1CmTD6877FFVtMu5sRPdAB1Q+38=; b=FjDIKygrRPmZoAxRSHp/VInPUAx6i3TsZ1dp4Wc/ulOsr+NtM6FYuJrN51p/fcQxnY tTlrYEG5JpPM+QSOxqXHQQJRdTdzRaxpQjG/BmgUdBlxM/eygMMlM7pcXllFkRxYcC9y 3axqkPiwPws0NslnGNaKp4/G0hCEVtmy2Ahgj+/lKsFBMxdTG1Cf2rJNQisrvbnIbkLW ahOloOYaSOxXdkiOHCuesNbYzvaT9SK0yTM4934VosPRTZNmVUlHYUoF5mAE4cw4qA9C J+9QxRw1dVd9RZlHl6MJZgATimV2jpDPeLqQtdySylc1NZnByDQWNsNX3xAT13UAQEOI U1UQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wzd7XsRG; 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 a640c23a62f3a-a7a3c954c63si405765566b.829.2024.07.22.10.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59:00 -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=Wzd7XsRG; 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 1933D885CE; Mon, 22 Jul 2024 19:57:53 +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="Wzd7XsRG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 11404883DE; Mon, 22 Jul 2024 19:57: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-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 287A5883DE for ; Mon, 22 Jul 2024 19:57: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-oa1-x29.google.com with SMTP id 586e51a60fabf-260f4c9dfe2so2094179fac.0 for ; Mon, 22 Jul 2024 10:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671066; x=1722275866; 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=5Sb+eA0nsKjqJFteQS72+wjT8H0sZbUzKqM2Sbywazg=; b=Wzd7XsRGYDIs7Slxn2DlNCJojOywj2pcRLz2iPW2tDl5JicYjztf74yBsc/8208YBL TuK3otOoKyOgKH6vcQRjNS6dzh/zIFBU7s2g0eP8ilBqdXGDwVsod3LApV2TBFX7pzRj dZZpe7yyZv1H6NQpTUqk6+I3Qa8Vknbk8GXo8vihoyoyxXToVnxBbUAsrj4hDUEFraew mg8giU1lz7dudSFwzwnB4wXtzNTg4176arJDZrxRZcEGCI/Fe44I2eHgbEDU07rZGHf5 CwJqtTmoC0U2MahYdYnfvJQGRZ25WVEt8hRnG9OHmjBR2fYZLRkkQs0LHs2PImG9Ve3G zf0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671066; x=1722275866; 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=5Sb+eA0nsKjqJFteQS72+wjT8H0sZbUzKqM2Sbywazg=; b=tT5Y5we5r41Sq2LVg/voyp14TecI6mvtvzKAKnI13UMPqEChi1obB2+uu+V4ckzTxo EgYncEYyYHo71TheqcENgh/v78M8iUTiL2U6r3U1ISqTR7bqYb0b0iTjo/aFJEcnkzpo ClzWXQQYmm/demp4/jb8ojDn0+A0mFfPRRDLX6jpxojoX+PR2dXupWN/h+mQv1BYcCDR XFe77+BFt0M1NUu0U9ddu9NqyYy2mUeLg0+uvLlHlPyky5VkyBPPUgSdawKUu5T0PdJu yu6NW8y0lQ+4Xg3QLI4pJmW1dm3umBQaBul+OIAeAkkRd8FneXXGSg5thlhI9qNlN/xt folg== X-Forwarded-Encrypted: i=1; AJvYcCWZdWiVRMxewVBYOgQgSG+2ZD/ghfrxtwGlhJgSa4s3Woy4fpKeU7s+BTpmKxvz3v5QqwZ7AZBtYmTcyn0Ub4wvIOcPAA== X-Gm-Message-State: AOJu0YwlvUKOxi3oCF9g5obfd8dkkrXM1iofeUNNcZf4dX+3gWAZd4JD Dzqf+P/8qXsMptLi9n9z2DjPo+CHgYRVS2utE3wdwwTSaiP1SspLnHtJRVaw11I= X-Received: by 2002:a05:6870:9382:b0:254:a6ab:e10f with SMTP id 586e51a60fabf-26121c07da3mr3934949fac.13.1721671065765; Mon, 22 Jul 2024 10:57:45 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c76bf2bsm1764090fac.13.2024.07.22.10.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:45 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 06/38] mmc: dw_mmc: Extract FIFO data transfer into a separate routine Date: Mon, 22 Jul 2024 12:57:08 -0500 Message-Id: <20240722175740.6985-7-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 7bf3279ee9ec..37a1125fba4f 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -140,25 +140,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); @@ -169,50 +211,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 Mon Jul 22 17:57: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: 813748 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985280wro; Mon, 22 Jul 2024 10:58:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9rQ59AdnETN8S7MF+Q+ZPad+5S+Saa+szuREklyeoNZVb52y2Fk36zuKGfS3SW0DFyOwHmvIIENa0/fG+F3Hx X-Google-Smtp-Source: AGHT+IFbG6Ijsi9b4cpMDaAZMPZT5kla4R81M3XiOT37sceszaaEH5zOyz3sSB0uKZkddu416TA0 X-Received: by 2002:a05:6402:50c9:b0:5a2:28d9:6062 with SMTP id 4fb4d7f45d1cf-5a47ac09a68mr5370759a12.35.1721671129733; Mon, 22 Jul 2024 10:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671129; cv=none; d=google.com; s=arc-20160816; b=CLO5PIk9xNxX8WfyNRN7M1ll9Ef9OsOqNbPvJB3Q3kee9ldqpKG5YEb9RCHHjfKssd Ovuxxe/uqWHHdYGDNXQjQHhZFT7NgTgKRF8z1E8LCZA3a9qtpWuSKqw4FI6Lu2Tyzrzq prpuumxwuPbneiMTAcSxgmI8zLZmPAG0zUOUn5AeiHmL4Y2rIYfD5tFT7Y8obqqntg5W WeLHWSgNDjgWmDAX+8kmeT653W1e5350A06Rp5FUx4ntb8SDmjtcyAVD9159z4peddLt ZqHxWf6beBAUsgzve4b/squaNsVhn7CkNq2CtSmJ40gAZtinnJzaTgenoe0LNceU0syv aICg== 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=11WuBB5C6fLNVutMYcUdxo6m0qC6Z3s9HJbjOLj/k8Y=; fh=76gxzEgX7hS64xLolvpQnyKjKWFYMp5tg0YWsdmHYa0=; b=S+8fQS80FMm0AsmCTZ2gXN2Zg9mbFgyqGHi65vuJh2CT/prx0010G9/65eqL0+V9qY f2b7g17wkBctZQbrOAKMm3nDTqQOTGvt97tm3XmHu7SrMv1jgi35jZ+hfpCPBrz1DqyH fhf+BsmFyow22g8HXwtc61cbxDTgJifSSaYCOwo2wQdEkctjx9bpyQ8q1kEwbRCddzsh Y7x/LjZRcRYB34YX6aOfmClEsVvu6loRdWhfNeOpgFYDg/LalE26T+3vQDZjOjbmYE5G 50m0diVz/+mxMCkP9A5zFZx+saEg/gTk1rqNHMbQG4cWe4oeI2lno/m6+IyLiWNYA/1D /IQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PDi2YLLt; 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 4fb4d7f45d1cf-5a30c2f3e4fsi4607777a12.380.2024.07.22.10.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:49 -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=PDi2YLLt; 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 A9B3288578; Mon, 22 Jul 2024 19:57:52 +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="PDi2YLLt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF2A58850A; Mon, 22 Jul 2024 19:57: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-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 A8C2D88403 for ; Mon, 22 Jul 2024 19:57: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-oi1-x235.google.com with SMTP id 5614622812f47-3d934cb84b6so2749111b6e.3 for ; Mon, 22 Jul 2024 10:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671066; x=1722275866; 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=11WuBB5C6fLNVutMYcUdxo6m0qC6Z3s9HJbjOLj/k8Y=; b=PDi2YLLtKibC0c9i49n05YxWkkp6hBcL5Kz3v+W7zVkTK2T0KgZlbl99I2P/XketlZ wiuLZAgsZB6pb7W+ANtsjNT70FYGp5vu2neGoWje90cHNWaqrYAKc3/DXZCQvR9BuhL/ elrE4ga27Fitfam0Z14AvNBLO9jzEk7Z34O+B5v5MG1P0LkwrlmRXgG+TIpjP66TZDKQ Ycf8iWRyktsNSg/MaDg7bC/ErgDr/3NLX2aC9ENwC+rZLigSnhzZlj1oF86+FmhrUEGE 30qx/B7tA3RAtvMZIfaw6Z1PTKLaihsBZqWZRFZ9/plkU2BRx4KL1Ipsgo20rOeWVGgy 9X9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671066; x=1722275866; 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=11WuBB5C6fLNVutMYcUdxo6m0qC6Z3s9HJbjOLj/k8Y=; b=hwJwXfT3fmOYDKsILNORFBf9q5NUMTicsQB2R6YRWum79oVU17JdVVHP7PnTlSth0p LKsEaledi2EJ7RCnqXRPGBB2GTJsZJDmOUdMbJop1zU8t5/OfxexKXfBPzctjjXBG8s9 v2d/0ASg2ekh5qitLLpOiWG0+qxBV2K/L0YlgsEzYhd5EuNGX4ELLG+HIEChQ+EtRkKn 5mdteW1faCdG1DGgMPHrNx4VKgGGaBmcTBP0+ZVLcvnekpeq10n8HsE8S495WT1hXdbV wQEGp9L+CVuYTVJcNo3IBOGjuyNctFddsQAp2GXmLVcIxibhHuEX2Ozzx6vUSYPzP6zH i3Iw== X-Forwarded-Encrypted: i=1; AJvYcCXdoOxsl9Am3G0CxKs581/tdfjtxJtWIKWa1xAPoAAiv5bUDElzqTzqkLY6kLgm7b/6imDSDMQa5EFEF6BZRS0eW12ZEA== X-Gm-Message-State: AOJu0YxQRgpB7nUH5El8yy1ouICiPMDZ0l8BKzN1aprXsih6b/iI0Ecd OUGx0HUPI5pqugKxiya3FrzyrOcsP1GsPVqbrisrw+Krl+uz89efdHPsyNLMp18= X-Received: by 2002:a05:6808:1688:b0:3d9:37b8:dae7 with SMTP id 5614622812f47-3dafd0ba558mr796315b6e.1.1721671066473; Mon, 22 Jul 2024 10:57:46 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae098bea1sm1599821b6e.27.2024.07.22.10.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:46 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 07/38] mmc: dw_mmc: Extract DMA transfer handling code into a separate routine Date: Mon, 22 Jul 2024 12:57:09 -0500 Message-Id: <20240722175740.6985-8-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 37a1125fba4f..7b20f4936b62 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -233,6 +233,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) { @@ -275,7 +302,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); @@ -384,26 +411,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 Mon Jul 22 17:57: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: 813750 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985397wro; Mon, 22 Jul 2024 10:59:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW958H6hjGHotZC5d7jyid3zQrhufizEjE3mAaxPIL341K+gJj/4kNb2OegwQDTCt1PUXCblqFJ94Yh3E2KRK+l X-Google-Smtp-Source: AGHT+IHum83AuqqGk/XUSyfnBmwJMvazvn095V8t9q7e3zZKgVYlg6vQjXrcIH+lMBjxuNZhldJl X-Received: by 2002:a05:6402:5246:b0:5a0:ec55:86dc with SMTP id 4fb4d7f45d1cf-5a478f6d638mr4666003a12.14.1721671150607; Mon, 22 Jul 2024 10:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671150; cv=none; d=google.com; s=arc-20160816; b=x9XM448G3CsBb4O6Vk1XRfEbZkPtLyiKOJlONQ3Bk7ipfPFVeECu2g7pETHFyy/wNd ZifBNVTrBopoFhddhHLDvV7QVWxw4Tq5cA8uCTZP7FKDGZ4fysx49XClAtzxXMiQSYB9 9MsdKw+yICB8yDWiRvHNMIVzhb7tQM6VNnJwYjDRJAu8hy7jwnLyzyLJuGieuRqf3tAi atJUHnf1OIQ91MYnA9LMkIwgrIowjVfVktHPcWkLZRFRgpv43sKTw6VorbczpEPmtx8T 7BxnjHshpl40hSx0txDKcFmWekLgNMQ5aRpPIZwSCpnSwGds+uXLsgctn0zSgiLJ1eUn o7Fw== 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=ayKudOXUaJapN/875CebWt66dclSkxeyV6btsdEkOpE=; fh=8CA5dHUCMCgewYCtoyWhivE05QEr0dtiwUP6GXCWyFQ=; b=qb9D8x3Xa+qF2K0SklAga/OWXgQ9jPmvb+9IPHqg3RLfY6LtasuxXFK6psK81k/FtF HUCVB6Z7PyNprKhcG0N1dGHYAByLeXpyEqCwUTm25ouA5Z7pwA+euPuqrBYfvwWI7yjP Zb+HldOjQDc7DBeSBwsOP9P1JDHUGIkblpXvgsWSDfb8gjIVBvVLK2Q1UxD6+Y05+6d4 T/pMhuFizeVRuZAZHOyJQTJcv8ujWh+PDZK0tcJHdf07F0Vaou1Nrg9LHIT+oUzmq11H ytNLELmKN2EhJ7g3vayHrAjliorh6esV9eKpoviWSYPwCRT8wb2yasl1YagcFhwP0wxh nYXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mPjuEyvS; 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 4fb4d7f45d1cf-5a30c2f62besi4708018a12.463.2024.07.22.10.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59: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=mPjuEyvS; 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 76002885E4; Mon, 22 Jul 2024 19:57:53 +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="mPjuEyvS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3A70885C5; Mon, 22 Jul 2024 19:57: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-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) (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 ACE0188005 for ; Mon, 22 Jul 2024 19:57: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-oa1-x2b.google.com with SMTP id 586e51a60fabf-25e397c51b2so2408968fac.3 for ; Mon, 22 Jul 2024 10:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671067; x=1722275867; 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=ayKudOXUaJapN/875CebWt66dclSkxeyV6btsdEkOpE=; b=mPjuEyvSY2TthWyBlqanQKeZQ9v7umZMxOCfGGXeGnqQ74c0qQrQTQ22qowf2HVnTM EAF6soQHgyXtVHp0Y0huXbAydlnfL0IsMja1S2qAKfXDCDnFtIx12XfL2pDuQtTGKN6o WgW2UrgrpwSiMJucdYmB+6rZ6s2cJ33PbqWYrGkNR8HpAFWkUCBsysVv0bjTsuwnVfum ATjoNPHtvETnzMNTNYqG7oWT3Y91f7cuw8/KjLqbFYPIPLjQAiCvE8xWw3MwPlaXQVY4 SEs8+utUQXYpqwHc917mtlezMrySznScm5/g70b96J1+czS44B/g3vPJ/RAvGO6M3yWM XCoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671067; x=1722275867; 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=ayKudOXUaJapN/875CebWt66dclSkxeyV6btsdEkOpE=; b=NhR41uBqeeHOgv74cDSe693vXDHoGZ/fSv2ARecJH6Qdb0iSpsrIwhqs2BGY8hgjRX AM2rsENvnVNJ6qHAy903MlzPuZustnYP2vmD4W33GZGvN2Vc6zOafS1YOUIgMLp3wYpb eTodCSLnShuzJHjY+cNiR7rhwZkqAKQhb4xtEA3tH56NJ2j2gCdvacHRvgnlP0YdoSY2 HZGY+sN1rl4m8hCqgRXoOwewGjPeY2GBnK/s9VC+V9Fbdn6IqA2CF9YiP4QLtARbLifj SXk5oOOYuFbfMrIWe9ggNFuEQTMLdUOUeTabBdQdPDW7U3u00j4bw92dDC+lXEeX47g2 SMBA== X-Forwarded-Encrypted: i=1; AJvYcCXVVYyVrp9amUb1oOlLproPFN4KbnNYh8RAV806tnM1I/oxCRfuALlX6dNE+YXl+Nb/dMZEvXgamzXBjn3xCwAtpz5vbQ== X-Gm-Message-State: AOJu0YwWEbP9dhMMPNc7odMwp5zhH+9knAGOh8AVlV0s/9ui3EOMq+dG sVqvP3fuDMu9Mfhdy0TLkPZocuL5kpkQeJN1jbNW/OzdICyARmXHATpuSrqkoZJ/JoKMl2IOVV1 o X-Received: by 2002:a05:6870:b61e:b0:25e:d90:fe78 with SMTP id 586e51a60fabf-26468fedc06mr413861fac.8.1721671067353; Mon, 22 Jul 2024 10:57:47 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c716fddsm1783083fac.8.2024.07.22.10.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:46 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 08/38] mmc: dw_mmc: Extract setting the DMA descriptor into a separate routine Date: Mon, 22 Jul 2024 12:57:10 -0500 Message-Id: <20240722175740.6985-9-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 52 ++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 7b20f4936b62..8bec43f0bd16 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -53,47 +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); + for (i = 0;; i++) { + unsigned int flags, cnt; - /* Clear IDMAC interrupt */ - dwmci_writel(host, DWMCI_IDSTS, 0xFFFFFFFF); - - 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 Mon Jul 22 17:57: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: 813751 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985461wro; Mon, 22 Jul 2024 10:59:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXJKeRJrN7rI1k6ZxxKcT45PB4/SZ3TEh1HW1ZcThW5DB3SLKWyJqqTaer9D/qDcL2Slv2NTfNBVkvFXKo2uNUW X-Google-Smtp-Source: AGHT+IGH2IRBiyGvuzWkH7414NmMltuEZ/LWnjKVlBelC2sXFGH64rd/uDZGUuM3G7l5A86eIoej X-Received: by 2002:a05:6402:2685:b0:58c:77b4:404b with SMTP id 4fb4d7f45d1cf-5a40e26964emr9192403a12.15.1721671160452; Mon, 22 Jul 2024 10:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671160; cv=none; d=google.com; s=arc-20160816; b=C2wJPyJaT90fJ81wjx20kgodXmwZmLCM1sIjt5/QFIrotUJGLnxJSO6Fx71q6Qu7Dr sv4WGpgM85Ufld2P1rf8P1C2MDZDs9qafyWPtgmofzV7CIDgumUbkaB/xQ5EyatQlKDI lIhsvEYOOZro3iqjbTQ5EEyQ+HjMTbgOarwpr8mwluEVB7/0Vo2160dacyAeGjTZJXaj a64eZ1MUTOS+nRufU8hO30zAvj01bwCUf11Y8btq/6ErNVV8eNDkmv8n/NgiRb1kG9fI ZzZsCFaHw2v8TykZs4W4SjX2w4MCBRsvqdwMJr+6mRuDCDq55Bjjbeu5YcxoMu0bv1i4 XD6A== 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=SkSjjSgefooPtdfg8UJb3GaBykHruI04D5TWcHQtrRI=; fh=ltymms4IKIfTyTSJA4a7/o4wharIUcpmLpE15hUxCFM=; b=GkQYV7lux0oaPXzj3ABbbCqHNx5VBV5M7ECICtXPG4GWO56bRfJUgN//C+wIb6ueDi fzFJvyuZb4RjE7pjmuZztWgh0ee1rJGTKXKoQGGi4xN7YWo4i0AYl9ZzezbM7cNcia6o qVH/Qj9hAUD3AG6OLfYE6ngKZPIGDGkxg87dM4fb+3TQHez/3ikB7w6/G1qK01/WhX3j agqszm1pir3bSWUxXKGP599Halu6VVm3RGo5pe7oV69wRRqlajcEJakNSHyKPzt+W1kp stG39zA8NJxRRkacF3iW0EhlYcQTfvlBcJczoipnEmva3rL+6DTXY43Y4yQaLVISb6eH BpkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gzFu/9yE"; 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 4fb4d7f45d1cf-5a30c2f3c74si4816944a12.390.2024.07.22.10.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59:20 -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="gzFu/9yE"; 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 D0B2C885FA; Mon, 22 Jul 2024 19:57:53 +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="gzFu/9yE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 743E7885CE; Mon, 22 Jul 2024 19:57: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-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (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 4CA53884AC for ; Mon, 22 Jul 2024 19:57: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-ot1-x333.google.com with SMTP id 46e09a7af769-70365f905b6so3012253a34.0 for ; Mon, 22 Jul 2024 10:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671068; x=1722275868; 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=SkSjjSgefooPtdfg8UJb3GaBykHruI04D5TWcHQtrRI=; b=gzFu/9yEDB62fJUwo92SIsEN/8C7QUR2DSYALmWRA3fyr5nW13vd5i8lDeIvhelyKC tWLI8NtnMa1oCaG2+rInFE58OKARajHOPncc/5AUZwDB+CbiPbIpEr4X1Ur7zj0mOzSW shrK/efFpU9wselz68/I1vyccttTmYe83DoA//NTg4yPyMfNiuNIYDqFjitdv7BflHGu HDV9ftSpyZk4P1JcJxxeyoDXmKn00B1V9yq9EnTg7A4geZ4gyZX6LFPirlVALpg7uv1H Sw6olkVsmxR5smmADV5cxB25SHV8o/hjPZnF7xjSabiUfsLnapahEAhCZ8nTxZb42tBk fdnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671068; x=1722275868; 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=SkSjjSgefooPtdfg8UJb3GaBykHruI04D5TWcHQtrRI=; b=FnlO1aTwpJCw5wvkdRBMPNDmLXbO9nm8IvdWtQkL0JnAczuyORA3xMLw8eNNh5/IFX FaGlP+B12ul9uHJpxjdP4AXYwcCShPxZmNmpswRKs0ucvGmLQuFVUtLiDiqhFAzvbYOo A1QyYm2GBygDim6i/Ak1vVIUL0L4BcaVCAAtu6t3RVKOSrAhrTvgt3Fok8iwQFpXJgbC 8EnmFQig++LWhWU7c9tm5njwS0XkdphGC/W3kDqNjREGQLJy3bA2NU4qPm26182QGU91 NH+V7mnpz07YuV1pBzYPOw4X/75rJNK0sqNtifP2IWkOg5SLavpJtQyiCZogjS6Y4eiW W52w== X-Forwarded-Encrypted: i=1; AJvYcCXXMcLaIz42eoeskcoVJ8FPBmP2ZQv5/77gMMGWVs9g4p4JUrXtQTgu3o7JzUaza61mFvixF2yCYrZl/hxt1OH98x9/LQ== X-Gm-Message-State: AOJu0Yz1UQi1ihSjXwbNEOG1+jMeYAAU0eTAau/K9GF9jCzJmWe9ajKB kRNxT58SjAy18uG0SRX+YEftwZYyxgWHGTVEAZbIMxXQpE1Q47PpTivNC0MdyjdhZ9WVFPYe/kp h X-Received: by 2002:a05:6830:3c83:b0:704:7c75:b13b with SMTP id 46e09a7af769-709008804damr8501761a34.6.1721671068112; Mon, 22 Jul 2024 10:57:48 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f6174359sm1595089a34.61.2024.07.22.10.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:47 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 09/38] mmc: dw_mmc: Improve 32-bit IDMAC descriptor namings Date: Mon, 22 Jul 2024 12:57:11 -0500 Message-Id: <20240722175740.6985-10-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 8bec43f0bd16..a77023ff4cd6 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 Mon Jul 22 17:57: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: 813752 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985511wro; Mon, 22 Jul 2024 10:59:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV2V5I59xJtzTaKXRIhwRAx1CVd04bnDassHOzbdOWi+IQk7DV35OMag3J5up14kI/qoV4hhmDs0bEleVIiZmOE X-Google-Smtp-Source: AGHT+IHWiTlQJMK3YEvD+swBUo5lJK4P09uDlLPcztT5pxU3s6QpujjpT55YXyIBfPVM4pHhKgkD X-Received: by 2002:a05:6512:39d5:b0:52e:a648:a72f with SMTP id 2adb3069b0e04-52efb895c0amr4107807e87.45.1721671169945; Mon, 22 Jul 2024 10:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671169; cv=none; d=google.com; s=arc-20160816; b=EDqPwyun/6XB0pQbUOC6CbJpLQXE+6glfb0RxsoUgX99DunSluMRFnXPXVOZccy0Mg hXHPMzpKwxERScchoKMkqAFBd1pFRvCr20bJQ9wSByzjVlTmZpYZThzUFGxmWNkTTWhj y2wiq2ZlZRHvwvmClVaIldQFMcph8dqKi/b1wBG9+aA7IK5dtQYFXSjPSjevqOKGanB/ zzLk2YQ4ojfVPHmt4G3Af1rCQKuHH85yyf9PphW/jz3oskUX693FH/f5Mn20A0TEWYUn /byKLT+1G5q8jCiljj3wgT4sxLxRdJDe7J055A629uqhk0C4p1tPDnDrd3ibSSNTEjTs LlUw== 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=3MHyIdpoAUyw54t/oGINv3NyldAoLCepLGpJFqSJ1Yk=; fh=zyxXRpXo3XElngY2cbt8g5vW3DuW4ttY68E/T5JxHXI=; b=rtZzm0vJZsN6neux6rB2Ucxmu4YRDnVu99qJD7GbAi2a7le7Ko5Kc/1FNEJBVoGx0U Vu5xyAeGe9enB8KzDhbZyfdnim0cGvviT5P3ktacEbzOiD5gEyfbixKLMYO+dmmvWUTI yVxHcmbRh4c7pZcpiBCXDZW4Ddzzq18S7oHYKkazpw5ZSsjsINzNIqVkY3wW+MJ9g9Pu qtGgMM+GtwfquALZgO/JktNiB8LpTEsqC8SOia5+3cZiEool8gNZg3QnlRoeIaMEmqCW vQfsRDvqnZ1t+mx2qmstyjFJ2Z2f6oq6zf7epu/ap6+VcmjQEXkyMEci0opqFF3Okqzn 1BWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iBhVTTsA; 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 a640c23a62f3a-a7a3c8cbce6si428312166b.364.2024.07.22.10.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59:29 -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=iBhVTTsA; 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 3F29A8857C; Mon, 22 Jul 2024 19:57: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="iBhVTTsA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9CEA188511; Mon, 22 Jul 2024 19:57: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-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 2A8CC883DE for ; Mon, 22 Jul 2024 19:57: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-x331.google.com with SMTP id 46e09a7af769-70448cae1e0so2468822a34.3 for ; Mon, 22 Jul 2024 10:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671069; x=1722275869; 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=3MHyIdpoAUyw54t/oGINv3NyldAoLCepLGpJFqSJ1Yk=; b=iBhVTTsAGE60vj2GdhN3SETc37Ojegw7ItnVTLgWG+eoK5pC4zvjitgk9RUh7PCbBH DOyQg5sYTnty2QeQMJO6Y71H4+BqgROCXRUuoRmLUBXkaBdYcOqTc7/l91ooJPXOAeiw HkxRYVqR9aduelECKlZc7ZFi6gBtjMKipk2GtE1hoQIeatKhPzuGELY8q49WQdp1GVFd VPoBPDU4DZLuww4OAaUEOFVWSFelh+j1RfsYPjxdjSOZ14il2zR/Q5QlNUfYb4TcHGDZ C3+osJG1ucDbH61jZB5cTzkiXHDkUIQGZjrKlUArF7G+4DRa4qH/E8TmAPe3W1nhUgdB 6Rcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671069; x=1722275869; 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=3MHyIdpoAUyw54t/oGINv3NyldAoLCepLGpJFqSJ1Yk=; b=Yiw3UeevUR9AUl5kbXYyu7N4IvBsBmwjiEelgqmx+N3rSlfnVwcr/3j0b9uYbV/b5n cRGSANJfGdyY59gGGSlWqMGPSkxoUriu7vlQYMdFhMR0JVNaT5mn95sAIeaGIY4srHCU IElzd/RcZVftjnS4OlUCpIEtqjS00ALqVGFeKc+w2wzvezLM7JqsWz6ddJ9xCEeL7YUo aiKUNeMoTPIWddLVsreVPUuIgtqZqMFwnAMcaKSAE0R+huGx5Ix3e8M5jgRFkAXugimI A+qfnpPkAslyTwlW/uyeP0nmJO1VrwLGTRG6/wae4QBkJuxAPxPegXTFafOWTGf6mBzr vzDw== X-Forwarded-Encrypted: i=1; AJvYcCV+Go155NEpjysi9b4l17VfJp5V9qXd/dTmrZzpuNmJLiZM7imhUGn4qHzbjVEnkFuaormPRxRzE+7ud9oragKfYsGCzg== X-Gm-Message-State: AOJu0YzJQVu8NpkhRsooPnEweHfAldQtB1OwB56Y5j0DRXo1WX7oaRur dDR4tm92rfc5O8MLf3yZbFJ+LUd8eZJQbncNZrM1XMEvfnXfaqzPah8EGY+S+tk= X-Received: by 2002:a05:6830:9c4:b0:703:5e7e:4ec8 with SMTP id 46e09a7af769-709008d0985mr10358745a34.1.1721671068842; Mon, 22 Jul 2024 10:57:48 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60c2b55sm1643192a34.21.2024.07.22.10.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:48 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 10/38] mmc: dw_mmc: Add support for 64-bit IDMAC Date: Mon, 22 Jul 2024 12:57:12 -0500 Message-Id: <20240722175740.6985-11-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 a77023ff4cd6..7aa3dbbe83ad 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; @@ -433,6 +485,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; @@ -594,6 +668,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; @@ -616,16 +711,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 Mon Jul 22 17:57: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: 813755 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985708wro; Mon, 22 Jul 2024 11:00:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUB87nev/vsXM+GTIAU5lDimR2wVtXwMT9koLuyUk4XE5rzvU5CgWK1lyJChL1tmZ8RTZXUXfyjFvn3cq8uZmc0 X-Google-Smtp-Source: AGHT+IH8fA4d32Oend6CPM/ThkQiV0EwtqaEpQIwCVzt6vuTsCq47u6W/ZY1+yxgk8rZA389En7Q X-Received: by 2002:a50:ab4c:0:b0:5a1:4ca9:c667 with SMTP id 4fb4d7f45d1cf-5a40cf09a8emr8917627a12.11.1721671203831; Mon, 22 Jul 2024 11:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671203; cv=none; d=google.com; s=arc-20160816; b=C1VGy1KxIfK1PHfwBCSdWTKlnJKydUf1Ua4LjfMWJtgwrtehkDOopVuWKoGLR5yrMY x2y0qLyi2IiB4mmb1Nw75wgKQVGyQ4R2lTo5QHekOuI11SEkEXuoqj1wt4CGTIN42ZK1 QcgqeJ8BLSpWv36m+wSmzEHjMEIIiswgZUQKwprB9SlJbPoaW8oZdZGgo/2+zjjncWCe gVu+bHg2uOOURP5H76y2IG0M6Oix2VzzvBm2T8StedlxTEpK4UUGg+FmNkCqBfIXVFYs elCoNKFLf7uNgIr2zhv3U19pfj3UyqiNBYVhzNqZrjSUxUKA5+5wyARu1EOs8h0iiK9n 3OSQ== 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=1aUcQOokL3xqy+2RQdZCNrjA8SK63j9nZZpmOhUjF74=; fh=tIOCcr3zH29SYr1i8Vdd3A9RpY+1vqC42sPXA1ne17M=; b=NA0Gu0kFqARFx49pnlswutNGritUKWnqj99fK0o8jzd04L/Q9IBwZRYPfeA/0wykFW tRwNZLpR297iLuy+5twdhreWGF4JBtBXzyaG6COLRmU/i9TXI1pxUkaOiJTtOj+0IbzJ UrFCUQVejDI26Uy5BwbSuWnkAvFd6gUlVLWM/PeEhFgQmquA34OrF8ENGHOHbC+lLf9F 9LmFaKr9EAehLN5pqyrO/feLE3sjuaHsyDe41Vys1xtTBzIoZB5fXqPt23/4/Yq3IsWv iX/+9ag9bxb2e7M1i1+uY1xdJQRZSpoXBoX9Xr40svn86uJeYA0j9g8Hd1lQRg67DMnR 7Yxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTswfDU4; 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 4fb4d7f45d1cf-5a77d9b7475si1774816a12.91.2024.07.22.11.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:00:03 -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=QTswfDU4; 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 54F1188636; Mon, 22 Jul 2024 19:57: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="QTswfDU4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C032088005; Mon, 22 Jul 2024 19:57:55 +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 CEBBD885C4 for ; Mon, 22 Jul 2024 19:57: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-x330.google.com with SMTP id 46e09a7af769-70360eeb7d2so2292928a34.1 for ; Mon, 22 Jul 2024 10:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671069; x=1722275869; 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=1aUcQOokL3xqy+2RQdZCNrjA8SK63j9nZZpmOhUjF74=; b=QTswfDU43Kglxw7LlOiXNCrcKkmqwjBcEyW6Oc6M3X7B7SshQaXChtN2MqCqfMiYPn SnnG8/Vv2en6fZBpmspbLS6rakcFX30zvT6+hPLFRMNhRwDy6L3JhsD7lCeKAWnxUcld D5FTxZx6jjuXt2X115OO07uuTTsafiIxU9S0xwhbvyf3ncy1Cny4rxZ5kc4vgAhNZm9d UfkqypU4pcPPlqiJ7Sq3U0a2/XAMWmYDP/tOQs28OZCKVWVmO26aDckBP//sThqvE1iY //MGDEdKm2enwguIuBTbU720UTszfm2YerkDFMuTwF+MqKLOjJt+SZS66S0zAxwx91+D T8Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671069; x=1722275869; 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=1aUcQOokL3xqy+2RQdZCNrjA8SK63j9nZZpmOhUjF74=; b=bzwYeaMt4WLXvADpKYDCA08kFvD2kAFB/9C904uXCK8loNzmSQ0WB7T1BGG4I5p4vP JcoIIH/59L54xfv6k9ODilS6PR+7JZ7D/z6x5zJosf48A0OJ2QhwadZ+xVO5G12ceOcd ODRpjKxzZXy4SzmplxwJIUOF8KsiI/ah3Ft0wggDSm+qaHHTLgCZcbVwkYtpZ7on0gtK A/PzW+XxVLzt2I8WgYWgbiZFkk3hfaCDS7T11rgxL8avyMvsun+WQxhpnCxL6yHJYn1O Ooceo/KaUxIYR/fK/95n2GdIP2gvdIo5wcboKmuiCE8JiOLR5c6wjaH1yHIL9hC8vHux Oz+Q== X-Forwarded-Encrypted: i=1; AJvYcCWPHQG/1E74cH6cu4rTE6QpoRm15zdNoXUGd2ytdVdo+BT7iCYU3n/sF5pQcBbGtZXOa8scgPxik072w1EAIyuZyME3Rg== X-Gm-Message-State: AOJu0YwBxcC0kun1OPzV7nkPh4wBn7PqF5Kdezm6tsQKkIidxamm8qZ9 NKV8mucZy04TjNfWL5paN5ByqpVPo3NsfNWPCN3jhBMS6QhLRlrMeB9a9OqzL4E= X-Received: by 2002:a05:6830:6f81:b0:703:783a:dad5 with SMTP id 46e09a7af769-709009d69b7mr12198291a34.27.1721671069537; Mon, 22 Jul 2024 10:57:49 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60d73a8sm1665316a34.41.2024.07.22.10.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:49 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 11/38] mmc: dw_mmc: Replace fifoth_val property with fifo-depth Date: Mon, 22 Jul 2024 12:57:13 -0500 Message-Id: <20240722175740.6985-12-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 7aa3dbbe83ad..8af665a00222 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++); @@ -656,16 +654,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 Mon Jul 22 17:57: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: 813753 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985561wro; Mon, 22 Jul 2024 10:59:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUv1hCJFFGyPuAeqYa+V9Fojjn6Sm5Z/qXNJz+0rt+PWLRQvxCrM+ley6k8uGJVpG83+lX2E9pj7IH7a18+gOhC X-Google-Smtp-Source: AGHT+IE2J30y4gUnTEDmDfZ88aA7MYyAEIQBJKNvs9ydyR0PK2LARhNjX6qfxy43uSVlu1yZJy05 X-Received: by 2002:a17:907:940e:b0:a6f:e75b:2b39 with SMTP id a640c23a62f3a-a7a4c034dfemr531390966b.42.1721671180429; Mon, 22 Jul 2024 10:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671180; cv=none; d=google.com; s=arc-20160816; b=GM561LSCPut+8Ls2jnrSNvcUpuT4XWlNMP4yGSch+HlogHSZDc4tBf410UD+Dtsh28 NEs1Xr7r+zTdWr9vezIsQglkDcMwrqgInF/Vaocft8xhADxmaViCfukkasdZZ353Q+xn kSFiDK13+K8sn5/j20if5CXu5CyaWHH0D9TARAjp7yztMJ8L/pedkASyTYaXa8aBsZfG V1onveAS+ciksg6wsUouCyC/hZ48OQgMDBYeIrC8c3JcAKl0eV3kZbI6wFuJpRQ/SKYM KZsVrtavMgsXTEAkdSW+aAHhv6aNDfzlHB5APDgfJWRctWL1XnFF8uk439Smm427H2pw WVhg== 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=inU69zmT+ZdhaRf86kD0MC5f2+AEmq7litunUhr5UBg=; fh=12dwX4v0PaQSW/EgJhZAwJLHmShZOAMl4DMhwgavMss=; b=sExiqsaO/uF7N+MYyFYC2sXctZzoASmzbtNSu3hl6mSKjUJ0LlWfFtg6JL3X65DeTw /C2GbgaO7gWw+CRSmh8O+/m+/yA1OYERoAPVpGTTgcIIsBIU69FUXCbCy8mX/zJ0/84F TZ+o+Fzo4AoZaydCD0adh1J5Dk6nf7f5AmOZ+LuVpboc4ZFLp/Nu701BslCczLFoSmbb GjjNlUYuVY4xdjTqFn6+fRzhfEXNawyixLKniMjbNpPnX5vAq9Xxw+VNYtC+2R7Jgeks dky9muqA5Z2Zw8N8HlGT87V2k3KtBtuzw5YXaVFXgnfADBoCGv39tEr+i/m4uoCeOYbj 0ypw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=caFXcEmq; 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 a640c23a62f3a-a7a3c78933asi430553766b.87.2024.07.22.10.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59:40 -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=caFXcEmq; 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 961E0885CC; Mon, 22 Jul 2024 19:57: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="caFXcEmq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B770D88617; Mon, 22 Jul 2024 19:57:54 +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-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (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 769C8884AC for ; Mon, 22 Jul 2024 19:57:51 +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-x335.google.com with SMTP id 46e09a7af769-70445bb3811so2118796a34.1 for ; Mon, 22 Jul 2024 10:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671070; x=1722275870; 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=inU69zmT+ZdhaRf86kD0MC5f2+AEmq7litunUhr5UBg=; b=caFXcEmqFxWy5j8+1H264Un9lw0cSVZyECl5c49abrQxw1KvG9+zWuTAKsiqbKzVzT aDVETAYIBsbresJntQeI2S+Eo1uXB9ufoe0NS3MaH/ptTcazCrkWhu+2ZxK/XFIJ7Lkz 8L2adG7NwiQBkR8OOGhZO6FFH+WpfdJe7jt3iTqiBhN1aLxOJ/q6ANsK6iueIPtYU+iQ b4guvb5GOgZIkYGTjLzGnVziDz0znfGREJm19kg5GI7hX2uGxKmccPD4huOSA0pzyRUx ZrujtKyn/h3MX0C01PIXMOvqnP9Uoe8Exb8iohMr8zincrTo9kEi/Uueo1kCkTdIBQgg AXcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671070; x=1722275870; 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=inU69zmT+ZdhaRf86kD0MC5f2+AEmq7litunUhr5UBg=; b=HLNSX338wRIx8zjbH2ZIcHZrFxLv1zgOtJVDCYfodKVqD39BWVMH5jnZncmIyNgTmI SDaxAxMaLzsn1yTRMU8vULSbIfTo/uUYeeCDgsgIoETqna7SaTSwcSIRJhf+j2cU5REV pRZO/IgWUB1jzd06abkjUm7vRJ2LxLt8Q22hZWcmGs1WUkMswaZKglViUhsiYgf9jyKi Xr/ubsnz5TAWOw2RiBUp/SeAvcIsIU7se/2a2giscQyLVLFm/pg3jQChbLt3HHFNGauk JjVIaQ0F+rKd1sAQrlxcXeDN9f1NETncqxUJFj8h6ivUmRXlqj135Yt2Lg4adrGDQI3v Srlg== X-Forwarded-Encrypted: i=1; AJvYcCXyCobSfg1buW+Sglq/z4th6qTiQBgR0oqas49zTgqkJwty4D4RXC4eJNaB/TJxHsy2O0tULTV0+2iN4WhVIQgujW+ZBQ== X-Gm-Message-State: AOJu0YwHa4HUv9lOcJ3nbHj7rXQhQF3+AZKt1EaXUvUlCwMGz4QPV6yO ynBiP75g1VRqickxDIYL7afVWv+lNH7r3IXUfDp+a7wmKZIQLQtAxuJWn3axgf0= X-Received: by 2002:a05:6830:dc3:b0:704:45b7:8ffc with SMTP id 46e09a7af769-709009d29a4mr6121591a34.32.1721671070189; Mon, 22 Jul 2024 10:57:50 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55aad1958sm1384450eaf.35.2024.07.22.10.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:49 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 12/38] mmc: dw_mmc: Fix kernel-doc comments in dwmmc.h Date: Mon, 22 Jul 2024 12:57:14 -0500 Message-Id: <20240722175740.6985-13-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813754 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985625wro; Mon, 22 Jul 2024 10:59:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVcRr7zBSsTrVSf02iaThFnBNZTEqdXsoigubMQVaZZsZTLDxPUmZr5ruJrKQyZY58ydtYcGpvr8bgUqFwEMo8u X-Google-Smtp-Source: AGHT+IH7w6DpbExNiAwj9/nO7V70uWwvn7rUojLU12ns+Xuj6Z6q1o+FG59kib7qTWtEHzLTfoN4 X-Received: by 2002:a17:906:eec6:b0:a72:80b8:ba64 with SMTP id a640c23a62f3a-a7a4c01c6e3mr476802866b.25.1721671192658; Mon, 22 Jul 2024 10:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671192; cv=none; d=google.com; s=arc-20160816; b=Rn8VUCFZRHDooQGdyWvfEtMS9Ji0m06aL7wrgACtSarFL0mkXV5yXCFJYI2gxJwHSr XyZ9XlyBUPGUo52wHvaakbTMh4D17qM1pQ7fM+Iz7xR8BkEj2jGJc4DkEPjgK3wB/asV dA8jz+3rQ8V1BeRokNwwLBG8ff1rNOBxSnhlx0iZfarVPtfX1Ff5SYmV8h5yMKtnXJOS PN1kwyu1ijQ7+EuseWE6CyC3J6L8330T/rWBvkY7Si+/8OfLdYcoAlserQoxXehrpYLS P+6FIcQpB6PpTs61oHFYY2IhXC8fyCGpDZrlTTnq6HXGiX5U1oGMnVJ6TRqM5y7T4JbQ i64Q== 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=GiWkBHfBCMF0meV1xEDsmcygKVcTz36qXrwmUIbHoYU=; fh=SM2V36HdV6D65NkpSYktFIbGw56kBIVMEulFGJRnnOQ=; b=UHEzhBg7LQ/9hGnXHMkJoZ2wI3n16BkmrR+cruYFQrJuxRJFjPiHPkr53Cc81Om0LR GZ9NbGPP6rqiVIlWe1g+lDiWc+Jq259N4BmqY0dKKVpYKfrFZfnrTDT1LGM6rTuKoqgt 1fSlOE0N96KNusvCw/FKcIj16EJPM44hQvU7z7CCdpnu8YjcX1f4db7v6L4t/fUtSznG jbq5bZ2ut+D8X5XBwcNs5DK0yhw21e0dCnsIqrZ+s38zSNbOmbcU+iuEXVMUOsViE3Ix p19ly85O3j1E7k3Ucmo7BJBV0i9g1wZmvOuJrM/XoDTFVnzTPJYSRO78UdlkwWBy/YOi +MBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=upt8c3L+; 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 a640c23a62f3a-a7a3c7883c9si437153166b.45.2024.07.22.10.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:59:52 -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=upt8c3L+; 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 EFDD688629; Mon, 22 Jul 2024 19:57: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="upt8c3L+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 827CF88005; Mon, 22 Jul 2024 19:57:55 +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-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (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 4B757884DC for ; Mon, 22 Jul 2024 19:57:52 +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-xc2e.google.com with SMTP id 006d021491bc7-5d5846f799dso419973eaf.3 for ; Mon, 22 Jul 2024 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671071; x=1722275871; 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=GiWkBHfBCMF0meV1xEDsmcygKVcTz36qXrwmUIbHoYU=; b=upt8c3L+eAuXpFmXLKDuVQhLXmjMfJTaQBffSjzFdenWtAmbpue9/fLTffceU41E/y yBMUWfWSnJgeU7kLr+ytYC/NBFjLNHPzcZWOw0yViYQHcocWGE6C99O72dQebkmo7oMv 9LbY1+rUSrUftLD9TcRAeClg2MSLxUm2ekgXQk6Z1ItZpViskIhKDnE1WNArv79fGZZw GNxwMetdfmFfmC14E9e8WtBWdL3f4kLwzLEoa7LxvTKuWkoJrtkC5FaxCDiunSUwam05 Td7qp4Dwxq93XazuYJbpTR33AaukaxLhT31Ir7m5WReKxfON4k1GDX7olUF5mElFaCRg 4IVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671071; x=1722275871; 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=GiWkBHfBCMF0meV1xEDsmcygKVcTz36qXrwmUIbHoYU=; b=MGi2nLiWzfLynKcBMKMhgpUhgCNHh3LGtH8XhQmjqyckLDJz+zhAHgJ91VZdmS0pAQ bXltS2eK/E0XfEcl6CZ5lgJ2Gv3KE8g5RkWJf4teVWIec6PRpL1fScU5FqTeblOsTkXV UYAOK2W/D5V2ZR0LdwYU+P5ERq4ZFLb4Fke5jGBaiaQlVroyzKaakOYavXJBf+ckQNdJ CLhp2vF/y7WNRUTFNaaKNKU8+o1yV6HveZ86aRSebbpQurejesy+fhvWOxfhM4M7IERo 6WE1Wz+wZzdyEvXe3l4FcqaqPggj1GN3Md0RqTZwSB9k8lLEA1cjN/oFTAqaM0r7VUC8 Fp6A== X-Forwarded-Encrypted: i=1; AJvYcCWX3jERQHGhNUATRR55PJUZJ1IvOdCXNSj/54lbDsmNO5RPIfI5rEikoXydS6ZhM9A2TXuBYSBS78A2/DwYnDIawPKk4A== X-Gm-Message-State: AOJu0YycSBc9AO+d5UtUA/0eKGRrvOYzXS+FhPuwCkufifwq68lLEg0P M91IIEX0Q6qyKltS+ySsToqopEUgjL1eQQ49EUqttJSxhFO554P1mseawbDbZeA= X-Received: by 2002:a05:6870:171c:b0:254:8afa:6914 with SMTP id 586e51a60fabf-26121636797mr7384128fac.34.1721671070941; Mon, 22 Jul 2024 10:57:50 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c716a51sm1759718fac.7.2024.07.22.10.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:50 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 13/38] mmc: dw_mmc: Improve coding style Date: Mon, 22 Jul 2024 12:57:15 -0500 Message-Id: <20240722175740.6985-14-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 v3: - (none) Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 69 ++++++++++---------- include/dwmmc.h | 149 ++++++++++++++++++++++--------------------- 2 files changed, 110 insertions(+), 108 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 8af665a00222..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,18 +447,17 @@ 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; } - if (cmd->resp_type & MMC_RSP_PRESENT) { if (cmd->resp_type & MMC_RSP_136) { cmd->response[0] = dwmci_readl(host, DWMCI_RESP3); @@ -556,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); @@ -597,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) { @@ -711,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); @@ -748,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 @@ -784,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 Mon Jul 22 17:57: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: 813756 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985819wro; Mon, 22 Jul 2024 11:00:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdL6Oqwn4JIL5IYVBWB6221eiYkKDoJIacHadN3ViqHIap77LmYPw0v+uBgDzI0E9lODM8DkRopf0xEc4egdZV X-Google-Smtp-Source: AGHT+IE53APqffRXOVCsmS5AJT2wbK5CyWhKLtC9kAFMmOw0oSB5zAKp+VsQ44YHQEOnPCi1PZpd X-Received: by 2002:a17:907:8693:b0:a75:35d3:e917 with SMTP id a640c23a62f3a-a7a87cd86d6mr49121666b.21.1721671215328; Mon, 22 Jul 2024 11:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671215; cv=none; d=google.com; s=arc-20160816; b=Xv+bUWp0TMJOV+dGgF+WX9HAJxHo3ydbifZ3U1QgFGZ7qzmYdIGKUdbCBOJNlBB/PF sv0jKCdJzWzvQPOwETlAX/RdbhDCeWVWklRerC46rj83XkPPE+H+P/6AsrLEwHMGv6W7 7lm4AHq1NhU0SuXYRvdtUn6Ml0NyPGmPYphu3o4i8LAvGSigS6F8VjYSttofYfmZ/9Ys Y9a2PtSrlYW9ppGloyvppWnbDIaBCE+pzo0ftvbsH9PMisXlyWg/DvjacVCCw9Q3YQmz YnSNyTr5Ac1ey383b/9LV9SB5wZxO3nNxDv36C00nTMhNSgB7uJIfG+Bysh5hRlp4fdk KzKw== 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=id639ixBzy+ji376pqSatYxzuQUFVtJEU5yaKT9PomA=; fh=OzkrnP+NiH0H+SSS0lUYAlqUL4qG+pOC2AF7G6tUXqY=; b=rmk1Rw4In8gM2K8DaDyDI/L0Xb0Dlj3I91Yz2m+5uK/KcIWz+cuk/om/UkcNVj1udX c2grSJKKBr3uRkyU/8kPMutCCcJpszz3BHkR3D78xNKXgFMbZdmuNzLPorXTA5bOjWCU c09KtXBPIY4RWlOY5Wbvii/YHXVcc4EFUyNHCU0daEwIJeZk1zTiqTSMgq3Tg+Gt25Na eDhDo81v8xvU+lXfhLU+YsIk9YOG0NzsMChlj7thb7DMzuX6nQYTeAJ4sw1/Ep1Ma4wA Gf0anYcHlM1vYNmQ4fwAx+db0MKQih7jh4OjtGpagJaDNz5QXgT7XUsd5wi/dPmeybxM V1VA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cwKpK0Y5; 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 a640c23a62f3a-a7a3c924c58si421764266b.608.2024.07.22.11.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:00: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=cwKpK0Y5; 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 B889588657; Mon, 22 Jul 2024 19:58:00 +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="cwKpK0Y5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 364C6884DC; Mon, 22 Jul 2024 19:57:56 +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 D0A74884F9 for ; Mon, 22 Jul 2024 19:57:52 +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-708e75d8d7cso2625102a34.3 for ; Mon, 22 Jul 2024 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671071; x=1722275871; 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=id639ixBzy+ji376pqSatYxzuQUFVtJEU5yaKT9PomA=; b=cwKpK0Y56O8akKWdNEOOOjDXrBT6LmV8obnTDczJoxE0pbWxJ93cR3T747qIH3xNVc lsM92Kl5teX3/FipFPIDCMKZABzp64+23jz4Qf39R+h5pSYIGwLQpyce/hOo4N/aFDwQ jTibvUW+FUFOk2mmkqM/xslUYP6h+K75WBuYoEgxDbQwsGa2kSF8HWSFW/gS2IWca8mY PKt+yxV8Uchs5zO1ycM+BWBlDyEK/LT0nQkQ3LIXa+6vLN/K/RufDyClzmrzuElLEtIe PWzrIi/1MO7/TG4ZrSm3g9UWQKc2TCGsLEBtIhDsBv2H1IgpADFCN5d3AGdgowSGd0yC bM9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671071; x=1722275871; 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=id639ixBzy+ji376pqSatYxzuQUFVtJEU5yaKT9PomA=; b=tFnL24evG0mKvhQ0mfTjBR1lv6an5hA2kmPFYFubvfEEAxH4s3/tDl87E8Uhl14GXN IYkQYXfUEQdIxeTf4zm/2kl3G++dDu4kUv3I+odkXifb/ZbrSKBZ+ckTka6F6Gn6F/b4 aXchnguxwfaIoaFLA5LTn99UHNx98xbKoXuBpXqhnCRS0kEdzhtfr1N9ghi9EYC3C8xS +qEoet520plQa0BXmkBGSR7sc3rxv0e08ZJxYPFxKYuZzqWutP61vl05Xmm4SBP/NUSl MpNY2Q8EcTHkXYpqwzMg/xd8B/7NEr/ulJWr2StxsNgbLRfPaZ5HmQFi4FrO89nIBDJ/ uKNg== X-Forwarded-Encrypted: i=1; AJvYcCVx86967cX77IPXj+m3jVaI9aw1+o0zlpJ2eSbltZ/wECkAx3iV7U48GFjLFU5XyXvMScNjYmtH0hRL2AcYBOK3hY37sQ== X-Gm-Message-State: AOJu0YzblSScosjMEKhP1OkoYuVGYvl+MdanglzSkuMUPUMFVDlL5Zk0 hdhaGWxKgYH4hXzPX48qW3O5r3z89RJXPBLjpbnaLsKwCm3v4sWx0Jvr2Vutayg= X-Received: by 2002:a05:6830:6103:b0:703:c26b:6e05 with SMTP id 46e09a7af769-709008e4da1mr12024389a34.18.1721671071581; Mon, 22 Jul 2024 10:57:51 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f6195f6bsm1620485a34.77.2024.07.22.10.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:51 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 14/38] arm: dts: exynos: Add upstream DW MMC properties to all Exynos dts Date: Mon, 22 Jul 2024 12:57:16 -0500 Message-Id: <20240722175740.6985-15-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813757 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1985918wro; Mon, 22 Jul 2024 11:00:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUfeUUCdA5EEMOgRgHbPWlvklpEYXY4+KEiDMxx9J7nPU+HYqRjzSzYTiv45sXNajGUSS2IewPZOmpXz1PMFogX X-Google-Smtp-Source: AGHT+IFiN6hSJZiyqqQNzlO2ipYYNvTUPA+qFHeagQVMkcwxjGUx+V7TKZY/p0Kg0+53Vk7EUByu X-Received: by 2002:a17:907:2d8e:b0:a72:7a71:7f4f with SMTP id a640c23a62f3a-a7a41a96540mr806736466b.7.1721671226321; Mon, 22 Jul 2024 11:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671226; cv=none; d=google.com; s=arc-20160816; b=mmi/CysLdu5uqrIgETaJghuPyHzY0QWS8bCBRgd9yg1tfpwjVPCLv8vjXzXt/NcL0B 7vOBjBcqa4xRAPLPcUMDX/Bh/u6aouqnbpLMP7Xpdp6BIxeeSLas1qWplQXHpauZ+rC6 KWmCopbhnJU11LbWqQLa62rCvhFlRdapH/yhaqsY8bSuWTulPHrKmURvn7hJN40day7j eJQ9Mc5K1zd/N0JmuiJqS+kZ/PHRIdPdLjq3ywDRluM5JSZlzD4tea+cINh4ihfXQb4N 5UL6+0C2VCX3ltc2hn88qhz+2n+3ojGfD6bfTh0AgN461/6KVnMA1PrYSoj5ijqzWoGk d4zA== 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=Mzjxmrv1UDG7hsQgrCZmQtSMvml8YYhPjJX68Ztli4Y=; fh=5BFLH70/Oc6+sX23ByRZV/+g8HDZpLLJffl/ttT1/wY=; b=MrBxCui88gRTTmjKnjivNFhGZmg1Go03wWwRw/ufzLVLCS0wwhlpf85SUTp7XBjore Y/eZJTfEdZPcdLFR3OqsCdgdle+xPm4kncNRS6kroDkBIwrr13uGv26B5pIXuuvwfrKg NsU06JfrwxDoWiPm5dIQo1uSduFXPCwN9DKlChjHw/Zv2Q+kN+1LhfYpWq18V7Lo9Kc1 fslBdz9yIrD9zI9Gu0o+rYfJRLNR6uzU5IKCPSBUE+38aEo2Hmk5GVagJVyJXCzZhCd5 fFVHMtOEiCnCfvXjhmXB7uRakzBqD+dlwhwnqssdAphO+yXFQInxy+2fmE6g64TPgW9e tQcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yig5oAe0; 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 a640c23a62f3a-a7a8db7a0e3si4261466b.46.2024.07.22.11.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:00:26 -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=yig5oAe0; 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 30DE188676; Mon, 22 Jul 2024 19:58:01 +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="yig5oAe0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5EF8D88639; Mon, 22 Jul 2024 19:57:57 +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-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) (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 99819885F5 for ; Mon, 22 Jul 2024 19:57:53 +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-x31.google.com with SMTP id 586e51a60fabf-2610623f445so2168975fac.1 for ; Mon, 22 Jul 2024 10:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671072; x=1722275872; 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=Mzjxmrv1UDG7hsQgrCZmQtSMvml8YYhPjJX68Ztli4Y=; b=yig5oAe0zJ0wq5bObMxhWZrth1FpnHdiQSqukSnXDEcSXL6HTWPM6wjfORYPZCiW3/ 17hQxYVrOGYiM4TQEV7WLeiSshWuKKQGw0w1gLSqviG6xSquNlvIw941sUyB+FKKyeWf rSCuAHuNs/9u609CsFr52bkD7DxVsXgY3LAmyEfK0oJYLqVR5sVgbnvtUZlUWzBn4esd kEMeU4uv3nDPrjNmRBcehRuFBfsxuKBb/x1cBGRt93ZFG5+Ak24VTGDnaxCz+ztrYcvo z7/gNGAoJM3J/f0FcuGRzEfGsulmKKZBHPXTNQrzbiphZ+PhCoWbdbUhKyX+EWDADPIc SViQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671072; x=1722275872; 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=Mzjxmrv1UDG7hsQgrCZmQtSMvml8YYhPjJX68Ztli4Y=; b=l1mWyIfl4sVWVO7C3BHJzVABtus91qxKb8Jvkcfl9EddlJGyDEQJRczppz5QhwyibG foWzhkb6VduiARFpK/0YXpXjHU2SNdSvHdn3IUQqajgeE/KFVe9dO5Hto6cPZaj19PG4 dPMplyFBP3Tkk9r8ZzRZ0+X+LLwghMY/ThVNan9fqwyB9P9hKIQBk1fXaoBXDOex4ndi 8k/rPBBadD2j+oY5+6aFr+8FuWemgYoqgpOkr4hUVJgZuP7PvWHHP72ix3v1sYPOU6oT LnvmWG45Ps90n5OMeFtrM+vLab9hoGR0e/BzOHs9fW3xXELFh/Iibgl4NzXMH26SXZjB fxhw== X-Forwarded-Encrypted: i=1; AJvYcCUkUFkx3rRWLE1J/y/+ssbnEqa5khGaw8UGlgCB0aGEDx8B+nE/Ls19JKJcAoGQSjZTtTiAaB0aY3TnEDCshvh2fb55VQ== X-Gm-Message-State: AOJu0YxsMxx/CB1pGKEhd5Yw66tsA4mXGxTOzuybulO6NnowHyg75S6U bzzDlh19Lnk7kL2V5jO5B57g2yAD1t6jEj7G8kL/Cx7uRTFKq7627mhOrjOlm2g= X-Received: by 2002:a05:6871:2b0d:b0:261:2c4:f7a0 with SMTP id 586e51a60fabf-261216b4775mr7682047fac.51.1721671072326; Mon, 22 Jul 2024 10:57:52 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c7cf1fdsm1771388fac.28.2024.07.22.10.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:52 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 15/38] dt-bindings: exynos: Update bindings doc for DW MMC controller Date: Mon, 22 Jul 2024 12:57:17 -0500 Message-Id: <20240722175740.6985-16-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813760 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986318wro; Mon, 22 Jul 2024 11:01:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJdvNMYjqAArCBg6TJDMiSWZHRH2ieFPMQwmdUiNdXW86svbhJVad6PNa6FGPht1YtjFlh8wuLuPXZ4leO8WaY X-Google-Smtp-Source: AGHT+IE1+H0jeOuLeGh0wBTpWEHhH1VSp4340zwROxH3OyMNF5K8dd6LWP7wHpCfm1hrnlkF876j X-Received: by 2002:a17:907:728b:b0:a6f:24fe:f2a7 with SMTP id a640c23a62f3a-a7a87c8414amr41593466b.10.1721671265707; Mon, 22 Jul 2024 11:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671265; cv=none; d=google.com; s=arc-20160816; b=LN9c8PKvm0qiJvd/Z/1C4EjEMszDPiEIMNcJl3x+Z4WyCrh0Hl/jpIGRqAMlJ7ercC 3xS6YOBG3kQ3rTDlr40DpaNmKtVOeiJ2BUjUJfRmacNZne1OGrSyD09z3LFhaEbJrA3O GRcVOTAFsYStemysX+reKY7L88ZUHOBure6EOSt/DRIvAtwfv4+z8nXPVLUdSW7j9X92 Lhj+YOeJ8d6qWOqxXyresyMtNt7CVJUz7uSTsf/y3+Ogyx5QX24jqKx/9jTLqSEXiHJd pSLjn1e6o6hjoCw/Uta8N13D4UEiQZMuRsmALgePU4QJQKbqyLBPMuIzKsJ9AtSu65eN d+Qg== 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=PPILu+oS4i00jOzIMXyC/z62h6jSzQ9rf9UfyCALLiY=; fh=HBa8jCx3Zzg5mVknY23g85u92eUVjSsLDoP/h+iq4LM=; b=Wil4yWYM5yrZFEBEcdJZPhIxHf05+AE1heuFltQhPbbaGl6/GxldHyxyBxSX8Q6gx6 tngSTBjlH7xkG+Vod4XwBGGppS7DLLwlDxnKDwsIgDOQ9Fx/NkkHifBzgECZSikebuW1 XvhZaKNamqVLtlILuS08+e8LE/hQCjD782LhinTrVyT7gGaxGggSyUsYN+XHxSgekNu1 to4gobIMOiu2L2XIUBMdQk+6YFncc2QPmzrorQfaYM9u1wHBdhXEgznioqqbCDI4BQ6D HNB50fEcaTua0GtPax7cHAGfKQ2R9KRPlgG0Q8XGhEuhSRmK3BeFGJlIjpNTNNnDap5C EaWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iwFhkGz3; 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 a640c23a62f3a-a7a3c923342si420759966b.556.2024.07.22.11.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01: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=iwFhkGz3; 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 1EC66886BB; Mon, 22 Jul 2024 19:58:03 +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="iwFhkGz3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92FCB884AC; Mon, 22 Jul 2024 19:57:58 +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 3C2AC885B6 for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-70368b53cc0so2299702a34.1 for ; Mon, 22 Jul 2024 10:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671073; x=1722275873; 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=PPILu+oS4i00jOzIMXyC/z62h6jSzQ9rf9UfyCALLiY=; b=iwFhkGz3oPVIpqTBX3cjCyxAomboJDXKXUUVzUNiwclAs2dY0AyDLXDUgdnVrswkS4 t1ousRPhYIaXUIq4KSaRGAtiXarnBD7Q9vwlNKZKQSz5V6Bd7jBQm2CQ5dXvwz46tqF9 7+LJfX/rXvTSi61UlVDJHBWiDLSJUFs4MDRPJiBCHmE9cSbKKg6NBZXttAje9RaDe4UP B8/5X5pRrJLLVr6qVGTFw+DKlrhbsC2L2g8TwL4sM8uLj3RnuH/hMD+WxgQOyEFbB0VV n2VYvr34HaPT2fBVbTWgWrt7xugZ0v/LPCBqcPgSesIiogAFAIBqFCJ6PyMXuEqJ51p8 1HtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671073; x=1722275873; 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=PPILu+oS4i00jOzIMXyC/z62h6jSzQ9rf9UfyCALLiY=; b=sntoBhS9HmoTvMm7Zv/rf2z0e75ezKM6nDF0gZ/x6R5oy+COxkA7a9cjFQfUKJ1ovS I4NKAdZkINAPjti+YXcJZ0a6Niaj5D+lDPQ0j5DzvIRlxvy2E5UKVrhTMfHDZa1kwQ6z 8WN1XdIV3SWZGNroR55hujX58R6s8zsqeLBsWqDtxBwLGJx9iEnyonCMHttPA+YPcL0I SMWoYGqtgh+HdNB5AFyc6x0lr5oqHt79uUzAroIjuIaQ1FtZSJC5NquW2pkJe1wNrnTT C2aMXXj10Poog6mmD8sp954R2Pa0LvvlYR5DNkQkokR2cXOTx/V6i842HGStSaSpEApA BI1A== X-Forwarded-Encrypted: i=1; AJvYcCU3wRyQJb0PLcNHXp7lP/Ed7tT5rfdvYAoulRkdSy4CkPOq649t5FcVIQlnfg/6Dlse/8MkmkdmkNZBRqAUKJyN3PUjNQ== X-Gm-Message-State: AOJu0YxetKEZR88HTLdTwizdv1GeNO6Eud6R3On9/OU20zjaq8X2VfGm rAry3FLzahcfsalfjTUoJEyylClQ26NoL0Y7gTmE3I9GL1APGNX9SrbKY4uje9E= X-Received: by 2002:a05:6830:278b:b0:708:b28d:f964 with SMTP id 46e09a7af769-70900912bb7mr9061996a34.18.1721671073037; Mon, 22 Jul 2024 10:57:53 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60c1944sm1638181a34.20.2024.07.22.10.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:52 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 16/38] arm: exynos: Add header guard for dwmmc.h Date: Mon, 22 Jul 2024 12:57:18 -0500 Message-Id: <20240722175740.6985-17-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813759 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986134wro; Mon, 22 Jul 2024 11:00:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXB7zncjqxn152yd6Lqdjpdr8UTH4OKfIzZdTXoj1T5oIhvNIOpTd3aNNIER5eerRuP9w9yoSSXVT4Bf7u34DFV X-Google-Smtp-Source: AGHT+IET0ih++/XNKAVFmn24b0pjOOahyanosUxJQW+1HJjFipQes96iWbSNbJQ0HA/Iu/i4HxO5 X-Received: by 2002:a17:907:2d8e:b0:a71:40d4:b1d7 with SMTP id a640c23a62f3a-a7a4c29abd4mr533316566b.56.1721671236319; Mon, 22 Jul 2024 11:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671236; cv=none; d=google.com; s=arc-20160816; b=gCiJSVNayRwCw1JDpjzSirekizjtcjALD/hw23d0l44cyEEahxRdFp3Otjo4atd2n8 qqvwlbcpAeyTGyG0cTCSUnieHSqQoegL5/gQneRHVeq9xhQ8Bs3vBuPDiGwbZzywft05 v8Mbf758o5SD2UPbrvWh9DvZFqorw5ag4Op7An5iNoWftJNQnJdFMGm01Ztr35Y3J3NA Wn3zCC7jAvJGGn3QALcmBe1btTS8MZHYKLLyoFipPaa9h6XNAGAvH6xvpxEMf4ZTyPbh NcMWHm/HaTIJHuJDdDVHl/zTmYA5DjnWUUSMhH8SIk6cOV6n75NtFmT91Wqcp0g5Wt5I C36g== 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=Z0y0jof263srhDFgZAkkgTTJzKgOeUotT2aFOff6tn8=; fh=b2OAeePOlWQbjwW90oWVUXSz23tvSdPGlniZv1a7vIM=; b=jpm1O8pUpFJ/DyAOtRB5QwktKa1J6gHz03NiNhfOoHX4AP2IB1iTX5YsS6MNk+IH1M 6fa9mYuZHoQt/gg2pybtxgVslc84g7tjgOqPXCOm4hIwq8OzXXc8eGGQeV+cjoXTsA7G MbN+hnKPBEi3EYz9+jWeDb8bZdCknmsxDOzpazQcU7kxq6JISyFv5nW1dNRqyDcr7xzF 651bmZWf2eJJshUHOVCvBumFWl6dgUSsR/MoLuSnuBV9Hq0ycDLUDeYCxKnFz7kdtAZI ZZ5j/sHkrw0cciO9sLEn+ZBbt9TvHIc0Sd29nH1ySPyuLIq6HXHGX5HTO2IAIMa/lKVk ELAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aX6UV1XQ; 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 a640c23a62f3a-a7a3c953ca9si409894866b.858.2024.07.22.11.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:00:36 -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=aX6UV1XQ; 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 A4B3C88680; Mon, 22 Jul 2024 19:58:01 +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="aX6UV1XQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AB0788645; Mon, 22 Jul 2024 19:57:58 +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-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 2983E88214 for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3d9400a1ad9so2615923b6e.1 for ; Mon, 22 Jul 2024 10:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671074; x=1722275874; 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=Z0y0jof263srhDFgZAkkgTTJzKgOeUotT2aFOff6tn8=; b=aX6UV1XQhJmpwRWX5dHY9XCM9UNdMHDA3XpGQScz3h4jSIpbaAUo435QWMOpOSqCjB nsz/CQsPguXWAiivMmFaVStFiqJbhAMoQTtWLsKUbAKIJiBRwpRg24GalqSywzZWyo1S G6c3RUeVv3CTy7aZvkaXuRYT0hObibeS+jAKsd7mT9nx1J0g2vXocbjh5j/zn4lfa/Fk CjqbxWNPv0LtPIpCy9CvNUVrc7KrBKRL9cCsBX3pGq5tESi9nw4TaPK2XoZRve9vdWLZ 44qqAnEEB+IuS0FOkErZNiou9Te2P5NpJGaRupEPNKY4E09N6gbuSMHkfdrVICRDuqs+ wj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671074; x=1722275874; 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=Z0y0jof263srhDFgZAkkgTTJzKgOeUotT2aFOff6tn8=; b=gSMe8+WV+Stwg65vo+0EmgJupuHxKDVvLADgj30yDhowAv1XjZk7XF6HhGcNMvgLwF Phndv77fEathNtGs6dn7ofi3ncO94RQx79XhEp1hvxm2VTWIaei3I0M0qgE97YTmSK3K oCsEofDFY72a0a6ybnofrCCNYiibTjL9XHdAyEx9zIw0napHMHloHNCjkZzCFUXnOpVm oswG4rmUf+WaC0O1jSvt47MRkzkKNkmPwDxBljy+TSSXwxrhFNX04bxxhmYGZWdDNLnZ rro/vk7GxUDyXK8WJGiX9YraVNGC1Qkx1GBn04Erv+9j4rddBMHXOFnfMjjElXxdtVlw v5Fw== X-Forwarded-Encrypted: i=1; AJvYcCVPawodHcO0KPboX5ILOo+d2PkDzaodD53/IdETK4AoXHsNeYjHxScI9ANckZNu9VHE5lem6Y8YpmX0tg4G0OB0sC8pbQ== X-Gm-Message-State: AOJu0Yyvcid0Nucgr8o1mfeTbxKA+Pyq9nOTSZQm29n76iDSulo3TV49 JVuT4moJ3UmgMVtSNzvHx19vk17MYrZFHmOPehdS7n5Vq3MfFFsrJEzN428MDDw= X-Received: by 2002:a05:6808:f07:b0:3d9:2b45:1585 with SMTP id 5614622812f47-3dae5fb24bamr10121131b6e.22.1721671073938; Mon, 22 Jul 2024 10:57:53 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae099013asm1596433b6e.25.2024.07.22.10.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:53 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 17/38] mmc: exynos_dw_mmc: Fix obtaining the base address of controller Date: Mon, 22 Jul 2024 12:57:19 -0500 Message-Id: <20240722175740.6985-18-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57: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: 813758 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986127wro; Mon, 22 Jul 2024 11:00:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUyB+3Zcy3B4wj2cBzVlAi/aoF37XpQVYnXf88ln70VPOsw6oMy2tp26DXfYkuu6fV7VM7FmTlueUgEF25WG4/v X-Google-Smtp-Source: AGHT+IEgFy2WB5Fb0p0e0YDqcHQMED7mycD46hojr0y8X4e6ybNRY79YkeqLvVIqPar2x+KsY+kk X-Received: by 2002:a50:d58c:0:b0:5a4:12ea:333f with SMTP id 4fb4d7f45d1cf-5a943ee0aa0mr368069a12.37.1721671247441; Mon, 22 Jul 2024 11:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671247; cv=none; d=google.com; s=arc-20160816; b=h3B70oosMjP5RtiG860ZYf4Xhl/UHw+OVZCe4PR+RI09TNpa2jiwxRGVSjwY4DA4bb bYT7iGC+W/SnkGMEUWp6x9qPFBAUNe7Kjbx1NPNSRWamO/IfJP10rsKrF++J2cazMsPA Yomt7IXDSwrZbwQfzUxdCqL2EPgAZIFMiFecuvsbj9lDnZmu1C0RTjKtM9x9KKLsiIcN Cx0vJE4slfN2W7AGny1ptlCHR0YedKLqIa7EoJXiqVpbEO8OacPSDDpd0LANSdRePPGe GVJJeSb/Q/Tja7yNDJTGZpNWCgAEMaI8TElm8mctLSagY55e3MibR462Mvy1xc9CsGbW P6Cw== 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=H/9bLsSODM8QlNrXZwkKXMW66HF6+d8MEEjib5AaJSY=; fh=DqWyn26UF97RuegH/uoaT20y1xxqwkwphRctFzScl2Y=; b=N19IrwwDAPjX7jierVm8hZ/BPplA2wclkPKNQw0YP7QZqwKV8IreDxCjjSp/tPU/gf lOGMOTkEIheJpSBXHKbFKHQVhExkE8yTwAsGlvDHX+BxLzOIq4LD0d6LwG+gX4c8h33k crf1K+t5Pe1keB+nIE/vH9zK35VYpP9j9O3xz8rwfQOsPZ3P4gLb9K6IyTLHNu6niYxL lZienD5og5UDTT4Wv0rnmscUobhB6d2zqnpvWzoLhawh1Yi2392rkx7/Dzl8UNG/HWOO lFPbM6l4et+lCsam8HKwu864v3xdi0Jf+9sAXra6+/sxlieMA5++VQcVU9OfieQfwCrA zX1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fjfedCg0; 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 4fb4d7f45d1cf-5a30c8c9fa3si4496950a12.579.2024.07.22.11.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:00:47 -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=fjfedCg0; 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 97CE588214; Mon, 22 Jul 2024 19:58:02 +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="fjfedCg0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A98D884AC; Mon, 22 Jul 2024 19:57:58 +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-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 4E573884DC for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-260e5b2dfb5so2637409fac.3 for ; Mon, 22 Jul 2024 10:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671075; x=1722275875; 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=H/9bLsSODM8QlNrXZwkKXMW66HF6+d8MEEjib5AaJSY=; b=fjfedCg0TReC3A018fXmy5Tu6uN91G9YJILAzPDYbD/Olnph3kp2PXy8FgEbGHHCW+ wVDU+TRNraXQqB+KsK3YX5JIMfVE7k9KEpcj5xwkgQZwo3V4TfQ2l6wLH9E2eS6bBt20 YjcZe2vejNXxFeFvMIuljqtN1cPg9Fn2mptWkpBzAj4L0pzRYbyrESy8Rc8RbQhCznOl z0easfrswg27r8W6rMoEENvh0lYfm3PBI3ofkGfUj+xn3tex958Rn6Gyq9i5XvOCVnEx NOktrm1QOVhI2xy4X9jFxBXETn1TKtR7Q8vpg9UQXJX+S6tPNgRqG8LVCFQ63vM3xb0C 36BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671075; x=1722275875; 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=H/9bLsSODM8QlNrXZwkKXMW66HF6+d8MEEjib5AaJSY=; b=m4MTk92dtpDk3nYnMH4itzN5odguaVC3niaKyyuumsIGEN85IpxTwwDbzeMIlmyzof VnzYZqUG5woWMlRtLBwpp3svL9f3wM/tb2HHHUwbSyp9xUaEjbzdiQU5JGEKmuXiI5B8 Sapj6XsenURWT1JiMduCGTA3HAfVn/VhXhZGT4pZNVhFvZDeFNxEB4dGIdXmQIEDe9FC pL2uUzaYvlBk6w0q32Ptx7YoRfNQX3AtCsO/pWCTiCz8OIwu6QkljTtZM15gt5YYYIBV RUphyZzE9h2F/hqqC3ZJWxQNUP/yTi0JDbTJmU4DHUZhVo1D3X+/xtvb1pxawsXAZrbJ HiEg== X-Forwarded-Encrypted: i=1; AJvYcCXhs27BctvFOjq7pzAL7tkxEpcbbOPd1DwpT86TszxACg1Dui7vwn8D6Gnvwm7Lk5fIQJnRhU6n6LD/+4Ii+MsX2F0GJg== X-Gm-Message-State: AOJu0YyBOlu/0IGoqkityzPobvgizNlnrKjSzH/wm7fD5uDYC6au1xqd xhUmgiLZQRwOQq39V3JpKzR1wwqgSxhl8Ce7qaGMQvwNZPs61YIr9bNpVyd0bZ0= X-Received: by 2002:a05:6871:80e:b0:261:1267:fe95 with SMTP id 586e51a60fabf-264690938d6mr395447fac.9.1721671075077; Mon, 22 Jul 2024 10:57:55 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c76db96sm1787543fac.14.2024.07.22.10.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:54 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 18/38] mmc: exynos_dw_mmc: Fix getting private data in exynos_dwmci_board_init() Date: Mon, 22 Jul 2024 12:57:20 -0500 Message-Id: <20240722175740.6985-19-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813761 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986369wro; Mon, 22 Jul 2024 11:01:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUSdLOSryd6LajAc480f4NAmJIseUwigymMWble/Bz2cGxBRp5cU99tejSZYamMnA2vFsXfXRFx+E7OZg1zWadw X-Google-Smtp-Source: AGHT+IEFVyGQN5OrWnHhjYnT7ghfC3ZzFRfF2p911XDHQFUD/DuvFYD4aboyWyVP2Xw2ShOsj6qr X-Received: by 2002:a50:bb69:0:b0:57d:4409:4f48 with SMTP id 4fb4d7f45d1cf-5a2cc79260fmr11209850a12.15.1721671269710; Mon, 22 Jul 2024 11:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671269; cv=none; d=google.com; s=arc-20160816; b=OXedYIXrq9hKe/ZcbodiJxBuMVIFyHQqXoCm6CuGxkfZB8XqoKWEev/J14azdL6Wou p5T8OhQAttik4lW7k8FhsX+c0ykn5dfCJ7Dp9ZBa74XRxsBl6k4T14ZEvLqk9sxSQ6Oa ZVN0PyB3yTt4zeXZPC3ZR2OF47mGcAIPCmp0dwd3SLml19KWqwu8NFGH1wcHfukpy5UW FA/07EVJPTndHGQ5gptV5kV4l9/0bEXPETM9P8kZB/PscLx41UYLYkdtT9+Ldiy6spln cwz/k2c/GuY8UKqzXbki11jeMeKwCvuExiXsSqLByewZunb7ueUWcnbDFNfW+Xj/4M8A Hjfg== 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=qUyYRxpueeOSVxhoJgsfpm5qpbIninTSmLGdu9hQMkw=; fh=5jlgcFu5Tnj+okfvxIL56GaFBHAkmQYCyRSvnbDZD0E=; b=HwsHiA/F6CjNQmSZrC6b7/4IsF544TY445myVtHAIJaue3LNA7ty8JVI0PidhcMTJT 6dv5/O4Q8syUYLvTKGBumVAUGaSUZ00kAd5nymIPpPDWIjXR98pf0Xh1jWvUVGQDuZWj XH/Tlq9A5+aEO+sVn6Rtp1Sumhpuf+wg7iSNLxlswuG9DDBYtw7LdyMiCR8jjWzcrYpz XmYDV4em6GYqFmAoSJkrtiVg6+rv4EwD+aA7p4ZUqCKN0kMflLinL7NioitHjQrw0Nkw 9ENgiI2hlcHFE9jfno+nx2CmoDbl9SGSO9o5QxgxeIzJiEYeuJsS+F1N5DFpiV/4Oppg LorA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mjk2ORzA; 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 4fb4d7f45d1cf-5a74dbc42c7si2070856a12.315.2024.07.22.11.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01:09 -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=mjk2ORzA; 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 9081788617; Mon, 22 Jul 2024 19:58:03 +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="mjk2ORzA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4679088614; Mon, 22 Jul 2024 19:57:59 +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 EFB7388621 for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-70365f905b6so3012348a34.0 for ; Mon, 22 Jul 2024 10:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671076; x=1722275876; 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=qUyYRxpueeOSVxhoJgsfpm5qpbIninTSmLGdu9hQMkw=; b=mjk2ORzAgDx4WGM8bhhd7/X5VkUmJ/NRYmlQn7gJeWH27ckrV8yEiU8u7jBWHulvFH VXdmbP/SEMNOMnoZqcZ6B6YDLlMtTivqgEqTe/4MfHyyM9OXgod9HgyxJW9agRv+Rb+h 9pglUZc/gqZaSFEE87dqpsdJ90RvA5LgM65jYVpz1XnXcd/vTRyYFMmzzpfy+DRYz37d NrlHx1m0tlrwNZV86LRi+4/g0dsJlC4dB+OMUrJeLjcxT8/bBCJLKYp/W57cnffQDXrL bPmlwtUVfwkRWrRtKsyf8mfEJgmbSw0ATMLCtBJ4/nYkB5ShRCvVrXdqhiWEueKtVt3A 4Bsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671076; x=1722275876; 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=qUyYRxpueeOSVxhoJgsfpm5qpbIninTSmLGdu9hQMkw=; b=skwtOTDVGtNk77raDIdBjypiGplt3gTXwiWV0/hPIozWdgoGbpJBg4v2CBAQ8pY62R O38xigAggYhy14aobEk7WXO3552m5lH/WO8KL5HrWGjctShdS4ewSNFtRSyhcJ7plKpy k3o1E4pCF+7P07qw4odFwsTbPWiP1MlRHgQtD0KIAsIy8amb9zYebcbnAapxk8MTEX00 bCm8WFxvruAbKEs9YE/CR63LGelkCmYWquUDykOt8nR6BarBYn9RK0d0yOmgoCWLd+oN xcg3ff5q6cppFZRihl2HNjKCAuNyUA7nmYWMbjJ8kekvLawAR7JJlUw7aPi2TbcT4TQo 50uA== X-Forwarded-Encrypted: i=1; AJvYcCWNGUULBEnRn3bDZX/7xAYrYxiJaBHVCEhU4nhz+KaN5rOcf6up7FAPVU9PvCCb8yPVQQ4aULzZ0e5ggVBYXwWyLcMZcw== X-Gm-Message-State: AOJu0YwJTqmQC+Zyr8teVSmvKH5q9qiS/+U9/zYUW51uTD6mZFnakOVa rnUkc+MrHFFX95pDw1GIAs9XeBclZmTAvlD80W1RQiIXCCyznBjnMaCtjvEIFw4= X-Received: by 2002:a05:6830:488c:b0:708:b46d:5c76 with SMTP id 46e09a7af769-709008dd3abmr9251818a34.17.1721671075771; Mon, 22 Jul 2024 10:57:55 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60eb421sm1658717a34.44.2024.07.22.10.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:55 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 19/38] mmc: exynos_dw_mmc: Don't call pinmux functions on ARM64 chips Date: Mon, 22 Jul 2024 12:57:21 -0500 Message-Id: <20240722175740.6985-20-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813762 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986438wro; Mon, 22 Jul 2024 11:01:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlUhxsaSpeDzJReVIltPDgqz2Ijy6UjPQRZce9XArn8wiLcMym+0/wsIiMzrlry9FfJgSIFlP3/r4lN/m7IF05 X-Google-Smtp-Source: AGHT+IEJ9zq2OpWcF2v3OspB5Ihm+Z+KWtS9hXXF7gfewHlWe7ncWKRa6Wahlf6LjHHzd4L0pCiM X-Received: by 2002:a05:6402:5215:b0:5a1:7570:8914 with SMTP id 4fb4d7f45d1cf-5a3eee8241cmr6711956a12.11.1721671278021; Mon, 22 Jul 2024 11:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671278; cv=none; d=google.com; s=arc-20160816; b=qgXmf7HBjZCLh5q5H5GKzwEBOMcwqXio5lKw+jvXhK0l5lxrJV7ntewkI3UIhKqij6 DhvNhzkhmYcWTBnA7yAXD2B3vgGjsjAQ8EUuz/Wi/n9HwQdHG8OIwCp4g7ckutxN0REl vS2IYhfRrHPcZWLeTZ8FryiANoPRfy1kLHx+Y/E9VPnQNHEZdnc8J7jbMRpg4EPhAxL5 hBvx4RwpwjzvZN4ntsU+Yf/tGNqUtgypmRtwBuJ6fO8lS+zj6NCBy4Z75CiOGIohjE4D Q7A524gwm0ODl7iXjtl87Rq6KOsDd5Gk/bO+ef0JR2wp7XaAGqjAi+oYbwAhkhlJuMJs ZCiQ== 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=CGa3gMIJW2chTqaZtwdlvxZx8ygHbDg82FUsQVJNvCE=; fh=cimZd/xfvSLqxhub7FuocdXjc4i2/3GQEztNSaSBuLg=; b=1HaGJrWuPBuu9HE9CBHdJlc/+oGJ6FBSIbKGVv0aD4oyCCCj3rdjaR8ViUpiqeifmE Ztc/qqVTFjt9OmjDGNQ5eThFndspECtXcSIDoj5/kkWzw0k5dOA1jEGGscyndMW/Msn9 QOSCsl4HbGc8SD4Cs3g3cVlM8Io6GtPGgVJ/0FnITEVu6Gl1W1xkFFeXvucJKM9OorEw lc1yXF035F8PcAuZ3IxINFvBNis4xUZX7oYXWRuodeI5mzOEJYZHGDLcZThTBdF2l8Hj HtZGgJWFziSnQ6N3x/pON4AB1T/ELGKV6SWuo/1gOwKf4notjg7S/pU6+wxGaVgzQxJw ubLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ua9nEsEq; 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 4fb4d7f45d1cf-5a30c2f87bbsi4795705a12.440.2024.07.22.11.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01: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=Ua9nEsEq; 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 0050388669; Mon, 22 Jul 2024 19:58:06 +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="Ua9nEsEq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 66B8F88645; Mon, 22 Jul 2024 19:58:00 +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 C333F8863B for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5d5846f799dso420019eaf.3 for ; Mon, 22 Jul 2024 10:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671076; x=1722275876; 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=CGa3gMIJW2chTqaZtwdlvxZx8ygHbDg82FUsQVJNvCE=; b=Ua9nEsEqC46fDl7YxABRXmjVCCLgvaykrlMPLmX4Fn9SsK5JdqOnls4Hfm+wNA54k9 BM8FasqggCpmZv+sB73SxvmhMVAJseutndde3S/yjtmFRbseZkxAvOtwQDW5kkVTKSqW ZwsvjD+N5huw/Z0QiqRPL2sh47hpiXZ4+UBMXL0e+V6gW00JDAp1oIhQLK+shiUO/I5f UuoBLKAWukmpn1bDZDOH4NxvgE1h/UUmo3FW2N8Yp97USbrBAkswdgho3Pjl0hKF4Zxc ICa4viDdQ1TxZHC9kHoi0kThuuUYY3+AsVzn0A9r+fwGScjf9bkvXmjSWvu/RH/cj4SY rhYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671076; x=1722275876; 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=CGa3gMIJW2chTqaZtwdlvxZx8ygHbDg82FUsQVJNvCE=; b=gmOIIiVGqZuzl7hpiRbIB8W7wWV3JTqJHyFZqSuXQK/MqjeOL5k1Bzp1Pv2AFOab+X LYrskQW1b8Df/VjXhqFudYeBVm5MRiNilv12SdsMXk16DzjX/+CVxjeCtDJIVZsrKArZ GTl+2MxJaER2BqRIVGBKv4+DlE+S48TGItIPDdPA1JZEWn/MDryngjrWMvbqg5Ps+maN wUtv2MBVzOY1p31mIO8+RKTKnrtnFDxGCJtsQmX79uEbND8jDCr/qYd3iz8FcPADJv1o TsbtpsB2OiAWMqS6Fb51CXMnMMF/R1rY08aTq3WUdreSFRotpCHttuts50Pph9MUB/dR Qopw== X-Forwarded-Encrypted: i=1; AJvYcCU976ifyYT4+Ncc8RqPyz37rlCcyf8b/BFF/xO0H7byeYYRSs00EfDf849yUArLQkffhXkD35rFgWdGxvmq54DHseykIg== X-Gm-Message-State: AOJu0YwoHU9zN281I3dRIV9R/5d5CbMq7sNgbvFSlxb/49uyvRdJL6lp GEdD9uUkLb7nbAmgNve07olTpenxZhmjKms50U45fUQxVtPFYFpzzCIgQWtp//I= X-Received: by 2002:a4a:ee83:0:b0:5c4:5cbc:b1b5 with SMTP id 006d021491bc7-5d564cfc26dmr10181747eaf.0.1721671076451; Mon, 22 Jul 2024 10:57:56 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55a8042f8sm1411239eaf.8.2024.07.22.10.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:56 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 20/38] mmc: exynos_dw_mmc: Obtain and use CIU clock via CCF API Date: Mon, 22 Jul 2024 12:57:22 -0500 Message-Id: <20240722175740.6985-21-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813763 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986520wro; Mon, 22 Jul 2024 11:01:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXHYvqVymnwya9ueuq/R/hAs7QiBSCoY8m7eUzp+fBXYMRN9cCMkWG4hgQCKCIrqRY0/H5rwpNelhhWar3XXZIk X-Google-Smtp-Source: AGHT+IGvTT+U+WHnBQeTXhMnTzIrqWJrH5d0+e102LgC0f4kJgiGfOe8meqVFnnU31L3Wx2R6VOL X-Received: by 2002:a17:906:cae6:b0:a77:cdaa:88a9 with SMTP id a640c23a62f3a-a7a87c00681mr46075366b.6.1721671288524; Mon, 22 Jul 2024 11:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671288; cv=none; d=google.com; s=arc-20160816; b=PzrdN5LrUqK3piWs+c/yjU8iOlUy2u7dsFdUALmN7eB7jurDGUwAj7N3ldkCP623Jr lXBILNreJIVT6ZFNcyoxTrLWodgKo6TfGM7dajSE/Uw3ogJKccRIFYjeObvkV/yOPJGH CAef3Gj0phJez8skYUG+heI35zIBWRB9saqm1IAoY92KdxDDBc8asD3OiSaiOslpSQRg uKOtPcLDjvZbLAny1JwQnP8+/KNcF+4NUJtnDYOU0yg5WdZDJ5fmfDAbuHplnFeU5d4e 3xBwSutUQelB4GmCPzSvUGzQuRJpLc0tsC5NlnQOZkqJFJMAKE3134/hOoEBDWec3DLP qmfA== 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=y37Oe49jpSOYUz8ibpLrcyDInbVzJikIkqAZ8DtZNaI=; fh=7y3fNL1+aXY8iL5x5pUjDIeijfV1eslMYZS4eVUt/3I=; b=jXrqwulz3579it5aDYAGSpQYpql9mWh1xsVIjAMusRFtDMSkIufZclwekIiADZnHJz XINaHBhvbwdff6CkRn/QLUC8XEB6Voaylg7u/xnHKiwfE7ahQ2IuG3gW5ch2BJJL7cxK wbIs2K8qn62F8jykN+slld6Krl+xHwMQLqZCc8yfntUfiPLpIKOhBrvVyj0D8RGPvFkL I9o8t/IDtZZdSBTDO5rYdO5v13snVA5Ik4zXGgSUxc4U4VoZ4VgZSWVrbic/Y4g1CgUg +JyT7JCUUSQ/T0LTGGd1mkdtghJJ8e8e5PuesEvXIYOVSutWTXTOewLkKnUPIwX3SEqU j/Ag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MnK8Jtpl; 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 a640c23a62f3a-a7a8d2d0fc1si7296366b.21.2024.07.22.11.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01: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=MnK8Jtpl; 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 57166886B6; Mon, 22 Jul 2024 19:58:06 +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="MnK8Jtpl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9652688645; Mon, 22 Jul 2024 19:58:00 +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-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (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 74AF6884DC for ; Mon, 22 Jul 2024 19:57: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=semen.protsenko@linaro.org Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3d9234b77dfso2604917b6e.0 for ; Mon, 22 Jul 2024 10:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671077; x=1722275877; 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=y37Oe49jpSOYUz8ibpLrcyDInbVzJikIkqAZ8DtZNaI=; b=MnK8JtplByCLqcqoRMWj7vdQgu0A4Q6PsXPKfVL3BB+AoOQupMaiva0EDLGS9Fe8Bh xrh97ce6zMsP54a4QeUxuW476Pln1jMz0iLhOQBCiyUBC5T/sPGxNM/ynwIgh0TM1ZLp Bl1DZ4dxnFYblFFpeFdQ55wlBX7iwzWwp7QRZ/u7fF1cqRYic94HdMBp+umbZrknsBa1 b1IAxFDd3YrqCrV/eO87jxmkuI0OdM7qRAzwCCwjRQT9aJM8uVkRQIfPoqWLqHBX5vXG HZClqcBL16oVjK9x6MZFGnRHaNytq/vW3W+UMrFs9u0TfcZVZRgtX1ESMe1+XQQyjfV3 kaOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671077; x=1722275877; 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=y37Oe49jpSOYUz8ibpLrcyDInbVzJikIkqAZ8DtZNaI=; b=QcUqNYiHY/3KSi8U6vSwnzU2q6pd+1NYVUUp2TDRSNCTzXIZBCKbygS48KvACoWDqs Fuy5m7ag0gLmYlnOnqCbK6jqznaOOvPZc3jHW6c7Et4wCLRFZXqgZomgk3C9hbDKcTnC P09SMhYBzu9c2gGnFfumZ+sKa0LJZ+FSnW/i3zL7/JIYShN4AISkYsfCg937pWgU7/p+ EZAV/OfgpgUFtmy4FAgFiiS2eQCg9uaDaxfYjaYG9J6Wrey5dsgM2+9rpbKd/m5FqqMI BecybV+w6POGu5MHfvE7FTBx4ubfN3V7BXbeUgAPGArWNTfxuOJXRxtp12LReiqYx6Bv S33Q== X-Forwarded-Encrypted: i=1; AJvYcCXM9hmbF8qyHziISxZUXokGiwc9Yh1nAWK5f5u+KFt1bHIYI1ga7gagwrJYrl5UpNX08RdPgin4TJjouXMdmg/zVze64A== X-Gm-Message-State: AOJu0Yx0SbBKVQyWyUk8TG8nnWW0NusohsJENEjqrNYiKeuAwbVzR5wy mPzIsKeuUKLQH7Ngces3sXXwsdBDUiS4Mt0sZl/renqc+W3GS+XpBj5N0tnGKXc= X-Received: by 2002:a05:6808:2006:b0:3d9:dc70:1119 with SMTP id 5614622812f47-3dae97f708amr8441045b6e.46.1721671077180; Mon, 22 Jul 2024 10:57:57 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae097c6aesm1600548b6e.18.2024.07.22.10.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:56 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 21/38] mmc: exynos_dw_mmc: Use .of_to_plat for device tree parsing Date: Mon, 22 Jul 2024 12:57:23 -0500 Message-Id: <20240722175740.6985-22-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813764 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986617wro; Mon, 22 Jul 2024 11:01:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdzPBziv4zlkSXhMI59heoHMN6LWFYJszMJbwAXVzuVfKhkSQpdB7v9QsGpPBTG4SgLJYGZfPWHzxLnQ4VswIR X-Google-Smtp-Source: AGHT+IFEhNxxqN1F0sN+qv0k/zgvR/6KcUhirFB7rleBN0P94LP7tzJYNTu8Klwo9jxZy8MND9Fd X-Received: by 2002:a50:9b4a:0:b0:5a2:22f0:7f4e with SMTP id 4fb4d7f45d1cf-5a47a33a354mr4639805a12.16.1721671299582; Mon, 22 Jul 2024 11:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671299; cv=none; d=google.com; s=arc-20160816; b=jmjGc8LUyoX6LGt0u+4UTcPgj3JwcTIIVl9Q3biaEWGbANeo4xIk2qtB9MSTmrO6uQ Qr5p6PiFFnAv5FDKoaAgmRZ+zgNAFuL/sXgKSUCCVmyx1Y9oZjsERJgzUiNz2LnOHlaB w6GK6uKlM2OwrsHKOGuBLYnfddrE/rXj98YtEwXCEGLju6LKlzcDr8/xuPrUj15sLRse Gcu8UKhDz8Fd3YAateAjYqtUSXjnOi4sKNfdUffuOGo5DPJlz5lskJWYFu/dY+FuIOEV uyl+wSYANP+oVgZp9xEzUEiUhgxpPh4xlc4q3N2xw+PPEBBuOTjCRB9onUDjKpMHqhep vQoQ== 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; fh=ZKUUNKhoKYqW2Coooby2CMMD1fexi4gP32qvfaL4lPg=; b=i0RXSYN2F87GgjbSVQ9greleYacaIlMMbvpc0cCyQqU8Fer9P0M7gokVXXLbpPRXud mBXTCX6YX7c6XCl4LIYYvAi6wwCgJQ8EsRNJo0jOUOddnDI4ITK3BOT/1B3gdSOcjEpj q+CGr+d9QqS/fXDplFMyonhQvSicJtikBJfunuAAwJ5UG6t29l+LkjzPPq3I1OlEj1gf HCJVk+rpCXRku5whb7oQ5yBLxBWxOTULqVv85eZL9GQEjv1XYYSDA0dmYbNTu7+gnmQh dJtGl0YPadXUqUJ26flcUv+vMqx2jyAARxZQ4yt3OACiq5s0/ZyNnkWEuL3lOlpGRlba 0JkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K6c8z6aH; 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 4fb4d7f45d1cf-5a30c2f4df9si4915345a12.442.2024.07.22.11.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01:39 -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=K6c8z6aH; 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 B0029886F9; Mon, 22 Jul 2024 19:58:06 +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="K6c8z6aH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A7F588680; Mon, 22 Jul 2024 19:58:01 +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-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) (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 2816B885B6 for ; Mon, 22 Jul 2024 19:57:59 +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-xc29.google.com with SMTP id 006d021491bc7-5d569bee00aso1210270eaf.1 for ; Mon, 22 Jul 2024 10:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671078; x=1722275878; 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; b=K6c8z6aHp4wwr87E5DnKPoOoCPRE8H/zKtxbx3qqPN0jcS93i65ctBddzruyGlM1MR H8cOvdNCEkCCT4hGhghjDfJiqsbevtHrM6RXLSl5huMThLXQq+fjI7upE7EGRn9OTE+a JsmvQ4xcokbh13WGDXjNmN/0j0FlWxCF1aTEcmDlOREmLVd4kavPH5XXMC4B9ekZ1X4o aTRB7mH+0OOd9l4sFbuBOzTZEyuIbSg1T9hAo+KL2Tk9ANtJ7N3DSZPzs5MRifL0Aghr GdzNUJ3m3JYbIVLXgvETCjvOver3TY1phc3W5Ep5bGxhmUWoM3R2XWmzxrVmnOX3pztN OUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671078; x=1722275878; 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; b=vxbEOW1WFqfr/IHP/0PsmuWlMc/Cw4GXl0NYaKmVyYMg4y9F7uoRMxvYMpEH4DdLiB MoMVKJ2OvF359pBY4pZCCcd3ETJQYEbchLtiOP1Gcp58dmZnCrYnHEhlf0CijSttncWx gQFQNHB49rU1I4TG0JpMGjmkE/Kd5FdLbvmGKxdsH2FYwhey8cSQr/Y+jR814dVp5qZ/ Ivmew5iZyvlRWOC1nPqgyO5n89WrLt9EfHMvVq3at3iPfpN2faaDzD0N9s97XaQmsuWX IfcIMsIpoTv1BF5yJUMUMihHnfdCLxEqzdUoYEOAjY9CepcA2YyylA2heorF4ObJLg1A oWGA== X-Forwarded-Encrypted: i=1; AJvYcCUz1++e1rWTiBCjaYuAPVCV21S+CA4rCthKm6g7PbfKc4zz0gijkki2eyTfr39Fzs8l9Glc9ARIDNwCF0WYvBN52mpGig== X-Gm-Message-State: AOJu0Yx1s2DVaF8vSwkAZ8dmTbVQAkpYz2nIDF734i+sCNrxwYYt/IK2 SZWuXhsJ5aLztOn0JTsv1JVDMXyneCLXow59OmN9vSj85h+pgUdxg3v7fYNBfr4= X-Received: by 2002:a05:6820:88f:b0:5ca:581e:d604 with SMTP id 006d021491bc7-5d564eab6b3mr10090529eaf.2.1721671077841; Mon, 22 Jul 2024 10:57:57 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55a831d85sm1405389eaf.18.2024.07.22.10.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:57 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 22/38] mmc: exynos_dw_mmc: Convert to use livetree API Date: Mon, 22 Jul 2024 12:57:24 -0500 Message-Id: <20240722175740.6985-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813765 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986719wro; Mon, 22 Jul 2024 11:01:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcjMCEY47v2n7Ca2eJX//HYnrx5guNpvAAAZJfa6TYlNvYPZcIj5c0+fSCrOXINPEs4PTaDsKA9l34zKXSnEky X-Google-Smtp-Source: AGHT+IHYfdFlP3azqG5kJ2Pg+YPV6KRvJxZ1OtT4s2ENyTPQimIrOjQLkxPz0ANY2zHr2QGF4p+X X-Received: by 2002:a50:bb04:0:b0:5a3:d140:1a39 with SMTP id 4fb4d7f45d1cf-5a479879b3fmr4416327a12.1.1721671310804; Mon, 22 Jul 2024 11:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671310; cv=none; d=google.com; s=arc-20160816; b=Ld0vNByzc9nbV8hdVbgOo6k+BM16WQJnniKO+R4Jpk1IzrZZL8g24PzLD7rfs6gMeb AHMTb6jZEompIj5bpR5v8AFV1KAk+KbQ0dP7diyTWIceM4DuTEx9rD1ADEuzTHiQByps DSvSv8tPpVIDBfMcDljTxBYM0pchK8m8BtwO1uw7BMhrtaoTrtG/waDV8XMnBe2C+3MK mBlKKWuxWsB/iKj1luRNmVRFj8Not3xdrpoEw1JYWU/NubJNTmnwl6xcIQXkaJjDblF1 UcX8U9h4n44w8ShkrSzq71Ju/IKVcYF5y13a8GW4xjbJrAGxIUMp+FQMs3eBYrr1A/Ec iKiA== 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=xaXsGm/EMP0xrerv4pMH9IvwpK22W5xwacPA9TDWRnE=; fh=IbgSS7WEOlBwi9fHWyiO5kAmnbB6+vMV+vyqQp8/8CA=; b=YAT8KFY2vM8TYyNqOov7GRMVgS2wXpEaG63bczwPmyul7yUOBD5LK+HnlOn1wb+ToG yvrnyLrImQ720gIJCqeiJbOf73WVE3VLeRXjyoUh93p00SipvPJehVmW2LAQzAonSYdQ 46ZP4AkrgAJ8nYirT5Vd9nVeAVxVYiiA3xFptVuRp3vxMLCABDeX+5hrW7kZeYCPH8Yx nJ6k02hxpl2BcVCMogzcp9b9uv0aLMzH7i5jG6H57m4xrRpt6wNtIry1tM4rEbvM2THh Af/tYuM2YUfa1oMXAcJu5cwUx+4v/EJOOgq5X5V7r4A/ouTTP8ge/HYPLuK4HVM5ZBoU F+Jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BW85u562; 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 4fb4d7f45d1cf-5a74817365fsi2052204a12.437.2024.07.22.11.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01:50 -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=BW85u562; 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 19E1F884DC; Mon, 22 Jul 2024 19:58:07 +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="BW85u562"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4393A88614; Mon, 22 Jul 2024 19:58:02 +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-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 BE4F688614 for ; Mon, 22 Jul 2024 19:57:59 +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-x32d.google.com with SMTP id 46e09a7af769-703775e4d5dso2242966a34.0 for ; Mon, 22 Jul 2024 10:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671078; x=1722275878; 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=xaXsGm/EMP0xrerv4pMH9IvwpK22W5xwacPA9TDWRnE=; b=BW85u562zC+FXTO2TDya/cdolygZ7rC4tZdOhLZdW8FVGI09euRAkqmzlLh2nIzVia ksY8yXbaAadlXsG2NNH5FdrfnC2eLqD1xb2/4ci4zAmvtJqe+3Pa8C67ETYy1edZl6Dz PgwJISRtv/8hJ73peBrZkeEvqmfILODJohQFeMLeVCEIPrAeVNSA6iAM6ZaQDsUb2PLH ls/lyoUucmog+2PYWnYgt3tJ6sw29Dr81ZhrpHGYZmyCtUTwV7/VQ7Qscu5EVdb3Uz+b JphdwFrGxGAyIph3gkhz/icfOw7JoZpOz4eCV4gjnYOPE2rsxXHK1uJyM2XkUJuNuG3Y u9cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671078; x=1722275878; 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=xaXsGm/EMP0xrerv4pMH9IvwpK22W5xwacPA9TDWRnE=; b=dVLCB49Ga07mqGZc1g9qIfVluybMQexFCmUar7a7Y9VgSkOlEuVEbXCGPO0hKOVNHc 4P9iLMmVEEvxQHo+r9I+Xxo3tUEo8QLA/swC3jzCG0O2K8dNyuOyr1f2YrWg7guljvfd Ev7I2qmZW0KtvXY2LXbLmKJN648sDdqZGVU9gSTF2F2HEDjNkF7AFg+p3HGEer80dvZz Bn0aW+TXZ+2ALIzsJZ/OF/pHv0AmMzSrWFiif9wDIVmQw/rMbZik/CEsBS7jKVXnhcOa M2pc5wZ7nY4Vj8nbm5op0UbDAEwdtR0jPop+Ccxwg0NZQoVo1voMyTdIQC5Nd7+I4jGk Ddew== X-Forwarded-Encrypted: i=1; AJvYcCUs9tktYIP8It3tZ+s809FLSETkMgQ+mp17djujnm+gGOpkv1elXq2wC3k6zCGjBs6NM112tM/A+Z8yJTTcr03SHKTdeA== X-Gm-Message-State: AOJu0Yxug6PVtIjjVMIWiQgYJRymDNONgsMcDYgQ6Aa1RTIf75Iuhbdo U11RkueFqo08FH28Z5zZwKqRR8qpInxKwA2lzd54Xb2PnyZmArUUblijxiNDFo4= X-Received: by 2002:a05:6830:3814:b0:703:77b1:c653 with SMTP id 46e09a7af769-709009b1172mr11080955a34.24.1721671078530; Mon, 22 Jul 2024 10:57:58 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60d6ed1sm1635243a34.39.2024.07.22.10.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:58 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 23/38] mmc: exynos_dw_mmc: Read upstream SDR timing properties Date: Mon, 22 Jul 2024 12:57:25 -0500 Message-Id: <20240722175740.6985-24-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813766 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986800wro; Mon, 22 Jul 2024 11:01:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdhdZ+90DGRrSST8Tg1q2KQqYW96ZXjEQWwu6Y/wz7MA8i2y2VlMc8NWEQ4OIViI3nJVhQymepihqFqgFVg51h X-Google-Smtp-Source: AGHT+IEWc2yQFX+/5cqK7rAsiFQ6+AYlQwcZMkQF34TcMFQx4KJhEGYBz/iNDTgTp4LQLUmM511d X-Received: by 2002:a17:907:94c8:b0:a77:cbe5:413d with SMTP id a640c23a62f3a-a7a87c85f20mr50257466b.6.1721671319735; Mon, 22 Jul 2024 11:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671319; cv=none; d=google.com; s=arc-20160816; b=mjM+QDnwySACbUGOuBCxveAzqzCmXzgGCzIFEWoi22bCc42QMZAvL8OUmD49mOTaZM 6cKbN6czXRIrfZk6xcUi3DrtnMjgAJfo3DDXJ5jSeca1oYbYaP1nAsJLrA+tMLmI+qPB lRY49adcCREdxbI8ouYRY21a3r+Drf/7h5UddRy+EG/GMc/iQ5ovweMjSHhJOG9D4MZ2 V3YG8U6mkpyI1IukEI377j4e2bMkKUjqLX6JHK5S8VoFlGVf9VadOF+XKkl+0zQbGIDU 3qOMYQnCh1WDyrGDeeiWHKSIzfy/dBb+pO85v9JfVjDz1On5qAwfednKZxW3YRNS/Hpw k8+A== 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=q6u5JOlmgfqULKcBSJqc1nSNBcsqabkbx6MNcU825Oc=; fh=zCTXWkkv5/TakvhlA2Z9qXpupUTMrD8vBaijpeDh/yI=; b=w1CB7eT82v7mwIAci32hHMrcU3CsZq374Mzwwn0Cwy2OSmbho++qOwAjLH84DByP7f L2wAzGHr2/mQImQtP16b/yau0GtWN/weEUqzZriA4YklGnPmH+Lt7/0PTHcHYhK4Lhjl CW0nTESZIpF9dRfbz133ddn6mOYsFvrWEo3dwXpWYTD1Koa44p5r43oF1kurUafe/reW pHLzvb5ZGCQ8MfiqOjx80BZLzpWrWVRMiBvRohYnCir8M4EOoX7jQW9iFUgCFqh6N29t 3K9iId4OQM1o90fWgDn9H8JjNT0gRWcxSCmWU1KVvOl/siwSckd0jGo/Hh1QdTmah+Dg OeXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qmtMmwZK; 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 a640c23a62f3a-a7a3c993a31si407022166b.1030.2024.07.22.11.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01: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=qmtMmwZK; 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 73E5888708; Mon, 22 Jul 2024 19:58:07 +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="qmtMmwZK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 072D788645; Mon, 22 Jul 2024 19:58:04 +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 6CD598863B for ; Mon, 22 Jul 2024 19:58:00 +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-70446231242so2335096a34.1 for ; Mon, 22 Jul 2024 10:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671079; x=1722275879; 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=q6u5JOlmgfqULKcBSJqc1nSNBcsqabkbx6MNcU825Oc=; b=qmtMmwZKEei+Lyn5ys5VMujHWIKRaEz5DyqHoBOgvl7wX4K9DHA2TQAkzx2k0Sacdr pPym4pY+Ado0aFPCqBhl2jLpChHAMoHuYIfbzg5ikixcvRhYtPrWJqWF0tQpdeyzaHpD O3vZCg4o7cXWgzWXu+/BI0TacWMF5LHkc2nIZ5tpD+V7Zy7Tdi0Pm7EJv3nLbNUCtXrv TggeGM6a+wQzohWJ0LlGK/NZiAje2nYitYdj4d+xdZCfFM17g+Ckgv2XUD18BtwRjYHs hTwcq+QbNBLW18IMUjHvNplfxNCohNW31V+E6sEXlaPHgGx+27HNoF3jZmMl1jfwbo+p K33A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671079; x=1722275879; 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=q6u5JOlmgfqULKcBSJqc1nSNBcsqabkbx6MNcU825Oc=; b=s1RXj9OfFQxzqmOW36eIZsiGHFzR5neodk0lH+z+/IcCS5udhgWoqNmXqKkZW1FSOr HEmllW81IqSurXLxQWnvKuaN8+YssBKkDATrSRJHBAvxvuaCU9qN3vZGXlUtp83laNgF TtVu09TIwFcTqbqRLzYXsowEcBr3kdj+a6GSJlNmvmFXjlDSt7isaCNLGVkJubFVbjmT SPUwdA0/Z3XJbeM7RlpkZGl9ZU1u8d1/zZQIZDdMh+8vzwhU6zj0CIcyMLMFKJ7yV2bD x8rHJzoXDKGuRghvPn/uwuyfP7hHALY+xthjGG3g11I2tUAoygCXf8hjNoA9jnymxRzK yikA== X-Forwarded-Encrypted: i=1; AJvYcCUISMFE0pANvqPsYqKkfh5E8mqRdUK2KdGVZysH79LfjT2FW500MNjnAj1xYHc93IIECN/pmr2wUH8DsJkIGmS/Osi0Vg== X-Gm-Message-State: AOJu0YyBW36v929m5GMSbOIgzfzehqayYmtwZz5RTW3PXHIwvWfrLJ/b 81n8TJ6Np1wWhQypGsEWzaOJKPsDzW5pi8Av6FblDsgWhHbS58Mjl4qSdtQ/R+k= X-Received: by 2002:a05:6830:2712:b0:703:7777:244f with SMTP id 46e09a7af769-70918099151mr748375a34.2.1721671079189; Mon, 22 Jul 2024 10:57:59 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f61b2212sm1622113a34.81.2024.07.22.10.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:58 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 24/38] mmc: exynos_dw_mmc: Abstract CLKSEL register Date: Mon, 22 Jul 2024 12:57:26 -0500 Message-Id: <20240722175740.6985-25-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813767 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986881wro; Mon, 22 Jul 2024 11:02:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXyrU5ORUjLHhc7aSRY0eQOO0k4OHSzX0ZP7xcONdrFxvccmyKqBs36hCgOXLK9kuVp+3+Ku+UZW2Nj58uPFolr X-Google-Smtp-Source: AGHT+IGaJBRCSJbykKEw7azntzriImVjRxmhydvaNVGYdNJdrx30SNuRUEm63w5Z+ThqcNs09KWx X-Received: by 2002:a17:907:3ea1:b0:a6f:20e0:1d1a with SMTP id a640c23a62f3a-a7a41cae1d0mr812805966b.33.1721671330872; Mon, 22 Jul 2024 11:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671330; cv=none; d=google.com; s=arc-20160816; b=ljPpaWXVDAWOA9Nf3ysLmGu3/h0K63aHkBmZL3vDWniaor2F/fjbHGdMwmDryUnNhV lrYvcNtj12vr+r82+rjyrc/mr72PVDpBN043F3VDLmnczJpcJOFsnGuTf5uaRs8MVsUO MpHo2MpAzR2TQ40eFXPcXIK64Luqar897/mog+YefWCNhINmHwv/ohPkOCCcbNlnRFBf AGLrjqnhHn8vnQSyxoR+DIICIAKVOaXg020Oetu4HXzWsulw/GOiuZHwYU2jTGbg45Uc UX1Zz3hM8AC6OL2xsnrjry11squabrOw6EevM73xTscoLP2jjfy+4lvZSf/P+xJrUTyf htZg== 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=AIFlXK4DxyWpvRX0Nfuj/LLHNuWwohRMEDArjMWowkE=; fh=hwYtI4BolCHjOM18Lx3Cdzg0Ycct3Wr2HSO2lcc5CBA=; b=x7ghiM4dA782obzrIN4WoON8hr6frm7PujmJQJ0cBX1/YcpApfk2485zIRvdFQYyWI BIcNgD2jmA3A2CJxgDOJynLrGV1WeeKW/CJgoR+ibwS4qLL0w5yUrbK9Ga41gmn4YihM JKdQMONOXaHKme4S8GK7Wjg7FEEs9G7lZBSfPLe7vG3TSk8iY96ib6cuiaQ2TCoqsPN9 n4ePVnflbpBB1Sy9TlsQtOuXmuRw+N997cB+khJx79iglMRdSYYREuoWIzXCS5cZW4a+ yYvCrtTkmgPx0CtHiQQUl5lZ27ds+Ir6SyLfUyHQaaKjOn9CToktUck3jMj/YfK4JhCC gUzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KoRzQJQa; 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 a640c23a62f3a-a7a3c8c4941si427933566b.475.2024.07.22.11.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02: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=KoRzQJQa; 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 CDCDC8872F; Mon, 22 Jul 2024 19:58:07 +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="KoRzQJQa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 683B68863B; Mon, 22 Jul 2024 19:58:04 +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 14AE088669 for ; Mon, 22 Jul 2024 19:58:01 +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-5d57d8882eeso585591eaf.1 for ; Mon, 22 Jul 2024 10:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671080; x=1722275880; 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=AIFlXK4DxyWpvRX0Nfuj/LLHNuWwohRMEDArjMWowkE=; b=KoRzQJQaWdwd/Rdhza4ayiqKTywih8fInOZKECo/gpx4kwGQHulARjsgTlmKOtNpEk x3dybVABjMZodZ+ZKdoB5/zb8JO0vF2Efxqe9v2BNQNT6tf7OR9T/NGpDSToOZeGMczZ mVX/YfURudWjCSrcH14NCb7FBlNVNB+uFNQr/VuhnucctSrvXO1RfmbWgu2mBg3AAU+W cLneFPK5RhxvFmUg25CDtl801F+AncOzEwY6KcD7B0Vas8Hg/Hs925dLPPYBH/emkQBf YXQKHVJLsc46aBWuJ0+FpOReP5PCrDE849bG1uHLN45JydZ4oqNIk9/2EGzC4Ocki2QN aYQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671080; x=1722275880; 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=AIFlXK4DxyWpvRX0Nfuj/LLHNuWwohRMEDArjMWowkE=; b=bi0vev6eY2WQcvjFc4KuWffDXh7YD/VkhB4P80+PZWvJclXjzKaauH8tPujRnDtmH7 1DSKpA9Ls5Ax8og2icYhTVsTKbbBtWrrNrwKOrlIEn+xPmQNBkwxI91E/pgxN32pV1k0 6QpIFc4AKCm/Z9IdLJsN/2uImEh7WTCQ3N2sSVxmsv2MV1RVzu0m9LQDKPoI6hFadj8s wNRbE9dE0TE2HJlwAuJeu3LNY7A74MLxpUxhq0mUCT9JjQRZn6zURs9F6mfHYBBDGrM5 c0JN4KVjA310E0Z/FX+O2sBHXrTI7vY6FmMwc+or6uDfAkGkes3+jPCMDQXoOxjdOEl0 jzHw== X-Forwarded-Encrypted: i=1; AJvYcCW4bOxljF9ys4KLRmKjjA0kWVKfpmgYrjGrT+hi6s7Rkx1PshCTmn3zKDgvbWgz3SOcRYK9taNGDwQS+Ajt1uaK/NfVnw== X-Gm-Message-State: AOJu0YxfBkqDndaLtuXdDWZAdwmlG/HILmYHZxdKPobPgfBXZI/7CitQ FpKdWjfoYceuxUyYfjAgJSB4W7/QM1VmxsysoOAdaxe1HI3RhOlGL3jnijwnWeA= X-Received: by 2002:a05:6820:4c05:b0:5c6:aea8:aae7 with SMTP id 006d021491bc7-5d564f5ac2bmr10238117eaf.5.1721671079925; Mon, 22 Jul 2024 10:57:59 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55aaec665sm1392341eaf.40.2024.07.22.10.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:59 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 25/38] mmc: exynos_dw_mmc: Refactor fixed CIU clock divider Date: Mon, 22 Jul 2024 12:57:27 -0500 Message-Id: <20240722175740.6985-26-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813768 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986934wro; Mon, 22 Jul 2024 11:02:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOpYddBcVgKMhzIrNKUrEi7r4aphcn1yj99yCmfLsfUcbG+7EkbSyIt92TxHSND3KFggxYpBJIBWatgib9rfx0 X-Google-Smtp-Source: AGHT+IEFbi3vVzxZZnUj/tjH5T7klUOkC3ijFn91d70BI6yk/lkgLxKv18GXnu+s55Nq1cNpDi7a X-Received: by 2002:a05:6000:cc7:b0:369:c6d7:7b93 with SMTP id ffacd0b85a97d-369dec0cfe1mr453766f8f.28.1721671340709; Mon, 22 Jul 2024 11:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671340; cv=none; d=google.com; s=arc-20160816; b=cbolJ1cr/IdmuTxrNzMW97AMs3gSEXCVKsuh3Ia+jsgteuIFTbJ0UxBF6SUMVE1p7D yNNO1t+vu/HaaIBR2Ql9sckRySW0nvdtqPUWRH8QQvDECzo5rb0V42dmVdCzkfaMmahM SFxe7RW3RxhttkumfNE25pCW4ppyOgqOAIrWW40Hlkdrb+7V10V8t/MNcbyY2ItbI7Ao yTj4ps6EJ+AkRwOqVYCw5j8U+E0lk7eKUMax2KZpHPevFjKvO+hlM1kizc+bpcaPTIac FFsWQjNo9rKcsoott/oi3qpNZkjsGs2ADnI/55SuWRB7nJg4DIzwJk8SvGMP2eYx9rN8 8C3w== 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=iuo4s+jT2LDQjNpQvK91k3n+gM28GOOSe04ufuHr2SQ=; fh=y2Hpp7NdvYRNTCXAEfGsfKU74F6VKKxiC++7JeN2sCY=; b=nqm41kUBGpQzAUkd4Qln6lXkKkm6EAINTQqtvXTQ1dy/S9hV99k4mKcAS6c8NxllRU w83yvXSSF9KfCCCdE8gQtMTXD4kwYSOxhsyxQGd3SfyCKBq8hHzGbynD3mgJlpfKp0/e 09gzuFvDysTp94e3K+s6I1o1yxpfyjwQ7aUlG7CNL51JtTK564IQ2P24sPDoMwyrWrM3 AG0lQoKz4Hd1MBLD/NcGqmUA+q8v0Cy/OdwnMWAfmjPCw9KKj5dqmKwa1K7lKNHKnK/e 08194/SPtHhnNMijUm55L+gB29UDH0ZZHl+V4Z1DH4moNN9bYWTF7MiUpXZ+5yRZx+t1 xyog==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ArNX0tW4; 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 a640c23a62f3a-a7a3c98b977si425671366b.950.2024.07.22.11.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02:20 -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=ArNX0tW4; 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 3785E88744; Mon, 22 Jul 2024 19:58:08 +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="ArNX0tW4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 857C8884F9; Mon, 22 Jul 2024 19:58:04 +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-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) (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 C6329886B6 for ; Mon, 22 Jul 2024 19:58:01 +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-xc35.google.com with SMTP id 006d021491bc7-5d4fb707895so2504560eaf.0 for ; Mon, 22 Jul 2024 10:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671080; x=1722275880; 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=iuo4s+jT2LDQjNpQvK91k3n+gM28GOOSe04ufuHr2SQ=; b=ArNX0tW4bHpZCbp5ppCGIt4IMbs3PJppUzCkefPJdfcr4FsadIiDcmjDcvKOo1QPwB QzuV/++/XSnP1lPWV9aDSfL9FKn89oAbIGBdZDKFauw54A+wvZWNKw4L/wFGfBhUEjbV n6GW65HSxirPMawWaFElg+WlQQ0nLcpB7rtwdkQMSn/Uvym0+nE6NbX7M0ZcRZj6b/ZC lq7aizyv2sfVqqtPAbKIX/OyIHgjslahY85Rz86i/x4syH0xaBkd7NSGoh7+3ceVavQa vkoTGppHWKycUpOLZMyyQySPHB/W7DgFN4a41ff/mzUkpo7wustOhG+5Hmoxt78ojQKk WqaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671080; x=1722275880; 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=iuo4s+jT2LDQjNpQvK91k3n+gM28GOOSe04ufuHr2SQ=; b=FQLSa+AFcngkAPN+gFKBEmoVfYgRZdY+aI95BX1UsaZLEEkriBU2DWDj72F1PDWWum 9zf33uBeDneJRRiTCnS6vZGJIgfsADgwQ8xpmq4IHfnFvOBcE+g2NUQyUBqQJ63lNwgn MvSNriTwdEKqz0s3Bz5jzMeZAoh7m6GUbHPyWmLngxMJUlEL92NbN1S8sSGzwa3pt7b/ jSlA+eJQpyEmNgMI8CPV+fN+yChCMtcOIbLadU0BfQvKoFtDEzb+fuVnYt4Gmw/T0i4f 4xap/VdE6z/z0NAWU+fcjERaZZ8I/pQqHSWMCaIkm8dCy18UhLDFS8F4fmsvIqoEym1+ nXhA== X-Forwarded-Encrypted: i=1; AJvYcCVnd8HdY7XFvEJaBPOQwFp9TQ0PHntWfyNUf7I1ccK301l5/viNWCM7I3WZpEsNTk5sjAvt/nsaA1uZTeZQwbFzVY2B2w== X-Gm-Message-State: AOJu0YxSh0a96RnzIgAwPhkgCGGSGuHmCdQNPcpQWRx9ph4TKQGXwjCo 0j3BHkIOAAC84eWwqyyzSfvQJ6VkzCKPvteLjWkV/TS+AmWR8hCUPXzzBbtd62c= X-Received: by 2002:a05:6820:198d:b0:5c6:8618:5995 with SMTP id 006d021491bc7-5d564fea342mr10061298eaf.8.1721671080580; Mon, 22 Jul 2024 10:58:00 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55aad1dffsm1483147eaf.29.2024.07.22.10.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:00 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 26/38] mmc: exynos_dw_mmc: Read common bus-width property Date: Mon, 22 Jul 2024 12:57:28 -0500 Message-Id: <20240722175740.6985-27-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813769 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987001wro; Mon, 22 Jul 2024 11:02:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVI6p27ifomPrwqK8U2NYrQaHZf2kM7vDdpsihNgQ7njGzI4NLGEpx5IPGOIgHNKOaPVcum835RdBBjVKYscOnJ X-Google-Smtp-Source: AGHT+IFKuZJ0OKfsAutGicvr/x0v4QdcvKrFvUdtu+zFktD+U36hEfMtdt43Bo+hqMUIuwPcAsV9 X-Received: by 2002:a17:906:4686:b0:a72:afd9:6109 with SMTP id a640c23a62f3a-a7a0f13cb46mr1505708666b.16.1721671350328; Mon, 22 Jul 2024 11:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671350; cv=none; d=google.com; s=arc-20160816; b=EP1miab2p/+TQkcLNdgExaUuSMnhbQcte43aZrd50CLsZBlrgTU33ikC5Uhxrfpd8V xMP7ybqQzMfp8+wBXgre98P/PK1v2jkHHJL4RPBeG79cgBXTxAO6wSZmHlFum3AJfpxq cw9pRXbb2UMs+OD3WqVxZtgGSNde2QKMYEa9xidWhCN+Tu9iri6PQy5iJgUFlD+Uj/vc w5xpCJajijXeZIQy+a96corjL37cD4pEoGXCUM2Y86S1SHpdwb4jK2hlBeFzDxvMkwDT wpr2ab9oI5s6r5ROtpalqbtg41gOIHXx9GJx25KTCvqa9xv98IgqHv0yLjFGBnfZE8+a QZ6A== 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=7FHeNwdnpi6EdFwhOvhLAK/f4VN+1hjXcFqzslTE8tc=; fh=UgxEwtbfJt2Q3RSWPkuJrZ/auZ0wt9V+GDJR3FVC09A=; b=Rw6L3EhmH/yyV/oUZTipQxpfm9CrDgb5PSpS+Qh0i/TK5Vy/g33gATACzCTwCvm43+ lAolfT0BKobMW5FUt2AfRISnazUiVu/YWWg2wXrse1JM+IV5YnQN3erDIqQueG/0yVRd VY4zfEB1BcqNtEZUB+2XhRHHK8VVq7HNKCNtM5uIagoHti3M5eM07fN3m9FK7IyQvPXz ZBT9NoTUuPR26Vdnr891rZU328tL46vUNIgnqCByjwqzY/l8UmXGby+hT4kFUGIfxNZD XGSefAMS8rhIM/pmdmpE/AZEIwtWAuczkEcm6ai/oJzg+SIOWvARrno/LhYrTcMIZWmC kcqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TtB8x1Nv; 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 a640c23a62f3a-a7a3c8cbd16si407092766b.427.2024.07.22.11.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02: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=TtB8x1Nv; 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 A45C38862C; Mon, 22 Jul 2024 19:58:13 +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="TtB8x1Nv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D812588669; Mon, 22 Jul 2024 19:58:05 +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 B61B7884AC for ; Mon, 22 Jul 2024 19:58:02 +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-3d9e233873aso2128053b6e.1 for ; Mon, 22 Jul 2024 10:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671081; x=1722275881; 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=7FHeNwdnpi6EdFwhOvhLAK/f4VN+1hjXcFqzslTE8tc=; b=TtB8x1Nvdgdajsbg0eSxbOM348ig7xudkyRyZ7CSUrZNteSIPTeSF3gzfgBv85NbiL SDxAcSq8gDsw5f9AGS44V/iaAoDlXxV1ttAPuL7KBgoO+F1EaRnZA/VvewsHLA6P2fVc Hc0UpIuztk+272fRuQUOQY/PPpzE2143cU9TKYeXwM8ZSlB7bV0twbng5qbZ7rqpWT9c XXwgA3wlVw0qbdyY3jAlv7RnWBDS9aT125SAOlbZWSqBtTij/R7qWRJ+uQC7Mc1qZ7ju q+G0dFa10XsUfTsN5MgByn+KIyXBYqA5srUGsJbMk7P5weDwsIzof06hDAREQd6Nz030 1pxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671081; x=1722275881; 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=7FHeNwdnpi6EdFwhOvhLAK/f4VN+1hjXcFqzslTE8tc=; b=OW3ogE16eqvrq669nZT7J+IIp/zKbm2LfvRI9j8/Kc6NWe7H1XU4qOG1nqMGayUZ9T CF7td70ttG5nPSDORV277EbcEQk0zWX3oRHpt8OLZKG9/iVR2WHz50aicKPrhDDelWr6 GPD2ih6nG56Z4qjwiaam8ZYv7pEfsklHYVomzQhNsX80iZ9S2g0hKmQRDl6YEnGE3Ayl xdKRYTlclvnJ+Yxqef/73ZuPnjv6SU8IDLMkdANeVEkgHtqUuJdaG21GueiVPMynidpc 97pSxZpxBqEmBFact+U5cok4vtpdwSKh3lTMZCj3q8p0zur05jI1+TCQHxmwWkV/DbMF io9Q== X-Forwarded-Encrypted: i=1; AJvYcCUVLCjbrpK26Xldz9xR+GCwMAcQGgUPnnpfB0YkL95rfoRo45C1LsS3ykiH9PDIa2i4gn9QlOnfFifVWgGDGAfVnmR00A== X-Gm-Message-State: AOJu0YyRzJ1baHdwDvqwVUGKlC3X4B/eQEYr650jmOfoAx9PxjD5GC4S TwJrJHRwLgfFgy4kO2goaMcv1V8OsV3Lcfxlc0rFuvXdhjNTsxDpA92Nu1Js/vs= X-Received: by 2002:a05:6808:23d2:b0:3d9:daf9:345d with SMTP id 5614622812f47-3dae97e4d0cmr6492821b6e.24.1721671081199; Mon, 22 Jul 2024 10:58:01 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae096b0ecsm1617049b6e.2.2024.07.22.10.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:00 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 27/38] mmc: exynos_dw_mmc: Read common clock-frequency property Date: Mon, 22 Jul 2024 12:57:29 -0500 Message-Id: <20240722175740.6985-28-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813770 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987078wro; Mon, 22 Jul 2024 11:02:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhK2YkuGnIxhtSSq2YYBeoIa1/G+3Hsnby5Vha8CkMA9B/wGClEI2N/Tv1NmwJeegkYu66zg34XfH0GJoa3qEk X-Google-Smtp-Source: AGHT+IERTOYM/AcuSR00AZb1ljko6Cw15bHsL6WB+5WQEL4Cyhy5TRjsKR247sK6v/gqAkHpcW2V X-Received: by 2002:a17:907:1c17:b0:a77:cca9:b212 with SMTP id a640c23a62f3a-a7a4c226b7bmr539087066b.45.1721671359214; Mon, 22 Jul 2024 11:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671359; cv=none; d=google.com; s=arc-20160816; b=D/cCE7ywX6WbXEVU/W7/th2FprHoQgahRV0B7z1HqYSNDq398+zKTnzSHMfYYVNZMp ++4cK54ibg1H3PBrrh6hcElPXnN66XAogeNqKA9cV1h85U8yJC38tjBaZ0RizNYohl5e tbF3lwTvZTJwS42Xxn2KaRGgt+edxAQGKyUse5KMjsA98nQ7Bm4+6TNSuSzsL3IGFGbI HTrwXofJ6nmtG+CARLZMPLoWmUItWAwle22xDP2KFOU4Md7foD1hYsTKd3jmzpQrvnb7 B7Mv6W3ADEF3jJl9tLEqmAiesvweZThWqZ9UgxK5UzPnea6gCE2ytHTv4CEdKQJRIzjf LyIA== 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=aDqIAM4+ORVKDjdU6ZaN5Hj+XhgxoYsFlxybUSvTUms=; fh=1ewezEu0XFFkGPW9nvpCg5chqkSSz8bEz8MG9HkVliY=; b=HFjBZ4lPaFdEZ6W3LTMGXzV1I1aoKdAWad4YyQF0a0pc3YF8kAvzp1oTDQoL85aBDP pW1xq5zhY0Gey0mpF/+wuvZ5PybHhe1/KQ5FOnA72YeWUACvPjuAJICBUDaVZgT1jaYe wIzfBgpR5Okwtc32u96yyGHE9YGmyfDMlyevZZ3N6550f/L2N6I4/SvOrdgqsjJzJyDl Y2FwyrCU8IFnB2M8rcPBGxEb0VTHtKbYlwfj0zTzC9D6/3dXCWTPLy0KleRuEu6uqCCv kLD+HCiAGDoGgiHLJUW14KKb5008PCW6+zxHchJHkINz4WUpJJBZdPDrvbyjWyPHYNjs gXDQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoTjh3r0; 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 a640c23a62f3a-a7a3c8c640esi423531766b.400.2024.07.22.11.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02:39 -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=FoTjh3r0; 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 1BC68886A0; Mon, 22 Jul 2024 19:58:14 +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="FoTjh3r0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55022885B6; Mon, 22 Jul 2024 19:58:06 +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 3A230886D7 for ; Mon, 22 Jul 2024 19:58:03 +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-3d92d1a5222so2748269b6e.1 for ; Mon, 22 Jul 2024 10:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671082; x=1722275882; 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=aDqIAM4+ORVKDjdU6ZaN5Hj+XhgxoYsFlxybUSvTUms=; b=FoTjh3r0K7fMdrmp5BkBF3XG7a9V3fP28d9Lr/Mi8JUw5yzLgpFhbLNKwnXR1vcCk8 0lG4D5Sp+KxTqIMDB6b8LgwqRwexJn4hLtEk8UnucuIp6C3tp2sUjB8FkQHYq2phYZkH mkz1rLEABFcJPi+cOfZPb0oX3lEyXjCtu/RUZAxN8OTCzb0MDpeYn51FJj1RSi6jbAl9 EKKFy0DgQ6EJIJGz27J3kKG87Bzd0SmNZoXJgWjLDJGHsQ1WsFs/PdwPoTPAC4LA6Hce p3YRfuVFccuYP5Bm7GkwUW5jAqsAs3Z/Qp/MicK7EdQBQIyrGEG3QjSvssFuQ/kBGhlL 4LWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671082; x=1722275882; 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=aDqIAM4+ORVKDjdU6ZaN5Hj+XhgxoYsFlxybUSvTUms=; b=cEcMzl5n/lA7VhUuKNpAKZVrJHQRXzhaY0LC4WgPEMfcVzYbofcfwGvjjsT8k3dnoJ NyCYr7XOXQlzp44ndJes/ncinvXI4jpimd/Yaj4dPWUG8Nr9QGPvrKDHSsOjP8UBjDMG aFSvOP1K2RHEmwlxTOyVQcfjhzrOdo2MhqnifV1/G/yRwwSsAI+T1Jw/mCPiMSLS0VIG pdPZUJCnRjVhxRIY+14sU2IhLSHZal0IecPBr3dEQDDqqCksnijf54rbqbwdxQSi3kG1 JNI3ToAO4Lt6L+nmJclU5vMjHPYRyFXePNp/K9vGyCTr1PA78OojdnhJheL/wdHqCR6U dLzw== X-Forwarded-Encrypted: i=1; AJvYcCVtxLXguGYmj7rN1S6oGt0ESj9iSdB/bK0O7SVq6cnh0KOB+NYspfb4GWkwJVo2I35HdK5FslV6nDTx0JocTPg5oBys0g== X-Gm-Message-State: AOJu0Yw67G1lpyjoVKa+pKHsS63SCshMzkb5HrAq8hIVX8sKEyjb/pgr Mr0FSgHmXGtFiEaeIygoi0k1hF3ZaNkjofnyc6D2Pyy7/C33p5GpnUvzveJqb9w= X-Received: by 2002:a05:6808:179e:b0:3d9:231d:cd87 with SMTP id 5614622812f47-3dafd42386bmr543318b6e.35.1721671081965; Mon, 22 Jul 2024 10:58:01 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae0969c8fsm1610698b6e.12.2024.07.22.10.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:01 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 28/38] mmc: exynos_dw_mmc: Move quirks from struct dwmci_host to chip data Date: Mon, 22 Jul 2024 12:57:30 -0500 Message-Id: <20240722175740.6985-29-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813772 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987232wro; Mon, 22 Jul 2024 11:02:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIZlKHSIdcs2LaaeI3i998hQc1vB3zz40Tek5j1dlZY5TdsMbM8wJIYrR9/JHwKcQJ3SdrutKyZM42hiWhidj8 X-Google-Smtp-Source: AGHT+IH45jp/WjZOJSDHUo0qiwroSeACqzHYjyWHhReYf2e4ISPCtZxmwZivjrnLaWdSuV+fPTZm X-Received: by 2002:a17:907:97c2:b0:a77:b0a4:7d88 with SMTP id a640c23a62f3a-a7a4bfbc0d4mr468178066b.10.1721671378598; Mon, 22 Jul 2024 11:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671378; cv=none; d=google.com; s=arc-20160816; b=QXD/cWf6YyCRFx1+OgC4ef3dLubw2DsZns0f97mpZmjSsTfXBulkfiFiI+yy3lJPXg T28UG63U/NozQv3Dt7XsApYCPc1L3neJsncTGC1V2mDm0fwn88D39FBHmq6NWnmitrTz jit0QIaJ52u5RePBZ5TuMLajA+DkDEDKojX7uP4A1m4MeXlKXZAxGfJ+8C9JSQsi2yaK chvuw++I+JE687aN0ZIMIxNWZPUepl3xDVEY4yHviDE1/ehr1ITja7O+R+5bXAoyTrQC WwYNiOlnLj2OT/m2ypQ+5ksHzK1H0YPyktHq/UZ4rnyzyhk9SJClHfn4o6gW+3X4Ac9Z zb6Q== 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=A5T7A/mEbivYIgckafzMYIBbRDiGDLtIO9ibMZLMgfY=; fh=9FF+kwvj6AFdKzw04K5fykVF7gwrWlOSLoK5o2zKNlQ=; b=BJfxMPXKbi9M86FIbJaUGlSiV1VC//CWX4+xVTkbDF1eHQS3eKoj1k1gVjmaiCRdS6 FMo4fc4A+/I6AezchCEWtSYrSH4d6nvL7JzZifTwkKqytSZRDSlT6MwMjZcGD+DXNL2y vQSydJN5txDtTeQ0aI4f+OAG9poHaP87sgtuVGFeFUxKDDAZl/C1ONj984dP09HMpX+a FBLBOhvZJJTGjNrmY+czIvHXLNcOh0P3HKHeRI7w+tEc32DdT3vow3BcpKVEkgxWm7U2 T5WWGuVp4TkdupOamxPJfQJnTDP+Rm5Lf9kjOATHthJLPJqj1vCcyREcDXFlxF5/m7JP L3iA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WdRv5Sdu; 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 a640c23a62f3a-a7a3c8c53b8si411805066b.329.2024.07.22.11.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02: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=WdRv5Sdu; 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 CFAF588747; Mon, 22 Jul 2024 19:58:14 +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="WdRv5Sdu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18EA1886FD; Mon, 22 Jul 2024 19:58:07 +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 E30F8886E6 for ; Mon, 22 Jul 2024 19:58:03 +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-5cebf0b37fcso2402015eaf.1 for ; Mon, 22 Jul 2024 10:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671083; x=1722275883; 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=A5T7A/mEbivYIgckafzMYIBbRDiGDLtIO9ibMZLMgfY=; b=WdRv5SduFAOxJaBmJLCWYTDdJ2dr6E5tmHlhbKYn3XKfFwJZMhbwxL6mla++Gm0GcA CAqWh7Qb08JNbYSexyjgDmMUffnuxCP4kk0ODf6AGaZEZqcV41oZB/BJ0R8TeAJ0C9Vk plVIa/bYRSIeHMrmyZMqeKiv29LqOJz5bRhQg4AablZiwu6QfvLwjASvWGIswXWBA675 ILih9MQeRk2xD9airCv4Na2T+uFdGhxKfB5JzqI8wb86KddnPdLLFeZ3fftAeL/F3v0e ETVskNU6x5Omo/fkYhbTCHRSzpisw2GvXFlLwWiVq3uPS30KWGySEv4slGu8LoPAdFma Uriw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671083; x=1722275883; 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=A5T7A/mEbivYIgckafzMYIBbRDiGDLtIO9ibMZLMgfY=; b=vGIMFYLhg+N6vIvAFAHRc2VhlrADLEVqsAwytto/aJyg8lKGLknrGikxNpbAChRJzP lXKzIaCeFN5qmjKcrdG4G8rsafmP0YEXgYC/LM3xqhPw0xLAKA2o+vyc79dcWNtXX1CS Bc1QfE/vaSZXHrEQgnac0wfu8s1KBBREaEcp+8OZSXziUCfG7VlXmyCyg4mJaWhwtGqp QOjJ0tW22mlk8eWLdfQlxqmmxRTKXRdI8Byf9yinAtpYrz+t6fYDRDW/OG7i++OZrNKg Lyv0MoZ4+wc43B3qDtdDvBgFd/ptfnXy2VzVn12V8gpSXPYYw1Hw6S6czVAx9htw3imS v3QA== X-Forwarded-Encrypted: i=1; AJvYcCWxfQ92i/CD6i20zYrwgmrGNV6Dm7PwTJpzIHsJLjCK2xlenuPIJ/laFfu+hs7mr5DiQuTz1DRiDFW8QG7koJ0HNoyKtA== X-Gm-Message-State: AOJu0YzEFR0f8q29iwBplF8Buhdm82uGNx+7P0Bxr7NpB8Fb92H/YTtI MTZqF8CKz9/oftYkqKuEV3hIRn1NPcbY10MwTIlkNGLNZ8tdo3dCID9k44KqFrQ= X-Received: by 2002:a05:6870:d695:b0:260:f50e:923e with SMTP id 586e51a60fabf-26469231728mr354614fac.37.1721671082698; Mon, 22 Jul 2024 10:58:02 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c771c34sm1757089fac.22.2024.07.22.10.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:02 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 29/38] mmc: exynos_dw_mmc: Read and use DDR timing when available Date: Mon, 22 Jul 2024 12:57:31 -0500 Message-Id: <20240722175740.6985-30-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813771 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987152wro; Mon, 22 Jul 2024 11:02:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMQVxswOyhAZOwWxIDATXxWcpmPqcviSxIMFk5mqnv++r5hKZbk9Lni3dwtGEiPLvh7fNHfUuZ0ya/FR8sWJVX X-Google-Smtp-Source: AGHT+IE6aBIWnZuIasVC/PMk/P5BS0lStpzq8s0cqTBQ7MSIZxa2cZCpvr76TM6gboqwgw89yff6 X-Received: by 2002:a05:6402:3550:b0:5a7:d986:6e9 with SMTP id 4fb4d7f45d1cf-5a7d986096cmr2897998a12.9.1721671368571; Mon, 22 Jul 2024 11:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671368; cv=none; d=google.com; s=arc-20160816; b=jxzrupeNFJK6XuaO/Ib07uZzAYZcjJ/oNY4RlYZOCz2U/RrBwk2UBPbZshpRpLF3Wg BR+q5qywi2w1VSCxMHiKlSgF0SVdUqCMmCJiesOOGwTyN/ndCtaSGFyFaIeZFvZ3prjg yiJ6sgaq8W8RrjUEUSdQmlDm7bw+GL3If4puISCl8f1fiArlnqNZJqz3I9r52ZjqT8SF idt5vxnEj3CSd7SqOKihlGUiLjVNjeLJzBpcyw4szxjUQP06fSt99Q4FzhWnu0E5Imce Z2XUbnCoTxPpsQBv0g72ib90/iNrDwJWt91ehnKhHcLtY4pLM3/zXQ64BcZXcNai9T52 YDXg== 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=84FJEpEOxftXRM7klNVnM18RgAFuIoL7LFsM7XGUkQU=; fh=Q+28iWs4hP5PKDg+Ys+k/+/2axf7PlC4F13Ir1ruTr0=; b=HW51XDpYEaK50SJYAk3FgDDMemF9vRjTecnT8WVJ7oBGImhwGZMtro+8KgJJTpUy7J 3iXiwTCTkxO5dZjCvHYn5M0ua0xMnXTfkClJwvfMbvZoA0Vp0hTAbhQQVMvPJreSRGyj JsqgOEPs+41EaYYRi/Njj8tn5gTUO4z3fkBvy6/HRkxgDo7Re2+F5smTfQnTcq/6zG1N H6P15Ma+nf8EC9lwwTgvuZyHmtG78yHV/s0JlLRc4UkT1JLPdh3a/XK11HeVZJ3i7EVV KQioJ9o6Yp8pb0l1Ygs9T6dTrUGNU7XIs6Thb3m5wk7ArFtxIPlR5RpPkHwm9jgvE/Yn xxaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uOFBG1c7; 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 4fb4d7f45d1cf-5a30bf10c20si4871160a12.287.2024.07.22.11.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:02: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=uOFBG1c7; 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 766F088714; Mon, 22 Jul 2024 19:58:14 +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="uOFBG1c7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD42588700; Mon, 22 Jul 2024 19:58:06 +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 AC0FC884F9 for ; Mon, 22 Jul 2024 19:58:04 +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-7036e383089so2219421a34.2 for ; Mon, 22 Jul 2024 10:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671083; x=1722275883; 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=84FJEpEOxftXRM7klNVnM18RgAFuIoL7LFsM7XGUkQU=; b=uOFBG1c7nhnFD4cU/aj5mH0refspdL06N54pQnEqWNCeG5E1cS9SH7Ig5IL0JoT/4j PkO7AgAzDoJsnpRwxY1W75cn0qpzqvwQaK9W+v5EQLGlur5S8yqZY4apBVVznOpjgevp lOnz4zjm8U7Kl8MqPKCoURrw2nxoNX7gCSJTMYhYMCR5jUdDw9n4FBE/COh//XgHyCs6 5H3O8PsKsvf9/mVBOOjNKl0ZG5QDpwl6twTw7vS4oG/NKVn+T4hAWEJ7q7NaRVyAiC2a w8ndQYUUTktz4eXfWbUcizLK3/TdRe//kXFjdSBlXghg3CFaR+ZrHRUZTd/KEhmoIEEj eN3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671083; x=1722275883; 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=84FJEpEOxftXRM7klNVnM18RgAFuIoL7LFsM7XGUkQU=; b=UrHSabaFd4uY2dX+9IDkM6wzVVDgbz7P9avgVtBhb3OgoUGxOEmEreOq1ZFo93uyIT ucjakuZLcDcEkO49JPensR2+883nPrCg/Vsbu6hA5mLr3OcRmzFtYCGXNHK2Rw3lPRSo KWKUVpOxHBlb8hdwzksbbvXvpz0m3YMA3ulWFSNLBSym+dgpfA98UIFNyWrvo3rJrBwP 64TD1aogauumdsXzOn46JT6L7aN0JZZtDLQLcYhXbRZ49oUSLeG//RIXtcNyeSU01YZt X6TE+f+X3N8mKrHXIgPbxKlo1BBOmpxrjmIheZmevThCyAS3db82CSIrW3qntIj9C1+e jGMQ== X-Forwarded-Encrypted: i=1; AJvYcCV3+krHASUOfAriIje+o0dzIPWxJLc00VV4IrU822bomrj1gqjXbQEvuGebJ3X3F51NBAa7x1kqkkK21H9Iap/dNOoqDA== X-Gm-Message-State: AOJu0YyoQ49T59x8a2poO0zGFOzVhSrvxvQdQr4Pk7c2N6yGcHNT47BJ BtTkODnrMnDU9jcGPBQel22Sb+A3QP6LKqoxu8iMaODyB0lDrZm5d+1DqBJNBdM= X-Received: by 2002:a05:6830:b85:b0:708:9433:3574 with SMTP id 46e09a7af769-7091810e12amr666959a34.16.1721671083469; Mon, 22 Jul 2024 10:58:03 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60a4b41sm1608414a34.8.2024.07.22.10.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:03 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 30/38] mmc: exynos_dw_mmc: Set requested freq in get_mmc_clk() callback Date: Mon, 22 Jul 2024 12:57:32 -0500 Message-Id: <20240722175740.6985-31-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813773 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987305wro; Mon, 22 Jul 2024 11:03:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX00mnCbCNhNJFPpqeMmxAkQ9t7j6KiXsjjqnsxI/wp+sZCpBazcbWr7GSn/MNLUfpAHTpUvPimXRg9tqbaZZbH X-Google-Smtp-Source: AGHT+IGizjupBjOn13kghBiwT2HemJbIeYjxdqTJeROfF66rpLgWNYrpBybg9sxf4yYNf7dhWkKi X-Received: by 2002:a05:6402:2786:b0:587:86d8:8b54 with SMTP id 4fb4d7f45d1cf-5a941d24fa7mr586175a12.4.1721671388219; Mon, 22 Jul 2024 11:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671388; cv=none; d=google.com; s=arc-20160816; b=Aze9KYDL8JzGong7/1Zo76FUImnE42XD4ZlQ34skyYNEguieZ0JM50UG7mnMwmThnc O6czCaO6IlIzL+e6Al3eVjs3ZCGKoe+o9ZxogpTuEoGrS0PMzUgha89ALBjnNr/AhVcV LQilT4tDKqM3FnJTGF0gn1Om/wkliJ53GmQLXKejiRLzGbu1M6A1tPYnAE9cJvdqKIFg XFxmYayqgKzA0HDUDSAY3LmrB40oO02+KJZhGPi+03IA+Mli+xWGS+4IC13xjWiuoOu5 VMCj/KuL7aTn0VrkgsrPNPDdDraCF0WhgaTeBn4dkfGGblDhhNfNAGOQQM6hCPoEcuGq IH4A== 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=L2Qba+p3+HBxKvTQF4PAqRbfCun8WfOLNPwAsqU7wq0=; fh=G9TpJd+juZ2xGYS1jr4T3FQfDfp5b7Kfe3JNb+JQTJE=; b=kU6DtWq/otLMplcupZjofhy2FJi7kahhuENaMC6q2HId7MOsH3TdhqmIsNzA6VPMjP sTClhEIO8q0huMj46La1snlXlAG8RmLPOJB/Q0oHiEhEIxc9+L+Tx+VTWoQbyRWLrsMP 05d+ihe/QPwqYb8vh/0whSXR/wXWTv89FVgWxz3UCyEGgDYBXmNCKPNQQcb0nW3hmxw/ EG50adOYhh+j3T2VOXoEGpTXxXBKPJFZjCb7i4lQ/7Z2zIaQLx6pKUopDPuWD54y72dr VOGO1V/xzRFL+5tkUEoB4EMCIDi5wZYHyPbTl/jEIwo9/BFQ+YJXpWIPfeMqCOYCdyGy qMnw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MtJ0Y6Rk; 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 4fb4d7f45d1cf-5a30c2f4fa7si4899127a12.398.2024.07.22.11.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03: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=MtJ0Y6Rk; 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 41DDE8875D; Mon, 22 Jul 2024 19:58:15 +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="MtJ0Y6Rk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 168CC88744; Mon, 22 Jul 2024 19:58:08 +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-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) (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 8B1D88863E for ; Mon, 22 Jul 2024 19:58:05 +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-xc2c.google.com with SMTP id 006d021491bc7-5d3cf39c239so2516586eaf.1 for ; Mon, 22 Jul 2024 10:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671084; x=1722275884; 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=L2Qba+p3+HBxKvTQF4PAqRbfCun8WfOLNPwAsqU7wq0=; b=MtJ0Y6RkHlQ+9+sqgLnYSrSCKkGMdVWFTB74dnAB5Py2uoZ26iy3QVAF/p8dhLnM8o mlb5TgW6nn1Uk9+vfJtsm/DJsGJT/rLp784I+TkRfeDtrzJUhwc8OZq/CE+XOPhj91m+ Sv7sMzJE7YG7GUQpoTK+b5BOUKkKwXbq/7Ihuo6RucSncMUs+dUdlIJk6v6R1vES9wEe D+JgTr39ZRlPOqSLgpaxHj0aVj+K3qtDLEimOcXCocYilCGudPKGtlCZUzG9WN+iHg/M HlMTKWYpiDdQZVZToASxZM0cCYdx96w5xxpcp+LbeTlQykn1KjULCbTDartgyiPN5xQZ SNLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671084; x=1722275884; 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=L2Qba+p3+HBxKvTQF4PAqRbfCun8WfOLNPwAsqU7wq0=; b=lK+7zoQ3tTgk7Uq80UZXzuma+0Zvc/c6o3JVUNny5aDQG1uoCCYrSRRSrkjzxZz7V0 vfTJr8WyKlXP6OrlCk5sDoakIZt5Rl7wNJHP5U8vKykH/okYA7QSuSPqpqhdH3xwqP0H K6oW8wy7Iz70ENTZ4Vgg/D4/6dWhDXU/Yx75qLAS0msyeecR1l5ja9hoX7X6kZ+H1z3M 0ObmCSFmg+/WWiBfyiyOJpo1CD7qYrdkHHBdHD+vYJ7LeazWH/9IZc/0iSHbNkVotUYY lGaBGjteqdFoisevGEY+QEnZ7ymWOwbQZwyWA+S9DpE1RwmmzT7ACtoJANp70U6T+Ea+ NJjg== X-Forwarded-Encrypted: i=1; AJvYcCUceVDr9Zlti0877uZkBlrHPkvR3PiullEPy4Zp218EtHIXYBRgk4K8u/yY2j1tQ1tCke5laxKkDK6e0SZE4BT95Ga0lA== X-Gm-Message-State: AOJu0YyzR0YESiGSeYLHNsMG0f6XtQvmUX/JjotHVdwdkkrq3r5565CK EjT1FD9m6a3JFyu13NvFD2oEas3NZFkGzJJshpMRltMa8+uZ8AeQ5VykF7AkdZc= X-Received: by 2002:a05:6870:fb87:b0:261:1342:26b9 with SMTP id 586e51a60fabf-263ab62ba17mr6138455fac.51.1721671084179; Mon, 22 Jul 2024 10:58:04 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610cb2c2f1sm1771818fac.57.2024.07.22.10.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:03 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 31/38] mmc: exynos_dw_mmc: Add support for ARM64 Exynos chips Date: Mon, 22 Jul 2024 12:57:33 -0500 Message-Id: <20240722175740.6985-32-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813774 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987390wro; Mon, 22 Jul 2024 11:03:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUStpzBlurByLkqHuGg+h9Bip5AAVfNWOc7hzxZCDI9r1DB6YsxPda/ks/epYI44Kp5idRVEfhQVUkVPgR1CuE X-Google-Smtp-Source: AGHT+IGVxpoIJLV7zaUhd5+nWSZFUqliNbKKgBbRXs01Fcoaf/eZBe1iRFagPVFN/lYUx4zkxLhI X-Received: by 2002:a05:6512:3045:b0:52e:fada:eff3 with SMTP id 2adb3069b0e04-52efb52404fmr5415302e87.11.1721671398532; Mon, 22 Jul 2024 11:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671398; cv=none; d=google.com; s=arc-20160816; b=vZcAoVcjT+sAPNr6LgDFr6t+bU9F0AT8uvc92ccz2SDR69QeYmnVy1URv4fcEvcz07 eru+W/SHZ+8UcYnkxrDUsaF5ylacSoX0h/A51cQwn7gUQ3ztd9985i9noWFi8aHCZOof vnT8TYUhhMrBEyxjeQrjdpAr8ttMMQryjfpt0GoWd468DXmRmF+5jcKxvjngMbtcJOa/ baYXdBw71a8VhCXenOyqjbIESuVU89T8UJjEbt7Hl2q9KvoKQIE0qaX130pGkDpN6rDt e3r7FbhvkU6qDP8Y5lXrR2WrFZtlZvhZ1M5mHLNPyEe9RKj2uVMs3LKhLnwSwpe2cyQR hEdw== 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=uxAqhYxXUfKOKyL9wAYDi0rYpojxZimic7j/BRNYfIw=; fh=mWBoOWlu0rl/MJU+8VKdwmHbKhedyBNXFpglxYqgqJk=; b=CLP5aT6BKyXffpYbA1W5DsUaV4FbE/HRgSQ640ySdnZki2z6JxeUd8hqyX6oFBuScL YDhY6cS9nK1Ngvxv+s6LyZt4F5MahRvUd2UTsjUMByseqMTUEoOl2LF2+GLAEen1AHmO mGJb/46WC5Jy0xSpyawEsX+29lTkVhccj1CjhGVHPVPiM2nxgKOPrAyJ0sQIOBpnjAAq PlNqOmf47XEWYw0TSuHe78u4Yj1jRW2cAIgTIOfhxjzID/uRRRJyrY5x6DZyf81/ViZ+ /m+W5qhBOKTf1cMJu4e6ztq6mwv8V5CMLQX2i9Z2zDLtEEHsm1ofa8yZoBEDYKZ7CBEu 4onQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C6wV+ZRa; 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 a640c23a62f3a-a7a3c94f8f9si405602966b.700.2024.07.22.11.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03:18 -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=C6wV+ZRa; 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 A0C8288777; Mon, 22 Jul 2024 19:58:15 +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="C6wV+ZRa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6514088754; Mon, 22 Jul 2024 19:58:08 +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 3B69687919 for ; Mon, 22 Jul 2024 19:58:06 +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-3d9da46ca13so2549465b6e.2 for ; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671085; x=1722275885; 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=uxAqhYxXUfKOKyL9wAYDi0rYpojxZimic7j/BRNYfIw=; b=C6wV+ZRa+Qfo595CjxtNwEuDUgym0blBuefYCiC+l0gpUk9nHA1htO9RCs2yPctwVU zr+Ll/5UJp4KmkJ7IzYcoMkhYWytskyHoMU6h48ezQayJefhj1k2e1xfjYJXytKxd7br fqgcdaR3jeD1HArvER7kjRSVMz4YVuF7YhusKb6IKLWW7KL8Vcvn1jJt1L+2FgLdHjN8 K80aoH3/RwWcld8j5PEBokVVj0jWx3E8gOloiiBl2rSbp36g9or16KG5mWZcUx7TPQp5 SJE1WDM1aaXZLY3MFcn/NdiGki7Us5q7Z76Tr95PlHM9++fSzxr1w6gKY+0LHwzllPlD /3mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671085; x=1722275885; 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=uxAqhYxXUfKOKyL9wAYDi0rYpojxZimic7j/BRNYfIw=; b=eJoG67JpZY/oMDiRf/20rdS7r2NoxIwprU/bGRzidQpWl3FKfkxmphqtWfbI/qv3CA rzHZ66G+KdDufo6+26HMg2rqpIHxRw9aj0wl7ymwnE2YKPDwymCMCcWcJCFObOzj1Cxw S1Glbo6jxcmUcyyjW0x3PWEjzKcuAfFy9txB7iVKXhHt/5gXrvhN0u3aI0JLqyoCGMNw pryfa5zpv4oC4qb5Epd7PbMOojIIkSnqkJwPyLX8xUBHv7STligxasnemUsZyb6Onq6o AN3F36EyxRSyrKRFdkAI/KlECBCJyCgzuerX8Ax+MR2WT1WQZnZKMW/F/aDi3Pn/MyJ0 x6yg== X-Forwarded-Encrypted: i=1; AJvYcCV17KhVfON0twwTsG8E+wur1OHxdGoTBJdozh1gB+8Lg2UCfPX7EDIyB1NJdjITf2YF0/x+HSNcvCBgPjKNr5m9+l8ngw== X-Gm-Message-State: AOJu0YwlVh9qqAFDWRkzsIRvx9kGcaW0Ce+JLMOuJIjvG/N+lSPuPk1E pwlLnybzGSFPYPkVw+XWf6zwyxvFrEFReZYkSym7t3t0DabAG5bq5UFyeqhrwxs= X-Received: by 2002:a05:6808:1523:b0:3d9:28e5:5865 with SMTP id 5614622812f47-3dafd0e9993mr620865b6e.21.1721671084987; Mon, 22 Jul 2024 10:58:04 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae096bce5sm1621675b6e.7.2024.07.22.10.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:04 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 32/38] mmc: exynos_dw_mmc: Pull all init code into probe function Date: Mon, 22 Jul 2024 12:57:34 -0500 Message-Id: <20240722175740.6985-33-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813775 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987456wro; Mon, 22 Jul 2024 11:03:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzelAZSnubRueYXAy9X2pTvhaLjOp2yQ3uBHvwAJoXEQ1EOYDbzWTfiB3G/bm6lyWDv6o9N3sXSF/V2EXawzFY X-Google-Smtp-Source: AGHT+IFH5qBINfX2VRWRLp4951QusgmJNQMylQp8sG7j3QWWIHM7BlSnY0DqcehYya2w/1KyfiPm X-Received: by 2002:a2e:3212:0:b0:2ef:2d3a:e70a with SMTP id 38308e7fff4ca-2ef2d3ae888mr30648561fa.18.1721671407829; Mon, 22 Jul 2024 11:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671407; cv=none; d=google.com; s=arc-20160816; b=EeSb3MBIw2arM90kiuNerR78SMB8++KAXL8v3XCaFuCmBtwwm6KdnDv0z9bTeFNM/k OlxrhI7nz5OKnK+IhaWU5qU1ZhhtF0Ak4uy7UzIeWPBv8pw8cjSe00U5KMm3Xqa7wroC v0NzAzFXRtifCw+f9zCoUh/nSjsx4pM86TSxCHPaubtAj80f4rTEraLPgGrJwUy5Svek j/lmWRer4Mc0qRuexP5YRgIdbMnk9XMo0BMrg8qqQWlWT8m9S07oa4FB4WDn38qsX4Yc eZuYPd7qv2pOWDX+HBjdrG4Xl/EYDNk4o04D8PnnWrwwPB7UsAyEH1lC8DmZClXoSRDD +PiA== 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=F6n6p02MgaNQdakttvFqsRWuDRqBTpx7N8fwwOIzWXw=; fh=1MkJlugVaYeG2aG6XElFy/a1lJeJSn2oRDkc95f/hvE=; b=ZPTtBK0jVzMzjF36viKe0YoRCJtVyvmaXWX4Vg2GGis2PgWgRvjR1Lii+ZnuqffjZ0 FMQplH625puqvfudDcd62vS0B8ORe+ntSUtBsv92spA5rNLG7z4UMuC4o5/Nh6ezt601 RIP1DEaSByEIlbhMDdlZWv8YMLgSjuFsatKbBMtKPHuYYu7fQWPn0w6I9qFYXdRfzgLY s5z6m6EPa8bD5rhp05aA0mxSdTKUcQjcjgbLAtlxM5v/lahA81J9yfflhQpbRFOX2+qq UqgqtUVkTHA0eeOxwZT/ytnVY1Oy0ze+G5D9m4n9kx2fo5qU+XQA57W9HCGVjPnJ/WcR zilg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L1kmu7e+; 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 4fb4d7f45d1cf-5a773547e8dsi1882985a12.501.2024.07.22.11.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03:27 -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=L1kmu7e+; 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 6AE4188792; Mon, 22 Jul 2024 19:58:16 +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="L1kmu7e+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 07025884AC; Mon, 22 Jul 2024 19:58:09 +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 D9A7C884F9 for ; Mon, 22 Jul 2024 19:58:06 +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-5d57d8882eeso585650eaf.1 for ; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671085; x=1722275885; 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=F6n6p02MgaNQdakttvFqsRWuDRqBTpx7N8fwwOIzWXw=; b=L1kmu7e+4/oY5Bn8hguBc7dlqxTctgQyN3rkI3eAhhcCc5n/mYmnF/bnJ0AnjeIoKI ZjeaDYgSMoYkRTH2btx0BGuykWcYuJgws1oU+3uWwpWWwIqHxhIjUwyB3t9ByPXDtVZB ua74vXkGqfDPEJkb1Hp+ELly9PxOyM/vfPZ3ecBm6//XPQMBoqi5Of2/Yc1Q9EglhdXV 5K+R8zmxRDDraYLfV+m2bJzzY64s5J9CHhFRVViHvgB50DpQw7ad36VBx14+I4feZGCo UAQWEVKGeWWWCZAFMKDwAmUMJXTm6qvd+WNFmqUqFM/HK34yK5Zdoo0G/6DGObZNxIEL VpPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671085; x=1722275885; 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=F6n6p02MgaNQdakttvFqsRWuDRqBTpx7N8fwwOIzWXw=; b=PK4mXwuvoJgIN7qjyxVigQ1/JUDeJxSxatk7ua+wOkNmlBX3NjnuKsOaCmB0hkMQq2 PKgQLryreFwOIHHY+q6PzWf5ZDoEb2axmhVlOdpnDgVAJgDgnFUCxq0frJ7C6w+hOGvo 3dRW9cRRcy+c48okLyTnghxNnLC1pHWWXnVNsq97woXkWD4sEN3MiPuS3Px9vEqNqG1+ gwPnlnVXvE7k3B9vKXDdcFdre+ySzJ1nKpfPiPo7fnp6f2vsmrkvpyzr4+XHDmK06ylW q0/EPCyykmzZPWMl0gPiEVpEVNNJEQZIVYerOJ3F2W4Qs8SiZ9e0HXiuXale1rqTIOJL HY4w== X-Forwarded-Encrypted: i=1; AJvYcCXfXJ+B27TFnJSveXBW/Zl1tqGRKKdWKKF8CH//T7B0tF94j69XMroSrAsUDg6kLq+Dgl4OWEHCL2i3KJ844ptPhIAD8w== X-Gm-Message-State: AOJu0YzwzFRJUIjrJKscr/fJRP+7wnbxIGYA3TFmIdzNNUaNsZXrdcBQ BEQkiyPKimLHg4L+WmoA8KFGdkvxvn5KfxGyOxddvl6o1yeGQcF9sfh8pa0cdzE= X-Received: by 2002:a05:6820:2782:b0:5d5:5e54:4f11 with SMTP id 006d021491bc7-5d564f41be0mr9865154eaf.3.1721671085653; Mon, 22 Jul 2024 10:58:05 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55a857934sm1413618eaf.25.2024.07.22.10.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:05 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 33/38] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci() Date: Mon, 22 Jul 2024 12:57:35 -0500 Message-Id: <20240722175740.6985-34-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813776 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987536wro; Mon, 22 Jul 2024 11:03:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbccJZC2NNrq0r4IIvXUPo1XOc6zxT3Z1rTHGlzfp0YQGdPnBX6Ll7DbFmEZo+7ufKm9woMIDyYzNlanLJEXQG X-Google-Smtp-Source: AGHT+IFN90uAMMA663mOPPgqwDHtPihT2VdYl+Qb9TLKtdZAiu8oYoQZUEa7Q0O/Ym2l/ioZnTcs X-Received: by 2002:a50:9fc5:0:b0:5a2:6142:24c1 with SMTP id 4fb4d7f45d1cf-5a478b65faamr6128521a12.5.1721671418307; Mon, 22 Jul 2024 11:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671418; cv=none; d=google.com; s=arc-20160816; b=nW1DhoscmQrdDpnpIvUZHiF0ElYEISVrdQZ5LLTbwcY2Ym9olv6CbHzINFa3X1GO1K oSnSHDZopcPxAsyYG4FmKYB+JL7h76mVP+eyMczEx3AiTxg5FG6xaNhrcBKUpE0U24xG M1FjjKAROxTURjrqlxDDVjw8vZHhaeCLTrXOCcv5e3ScoZz7ukMdF05BnCwSsGMnYfi/ TNpeiY2LK6pSaG9gCLt136e4y1wtFXQ7rjxZJY2rag3g9lgyBbWwVocMRq9OWXu43qeA wCMTCi2/0rh4717J5m6GbJjiUxKRnG7TuqY+7ZjbeL0ZodqfMjUH+p581BdBZ/W/IHvm 306w== 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=zljk88b5uhIt622WVCD8ub/dXpb7gNcfzj+9ej5gn+U=; fh=zGZfq8FvNJ1yVR+pX+KqvHIfkwNDAwEXIXFcIKiHR1g=; b=wAoJoPOStyN2ash/B8+ZcrWyqN0+132ND/hUz7+aAwZlVl6q7YQNXir6frSw5YD99Y vWKxcq5Un1c9Crut0fKHy1G6WjTrUv16K4/sqtsnQ+dq0veMiv1uK/YGlHTE+ZSQDop+ rz73TY2NIpaGCcPwHWWrjNe9bLJRrpbugEkSU8gTVrmmsSCJfGkRGzEc5rNTK+ZBteQT MDNj230il9W99EyUSMvCFhiqh/SSSeaFDoc3Ika4qRrZF8aoab8gqw8t3Wbz+dqpWjV8 JeuI1FSj4pxOal3IjZESPw9G+weO6VJnQNwRVy7+9Dcyc+AE8feaayZycfN53CVnKllL AJqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=laPvU+8z; 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 4fb4d7f45d1cf-5a30c7d54bfsi4798252a12.590.2024.07.22.11.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03: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=laPvU+8z; 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 CF61F887C2; Mon, 22 Jul 2024 19:58:16 +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="laPvU+8z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBBFB8863B; Mon, 22 Jul 2024 19:58:09 +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-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 801BA8870C for ; Mon, 22 Jul 2024 19:58:07 +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-x29.google.com with SMTP id 586e51a60fabf-26119999171so1968143fac.2 for ; Mon, 22 Jul 2024 10:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671086; x=1722275886; 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=zljk88b5uhIt622WVCD8ub/dXpb7gNcfzj+9ej5gn+U=; b=laPvU+8zfzgaeZKaddQuGXydd2pWMe/EF/y8EFUAUPkvVwqCJs0BcuvE/kZl4OH7FS Kr6I63bqfmhltwp6KRn6H/oa1I2xFUQJfga+It5WY1T3rwZLNkV4fe1v058euUCqjv/+ 6Itq5cwH+lF+R7tjRLHCTEb4fVRTtN6OiBV7Ip6V5tsxJdvDLQ+QGRuPOaJgNb2sD6S4 iTUyIphQC7JDmM38fKBqhhvoPdez13YSLn8lDoBYFcxjhc3IhgcBCErappbj1RKQPC2d uSUZNGc4g7Kh73qDCqxpQ005jQE+ttrfWPw3ot6wmboC3g8uHqNsuhlneioZ3MEQbwAC Tu+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671086; x=1722275886; 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=zljk88b5uhIt622WVCD8ub/dXpb7gNcfzj+9ej5gn+U=; b=CQaK+VpQEgDgGb7EhrSvcn7vbBfl0ib1mnoSwohVZIgYbPY15L8bJ87Licc/sRbPSO HNz4VO9YxsOmTWFmEKDQgloYLyq4qm7i5AP+dHeRTOOUrpfQF8GvuGRVmjM1HF/e2dlK oEPH0r+vlyL9q2pQZj/U+pmCcHOQ821hBENX2PwVBux51BEVmcNE9w6qIB2al7M/aJkU NpVQjTxh3ZxpvDhljQfiUzIirfj9W+VxkMzdjCvhTOlwRvVNkq686MyccqaJmShs4N6E ab0j3FmcFDvl2jJB2rXS2nuex9r19qy2LW2/f1FwFQg6N4N6Vqdf7F0fXYwXAaqGH+1W gwBA== X-Forwarded-Encrypted: i=1; AJvYcCV3cozR9G25JIOzJR0ajnTl5peqHvHOdx1mN8dA03fHRue4jMYD46Od9Q1yKpX6EA2KaWmuJx2ts4QiUSjRrGfjMxzUVQ== X-Gm-Message-State: AOJu0YzA3RMq0JtRGvpmIiGKbKEw453f9yf+rKXGy3RU7gI1KcYSg1n2 EXmfJT0w0YyeyUcJx4jA5K3UIB7nqrCohp19vuxqghrPmStAjgEfkYpyW4cHqh4= X-Received: by 2002:a05:6870:e38c:b0:261:236c:2bc1 with SMTP id 586e51a60fabf-2646906a752mr466938fac.12.1721671086301; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c7cf209sm1766436fac.29.2024.07.22.10.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:06 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 34/38] mmc: exynos_dw_mmc: Use dev->name as driver's displayed name Date: Mon, 22 Jul 2024 12:57:36 -0500 Message-Id: <20240722175740.6985-35-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813777 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987614wro; Mon, 22 Jul 2024 11:03:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWao/5oVP8Tk2y0t5v45O433J99XzgLzDBQcduBg912vD+n0xMpj2RnXnRZvqNHZVQxfVx8Xa3qXch9Qtx8tp2c X-Google-Smtp-Source: AGHT+IHpChC/g9Lgx2hzaVrA2MQlLzs0b4vYS4yY+Cy/y8uX8MTb0FGb0VHfMzkHRl+3OifiDYA4 X-Received: by 2002:a2e:98c6:0:b0:2ee:87b9:91a7 with SMTP id 38308e7fff4ca-2f01ea57aadmr3469151fa.18.1721671428282; Mon, 22 Jul 2024 11:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671428; cv=none; d=google.com; s=arc-20160816; b=mMTSrEBc8MbheNsgJzsubLFOTxc6cX/s54ogNO2edX4KWKAiwZ+MAuVHTKMAlTDoLV dbxe9XmNNPdToW71PzwRSafTFQ/7CIcOjTIR4OShCh94ObCRUC3SzLH/Al3kdq2/+Swb akgIsS5MNwVD0+pnuJLglZHnQqKmyxbWOEAW/94HOsUm97lkDhFdq54TslvY1WrHgrSj HlMqCtKvHQSlfNwJxQufdiOh5Jj3miQN6siZx77lenWITVyREpPtSf4VJ4R0AVww5L5C VN1R2OuxHi45Vm1bKZYRILVsM+3f3KxuSzaOaGHRs53Sr4E3gxygIYADUToauv4efL0J Kypg== 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=XZLO3mw6Oyr5K+0LciueYaGHr7PW6gsmKtec9KwuSJI=; fh=Edat2ay8lGK1IBnwhXcfwXl1MMVW4PmxSyNWvrE2fEE=; b=TLCISLMd7k/H9PBcd2SifhWfWqLr5dUB7zkwcqeaEJfTOg63tsLbQJRSZqHfYkVcL/ QFTiZEI/XiNyvb0bh2A+f8Gv51TbxGaSG0AaNKCnqNDQahcEN+o5Ij1gIRt0HEIiwYGV fUex3Rj+QvQUxrvD7MeW5a9HuV8NQSacpy7LIa48Idx/rVoI+8/L46LhBW3UGY9nxM8r oPZT7RZMU5d2cg6Q//S/ZWll4sC0N31slHAHE3k9xAgkE1H7bTPV4OVqE2tVknQkmuI2 CCWwc+oElxTs6PlssdJbRfj+wZPxyxxZf6NlZftMADU1zlpATGvAOuORpC8WRQcC+xe6 XQqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VThDvh7P; 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 4fb4d7f45d1cf-5a30a4d7503si4803220a12.183.2024.07.22.11.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03:48 -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=VThDvh7P; 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 3722F887D2; Mon, 22 Jul 2024 19:58:17 +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="VThDvh7P"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7C43D886A0; Mon, 22 Jul 2024 19:58:10 +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 372F788747 for ; Mon, 22 Jul 2024 19:58:08 +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-70445bb3811so2119001a34.1 for ; Mon, 22 Jul 2024 10:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671087; x=1722275887; 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=XZLO3mw6Oyr5K+0LciueYaGHr7PW6gsmKtec9KwuSJI=; b=VThDvh7PClihFJ4Z/hivnqat9L94SwNneR3gs5RIMfcACZKJYZKS4U3wSVtW+hHLk8 N5bgeMdgd1aIacw2e6n2Ja7W3thKR9wjusPVZpIiy+tyshExcZly6IA5P7I2JS5+s8Hy gXUNLAw8XDN2GAWLb1ZozVEJJhDvRTlh8e56NCgFi964IAOpVmvXbVOSLt4liueYUja5 kc57xdv1+DHb+HhDbJ8tj5J8MRcwJjsM8OrLFMBf8zfqAPQLBcfM/k+iZJMG/H+WGDkf z31ZFkixPwcWdf7mnuawsVbuPW2c9ZoGRYasvKohvZwZG/b/mqrdAjdN04ZAkzA+lyTz VCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671087; x=1722275887; 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=XZLO3mw6Oyr5K+0LciueYaGHr7PW6gsmKtec9KwuSJI=; b=E4IrdiufB7Nbew4m4v+KsJGzmv/Y1KYHUp1h0ofaneMubNxngh4fsqhncosFMFhTS+ uPNz0cQgQjeqCHbYvkQ5n/2ZrGTepg1f4pRV/OCWcFRdAfYjjqlajPnoTIHu8WJKPwVN +p4VMz/urElpsF9cNMEjV6+OzTzQpoA0O0stUmmskGkFv6svF2hDNMMyJy52GPP5ksze Q8lY4taN+U6K/tU+XEtvoR3aPMwBiuDGUXLAD6IxUEGqbjoHzfRNzavFFJApczgAfaQ1 3Dvik80sK53coZl3eKWg93u9I6boQ8fVuXmofcdMXRg2fmto1AY5BRlIpCTqrT4Oov0b w5ZA== X-Forwarded-Encrypted: i=1; AJvYcCVxg8GqfVj/SpbIZgwQrx9Kq/LUovQiYeOeq/OJV49ZwMbKxurI57++2ZnGvgztqmr8rNTpHOPMyHH3d7si0kSV9RMe7w== X-Gm-Message-State: AOJu0Yy17Klw+eP9IOaHFkgibCn/UAYFBsqrnCS/+jqcavf+Rm9HgyzZ PAXhuKtKlqZDHgXHRrtkH6zENOweP2L+yECuUyIc7ZjFZuwMCW43S53PpzVVTDE= X-Received: by 2002:a05:6830:7313:b0:708:d84d:f622 with SMTP id 46e09a7af769-7090099c938mr7143312a34.26.1721671086935; Mon, 22 Jul 2024 10:58:06 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f61b2212sm1622176a34.81.2024.07.22.10.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:06 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 35/38] mmc: exynos_dw_mmc: Improve coding style Date: Mon, 22 Jul 2024 12:57:37 -0500 Message-Id: <20240722175740.6985-36-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813778 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987689wro; Mon, 22 Jul 2024 11:03:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpnOor+IlDFEA/BKRXr2kGHpouRtxwQPujSVYIDjyw/il/PBx3pjDeETHKVb8fIZJANl2d45EJtl47HTSNX8QX X-Google-Smtp-Source: AGHT+IFdIlB6Q+ghrBiQ46jjGmgK4F+3eMkpZ2zVhJ6gC2weggsMgb7+5jv9m+ZndwEec7VTY778 X-Received: by 2002:a05:6512:2392:b0:52c:88d7:ae31 with SMTP id 2adb3069b0e04-52efb89cfabmr4923314e87.48.1721671437853; Mon, 22 Jul 2024 11:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671437; cv=none; d=google.com; s=arc-20160816; b=pYCRp8MT2aXKWc4LuygquCEKUQB+qLv6fvIJXjsvFq9t3lsHI2Bx5hYJcue07vIz93 JqBGyuubNMr1NBRL76uWfJJorgXD4oF28NaPua4ggDbdDbIq4oWNQJexpNCkBTFbMr62 tB/N6kHLp6kMNeyUajhaALuNCHwcm1sRyaAEoCJJnrEEzZOCkTF5nmfn73cN1EzYZN0m WH3q9Qz6cJyejSTD1g9KkEV4lJizetGSnsEqRzglkbo1Bzt0+knoW6bFZ+lbLl/mgK1+ h/gseXFcEIofn6t+sVVn4nS7NvDOS/wrR5kyI7W8jOt2JGwgD1TJNSGH4043xsGDg6YC LswA== 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=ad7GdUK8rf43qjd052nPBd+Af34mQ2N6SsTFgPP0XNE=; fh=Q6CBIes9Dup4+kPPFIvsnwCX2iuO4gHD80gF5cWTHFo=; b=uNeBabbHvofkCsq4WzR+9Qn0Rgd1Qp1sTOpneumP4cXH2icy9ep2P6YGoo1ZACDHvv 0qfrOSKDwxzQO7UY66FvEAdfEJyqfQro3aIWEADN7YxzrN6xOQ/wWf8dT5vp261S/r/z QCcfdBQOVVjJF9080EhGXrJqyOvwJR6gNImdnuUyltCWMMeIxPPyVGYPnq092YYL+t1j 71v5VgtEuP3IPrZAkOj5DHo6fCSG/+b8mz7FxkCvE4YqfYApWRieIgxVwFbGRY3YjLCO HpLNJii/Y1owqSm+B7CRT1q/Irc67vB6qZiq62+lEWpqF4PEzeT+bQcDo9IF0588bX1+ fZsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wSQlF/k4"; 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 a640c23a62f3a-a7a3c7882cfsi418189266b.111.2024.07.22.11.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:03: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="wSQlF/k4"; 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 8ECCC887D7; Mon, 22 Jul 2024 19:58:17 +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="wSQlF/k4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4090B88722; Mon, 22 Jul 2024 19:58:11 +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-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (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 E568388644 for ; Mon, 22 Jul 2024 19:58:08 +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-x334.google.com with SMTP id 46e09a7af769-7037c464792so2580940a34.2 for ; Mon, 22 Jul 2024 10:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671088; x=1722275888; 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=ad7GdUK8rf43qjd052nPBd+Af34mQ2N6SsTFgPP0XNE=; b=wSQlF/k4KilRApu9+izO4iP5Ruocx8mgFVpajCDkIyvamQiAuXQqmCWwXaCz8DtaJM AuCuuphnOGmPnKpnx5wicOF/hN/jwhXoxHtltUikNcfAoKaYfubJ3z90Yu8JQP6VVSAq 2MU+2rzLyie8NICebEDn6Sd8FQ5kImlGO1HOeCINeLpC4gYb6gDwKlRnZhP3shP0rbMY IcAAc+v6IgqWCzrP7Na+IhiZz+HiEgJkJ68dy+NUoPYLmG1/7XjEkAN4AE9lj463eXi/ CfYab82QAfNVdwedngK9MnyInm9pAcmcUhXHkUjbTm4IOENrAmrxI4aOEqtzSR2GSY+I 0LxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671088; x=1722275888; 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=ad7GdUK8rf43qjd052nPBd+Af34mQ2N6SsTFgPP0XNE=; b=OyCbiVGm8IpE+vZxsHcEaHAp0bzDbdNbt5JX1eWiZG7SeW+rztFD2WpKeEUnlAgVmY ped2wXsRPRRsDejwAiuPBwYW7pPb3sleLSG3W+ONoy36HoOYUOaniHmyWgV7p+ucLfNk byGtT/L5CHSzR5GiyocQthSpLoT2gTtC8QSUOauNbrI8WkH6Akwa+qWTNkG0B5Rg8Xcj tUiUnwwR8E/DDlmw2ElTBaX+2z/3b3IvB7TbOR1NJnCIBQUUyxocSdtuJfi4vFD/4/E/ /9EbUEOwlkqomrJfQNsl6m+dkX2T11/i2jQ33iRtZL8vLeP6bGqy+pM/wgQa5gLfA954 djSQ== X-Forwarded-Encrypted: i=1; AJvYcCV5fKQ/GKemqnHDs3QMfLeP+K5E87J2tGOQ2p0leK5DLkg18JrrU7J9p7qlHUBeNwrUZQvlmziYvMs07waVyhi+KcnW/g== X-Gm-Message-State: AOJu0YzZzZah6xAqtERx0pzx8wrtl7JyAf2QZP6RsU6+X3YZEteTJcQB sMzOoPX2nDvK8NAAzgDrnTsFJC5QOZNjnZ51bYv8hGNAR4SwhcxzrXKbnbkeTI4= X-Received: by 2002:a05:6830:2a05:b0:702:1ea0:cfbb with SMTP id 46e09a7af769-708fdb44267mr12159718a34.18.1721671087605; Mon, 22 Jul 2024 10:58:07 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f6189ca7sm1633927a34.72.2024.07.22.10.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:07 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 36/38] arm: dts: exynos: Remove outdated DW MMC properties in all Exynos dts Date: Mon, 22 Jul 2024 12:57:38 -0500 Message-Id: <20240722175740.6985-37-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 Mon Jul 22 17:57:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813779 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987782wro; Mon, 22 Jul 2024 11:04:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUVkuTCzdEJtOhFAcuXq98H+upF9JiVsL0ni+pvvrJb/pBum26/3sowoY64AT177ngQw55WBSmQEzrbKWcRYruk X-Google-Smtp-Source: AGHT+IEfwQHTjGwJ25pP89bnLTIzjY3jhomtfLb0Q0mShv1uEeYg7pZYA1vOY1vDU4kbxJbq2O9B X-Received: by 2002:a17:907:94c9:b0:a77:c5e4:eebd with SMTP id a640c23a62f3a-a7a4c011cb3mr522423666b.26.1721671447945; Mon, 22 Jul 2024 11:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671447; cv=none; d=google.com; s=arc-20160816; b=VSkEFV7lfbKVfk5sEbMuqv1hcZMjUqITgfMoPV+lCvyGad2NkeKEXCc4HFD5YSXKIV 0BRXTWKr/9qpJC1r6U3HlNOoH5I6vjPcstze2vuKJmPzmcblTaJlD53GJfwSbtZYXOVc dqrodG1bXkxmJfX8OcR6poc9HZUhYjEf3pYEy0IkAC7knd6yz1aELRNzDfvLppfNw8C6 vz1vwbtSVdw/XYNoqM7NW1a+l9Gg7auW/HPiYKZwTt9Zhto62tPJ8XDZvLOU64+oKTDa o47n2kfpO21AtYQti039ySJi9NrudpRbyxXCUh1fSjQPlysEcJUqWxxxeWuc6nDBbeF2 aDtw== 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=n/szmDhlxI5TD12xg5Y9pDn//djwXokH5PDOIv4i0Rg=; fh=1EOHTfiAjpDzUXCFPJOKImYuR1K5GFLC6rOJgp9UJ+o=; b=Zr7s+MwcBVJItzZ4uJFgwR/ieUSg66GOQ/CbTjl6ZWHfkYzCxsj7xm7obGW5MVzA4M Fx9dQi3RjAyRcosP67S4XT5ETH8XlyoOm2/0lc6IB+JOtT7UEcT0AN2fQxReBBfIcova 4HTX/UGHj92jOCIRzVTePihhhDQjSqXIUT3Ho0uOcYMbycVbqwGTXPV8pTC0hw31munE E7+wZx8PyrbxKQy6CPEgCC0MafqNTnx7GQuaNkW0BLsFKO5fw6PNWJsWn8osOU5IAJYP yYapTSyM+8F1hxZxvFCB7gopvd/pKsVDyLIM5ybPXCY6X5pRKgOwvLBqLWtVEx9t6KLW VIEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m2JBbQkQ; 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 a640c23a62f3a-a7a84481727si34340066b.593.2024.07.22.11.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:04:07 -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=m2JBbQkQ; 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 0FB778878A; Mon, 22 Jul 2024 19:58:18 +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="m2JBbQkQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8431688644; Mon, 22 Jul 2024 19:58:11 +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 70D09884F9 for ; Mon, 22 Jul 2024 19:58:09 +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-708b273b437so2483128a34.0 for ; Mon, 22 Jul 2024 10:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671088; x=1722275888; 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=n/szmDhlxI5TD12xg5Y9pDn//djwXokH5PDOIv4i0Rg=; b=m2JBbQkQuN/pCSxghtTQ02tDd6a6zCuL+1GyY2DhbIOSH+YRaVNW0uLreT74cgemFn 1yJyGFR1SV9AtC4NzmFie2lBi4YccHLhjdVfRRd8I+a9iaIT8LJAd8gl/KoYGaY31VAA 0H1Jn3Xfx3DBvOID/9n4useBrA1V84+yoVb0YEyK24qilmKSL5mVZDgqdgvG7QeZh/FO NjARuyis1w0FjHm9KLsRWJ7Fl0ILuvJP/GnnQaa6Y6fTtE5/zIjBtHj+uKoECh3V5H0V UWQo9+rhvyiBPVsM9Qy7ULI4OS4V2U6SOpiCAbGXfSJoyHx+Olr/QToiXZbwDS135LVd Eucg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671088; x=1722275888; 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=n/szmDhlxI5TD12xg5Y9pDn//djwXokH5PDOIv4i0Rg=; b=WHPsX9V0QAIwrEz/2rG5Kra+FJLZPnwrqOpcGXOinW/8uTPBLhgmDP+oA34cMScVyl Tlv9nnXrQikndjmPrbPDxVMIDFy+zhGLO81WisT52ySKHQLxxcNSMxpcHOLz39KDtOW9 yMma2XHqNtaeCuxVpT4FXbZP+ndJiQZ4XMoPACJjUIvGietKjuqaMP9L7N9kTvvkG6Nc qORM2ACovuxVvCOLLtXqCSleSusw7bKBnSHuU61yTEv3c+OBuJoBBCYLi/V5MONbj+Kl ETTbQm6Bl/1f1hBko/ATYOl+lUUj7H07nz5cUHVjE3x8kX9dwcUDLyp5K3sztgl/0vps BdGg== X-Forwarded-Encrypted: i=1; AJvYcCUtc7uX93BEtxght9h0v0bG8b7tN6YfGKfYmwofrVQGbWJ8BZ9pihTTlieIBCxARtG9KRQGySti3dnr0mX8zES4R68sWg== X-Gm-Message-State: AOJu0YwrrZxdG/iPT6JXW4qHOGygm9qXx580aDetYWd7GkwpSeNDoVFx vJN5XhpdypqRAmp6UnpOhM41Fx13PhFTR45rgUbWPZBD4xMYeMqru5f+UllwYSQ= X-Received: by 2002:a05:6830:698e:b0:703:6845:ed89 with SMTP id 46e09a7af769-7091809843bmr620965a34.5.1721671088279; Mon, 22 Jul 2024 10:58:08 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f6172f97sm1628862a34.54.2024.07.22.10.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:08 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 37/38] configs: e850-96: Enable MMC Date: Mon, 22 Jul 2024 12:57:39 -0500 Message-Id: <20240722175740.6985-38-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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 38b9968c1671..29ad31d5f8ed 100644 --- a/configs/e850-96_defconfig +++ b/configs/e850-96_defconfig @@ -9,11 +9,19 @@ 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_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 Mon Jul 22 17:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813780 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1987877wro; Mon, 22 Jul 2024 11:04:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVIATOIcpIDsNAR8+e8wmO2EODyX0/mlULFAd/SWMkzR4Tlza4Y/ht7+pDFZxiv9gYR5wPFHmSjPq12cSHP+70W X-Google-Smtp-Source: AGHT+IHwyhb8p/8OdpEEXFC6gyLtpfpuke6Hr89+4zXXvQf9I3NuZKzJ9T5UvlCBwIufzUBcOAsy X-Received: by 2002:a5d:64ea:0:b0:366:f04d:676f with SMTP id ffacd0b85a97d-369bae3a43emr7011929f8f.12.1721671458129; Mon, 22 Jul 2024 11:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671458; cv=none; d=google.com; s=arc-20160816; b=tTaFY/GoSAHAc1gD/SBTh+nVGrA3VI8n3C86/+FXvv78DagFkN7G3FROn3ytagclyB czDGGc3FiM4nQCLcEqPAA8kfMdYsMmPHirzKM8EJnXFo8CnjP6ZJZxFAI/lwJX2XBenW /5QesidcuFN6Vfm/mvxarFEg/RT3qSd4QmqP00PW+cUma9WMhfxeepP2rOSFFT2e3C+F AFXsvSMnjy6ZiWlyzeju7DaDtV7awdg0Bw4TH+mFC1uDsVckd9PZVBG64qvGenXLV/O2 IkrTnWARc0jCsDKhLF0Gt5Y6mTKiDkxc8eovVw2x/Dg5yT/8Uk0ITWoc0JfBuqUP+ekO O1YQ== 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=eDECQwEiIbilW7GC5h3kScq/RNkZ6iHasy9TlEMgqp4=; fh=HjOMvr5NfbZL6TzdBfuexG69hVP4Cvg+/Sze36vxy34=; b=huyGOgflxzBb/pdrToFb/oG6Hmw+pyOaP03L2PfZxiQz0HI1yIfpym80C6qVbNgzZV s8fRvAjq2wGxJxEN4nhPDo6whsc9xHt5LsztVkjVlPCIl9o4YPTMLRHEOHfolUyrQ2kb xNnAz+scx9fjxFIASORcp1EDow0IKnyWC26iCNjugN+Diyd/gyoGNIp+60UgpkclRmne /LIchjONzo4NgP/4BfpmSr63bCh3IJeG5/AQNXWENJmfeBwcZLFlKHcMzlAkwE35fFKT GQDqt11mwSr7G4+ptEgxNhHepsrkvna/77hrVZqhK3Ku7h4Pu0yy/yj8YZsFrVVbHjLz g3RA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lu6LSt+5; 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 a640c23a62f3a-a7a3c8c53edsi421949266b.444.2024.07.22.11.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:04:18 -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=Lu6LSt+5; 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 72F7B887E6; Mon, 22 Jul 2024 19:58:18 +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="Lu6LSt+5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 483648862C; Mon, 22 Jul 2024 19:58:12 +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-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 25B5D8863B for ; Mon, 22 Jul 2024 19:58:10 +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-x235.google.com with SMTP id 5614622812f47-3dab336717fso2642696b6e.0 for ; Mon, 22 Jul 2024 10:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671089; x=1722275889; 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=eDECQwEiIbilW7GC5h3kScq/RNkZ6iHasy9TlEMgqp4=; b=Lu6LSt+5/uhLRJhZ6hKH1z5jkE8yrBu5Y1+FJzSqaHmkmcxmbre2j63OuTvYD3H602 b4caaGxw9GrCMqLW1Qho93Vl/6m2u3cvfvZOHwMp4DfNjmjS8w+4Tv6UEk7bpkaqlZ8B 3v6tGCk5kp05M2Qg3+Y2G6jsTBN/cFs/xdDmvgN50rDumUs/Plu0VH1bcgNgiiJbWoxv latPnfSQtXd4sjldFygfjwjaR7SeXimKoAmpty8lo+VRJa866iAWuN29lv8zIzNl9dvM dqFaVBj5yBYhuy3CsgFjdLysIxpqwjNNuc4QOoAuLzSC/Nq0RT6OeCwDibFGqZEOSVRS wcaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671089; x=1722275889; 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=eDECQwEiIbilW7GC5h3kScq/RNkZ6iHasy9TlEMgqp4=; b=V26emDRo3J31RI4YvCCkTCD3kiL8kF4X8HzAATSio398E1LZXa56VwCPajOSwrIPK/ Njom064gOvuyGq8GNXwRFKnSYno8TcSbQVLXHpLSwSAlLfBeNvt2fib7guOu05hQNvXi b7XqRfWhWZ0KQPNXbY4a0m11kNr8vHP1iRcHRSZlwQUSokwjmH/dx3O4RHFVgDyEo/dm 0MpTgXv7s8RkUXN6IYiItl/zHukxaPGcgdkOKVi1qFeIGF9bRRN1IcPHlAKCGVlcDOQM Jo/1xZD4yABXWnolx1RTbE6gfzgK30xIefSQzrAxrZ4p0WoXmr4ugoTcvqAeHCC1XQX/ R4wg== X-Forwarded-Encrypted: i=1; AJvYcCXdHlDvck0eA4fdam3dwInaix6UWzT+9XtezWI3aTdKPaz4yfFC8+BKe3jlWlCeyox0nW+s2Gok3Eh+bO5fmZZVrcw84A== X-Gm-Message-State: AOJu0Yx+xRwptGkf9ZFJ4ury/1Hy9MUZblPv6kD84+RQF9uXjxc573wd J2qtRkW20G82X1iRv6iqBMf6FFlz0z6n2o18ntORfvrSEkDNwB4rTHD1cwU5288= X-Received: by 2002:a05:6808:124a:b0:3d6:838b:8286 with SMTP id 5614622812f47-3dafd0d18e1mr578986b6e.16.1721671088938; Mon, 22 Jul 2024 10:58:08 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae0969e73sm1587230b6e.5.2024.07.22.10.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:58:08 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 38/38] doc: samsung: Mention enabled eMMC in E850-96 board doc Date: Mon, 22 Jul 2024 12:57:40 -0500 Message-Id: <20240722175740.6985-39-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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):