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 19548C61DA3 for ; Wed, 22 Feb 2023 01:42:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D5CE85AD1; Wed, 22 Feb 2023 02:40:08 +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="hd43R049"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9A4DE85A90; Wed, 22 Feb 2023 02:39:17 +0100 (CET) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 EC72985A82 for ; Wed, 22 Feb 2023 02:39:01 +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=troykiskyboundary@gmail.com Received: by mail-pl1-x62e.google.com with SMTP id e9so2089851plh.2 for ; Tue, 21 Feb 2023 17:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yrQBwqkVGjGrReyQSpP6vK2vTn9mcq3LlVJSet9urvI=; b=hd43R049YQcwldPxyY3faa/XRiJdheOVnP3MJcQDzpLRUTvqIcE9pKrrHMcNxckJBf e/OnYuTrG8/0MgZrwC3lfe+HUBAgid25QszvNuxNqTX+PFN2ufqRPZtHpgthONmc7fu4 CGJgYpqAuzTuQGVgttU7xETguP448k3aP1SoPKqiVSo9PkxWn//Y2D6S7uUxbK+UxPhJ sNSMyVKWo6c2juVeps6zeQuvhMq6CVFKJ/mLYE0BUENELjtDXCJmnOQ6nEe4q0O4jau+ 7k/Qa5qOMMmnpUR7dqPQZsbpzXRxgIpGGxzeF/MHyn1GWev6Vwx/mTNrHQD157nYdCGU +bjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yrQBwqkVGjGrReyQSpP6vK2vTn9mcq3LlVJSet9urvI=; b=qjvFZ3ZeE+0dlkxJfe0K6/pqUkc51+DjkOqUgKilJArMleg88x+jaGuFY1fklAZvup kq/jJO3jqVQLN0l7orF8xzZVcuVhF4W11Wa7BPlFZF0wQGHgtLtC57zbjisV9INIPj8m RgNXXgspU9jvUtPD+woM8yOSnfsobKztLRdgQTMz/qscffXCXEtNwNB2QrkYQCWcTawi AJnmAkOmQ0jaYeXdN2KOJZ5P2hnJU1md2JNGT3TPhOFPexMeWQlHMWyVrPQe2N5Ia5Xn 8TCwD8IpiuGP1ENMkS2CpqCJjQWLC7HF/ICNGnsD8l6KiSnTjywvmBDjiOVPytkbLYmJ BfUg== X-Gm-Message-State: AO0yUKVJCm7vOCkdEu4TjV/f0uoB6ZSH/mDuoziL3MSck1S4gPZsyuAz /01p/jx98fhaITnysj2hMMI= X-Google-Smtp-Source: AK7set9pfZwc95LRzlxjV1OzOpEJeWQDyFY/PnEBGECra0QOimIWwchPjqMTJDE4vh7uGLrk2wFLBA== X-Received: by 2002:a05:6a20:144c:b0:a2:c3b0:f637 with SMTP id a12-20020a056a20144c00b000a2c3b0f637mr18283218pzi.26.1677029939109; Tue, 21 Feb 2023 17:38:59 -0800 (PST) Received: from OS2.boundarydevices.com. (wsip-184-189-120-117.oc.oc.cox.net. [184.189.120.117]) by smtp.gmail.com with ESMTPSA id d6-20020aa78e46000000b005accb31201fsm4200976pfr.26.2023.02.21.17.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:38:58 -0800 (PST) From: Troy Kisky To: sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de Cc: gary.bisson@lairdconnect.com, Troy Kisky , Andre Przywara , Bin Meng Subject: [PATCH v1 17/24] ns16550: match when to define bdf with uart code Date: Tue, 21 Feb 2023 17:38:14 -0800 Message-Id: <20230222013821.1144691-18-troykiskyboundary@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222013821.1144691-1-troykiskyboundary@gmail.com> References: <20230222013821.1144691-1-troykiskyboundary@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI) bdf is no longer accessible. So change to preprocessor to avoid access. Signed-off-by: Troy Kisky --- arch/x86/cpu/apollolake/uart.c | 6 +++--- include/ns16550.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c index a9362436000..143217755ff 100644 --- a/arch/x86/cpu/apollolake/uart.c +++ b/arch/x86/cpu/apollolake/uart.c @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base) static int apl_ns16550_probe(struct udevice *dev) { +#if !CONFIG_IS_ENABLED(PCI) struct apl_ns16550_plat *plat = dev_get_plat(dev); - if (!CONFIG_IS_ENABLED(PCI)) - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base); - + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base); +#endif return ns16550_serial_probe(dev); } diff --git a/include/ns16550.h b/include/ns16550.h index e7e68663d03..8d7eb7d8f9c 100644 --- a/include/ns16550.h +++ b/include/ns16550.h @@ -74,7 +74,7 @@ struct ns16550_plat { int clock; u32 fcr; int flags; -#if defined(CONFIG_PCI) && defined(CONFIG_SPL) +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA) int bdf; #endif }; -- 2.34.1