From patchwork Mon Jun 10 01:12: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: 802949 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1734817wro; Sun, 9 Jun 2024 18:15:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW4V88YO6ba7AU5bY4fur2LgCZmTBs7pgVXro0hX7fcXqw9yEosTH+A88lUZW7ks7kkw428bcIGPwpBKTsBEnx9 X-Google-Smtp-Source: AGHT+IHb7EggDpobnDIsDVkqevtC2MrP/wEqkbNFj7VtdrWzJVgmjRFiBpWltdkZNsNwEIIIUa6M X-Received: by 2002:a17:906:2a14:b0:a6f:2448:a274 with SMTP id a640c23a62f3a-a6f2448a3f6mr29800166b.59.1717982145235; Sun, 09 Jun 2024 18:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717982145; cv=none; d=google.com; s=arc-20160816; b=TQB2P187hiS+8y6LZZDtnCahHLRJLX10m49PPe5KzkZUYwqvBizV+RC/QkBE2s6hFX M3OR7G8vvrUHkPWFooLNqQDqVeP5/DiLCrTp/5OSF5McBB1fbWko98my5K9dHBqAdRst 2+71/+E3uFfrt/iE9icqJjG0+kqRw0PxuotXYSIQVGXTJIlEs7VPDDwlbFR9D4JOOENA M5SDGPeR6SAjvcPwCBCSDtwYBU0EgF6hQb2u0zJT++XOyeQhtyniRofAC7YuBa3JfmPc RzYfDMtVifQBVtNAsTlapieD4Fp02b+vCnak5fD/9sbNGlcMVbm+kVJtBFRl2Az8iJ6L FTog== 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=bCjyQx/0jLeoyYpM8IqEJbONYckgIBxdTVXk9Pljolw=; fh=5svQwgiGHzt6zquzvXsZZCcLCsxiZr60cFpssbkvFsw=; b=qjio1SEnc7ACWTNXvKc3Tn6CY20zCzX43DcmRT2JZzXjEGxINi3Bh2gH1L2zm0J8+u q0h+9RfACpDGEqVJ3+LVwVLmxw2W3+p6SFOHl8ZjsWvLq98HB5klsFFdME2hmy8GC7l9 rUOR2fVSGWEOcb4AOMWPn5CJSJm6t2IQc5b89MCuKu+jharrVS9sAU/ETaOz/2vI/V00 1DALdRqg8oWdrFDEW9obAaFJtzpP8DuzrzRPKI/mo2cdBjADOTNllxGGnhaXqXFy9NR2 xrbBX+UAhN5Jr4D8yRxH7B2b13vTz+T1OdEUQZr8+oI6qocwAJz/h4575sV91fFb+LU3 gt9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wna+KWkr; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef84e2e35si237711966b.317.2024.06.09.18.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:15:45 -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=wna+KWkr; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE8E28850B; Mon, 10 Jun 2024 03:12: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="wna+KWkr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D52A884FC; Mon, 10 Jun 2024 03:12:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 482EA88489 for ; Mon, 10 Jun 2024 03:12:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6f971cb3c9cso824252a34.1 for ; Sun, 09 Jun 2024 18:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717981960; x=1718586760; 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=bCjyQx/0jLeoyYpM8IqEJbONYckgIBxdTVXk9Pljolw=; b=wna+KWkrWcTjK35R6v8trTsTmg078Kzev3XZWjbtvL7YlFxHy1A/Ad4BMNfylVPozx dZZI6rWPCnbo0hapH+YSx/xT6YmAofYGVluCSDpWceZfRgIxfai//bWpOJrj2nBKio9e htG17SAgIUxCqa1wORc6HQ4hQOaKuOl1jVJvDyQ60sWKPnv1fQSCaCHQjGn2Xjx+Rvfw WXCukQqvTPaUb8jKkp3dTIOcjby5nMmNCaZKfHULU7OEy/aBrgUrq0RW3MP8iFEOtmrb 3E8cMd6FncosD6koikmcqV7zuPyFVRegk3RXdWi8zyfsPzdCuB7RsQzDuFyiUTN6NmDx T0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717981960; x=1718586760; 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=bCjyQx/0jLeoyYpM8IqEJbONYckgIBxdTVXk9Pljolw=; b=AmHQJgTKmLnWWoCXjIbn70hBlGHHkkJpPF2DcNFLfxQL/JUOsgioDwqK7IKBOPki7O hLbBLPpgPB8UxKA9XhnMLlqB/beq43sYdOIRSwPgns40M+nMWQaOR43h3l98KBR/G4rD Wm1C7E2+xHXOpwmRUC7c9IJEmJiMOmUo1opudVq1189InOSKoL6q2+hFl6fqnAQ6SwWN i/Kr8ZoyWKblgFXA3OO5Q1CjFetFPTUP7Vle+SYaBcCaRi6MrzdLhBv/VKttONdoXIwO RGcx8WU2MXAL/7U9cNJv4Uf5D6d45HZGcvw+/GkyvGNk2kgetLd26X7QPgqwOS0OuM6G SIEw== X-Forwarded-Encrypted: i=1; AJvYcCWBQ+vltC8IXkKsMib5Vrq/ibp7Br0/zT8Wevjnhfjt+shw0kF1GvSDl5iG79RBeCeb9C+LduB7lwlzh24ARi/g5Jt6eA== X-Gm-Message-State: AOJu0YwqFfYTCaYq9CLlA1nzCGf9+pkWH34aB3wbasqciH5abzoNiG7H W+HqcayFoQAPNeDPG+gz0G68dVy1HT2JOfMQvT7StAIPceG3ALcfddVxzJmKwQ0= X-Received: by 2002:a9d:6a44:0:b0:6f9:80a2:c4de with SMTP id 46e09a7af769-6f980a2c5f8mr4775853a34.32.1717981960018; Sun, 09 Jun 2024 18:12:40 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f977ccd4aasm735991a34.65.2024.06.09.18.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:12:39 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang , Peng Fan , Jaehoon Chung , Simon Glass Cc: 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 v2 18/40] mmc: exynos_dw_mmc: Fix obtaining the base address of controller Date: Sun, 9 Jun 2024 20:12:04 -0500 Message-Id: <20240610011226.4050-19-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610011226.4050-1-semen.protsenko@linaro.org> References: <20240610011226.4050-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 --- 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 14cb0c05cb55..1f69e193f601 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -156,7 +156,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); @@ -174,12 +174,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);