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 8CE66C7EE2D for ; Sat, 25 Feb 2023 11:44:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6ACBF85B6B; Sat, 25 Feb 2023 12:44:55 +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="JiIRJMYj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F9D885B7F; Sat, 25 Feb 2023 12:44:53 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 93A5F85767 for ; Sat, 25 Feb 2023 12:44:50 +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-x536.google.com with SMTP id h16so7327487edz.10 for ; Sat, 25 Feb 2023 03:44:50 -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=3gkBw3QLY8PDwTq1GcL9tHqkTL2BgfBa6FfueSSFPck=; b=JiIRJMYjmO396XSgjMsiFt4WufYCM7UwvaqBiXdANoXC+U6MQjlFN4zGYziP08Nofu IutHa5+6U5uzZr0tY1xWtxv8UbMFkDf+WxZIIrUHVqY9Xd+/N+/0SaIlAhDVZ0A27NJu XQhJfjUjduMRyZzVpOgn63YgrCp574CXmNwYDBoCevWufyZACUJ/SiQEq8W5V3woOSLR hnsTewsuvMpGDgA1VqLcjsvdZwMHczKL6ekPeZe4xFQBban25yzFPHB2QIi7ijgS230M nRiEtEJEf0zwY3VTf2hdlu0r3VRZ3QDl5LBjnmwhfnLcFy3/RxxyKNVx/Md8GDt/7eGv Smaw== 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=3gkBw3QLY8PDwTq1GcL9tHqkTL2BgfBa6FfueSSFPck=; b=FSmjcSq6chXFrq7HiVq9DSuGW7a4i7seFH+YzUPO+lZbPTCUP2btP1vvqgJnEbZc+M E7WUif62IZGPIGqo2SqYHM0K+MSh30IS2psFXDTJIM2WGYQiIRbWC8iSo3FBNrSBSijg GFqltwrZhinWZufO0pKYYWtTJrdw+BQ/+oXx9ITfx9BAcerCa5/VwiUXTY2jcjvKufd3 hpT6QcUCav6rz2X3TkdjcR7yd8oQn14KZRs4nav/SKFPjA/WFcADJy82l0EujKscBmJ9 9inFWfAvLRPL0hGZmT/NwjvIaRR+QtSoylW9HzTDxTxE7B7qwcYu5ncCJM5iwjGPOy2A DhcA== X-Gm-Message-State: AO0yUKXQCPninurTIwRZK7Q34JqJx/CI0D1t3uIgCpMIOYTrQu8oG+DI s1tzBSXMqXdf+LgArb1wjUA= X-Google-Smtp-Source: AK7set9bIpGgPKLduKQec8EwY+nY9ac50f9pDPsyPfFgGulRslCadjypnccRzxYl9RwZUb8C2J4RNg== X-Received: by 2002:a17:907:5016:b0:8b0:26b6:3f2b with SMTP id fw22-20020a170907501600b008b026b63f2bmr18131234ejc.53.1677325490169; Sat, 25 Feb 2023 03:44:50 -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 jr6-20020a170906a98600b008b980c3e013sm746823ejb.179.2023.02.25.03.44.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Feb 2023 03:44:49 -0800 (PST) Message-ID: <37692c20-a1ec-7620-159d-1c6399f8954b@gmail.com> Date: Sat, 25 Feb 2023 12:44:48 +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 v2 2/2] spi: spi-aspeed-smc: use devfdt_get_addr_index_ptr To: chin-ting_kuo@aspeedtech.com, clg@kaod.org, sjg@chromium.org, kever.yang@rock-chips.com Cc: BMC-SW@aspeedtech.com, jagan@amarulasolutions.com, ryan_chen@aspeedtech.com, chiawei_wang@aspeedtech.com, joel@jms.id.au, dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, philipp.tomsich@vrull.eu, u-boot@lists.denx.de, yifeng.zhao@rock-chips.com References: <49d0321c-72e4-429f-335e-8f23ff866d39@rock-chips.com> <6487e8db-c954-9ee0-f6cf-88ac1fcfac96@gmail.com> Content-Language: en-US In-Reply-To: <6487e8db-c954-9ee0-f6cf-88ac1fcfac96@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_index_ptr and devfdt_get_addr_size_index_ptr function in the spi-aspeed-smc.c file. Also fix dev_dbg to be able to handle both sizes. 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/ Changed V2: Use devfdt_get_addr_index_ptr and devfdt_get_addr_size_index_ptr --- drivers/spi/spi-aspeed-smc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index a3c96333..fedcaad6 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -1125,15 +1125,14 @@ static int apseed_spi_of_to_plat(struct udevice *bus) int ret; struct clk hclk; - priv->regs = (void __iomem *)devfdt_get_addr_index(bus, 0); - if ((u32)priv->regs == FDT_ADDR_T_NONE) { + priv->regs = devfdt_get_addr_index_ptr(bus, 0); + if (!priv->regs) { dev_err(bus, "wrong ctrl base\n"); return -ENODEV; } - plat->ahb_base = - (void __iomem *)devfdt_get_addr_size_index(bus, 1, &plat->ahb_sz); - if ((u32)plat->ahb_base == FDT_ADDR_T_NONE) { + plat->ahb_base = devfdt_get_addr_size_index_ptr(bus, 1, &plat->ahb_sz); + if (!plat->ahb_base) { dev_err(bus, "wrong AHB base\n"); return -ENODEV; } @@ -1151,8 +1150,8 @@ static int apseed_spi_of_to_plat(struct udevice *bus) plat->hclk_rate = clk_get_rate(&hclk); clk_free(&hclk); - dev_dbg(bus, "ctrl_base = 0x%x, ahb_base = 0x%p, size = 0x%lx\n", - (u32)priv->regs, plat->ahb_base, plat->ahb_sz); + dev_dbg(bus, "ctrl_base = 0x%x, ahb_base = 0x%p, size = 0x%llx\n", + (u32)priv->regs, plat->ahb_base, (fdt64_t)plat->ahb_sz); dev_dbg(bus, "hclk = %dMHz, max_cs = %d\n", plat->hclk_rate / 1000000, plat->max_cs); -- 2.20.1