Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3349578pxb; Sun, 26 Sep 2021 12:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy63lr7zQK6GDliXT4UaWdcvkHjjQAyaHRa/7T1EVg0esyENhmJPZGnKfI9MZVNBPp5q4hi X-Received: by 2002:a17:907:7664:: with SMTP id kk4mr4976170ejc.130.1632684198257; Sun, 26 Sep 2021 12:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632684198; cv=none; d=google.com; s=arc-20160816; b=gU/OoPQWaAA3gFOpwnnZUr56b+29t92qO2FpedIXA+qFcfRZgJReLZ2CRmFHw7X2E8 4woSxAOkPhig8G8wNLH021nSM2785aZSuaisfraLGfX6I/D3gWzOwyQNDdL+OFrtGo55 EDpn/e927N0PrhW7roQdhgSb2umeTfSy8NDaYsWoZIvQ/BHk93SVIOm6hk+itqIRlzIL 5RtoGHQXX87VGbVjZ6/9HqrdVrvud4Z5IU6jl/Ojj2HEyVgl1IDlN15qANqM2u7vTW2y NFksrs9V6Pl8fNeN3maE5f8jy5D/krMcPxoeoljUl3rlaKjEqNwR0+9RjJhtEZVQJS88 SdAg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8VoC22VdCllOXZFZ1LpEuBes/M4AcpmZRe4ChismgTw=; b=UDo5qHo+T8FL0cZxioSuVaha4RY/29qM5JVrv9MPa0dne6t3r5bq4GgjE3Bsvk3wh5 NwOolGjSlQ6dIUw0X6wmTLr4RJkmy2C8o6QklrKpRGDUnh1L+9HL4n/sjmTL+3c0mjeH /4ylo5167faMEgpo6PZhEMNikaWsEfDVUVpOAeiF72G8tEoxYkq2QhUQxWMSKWx+ZA76 uu01EoXKShPUhUaz3oJTpw5ZNoBoR5KEqtSscufL2lcjnEvtm6kZb5DzIYGcQ6Lg9Pwf 9mq7heVItdWiYjP9EHAK51tIFv26a4vtKzoc9wx2PoNb1/d+HUQ/dKw4k/vLAyiA2n6t Zs1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FB+sD0lH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si17566847ede.572.2021.09.26.12.22.54; Sun, 26 Sep 2021 12:23:18 -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=@gmail.com header.s=20210112 header.b=FB+sD0lH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbhIZTXP (ORCPT + 99 others); Sun, 26 Sep 2021 15:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhIZTXO (ORCPT ); Sun, 26 Sep 2021 15:23:14 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40DFAC061570 for ; Sun, 26 Sep 2021 12:21:38 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id bb10so10274681plb.2 for ; Sun, 26 Sep 2021 12:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8VoC22VdCllOXZFZ1LpEuBes/M4AcpmZRe4ChismgTw=; b=FB+sD0lH8m3BwjrgcAS4fuDSbMgqQA8XKScYogSP2U9uTMifHqFqUc4+8Z59GBAZSt FOIUXHF5HQaaXgjkAjl7oUmw1jA2RXW0Leb2Vhe+Yyw6Ipy4J+zx5VhfHB8v6XpLYZm+ 43L1CIF1yb4YeSfklNS2gBUHAj8arIlU+ZVhywtNDgTIGlGN/GBA7WfDZ7U/UL0wwz4m KW7pLiut9pLXNBcF4YTXSQPa7ABQRBtcuDM+6lUlPYGu6WuLGctFnwED8ai1JYaBJtT4 k9bfMvs15P0MXgxywYwBCAO0VNMCB+U5JqpAwuqRsOS0kw7VN+TPBZZKjpTlu2K+MOD6 LEaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8VoC22VdCllOXZFZ1LpEuBes/M4AcpmZRe4ChismgTw=; b=7UgQFoZdDP+Ze2K/OZYM5t0y4lBk1Eg3dLMCcXNJJY8aw6oDTtj89qa+nRGK6emUdd KgzpLk/gFlMMABjLwRs4BXA7ynJZswuu+2iCyQgckB33tiWGlCIxtieT/MxI6yHhVqad 4AmTY6M1+Mxn1Q3+ovaf0e/1doDTPj/kW0ZFSmSE62HytYOSsKbGrV6eIWYaNLXEdMqU T7hTSvZNJz+20WmggIcBo3i/2tMqpqLI4tqZcWzj1U1bow5Gds9c8NdyPy/Tbi4RnDwA tW7gRj3aEU/66uGWnUNw9D3fJX+8VUOgS5d0SjVDccklzwJC6vUOK0mhds/LLJ/WRaPF B8Vg== X-Gm-Message-State: AOAM531m3QWAGmbjraKDM8Bn4lL5wG1PtZz9Nz4wEX3CgSExm+a3EfqR wKWx7tjkjLMlleuhw/aBiag= X-Received: by 2002:a17:90a:1a58:: with SMTP id 24mr15472973pjl.45.1632684097413; Sun, 26 Sep 2021 12:21:37 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:794c:d573:9874:654d]) by smtp.gmail.com with ESMTPSA id e14sm15862802pga.23.2021.09.26.12.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 12:21:36 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Randy Dunlap , Max Filippov Subject: [PATCH] xtensa: use CONFIG_USE_OF instead of CONFIG_OF Date: Sun, 26 Sep 2021 12:21:06 -0700 Message-Id: <20210926192106.1943-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 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 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 --- 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 7e4d97dc8bd8..38acda4f04e8 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c @@ -101,7 +101,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.20.1