Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B03C8C4338F for ; Mon, 2 Aug 2021 00:56:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D15360560 for ; Mon, 2 Aug 2021 00:56:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D15360560 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 45ED2831FE; Mon, 2 Aug 2021 02:55:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Pb2YSYDu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7B97D832FE; Mon, 2 Aug 2021 02:55:38 +0200 (CEST) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 9C812831D6 for ; Mon, 2 Aug 2021 02:54:55 +0200 (CEST) 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-oi1-x236.google.com with SMTP id t128so22250243oig.1 for ; Sun, 01 Aug 2021 17:54:55 -0700 (PDT) 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=05Y400Mucl8opRie2AbcYSnlwJZwNaX6PhMkqA/KCFI=; b=Pb2YSYDuIPqliuKu+R6sSpVHjWs6AuoiJ1ZY5nkkP8J0typuRp5O/MMTkIp1FXzaQw a5R6Mt0s1AIcAVimdjiQ/jH+e7s7mnfo/gud/PXUJFd1Plq05tJ7AXqn30pBtANrERr+ m1PYPEqsmaVRAyI+z3wTFDIJRJXuYPAF0KKUI= 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=05Y400Mucl8opRie2AbcYSnlwJZwNaX6PhMkqA/KCFI=; b=NEfsSadXIN9f8sUXgMwMkzZqyQezuSFUTw0Yt4JZwg8rVz1UMZ7JrvESO4OhjMgxKU jykLPzJ2C9AAO7c7pqlA1NWzt0o/nOzj9qyzPjo4OinvHcS0mk9aMoFS7LA8bKDZJg8c PSM2VaB+iOuw1V4HDMDUXj95hcgpfnEC/y4ZRAdSIoyM+SsvNJC2YKAHcxsrM3EF5/cX KHY560j7NNRZ+24bfX0FhFfV543yzTvQHIrLZqi7Cia5CMyYs6ZdHT3yfnOW3PtL7Zyv aoUXXHufarebhUew9bv+BZ8TgdeES2tWDg/WqgIlc/eKAxQImF71PXz+F5Pd6PzPqIGb MdIA== X-Gm-Message-State: AOAM530PS2Rxlmy3Gc1Tet2pFpC3QMq226nOWlQIdJ3tDQkPksNmLhjd YMELrzb9vVHyvSz46y28i5RbEMcVmpBRz7xv X-Google-Smtp-Source: ABdhPJz1PmeYRI/h92ja/HWwUNMMyWp00i102+KCA7XyjsR1EvkNE6JS1/ZFedL20DJFKSjsKr5Cqw== X-Received: by 2002:aca:aac9:: with SMTP id t192mr8838365oie.55.1627865693847; Sun, 01 Aug 2021 17:54:53 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id s2sm1452616ooc.15.2021.08.01.17.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 17:54:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 05/32] pci: Drop DM_PCI check from fdtdec Date: Sun, 1 Aug 2021 18:54:18 -0600 Message-Id: <20210802005446.2267075-6-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210802005446.2267075-1-sjg@chromium.org> References: <20210802005446.2267075-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean We don't need this check anymore since when PCI is enabled, driver model is always used. Sadly this doesn't work with nds32 for some reason to do with the toolchain. Add a work-around for that. Signed-off-by: Simon Glass --- (no changes since v1) lib/fdtdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 4b097fb588e..d12c6d340a0 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -192,7 +192,6 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name) return fdtdec_get_addr_size(blob, node, prop_name, NULL); } -#if CONFIG_IS_ENABLED(PCI) && defined(CONFIG_DM_PCI) int fdtdec_get_pci_vendev(const void *blob, int node, u16 *vendor, u16 *device) { const char *list, *end; @@ -240,7 +239,15 @@ int fdtdec_get_pci_bar32(const struct udevice *dev, struct fdt_pci_addr *addr, return -EINVAL; barnum = (barnum - PCI_BASE_ADDRESS_0) / 4; + + /* + * There is a strange toolchain bug with nds32 which complains about + * an undefined reference here, even if fdtdec_get_pci_bar32() is never + * called. An #ifdef seems to be the only fix! + */ +#if !IS_ENABLED(CONFIG_NDS32) *bar = dm_pci_read_bar32(dev, barnum); +#endif return 0; } @@ -260,7 +267,6 @@ int fdtdec_get_pci_bus_range(const void *blob, int node, return 0; } -#endif uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name, uint64_t default_val) -- 2.32.0.554.ge1b32706d8-goog