Skip to content

Commit 5d6ab0b

Browse files
committed
Merge tag 'xtensa-20211008' of git://github.com/jcmvbkbc/linux-xtensa
Pull xtensa fixes from Max Filippov: - fix build/boot issues caused by CONFIG_OF vs CONFIC_USE_OF usage - fix reset handler for xtfpga boards * tag 'xtensa-20211008' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: xtfpga: Try software restart before simulating CPU reset xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF xtensa: call irqchip_init only when CONFIG_USE_OF is selected xtensa: use CONFIG_USE_OF instead of CONFIG_OF
2 parents 3946b46 + 012e974 commit 5d6ab0b

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

arch/xtensa/include/asm/kmem_layout.h

Lines changed: 1 addition & 1 deletion
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/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ unsigned xtensa_get_ext_irq_no(unsigned irq)
143143

144144
void __init init_IRQ(void)
145145
{
146-
#ifdef CONFIG_OF
146+
#ifdef CONFIG_USE_OF
147147
irqchip_init();
148148
#else
149149
#ifdef CONFIG_HAVE_SMP

arch/xtensa/kernel/setup.c

Lines changed: 6 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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
*/

arch/xtensa/platforms/xtfpga/setup.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ void platform_power_off(void)
5151

5252
void platform_restart(void)
5353
{
54-
/* Flush and reset the mmu, simulate a processor reset, and
55-
* jump to the reset vector. */
54+
/* Try software reset first. */
55+
WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
56+
57+
/* If software reset did not work, flush and reset the mmu,
58+
* simulate a processor reset, and jump to the reset vector.
59+
*/
5660
cpu_reset();
5761
/* control never gets here */
5862
}
@@ -66,7 +70,7 @@ void __init platform_calibrate_ccount(void)
6670

6771
#endif
6872

69-
#ifdef CONFIG_OF
73+
#ifdef CONFIG_USE_OF
7074

7175
static void __init xtfpga_clk_setup(struct device_node *np)
7276
{
@@ -284,4 +288,4 @@ static int __init xtavnet_init(void)
284288
*/
285289
arch_initcall(xtavnet_init);
286290

287-
#endif /* CONFIG_OF */
291+
#endif /* CONFIG_USE_OF */

0 commit comments

Comments
 (0)