diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2019-08-19 16:23:06 +0200 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-08-23 15:47:05 +0200 |
commit | 6cda3a5e002f90e6ccce9ed8fb076fe28ae4ef3b (patch) | |
tree | 465503a81318113401a89c28f0bb0f5c84728c6e /arch | |
parent | irqchip/irq-ingenic-tcu: Fix COMPILE_TEST building (diff) | |
download | linux-6cda3a5e002f90e6ccce9ed8fb076fe28ae4ef3b.tar.xz linux-6cda3a5e002f90e6ccce9ed8fb076fe28ae4ef3b.zip |
MIPS: OCTEON: Drop boot_mem_map
Replace walk through boot_mem_map with for_each_memblock.
And remove the check of total boot_mem_map.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: yasha.che3@gmail.com
Cc: aurelien@aurel32.net
Cc: sfr@canb.auug.org.au
Cc: fancer.lancer@gmail.com
Cc: matt.redfearn@mips.com
Cc: chenhc@lemote.com
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/cavium-octeon/dma-octeon.c | 17 | ||||
-rw-r--r-- | arch/mips/cavium-octeon/setup.c | 3 |
2 files changed, 8 insertions, 12 deletions
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c index 11d5a4e90736..72f24a4db099 100644 --- a/arch/mips/cavium-octeon/dma-octeon.c +++ b/arch/mips/cavium-octeon/dma-octeon.c @@ -16,6 +16,7 @@ #include <linux/types.h> #include <linux/init.h> #include <linux/mm.h> +#include <linux/memblock.h> #include <asm/bootinfo.h> @@ -190,7 +191,7 @@ char *octeon_swiotlb; void __init plat_swiotlb_setup(void) { - int i; + struct memblock_region *mem; phys_addr_t max_addr; phys_addr_t addr_size; size_t swiotlbsize; @@ -199,19 +200,15 @@ void __init plat_swiotlb_setup(void) max_addr = 0; addr_size = 0; - for (i = 0 ; i < boot_mem_map.nr_map; i++) { - struct boot_mem_map_entry *e = &boot_mem_map.map[i]; - if (e->type != BOOT_MEM_RAM && e->type != BOOT_MEM_INIT_RAM) - continue; - + for_each_memblock(memory, mem) { /* These addresses map low for PCI. */ - if (e->addr > 0x410000000ull && !OCTEON_IS_OCTEON2()) + if (mem->base > 0x410000000ull && !OCTEON_IS_OCTEON2()) continue; - addr_size += e->size; + addr_size += mem->size; - if (max_addr < e->addr + e->size) - max_addr = e->addr + e->size; + if (max_addr < mem->base + mem->size) + max_addr = mem->base + mem->size; } diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 8bf43c5a7bc7..95034bf5ca83 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c @@ -1007,8 +1007,7 @@ void __init plat_mem_setup(void) * regions next to each other. */ cvmx_bootmem_lock(); - while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX) - && (total < max_memory)) { + while (total < max_memory) { memory = cvmx_bootmem_phy_alloc(mem_alloc_size, __pa_symbol(&_end), -1, 0x100000, |