mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 00:30:52 +07:00
of: consolidate definition of early_init_dt_alloc_memory_arch()
Most architectures use the same implementation. Collapse the common ones into a single weak function that can be overridden. Signed-off-by: Grant Likely <grant.likely@linaro.org>
This commit is contained in:
parent
7e0bdf15ce
commit
a1727da599
@ -18,12 +18,6 @@
|
||||
#include <asm/clk.h>
|
||||
#include <asm/mach_desc.h>
|
||||
|
||||
/* called from unflatten_device_tree() to bootstrap devicetree itself */
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
||||
/**
|
||||
* setup_machine_fdt - Machine setup when an dtb was passed to the kernel
|
||||
* @dt: virtual address pointer to dt blob
|
||||
|
@ -190,11 +190,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
memblock_add(base, size);
|
||||
}
|
||||
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
||||
/*
|
||||
* Limit the memory size that was specified via FDT.
|
||||
*/
|
||||
|
@ -45,8 +45,3 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
{
|
||||
c6x_add_memory(base, size);
|
||||
}
|
||||
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
@ -46,11 +46,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
memblock_add(base, size);
|
||||
}
|
||||
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EARLY_PRINTK
|
||||
static char *stdout;
|
||||
|
||||
|
@ -55,11 +55,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
memblock_add(base, size);
|
||||
}
|
||||
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
||||
void __init early_init_devtree(void *params)
|
||||
{
|
||||
void *alloc;
|
||||
|
@ -544,11 +544,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
memblock_add(base, size);
|
||||
}
|
||||
|
||||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/initrd.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_fdt.h>
|
||||
@ -700,6 +701,17 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HAVE_MEMBLOCK
|
||||
/*
|
||||
* called from unflatten_device_tree() to bootstrap devicetree itself
|
||||
* Architectures can override this definition if memblock isn't used
|
||||
*/
|
||||
void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return __va(memblock_alloc(size, align));
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* unflatten_device_tree - create tree of device_nodes from flat blob
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user