Skip to content

Commit

Permalink
nios2: use generic early_init_dt_add_memory_arch
Browse files Browse the repository at this point in the history
All we have to do is to enable memblock, the generic FDT code will take
care of the rest.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Acked-by: Ley Foon Tan <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Richard Kuo <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rppt authored and torvalds committed Oct 26, 2018
1 parent 6072cf5 commit a811c05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions arch/nios2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ config NIOS2
select SPARSE_IRQ
select USB_ARCH_HAS_HCD if USB_SUPPORT
select CPU_NO_EFFICIENT_FFS
select HAVE_MEMBLOCK

config GENERIC_CSUM
def_bool y
Expand Down
10 changes: 0 additions & 10 deletions arch/nios2/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@

#include <asm/sections.h>

void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
u64 kernel_start = (u64)virt_to_phys(_text);

if (!memory_size &&
(kernel_start >= base) && (kernel_start < (base + size)))
memory_size = size;

}

int __init early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size,
bool nomap)
{
Expand Down
2 changes: 2 additions & 0 deletions arch/nios2/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/sched/task.h>
#include <linux/console.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
#include <linux/initrd.h>
#include <linux/of_fdt.h>
#include <linux/screen_info.h>
Expand Down Expand Up @@ -147,6 +148,7 @@ void __init setup_arch(char **cmdline_p)

console_verbose();

memory_size = memblock_phys_mem_size();
memory_start = PAGE_ALIGN((unsigned long)__pa(_end));
memory_end = (unsigned long) CONFIG_NIOS2_MEM_BASE + memory_size;

Expand Down

0 comments on commit a811c05

Please sign in to comment.