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 517B7C433EF for ; Fri, 22 Apr 2022 06:52:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B42083C54; Fri, 22 Apr 2022 08:52:25 +0200 (CEST) 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="dWVRlTlq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4216883565; Fri, 22 Apr 2022 08:52:23 +0200 (CEST) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 6014683C96 for ; Fri, 22 Apr 2022 08:52:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-yb1-xb33.google.com with SMTP id v10so4007446ybe.5 for ; Thu, 21 Apr 2022 23:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XFyGGlnwIukIaQV3mOVm5SmKDqh/fP4EQiJnW0C1GYo=; b=dWVRlTlqbyvtVubwBfBJJQ3en2wrJHNeQbhKj0jRxNRuA+oTPljuzOjLHqC0VT37+F Tsm991g7Vd9K6O1WB2yJNEksWgznqk9G/b0MvAB2FHChoNhKsFwh8CgW+KU/LnvYhzdJ t0xDIjgo1WknjmrONUrKIV13t5GRWQ4Xos+BSzQ0DSYDCLp8VlBvFJA6JdWURu3LKYJv 6qfpX3msBdI7xfv3R4sdhCflBUsrmMPfKvUsIeV34qLqaq4x6g01Ejr5qXUb1lDW8pTL dK21C3TL0ujdTfgzR9luwkdVnQlonN+UkXVnFY2u2m7SxqMGu+3XN2hmb/pwbnqL2rZz 8uiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XFyGGlnwIukIaQV3mOVm5SmKDqh/fP4EQiJnW0C1GYo=; b=X13HPj80rHP2C7M0fG5dCiqjA7/pvFiWpFsqFBWuVE1GQZSmzKLfGyBZV7+JLPU47k RbvJB0+NX9arQzZ8SpfewlwSWUK7+DZ+QIp+jpoP7D6ST5yTn6AXmCbq7SER37xlrXGH X8QVnV4LaLIoVAhY/AoBygDzmL3YB+13fDltGpr5SuZQijvVyDoEZ9kC3dpU3BCxqtX5 cDMNul99As27zzrhFI5/UW7wTnfE0jFStFrLaTvjOlsj2I3RyoKjDK9Ay+wpc1Zh2uWO hkvhI1sfTKswv76mEXmAsQvjrbmqF1vsWPeB5Nx79E4eXkMdOex+L96O9ov+Prf4UeD2 2p3A== X-Gm-Message-State: AOAM530zaNVo4I3+eJeD3XYFgMf2TszRbr0XK3mujNJ5kIBq+olz8PVv N4RN9Xjoa6KDEfCSTLvB3U86XogD8kCz/U3y5Uk= X-Google-Smtp-Source: ABdhPJwSIuBd7XyebdbeXJqKIztXm3jKuDbvxjbeMqFWPeq/gh1qYXFRUgoM4ovj8CTBlfEdGc8i2P/xoC0v8BNRAwQ= X-Received: by 2002:a05:6902:10c1:b0:63c:d3bf:59d2 with SMTP id w1-20020a05690210c100b0063cd3bf59d2mr3037598ybu.99.1650610338991; Thu, 21 Apr 2022 23:52:18 -0700 (PDT) MIME-Version: 1.0 References: <20220421161116.1202023-1-ascull@google.com> <20220421161116.1202023-13-ascull@google.com> In-Reply-To: <20220421161116.1202023-13-ascull@google.com> From: Bin Meng Date: Fri, 22 Apr 2022 14:52:06 +0800 Message-ID: Subject: Re: [PATCH v3 12/18] pci: Map bars with offset and length To: Andrew Scull Cc: U-Boot Mailing List , Simon Glass , Tom Rini Content-Type: text/plain; charset="UTF-8" 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.5 at phobos.denx.de X-Virus-Status: Clean On Fri, Apr 22, 2022 at 12:11 AM Andrew Scull wrote: > > Evolve dm_pci_map_bar() to include an offset and length parameter. These > allow a portion of the memory to be mapped and range checks to be > applied. > > Passing both the offset and length as zero results in the previous > behaviour and this is used to migrate the previous callers. > > Signed-off-by: Andrew Scull > --- > arch/x86/cpu/baytrail/cpu.c | 2 +- > drivers/ata/ahci.c | 8 ++++---- > drivers/ata/sata_sil.c | 4 ++-- > drivers/gpio/octeon_gpio.c | 2 +- > drivers/i2c/designware_i2c_pci.c | 2 +- > drivers/i2c/intel_i2c.c | 2 +- > drivers/i2c/octeon_i2c.c | 2 +- > drivers/mmc/octeontx_hsmmc.c | 2 +- > drivers/mmc/pci_mmc.c | 2 +- > drivers/mtd/nand/raw/octeontx_bch.c | 4 ++-- > drivers/mtd/nand/raw/octeontx_nand.c | 2 +- > drivers/net/bnxt/bnxt.c | 6 +++--- > drivers/net/e1000.c | 2 +- > drivers/net/fsl_enetc.c | 2 +- > drivers/net/fsl_enetc_mdio.c | 2 +- > drivers/net/mscc_eswitch/felix_switch.c | 4 ++-- > drivers/net/octeontx/bgx.c | 2 +- > drivers/net/octeontx/nic_main.c | 2 +- > drivers/net/octeontx/nicvf_main.c | 2 +- > drivers/net/octeontx/smi.c | 2 +- > drivers/net/octeontx2/cgx.c | 2 +- > drivers/net/octeontx2/rvu_af.c | 2 +- > drivers/net/octeontx2/rvu_pf.c | 2 +- > drivers/net/pch_gbe.c | 2 +- > drivers/nvme/nvme_pci.c | 4 ++-- > drivers/pci/pci-uclass.c | 27 ++++++++++++++++--------- > drivers/spi/octeon_spi.c | 2 +- > drivers/usb/host/ehci-pci.c | 2 +- > drivers/usb/host/ohci-pci.c | 2 +- > drivers/usb/host/xhci-pci.c | 2 +- > drivers/virtio/virtio_pci_legacy.c | 2 +- > include/pci.h | 5 ++++- > test/dm/pci.c | 12 +++++------ > 33 files changed, 67 insertions(+), 55 deletions(-) > Reviewed-by: Bin Meng