Commit 5d6ab0bb authored by Linus Torvalds's avatar Linus Torvalds

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
parents 3946b46c 012e9745
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
#endif #endif
#define XCHAL_KIO_SIZE 0x10000000 #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() #define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern unsigned long xtensa_kio_paddr; extern unsigned long xtensa_kio_paddr;
......
...@@ -143,7 +143,7 @@ unsigned xtensa_get_ext_irq_no(unsigned irq) ...@@ -143,7 +143,7 @@ unsigned xtensa_get_ext_irq_no(unsigned irq)
void __init init_IRQ(void) void __init init_IRQ(void)
{ {
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
irqchip_init(); irqchip_init();
#else #else
#ifdef CONFIG_HAVE_SMP #ifdef CONFIG_HAVE_SMP
......
...@@ -63,7 +63,7 @@ extern unsigned long initrd_end; ...@@ -63,7 +63,7 @@ extern unsigned long initrd_end;
extern int initrd_below_start_ok; extern int initrd_below_start_ok;
#endif #endif
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
void *dtb_start = __dtb_start; void *dtb_start = __dtb_start;
#endif #endif
...@@ -125,7 +125,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd); ...@@ -125,7 +125,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd);
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
static int __init parse_tag_fdt(const bp_tag_t *tag) 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) ...@@ -135,7 +135,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
__tagtable(BP_TAG_FDT, parse_tag_fdt); __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) 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) ...@@ -183,7 +183,7 @@ static int __init parse_bootparam(const bp_tag_t *tag)
} }
#endif #endif
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
#if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY #if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY
unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR; unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR;
...@@ -232,7 +232,7 @@ void __init early_init_devtree(void *params) ...@@ -232,7 +232,7 @@ void __init early_init_devtree(void *params)
strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
} }
#endif /* CONFIG_OF */ #endif /* CONFIG_USE_OF */
/* /*
* Initialize architecture. (Early stage) * Initialize architecture. (Early stage)
...@@ -253,7 +253,7 @@ void __init init_arch(bp_tag_t *bp_start) ...@@ -253,7 +253,7 @@ void __init init_arch(bp_tag_t *bp_start)
if (bp_start) if (bp_start)
parse_bootparam(bp_start); parse_bootparam(bp_start);
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
early_init_devtree(dtb_start); early_init_devtree(dtb_start);
#endif #endif
......
...@@ -101,7 +101,7 @@ void init_mmu(void) ...@@ -101,7 +101,7 @@ void init_mmu(void)
void init_kio(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 * Update the IO area mapping in case xtensa_kio_paddr has changed
*/ */
......
...@@ -51,8 +51,12 @@ void platform_power_off(void) ...@@ -51,8 +51,12 @@ void platform_power_off(void)
void platform_restart(void) void platform_restart(void)
{ {
/* Flush and reset the mmu, simulate a processor reset, and /* Try software reset first. */
* jump to the reset vector. */ WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
/* If software reset did not work, flush and reset the mmu,
* simulate a processor reset, and jump to the reset vector.
*/
cpu_reset(); cpu_reset();
/* control never gets here */ /* control never gets here */
} }
...@@ -66,7 +70,7 @@ void __init platform_calibrate_ccount(void) ...@@ -66,7 +70,7 @@ void __init platform_calibrate_ccount(void)
#endif #endif
#ifdef CONFIG_OF #ifdef CONFIG_USE_OF
static void __init xtfpga_clk_setup(struct device_node *np) static void __init xtfpga_clk_setup(struct device_node *np)
{ {
...@@ -284,4 +288,4 @@ static int __init xtavnet_init(void) ...@@ -284,4 +288,4 @@ static int __init xtavnet_init(void)
*/ */
arch_initcall(xtavnet_init); arch_initcall(xtavnet_init);
#endif /* CONFIG_OF */ #endif /* CONFIG_USE_OF */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment