Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61e0cae8 authored by Laura Abbott's avatar Laura Abbott
Browse files

arm: Get rid of meminfo



memblock is now fully integrated into the kernel and is the prefered
method for tracking memory. Rather than reinvent the wheel with
meminfo, migrate to using memblock directly instead of meminfo as
an intermediate.

Change-Id: I9d04e636f43bf939e13b4934dc23da0c076811d2
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 36ba7ff2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include <linux/reboot.h>

struct tag;
struct meminfo;
struct pt_regs;
struct smp_operations;
#ifdef CONFIG_SMP
@@ -42,8 +41,7 @@ struct machine_desc {
	unsigned char		reserve_lp2 :1;	/* never has lp2	*/
	enum reboot_mode	reboot_mode;	/* default restart mode	*/
	struct smp_operations	*smp;		/* SMP operations	*/
	void			(*fixup)(struct tag *, char **,
					 struct meminfo *);
	void			(*fixup)(struct tag *, char **);
	void			(*reserve)(void);/* reserve mem blocks	*/
	void			(*map_io)(void);/* IO mapping function	*/
	void			(*init_early)(void);
+1 −2
Original line number Diff line number Diff line
#ifndef _ASM_ARM_MEMBLOCK_H
#define _ASM_ARM_MEMBLOCK_H

struct meminfo;
struct machine_desc;

extern void arm_memblock_init(struct meminfo *, struct machine_desc *);
extern void arm_memblock_init(struct machine_desc *);

phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);

+0 −24
Original line number Diff line number Diff line
@@ -26,30 +26,6 @@ static const struct tagtable __tagtable_##fn __tag = { tag, fn }
 */
#define NR_BANKS	CONFIG_ARM_NR_BANKS

struct membank {
	phys_addr_t start;
	phys_addr_t size;
	unsigned int highmem;
};

struct meminfo {
	int nr_banks;
	struct membank bank[NR_BANKS];
};

extern struct meminfo meminfo;

#define for_each_bank(iter,mi)				\
	for (iter = 0; iter < (mi)->nr_banks; iter++)

#define bank_pfn_start(bank)	__phys_to_pfn((bank)->start)
#define bank_pfn_end(bank)	(__phys_to_pfn((bank)->start) + \
						__phys_to_pfn((bank)->size))
#define bank_pfn_size(bank)	((bank)->size >> PAGE_SHIFT)
#define bank_phys_start(bank)	(bank)->start
#define bank_phys_end(bank)	((bank)->start + (bank)->size)
#define bank_phys_size(bank)	(bank)->size

extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
extern void early_print(const char *str, ...);
extern void dump_machine_table(void);
+3 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/fs.h>
#include <linux/root_dev.h>
#include <linux/screen_info.h>
#include <linux/memblock.h>

#include <asm/setup.h>
#include <asm/system_info.h>
@@ -222,10 +223,10 @@ struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer,
	}

	if (mdesc->fixup)
		mdesc->fixup(tags, &from, &meminfo);
		mdesc->fixup(tags, &from);

	if (tags->hdr.tag == ATAG_CORE) {
		if (meminfo.nr_banks != 0)
		if (memblock_phys_mem_size())
			squash_mem_tags(tags);
		save_atags(tags);
		parse_tags(tags);
+0 −17
Original line number Diff line number Diff line
@@ -26,23 +26,6 @@
#include <asm/mach/arch.h>
#include <asm/mach-types.h>

void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
#ifndef CONFIG_ARM_LPAE
	if (base > ((phys_addr_t)~0)) {
		pr_crit("Ignoring memory at 0x%08llx due to lack of LPAE support\n",
			base);
		return;
	}

	if (size > ((phys_addr_t)~0))
		size = ((phys_addr_t)~0);

	/* arm_add_memory() already checks for the case of base + size > 4GB */
#endif
	arm_add_memory(base, size);
}

void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
{
	return alloc_bootmem_align(size, align);
Loading