From patchwork Thu Aug 8 03:14: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: 817681 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp675307wrt; Wed, 7 Aug 2024 20:18:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU0xql/WcK8dl8umKYDGWXW9Bu+sEkNsO30+49qUQGMZYLkU/0uuKit+EW3H2sTFBVU5tS4agflU2UElNf5ygh4 X-Google-Smtp-Source: AGHT+IGVhIiQyGNdipmgLWnbEn7es3lO+/WP9d5kGyV5eckW9lJMDee8LSpM5wbe9f+hJkmMDy3G X-Received: by 2002:a05:6512:b2a:b0:52f:244:206f with SMTP id 2adb3069b0e04-530e58c6e65mr261413e87.53.1723087085099; Wed, 07 Aug 2024 20:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723087085; cv=none; d=google.com; s=arc-20160816; b=NYeFZD/HJis/pehNu1Q/wYKgGV6/71A5Gg5cQO4EM4AsiAfhJ2uM1MhwHFBDSR4Q0P YzBUGa7zglH2Hyrn3jD76KClqpsRKlaiIpzjxAAOUdZpdO/4ENcgDT8rVbvq9o3g+yRL +WHVOoFA9EN/QrlCyODjnRXcdLaenTBEekI+jC2SPNelrLO5SXMLAVflCBMy1vO5zB41 dcpUklMs0yibxtCGv/fMCxF/6S8qhMlR0/2oOA556kI5MlhI9D2h31riY3T/+hd/RrtC rxyIfCp7Zpq2UcAQxpidftOI69VNyM5MfulDuJdC6y8WgXOJhi/OCNOqQ9EEeVSIPQbM flZw== 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=W/Opz58k2M9Rm+jtv1QysddzT+5tlN71aNOiKrAKmsI=; fh=itBk0Ds0gbxWuj9uGwEll6wcjfYqiSpMEgTSGTvFOEg=; b=lDAMD8ndsSRJD2MmEDUZ2y+QLCRkPlFaoTINUMl5Og4MIytqIiqeqrjTeiKM8CYxP4 5825HOtvlCZ2nhIMZGfPAlKznrN0jAlmZyBerNczys1Ly02k1M+zrGJXDmAEHuYE58ug TMxoxa/vTdRoCmEKK9vWz1g8HNewQ+R+eoiTjSB6fV4wvbweRghMrb4/RJD0OZgqtM1P 7+t2yBUe1PpbBCzy0v2NzJfS2/B0/iqggqoxzwvbgPwjznKIRYrZ9QJnBAkYUjY09Z6o oATdTqTfpw0R/KxA0MvjSmg3JDJir7SkjbxKM2Rj1sV6OoZVDZLOtYsbw/sJ1wIgnDsx fOWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OfsbG1QR; 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-5bbb2bf8cb2si263962a12.79.2024.08.07.20.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:18:05 -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=OfsbG1QR; 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 30A5488B8E; Thu, 8 Aug 2024 05:15:11 +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="OfsbG1QR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DBEC88A7A; Thu, 8 Aug 2024 05:15:03 +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 7D92F88AFF for ; Thu, 8 Aug 2024 05:15: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-oa1-x2b.google.com with SMTP id 586e51a60fabf-261112c303bso388187fac.1 for ; Wed, 07 Aug 2024 20:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723086897; x=1723691697; 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=W/Opz58k2M9Rm+jtv1QysddzT+5tlN71aNOiKrAKmsI=; b=OfsbG1QR8b2P9lNFp5eO5ziF6500ld4jBXmlrUgn951cTS9hi8jyh+AmjtC13T54vH ZuTcopshwkMxYmvwR3GqC9/vwvIiZzsT9nG4VD50vZh3pJPpYZFUk/Q3msaNFjdtif+O QSU8B2z6duu9YBa6LVcGoenwiexaiHcec8+fa5vnz8dkBFrFRCLP8byR4wkrNWTiYPyp 67rajmpEsY5MuXqu0quHlGKRn2bheMkoaEQYinP5sbFAAAjt0H8Ya4L1dxbRULVMFirC UJoQuYI7+lPNvEXxf6Q16K3d1iPbZYFJI9zcctRogF9CjiwIiuqGzQiqlq4EDnt2SPZ7 1fQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723086897; x=1723691697; 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=W/Opz58k2M9Rm+jtv1QysddzT+5tlN71aNOiKrAKmsI=; b=wOKNArGQ9gk1f4q5JkIcCY8TpZFwSPWCWNwlnEwdEqRev/d6jjnQlOSbPZUj6j9yFR pVrs7tiqPmXMefENuRIPJaG9eF70QQvxrMvQZiDjsiGeHNyVtJvoBJ6Yg/iMDf4lLxit Hj5zqlQxoqJy2RWy3Li2duM3PUZhlh2dC6KJFIro5n8yC5ftYj34chbpr4+Nj9+CsfxC y8ZYltiw0r8w0VJLmQ1fbjcAufwv7EwRPomi24+vHeAYx9k6sGQ3wHAuhp2xMjSDJpSS EsS/fzeCQJsQFXv4VAayIJ7A768tmXlADaeVFdRgLomdLx2PE0FVLvmmRTWpixgNzb0x Evpg== X-Forwarded-Encrypted: i=1; AJvYcCWnXZu1KUN/viKQuHi6kuCYjx8pasTRIxOey2CtZzmCpxuhFfSxi55lLgF55tjlWqitCkafuvnJBFri5v/H1S6yQGjfLg== X-Gm-Message-State: AOJu0YxWg+wt19ssACJ9nfZv7SgtFF1kUdaU4T+LKIsXWaoB4GZPZHXr /ZZ4vQsBJ31CJBY+RujrgmXX9PdcunTHPInCGOFfXS+xrOC8S6r1VjURSza+yd8= X-Received: by 2002:a05:6870:b69f:b0:261:e19:4587 with SMTP id 586e51a60fabf-2692b61801cmr761131fac.6.1723086897413; Wed, 07 Aug 2024 20:14:57 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2689a2f2269sm4359925fac.14.2024.08.07.20.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:14:57 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang , Jaehoon Chung Cc: Tom Rini , Henrik Grimler , 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 v5 17/38] mmc: exynos_dw_mmc: Fix obtaining the base address of controller Date: Wed, 7 Aug 2024 22:14:23 -0500 Message-Id: <20240808031444.9619-18-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240808031444.9619-1-semen.protsenko@linaro.org> References: <20240808031444.9619-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 v5: - (none) 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);