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.5 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 180DEC4338F for ; Mon, 26 Jul 2021 13:35:39 +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 84AF860F02 for ; Mon, 26 Jul 2021 13:35:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 84AF860F02 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 6396A83326; Mon, 26 Jul 2021 15:35:31 +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="WwBeb/m8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0C5AD83345; Mon, 26 Jul 2021 15:35:13 +0200 (CEST) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (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 4BEB983303 for ; Mon, 26 Jul 2021 15:35:04 +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-x232.google.com with SMTP id o185so10792702oih.13 for ; Mon, 26 Jul 2021 06:35:04 -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=D4SCOeZOasKZWSPi1k8bVaxxp0bXlEGT4vdAyI4Zn40=; b=WwBeb/m8qzIRc7WDzCDED2kKwX5Nb8vVJ2OA5LO0M3KIKUDgV4WmSsbGBuGgAmB6II FaBkbchwUGgFyjYxR+cp4mb5lyw2oKjdhPNL2iA3Hz0G/uvdOvVa7qQ01SPyFmtFOihR cREkRhlLp1uHrnpdwlphYGlvB9SJ8RWYZzMno= 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=D4SCOeZOasKZWSPi1k8bVaxxp0bXlEGT4vdAyI4Zn40=; b=V5gmhwHQDIg7rrY9mQsQUO2UbBRf/TTr/GA1UutIzfDG+XthJe5vypX+rzQfgqZlnI kTOomsFLoIzjJ2A0Dq82GvAacOYR7nLiDJ8CC6HeLY1yZELzPorUW8qYgaAQutVL5eDL hSlpJk07Oca8B+IZx82tRmAzawZ+T9OfRuVc72/IXyZXdo9Iac1mQ8GZyvc4YgUS2g+k sefTX1D41JZByTjv01IXv8rFMLXVVgJSM+tuOWgX9sJbnc1oZeBrCiAUBBAnLEX3RDAl eyKvy3YTs+nbNvRu2O4LvSaUd+zULj39xJLW19/UBcylmfTlMvnRKw1zcIZU+wE9QFkn gM2Q== X-Gm-Message-State: AOAM532tK6PIa8shtHizAkV28eKGdSdTOekMgPon4S+4z2isSZPD/qNZ /n5tQyuIvPJUywzgdrXe3kKqimISX3K0m24v X-Google-Smtp-Source: ABdhPJysdcUfBC9P2uM5SnToSEH05KH8J1N7fsQ3fCORweIdFCLH8PRFOwM+GTYTkslgMZ+wFPtnng== X-Received: by 2002:a05:6808:114a:: with SMTP id u10mr11200896oiu.19.1627306501826; Mon, 26 Jul 2021 06:35:01 -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 t141sm6591527oot.40.2021.07.26.06.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:35:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 06/33] pci: Drop DM_PCI check from fdtdec Date: Mon, 26 Jul 2021 07:34:12 -0600 Message-Id: <20210726133440.634682-7-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog In-Reply-To: <20210726133440.634682-1-sjg@chromium.org> References: <20210726133440.634682-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 --- 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.432.gabb21c7263-goog