Message ID | 20200126220508.10.I36321d5e30daf051900f01f6289dfc58439871ea@changeid |
---|---|
State | RFC |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Tns9PIRG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485d9m289Jz9sR1 for <incoming@patchwork.ozlabs.org>; Mon, 27 Jan 2020 16:10:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C2E878181F; Mon, 27 Jan 2020 06:09:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Tns9PIRG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 02915815D3; Mon, 27 Jan 2020 06:08:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 CDCBF81722 for <u-boot@lists.denx.de>; Mon, 27 Jan 2020 06:08:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id t26so8540782ioi.13 for <u-boot@lists.denx.de>; Sun, 26 Jan 2020 21:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k3ZPy5JhVfu401FxH/ODYlXg25Dtyv7Fv0p3uWtnDvo=; b=Tns9PIRGhtkzibzlJdZv6QmcMXd7HUCwsuMPvIU7xEN34TmeTr7byFDEpe2iyqcL06 Bn5JhI0aeDYEcKrK5ObJuqEAfDS5m3J3xxl+24rbugAduXv61m34oalP0tATVrzrAWVm BnEPAQpkbCM03mqvq5LdhyVYFBzhEw25u79hU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k3ZPy5JhVfu401FxH/ODYlXg25Dtyv7Fv0p3uWtnDvo=; b=m+2FaYkU6QTVI+8PkrzxjetzbQrxncocx7GFn86kTpJHXZ5f2yHF86uEiscR76PWBa YVcAX90aCLxRnXRQqHcSnFa4JkIejypMS+Z559L9KwI4QMrbn26rmvIdkXTZorXRLY8S XMDpZ2XeznN4I+oPA8EBxdooRnpC5BnJVglmY53HyDkI/BO5LM0vp6Z044OrMbYIGrN8 pU80Q5eR2euE+sG9pYzHxP72IvzDNRWQGrt8i3qR57Rq5cxA00NS8L5+ZriGufROaS3p kcEf/mKHMMBCv3UUVEZDd2FySfA7Kv5rPBy0XANYR0UQk5LEFUmIf0UpY+Juw4VhOzfS E5NA== X-Gm-Message-State: APjAAAUVvHF89xAC/Aqcw0Ufk/55ErllOj7qkq7wIfGFDT/FgbwOlm0K Vb3Mx9b9jiDU7yS/VkC3Vptgto1hIekI+Q== X-Google-Smtp-Source: APXvYqy7IhNnxJAqSpV5+XzRVQoMxN36LyHez4qqHvi4p3TbGsfIuYdpx/TSuZCVVzNzRETL2cYuMw== X-Received: by 2002:a02:a415:: with SMTP id c21mr11711163jal.45.1580101713555; Sun, 26 Jan 2020 21:08:33 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id h23sm4313195ilf.57.2020.01.26.21.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2020 21:08:33 -0800 (PST) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Subject: [PATCH 010/108] pci: Adjust dm_pci_read_bar32() to return errors correctly Date: Sun, 26 Jan 2020 22:05:17 -0700 Message-Id: <20200126220508.10.I36321d5e30daf051900f01f6289dfc58439871ea@changeid> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200127050655.170614-1-sjg@chromium.org> References: <20200127050655.170614-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
RFC: dm: Add programatic generation of ACPI tables
|
expand
|
On Mon, Jan 27, 2020 at 1:08 PM Simon Glass <sjg@chromium.org> wrote: > > At present if reading a BAR returns 0xffffffff (e.g. the device is not > present) then the value is masked and a different value is returned. > This makes it harder to detect the problem when debugging. > > Update the function to avoid masking in this case. > > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > drivers/pci/pci-uclass.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index f5f713fdf4..ed57ff9ebe 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -1210,7 +1210,14 @@ u32 dm_pci_read_bar32(const struct udevice *dev, int barnum) bar = PCI_BASE_ADDRESS_0 + barnum * 4; dm_pci_read_config32(dev, bar, &addr); - if (addr & PCI_BASE_ADDRESS_SPACE_IO) + + /* + * If we get an invalid address, return this so that comparisons with + * FDT_ADDR_T_NONE work correctly + */ + if (addr == 0xffffffff) + return addr; + else if (addr & PCI_BASE_ADDRESS_SPACE_IO) return addr & PCI_BASE_ADDRESS_IO_MASK; else return addr & PCI_BASE_ADDRESS_MEM_MASK;
At present if reading a BAR returns 0xffffffff (e.g. the device is not present) then the value is masked and a different value is returned. This makes it harder to detect the problem when debugging. Update the function to avoid masking in this case. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/pci/pci-uclass.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)