Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1614764pxb; Mon, 11 Oct 2021 09:31:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT9vIetZlANuuwed0T+3Qb9aK5r8b4D/ubh/6AcY3JaS9i2BwBxGXsCVt6+tZY+cDOJcZC X-Received: by 2002:a17:906:4f82:: with SMTP id o2mr26884839eju.10.1633969892448; Mon, 11 Oct 2021 09:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969892; cv=none; d=google.com; s=arc-20160816; b=L5rXjbBnaEpCG3ewr5SNyMZ4XTiU/MZye4QHHp/Z2/GnEqz6DMEyW2SeaA9YDzHmly TqirhuwVCTbtCCDElG+ewojpbtW+vdJdH1nB/ggqENrCdJLv6tT+KHu2GCDHeBNiCLRc sS3mziFqCeb3xCeHmklvWy3YtxSbDy+6AYj1/6K1P2WjcHZKVH3ULrJeKOQdwCc3Iy4H 7uI+OKVmUYHSm6bkkLhgCr15xe6UsIQQYiYNUDKiVLHSQvmSz/w2ZIv676kHim0wh8UA uv6qTjfhsd770YqdOqyNAd3UHQiwBpyHDzPCxK96FQHOtMFoQLZVrFXkVMuzizWZEsuB S+7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lsIZv6pC7oUlEjp8Z0+DC/pGrRV8G3TCFq9EG1Ulin0=; b=GHQusTaFm2sYOs17qCLE1ZOc/+yA5bQ9Wo4/1rCCmS0vSYIpOB2mnTHBpC2j4TG6Gm 5qvLAkxvRHL7Faoqgq49K8iVRdi2CzEp6EB5GHFbmJWzvLu6JUVBzhhwLUuttrtkibS0 ZzYcYyV3OszZEaVJVy6JXFd2q3RQRF2xw0sZAJFdw3lxy/PU0SAHoKFpwyq6o3bnPUry BLPZCRnQ8wUUQ6q551VS4gDh3LE3oXo/6KW7RLai5ODrcEmAApYkvAfWhFpDDGXbRnyC gbMfcfA22b1TkrxgTwGOxQRuFw5Rw/4KNwbjYBlTDQkYUQYrCOH4ewCgq1kIoy7aIsgX M7AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I0NuIJNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si12072742edj.273.2021.10.11.09.31.07; Mon, 11 Oct 2021 09:31:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I0NuIJNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235133AbhJKN4k (ORCPT + 99 others); Mon, 11 Oct 2021 09:56:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235338AbhJKNyo (ORCPT ); Mon, 11 Oct 2021 09:54:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3756610CB; Mon, 11 Oct 2021 13:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960343; bh=q3l7vbbtsJK4uUj/2fRASh/IZJsGxjVAiy8krrP7vUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0NuIJNWGnQhkIv30XRjdfVYZV06IUTsgVGD0GjLlEFkBjvsa6D1VC5Riio6kTFNo VhgukiPPlcbkz9R4UpgqZF/0OBWEyvqnbFW6Pd0UG8/3D5R95Ae0ktVSYVkyrGCSlo 3zCXZMSIWPelRmdzK2fe2tLMHGBxsyLCOxjQg75E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Max Filippov , Sasha Levin Subject: [PATCH 5.10 32/83] xtensa: use CONFIG_USE_OF instead of CONFIG_OF Date: Mon, 11 Oct 2021 15:45:52 +0200 Message-Id: <20211011134509.476470822@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap [ Upstream commit d67ed2510d28a1eb33171010d35cf52178cfcbdd ] CONFIG_OF can be set by a randconfig or by a user -- without setting the early flattree option (OF_EARLY_FLATTREE). This causes build errors. However, if randconfig or a user sets USE_OF in the Xtensa config, the right kconfig symbols are set to fix the build. Fixes these build errors: ../arch/xtensa/kernel/setup.c:67:19: error: ‘__dtb_start’ undeclared here (not in a function); did you mean ‘dtb_start’? 67 | void *dtb_start = __dtb_start; | ^~~~~~~~~~~ ../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area': ../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration] 201 | if (!of_flat_dt_is_compatible(node, "simple-bus")) ../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration] 204 | ranges = of_get_flat_dt_prop(node, "ranges", &len); ../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion] 204 | ranges = of_get_flat_dt_prop(node, "ranges", &len); | ^ ../arch/xtensa/kernel/setup.c: In function 'early_init_devtree': ../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration] 228 | early_init_dt_scan(params); ../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration] 229 | of_scan_flat_dt(xtensa_dt_io_area, NULL); xtensa-elf-ld: arch/xtensa/mm/mmu.o:(.text+0x0): undefined reference to `xtensa_kio_paddr' Fixes: da844a81779e ("xtensa: add device trees support") Fixes: 6cb971114f63 ("xtensa: remap io area defined in device tree") Signed-off-by: Randy Dunlap Signed-off-by: Max Filippov Signed-off-by: Sasha Levin --- arch/xtensa/include/asm/kmem_layout.h | 2 +- arch/xtensa/kernel/setup.c | 12 ++++++------ arch/xtensa/mm/mmu.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/xtensa/include/asm/kmem_layout.h b/arch/xtensa/include/asm/kmem_layout.h index 7cbf68ca7106..6fc05cba61a2 100644 --- a/arch/xtensa/include/asm/kmem_layout.h +++ b/arch/xtensa/include/asm/kmem_layout.h @@ -78,7 +78,7 @@ #endif #define XCHAL_KIO_SIZE 0x10000000 -#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_OF) +#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_USE_OF) #define XCHAL_KIO_PADDR xtensa_get_kio_paddr() #ifndef __ASSEMBLY__ extern unsigned long xtensa_kio_paddr; diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index ed184106e4cf..ee9082a142fe 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -63,7 +63,7 @@ extern unsigned long initrd_end; extern int initrd_below_start_ok; #endif -#ifdef CONFIG_OF +#ifdef CONFIG_USE_OF void *dtb_start = __dtb_start; #endif @@ -125,7 +125,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd); #endif /* CONFIG_BLK_DEV_INITRD */ -#ifdef CONFIG_OF +#ifdef CONFIG_USE_OF static int __init parse_tag_fdt(const bp_tag_t *tag) { @@ -135,7 +135,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag) __tagtable(BP_TAG_FDT, parse_tag_fdt); -#endif /* CONFIG_OF */ +#endif /* CONFIG_USE_OF */ static int __init parse_tag_cmdline(const bp_tag_t* tag) { @@ -183,7 +183,7 @@ static int __init parse_bootparam(const bp_tag_t *tag) } #endif -#ifdef CONFIG_OF +#ifdef CONFIG_USE_OF #if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR; @@ -232,7 +232,7 @@ void __init early_init_devtree(void *params) strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); } -#endif /* CONFIG_OF */ +#endif /* CONFIG_USE_OF */ /* * Initialize architecture. (Early stage) @@ -253,7 +253,7 @@ void __init init_arch(bp_tag_t *bp_start) if (bp_start) parse_bootparam(bp_start); -#ifdef CONFIG_OF +#ifdef CONFIG_USE_OF early_init_devtree(dtb_start); #endif diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c index fd2193df8a14..511bb92518f2 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c @@ -100,7 +100,7 @@ void init_mmu(void) void init_kio(void) { -#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) +#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_USE_OF) /* * Update the IO area mapping in case xtensa_kio_paddr has changed */ -- 2.33.0