From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D240CC6FD1F for ; Mon, 13 Mar 2023 00:32:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A34178611A; Mon, 13 Mar 2023 01:32:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="bnHOB7SZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E74648611A; Mon, 13 Mar 2023 01:32:22 +0100 (CET) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 ED52B859B4 for ; Mon, 13 Mar 2023 01:32:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x535.google.com with SMTP id j11so42283352edq.4 for ; Sun, 12 Mar 2023 17:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678667539; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=KIjS22A3W22nF9WqaYHHkoHIymbyyuWWft8SRKDXnqc=; b=bnHOB7SZEhRN35bq1MX4EiskkPaBc3EsTFZIDJTEz/uIpVLssTAUzhYpjMuqV3N0Cp O2wKeSpWismAoJiKFBHRroytDypd/VEJ5sMEDRX0rNVKS6imOtpq7jpbd60U21aXPDKa DDbRq2xVfpFqsqrdJlJVAj64KdP5vmhEAZbUFvxufslu7qv1jNcNUPYhzf3g2w0E1tQt PDa/5bPyy31ltfRZQepwlofhMfGp4JzLHMBlJZ1vIT3DtUAGcWbsBe5eIpm+2he5H4yY 3YitOUxWfTiiYFmYQIYlggIC+7O9JEH8byNGIqloGqutnVxk1zkKGVDeFrz9FLYtPcst 5xcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678667539; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KIjS22A3W22nF9WqaYHHkoHIymbyyuWWft8SRKDXnqc=; b=CVwITPxgrREBB7EgWtPwLWAtvs3lGv3yalTUTy1FB0cYHgNqsCJXDR4A2sEfY4+tum Q8oH/U9a2HTh4caZjK3n8BOH96grTMIpWOeQwXhtZ4X2OgvL6f7wnHtlBukhmNrADypN 8JOWSJ6hq+Nx9xTxntcPTg+IKZnz7S+sysK+ggUTcxmVrsnmKeVssmXsTBWf4sAbct6g IACvwihAjnB+zR0WJqN6nagHKZiAuE1eL8RMBTfClZMrb0L25lmxmWo2etJumYrIuSNm oqe12l3dxVw5myND68Fy0gDCCOj9C4zdDj8bcep2KNxecOn4r77HBLpt/YRwYV9Y3bZH CRnA== X-Gm-Message-State: AO0yUKWGN+V/T4SRvsJywpYg+WzhrJr65P7Ex8jKQkoHAazBJRo2Ee+T HT4qrvFxu/Of7RNW0lM1L6s= X-Google-Smtp-Source: AK7set+t4FvcsTF9ToTwphmot24wwkBhg+I0PnAmtvTX+nTh9/+1yfNFesIWF9Gy1uoqTnXQxqZgwA== X-Received: by 2002:a05:6402:1058:b0:4fb:ec6a:2357 with SMTP id e24-20020a056402105800b004fbec6a2357mr2147757edu.34.1678667539557; Sun, 12 Mar 2023 17:32:19 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id l12-20020a056402028c00b004fccef39ec9sm234780edv.70.2023.03.12.17.32.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Mar 2023 17:32:19 -0700 (PDT) Message-ID: Date: Mon, 13 Mar 2023 01:32:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 From: Johan Jonker Subject: [PATCH v8 19/24] drivers: use devfdt_get_addr_size_index_ptr when cast to pointer To: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com Cc: u-boot@lists.denx.de, yifeng.zhao@rock-chips.com References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use devfdt_get_addr_size_index_ptr instead of the devfdt_get_addr_size_index function in the various files in the drivers directory that cast to a pointer. Signed-off-by: Johan Jonker Reviewed-by: Michael Trimarchi Reviewed-by: Simon Glass --- drivers/pci/pcie_dw_mvebu.c | 6 +++--- drivers/spi/cadence_qspi.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pcie_dw_mvebu.c b/drivers/pci/pcie_dw_mvebu.c index a0b82c78..3b2ada54 100644 --- a/drivers/pci/pcie_dw_mvebu.c +++ b/drivers/pci/pcie_dw_mvebu.c @@ -569,9 +569,9 @@ static int pcie_dw_mvebu_of_to_plat(struct udevice *dev) return -EINVAL; /* Get the config space base address and size */ - pcie->cfg_base = (void *)devfdt_get_addr_size_index(dev, 1, - &pcie->cfg_size); - if ((fdt_addr_t)pcie->cfg_base == FDT_ADDR_T_NONE) + pcie->cfg_base = devfdt_get_addr_size_index_ptr(dev, 1, + &pcie->cfg_size); + if (!pcie->cfg_base) return -EINVAL; return 0; diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index c7f10c50..6a52676a 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -384,8 +384,7 @@ static int cadence_spi_of_to_plat(struct udevice *bus) ofnode subnode; plat->regbase = (void *)devfdt_get_addr_index(bus, 0); - plat->ahbbase = (void *)devfdt_get_addr_size_index(bus, 1, - &plat->ahbsize); + plat->ahbbase = devfdt_get_addr_size_index_ptr(bus, 1, &plat->ahbsize); plat->is_decoded_cs = dev_read_bool(bus, "cdns,is-decoded-cs"); plat->fifo_depth = dev_read_u32_default(bus, "cdns,fifo-depth", 128); plat->fifo_width = dev_read_u32_default(bus, "cdns,fifo-width", 4); -- 2.20.1