Skip to content

Commit c4a9836

Browse files
rddunlapgregkh
authored andcommitted
xtensa: use CONFIG_USE_OF instead of CONFIG_OF
[ Upstream commit d67ed25 ] 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: da844a8 ("xtensa: add device trees support") Fixes: 6cb9711 ("xtensa: remap io area defined in device tree") Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Max Filippov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5be9d13 commit c4a9836

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

arch/xtensa/include/asm/kmem_layout.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
#endif
7979
#define XCHAL_KIO_SIZE 0x10000000
8080

81-
#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_OF)
81+
#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_USE_OF)
8282
#define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
8383
#ifndef __ASSEMBLY__
8484
extern unsigned long xtensa_kio_paddr;

arch/xtensa/kernel/setup.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern unsigned long initrd_end;
6363
extern int initrd_below_start_ok;
6464
#endif
6565

66-
#ifdef CONFIG_OF
66+
#ifdef CONFIG_USE_OF
6767
void *dtb_start = __dtb_start;
6868
#endif
6969

@@ -125,7 +125,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd);
125125

126126
#endif /* CONFIG_BLK_DEV_INITRD */
127127

128-
#ifdef CONFIG_OF
128+
#ifdef CONFIG_USE_OF
129129

130130
static int __init parse_tag_fdt(const bp_tag_t *tag)
131131
{
@@ -135,7 +135,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
135135

136136
__tagtable(BP_TAG_FDT, parse_tag_fdt);
137137

138-
#endif /* CONFIG_OF */
138+
#endif /* CONFIG_USE_OF */
139139

140140
static int __init parse_tag_cmdline(const bp_tag_t* tag)
141141
{
@@ -183,7 +183,7 @@ static int __init parse_bootparam(const bp_tag_t *tag)
183183
}
184184
#endif
185185

186-
#ifdef CONFIG_OF
186+
#ifdef CONFIG_USE_OF
187187

188188
#if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY
189189
unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR;
@@ -232,7 +232,7 @@ void __init early_init_devtree(void *params)
232232
strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
233233
}
234234

235-
#endif /* CONFIG_OF */
235+
#endif /* CONFIG_USE_OF */
236236

237237
/*
238238
* Initialize architecture. (Early stage)
@@ -253,7 +253,7 @@ void __init init_arch(bp_tag_t *bp_start)
253253
if (bp_start)
254254
parse_bootparam(bp_start);
255255

256-
#ifdef CONFIG_OF
256+
#ifdef CONFIG_USE_OF
257257
early_init_devtree(dtb_start);
258258
#endif
259259

arch/xtensa/mm/mmu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void init_mmu(void)
101101

102102
void init_kio(void)
103103
{
104-
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
104+
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_USE_OF)
105105
/*
106106
* Update the IO area mapping in case xtensa_kio_paddr has changed
107107
*/

0 commit comments

Comments
 (0)