From patchwork Thu Jul 25 20:44:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814392 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp566896wrn; Thu, 25 Jul 2024 13:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCej9shT61RZcu+SIfwN81bjm1MVL05t0jgF9sGBo4+37dLGxv9JrW0Smsz2f1ycoPrcN6rEyFj7h7Pmmebyu+ X-Google-Smtp-Source: AGHT+IEafTX/iyG4hAwr/0l4aRpTu3YMQdu6BkmnR+rm2YWL0KuOLpj6SyjvuKeKD/GgdjXM7N1f X-Received: by 2002:a2e:b8c1:0:b0:2ee:7c12:7b36 with SMTP id 38308e7fff4ca-2f03db7eb92mr28712611fa.19.1721940488840; Thu, 25 Jul 2024 13:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940488; cv=none; d=google.com; s=arc-20160816; b=WvMPao2a+P+JRGaJCQNAitpnV0AOC19scT/kddFor5Y3FcSq9Bk8RaI6TY9uU9Xt/J eSJWGoUqhoCFmM/JQBCYr+EKkGdUhzi9JoHwoAYl6RkqfSX4kO+sYn97IojlR/z/zZBE bQYYdPPJmI1qCge0DUUelib6HpZRNoVULjJOfsmE71Lkxrc8K/L8BD7Jwpk7/gq2J5ad d1PXf3HDSNFt9Wrahk5LcHVp4j0w3fb7eD4QqYnHXQFLEYI8umN4tYt2Ir4WmJUea2T8 Sh197zbxETUOaq1x1iPYtPGH2UmTTtH6DZRyLvtG1Y0LtbfCmcBARuYTEcURCJ+OxqyD 9aIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; fh=cPdG/mRRsGcV6XN2PUX41Xfl+BEGQS+AR4skRZZ7VTA=; b=zmKU/p29JGO4JGJBshJjTdasLLowT/Lo0xkNeB3dht60pD0Ncb0ACZa9Ee/uxzwEPf gMAkmhPk4VlbR8ZTXiml05+CrEAjL2nQU6tefbMDyhJ4zPT61edQcosav7ZIjqz7tsbu wZRAUBvFDkDMF+VyM+o1oC0/x+Tk5UHQD6S9ZTI1uzJuArqeOIylY3dNBco0AYvBxmGK s1WTs9dCFyM4OXiQcPdky0lk4vhTrwHezunvVmR38YE0StDepV7UavHZJ3OD7yRR+hm2 sRQlwmX8DnCOYUdi8D6r7+WNRn5D6nkImJtH2F06M35U77mnecm7aTqeu2Z1mL81xLhT 5V0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8KxWYhZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d08d324si6142231fa.9.2024.07.25.13.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8KxWYhZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F07CB8863C; Thu, 25 Jul 2024 22:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="L8KxWYhZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08DF88860C; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7633088403 for ; Thu, 25 Jul 2024 22:45:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-260e6298635so299979fac.1 for ; Thu, 25 Jul 2024 13:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940334; x=1722545134; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; b=L8KxWYhZIGiASGM0OblrQuoxvgeFIzBmXglOZ2i0u6COu+6nZ4ezSbO0nD35njunjf y4r4SLJAV/C9dIBB46yh5Chh2pvTMMpUjNouKmU2lGAPM+EGkgSYwLI9QE2bXZmiIBoq axmatO9FFpBqfs9X3n9oayubdmy53ko9OwnkrqwjX2LazHgnADMwBBCtNI5gJXR76fg1 DrJifbs9N1l4N8hzkrZU5ZwESjJtnKptDTkPdgvYi8pCI9T2aEv9L/+nq3K+afUxvl7m Gwi3dSWHl937YpIQ9d8dykI1PRP5FLoqW2kf2TNoxdgg6oubjbmbvrmLkt0JqdIcecFn hW5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940334; x=1722545134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lsJbcyCvg89puDca1y77AVKb4GyP0NkPuWZdHw+/E+Y=; b=acwMQCOAO3c0JcXwVHuAxGqocQi2mOGR8v3Anz7n+nS9gc4bcXfBoHWgInxaX7t3f/ cJFRgobXKp/Kfhb1lE907vpU3D7v3oOSD1KIJ5MwTVLB/uA8ZADnJT/jhWaaBkpoPY2y bntiOyMmhLthgxR6B3qsdfEAWQvri5L6QnLffK832qPU1axHazlaxBNhm/o4ZWgxTeiR 0L6Lj/6ck6WciGZXfKYGaWmsBbQy1RiUoKQspIAym/XglaBo9ZKIee1llhjzdvLZkwxy iPm6iBWy970xoUcorVjmRM8N3a6tNoKh63TjvNOygF0Mpg9qkPh3rSRiCtq/+5edqNX2 YkVg== X-Forwarded-Encrypted: i=1; AJvYcCUrPYo9ksLsBNeEbnRvl9yTDdSh26Au6K09DbhzbHwy2yC2Fe62iOMG4+1xFpIVB+rrE10i7eSiRRk5RzaA+qe8tPPvSA== X-Gm-Message-State: AOJu0YwXsMNgfvpgRJvExtJ5PIkTxv7JQHKEGWM15LrpGxztjVh4ciAt UScZ6vIkHmDscbMF/IFgra/csVufWNiHiE+3UnIC0/5qji4fHRambS9ApJhRjSs= X-Received: by 2002:a05:6870:3a27:b0:261:184f:4ef1 with SMTP id 586e51a60fabf-2648e8ebaafmr2413298fac.15.1721940334044; Thu, 25 Jul 2024 13:45:34 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093070671fsm458194a34.21.2024.07.25.13.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:33 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 17/38] mmc: exynos_dw_mmc: Fix obtaining the base address of controller Date: Thu, 25 Jul 2024 15:44:59 -0500 Message-Id: <20240725204520.18134-18-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Getting the base address with outdated fdtdec_get_addr() API and further casting it to (void *) leads to next build warning on ARM64 platforms: In function 'exynos_dwmci_get_config': warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] host->ioaddr = (void *)base; Use livetree API instead (dev_read_addr_ptr()), which handles this correctly. Fixes: a082a2dde061 ("EXYNOS5: DWMMC: Added FDT support for DWMMC") Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) drivers/mmc/exynos_dw_mmc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 377c9e6d90b9..a86d58663c1b 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, struct dwmci_exynos_priv_data *priv) { int err = 0; - u32 base, timing[3]; + u32 timing[3]; /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); @@ -173,12 +173,11 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4); /* Set the base address from the device node */ - base = fdtdec_get_addr(blob, node, "reg"); - if (!base) { + host->ioaddr = dev_read_addr_ptr(dev); + if (!host->ioaddr) { printf("DWMMC%d: Can't get base address\n", host->dev_index); return -EINVAL; } - host->ioaddr = (void *)base; /* Extract the timing info from the node */ err = fdtdec_get_int_array(blob, node, "samsung,timing", timing, 3);