Commit 376e3fde authored by Finn Thain's avatar Finn Thain Committed by Geert Uytterhoeven

m68k: Enable memtest functionality

Enable the memtest functionality and rearrange some code to prevent it
from clobbering the initrd.

The code to implement CONFIG_BLK_DEV_INITRD was conditional on
!defined(CONFIG_SUN3). For simplicity, remove that test on the basis
that m68k_ramdisk.size == 0 on Sun 3. The SLIME source code at
http://sammy.net/sun3/ftp/pub/m68k/sun3/slime/slime-2.0.tar.gz
indicates that no BI_RAMDISK entry is ever passed to the kernel due
to #ifdef 0 around the relevant code.

Cc: Mike Rapoport <rppt@kernel.org>
Cc: Sam Creasey <sammy@sammy.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarFinn Thain <fthain@linux-m68k.org>
Acked-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/8170fe1d1c62426d82275d36ba409ecc18754292.1637274578.git.fthain@linux-m68k.orgSigned-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent fa55b7dc
...@@ -2934,7 +2934,7 @@ ...@@ -2934,7 +2934,7 @@
both parameters are enabled, hugetlb_free_vmemmap takes both parameters are enabled, hugetlb_free_vmemmap takes
precedence over memory_hotplug.memmap_on_memory. precedence over memory_hotplug.memmap_on_memory.
memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest memtest= [KNL,X86,ARM,M68K,PPC,RISCV] Enable memtest
Format: <integer> Format: <integer>
default : 0 <disable> default : 0 <disable>
Specifies the number of memtest passes to be Specifies the number of memtest passes to be
......
...@@ -9,6 +9,7 @@ config M68K ...@@ -9,6 +9,7 @@ config M68K
select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
select ARCH_MIGHT_HAVE_PC_PARPORT if ISA select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
select ARCH_NO_PREEMPT if !COLDFIRE select ARCH_NO_PREEMPT if !COLDFIRE
select ARCH_USE_MEMTEST if MMU_MOTOROLA
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
......
...@@ -338,13 +338,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -338,13 +338,6 @@ void __init setup_arch(char **cmdline_p)
panic("No configuration setup"); panic("No configuration setup");
} }
paging_init();
#ifdef CONFIG_NATFEAT
nf_init();
#endif
#ifndef CONFIG_SUN3
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (m68k_ramdisk.size) { if (m68k_ramdisk.size) {
memblock_reserve(m68k_ramdisk.addr, m68k_ramdisk.size); memblock_reserve(m68k_ramdisk.addr, m68k_ramdisk.size);
...@@ -354,6 +347,12 @@ void __init setup_arch(char **cmdline_p) ...@@ -354,6 +347,12 @@ void __init setup_arch(char **cmdline_p)
} }
#endif #endif
paging_init();
#ifdef CONFIG_NATFEAT
nf_init();
#endif
#ifdef CONFIG_ATARI #ifdef CONFIG_ATARI
if (MACH_IS_ATARI) if (MACH_IS_ATARI)
atari_stram_reserve_pages((void *)availmem); atari_stram_reserve_pages((void *)availmem);
...@@ -364,8 +363,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -364,8 +363,6 @@ void __init setup_arch(char **cmdline_p)
} }
#endif #endif
#endif /* !CONFIG_SUN3 */
/* set ISA defs early as possible */ /* set ISA defs early as possible */
#if defined(CONFIG_ISA) && defined(MULTI_ISA) #if defined(CONFIG_ISA) && defined(MULTI_ISA)
if (MACH_IS_Q40) { if (MACH_IS_Q40) {
......
...@@ -457,6 +457,8 @@ void __init paging_init(void) ...@@ -457,6 +457,8 @@ void __init paging_init(void)
flush_tlb_all(); flush_tlb_all();
early_memtest(min_addr, max_addr);
/* /*
* initialize the bad page table and bad page to point * initialize the bad page table and bad page to point
* to a couple of allocated pages * to a couple of allocated pages
......
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