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 BE731C7EE23 for ; Sat, 25 Feb 2023 19:19:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1022285B7A; Sat, 25 Feb 2023 20:19:42 +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="MirIZVln"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E61585B7A; Sat, 25 Feb 2023 20:19:40 +0100 (CET) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 E364485767 for ; Sat, 25 Feb 2023 20:19:37 +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-x52b.google.com with SMTP id d30so10245249eda.4 for ; Sat, 25 Feb 2023 11:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=G0ZX8fjPfzsN1xCrhR7b3bTX1EeFcwaRFEgkzAvokyE=; b=MirIZVlnvX+irtTpxHrQSwJyDr8SktdCC3xK8Vk4H227BUDh6DhZQMivTYGzeEyyBy K+UIr0PTCl0WxT/+HrZMlw15xMDhND1YiL3xIv+umtEy4OgnaLZ1+iR4IBIifruB+rDr Nw/qZjaVZDOS0rLGMlEAN1OiJxW5pPf5fCUO+4qe+AI7zyRTrereEqrAn3pfisFvM4rH ZlFXV2W8N2RtexbJWT0z83mf6r6jexJehF6Df2ENPAOf0EWv1q2SKJU9Kd0gAw6wAu8f +/2wQ6J5M0YHWNIifOfZas6+iklGUqULs4/mTLAAb3F9ZdG1JbxqY0j10yWik4FoKVfF eb1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=G0ZX8fjPfzsN1xCrhR7b3bTX1EeFcwaRFEgkzAvokyE=; b=xZX6wFlC0kwM1Y8cvOHDvEI1tWtqUhXezALU4scUbG6yHOx+RHtyFWGJGRJreUPhFa jKLeVuJy9mmHWY1zZ9+uySN1Eg8g4lRapp5uN5HNOaz2IhQbb+1A+izxsPtAiTgduAKQ 2T+1TZ0hwLm/eVl8jccJw8KPtDFDDy7PA7ZlFXjpSbs4kxBCgFnhA8dJPZP2z8StjwmI k08Yvhre5i2B7h3O8Vxf3RhcKoIYdTwdrCyfHeN+BVGJ4XVqFilY8ocKjrm95juivjtA 4ECrMvyMf1sbEYumZ9Jx4ftKBcAsiUwjXHc7e7faOZO1KKZNScnC7FHuGcr7ePh/F51j JMhA== X-Gm-Message-State: AO0yUKV2Dfi3/cq0LIfoBQkkGSJ23nelcrULRAsYQ7y7/kinNTrPQY91 E/NJWRwPpOdnez6Q1CuCN64= X-Google-Smtp-Source: AK7set/4p2te1xlb4ewH8iQ+MRjnwvSGEKwdjwHkta9/w9T/bTLKS6m+vS7wQYMnMmaDhzeXPRKTMg== X-Received: by 2002:aa7:cfd1:0:b0:4ab:2555:408a with SMTP id r17-20020aa7cfd1000000b004ab2555408amr20242113edy.22.1677352777533; Sat, 25 Feb 2023 11:19:37 -0800 (PST) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id u30-20020a50951e000000b004af6a7cf249sm1164273eda.61.2023.02.25.11.19.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Feb 2023 11:19:36 -0800 (PST) Message-ID: Date: Sat, 25 Feb 2023 20:19:35 +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: [RFC PATCH v1 3/4] 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: <49d0321c-72e4-429f-335e-8f23ff866d39@rock-chips.com> <0a708ae1-4b92-a572-1d74-343070c8a26b@gmail.com> Content-Language: en-US In-Reply-To: <0a708ae1-4b92-a572-1d74-343070c8a26b@gmail.com> 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.6 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 --- Note: This is needed for a Rockchip patch serie to pass the test and must be merged before by Rockchip maintainers: [PATCH v4 00/11] Fixes for Rockchip NFC driver part 1 https://lore.kernel.org/u-boot/f3dba231-4a55-0a94-dfab-5cab1419d132@gmail.com/ Replacement command used: find . -type f -exec sed -i 's/*)devfdt_get_addr_size_index(/ *)devfdt_get_addr_size_index_ptr(/g' {} + --- 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 ab0a681c..93e57a54 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -378,8 +378,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